You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cblas_dgemv error during matrix multiplication #1085
I've been sometimes getting the error message Intel MKL ERROR: Parameter 9 was incorrect on entry to cblas_dgemv. when running A.dot(b), where A is 2-D and b is 1-D. This happens when I link with the Intel MKL library. This doesn't crash the program but leads to the wrong result. Does anyone know what the error message means?
These are the docs for Intel's cblas_dgemv implementation. I'm guessing that parameter 9 is the incx parameter, which the docs say must not be zero. If the 1-D array is the result of broadcasting, its stride may be zero, and I'm not sure if ndarray checks for that before calling cblas_dgemv. I'm also not sure what happens if the stride is negative.
Activity
jturner314 commentedon Oct 22, 2021
Can you provide an example? In particular, it would be helpful to print the following for each array:
These are the docs for Intel's
cblas_dgemvimplementation. I'm guessing that parameter 9 is theincxparameter, which the docs say must not be zero. If the 1-D array is the result of broadcasting, its stride may be zero, and I'm not sure ifndarraychecks for that before callingcblas_dgemv. I'm also not sure what happens if the stride is negative.YuhanLiin commentedon Oct 23, 2021
This is the code:
This is the printout:
Looks like
remove_indexis setting the stride to 0. Things work fine with 1-D arrays when I don't use it.jturner314 commentedon Oct 23, 2021
#1088 should fix this issue. Will you please confirm? A simple way to test would be to add the following to your
Cargo.toml:YuhanLiin commentedon Oct 23, 2021
I get this printout instead:
The error is no longer present and the result is correct. The stride of the 2nd array is still 0 but I don't know if that's a bug.
jturner314 commentedon Oct 23, 2021
Okay, great. Thanks for confirming that the PR fixes the issue. The stride of 0 is not a bug – for a 1-D array with length 1, the stride is arbitrary.