Skip to content

Limit tensor block numel to triton's requirements #485

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oulgen
Copy link
Contributor

@oulgen oulgen commented Aug 11, 2025

Stacked PRs:


Limit tensor block numel to triton's requirements

Fixes #456

Fixes #456

stack-info: PR: #485, branch: oulgen/stack/63
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 11, 2025
@oulgen oulgen requested a review from jansel August 11, 2025 22:07
Copy link
Contributor

@jansel jansel left a comment

Choose a reason for hiding this comment

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

See below, this will over-count block sizes from inner loops.

Comment on lines +189 to +192
if name == "block_sizes" and math.prod(values) > 1048576:
raise InvalidConfig(
"Triton does not allow for tensor numel greater than 1048576"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not all block sizes should be included in this count, only the ones in the top level loop. We might need to tag some block sizes as coming from the grid and only count those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limit block sizes in autotuning because of triton max numel range
2 participants