Skip to content

Commit baa39b7

Browse files
committed
[mlir] fix wording in transform dialect docs
The wording "fails silently" has been sometimes used to indicate that a silenceable failure was emitted by the operation. The meaning is exactly the opposite: silenceable failure is _not_ silent unless silenced.
1 parent 588802a commit baa39b7

File tree

3 files changed

+79
-71
lines changed

3 files changed

+79
-71
lines changed

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

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ def DecomposeOp : Op<Transform_Dialect, "structured.decompose",
186186

187187
This operation ignores non-Linalg ops and drops them in the return.
188188
If all the operations referred to by the `target` handle decompose
189-
properly, the transform succeeds. Otherwise the transform silently fails.
190-
The return handle points to only the subset of successfully produced
191-
computational operations, which can be empty.
189+
properly, the transform succeeds. Otherwise the transform produces a
190+
silenceable failure. The return handle points to only the subset of
191+
successfully produced computational operations, which can be empty.
192192
}];
193193

194194
let arguments = (ins TransformHandleTypeInterface:$target);
@@ -336,11 +336,11 @@ def FuseIntoContainingOp :
336336

337337
#### Return modes
338338

339-
If at least one producer could not be fused, this operation fails silently.
340-
This is the case when tiling fails or when no producer op could be found
341-
among the remaining producers that has at least one use within the
342-
containing op. I.e., "producers" that are not consumed within the containing
343-
op are rejected by this operation.
339+
If at least one producer could not be fused, this operation produces a
340+
silenceable failure. This is the case when tiling fails or when no
341+
producer op could be found among the remaining producers that has at least
342+
one use within the containing op. I.e., "producers" that are not consumed
343+
within the containing op are rejected by this operation.
344344

345345
This operation consumes the producer handle.
346346
This operation only reads the containing op handle.
@@ -374,10 +374,10 @@ def GeneralizeOp : Op<Transform_Dialect, "structured.generalize",
374374

375375
This operation ignores non-Linalg ops and drops them in the return.
376376
If all the operations referred to by the `target` handle generalize
377-
properly, the transform succeeds. Otherwise the transform silently fails.
378-
The return handle points to only the subset of successfully produced
379-
equivalent generic operations, which can be empty or contain the original
380-
ops if they were already in generic form.
377+
properly, the transform succeeds. Otherwise the transform produces a
378+
silenceable failure. The return handle points to only the subset of
379+
successfully produced equivalent generic operations, which can be empty or
380+
contain the original ops if they were already in generic form.
381381
}];
382382

