[Mlir-commits] [mlir] [mlir][tensor] Add new helper hooks for RelayoutOp (PR #109642)

Adam Siemieniuk llvmlistbot at llvm.org
Mon Sep 23 07:33:11 PDT 2024


================
@@ -3987,6 +3987,17 @@ SmallVector<int64_t> PackOp::getStaticTiles() {
   return getStaticTilesImpl(*this);
 }
 
+SmallVector<int64_t> PackOp::getTiledOuterDims() {
+  auto innerDimsPos = getInnerDimsPos();
----------------
adam-smnk wrote:

My first instinct is to get the same answers from `getAllOuterDims` and `getTiledOuterDims` for:
```
%packed = tensor.pack %arg0 outer_dims_perm = [1, 0]
    inner_dims_pos = [1, 0] inner_tiles = [8, 16]
    into %e : tensor<32x128xf32> -> tensor<16x2x8x16xf32>
```
which is not the case right now.

At the same time, I'm not certain that complicating this util with all permutation magic is worth it.
So, maybe at least some comment at the API to avoid surprises?

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


More information about the Mlir-commits mailing list