[Mlir-commits] [mlir] [MLIR][Linalg] Introduce transpose/broadcast semantic to linalg.batch… (PR #130944)

Md Asghar Ahmad Shahid llvmlistbot at llvm.org
Wed Apr 30 22:29:05 PDT 2025


================
@@ -690,34 +690,32 @@ def MatmulOp : LinalgStructuredBase_Op<"matmul", [
 
     Example Transpose:
     ```mlir
-    linalg.matmul indexing_maps = [
-                   affine_map<(d0, d1, d2) -> (d2, d0)>, // transpose
-                   affine_map<(d0, d1, d2) -> (d2, d1)>,
-                   affine_map<(d0, d1, d2) -> (d0, d1)>
-                   ]
-                   ins(%arg0, %arg1 : memref<5x3xf32>,memref<5x7xf32>)
-                   outs(%arg2: memref<3x7xf32>)
+    linalg.matmul
----------------
shahidact wrote:

> Would it be better to upfront mention `each map can be a projected-permutation (simple transpose or broadcast, or mix of two) as long as the dimensions are application of the map match the semantics of batch_matmul`

Do you mean to update the description as below?

`Broadcast and Transpose semantics can be applied by specifying the explicit projected permutation map using attribute 'indexing_maps' as shown below.`

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


More information about the Mlir-commits mailing list