GPU support?
Cupy provides GPU enabled sparse matrix implementation that has similar APIs to scipy.sparse.
I believe that only a slight modification makes sparse compatible to cupyx.scipy.sparse.
Is it in the scope of sparse's development?
The most significant problem I believe is how to prepare a testing framework. Travis does not provide gpu instance. It looks that Cupy's development team has their own server for testing.
The problem I have with this approach is that I do not have a CUDA GPU I can use for testing currently. Therefore, maintaining and testing any cupy-specific parts will be close to impossible for me.
I can accept PRs if and only if they do not contain any cupy specific code. The reason isn't the unwillingness to have it; it's the inability to maintain it.
Thanks, @hameerabbasi.
How about to enable the use of general scipy.sparse-like arrays (and also np.ndarray-like array) in sparse?
I think it would have done connection to #86, when we may want sparse stay that had similar api to scipy's sparse.
For API, I am thinking if we could do with the context manager, like
with use_array_modules(cupy, cupyx.scipy.sparse):
sparse.COO(coords, data)
which uses cupy.ndarray and cupyx.scipy.sparse instead of numpy and scipy.sparse, respectively.
I'm currently using Numba for some of the calculations on the NumPy. If Numba doesn't properly support these NumPy-ish arrays, then we run into issues.
I guess we could add this context and only test against NumPy specifically. We would also need to check if the contexts are all the same during a calculation.
I guess my point is it would quickly turn complicated, with very little chance left for me to support it. That said, I'm willing to give it a try if we can have a solid CI setup at the very least.
If Numba doesn't properly support these NumPy-ish arrays, then we run into issues.
Numba does not support Cupy... OK. It looks the GPU support is a little further away than I expected. Thanks for the information.
IIUC Sparse makes use of NumPy arrays to hold the coordinates and data as well as uses it for computation, correct? If so, I wonder to what extent protocols like NEP 18 can get us where we want to go here.
I am currently in a situation where I have a sparse 1D vector and I have been using sparse.COO. Now I have moved to a GPU server and have been implementing cupy. It seems on y'all's site that cupy integration is in the future, but not yet. I have looked into cupyx.scipy.sparse.coo_matrix but it doesn't support 1D vectors. Ideas? The other matrix and vector are cupy, so I'd like to find some answer that results in a cupy compatible array because then I can still use the gpu for this one operation.