-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add new dispatch keys for Fake Tensor and Deferred Module Initialization #76139
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
Conversation
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit f3815bb (more details on the Dr. CI page): Expand to see more
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages
|
Per our discussion in today's meeting, bumping up this PR. cc @bdhirsh |
c10/core/DispatchKey.h
Outdated
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.
Are you sure that you want Fake
to have higher priority than ZeroTensor/Negative/Conjugate? (I think I'd expect it to have ~ the same priority as the Python
key, right above backend select, or you might hit weird issues with code that uses forward mode AD / complex numbers)
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.
In fact it works in both orders, but has different effects (Zero tensor treated as Fake vs. Fake treated as Zero). Anyways, as you suggested, I moved it next to Python to make it more consistent with the behavior of Python subclasses.
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.
Left a comment, but preemptively approving as per the composability conversation earlier today
bcad9c6
to
f3815bb
Compare
Note: verified that the failing GitHub Action is not related to the changes included in this PR. |
@pytorchbot merge this please |
Hey @cbalioglu. |
…ion (#76139) Summary: Thanks to bdhirsh's work, we now have room for new dispatch keys in `DispatchKey` enum. This PR adds two new keys for out-of-core [Fake Tensor](https://pytorch.org/torchdistx/latest/fake_tensor.html) and [Deferred Module Initialization](https://pytorch.org/torchdistx/latest/deferred_init.html) features. Pull Request resolved: #76139 Approved by: https://github.com/bdhirsh Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/a0bf0f5611b0986405de28cca2f198eef22ac4ec Reviewed By: osalpekar Differential Revision: D35992313 fbshipit-source-id: 045b4e4021605b063da0ad7bdd1ee08ceec468d3
Thanks to @bdhirsh's work, we now have room for new dispatch keys in
DispatchKey
enum. This PR adds two new keys for out-of-core Fake Tensor and Deferred Module Initialization features.