Skip to content

[inductor] fix triton bucketize mask propagation #159961

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
wants to merge 7 commits into from

Conversation

v0i0
Copy link
Contributor

@v0i0 v0i0 commented Aug 6, 2025

See https://hud.pytorch.org/pytorch/pytorch/commit/6b414f56a4a133a428af618d8ed1553849341497

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: 23c0501
Pull-Request: #159930

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Aug 6, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/159961

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (2 Unrelated Failures)

As of commit 08d2f87 with merge base b9003ed (image):

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

v0i0 added a commit that referenced this pull request Aug 6, 2025
See https://hud.pytorch.org/pytorch/pytorch/commit/6b414f56a4a133a428af618d8ed1553849341497

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: 23c0501
Pull-Request: #159930

ghstack-source-id: 5132a6b
Pull Request resolved: #159961
See https://hud.pytorch.org/pytorch/pytorch/commit/6b414f56a4a133a428af618d8ed1553849341497

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Pull-Request: #159930

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben

[ghstack-poisoned]
v0i0 added a commit that referenced this pull request Aug 6, 2025
See https://hud.pytorch.org/pytorch/pytorch/commit/6b414f56a4a133a428af618d8ed1553849341497

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: a904d7b
Pull-Request: #159930

ghstack-source-id: a904d7b
Pull Request resolved: #159961
@v0i0 v0i0 requested review from eellison and davidberard98 August 6, 2025 17:05
@v0i0
Copy link
Contributor Author

v0i0 commented Aug 6, 2025

@pytorchbot label "topic: not user facing"

Comment on lines +13658 to +13659
config.cpp_wrapper,
"cpp_wrapper samples will lead to invalid indexing",
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens when cpp_wrapper is used - does it raise a device-side assert? (and is it during compilation or during runtime?) and do you know if that is a regression or if that is a previously-existing bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cpp wrapper generates examples and runs kernels using those examples. these examples have the rule - random tensor for real data, zero data for integral data (to capture the kernel cubin i think?). so if the model makes assumptions (like repeats.sum() == output_size), cpp_wrapper fails. this is why the original MR disabled the decomp for cpp_wrapper, too.

v0i0 added 3 commits August 6, 2025 14:29
See https://hud.pytorch.org/pytorch/pytorch/commit/6b414f56a4a133a428af618d8ed1553849341497

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Pull-Request: #159930

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben

[ghstack-poisoned]
See https://hud.pytorch.org/pytorch/pytorch/commit/6b414f56a4a133a428af618d8ed1553849341497

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Pull-Request: #159930

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov coconutruben

[ghstack-poisoned]
@@ -2720,6 +2720,8 @@ def bucketize(
dtype=indexing_dtype, # type: ignore[attr-defined]
)

result.mask_vars = values.mask_vars # type: ignore[attr-defined]
Copy link
Contributor

Choose a reason for hiding this comment

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

Would we need to add the boundaries mask as well ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added all CSEVariables

v0i0 added a commit that referenced this pull request Aug 8, 2025
See https://hud.pytorch.org/pytorch/pytorch/commit/6b414f56a4a133a428af618d8ed1553849341497

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: a2229df
Pull-Request: #159930

ghstack-source-id: a2229df
Pull Request resolved: #159961
[ghstack-poisoned]
@v0i0
Copy link
Contributor Author

v0i0 commented Aug 11, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 11, 2025
@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

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #158462

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: Command git -C /home/runner/work/pytorch/pytorch cherry-pick -x 6efbbd62df8e148f48e6a0ebc50bab2240ebf6ad returned non-zero exit code 1

Auto-merging test/inductor/test_torchinductor.py
CONFLICT (content): Merge conflict in test/inductor/test_torchinductor.py
error: could not apply 6efbbd62df8... [inductor] fix triton bucketize mask propagation
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Details for Dev Infra team Raised by workflow job

[ghstack-poisoned]
@v0i0
Copy link
Contributor Author

v0i0 commented Aug 12, 2025

@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

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #158462

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.

4 participants