-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[C10] cpuinfo error handling #113771
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
[C10] cpuinfo error handling #113771
Conversation
If `cpuinfo_initalize` returns false, call to subsequent cpuinfo functions may result in `abort()` Also, `defaultNumThreads()` method is assumption if one method fails then try another, and finally return 1. Partially addresses #113568 [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/113771
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 4d942e8 with merge base 9146ca6 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
|
@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 |
It can fail on ARM platform if `/sys` folder is not accessible. In that case, call `std::thread::hardware_concurrency()`, which is aligned with the thread_pool initialization logic of `c10::TaskThreadPoolBase:defaultNumThreads()` Further addresses issue raised in #113568 Pull Request resolved: #114011 Approved by: https://github.com/kit1980 ghstack dependencies: #113771
Stack from ghstack (oldest at bottom):
If
cpuinfo_initalizereturns false, call to subsequent cpuinfo functions may result inabort()Also,
defaultNumThreads()method is assumption if one method fails then try another, and finally return 1.Alas there are no good way to test it on x86 platform, but on ARM one can replicate it by running
sudo chmod 750 /sysand thenpython3 -c "import torch;torch._C.profiler.gather_traceback(True, True, True)"🤖 Generated by Copilot at 4d942e8
Partially addresses #113568