-
Notifications
You must be signed in to change notification settings - Fork 98
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
Fix fallback gemm for complex scalar types #550
Conversation
…dom numbers are allowed
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.
Great catch, thanks for reintroducing the test improvements!
@ndellingwood @seheracer I have just noticed that |
@vqd8a in the code @seheracer is using |
@ndellingwood It was |
@vqd8a This is very surprising to me! Changing it from 10 to max results in larger diffs so that several bugs were exposed. That's why I thought max should be larger than 10. Vinh, can you point us to the code where you saw "1" as the returned value for max? Thanks! |
@seheracer I just printed out |
@crtrott can you confirm what Vinh is seeing is as expected?
|
I think it is 1+1j. See the file https://github.com/kokkos/kokkos/blob/develop/algorithms/src/Kokkos_Random.hpp, around line 511 to 515 |
That is correct. So probably the additional exposure happens because you now have actual complex values, instead of complex values where the imaginary part is zero. |
Thanks @vqd8a @crtrott @ndellingwood !! I think having the upper bound this way (1+1j) is better than 10 to catch errors concerning the imaginary parts. In addition, this is how Tpetra is testing gemm, so the tests are consistent now. I think we should keep |
@seheracer wrote:
Wait, Tpetra is calling a hand-rolled GEMM ? Tpetra only tests for types that the BLAS and cuBLAS supports. It's great that we have a fall-back implementation, but why aren't we calling cuBLAS? |
Description:
This PR fixes the fallback gemm resulting in large diffs with complex scalar type when the entries in the input random matrices have nonzero imaginary parts.
This defect was exposed when the upper bound of the random number generator (for A, B, and C matrices) in KokkosKernels gemm unit test was changed from
10
toKokkos::Random_XorShift64_Pool<...>::max()
, which is equal to1+1j
forcomplex<double>
. This PR includes this change too.Testing:
[sacer@white29 testing]$ ../scripts/test_all_sandia --spot-check --arch=Power8,Pascal60