Here’s something apparently going on with the openblas bottle. I and some Octave.app users have found that its MAX_THREADS is set to 6, even when you run it on an 8- or 10-core Mac, where I’d expect it to be 16 or 20. This shows up in Octave when you run
On my 10-core iMac Pro “angharad”:
With bottled openblas:
$ octave octave:1> version -blas ans = OpenBLAS (config: OpenBLAS 0.3.12 DYNAMIC_ARCH NO_AFFINITY USE_OPENMP Haswell MAX_THREADS=6)
brew reinstall --build-from-source openblas:
$ octave -q octave:1> version -blas ans = OpenBLAS (config: OpenBLAS 0.3.12 DYNAMIC_ARCH NO_AFFINITY USE_OPENMP Haswell MAX_THREADS=20)
I’m guessing that MAX_THREADS is set to 6 at build time, based on the size of the VM in the bottle build farm. This means that when you run a bottled openblas on a Mac with more than 3 cores, it’s underutilizing the CPU. No big deal on a quad-core, but may be a significant waste on an 8-core or more.
You can set OMP_NUM_THREADS, but that only seems to work to reduce the number of threads below the built-in MAX_THREADS; setting it to a higher value has no effect.
For power users, the easy workaround is to just reinstall openblas from source. But that’s kind of a bummer for non-power-users.
Any ideas what a good thing to do here is?
Downstream bug report: https://github.com/octave-app/octave-app/issues/214