- Note: This only works if untiled dims are static. Otherwise we need to change the semantics of PadOp to accept [%size...] attributes.
Details
- Reviewers
nicolasvasilache mravishankar hanchung
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp | ||
---|---|---|
276–277 | This revision breaks this invariant, why ? | |
mlir/test/Dialect/Linalg/tile-and-pad-tensors.mlir | ||
46 | This does not check = instead of -. | |
mlir/test/lib/Transforms/TestLinalgTransforms.cpp | ||
87 | tile-sizes is a bit too generic for this very specialized test. |
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp | ||
---|---|---|
276–277 | To alter the marker in any case otherwise this pattern will be stuck in in an infinite loop of tile -> pad -> fail -> tile -> pad -> fail -> ... | |
mlir/test/lib/Transforms/TestLinalgTransforms.cpp | ||
87 | make sense! will change the name in the next revision |
Otherwise we need to change the semantics of PadOp to accept [%size...] attributes.
I think the pad op can accept [%size ...] ? See https://github.com/llvm/llvm-project/blob/main/mlir/test/Dialect/Linalg/roundtrip.mlir#L30-L37
func @pad_dynamic(%arg0: tensor<1x2x2x?xf32>, %low: index, %high: index, %pad_value: f32) -> tensor<6x?x?x?xf32> { %0 = linalg.pad_tensor %arg0 low[2, %low, 3, 3] high[3, 3, %high, 2] { ^bb0(%arg1: index, %arg2: index, %arg3: index, %arg4: index): linalg.yield %pad_value : f32 } : tensor<1x2x2x?xf32> to tensor<6x?x?x?xf32> return %0 : tensor<6x?x?x?xf32> }
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp | ||
---|---|---|
276–277 | Ok, then this deserves a separate commit and a test case that exhibits the behavior, independently of your current CL (which is otherwise good to go from my perspective). |
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp | ||
---|---|---|
276–277 | done in https://reviews.llvm.org/D97720, retire this diff now.. |
This revision breaks this invariant, why ?