Skip to content

Conversation

@xmfan
Copy link
Member

@xmfan xmfan commented Aug 16, 2025

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Aug 16, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit be18929 with merge base eac2d9d (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

xmfan added a commit that referenced this pull request Aug 16, 2025
[ghstack-poisoned]
xmfan added a commit that referenced this pull request Aug 16, 2025
@xmfan xmfan requested review from anijain2305 and bdhirsh August 16, 2025 02:21
[ghstack-poisoned]
xmfan added a commit that referenced this pull request Aug 16, 2025
Copy link
Contributor

@StrongerXi StrongerXi left a comment

Choose a reason for hiding this comment

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

I wish we have a systematic user-actionable way for tracing these things (e.g., some decorator), rather than having to tweak the tracer internals...

@xmfan
Copy link
Member Author

xmfan commented Aug 19, 2025

These APIs go into c++ eventually, where you don't have side-effect free guarantees, so it wouldn't change many of these cases

@xmfan
Copy link
Member Author

xmfan commented Aug 19, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 19, 2025
@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

@mlazos
Copy link
Contributor

mlazos commented Aug 20, 2025

I wish we have a systematic user-actionable way for tracing these things (e.g., some decorator), rather than having to tweak the tracer internals...

I feel like we can do this, get the function's name, add it to some map and wrap getattr(self.value, name) in ConstantVariable

xmfan added a commit that referenced this pull request Aug 20, 2025
pytorchmergebot pushed a commit that referenced this pull request Aug 22, 2025
…1036)

Fixes silent incorrectness for autograd function tracing, where we rely on FakeTensor metadata (requires_grad) to determine whether to HOP or not: https://github.com/pytorch/pytorch/blob/5ee464db5c4293ac09521f9069fa7d2106680a7f/torch/_dynamo/variables/misc.py#L671

Stared at this with @anijain2305 yesterday, `Tensor.__setitem__` can update tensor metadata, and we can just run the fake prop and extract the output metadata from the updated FakeTensor.

FIXES #160901

It should also be the root cause behind the issue in pytorch/torchtitan#1604 @bdhirsh  @ruisizhang123

Pull Request resolved: #161036
Approved by: https://github.com/anijain2305
ghstack dependencies: #160805
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…orch#161036)

Fixes silent incorrectness for autograd function tracing, where we rely on FakeTensor metadata (requires_grad) to determine whether to HOP or not: https://github.com/pytorch/pytorch/blob/5ee464db5c4293ac09521f9069fa7d2106680a7f/torch/_dynamo/variables/misc.py#L671

Stared at this with @anijain2305 yesterday, `Tensor.__setitem__` can update tensor metadata, and we can just run the fake prop and extract the output metadata from the updated FakeTensor.

FIXES pytorch#160901

It should also be the root cause behind the issue in pytorch/torchtitan#1604 @bdhirsh  @ruisizhang123

Pull Request resolved: pytorch#161036
Approved by: https://github.com/anijain2305
ghstack dependencies: pytorch#160805
@github-actions github-actions bot deleted the gh/xmfan/278/head branch September 19, 2025 02:10
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.

5 participants