Skip to content

Conversation

linuxlonelyeagle
Copy link
Member

Since the size of the last dimension of TMA is no longer fixed at 128 bytes, remove the kMaxTMALastdimByte.

@llvmbot
Copy link
Member

llvmbot commented Aug 28, 2025

@llvm/pr-subscribers-mlir-nvgpu
@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-gpu

Author: lonely eagle (linuxlonelyeagle)

Changes

Since the size of the last dimension of TMA is no longer fixed at 128 bytes, remove the kMaxTMALastdimByte.


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

1 Files Affected:

  • (modified) mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h (-2)
diff --git a/mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h b/mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h
index 61a57fb60bda4..b07e1a5beb866 100644
--- a/mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h
+++ b/mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h
@@ -46,8 +46,6 @@ constexpr unsigned kMaxTMATensorDimension = 5;
 /// to be traversed along each of the kMaxTMATensorDimension (tensorRank)
 /// dimensions, must be non-zero and less than or equal to 256.
 constexpr unsigned kMaxTMADimension = 256;
-/// Last dimension of 2D+ TMA must be 128 bytes
-constexpr unsigned kMaxTMALastdimByte = 128;
 
 #define GET_ATTRDEF_CLASSES
 #include "mlir/Dialect/NVGPU/IR/NVGPUAttrDefs.h.inc"

@linuxlonelyeagle
Copy link
Member Author

#153451 In this PR, I forgot to remove kMaxTMALastdimByte. Sorry.

@durga4github durga4github changed the title [mlir][nvgpu] Delete nvgpu dialect useless variables kMaxTMALastdimByte (NFC) [mlir][nvgpu] Delete nvgpu dialect unused variable kMaxTMALastdimByte (NFC) Aug 28, 2025
@@ -46,8 +46,6 @@ constexpr unsigned kMaxTMATensorDimension = 5;
/// to be traversed along each of the kMaxTMATensorDimension (tensorRank)
/// dimensions, must be non-zero and less than or equal to 256.
constexpr unsigned kMaxTMADimension = 256;
/// Last dimension of 2D+ TMA must be 128 bytes
constexpr unsigned kMaxTMALastdimByte = 128;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make it 16 and use it in the code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I don't quite understand your intention.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do this

/// Last dimension of 2D+ TMA must be 128 bytes
constexpr unsigned kMaxTMALastdimByte = 16;


 int lastDimBytes =
      descMemref.getShape().back() * descMemref.getElementTypeBitWidth() / 8;
  if (lastDimBytes % kMaxTMALastdimByte != 0) {
    return op->emitError() << "the bytes in the last dimension of the tensor "
                              "map must be a multiple of 16";
  }

@linuxlonelyeagle
Copy link
Member Author

#152160 This PR must have forgotten to remove the unused variables. I pasted the wrong link above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants