-
-
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
Distributed: Set number of BLAS threads if LinearAlgebra is loaded, otherwise do nothing #28150
Conversation
Can we use |
I more general solution might be useful here since e.g. FFTW might also want to use this. |
Could you propose something? A vector in const thread_callbacks = []
function set_library_threads(n::Int)
for f in thread_callbacks
f(n)
end
end |
Unfortunately, I'm not sure how this could be done. I just realized that this might be relevant beyond LinearAlgebra. Maybe these packages should have some |
Why does loading "Distributed" do "magic things" to other libraries (BLAS). Why can't it be just a doc thing, "if you do distributed computing, make sure your libraries only use one core" or something. |
It could and it would indeed simplify things. It's not unreasonable to ask people to actively set the number of threads when using multiple processes. Often you'd probably want a combination of threads and processes anyway. So far we have assumed that people wanted to disable threading when using multiple processes but we could stop assuming that. As you've pointed out, the dependency structure required by the current assumption is also a bit unfortunate. |
Is there a decision to do something? Or close? |
I for one are in favour of making things simpler and stop having Distributed change the number of threads in the BLAS library. It made sense when we didn't have robust multi-threading support and the expectation was that users would use Distributed to do single machine work. Machines since then have also gained cores even on laptops. |
Got done in #30004 |
Breaks a dependency from Distributed -> LinearAlgebra.