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

Guray Ozen llvmlistbot at llvm.org
Mon Feb 12 09:02:05 PST 2024


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

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

>From e8bf17895bd7fbb9b364846fff41e1d7d6caab51 Mon Sep 17 00:00:00 2001
From: grypp <guray.ozen at gmail.com>
Date: Mon, 12 Feb 2024 17:01:15 +0000
Subject: [PATCH] [mlir][nvgpu] Allow TMA's last dimenision to be non-128B for
 none swizzling

Allow TMA's last dimenision 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
---
 mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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)



More information about the Mlir-commits mailing list