Skip to content
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

Merged
merged 2 commits into from
Dec 20, 2023
Merged

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Dec 19, 2023

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, using torch.where here adds no complexity and will be faster on CUDA as well.

cc @vfdev-5

Copy link

pytorch-bot bot commented Dec 19, 2023

🔗 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 (image):

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.

@lezcano
Copy link
Contributor

lezcano commented Dec 20, 2023

Also note that this will also generate better code even when pytorch/pytorch#114220 is set as the default.

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @pmeier !

@pmeier pmeier merged commit 80a708f into pytorch:main Dec 20, 2023
2 of 7 checks passed
Copy link

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

facebook-github-bot pushed a commit that referenced this pull request Jan 16, 2024
Reviewed By: vmoens

Differential Revision: D52539024

fbshipit-source-id: 62023b849e181d7f298abc9f9145298fef248a6b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants