-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add masked_select abstract impl #110103
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
Add masked_select abstract impl #110103
Conversation
Fixes #109871 Signed-off-by: Edward Z. Yang <ezyang@meta.com> [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/110103
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit 657771a with merge base 0dcea70 ( NEW FAILURE - The following job has failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
def masked_select(fake_mode, func, self, mask): | ||
if ( | ||
fake_mode.shape_env is None | ||
or not fake_mode.shape_env.allow_dynamic_output_shape_ops |
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.
I forget why we have this config (as opposed to dyn output shapes always being allowed when we have a shape env), but i'll read the code later - see we do the same for nonzero.
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.
The reason is inductor currently chokes on this stuff, so we need to induce a graph break under default config. But #109893 should make it so we can start attempting to change the defaults here.
maxval = sys.maxsize - 1 | ||
if not free_symbols(arg.numel()): | ||
if arg.numel() >= 2: | ||
maxval = int(arg.numel()) |
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.
i wonder if this pattern will become common enough that we should util-ify it
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.
There's definitely some design that needs to be thought through for upper bounds on symbolic sizes. We actually probably do want to track upper bounds that have symbolic symbols in them, for other reasons...
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 2 checks: pull / linux-focal-py3.8-clang10 / test (dynamo, 2, 2, linux.2xlarge), trunk / linux-focal-rocm5.6-py3.8 / test (default, 1, 3, linux.rocm.gpu) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Stack from ghstack (oldest at bottom):
Fixes #109871
Signed-off-by: Edward Z. Yang ezyang@meta.com