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

Han-Chung Wang llvmlistbot at llvm.org
Mon Nov 25 10:36:32 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:

Yes, I understood this part. There are few ways to decompose pack ops. We can either drop or not drop unit dims during the decomposition. I think I got the answer in the above transform op. We firstly tile outer dims with tile_size=1, and the outer dimensions all have size=1. Then we decompose the ops. In the decomposition, we use patterns that drop outer unit dims, so there are no transpose ops.  So I can connect all the pieces now, thanks!

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


More information about the Mlir-commits mailing list