
CuPy
A NumPy/SciPy-compatible array library that runs Python array code on NVIDIA GPUs.
- Stars
- 12.4k
- Forks
- 1.2k
- Licence
- MIT
- Language
- Python
- Last update
- 4 days ago
- Type
- Library
What it is
CuPy is a Python library that mirrors the NumPy and SciPy interfaces but runs the array calculations on a GPU. The README describes it as a drop-in replacement, so existing NumPy or SciPy code can often be moved to the GPU with few changes. It also exposes lower-level CUDA features for people who need them.
- Run an existing NumPy array calculation on the GPU by changing the import to cupy
- Pass CuPy arrays to existing CUDA C/C++ programs through RawKernels
- Use CUDA streams or call CUDA Runtime APIs directly from Python
Great for
- Python users with NVIDIA GPUs who want to speed up NumPy-style array code
- Researchers or engineers moving existing NumPy/SciPy scripts onto a GPU
- Developers who want to call their own CUDA C/C++ kernels from Python using arrays
Not ideal for
- People without an NVIDIA (or supported AMD) GPU, since the library is built around GPU hardware
- Small workloads where data transfer to the GPU would cost more than the computation saves (general reasoning, not stated in the README)
How to get it
- 1
Install with a package manager
You'll need: Python · NVIDIA GPU with a CUDA driver
Install for CUDA 12.x (pip)
pip install cupy-cuda12xInstall for CUDA 13.x (pip)
pip install cupy-cuda13xInstall from conda-forge
conda install -c conda-forge cupy - 2
Run it
- Install a CuPy package matching your CUDA version using one of the install commands
- Start Python and run import cupy as cp
- Create an array with cp.arange(6).reshape(2, 3) and call .sum(axis=1) to see a result on the GPU
- 3
Get the most out of it
- Read the comparison page in the docs to see which NumPy/SciPy code will run unchanged
- Use RawKernels to run your own CUDA C/C++ code on CuPy arrays
- Try the Docker image (docker run --gpus all -it cupy/cupy) to avoid local setup
- Explore the examples folder and the tutorial linked in the README
Downloads
Strengths
- Familiar NumPy and SciPy API lowers the cost of switching to GPU computing
- Supports both CUDA (NVIDIA) and ROCm (AMD, experimental) platforms per the README
- MIT licensed with official wheels and conda packages
Trade-offs
- AMD ROCm support is marked experimental in the README
- Requires a compatible NVIDIA CUDA setup; the README lists CUDA 12.x and 13.x packages
- Not every NumPy/SciPy function is covered, so the comparison page should be checked for your code
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| cupy (this) | 12.4k | Library | intermediate | 4 days ago | Python users with NVIDIA GPUs who want to speed up NumPy-style array code |
| gpu.js | 15.5k | Library | intermediate | 6 days ago | Developers who need to speed up large numeric computations in the browser |
| PythonDataScienceHandbook | 50.3k | Learning resource | beginner | 2.4 years ago | Students learning NumPy, Pandas, Matplotlib, or Scikit-Learn through hands-on examples |
| stats | 43k | App | beginner | 5 days ago | Mac users who want a glanceable view of CPU, memory, network or battery in the menu bar |
| WebGL-Fluid-Simulation | 16.8k | App | beginner | 2.0 years ago | People curious about how fluids behave in a visual, hands-on way |
| cheatsheets-ai | 15.4k | Learning resource | beginner | 7.1 years ago | Students who want a one-page summary of a library's main functions |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.