cudarray icon indicating copy to clipboard operation
cudarray copied to clipboard

fp16

Open filmo opened this issue 8 years ago • 3 comments

Is it possible to set up arrays using FP16 rather than FP32 ?? (I didn't see anything obvious. Looks like the code using fp32 right now. I seem to recall seeing it being set to 32 somewhere in the code.)

If fp16 is possible, is it possible to convert fp32 arrays to fp16 directly as it is doing type conversion in numpy?

filmo avatar Mar 30 '16 01:03 filmo

Good question! FP16 is not supported at the moment. I expect it would be fairly straightforward (but tedious) to add FP16 to all the CUDA kernels. Maybe it's easier to simply replace all occurrences of FP32 with FP16 as a hack.

  • Anders

andersbll avatar Mar 30 '16 06:03 andersbll

I've only dabbled with CUDA and C++. I see many of the kernels taking 'float' as their data type. Would each kernel need to be duplicated to take half floats? or is it possible with templating to abstract this so that any particular type of float or int can be handled through redirection?

filmo avatar Mar 30 '16 22:03 filmo

I think all kernels have types as template parameters. Thus, you can add float16 support by instantiating template functions with float16. Alternatively you can try to change all occurences of float32 to float16.

andersbll avatar Mar 31 '16 09:03 andersbll