383383
let arguments = (ins TransformHandleTypeInterface:$target);
@@ -450,7 +450,7 @@ def InterchangeOp : Op<Transform_Dialect, "structured.interchange",
450450
This operation fails if the interchange attribute is invalid.
451451
If all the operations referred to by the `target` handle interchange
452452
properly, the transform succeeds.
453-
If any interchange fails, the transform definitely fails.
453+
If any interchange fails, the transform produces a definite failure.
454454
The return handle points to only the subset of successfully produced
455455
interchanged operations, which can be empty.
456456
}];
@@ -492,7 +492,7 @@ def LowerPackOp : Op<Transform_Dialect, "structured.lower_pack", [
492492
#### Return modes
493493

494494
This operation ignores non-pack ops and drops them in the return.
495-
This operation produces a silenceableFailure if the rewrite fails for any
495+
This operation produces a silenceable failure if the rewrite fails for any
496496
reason.
497497
If all the operations referred to by the `target` are rewritten, the
498498
transform succeeds.
@@ -532,7 +532,7 @@ def LowerUnPackOp : Op<Transform_Dialect, "structured.lower_unpack", [
532532
#### Return modes
533533

534534
This operation ignores non-unpack ops and drops them in the return.
535-
This operation produces a silenceableFailure if the rewrite fails for any
535+
This operation produces a silenceable failure if the rewrite fails for any
536536
reason.
537537
If all the operations referred to by the `target` are rewritten, the
538538
transform succeeds.
@@ -770,7 +770,7 @@ def PackOp : Op<Transform_Dialect, "structured.pack", [
770770
#### Return modes
771771

772772
This operation applies to a single Linalg op, otherwise it fails.
773-
This operation may produce a definiteFailure if the packing fails for any
773+
This operation may produce a definite failure if the packing fails for any
774774
reason.
775775

776776
The returned handle point to the packed LinalgOp.
@@ -997,11 +997,12 @@ def PadOp : Op<Transform_Dialect, "structured.pad",
997997
#### Return modes
998998

999999
This operation ignores non-Linalg ops and drops them in the return.
1000-
This operation may produce a definiteFailure if the padding fails for any
1000+
This operation may produce a definite failure if the padding fails for any
10011001
reason.
10021002

10031003
If all the operations referred to by the `target` handle pad
1004-
properly, the transform succeeds. Otherwise the transform silently fails.
1004+
properly, the transform succeeds. Otherwise the transform produces a
1005+
silenceable failure.
10051006
The return handle points to only the subset of successfully produced
10061007
padded operations, which can be empty.
10071008
}];
@@ -1114,7 +1115,7 @@ def HoistPadOp : Op<Transform_Dialect, "structured.hoist_pad",
11141115
If any non-tensor.pad is passed, the transform emits a silenceable failure.
11151116

11161117
If all the operations referred to by the `target` handle padproperly, the
1117-
transform succeeds. Otherwise the transform silently fails.
1118+
transform succeeds. Otherwise the transform produces a silenceable failure.
11181119

11191120
The return handle points to only the subset of successfully hoisted
11201121
tensor.pad operations, which can be empty.
@@ -1240,10 +1241,11 @@ def ScalarizeOp : Op<Transform_Dialect, "structured.scalarize",
12401241
#### Return modes:
12411242

12421243
This operation ignores non-Linalg ops and drops them in the return.
1243-
This operation produces `definiteFailure` if the scalarization fails for any
1244+
This operation produces definite failure if the scalarization fails for any
12441245
reason.
12451246
If all the operations referred to by the `target` handle scalarize
1246-
properly, the transform succeeds. Otherwise the transform silently fails.
1247+
properly, the transform succeeds. Otherwise the transform produces a
1248+
silenceable failure.
12471249

12481250
The return handle points to only the subset of successfully produced
12491251
tiled-by-1 operations, which can be empty.
@@ -1351,7 +1353,8 @@ def RewriteInDestinationPassingStyleOp : Op<
13511353

13521354
This operation ignores non-unsupported ops and drops them from the return.
13531355
If all the operations referred to by the `target` handle generalize
1354-
properly, the transform succeeds. Otherwise the transform silently fails.
1356+
properly, the transform succeeds. Otherwise the transform produces a
1357+
silenceable failure.
13551358
The return handle points to a subset of successfully produced operations:
13561359
- `tensor.pad` case, the returned handle points to the tensor.insert_slice.
13571360
- `tensor.generate` case, the returned handle points to the linalg.generic.
@@ -1444,13 +1447,13 @@ def SplitReductionOp : Op<Transform_Dialect, "structured.split_reduction",
14441447
#### Return modes
14451448

14461449
This operation ignores non-Linalg ops and drops them in the return.
1447-
This operation produces `definiteFailure` if the splitting fails for any
1450+
This operation produces a definite failure if the splitting fails for any
14481451
reason.
14491452

14501453
If all the operations referred to by the `target` handle split
1451-
properly, the transform succeeds. Otherwise the transform silently fails.
1452-
The 4 returned handles points to only the subset of successfully produced
1453-
computational operations, which can all be empty.
1454+
properly, the transform succeeds. Otherwise the transform produces a
1455+
silenceable failure. The 4 returned handles points to only the subset of
1456+
successfully produced computational operations, which can all be empty.
14541457
This 4 returned handles point to:
14551458
- the init op (or tensor_alloc op if use_alloc = true),
14561459
- the fill op used to initialize the neutral element,
@@ -1910,7 +1913,7 @@ def TileUsingForallOp :
19101913
Tiling is applied by either specifying `num_threads` or `tile_size`. If
19111914
`num_threads` is specified, then the tile size for each dimension `i` is
19121915
calculated dynamically via `ceilDiv(dimSize[i], num_threads[i])`.
1913-
`num_threads` and `tile_size` can be either static index attributes or
1916+
`num_threads` and `tile_size` can be either static index attributes or
19141917
operation handles (or a mix thereof). Operation handles must be mapped to
19151918
exactly one op that has exactly one result of index type.
19161919

@@ -1935,7 +1938,7 @@ def TileUsingForallOp :
19351938

19361939
If all the operations referred to by the `target` handle tile
19371940
successfully, the transform succeeds.
1938-
Otherwise the transform silently fails.
1941+
Otherwise the transform produces a silenceable failure.
19391942

19401943
The two returned handles point to only the subset of successfully produced
19411944
tiled operations, which can all be empty.
@@ -2066,7 +2069,7 @@ def VectorizeChildrenAndApplyPatternsOp :
20662069

20672070
#### Return modes:
20682071

2069-
This operation produces `definiteFailure` if vectorization fails for any
2072+
This operation produces a definite failure if vectorization fails for any
20702073
reason.
20712074
The operation always returns the handle to the target op that is expected
20722075
to be isolated from above.
@@ -2103,7 +2106,7 @@ def VectorizeOp : Op<Transform_Dialect, "structured.vectorize",
21032106
[DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
21042107
TransformOpInterface, ReportTrackingListenerFailuresOpTrait]> {
21052108
let description = [{
2106-
Vectorize the target ops, which must be Linalg ops.
2109+
Vectorize the target ops, which must be Linalg ops.
21072110

21082111
Use the optional vector sizes to specify exactly what configuration the
21092112
vectorizer should use. It will then use masked vectors of the specified
@@ -2133,7 +2136,7 @@ def VectorizeOp : Op<Transform_Dialect, "structured.vectorize",
21332136
This operation produces a silenceable failure if at least one target op is
21342137
not a Linalg op or fails to vectorize. It produces a definite failure if
21352138
the dynamic vector sizes (SSA values) do not satisfy the constraints
2136-
mentioned above.
2139+
mentioned above.
21372140
}];
21382141

21392142
let arguments = (ins TransformHandleTypeInterface:$target,

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ def LoopPipelineOp : Op<Transform_Dialect, "loop.pipeline",
177177

178178
This operation ignores non-scf::For ops and drops them in the return.
179179
If all the operations referred to by the `target` PDLOperation pipeline
180-
properly, the transform succeeds. Otherwise the transform silently fails.
181-
The return handle points to only the subset of successfully produced
182-
pipelined loops, which can be empty.
180+
properly, the transform succeeds. Otherwise the transform produces a
181+
silenceable failure. The return handle points to only the subset of
182+
successfully produced pipelined loops, which can be empty.
183183
}];
184184

185185
let arguments = (ins Transform_ScfForOp:$target,
@@ -240,10 +240,10 @@ def LoopUnrollOp : Op<Transform_Dialect, "loop.unroll",
240240

241241
#### Return modes
242242

243-
This operation ignores non-scf::For, non-affine::For ops and drops them in
244-
the return. If all the operations referred to by the `target` PDLOperation
245-
unroll properly, the transform succeeds. Otherwise the transform silently
246-
fails.
243+
This operation ignores non-`scf.for`, non-`affine.for` ops and drops them
244+
in the return. If all the operations referred to by the `target` operand
245+
unroll properly, the transform succeeds. Otherwise the transform produces a
246+
silencebale failure.
247247

248248
Does not return handles as the operation may result in the loop being
249249
removed after a full unrolling.

0 commit comments

Comments
 (0)