[Mlir-commits] [mlir] [mlir][linalg] Introduce transpose semantic to 'linalg.matmul' ops. (PR #104783)
Md Asghar Ahmad Shahid
llvmlistbot at llvm.org
Wed Oct 9 22:26:01 PDT 2024
================
@@ -1172,19 +1240,26 @@ LogicalResult mlir::linalg::detail::verifyStructuredOpInterface(Operation *op) {
// Domain must be consistent.
unsigned numLoops = linalgOp.getNumLoops();
- if (indexingMap.getNumDims() != numLoops)
+ if (!isUserDefinedSemantic && indexingMap.getNumDims() != numLoops)
return op->emitOpError("expected indexing_map #")
<< opOperand.getOperandNumber() << " to have " << numLoops
<< " dim(s) to match the number of loops";
int64_t rank = linalgOp.getRank(&opOperand);
- if (indexingMap.getNumResults() != rank)
+
+ if (!isUserDefinedSemantic && indexingMap.getNumResults() != rank)
return op->emitOpError("expected operand rank (")
<< rank << ") to match the result rank of indexing_map #"
<< opOperand.getOperandNumber() << " ("
<< indexingMap.getNumResults() << ")";
- }
+ // Try to verify broadcast/transpose semantic requested through explicit
----------------
shahidact wrote:
Since I was not sure what later part of the `verifyStructuredOpInterface` logic is required for MatmulOp, I thought of using it to trigger the verification of matmulOp with extended semantic and let it go through the later part of the logic.
However, I can duplicate those logic and completely separate the verification of MatmulOp. Are you asking for this?
https://github.com/llvm/llvm-project/pull/104783
More information about the Mlir-commits
mailing list