run functorch decomps after functionalization when enabled#83992
Closed
bdhirsh wants to merge 3 commits intogh/bdhirsh/308/basefrom
Closed
run functorch decomps after functionalization when enabled#83992bdhirsh wants to merge 3 commits intogh/bdhirsh/308/basefrom
bdhirsh wants to merge 3 commits intogh/bdhirsh/308/basefrom
Conversation
[ghstack-poisoned]
Contributor
🔗 Helpful links
✅ No Failures (0 Pending)As of commit 2696cba (more details on the Dr. CI page): Expand to see more💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
Fixes #83923 I only bothered with `broadcast_in_dim` for now, but we might need to add other view ops later [ghstack-poisoned]
bdhirsh
commented
Aug 24, 2022
| error_str += "\n"; | ||
| } | ||
| ASSERT_EQ(danglingImpls.size(), 0) << error_str; | ||
| ASSERT_EQ(danglingImpls.size(), dangling_prim_ops) << error_str; |
ezyang
approved these changes
Aug 24, 2022
Contributor
ezyang
left a comment
There was a problem hiding this comment.
If we need to do more of these, let's expose enough API that these can be written in Python
Collaborator
|
I'm kind of against doing this, tbh. I feel like this can be resolved by just doing decompositions after functionalization. |
Fixes #83923 I only bothered with `broadcast_in_dim` for now, but we might need to add other view ops later [ghstack-poisoned]
Collaborator
Author
|
Updated based on suggestions in that linked issue - now we'll just run decomps after functionalization. I confirmed that with the repro command the errors also goes away. |
facebook-github-bot
pushed a commit
to pytorch/functorch
that referenced
this pull request
Aug 26, 2022
…#83992) Summary: This is a short-to-midterm fix for pytorch/pytorch#83923. By running functionalization before decomps, we guarantee that functionalization won't have to see any primtorch view/inplace ops like `broadcast_in_dim`. This will only really be a problem if there's a function in the decomposition table that decomposes a functional op into mutations. If that comes up later, we'll need to revisit pytorch/pytorch#83923. X-link: pytorch/pytorch#83992 Approved by: https://github.com/ezyang Reviewed By: malfet Differential Revision: D39034425 Pulled By: bdhirsh fbshipit-source-id: 7037095a54d4aebb4fc7d9cf903a6d0bd4d54701
facebook-github-bot
pushed a commit
that referenced
this pull request
Aug 26, 2022
…83992) Summary: This is a short-to-midterm fix for #83923. By running functionalization before decomps, we guarantee that functionalization won't have to see any primtorch view/inplace ops like `broadcast_in_dim`. This will only really be a problem if there's a function in the decomposition table that decomposes a functional op into mutations. If that comes up later, we'll need to revisit #83923. Pull Request resolved: #83992 Approved by: https://github.com/ezyang Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/0c6a616af0b14b9bbe190b93655edf24bac14cfd Reviewed By: malfet Differential Revision: D39034425 Pulled By: bdhirsh fbshipit-source-id: 7037095a54d4aebb4fc7d9cf903a6d0bd4d54701
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a short-to-midterm fix for #83923. By running functionalization before decomps, we guarantee that functionalization won't have to see any primtorch view/inplace ops like
broadcast_in_dim.This will only really be a problem if there's a function in the decomposition table that decomposes a functional op into mutations. If that comes up later, we'll need to revisit #83923.
Stack from ghstack (oldest at bottom):