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

Adam Siemieniuk llvmlistbot at llvm.org
Wed Jan 29 11:23:38 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:

> When it comes to sg_map layouts, the [documentation](https://github.com/intel/mlir-extensions/blob/main/docs/rfcs/XeGPU.md#rules-of-sg_map-setting-for-load-and-store-on-pvc-and-arc) explicitly sets rules for non-nd operations

Doesn't this contradict earlier paragraph?
> xegpu.sg_map is also applied to 1d vector load for WI data distribution. When the tensor_desc only specify 1d tensor, sg_map.wi_layout[0] and sg_map.wi_data[0] must be 1, and they are ignored in the WI distribution.

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


More information about the Mlir-commits mailing list