Skip to content

Fix self.__dict__.get() and property.fget in torch.compile#176623

Closed
guilhermeleobas wants to merge 1 commit intogh/guilhermeleobas/307/basefrom
gh/guilhermeleobas/307/head
Closed

Fix self.__dict__.get() and property.fget in torch.compile#176623
guilhermeleobas wants to merge 1 commit intogh/guilhermeleobas/307/basefrom
gh/guilhermeleobas/307/head

Conversation

@guilhermeleobas
Copy link
Copy Markdown
Collaborator

@guilhermeleobas guilhermeleobas commented Mar 5, 2026

[ghstack-poisoned]
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Mar 5, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/176623

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (5 Unrelated Failures)

As of commit 0cb6b4a with merge base 65762ca (image):

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Mar 5, 2026

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

guilhermeleobas added a commit that referenced this pull request Mar 5, 2026
Fixes #176608

Claude authored parts of this PR.


ghstack-source-id: ec8d460
Pull-Request: #176623
@guilhermeleobas
Copy link
Copy Markdown
Collaborator Author

cc @vmoens

@guilhermeleobas guilhermeleobas marked this pull request as ready for review March 5, 2026 18:45
Copy link
Copy Markdown
Contributor

@Lucaskabela Lucaskabela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

Copy link
Copy Markdown
Contributor

@vmoens vmoens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@guilhermeleobas
Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Copy Markdown
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
Copy Markdown
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.

@guilhermeleobas
Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Copy Markdown
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

guilhermeleobas added a commit that referenced this pull request Mar 9, 2026
Fixes #176608

Claude authored parts of this PR.

ghstack-source-id: ec8d460
Pull-Request: #176623
pytorchmergebot pushed a commit that referenced this pull request Mar 12, 2026
…ache, wraps) (#176934)

`WrapperUserFunctionVariable` now inherits from `BaseUserFunctionVariable`
instead of `VariableTracker`, gaining the shared `var_getattr` implementation
that handles `__name__`, `__qualname__`, `__doc__`, `__module__`, `__code__`,
`__dict__`, `__annotations__`, and `__type_params__`.

This fixes `functools.wraps` applied to `lru_cache`-wrapped functions at trace
time — previously, accessing `__name__`, `__dict__`, etc. on the wrapper object
would graph-break.

Co-authored Claude Sonnet 4.6

Pull Request resolved: #176934
Approved by: https://github.com/Lucaskabela, https://github.com/williamwen42
ghstack dependencies: #176623
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
…ache, wraps) (pytorch#176934)

`WrapperUserFunctionVariable` now inherits from `BaseUserFunctionVariable`
instead of `VariableTracker`, gaining the shared `var_getattr` implementation
that handles `__name__`, `__qualname__`, `__doc__`, `__module__`, `__code__`,
`__dict__`, `__annotations__`, and `__type_params__`.

This fixes `functools.wraps` applied to `lru_cache`-wrapped functions at trace
time — previously, accessing `__name__`, `__dict__`, etc. on the wrapper object
would graph-break.

Co-authored Claude Sonnet 4.6

Pull Request resolved: pytorch#176934
Approved by: https://github.com/Lucaskabela, https://github.com/williamwen42
ghstack dependencies: pytorch#176623
@github-actions github-actions bot deleted the gh/guilhermeleobas/307/head branch April 6, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dynamo] Property getter using __dict__.get() returns stale value inside @torch.compiler.disable in nightlies

5 participants