Skip to content

Commit 79e5629

Browse files
committed
Add comments
1 parent 01f2f3a commit 79e5629

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,6 +1191,7 @@ def PadTilingInterfaceOp : Op<Transform_Dialect, "structured.pad_tiling_interfac
11911191
iteration domain induces a padding of the operands that is consistent
11921192
across the op semantics and, unlike for simple elementwise ops, may not be
11931193
trivially deducible or specifiable on operands only (e.g. convolutions).
1194+
Currently, only a limited set of projected permutation map is supported.
11941195

11951196
The specification of `padding_sizes` follows that of `tile_sizes` during
11961197
tiling: the value "0" on a particular iterator encode "no padding". Like in

mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,13 @@ LogicalResult rewriteAsPaddedOp(RewriterBase &rewriter, LinalgOp opToPad,
601601
/// affine.apply operations.
602602
/// The `indexingMap` + `indexingSizes` encoding suits StructuredOps and
603603
/// provides a gentle portability path for Linalg-like ops with affine maps.
604+
/// The padded shape is computed by evaluating the maximum accessed index per
605+
/// dimension, which may involve multiplying by constant factors derived from
606+
/// the affine indexing expressions. Currently, only a limited set of projected
607+
/// permuation indexing map is supported, such as
608+
/// - affine_map<(d0, d1, d2) -> (d0, d1)>
609+
/// - affine_map<(d0, d1, d2) -> (d0, d1 + d2)>
610+
/// - affine_map<(d0, d1) -> (d0 * 3 + d1)>
604611
/// In the future, more general interfaces can be devised to encode similar
605612
/// shape evolutions and map between an op and its operands.
606613
SmallVector<OpFoldResult>

mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ static int64_t extractConstantMultiplier(AffineExpr expr) {
8585
/// The `indexingMap` + `indexingSizes` encoding suits StructuredOps.
8686
/// The implementaiton below iteratively combines increases from contributing
8787
/// dimensions using affine.apply operations.
88+
/// The padded shape is computed by evaluating the maximum accessed index per
89+
/// dimension, which may involve multiplying by constant factors derived from
90+
/// the affine indexing expressions. Currently, only a limited set of projected
91+
/// permutation indexing map is supported, such as
92+
/// - affine_map<(d0, d1, d2) -> (d0, d1)>
93+
/// - affine_map<(d0, d1, d2) -> (d0, d1 + d2)>
94+
/// - affine_map<(d0, d1) -> (d0 * 3 + d1)>
8895
/// In the future, more general interfaces can be devised to encode similar
8996
/// shape evolutions and map between an op and its operands.
9097
SmallVector<OpFoldResult> linalg::computePaddedShape(

0 commit comments

Comments
 (0)