Highlights
The CuPy v8.0.0 release includes a number of new features, as well as enhanced NumPy/SciPy functionality coverage.
-
TensorFloat-32 (TF32) Support
- CuPy now supports TensorFloat-32, a new feature available in NVIDIA Ampere GPU and CUDA 11. Set
CUPY_TF32=1environment variable to boost the performance of matrix multiplications in routines such ascupy.matmulorcupy.tensordot.
- CuPy now supports TensorFloat-32, a new feature available in NVIDIA Ampere GPU and CUDA 11. Set
-
Official support for NVIDIA cuTENSOR and CUB libraries
-
Enhanced kernel fusion
- While combining multiple kernels into a single one using
cupy.fuse, it was only possible to use a single reduction operation (cupy.sum, etc.) at the end. With the new kernel fusion mechanism available in CuPy v8, now it is possible to combine multiple element-wise operations with interleaved reductions.
- While combining multiple kernels into a single one using
-
Automatic tuning of kernel launch parameters
- CuPy now supports discovering the optimal CUDA kernel launch parameters depending on the data and device properties for better performance. See the API reference (
cupyx.optimizing.optimize) for details.
- CuPy now supports discovering the optimal CUDA kernel launch parameters depending on the data and device properties for better performance. See the API reference (
-
Memory pool sharing with external libraries
- With the new
PythonFunctionAllocatorAPI, you can let CuPy use arbitrary Python functions instead of a built-in memory pool when managing GPU memory. This improves interoperability with external libraries; for example, you can flexibly use CuPy to preprocess data or use its custom CUDA kernel features inside PyTorch. With pytorch-pfn-extras bundled allocator it is possible to easily use the PyTorch memory pool from CuPy.
- With the new
-
Improved NumPy/SciPy function coverage
- Many functions added, including the NumPy Polynomials package (results of Google Summer of Code 2020, thanks @Dahlia-Chehata!), the SciPy image processing package, and extended support for the SciPy sparse matrices package.
For the list of all backward-incompatible changes in v8, please refer to the Upgrade Guide.
Notes on Wheel Packages
- CuPy for CUDA 10.1 (
cupy-cuda101), 10.2 (cupy-cuda102), and 11.0 (cupy-cuda110) packages are built with cuDNN v8 support but without bundled cuDNN shared libraries (see #3724 for the discussion). To use cuDNN features, You need to download cuDNN library using the following command:python -m cupyx.tools.install_library --library cudnn --cuda X.X. It is also possible to install cuDNN v8.0.x via the system package manager (e.g.,apt install libcudnn8oryum install libcudnn8) or manually install it and setLD_LIBRARY_PATHenvironment variables.
Changes since v8.0.0rc1
See here for the complete list of merged PRs after v8.0.0rc1 release. For all changes since v7 series, please refer to the release notes of the pre-releases (alpha1, beta1, beta2, beta3, beta4, beta5, rc1).
Highlights
- Add a cache to reuse FFT plans that greatly improves CPU time. (thanks @leofang!)
- Support for cuTENSOR 1.2 and acceleration of
cupy.prod,cupy.max,cupy.min,cupy.ptpandcupy.meanby means ofCUPY_ACCELERATORS - Sparse matrices support greatly improved with the addition of new operators and the possibility of setting items.
New Features
- Support sparse matrix pointwise maximum and minimum (#3943)
- Support sparse matrix pointwise division by vectors or matrices (#3964)
- Add
cupy.testing.shaped_sparse_random(#3976) - Add compressed sparse
__setitem__(#3998) - Add
sparse.linalg.norm(#4040) - Add cuTENSOR 1.2 support (#3970)
- Add a cuFFT plan cache (#4010)
Enhancements
Performance Improvements
- Use
_csr_row_indexfor CSR matrix major-axis slicing with step (#3898) - Improve CSR matrix column fancy indexing (#3960)
- Improve
cupyx.scipy.sparseint x int indexing (#4003) - Avoid using
CUlinkStateunless absolutely necessary (#4016) - Use cuTENSOR in
cupy.prod,cupy.max,cupy.min,cupy.ptpandcupy.mean(#4046)
Bug Fixes
- Fix dtype in CSR matrix division (#3924)
- Fix
_compressed_sparse_matrix._minor_slicefor step > 1 case (#3952) - Fix
csr_matrix._get_intXsliceforstep < 0case (#3957) - Handle transfer to cupy view (#3962)
- Fix
sparse.__getitem__not to return view of input (#3993) - Fix managed memory leak (#4032)
- Use
__dealloc__instead of__del__for cdef class (#4037)
Code Fixes
- Rename
cupyx.scattersubmodule (#3921) - Hide private names in
cupyx/scipy/__init__.py(#3923) - Rename submodule under
cupyx.scipy.fftpack(#3926) - Refactor CSR sparse matrix row fancy indexing (#3930)
- Rename
cupyx.runtimesubmodule (#3937) - Rename
cupy.utilsubmodule tocupy._util(#3938) - Rename
cupy.statisticssubmodule tocupy._statistics(#3939) - Rename submodule under
cupy.profpackage (#3940) - Hide private names in
cupyx.time(#3990) - Hide private names in
cupy.cusparse(#4005) - Rename
cupy.mathsubmodule tocupy._math(#4028) - Hide private names in
cupy.cudnn(#4029) - Rename
cupy.logicsubmodule tocupy._logic(#4030) - Hide private names in
cupy/__init__.py(#4039)
Documentation
Tests
- Fix test fail when cuDNN is unavailable (#3910)
- Fix 32-bit boundary test to run on Windows (#3913)
- Add v8 to list of known branch in FlexCI script (#3914)
- Fix side effects in some tests (#3953)
- Fix some test to check compatibility with SciPy's behavior (#3956)
- Refactor sparse indexing tests (#3977)
- Fix
cupy.ndimtest style (#4034) - Fix bugs and test suites to make ROCm/HIP happy - Part 1 (#3929)
Others
Contributors
The CuPy Team would like to thank all those who contributed to this release!