Skip to content
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

Warn users about *_NUM_THREADS behavior in multithreaded Julia codes #106

Closed
carstenbauer opened this issue Jan 30, 2022 · 3 comments
Closed

Comments

@carstenbauer
Copy link
Member

OpenBLAS and MKL behave very much differently when used in a multithreaded Julia process. Understandably, this leads to confusions for users. Given that using MKL is seen and also marketed as the easiest way to switch between OpenBLAS and MKL I think a warning in the README.md about the different behavior in a multithreaded settings is warranted.

Example:
The current MKL default for BLAS.get_num_threads() is # of cores, i.e. 40 on my machine. While this is good for serial Julia, it's pretty bad when you run your code with julia -t N in which case you will immediately oversubscribe your cores by a factor of N. This is not the case for OpenBLAS, which will still use 40 BLAS threads. However, there it is generally better to set OPENBLAS_NUM_THREADS=1.

@ViralBShah
Copy link
Contributor

I suspect this all needs to go into the Julia manual's multi-threading section (even for notes related to MKL).

@carstenbauer
Copy link
Member Author

Yeah, maybe. Definitely the OpenBLAS related things.

(BTW, I've written some compact notes down in the ThreadPinning.jl docs, see here)

@carstenbauer
Copy link
Member Author

Closing in favor of JuliaLang/julia#44201.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants