Skip to content

Commit 80e1735

Browse files
committed
[mlir] assorted fixes in transform dialect documentation
Various typos and formatting fixes that make the generated documentation hard to follow.
1 parent d1e9d0b commit 80e1735

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def DecomposeOp : Op<Transform_Dialect, "structured.decompose",
2424
(depthwise) convolutions, into combinations of lower-dimensional equivalents
2525
when possible.
2626

27-
Return modes:
28-
=============
27+
#### Return modes
28+
2929
This operation ignores non-Linalg ops and drops them in the return.
3030
If all the operations referred to by the `target` PDLOperation decompose
3131
properly, the transform succeeds. Otherwise the transform silently fails.
@@ -68,11 +68,11 @@ def GeneralizeOp : Op<Transform_Dialect, "structured.generalize",
6868
[FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
6969
TransformOpInterface, TransformEachOpTrait]> {
7070
let description = [{
71-
Transforms a named structued operation into the generic form with the
71+
Transforms a named structured operation into the generic form with the
7272
explicit attached region.
7373

74-
Return modes:
75-
=============
74+
#### Return modes
75+
7676
This operation ignores non-Linalg ops and drops them in the return.
7777
If all the operations referred to by the `target` PDLOperation generalize
7878
properly, the transform succeeds. Otherwise the transform silently fails.
@@ -100,8 +100,8 @@ def InterchangeOp : Op<Transform_Dialect, "structured.interchange",
100100
Interchanges the iterators of the operations pointed to by the target handle
101101
using the iterator interchange attribute.
102102

103-
Return modes:
104-
=============
103+
#### Return modes
104+
105105
This operation ignores non-linalg::Generic ops and drops them in the return.
106106
This operation fails if the interchange attribute is invalid.
107107
If all the operations referred to by the `target` PDLOperation interchange
@@ -134,8 +134,8 @@ def PadOp : Op<Transform_Dialect, "structured.pad",
134134
Pads the operations pointed to by the target handle using the options
135135
provides as operation attributes.
136136

137-
Return modes:
138-
=============
137+
#### Return modes
138+
139139
This operation ignores non-Linalg ops and drops them in the return.
140140
This operation may produce a definiteFailure if the padding fails for any
141141
reason.
@@ -174,8 +174,8 @@ def ScalarizeOp : Op<Transform_Dialect, "structured.scalarize",
174174
Indicates that ops of a specific kind in the given function should be
175175
scalarized (i.e. their dynamic dimensions tiled by 1).
176176

177-
Return modes:
178-
=============
177+
#### Return modes:
178+
179179
This operation ignores non-Linalg ops and drops them in the return.
180180
This operation produces `definiteFailure` if the scalarization fails for any
181181
reason.
@@ -259,8 +259,8 @@ def SplitReductionOp : Op<Transform_Dialect, "structured.split_reduction",
259259
- use_alloc: whether to use an alloc op to allocate the temporary
260260
tensor (default: do not use alloc op)
261261

262-
Return modes:
263-
=============
262+
#### Return modes
263+
264264
This operation ignores non-Linalg ops and drops them in the return.
265265
This operation produces `definiteFailure` if the splitting fails for any
266266
reason.
@@ -275,8 +275,8 @@ def SplitReductionOp : Op<Transform_Dialect, "structured.split_reduction",
275275
- the split op and
276276
- the result-combining op.
277277

278-
Example (default: use_scaling_algorithm = false, use_alloc = false):
279-
====================================================================
278+
#### Example (default: `use_scaling_algorithm = false, use_alloc = false`):
279+
280280
```
281281
%r = linalg.generic {indexing_maps = [affine_map<(d0) -> (d0)>,
282282
affine_map<(d0) -> ()>],
@@ -314,8 +314,8 @@ def SplitReductionOp : Op<Transform_Dialect, "structured.split_reduction",
314314
} -> tensor<f32>
315315
```
316316

317-
Example (use_scaling_algorithm = true, use_alloc = true):
318-
=========================================================
317+
#### Example (`use_scaling_algorithm = true, use_alloc = true`):
318+
319319
Instead of introducing an ExpandShapeOp, this scaling-based implementation
320320
rewrites a reduction dimension `k` into `k * split_factor + kk`.
321321
The dimension `kk` is added as an extra parallel dimension to the
@@ -329,7 +329,7 @@ def SplitReductionOp : Op<Transform_Dialect, "structured.split_reduction",
329329
b. O(i, j) += O_i(kk, i, j)
330330
The intermediate tensor O_i is of shape (128/16)x3x5 == 8x3x5.
331331

332-
Example:
332+
#### Example:
333333

334334
```
335335
%0 = linalg.matmul ins(%A, %B: tensor<16x256xf32>, tensor<256x32xf32>)
@@ -439,8 +439,8 @@ def VectorizeOp : Op<Transform_Dialect, "structured.vectorize",
439439
Note that this transformation is invalidating the handles to any payload IR
440440
operation that is contained inside the vectorization target.
441441

442-
Return modes:
443-
=============
442+
#### Return modes:
443+
444444
This operation produces `definiteFailure` if vectorization fails for any
445445
reason.
446446
The operation always returns the handle to the target op that is expected

mlir/include/mlir/Dialect/SCF/TransformOps/SCFTransformOps.td

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ def LoopPeelOp : Op<Transform_Dialect, "loop.peel",
7373
In the absence of sufficient static information, this op may peel a loop,
7474
even if the step always divides the range evenly at runtime.
7575

76-
Return modes:
77-
=============
76+
#### Return modes
77+
7878
This operation ignores non-scf::ForOp ops and drops them in the return.
7979

8080
This operation always succeeds and returns the scf::ForOp with the
@@ -122,8 +122,8 @@ def LoopPipelineOp : Op<Transform_Dialect, "loop.pipeline",
122122
arguments. Currently supports memref and vector transfer operations as
123123
memory reads/writes.
124124

125-
Return modes:
126-
=============
125+
#### Return modes
126+
127127
This operation ignores non-scf::For ops and drops them in the return.
128128
If all the operations referred to by the `target` PDLOperation pipeline
129129
properly, the transform succeeds. Otherwise the transform silently fails.
@@ -155,8 +155,8 @@ def LoopUnrollOp : Op<Transform_Dialect, "loop.unroll",
155155
number of loop body copies per iteration. If the unroll factor is larger
156156
than the loop trip count, the latter is used as the unroll factor instead.
157157

158-
Return modes:
159-
==============
158+
#### Return modes
159+
160160
This operation ignores non-scf::For ops and drops them in the return.
161161
If all the operations referred to by the `target` PDLOperation unroll
162162
properly, the transform succeeds. Otherwise the transform silently fails.

mlir/include/mlir/Dialect/Transform/IR/TransformOps.td

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def AlternativesOp : TransformDialectOp<"alternatives",
3838
"alternatives" transformation fails.
3939

4040
It is up to the nested operations to define which errors are "recoverable"
41-
(or "silencable") and allow another alternatives to be attempted, and which
41+
(or "silenceable") and allow another alternatives to be attempted, and which
4242
errors should be propagated without attempting the other alternatives.
4343

4444
The single operand of this operation is the scope in which the alternative
@@ -51,7 +51,7 @@ def AlternativesOp : TransformDialectOp<"alternatives",
5151
irrecoverable error and thus abort the execution without attempting the
5252
remaining alternatives. Note that the payload IR outside of the given scope
5353
is not necessarily in the valid state, or even accessible to the
54-
tranfsormation.
54+
transformation.
5555

5656
The changes to the IR within the scope performed by transforms in the failed
5757
alternative region are reverted before attempting the next region.
@@ -79,7 +79,7 @@ def AlternativesOp : TransformDialectOp<"alternatives",
7979
transform.yield %0 : !pdl.operation
8080
}, {
8181
^bb0(%arg0: !pdl.operation):
82-
// Otherwise, the second alternative is tried and it always succeeeds by
82+
// Otherwise, the second alternative is tried and it always succeeds by
8383
// returning the original handle.
8484
transform.yield %arg0 : !pdl.operation
8585
}
@@ -106,8 +106,8 @@ def GetClosestIsolatedParentOp : TransformDialectOp<"get_closest_isolated_parent
106106
there usually is a top-level ModuleOp), the transformation is considered to
107107
have failed.
108108

109-
Ancestor ops follow the same order as the ops assocaited with the
110-
operand, except for potential duplicates (multiple Payload IR ops assocaited
109+
Ancestor ops follow the same order as the ops associated with the
110+
operand, except for potential duplicates (multiple Payload IR ops associated
111111
with the operand have the same parent) for which the ancestor will only be
112112
listed once for the first time it occurs. For example, given the list
113113
"(childof(A), childof(B), childof(B), childof(A), childof(B))", the
@@ -154,11 +154,11 @@ def PDLMatchOp : TransformDialectOp<"pdl_match",
154154
Produces a Transform IR value associated with the list of Payload IR ops
155155
that matched the pattern. The order of results in the list is that of the
156156
Operation::walk, clients are advised not to rely on a specific order though.
157-
If the operand is assocaited with multiple Payload IR ops, finds matching
157+
If the operand is associated with multiple Payload IR ops, finds matching
158158
ops nested within each of those and produces a single list containing all
159159
of the matched ops.
160160

161-
The tranfsormation is considered successful regardless of whether some
161+
The transformation is considered successful regardless of whether some
162162
Payload IR ops actually matched the pattern and only fails if the pattern
163163
could not be looked up or compiled.
164164
}];
@@ -312,7 +312,7 @@ def YieldOp : TransformDialectOp<"yield", [Terminator]> {
312312
}];
313313

314314
let arguments = (ins
315-
Arg<Variadic<AnyType>, "Opration handles yielded back to the parent",
315+
Arg<Variadic<AnyType>, "Operation handles yielded back to the parent",
316316
[TransformMappingRead]>:$operands);
317317
let assemblyFormat = "operands attr-dict (`:` type($operands)^)?";
318318

0 commit comments

Comments
 (0)