[Mlir-commits] [mlir] [mlir][linalg] Add patterns to convert matmul to transposed variants (PR #89075)
Oleksandr Alex Zinenko
llvmlistbot at llvm.org
Mon Apr 22 01:57:57 PDT 2024
================
@@ -73,6 +73,21 @@ def ApplyTilingCanonicalizationPatternsOp : Op<Transform_Dialect,
let assemblyFormat = "attr-dict";
}
+def ApplyTransposeMatmulPatternsOp : Op<Transform_Dialect,
+ "apply_patterns.linalg.transpose_matmul",
+ [DeclareOpInterfaceMethods<PatternDescriptorOpInterface>]> {
+ let description = [{
+ Collects patterns to convert Linalg matmul ops to transposed variants.
+
+ By default the A matrix is transposed, set `transpose_a=false` to transpose
+ B matrix.
+ }];
+
+ let arguments = (ins DefaultValuedAttr<BoolAttr, "true">:$transpose_a);
----------------
ftynse wrote:
I find this interface/API highly confusing. `transpose_a = false` reads like we shouldn't be transposing anything at all. How about we have two unit attributes, `transpose_lhs` and `transpose_rhs` that indicate which of the operands we have to transpose? Alternatively, an enum or string attribute specifying which of the operands is transposed.
https://github.com/llvm/llvm-project/pull/89075
More information about the Mlir-commits
mailing list