-
Notifications
You must be signed in to change notification settings - Fork 24.2k
removed zero dim cpu logic from fake_tensor.py #147501
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/147501
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 28f7a88 with merge base f5e0806 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label "topic: not user facing" |
@mruberry could you check if you're the right reviewer for this? |
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.
Will let the folks more familiar with core review this but this doesn't seem like the right fix.
Also - FakeTensor is meant to represent the semantics of eager. we should not make eager only changes without a legitimate reason outside of FakeTensor.
@zou3519 could you review this pull request? |
Checked failures in https://github.com/pytorch/pytorch/actions/runs/13427521197/job/37951270051, those codes seem to be auto-generated by some script, but unable to find the script for xpu, it might be outside this repository. |
@pytorchbot rebase |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Successfully rebased |
2a039a4
to
b72fee5
Compare
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.
same comment - shouldnt change eager to make it align with fake tensor. fake tensor should change instead.
@eellison Thanks for the comment, I guess the suggested change is to remove the zero dim cpu case in the fake tensor side instead of copying the logic in the eager mode. |
@eellison , removed zero dim cpu tensor logic from fake_tensor.py, could you take a look again? |
Merging conflict, working on resolving the conflict. |
@pytorchbot rebase |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Rebase failed due to Command
Raised by https://github.com/pytorch/pytorch/actions/runs/14120360541 |
Successfully rebased |
5a5eca2
to
97001e1
Compare
@malfet fixed all failures, could you reenable CI? |
@malfet looks like no failure in CI, could you review this pull request? |
@eellison added a list to bypass zero dim cpu tensor logic, could you review the change again? |
Fixes #144748
In #144748, the inconsistency between the eager mode and the inductor mode is reported as a bug.
The root cause is fake_tenosr.py's find-common-device method,
pytorch/torch/_subclasses/fake_tensor.py
Line 833 in 0b0da81
This fix is to add a list for some ops to bypass zero-dim-cpu-tensor check to align with the eager mode.
cc @eellison @zou3519