Closed mingwandroid closed 6 years ago
Agreed. This came up in another PR not long ago. FWICT NUM_THREADS
is a misnomer as it has nothing really to do with the number of threads and everything to do with the maximum amount of memory available. So we should keep this in mind when choosing a value.
It mostly affects stack space requirements and does directly concern the maximum amount of threads this build of openblas
is able to launch in parallel. Less good CPUs are still able to cap this to sensible limits to prevent excessive thread eviction.
My understanding was that OpenBLAS would still detect the number of cores, which influences how many threads it launches. Does this change if we set NUM_THREADS
? IIUC it does not.
NUM_THREADS is a hard upper limit on the amount of threads that can be used. It's relatively inexpensive in terms of memory and more or less totally free in terms of performance.
Ok. Yeah I'm in favor of this change. Do you want to do a PR?
In defaults they use 128
.. otherwise the value is determined from the build machine instead and you'll fail to exploit high performance systems.