-
Notifications
You must be signed in to change notification settings - Fork 7k
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
use torch.where over boolean masking #8171
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8171
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (32 Unrelated Failures)As of commit a3d9eb3 with merge base 6640e49 (): FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Also note that this will also generate better code even when pytorch/pytorch#114220 is set as the default. |
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.
LGTM, thanks @pmeier !
Hey @pmeier! You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py |
Reviewed By: vmoens Differential Revision: D52539024 fbshipit-source-id: 62023b849e181d7f298abc9f9145298fef248a6b
This solves the graph break for
torch.compile
that stems from pytorch/pytorch#114220. The fix proposed there is no fix for now, but rather just a pointer to setting a feature flag. This flag is supposed to become the default in the future. Still, usingtorch.where
here adds no complexity and will be faster on CUDA as well.cc @vfdev-5