-
Notifications
You must be signed in to change notification settings - Fork 24.9k
[dynamo] Prevent unnecessary recompilation, when using disable inside of compile #157491
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
[dynamo] Prevent unnecessary recompilation, when using disable inside of compile #157491
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/157491
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New Failures, 37 PendingAs of commit 1a03f45 with merge base 34c8033 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
The committers listed above are authorized under a signed CLA. |
@pytorchbot label "topic: not user facing" |
Your fix might cause a issue that could lead to unexpected behavior in the following repro code; the inductor isn't compiling any functions.
|
Thx @thenumberouscode, I’ll look into that today, try to reproduce it and improve the fix if needed |
Bro, I tried to fix this issue as well. Would you mind checking it for me? Thanks! |
I think this fix needs further refinement. I'm closing the PR for now |
Fixes #157399 by skipping convert_frame._compile for functions with
code.co_names
equal to(torch, _dynamo, disable)
It's my naive first approach and my first PR to PyTorch. I tested it locally on simple tensors and seem to work fine. I'll be grateful for a further guidance with improving the fix and adding unit tests.
Thanks!
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames