Overview
CuPy 13.0, released on January 15, 2024, prepares NumPy 2.0 compatibility and improves CUDA kernel performance.
Main Features
NumPy 2.0 compatibility
CuPy 13 aligns its API with NumPy 2.0, supporting new dtypes and deprecating old APIs.
python
import cupy as cp
import numpy as np
# API aligned with NumPy 2.0
x = cp.array([1, 2, 3, 4, 5])
print(cp.mean(x)) # 3.0 (GPU)
print(cp.asnumpy(x)) # convert to NumPy
print(type(x.get())) # numpy.ndarray
Optimized CUDA kernels
Reduction kernels and sort operations are optimized for recent GPUs (Ampere, Hopper).
python
import cupy as cp
# Optimized GPU operations
x = cp.random.randn(1_000_000)
y = cp.sort(x) # optimized GPU sort
z = cp.sum(x ** 2) # GPU reduction
cp.cuda.Stream.null.synchronize()
print(f'Sum of squares: {float(z):.2f}')
