[Mlir-commits] [mlir] [mlir][linalg][nfc] Update "pack-dynamic-inner-tile.mlir" (PR #117533)

Han-Chung Wang llvmlistbot at llvm.org
Mon Nov 25 09:54:43 PST 2024


================
@@ -89,26 +85,49 @@ module @transforms attributes { transform.with_named_sequence } {
     %tiled_pack_op_p, %loops:2 = transform.structured.tile_using_for %pack tile_sizes [1, 1]
        : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
 
-    // 2. Decompose the tiled Op into (trimmed for brevity):
+    // 2. Decompose the tiled pack Op into (trimmed for brevity):
     //
     //  %padded = tensor.pad %slice_of_A (..) :
     //      tensor<?x?xi32> to tensor<8x1xi32>
     //  %inserted_slice = tensor.insert_slice %padded into %slice_of_A_pack (...) :
     //      tensor<8x1xi32> into tensor<1x1x?x1xi32>
     //
-    // NOTE: no tile is transposed, hence no linalg.transpose
-    %func_1 = transform.get_parent_op %tiled_pack_op_p {isolated_from_above} : (!transform.any_op) -> !transform.any_op
-    transform.apply_patterns to %func_1 {
+    // (NOTE: no tile is transposed, hence no linalg.transpose)
----------------
hanhanW wrote:

Is it because the pack op is decomposed with rank-reduced slices + outer_dims_perm map is empty/identity? Otherwise, I'd expect a transpose op that transposes the inner dimension of the first dimension into inner tiles.

E.g., it should be `tensor<?x?x16x1>` after expanding the  padded tensor, so I'd expect a transpose to bring it to `tensor<?x16x?x1>`.

```
  %A_pack = tensor.pack %A
    padding_value(%pad_val : i32)
    inner_dims_pos = [0, 1]
    inner_tiles = [%tile_size, 1]
    into %A_pack_empty : tensor<7x16xi32> -> tensor<?x16x?x1xi32>
```

https://github.com/llvm/llvm-project/pull/117533


More information about the Mlir-commits mailing list