question about mixed precision dot
jinz2014 opened this issue · 4 comments
Would the mixed precision "dot" be added to the library ?
For mixed precision version (inputs are float while result is double), dot product is computed with double precision.
Reference
https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-dpcpp/2023-0/dot.html
Hi @jinz2014, thanks for raising this issue.
This would have to first be done in rocBLAS, then hipBLAS would basically work automatically with the rocBLAS backend. It doesn't look like cuBLAS supports this as far as I can tell so it would only work with the rocBLAS backend.
I will discuss with the team if this is a common usecase and it can be added, I think the changes would be fairly minimal but would have to be tested, maintained, etc. If added, it would use the hipblasDotEx(...) API (or rocblas_dot_ex if using rocBLAS directly).
I'll keep you updated here with any progress,
Daine
@jinz2014 mixed precision dot support for 32-bit input and 64-bit output/compute has been added in rocBLAS at ROCm/rocBLAS@1ae1122. This uses the rocblas_dot_ex(...) api in rocBLAS, or the hipblasDotEx(...) api in hipBLAS. This addition will be picked up in a future ROCm release - I'll comment again here when it's available.
Thanks,
Daine
Hi again @jinz2014,
hipblasDotEx(...) should support mixed-precision dot with 32-bit float input and 64-bit double output/compute with the rocBLAS backend now in ROCm 6.2. You can also take a look at the rocblas_dot_ex(...) documentation for ROCm 6.2 as well for more info.
Thanks again for the suggestion,
Daine