[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:56 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);
+
+  let assemblyFormat = "(`transpose_a` `=` $transpose_a^)? attr-dict";
----------------
ftynse wrote:

Nit: can we just keep this as part of `attr-dict`? I don't see a significant improvement between `apply_patterns.transpose_matmul transpose_a = true` and `apply_patterns.transpose_matmul {transpose_a = true}`.

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


More information about the Mlir-commits mailing list