Skip to content

Move the tensor descriptor block size check. #7325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

arp2600
Copy link

@arp2600 arp2600 commented Jun 26, 2025

Move a check from when a make_tensor_descriptor operation is created to when the operation is lowered to tma.

Not all backends share this restriction and the TritonRewriteTensorDescriptorToPointerPass handles these cases. By moving the error to the tma lowering it allows other backends to use these small tensor descriptors.

New contributor declaration

  • I am not making a trivial change, such as fixing a typo in a comment.

  • I have written a PR description following these
    rules.

  • I have run pre-commit run --from-ref origin/main --to-ref HEAD.

  • Select one of the following.

    • I have added tests.
      • /test for lit tests
      • /unittest for C++ tests
      • /python/test for end-to-end tests
    • This PR does not need a test because Covered by existing tests. I had to modify the tma tests in test_core.py.
  • Select one of the following.

    • I have not added any lit tests.
    • The lit tests I have added follow these best practices,
      including the "tests should be minimal" section. (Usually running Python code
      and using the instructions it generates is not minimal.)

@arp2600 arp2600 requested a review from ptillet as a code owner June 26, 2025 14:39
Comment on lines +256 to +261
if (contigDimSize * elemSize < 16) {
return op->emitError("Descriptor block shape must have at least 16 bytes "
"in the last dimension, but got ")
<< contigDimSize << " * " << elemSize << " = "
<< (contigDimSize * elemSize) << " bytes";
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

we want this to be a front end error as this will be cleaning reported to user and not be a failure in the backend. Also in term of portability ideally we should keep the same restrictions independently of the backend.

@arp2600 arp2600 closed this Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants