Skip to content

Commit

Permalink
Avoid DeprecationWarning in cupy dispatch registration (#7836)
Browse files Browse the repository at this point in the history
In cupy 12 and above, cusparse should be imported from cupyx, not cupy
itself.
  • Loading branch information
wence- committed May 15, 2023
1 parent 693ad9d commit 6303f95
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion distributed/protocol/cupy.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ def dask_deserialize_cupy_ndarray(header, frames):


try:
from cupy.cusparse import MatDescriptor
from packaging.version import Version

if Version(cupy.__version__) >= Version("12"):
from cupyx.cusparse import MatDescriptor
else:
from cupy.cusparse import MatDescriptor
from cupyx.scipy.sparse import spmatrix
except ImportError:
MatDescriptor = None
Expand Down

0 comments on commit 6303f95

Please sign in to comment.