[Mlir-commits] [mlir] [MLIR][Linalg] Introduce broadcast/transpose semantic to 'linalg.batc… (PR #122275)
Md Asghar Ahmad Shahid
llvmlistbot at llvm.org
Thu Jan 9 21:11:55 PST 2025
================
@@ -3450,6 +3467,46 @@ static LogicalResult verifyExtendedMatmulSemantic(MatmulOp matmulOp,
return success();
}
+/// Checks if the given AffineMap represents a valid batch dimension.
+/// It checks if the first result dimension is a function of the first
+/// dimension.
+static bool isValidBatchDim(AffineMap bcastMap) {
+ assert(bcastMap.getNumResults() == 3 && "Expected three result dim expr.");
----------------
shahidact wrote:
The assert would be raised for this kind of LHS map "affine_map<(d0, d1, d2, d3) -> (d0, d1, d3, d3)>". I cannot return "False" for this case. The invariant here is that for batch matmul, number of result dims should not exceed 3.
https://github.com/llvm/llvm-project/pull/122275
More information about the Mlir-commits
mailing list