[Mlir-commits] [mlir] [MLIR][XeGPU] Switch to 1D representation for SIMT code (PR #135116)
Chao Chen
llvmlistbot at llvm.org
Thu Apr 17 08:44:07 PDT 2025
================
@@ -559,14 +600,31 @@ LogicalResult StoreScatterOp::verify() {
if (tdescShape[0] != maskShape[0])
return emitOpError("dim-0 of the Mask and TensorDesc should be the same.");
- if (tdescTy.getRank() == 2) {
+ auto chunkSize = tdescTy.getChunkSize();
+
+ // a valid shape for SIMT case
+ if (valueTy.getRank() == 1 && valueTy.getNumElements() == chunkSize) {
+ if (tdescTy.getLayoutAttr())
+ return emitOpError()
+ << "TensorDesc doesn't need LayoutAttr for SIMT code";
+ if (getTransposeAttr())
+ return emitOpError() << "doesn't need TransposeAttr for SIMT code";
+ return success();
+ }
+
+ if (tdescTy.getRank() == 2 && valueTy.getRank() == 2) {
if (!getTransposeAttr())
return emitOpError("Store of a rank-2 tensor has to be transposed.");
transpose({1, 0}, tdescShape);
}
- return isArgShapesValid(tdescTy, valueTy, tdescShape,
- [&]() { return emitOpError(); });
+ if (tdescShape != valueShape)
+ return emitOpError() << "Value shape " << makeString(valueShape)
+ << " is neither a valid distribution for SIMT nor "
+ "consistent with the tensor descriptor for SIMD "
+ << tdescTy;
+
+ return success();
----------------
chencha3 wrote:
Fixed
https://github.com/llvm/llvm-project/pull/135116
More information about the Mlir-commits
mailing list