[Mlir-commits] [mlir] [mlir][nvgpu] Allow TMA's last dim to be non-128B without swizzling (PR #81499)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Feb 12 09:02:34 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-gpu

@llvm/pr-subscribers-mlir

Author: Guray Ozen (grypp)

<details>
<summary>Changes</summary>

Allow TMA's last dimension to be non-128B when swizzling mode is not set.

Test `tma_load_64x8_8x128_noswizzle.mlir` is failing due to the verifier. This PR will fix that

---
Full diff: https://github.com/llvm/llvm-project/pull/81499.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp (+2-1) 


``````````diff
diff --git a/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp b/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
index 4b6327479a219c..26f831f10a4e40 100644
--- a/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
+++ b/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
@@ -362,7 +362,8 @@ std::optional<InFlightDiagnostic> verifyTmaDescriptorWithMemref(
                              << kMaxTMADimension << " but it is " << dim;
     }
   }
-  if (descMemref.getRank() > 1) {
+  if (descMemref.getRank() > 1 &&
+      descType.getSwizzle() != TensorMapSwizzleKind::SWIZZLE_NONE) {
     unsigned lastDimensionByte =
         descMemref.getElementTypeBitWidth() * descMemref.getShape().back() / 8;
     if (lastDimensionByte != kMaxTMALastdimByte)

``````````

</details>


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


More information about the Mlir-commits mailing list