Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jl_cpu_threads: exclude big.LITTLE efficency cores (#42099)
* jl_cpu_threads: exclude big.LITTLE efficency cores On big.LITTLE systems, we generally only want to spawn as many threads/tasks as there are performance cores. By default, we want to leave the efficiency cores alone, as they may end up choking on the heavy workloads we are likely to schedule. Even something as simple as starting `julia` and initializing OpenBLAS on each thread can cause a system-wide latency spike as the efficiency cores struggle to chew through the momentary workload. To fix this, we attempt to identify when we are running on a big.LITTLE system (the only one currently widely supported is the Apple M1), and we subtract out the known number of efficiency cores. Once macOS 12 is released, we will be able to use the official API for enumerating the perflevels of the available cores, demonstrated in this PR to pytorch's cpuinfo repository [0]. [0] https://github.com/pytorch/cpuinfo/blob/8ab2db2d405436f1014ed603021545b3b6b6f1ae/src/arm/mach/init.c#L161-L163 * whitespace
- Loading branch information
d0d895e
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.
M1 Max and Pro have only 2 efficiency cores