-
Notifications
You must be signed in to change notification settings - Fork 22.6k
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] Fix lineinfo generation on PY3.11+ #103525
Conversation
Do binary search for instruction index when on 3.11 rather than divide index by 2 Fixes #103355
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/103525
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 0b22750: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
We could replace sys.version_info >= (3, 11)
checks elsewhere as well.
@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 |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
Heh, I need to do linear search, as |
@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 |
for inst in instructions[0:targe.offset//2]: inst.starts_line = None
, with the one that that iterates over all instructions untilinst.offset == target.offset
condition is met, this way making it uniform across Python bytecode dialects (Python-3.11+ bytecode size is variable, while bytecode size is fixed for older Pythons)[i for i in instructions if i.offset == offset][0]
withnext(i for i in instructions if i.offset == offset)
, which aborts the evaluation after condition met for the first time, according to:is_py311_plus
variable rather than checkingsys.version_info
🤖 Generated by Copilot at 6cd7f27
Fixes #103355
cc @voznesenskym @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @msaroufim