CuPy v14.1.0 Release Note
This release for the CuPy v14 series introduces new features, enhancements, and bug fixes.
💬 Join the Matrix chat to talk with developers and users and ask quick questions!
🙌 Help us sustain the project by sponsoring CuPy!
✨ Highlights
Support for large sparse matrices
CuPy now supports large sparse matrices, allowing 64-bit sized dimensions and number of nonzero elements. Similar to SciPy, creation functions will automatically choose the larger index dtype for the sparsity pattern. The added functionality mostly uses newly wrapped cuSPARSE calls.
Initial support for free-threaded Python
CuPy 14.1 now releases free-threaded Python 3.14t Linux wheels and includes a number of thread-safety fixes. As threading issues can be intermittent, please report any issues you encounter. A known limitation is that some threaded CUDA graph-capture calls may fail when using threads.
Support for structured dtypes with fields
CuPy now supports structured dtypes with fields in kernels. This enables previously missing features such as comparisons and casts/copies. Because CUDA requires a larger alignment in some cases, CuPy now includes the make_aligned_dtype helper to create structured dtypes with larger alignments than guaranteed by NumPy’s align=True.
Caching for CUDA C++ template instantiations
CuPy now caches template kernels instantiated using name_expressions with RawModule. This avoids recompilation in cases where CuPy was previously unable to use the on-disk cache.
Optional faster kernel compilation using PCH
Users can now set the environment variable CUPY_NVRTC_USE_PCH=1 to use NVRTC’s precompiled headers (PCH) with CUDA 12.8+. This can drastically speed up compilation of multiple kernels and should be especially useful when the on-disk cache is cold or not used.
Support for CUDA 13.2
CuPy now supports CUDA 13.2 and NCCL 2.29.
New API coverage
CuPy now supports cupy.byteswap, cupy.isdtype, cupy.matrix_transpose, cupy.linalg.matmul and the cupyx.scipy.linalg.sparse.bicgstab (BIConjugate Gradient STABilized) solver. cupy.repeat was sped up and extended to allow a CuPy array of repeats.
📝 Changes
See here for the complete list of merged PRs.
New Features
- Implement
ndarray.byteswap()(#9868) - Add bicgstab solver for sparse linear systems (#9889)
- Add int64 index support to
cupyx.scipy.sparse(#9914) - ENH: (almost) full structured dtype support (#9927)
Enhancements
- BUG,MAINT: Restructure SingleDeviceMemoryPool and locking (#9802)
- Always query hipcc for include directories in hiprtc (#9820)
- Allow cupy.ndarray as repeats argument to cupy.repeat (#9855)
- Support caching CUBINs generated with
name_expressions(#9912) - Deprecate sparse matrix APIs removed in SciPy 1.14 (#9921)
- Add
cupy.linalg.matmul,cupy.linalg.matrix_transposeandcupy.matrix_transpose(#9929)
NumPy/SciPy Compatibility
- Skip
test_solve_singular_emptyon NumPy >= 2.4 (#9843) - Add
cupy.isdtype(#9891)
Performance Improvements
- Allow using PCH via
CUPY_NVRTC_USE_PCH=1and use it for tests (#9783) - Use expected precision in
cupyx.scipy.ndimageinterpolation functions (zoom, shift, rotate, affine_transform, map_coordinates) (#9808) - Remove NumericTraits specializations for complex types (#9883)
- Validate hypergeometric inputs without syncing (#9885)
Bug Fixes
- fix(hip): cap linear_launch grid dim to prevent AQL work-item overflow (#9747)
- MAINT: add missing names to linalg.all (#9762)
- Guard against None conda prefix in _get_conda_cuda_path() (#9784)
- Fix DistributedArray missing NotImplementedError overrides for
mdspanandmT(#9789) - cupyx.scipy.sparse.linalg.gmres: report non-convergence when maxiter is not divisible by restart (#9796)
- BUG: Fix bug with minimum_phase (#9806)
- BUG: Don't use
--device-as-default-execution-spacefor hip (#9819) - BUG: Fix regression for 32bit index flag in
.realand broadcast (#9865) - BUG: Fix incomplete size guard for CUB segmented reduce and scan (#9869)
- BUG: Make
cutensorbindings threadsafe (and some small fixes) (#9870) - MAINT,BUG: cleanup pending, simplify PooledMemory, use pymutex (#9874)
- sparse: work around cuSPARSE SpMM gridDim.y overflow (#9850) (#9875)
- BUG: fix cupy.interp returning nan at exact knot when fp contains inf (#9876)
- fix(hip): use event-based sync for cross-device D2D copies (#9879)
- Fix ZeroDivisionError when sorting along zero-length axis (#9816) (#9880)
- Fix remaining floating-point inconsistencies and improve tests for
cupyx.scipy.ndimage.interpolation(#9893) - Fix hip mask errors (#9897)
- Fix silent corruption in thrust sort/argsort/lexsort under OOM (#9901)
- Fix cupy.kron raising ValueError on empty arrays + refactor and performance improvement (#9917)
- scipy.ndimage.label index overflow (#9919)
- Use cuda.pathfinder for CUDA component discovery (#9933)
- BUG: Introduce a "promotion" step and fix integer comparisons (#9935)
- Fix arguments to get_current_callback_manager for HIP (#9955)
Code Fixes
- Remove old Python 2 buffer protocol functions to remove warnings (#9726)
- Implement kernel cache save/load abstraction (#9743)
- Cython Compilation Warnings of implicit noexcept (#9754)
- Ingnore Cython IF warnings and avoid DEF uses (#9788)
- TST: Fixup some more tests (mainly cupyx) for free-threading (#9821)
- Bump SciPy minimum to 1.14 and remove now-dead version handling (#9925)
Documentation
- DOC: Fix
scipy.linalg.*comparison table (#9744) - DOC: note in Comparison Table that np.ma is not implemented; suggest alternative (#9844)
- Document env vars for source builds in Conda envs (#9924)
Installation
- Bump version to v14.1.0 (#9953)
Tests
- TST: Protect graph tests from failing when GPU is busy (#9716)
- CI: Bump windows kernel cache size (#9735)
- TST: migrate tests from unittest to pytest (#9740)
- CI: Use GCP-backed kernel cache in Windows CI (#9761)
- CI: Use GCP-backed kernel cache in Linux CI (#9770)
- CI: Fix cuda120 CI failures due to
FutureWarning(#9778) - Update
test_assumed_runtime_versionfor Windows + CUDA >=13.0 (#9786) - TST: Skip many tests when running with pytest-run-parallel (#9798)
- CI: Make sure local cache is warmed up at job start time (#9799)
- CI: Revert to use NCCL 2.28 in CUDA 13.1 CI (#9836)
- Small Fix for cusparseLt v0.9.0 (#9837)
- Cherry pick rocm fixes (#9871)
- DEV: Make
CUPY_TEST_GPU_LIMITmore reliable. (#9882) - Remove
test_assumed_runtime_version(#9903) - CI: Add CUDA 13.2 and NCCL 2.29 support (#9908)
- TST: Work around NumPy 2.4.5 regression in conj(). (#9931)
- Advertise free-threading support and add linux CI run (#9934)
👥 Contributors
The CuPy Team would like to thank all those who contributed to this release!
@astroboylrx @Bhuvan1527 @eriknw @ev-br @gdaisukesuzuki @gpinkert @grlee77 @ikrommyd @jberg5 @jeremyfirst22 @kmaehashi @larsoner @leofang @ManuCorrea @marco-pas @mdhaber @megha-darda @seberg