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
Fix ZeroDivisionError when unfolding a zero-dimension tensor in compile mode #113259
Fix ZeroDivisionError when unfolding a zero-dimension tensor in compile mode #113259
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/113259
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 009cbea with merge base 6e73ae2 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label "release notes: inductor" |
x = torch.rand([1,0], dtype=torch.float32) | ||
|
||
y = forward(x) | ||
compiled_y = torch.compile(forward, mode='max-autotune',fullgraph=True)(x) |
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.
This test doesn't need max-autotune. Also, it should go in test_torchinductor.py
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.
Appreciate the quick review! I put it under CommonTemplate but I'm having trouble running it locally.
I'm on a mac and it's looking like this line
if HAS_CPU and not torch.backends.mps.is_available():
is short circuiting the CommonTemplate tests from running.
If I comment out the and not torch.backends.mps.is_available()
part
python test/inductor/test_torch inductor.py -k test_unfold_zero_dimension_tensor
passes!
Co-authored-by: peterbell10 <peterbell10@live.co.uk>
x = torch.rand([1, 0], dtype=torch.float32) | ||
|
||
y = forward(x) | ||
compiled_y = torch.compile(forward, fullgraph=True)(x) |
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.
@lamroger Just out of curiosity, I executed this line only inside python interpreter. It still throws out ZeroDivisionError
. Do you have any clue why? but pytest passes.
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.
Hmmm maybe you can reload the python REPL or look at the stack trace to see which files are being executed and make sure the right ones are patched locally.
That worked for me when I was fiddling around
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.
Interestingly. it is working now without an exception. Probably, the outdated module was still used.
@pytorchbot merge |
Merge startedYour 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 |
…le mode (pytorch#113259) Fixes pytorch#113026 Pull Request resolved: pytorch#113259 Approved by: https://github.com/peterbell10
Fixes #113026
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler