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

Cullen Rhodes llvmlistbot at llvm.org
Thu Apr 18 00:52:51 PDT 2024


c-rhodes wrote:

> Thanks @c-rhodes . This seems like a very specific use case though.... The possibilities here are too many. For one we shouldnt add a pass for it at all...
> 
> Broadly, I am wondering if we even need to add such one-off patterns in core. If there is a "general framework" to convert from one named op type to another prescriptively that would be a useful infra to have, but a one-off doesnt seem useful and hard to manage.

Thanks for comments @MaheshRavishankar. I can't say for sure this is relevant outside of our use case (SME), but the non-contiguous reads occur at quite a high level (Linalg / Vector) and other targets must face similar issues. To be honest I wasn't sure about this approach or how well it would be received, but this seemed like the simplest option.

I know there's MMT4D and @banach-space has spent a bit of time looking at this but it's a bit more involved and will require some work. I also came across the `CanonicalizeContractMatmulToMMT` pattern in VectorTransforms whilst implementing this pass that was originally in GPU lowerings (+ `CombineTransferReadOpTranspose`) and appears to be solving similar problem, but I've yet to look closely into this.

If some generic targeted named op conversion infra as you suggest would be useful we could look into this.






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


More information about the Mlir-commits mailing list