KEMBAR78
[inductor] getting AOT inductor to treat None args correctly by SamGinzburg · Pull Request #139114 · pytorch/pytorch · GitHub
Skip to content

Conversation

@SamGinzburg
Copy link
Contributor

@SamGinzburg SamGinzburg commented Oct 28, 2024

SamGinzburg added a commit that referenced this pull request Oct 28, 2024
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 28, 2024

🔗 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 Failures

As of commit 142cdc9 with merge base 2922b9f (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@SamGinzburg SamGinzburg requested a review from aakhundov October 28, 2024 22:33
@SamGinzburg
Copy link
Contributor Author

@pytorchbot label "topic: not user facing"

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Oct 28, 2024
Comment on lines 5427 to 5449
# 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
Copy link
Contributor

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 added a commit that referenced this pull request Oct 28, 2024
ghstack-source-id: 0737b00
Pull Request resolved: #139114

gate behind none args being removed
@SamGinzburg
Copy link
Contributor Author

@SamGinzburg has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 28, 2024
@SamGinzburg
Copy link
Contributor Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

rahulsingh-intel pushed a commit to rahulsingh-intel/pytorch that referenced this pull request Nov 5, 2024
@github-actions github-actions bot deleted the gh/SamGinzburg/10/head branch November 29, 2024 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants