Skip to content

Conversation

@aorenste
Copy link
Contributor

@aorenste aorenste commented Dec 3, 2024

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: ignores added by Allow Fakified subclass to have different device for inner and outer tensor #141839
  3. (minor) Fix _UNSERIALIZABLE to be a set instead of a dict which is converted into a set each time it's used.

Stack from ghstack (oldest at bottom):

@pytorch-bot
Copy link

pytorch-bot bot commented Dec 3, 2024

🔗 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 Failures

As of commit 6785393 with merge base f24a9d0 (image):
💚 Looks good so far! There are no failures yet. 💚

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(
Copy link
Contributor Author

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...

@ezyang
Copy link
Contributor

ezyang commented Dec 3, 2024

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]
@aorenste
Copy link
Contributor Author

aorenste commented Dec 5, 2024

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 5, 2024
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

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
For more information see pytorch-bot wiki.

@ezyang
Copy link
Contributor

ezyang commented Dec 5, 2024

@pytorchbot merge -f "low risk stuck test"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pytorch-bot bot pushed a commit that referenced this pull request Dec 9, 2024
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
Esquains pushed a commit to Esquains/study1 that referenced this pull request Dec 15, 2024
@github-actions github-actions bot deleted the gh/aorenste/148/head branch January 5, 2025 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants