This repository was archived by the owner on Aug 7, 2024. It is now read-only.
Try dispatching to the decomposed OpOverload to account for inference mode#251
Open
Try dispatching to the decomposed OpOverload to account for inference mode#251
Conversation
|
Huh. I don't know off the top of my head what the decompose method is doing... @zou3519 might know better? |
zou3519
reviewed
Apr 15, 2024
| if func in FLOAT8_OPS_TABLE: | ||
| return FLOAT8_OPS_TABLE[func](func, args, kwargs) | ||
| else: | ||
| return func.decompose(*args, *kwargs) |
There was a problem hiding this comment.
I'm not sure this is what you want, it directly invokes the CompositeImplicitAutograd implementation
There was a problem hiding this comment.
I think this is exactly what they want :D
What happens if there is no CompositeImplicitAutograd impl?
Contributor
Author
There was a problem hiding this comment.
yeah I figure that it we can noop ( execept not implemented) slide our way down by trying to decompose the op
- Either it wont be decomposable, and return not implemented, cool same place as after this
- or it is decomposable:
- Run supported op, Great!
- Not supported and ultimately end back up with a not implemented
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
This enables logic that work with torch.no.grad to work with inference mode: #238
cc @albanD on what the correct pattern should be