Support Int types in backend_cuda
Currently, backend_cuda
only supports 3 types: half(float16), float(float32) and double(float64).
Some users are asking for Int types support which is not easy for all operators:
Operators with Cublas kernels:
For the moment we only use cublasGemm and from the documentation, it supports int8 and int32 so these operators won't create a problem.
Operators with Custom kernels:
These operators have custom kernels in a .cu file. For these operators, supporting Int types is rather easy.
Operators with Cudnn kernels:
These operators' kernels are based on Cudnn functions. For these operators the task won't be easy since for some cudnn functions, int types are not supported.
example:
- cudnnPoolingForward (does not support int tensors)
- cudnnConvolutionForward (only supports CUDNN_DATA_INT8 but not CUDNN_DATA_INT32)
- ...
So what should we do for Cudnn-based operators? Will there be a specific custom kernel for int types besides the cudnn one for float types?