-
Notifications
You must be signed in to change notification settings - Fork 83
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
Kronecker product between Diagonal
and AbstractGPUArray
#585
Comments
cc @albertomercurio who provided the initial implementation in #575 |
The However, at the moment of writing that function, I thought that the This means that the current implementation for the sparse case should be constrained to Speaking of @ytdHuang's question, I think it would still be useful to define methods for a generic identity matrix, which are independent on the Array type. For this case, FillArrays.jl would be the solution. Indeed, we should only implement the method for If you agree on this implementation, I can make these PRs, but I don't know whether to use FillArrays.jl as a direct dependency or as an extension. |
But I think applying kronecker product between a CPU diagonal and GPU sparse matrices is also very useful... |
If the diagonal is constant yes, but make it for generic One can first convert the diagonal vector to a CUDA one, but I don't think it is a good idea. Linear algebra operations should always be between compatible types. I don't know what @maleadt thinks about it. |
We generally don't support array operations on mixed data sources, as the performance characteristics may be very surprising (having to allocate or upload behind the scenes). |
Yes indeed. But what do you recommend to do? Can I write a FillArrays.ls extension? Or can I just import FillArrays as a direct dependency to both CUDA and KernelAbstractions? |
I think an extension would be a better fit here -- you're suggesting adding a specific implementation as a method that dispatches on |
Yes. We just add a method for the |
The Kronecker product between
Diagonal
andCUDA.CUSPARSE.AbstractCuSparseMatrix
works:Is it possible to also support Kronecker product between
Diagonal
and (dense)AbstractGPUArray
?Because currently it's using scalar indexing:
I post it here because this should also help for other GPU backends,
Metal
etc.The text was updated successfully, but these errors were encountered: