-
Notifications
You must be signed in to change notification settings - Fork 17
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
[MKL] Get/Set number of threads - should get/set for BLAS, not for the whole MKL #74
Comments
Hmmm, I think I agree! I would be happy to accept a PR making this change, to force MKL to use |
You also need to use |
Yes, we need to essentially special-case this. |
This is pretty difficult to do in the current system. It would be best to not special case this mechanism in libblastrampoline, and instead let the various BLAS packages provide this at the Julia level. |
If MKL.jl (BLAS/LAPACK) is used with other packages providing access to others MKL features (FFT, VML, etc.) then a call to BLAS.set_num_threads(_) will set the maximum number of threads used by all this packages.
So if you need to manage threading yourself, e.g. for an embarrassingly parallelizable algo working on a lots of small matrix, then you would do a BLAS.set_num_threads(1). But at this point your FFT and VML calls also become single threaded.
MKL has a notion of "domain", see: mkl\include\mkl_types.h
All service settings functions should work on the domain they belong.
See MKL support-functions
The correct call:
Since the method is
BLAS.set_num_threads
, not VML or FFT...The current behavior interfere with VML, and as it is with the PR JuliaMath/IntelVectorMath.jl#55.
I think one should special case MKL in
https://github.com/JuliaLinearAlgebra/libblastrampoline/blob/main/src/threading.c
(and maybe elsewhere) since it's more than a BLAS/LAPACK library.
The text was updated successfully, but these errors were encountered: