-
Notifications
You must be signed in to change notification settings - Fork 26.3k
MetaTensorDesc changes for reconstructing proper FakeTensors #141926
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
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/141926
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 6785393 with merge base f24a9d0 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
A few changes to MetaTensorDesc and friends: 1. Change view_func from a raw method to an ADT where the common case (FakeTensor._view_func_unsafe) is a simple representation instead. 2. Allow passing an "override_device" to meta_tensor() (or more importantly allow you to NOT override if you don't want to). The existing behavior forced the device to "meta" - but for reconstructing FakeTensor that's not the behavior we want. 3. (minor) Fix _UNSERIALIZABLE to be a set instead of a dict which is converted into a set each time it's used. [ghstack-poisoned]
|
|
||
| # TODO: Is it important to enable torch.inference_mode before querying | ||
| # these values? | ||
| r = MetaTensorDesc( |
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.
mypy is being weird and requiring a type decl here...
|
I think you need to recursively propagate the force device thing. But I am also not too sure about what that is about |
A few changes to MetaTensorDesc and friends: 1. Change view_func from a raw method to an ADT where the common case (FakeTensor._view_func_unsafe) is a simple representation instead. 2. (minor) Remove and fix some `type: ignore`s added by #141839 3. (minor) Fix _UNSERIALIZABLE to be a set instead of a dict which is converted into a set each time it's used. [ghstack-poisoned]
A few changes to MetaTensorDesc and friends: 1. Change view_func from a raw method to an ADT where the common case (FakeTensor._view_func_unsafe) is a simple representation instead. 2. (minor) Remove and fix some `type: ignore`s added by #141839 3. (minor) Fix _UNSERIALIZABLE to be a set instead of a dict which is converted into a set each time it's used. [ghstack-poisoned]
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command |
|
@pytorchbot merge -f "low risk stuck test" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
A few changes to MetaTensorDesc and friends: 1. Change view_func from a raw method to an ADT where the common case (FakeTensor._view_func_unsafe) is a simple representation instead. 2. (minor) Remove and fix some `type: ignore`s added by #141839 3. (minor) Fix _UNSERIALIZABLE to be a set instead of a dict which is converted into a set each time it's used. Pull Request resolved: #141926 Approved by: https://github.com/ezyang
ghstack-source-id: d82ef2d Pull Request resolved: pytorch/pytorch#141926
A few changes to MetaTensorDesc and friends:
type: ignores added by Allow Fakified subclass to have different device for inner and outer tensor #141839Stack from ghstack (oldest at bottom):