[Mlir-commits] [mlir] [mlir][xegpu] Improve XeGPU op verification logic for SIMT flavor and update tests. (PR #127920)

Artem Kroviakov llvmlistbot at llvm.org
Mon Feb 24 08:05:11 PST 2025


================
@@ -276,14 +280,13 @@ LogicalResult TensorDescType::verify(
     if (scatterAttr) {
       // Validate subgroup mapping rules for scattered tensors.
       // A work-item's slice of the tensor with shape [sg_size] or
-      // [sg_size, chunk_size] will be [1] or [1, chunks_size] respectively,
-      // the mapping should reflect that.
+      // [sg_size, chunk_size] will be [1] or [1, 32/element_ty_bit_width]
+      // respectively, the mapping should reflect that.
       if (wiData[0] != 1)
         return emitError()
                << "cannot map over non-contiguous scattered row elements";
 
-      unsigned chunkSize = scatterAttr.getChunkSize().getInt();
-      if (wiData[1] != chunkSize)
+      if (wiData[1] != (32 / elementType.getIntOrFloatBitWidth()))
----------------
akroviakov wrote:

>From what I remember, one of the motivations for the undergoing sg_map [revision](https://github.com/intel/mlir-extensions/pull/1021) was to clarify the `wi_data` and `chunk_size`, and move towards more coherent rules for 2d and scatter ops. 
As an example, the `minimal distribution unit` definition [is introduced](https://github.com/intel/mlir-extensions/pull/1021/commits/c0f95454dc1d66a179c546430083c53595152424#diff-e32b31825787dace412eafaafe50c05d6e39e223e4941f4f7178ef157a9b70a5R339) where `minimal` means the HW granularity. It is then noted:

> Processing the entire tensor may require one or more distribution units.

 however the number of such distributions is implicit and must satisfy [certain shape constraints](https://github.com/intel/mlir-extensions/pull/1021/commits/c0f95454dc1d66a179c546430083c53595152424#diff-e32b31825787dace412eafaafe50c05d6e39e223e4941f4f7178ef157a9b70a5R356). This update should align the 2d and scatter ops rules that previously described `wi_data` as a packed unit for 2d ops, but element-wise for scatter ops.

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


More information about the Mlir-commits mailing list