-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[TorchScript][tensorexpr] imbue locale for IRPrinter #136458
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
[TorchScript][tensorexpr] imbue locale for IRPrinter #136458
Conversation
We had an internal report where the NNC-generated CUDA code had thousands separators in integer literals. Although I wasn't able to cleanly repro, I did come up with a hacky repro and verified that this fix works. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/136458
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit a7bd0ac with merge base 663e760 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
We had an internal report where the NNC-generated CUDA code had thousands separators in integer literals. Although I wasn't able to cleanly repro, I did come up with a hacky repro and verified that this fix works. [ghstack-poisoned]
|
@davidberard98 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
| return printer_os_; | ||
| } | ||
|
|
||
| class PrinterStream : public std::ostream { |
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.
Should we do this as a RAII where we restore the prior locale after we're done printing ?
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 think this should only affect one instance of the ostream; it doesn't affect global state.
... however, NVRTC does set the global locale to C
|
@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 |
We had an internal report where the NNC-generated CUDA code had thousands separators in integer literals. Although I wasn't able to cleanly repro, I did come up with a hacky repro and verified that this fix works (see pytorch#136459). Differential Revision: [D63278771](https://our.internmc.facebook.com/intern/diff/D63278771) Pull Request resolved: pytorch#136458 Approved by: https://github.com/eellison
Stack from ghstack (oldest at bottom):
We had an internal report where the NNC-generated CUDA code had thousands separators in integer literals. Although I wasn't able to cleanly repro, I did come up with a hacky repro and verified that this fix works (see #136459).
Differential Revision: D63278771
cc @EikanWang @jgong5