[Mlir-commits] [mlir] [XeGPU] Add sg_map for scatter verification (PR #124300)

Adam Siemieniuk llvmlistbot at llvm.org
Wed Jan 29 12:10:11 PST 2025


================
@@ -453,7 +453,16 @@ LogicalResult CreateDescOp::verify() {
   if (shape != tdescShape)
     return emitOpError("Incorrect TensorDesc shape. ")
            << "Expected is " << makeString(shape) << "\n";
-
+  if (auto sgMap = tdescTy.getSGMapAttr()) {
+    if (sgMap.getWiData()[0] > 1)
+      return emitOpError("TensorDesc cannot have wi_data[0] > 1.");
+    if (chunkSize != static_cast<int>(sgMap.getWiData()[1]))
+      return emitOpError("TensorDesc's chunkSize must match wi_data[1].");
+    if (int rank = tdescTy.getRank(); (sgMap.getWiLayout()[2 - rank] == 1))
----------------
adam-smnk wrote:

> for load without chunk_size (size as 1), we expect the rank is 1, so wi_layout[1] and t_desc_shpe [0] should match (equal to subgroup_size).

@Jianhui-Li Can't I have still 2D load with inner dimension 1 <Nx1>? That is, `chunk_size = 1`, wi_data = [1, 1]`

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


More information about the Mlir-commits mailing list