[Tracker] Implement all `scipy.*` APIs in CuPy
See original GitHub issueImplement 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.
- :shipit: Module available in CuPy and major features are implemented (may still have a few unimplemented APIs).
List of Modules
- π₯ Clustering package (
scipy.cluster
)- π₯ K-means clustering and vector quantization (
scipy.cluster.vq
) (#5947) - π₯ Hierarchical clustering (
scipy.cluster.hierarchy
) (#3434)
- π₯ K-means clustering and vector quantization (
- π₯ Constants (
scipy.constants
) - :shipit: Discrete Fourier transforms (
scipy.fft
) - :shipit: Legacy discrete Fourier transforms (
scipy.fftpack
) (note: deprecated, no further development planned) - π₯ Integration and ODEs (
scipy.integrate
) (#7019) - π₯ Interpolation (
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
(note: unlikely supported in CuPy) - π₯ Low-level LAPACK functions (
scipy.linalg.lapack
) - π₯
scipy.linalg.cython_lapack
- π₯ Interpolative matrix decomposition (
scipy.linalg.interpolative
)
- π₯ Low-level BLAS functions (
- :shipit: Multidimensional image processing (
scipy.ndimage
) - π₯ Orthogonal distance regression (
scipy.odr
) - π₯ Optimization and root finding (
scipy.optimize
) (#6112) - π₯ Signal processing (
scipy.signal
)- π₯
scipy.signal.windows
- π₯
- :shipit: Sparse matrices (
scipy.sparse
)- :shipit: Sparse linear algebra (
scipy.sparse.linalg
) - π₯ Compressed sparse graph routines (
scipy.sparse.csgraph
) (#2431)
- :shipit: Sparse linear algebra (
- π₯ Spatial algorithms and data structures (
scipy.spatial
) (#5946)- π₯ Distance computations (
scipy.spatial.distance
) (#5946) - π₯ Spatial transformations (
scipy.spatial.transform
)
- π₯ Distance computations (
- π₯ Special functions (
scipy.special
) - π₯ 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: Miscellaneous routines (scipy.misc
) is excluded from the list as it is planned to be removed in the upstream (https://github.com/scipy/scipy/issues/15608).
Starter Task
If you are new to CuPy and wondering where to start, here are some good first issues to try. They are relatively simple and independent.
- APIs under Special functions (
scipy.special
) - APIs under Statistical Functions (
scipy.stats
) scipy.sparse.block_diag
(#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
master
branch.
Note that you will need a GPU environment to develop CuPy.
See also: NumPy API Tracker Issue #6078
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:5 (5 by maintainers)
Top GitHub Comments
This looks great, thanks @kmaehashi!
Note that weβre quite likely deprecating this module in SciPy 1.9.0 (see https://github.com/scipy/scipy/issues/15608), so I suggest not working on that.
@kmaehashi, RAFT contains hierarchical clustering code as well: https://github.com/cupy/cupy/issues/3434.
RAFT also contains functions for computing contingency table and sampling from various distributions. Wondering if those might be useful here as well.