Overview

CuPy 11.0, released on June 15, 2022, brings significant performance improvements and optimizes GPU memory usage.

Main Features

Performance improvements

Element-wise operations and reductions are accelerated through better kernel fusion and optimized scheduling.

python
import cupy as cp

# Accelerated operations
a = cp.random.randn(5000, 5000)

# Optimized reduction
mean = cp.mean(a, axis=1)
std = cp.std(a, axis=1)
print(f'Mean shape: {mean.shape}')  # (5000,)

Optimized memory management

The GPU memory pool is improved to reduce fragmentation and allow better utilization of available memory.

python
import cupy as cp

# Memory pool management
pool = cp.get_default_memory_pool()
print(f'Used: {pool.used_bytes() / 1e6:.1f} MB')
print(f'Total: {pool.total_bytes() / 1e6:.1f} MB')

# Free unused memory
pool.free_all_blocks()
print(f'After free: {pool.used_bytes() / 1e6:.1f} MB')

Sources