[Mlir-commits] [mlir] [mlir][linalg] Add support for scalable vectorization of `linalg.batch_mmt4d` (PR #152984)

Andrzej Warzyński llvmlistbot at llvm.org
Thu Aug 14 03:06:48 PDT 2025


banach-space wrote:

> In the future, it would be good to know what's the cost of representing `mmt4d` and `batch_mmt4d` as variations on `contract`, so that we can make them as _specializations_ like we did with the transpose variants.

Why specialization of `linalg.contract`? 

For the transpose variants that was straightforward - we were just dealing with different variants of `linalg.matmul` and were creating specialisation of that. But with MMT4D, it's less obvious to me. I guess you'd like to see us converging towards the Linalg tree that you proposed:
* https://discourse.llvm.org/t/rfc-mlir-linalg-operation-tree/83586

? So the specialisation tree would be like this:
* `linalg.contract` -> `linalg.matmul` -> `linalg.matmul_transpose_a` (2 specializations)
* `linalg.contract` -> `linalg.matmul` -> `linalg.matmul_transpose_b` (2 specializations)
* `linalg.contract` -> `linalg.mmt4d` (1 specialization)
* `linalg.contract` -> `linalg.batch_mmt4d`  (1 specialization)

Just making sure that I understand what you meant 😅 

@egebeysel , IIUC, you were thinking of `vector.contract` rather than the Linalg Op Tree? :) 

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


More information about the Mlir-commits mailing list