-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
support Apple M1 Silicon #2335
support Apple M1 Silicon #2335
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2335 +/- ##
=======================================
Coverage 85.96% 85.96%
=======================================
Files 475 475
Lines 84558 84558
=======================================
Hits 72688 72688
Misses 11870 11870
Continue to review full report at Codecov.
|
#if __APPLE__ | ||
static int set_sched_affinity(const CpuSet& thread_affinity_mask) | ||
{ | ||
// https://developer.apple.com/library/archive/releasenotes/Performance/RN-AffinityAPI/index.html |
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.
This is a quite outdated document. Apple will not allow developers to set CPU affinity. In OS X 10.5 it worked, later it became a suggestion to OS X, then in 10.10 or so (as well in later ones), macOS will ignore any affinity settings.
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.
It returns KERN_NOT_SUPPORTED
QAQ
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.
It seems that we have no choice but trusts the thread scheduler in macOS. (I also tried processor_exit
to shutdown some cores, but that only works on the Intel ones.) I'm afraid that there's no way for us to do this...
Sad but true, QwQ
- [ ] cpu affinity on macos/ios