[Mlir-commits] [mlir] [MLIR][NVGPU] Remove Memref Rank vs. Coordinates `tma.async.load` (PR #69584)

Guray Ozen llvmlistbot at llvm.org
Thu Oct 19 03:18:07 PDT 2023


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

Previously, a verifier to check for mismatches between memref rank and number of coordinates was introduced. I noticed that it is very strict. Let's take following IR snippet where the verifier complains about mismatches (2 coordinates (%c1,%c2) != memref rank 3).

```
nvgpu.tma.async.load %0[%c1, %c2], %1 to %2 : ... -> memref<1x64x128xf16, ..., 3>
```

This PR relax the verifier.

>From 12c576296c91f0c707891fb765e99e470ee24e7a Mon Sep 17 00:00:00 2001
From: Guray Ozen <guray.ozen at gmail.com>
Date: Thu, 19 Oct 2023 12:16:42 +0200
Subject: [PATCH] [MLIR][NVGPU] Remove Memref Rank vs. Coordinates
 `tma.async.load`

Previously, a verifier to check for mismatches between memref rank and number of coordinates was introduced. I noticed that it is very strict. Let's take following IR snippet where the verifier complains about mismatches (2 coordinates != memref rank 3).

```
nvgpu.tma.async.load %map[%coord1, %coord2], %2 to %1 : ... -> memref<1x64x128xf16, ..., 3>
```

This PR relax the verifier.
---
 mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp b/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
index f5b02fe1b515591..2a280df68371d17 100644
--- a/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
+++ b/mlir/lib/Dialect/NVGPU/IR/NVGPUDialect.cpp
@@ -347,12 +347,6 @@ LogicalResult TmaAsyncLoadOp::verify() {
   if (getCoordinates().size() > 5) {
     return emitError() << "Maximum 5 coordinates are supported.";
   }
-  if (getCoordinates().size() != size_t(dstMemref.getRank())) {
-    return emitError() << "Destination memref rank is "
-                       << size_t(dstMemref.getRank()) << " but there are  "
-                       << getCoordinates().size()
-                       << " coordinates. They must match.";
-  }
   return success();
 }
 



More information about the Mlir-commits mailing list