-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
explicitly reset stderr/stdout in precompilation #125289
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/125289
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 3752a7c with merge base 1bcbc91 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
ghstack-source-id: d6c17386d1d58d722fb3931d75db22d81f88e74a Pull Request resolved: #125289
torch/_inductor/select_algorithm.py
Outdated
original_stdout = sys.stdout | ||
original_stderr = sys.stderr | ||
|
||
@contextmanager |
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.
do we know why thread pool executor is even playing with these things? or is that code outside of our control
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.
I haven't figured out yet. I added code which would error when stdout is reassigned but it didnt fire. All of the uses of stdout in torch/_inductor/ are unrelated. I also printed out all of the "bad" sys.stdout on exit. The StringIO objects do not match any of the same StringIO objects we construct inside torch inductor. Sometimes the bad objects are TextIOWrapper
which we dont construct inside torch/_inductor
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.
Approved, but please file an isssue with the repro so people will know about this if they hit something similar
I was seeing a weird bug where after running max-autotune my stdout would be misdirected. other people have not been able to repro this. cc ezyang msaroufim bdhirsh anijain2305 chauhang voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire [ghstack-poisoned]
ghstack-source-id: 1b3b75df68cc86a1b3e9272f783031d22aabcf90 Pull Request resolved: #125289
@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 |
I was seeing a weird bug where after running max-autotune my stdout would be misdirected. other people have not been able to repro this. Pull Request resolved: #125289 Approved by: https://github.com/shunting314, https://github.com/mlazos
… cpython bug (#125446) Fix for #125374. We dont have CI for this specific versions, but I verified locally. THere is a cpython bug from 3.11.0->3.11.7 where the ast parsing state is global, and errors with multiple threads. when dust settles a little around the new process based compilation we can look into migrating. Pull Request resolved: #125446 Approved by: https://github.com/Chillee ghstack dependencies: #125289
Stack from ghstack (oldest at bottom):
I was seeing a weird bug where after running max-autotune my stdout would be misdirected. other people have not been able to repro this.
cc @ezyang @msaroufim @bdhirsh @anijain2305 @chauhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire