-
-
Notifications
You must be signed in to change notification settings - Fork 956
Description
Implement GPU version of scipy.*
functions in cupyx.scipy.*
namespace.
This is a tracker issue that summarizes the implementation status of each SciPy public module in CuPy. See the comparison table for details.
Legends
- 🥚 Module not yet available in CuPy.
- 🐥 Module available in CuPy but coverage needs improvement.
Module available in CuPy and major features are implemented (may still have a few unimplemented APIs).
- ❌ Out of scope.
List of Modules
- 🥚 Clustering package (
scipy.cluster
)- 🥚 K-means clustering and vector quantization (
scipy.cluster.vq
) (Equivalent of scipy.cluster.vq.kmeans #5947) - 🥚 Hierarchical clustering (
scipy.cluster.hierarchy
) (Equivalent of scipy.cluster.hierarchy.linkage #3434)
- 🥚 K-means clustering and vector quantization (
- 🥚 Constants (
scipy.constants
) Discrete Fourier transforms (
scipy.fft
)Legacy discrete Fourier transforms (
scipy.fftpack
) (note: deprecated, no further development planned)- 🥚 Integration and ODEs (
scipy.integrate
) (Numerical Differential Equation Integration #7019) Interpolation (
scipy.interpolate
) (Tracker: cupyx.scipy.interpolate #7186)- 🥚 Input and output (
scipy.io
)- 🥚
scipy.io.arff
- 🥚
scipy.io.matlab
- 🥚
scipy.io.wavfile
- 🥚
- 🐥 Linear algebra (
scipy.linalg
)- 🥚 Low-level BLAS functions (
scipy.linalg.blas
) - ❌
scipy.linalg.cython_blas
- 🥚 Low-level LAPACK functions (
scipy.linalg.lapack
) c.f.cupyx.lapack
- ❌
scipy.linalg.cython_lapack
- 🥚 Interpolative matrix decomposition (
scipy.linalg.interpolative
)
- 🥚 Low-level BLAS functions (
Multidimensional image processing (
scipy.ndimage
)- 🥚 Orthogonal distance regression (
scipy.odr
) - 🥚 Optimization and root finding (
scipy.optimize
) (Any plans for scipy.optimize? #6112) Signal processing (
scipy.signal
) (Tracker: cupyx.scipy.signal #7403)scipy.signal.windows
(Tracker: cupyx.scipy.signal.windows #7404)
Sparse matrices (
scipy.sparse
)Sparse linear algebra (
scipy.sparse.linalg
)- 🐥 Compressed sparse graph routines (
scipy.sparse.csgraph
) (Compressed Sparse Graph Routines (scipy.sparse.csgraph
) #2431)
Spatial algorithms and data structures (
scipy.spatial
) (cupyx.scipy.spatial
andcupyx.scipy.spatial.distance
packages #5946)- 🐥 Distance computations (
scipy.spatial.distance
) (cupyx.scipy.spatial
andcupyx.scipy.spatial.distance
packages #5946) - 🥚 Spatial transformations (
scipy.spatial.transform
)
- 🐥 Distance computations (
- 🐥 Special functions (
scipy.special
) (note: planned to be backed by SciPy in future Add complex support for the digamma function #8163) - 🐥 Statistical functions (
scipy.stats
)- 🥚 Contingency table functions (
scipy.stats.contingency
) (note: RAFT could be used) - 🥚
scipy.stats.distributions
- 🥚 Statistical functions for masked arrays (
scipy.stats.mstats
) (note: masked arrays unsupported in CuPy) - 🥚 Quasi-Monte Carlo submodule (
scipy.stats.qmc
) - 🥚 Random Number Generators (
scipy.stats.sampling
) (note: RAFT could be used)
- 🥚 Contingency table functions (
Note: Several modules in SciPy such as scipy.cluster.hierarchy
accepts CuPy ndarrays as inputs through the Array API standard.
Starter Task
If you are new to CuPy and wondering where to start, here are some good first things to try. They are relatively simple and independent.
- APIs under Statistical Functions (
scipy.stats
) scipy.sparse.block_diag
(cupyx.scipy.sparse.block_diag
working with cupy sparse matrix on GPU #7058)scipy.sparse.load_npz
scipy.sparse.save_npz
scipy.constants.*
(hint: most things except for methods can just be borrowed from SciPy)
Steps to Contribute
-
Fork and star ⭐ the CuPy repository 😉
-
Pick a function you want to work on from any of the modules listed above. You can find the function in the SciPy API Reference to understand what should be implemented. If you want to work on new modules (🥚), first discuss with us on this issue.
-
Implement a function in your branch. If you need help, join Gitter or just ask for help in this issue.
-
Don't forget to write a test code!
-
Build CuPy and run tests to confirm that the function runs fine:
pip install -e . && pytest tests/cupyx_tests/scipy_tests/PATH_TO_YOUR_TEST
See the Contribution Guide for details. -
Submit a pull-request to the
main
branch.
Note that you will need a GPU environment to develop CuPy.
See also: NumPy API Tracker Issue #6078