KernelTuner / kernel_tuner

Kernel Tuner
https://kerneltuner.github.io/kernel_tuner/
Apache License 2.0
291 stars 49 forks source link

Add support for float16 to HIP backend #280

Closed loostrum closed 5 days ago

loostrum commented 5 days ago

The HIP backend failed with float16 numpy arrays as input. This is fixed by adding a float16 entry to the dtype map. ctypes does not have float16, but it is fine to use another type of the same size so I opted for int16.

Additionally, I have added myself to the Kernel Tuner author list as discussed with Ben.

sonarcloud[bot] commented 5 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

stijnh commented 5 days ago

While I think this PR is good, I am pretty sure that the HIP backend does not need to know the dtype of the arguments. It can just directly copy the bytes from the numpy array onto the GPU without looking at the data type. The pycuda backend does the same. I'm not sure why this check on the dtype exists in the first place.

benvanwerkhoven commented 5 days ago

Good point Stijn! I propose we merge this and then open an issue to discuss removing the check.