-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Detect the number of performance cores in the M1 macs via the new macos12 API #44072
Conversation
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 tried this on a MacBook Pro M1 Max and it works.
navid:gbaraldi_julia/ (add-ncpus-apple) $ /Users/navid/gbaraldi_julia/julia --threads=auto [13:59:59]
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.8.0-DEV.1459 (2022-02-08)
_/ |\__'_|_|_|\__'_| | add-ncpus-apple/304e20b1b6 (fork: 109 commits, 19 days)
|__/ |
julia> versioninfo()
Julia Version 1.8.0-DEV.1459
Commit 304e20b1b6 (2022-02-08 02:45 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin21.3.0)
CPU: Apple M1 Max
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.0 (ORCJIT, cyclone)
Environment:
JULIA_EDITOR = vim
julia> Threads.nthreads()
8
If someone can also see how to do that for Intel on Alderlake (on Linux/Windows). That might make @chriselrod happy |
…os12 API (JuliaLang#44072) * Use the new macos12 api to query perf cores
…os12 API (JuliaLang#44072) * Use the new macos12 api to query perf cores
…os12 API (JuliaLang#44072) * Use the new macos12 api to query perf cores
Just shooting in the dark here, but can you look around in e.g. |
Line 784 in 19eb307
|
I'm currently running the newly released Julia version 1.9.1 on an m2 mac air, and I'm facing the same issue. After reading through this thread about the detection of the number of performance cores in m1 CPUs, I wonder if the same patch may need to be applied to the m2 chips or if there's a different problem. I believe that Testing with 1.7.1 and 1.8.0-beta1~x64, |
So, from measurements, using all cores lead to slower performance than limiting to only performance cores, it also made the system very sluggish. I might be wrong but the 8 core m2 has 4 performance and 4 efficiency which means we tell blas to use 4 cores. |
Should fix #44067. The logic is a bit convoluted right now due to older mac versions not having the API.