-
Notifications
You must be signed in to change notification settings - Fork 12
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
Feature request: support for matmul with integer matrices #64
Comments
Some Googling suggests that cuBLAS does in fact support integer matrices. But I can't get it to work when using the Even if cuBLAS does indeed support integer matrices, I think it would be great to also have support for integer matrices in GemmKernels.jl. |
Tensor Cores of the Turing generation do support integer GEMM, but only with 1-bit, 4-bit, or 8-bit integer inputs, and 32-bit accumulation, so I'm guessing you would need to pass e.g. an 8-bit A and B matrix and a 32-bit With regards to integer support for GemmKernels, I personally don't have a lot of time to continue working on it at the moment, but if anyone wants to add support, I'd be happy to answer any questions. One would need to extend the WMMA support in CUDA.jl to also include the Turing-generation Tensor Core operations first, and then see which adaptations to GemmKernels.jl are necessary. |
Or, alternatively, a non-WMMA code path. @thomasfaingnaert, we discussed that at some point, but could you detail what that would require? If we want to fold this into CUDA.jl or GPUArrays.jl we'll need such an option anyway. |
Off the top of my head, adding support for new datatypes requires the following:
# arr1, arr2 = 512 x 512 Float32 CuArray
@aligned arr1[1, 5:8] = arr2[1, 5:8] which automatically uses vectorised loads and stores?
|
As far as I can tell, cuBLAS does not support matrix multiplication with integer matrices. When I try, I get errors that look like this:
So, I was thinking that it could be a good use case for GemmKernels if it could support matmul for integer matrices.
Unfortunately, currently it looks like GemmKernels doesn't support integer matrices, for example:
Would it be possible to add support for integer matrices to GemmKernels?
Here is a full MWE:
cc: @vchuravy @thomasfaingnaert @maleadt
The text was updated successfully, but these errors were encountered: