-
-
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
set default blas num threads to Sys.CPU_THREADS / 2 in absence of OPENBLAS_NUM_THREADS #45412
Conversation
is |
This needs to not be tied to How about we set |
yeah this is not tied to |
The problem with Julia threading defaults ( |
yes. Well, this PR only sets I always wanted |
Right, but that setting is almost always wrong - like on my laptop where I have only 2 physical and 4 hyperthreaded cores, it will pick 8. And on a big machine where we have more CPUs, it will pick too few. That's why my preference is just Julia's reported cores divided by 2. Would be great to have @chriselrod and @staticfloat chime in. |
reusing: julia/stdlib/LinearAlgebra/src/blas.jl Line 109 in a5438f9
|
I think we should we do this directly through the |
like this? |
I think that's fine. But with Apple M1 and Intel Alder Lake & future generations of both, we're going to have more and more cases where this is suboptimal. We should use Julia's existing feature detection for this, but that's not something I've looked at yet. |
There needs to be (or already exists) a separate issue for doing feature detection in Julia for all packages to use. |
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.
There needs to be (or already exists) a separate issue for doing feature detection in Julia for all packages to use.
Yeah, no reason not to do this until then.
I'm merging this so that it gives us time to experiment and see how it is working out. |
Set default blas num threads to Sys.CPU_THREADS / 2 in absence of OPENBLAS_NUM_THREADS Co-authored-by: SamuraiAku <[email protected]> (cherry picked from commit 390503e)
Set default blas num threads to Sys.CPU_THREADS / 2 in absence of OPENBLAS_NUM_THREADS Co-authored-by: SamuraiAku <[email protected]>
fix JuliaLang/LinearAlgebra.jl#915