-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Add TORCH_CHECK for group < channels for native_channel_shuffle #153781
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/153781
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 4d1aa81 with merge base 8568dbc ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
Thanks!
Would you be able to add a small test in test_torch.py to make sure it raises as expected now?
I can add a test! |
Or to OpInfo as error_inputs ;) |
From the OH, you could add |
This https://github.com/pytorch/pytorch/wiki/lintrunner help to pass lint failure. |
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
Fixes #153231
Changes
TORCH_CHECK(groups <= channels)
to prevent silent misbehavior innative_channel_shuffle
when the number of groups is larger than the input's channel dimension. Files changed: aten/src/ATen/native/ChannelShuffle.cppMotivation
groups > channels
, which silently produced incorrect behavior or segmentation faults downstream. This check ensures correctness and surfaces misuse early.Labels: module: nn, module: crash, module: edge cases
cc @albanD