You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While attempting to demonstrate the use of cupy.sparse arrays underneath Dask.Array, I found that cupy.sparse doesn't yet have vstack or hstack functions for concatenating sparse arrays. I have filed issue [1] with the cupy project.
Once this has been implemented, the corresponding concatenate function will need to be registered within Dask. I adapted the following code block from the scipy.sparseconcatenate_lookup function.
@concatenate_lookup.register_lazy("cupyx")defregister_cupyx():
importcupyximportcupydef_concat_cupy_sparse(L, axis=0):
ifaxis==0:
returncupy.sparse.vstack(L)
elifaxis==1:
returncupy.sparse.hstack(L)
else:
msg= (
"Can only concatenate cupy sparse matrices for axis in ""{0, 1}. Got %s"%axis
)
raiseValueError(msg)
concatenate_lookup.register(cupyx.scipy.sparse.spmatrix, _concat_cupy_sparse)
I noticed that you volunteered to help resolve this on the cupy side. Thanks @cjnolet . I'm looking forward to seeing this work. It's nice seeing all of the Numpy implementations converge a bit. (cc @stefanv )
Activity
mrocklin commentedon Nov 22, 2019
This also came up recently in scverse/scanpy#921
mrocklin commentedon Nov 22, 2019
I noticed that you volunteered to help resolve this on the cupy side. Thanks @cjnolet . I'm looking forward to seeing this work. It's nice seeing all of the Numpy implementations converge a bit. (cc @stefanv )
jakirkham commentedon Mar 9, 2020
This is being attempted in PR ( #5735 ).