Skip to content

[compile] workaround for compile error FakeTensor no op for builtin.- #2891

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

Merged
merged 1 commit into from
Jul 24, 2025

Conversation

IvanKobzarev
Copy link
Contributor

@IvanKobzarev IvanKobzarev commented Jul 24, 2025

Stack from ghstack (oldest at bottom):

Workaround for torch.compile to pass through:

Dynamo failed to run FX node with fake tensors: call_function <built-in function sub>(*(FakeTensor(..., device='cuda:0', size=(1, s27, s53, (s0//2)),
           grad_fn=<MulBackward0>), FakeTensor(..., device='cuda:0', size=(1, s27, s53, (s0//2)),
           grad_fn=<MulBackward0>)), **{}): got TypeError("unsupported operand type(s) for -: 'FakeTensor' and 'FakeTensor'")
from user code:
   File "/packages/content_understanding_projects_torchtune/main-inplace#link-tree/torchtune/models/llama4/_position_embeddings.py", line 182, in forward
    xshaped[..., 0] * rope_cache[..., 0]

Copy link

pytorch-bot bot commented Jul 24, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 4bb03ed with merge base 10c31c0 (image):
💚 Looks good so far! There are no failures yet. 💚

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

IvanKobzarev added a commit that referenced this pull request Jul 24, 2025
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 24, 2025
@IvanKobzarev IvanKobzarev requested a review from ebsmothers July 24, 2025 18:39
@IvanKobzarev IvanKobzarev changed the base branch from gh/IvanKobzarev/10/base to main July 24, 2025 18:40
Copy link
Contributor

@ebsmothers ebsmothers 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 fixing this!

@ebsmothers ebsmothers merged commit 4249bd2 into main Jul 24, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants