[Mlir-commits] [mlir] [mlir][linalg][nfc] Update pack-dynamic-inner-tile.mlir (PR #116788)
Javed Absar
llvmlistbot at llvm.org
Tue Nov 19 04:58:54 PST 2024
================
@@ -84,12 +82,30 @@ func.func private @pack(%A: tensor<7x16xi32>) {
}
module @transforms attributes { transform.with_named_sequence } {
- transform.named_sequence @__transform_main(%module: !transform.any_op {transform.readonly}) {
+ transform.named_sequence @__transform_main(%module: !transform.any_op {transform.consume}) {
%pack = transform.structured.match ops{["tensor.pack"]} in %module : (!transform.any_op) -> !transform.any_op
- %tiled_linalg_op_p, %loops:2 = transform.structured.tile_using_for %pack tile_sizes [1, 1]
+ // 1. Tile so that we can decompose tensor.pack into tensor.pad,
+ // linalg.transpose, etc (see step 2).
----------------
javedabsar1 wrote:
I got this from LinalgTransformOps.td which answered my doubt.
`Rewrite a tensor.pack into tensor.pad + tensor.expand_shape + linalg.transpose.`
This removes need for ambigious `inalg.transpose, etc (see step 2).`
I dont know if its too much to ask and they may be test example elsewhere , but what does
```
%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>
%A_cast = tensor.cast %A_pack : tensor<?x16x?x1xi32> to tensor<*xi32>
```
is expected to become ... even in scant mode as comment would be super.
https://github.com/llvm/llvm-project/pull/116788
More information about the Mlir-commits
mailing list