-
-
Notifications
You must be signed in to change notification settings - Fork 868
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
Add mixed precision (FP16) support for ROCm #7663
Conversation
/test mini |
Thanks, @jglaser! Your change looks good to me. Can I ask you to fix just static-checks? |
I also checked |
/test mini |
Thanks @takagi for moving this along. Looks like two CUDA related tests are still failing, however, I can't see the test results without logging in |
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.
LGTM!
CI failures are not related. Our CI requires logging in for security reasons. |
Thanks, @jglaser! |
This PR adds mixed precision support for matrix-matrix multiplies on ROCm, which is available in hipBLAS through
hipblasGemmEx
. On MI200 GPUs, this utilizes the MFMA (matrix fused-multiply add) instructions, which are intended as analogues of the NVIDIA tensor cores.For
cupy.float16
arrays, we allow the use of the hipBLAS primitive, which was previously disabled, and fp16 values were casted to single precision, albeit issuing a warning. I am not entirely sure if the reason for this was the lack of hardware and/or API support in earlier versions of the AMD libraries, therefore a version check for hipBLAS might be required. It appears though that support has been stable since ROCm 4.2.0 (https://github.com/ROCmSoftwarePlatform/hipBLAS/blob/develop/CHANGELOG.md).To verify that the code now uses
rocblas_gemm_ex
under the hood, enable rocBLAS runtime tracing with the unit test like this