[Mlir-commits] [mlir] [mlir][linalg] Add pass to transpose matmul op (PR #89075)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Apr 19 11:07:02 PDT 2024


MaheshRavishankar wrote:

We are going in circles here. I understand that this use case is important, and accomodating downstream users is important to me as well. But IMO we need to balance what goes into core and what lives downstream.

First of all, we cant have a pass. Passes in MLIR IMO are mostly for testing. So agreed there we can have a test pass (or as is the norm now a test transform op).

Broadly though, my concern is what are all the shapes of these kind of patterns we want to accomodate, and how to do you manage how these are used.
This is adding `matmul -> transpose + matmul_transpose_a + transpose`
What about `matmul -> transpose + matmul_transpose_b + transpose`
What about reverse of these (which are also reasonable) `transpose + matmul_transpose_b + transpose -> matmul` and other variants. There is no bound to these kind of patterns and no story on how and when to use them. The justifications for all of this depends on downstream use cases, so that is where such patterns should live. I dont see this as a "core infrastructure" to enable building a MLIR based compiler, but rather just a particular use case. 

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


More information about the Mlir-commits mailing list