[Compiler] Add reserved_launch_param_names to Backend ABC#1970
Open
hinriksnaer wants to merge 6 commits intopytorch:mainfrom
Open
[Compiler] Add reserved_launch_param_names to Backend ABC#1970hinriksnaer wants to merge 6 commits intopytorch:mainfrom
reserved_launch_param_names to Backend ABC#1970hinriksnaer wants to merge 6 commits intopytorch:mainfrom
Conversation
40c295c to
16b8a93
Compare
jansel
requested changes
Apr 9, 2026
| ... | ||
|
|
||
| @property | ||
| def experimental(self) -> bool: |
| (e.g., Triton's ``run()`` method uses ``grid``, ``num_warps``, | ||
| ``num_stages``, etc.). | ||
| """ | ||
| return [] |
Contributor
There was a problem hiding this comment.
frozenset might be better here.
Contributor
There was a problem hiding this comment.
Hrm this looks like a dupe with the prior PR something is off.
Collaborator
Author
There was a problem hiding this comment.
This is an extension of the previous PR so the diffs would disappear on merge. Let me know if there is a different convention for introducing changes that depend on unmerged ones. Maybe both should not target upstream?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
reserved_launch_param_namesto Backend ABC #1970Builds on the backend registry to eliminate a hardcoded backend string check in
device_function.py.Each backend's kernel launch mechanism reserves certain parameter names (e.g., Triton's
run()usesgrid,num_warps,num_stages). These names cannot be used as kernel variables. Previously, this was handled by a hardcoded list with anif backend_name == "tileir"branch to add TileIR-specific names.This PR adds
reserved_launch_param_names()as a static method on theBackendABC so each backend declares its own reserved names. The registry aggregates them viaall_reserved_launch_param_names()to ensure kernel portability across backends.