[Mlir-commits] [mlir] [mlir][linalg] Pack matmul pass (PR #89782)

Adam Siemieniuk llvmlistbot at llvm.org
Wed Apr 24 03:31:20 PDT 2024


adam-smnk wrote:

> I think this pass may not be general enough for a broader audience . It limits the usage to linalg.matmul/linalg.batch_matmul ops (without any linalg.generic variants) and fixes the innerPerm/outerPerm to {1, 0}.

I'll start with generalizing and exposing the API as Mahesh suggested. But I think there's still value in providing tools for the well defined named ops. Patterns for common linalg.generic variants could be added later too. But if you need to go with truly generic representations, you probably need custom logic anyway.

> On the other hand, this pass looks like a wrapper for packMatmulGreedily and packTranspose methods but has a rather narrow scope.

The aim is not necessarily to create a fully generic infrastructure. After all there are existing tools for that. Although, if we find enough common patterns then even better.
I'd say the main motivation here is to add a transformation that provides benefit in many common cases. Perhaps, it is still too narrow and/or I haven't considered enough use cases to judge that properly.

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


More information about the Mlir-commits mailing list