-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[inductor] getting AOT inductor to treat None args correctly #139114
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
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/139114
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 142cdc9 with merge base 2922b9f ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "topic: not user facing" |
torch/_inductor/ir.py
Outdated
| # We have to compute the constexpr indices for the new, filtered raw_args | ||
| # We also have to adjust equal_to_1. | ||
| eq1_indices_set = set(triton_meta["configs"][0].equal_to_1) | ||
| constexpr_indices = [] | ||
| equal_to_1 = [] | ||
| index_shift = 0 | ||
| for idx, kwarg in enumerate(self.ordered_kwargs_for_cpp_kernel): | ||
| # every time we encounter an idx we removed, adjust by one to account for it | ||
| # So for example if we had [None, const X] | ||
| # iter 1: | ||
| # None was removed, adjust=1 | ||
| # iter 2: | ||
| # X is const at idx=1, but the adjusted idx is 0 now, because None was removed | ||
| if idx in removed_none_args: | ||
| index_shift += 1 | ||
| continue | ||
| arg_index = kernel.arg_names.index(kwarg) | ||
| if arg_index in kernel.constexprs: | ||
| constexpr_indices.append(idx - index_shift) | ||
| if arg_index in eq1_indices_set: | ||
| equal_to_1.append(idx - index_shift) | ||
|
|
||
| triton_meta["configs"][0].equal_to_1 = equal_to_1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do this only if removed_none_args?
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang aakhundov [ghstack-poisoned]
|
@SamGinzburg has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…#139114) Differential Revision: [D65102228](https://our.internmc.facebook.com/intern/diff/D65102228) Pull Request resolved: pytorch#139114 Approved by: https://github.com/aakhundov
Stack from ghstack (oldest at bottom):
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov
Differential Revision: D65102228