CuPy v11 is now available

Kenichi Maehashi
CuPy
Published in
3 min readJul 28, 2022

We are excited to announce the release of CuPy v11! This release is the culmination of the effort in the past seven months, with more than 350 pull requests. The CuPy team would like to thank everyone involved in the development.

Highlights

Distributed Collective & P2P Primitives for Sparse Matrix

First introduced in CuPy v10, cupyx.distributed package now supports sparse matrices (cupyx.scipy.sparse.*_matrix) in addition to ndarrays. Here is a simple example that computes the sum of sparse matrices from all processes:

Check here for the full working code.

Unified Binary Package for CUDA 11.2+

Previously, CuPy provided binary packages for all supported CUDA releases; cupy-cuda112 for CUDA 11.2, cupy-cuda113 for CUDA 11.3, and so on. CuPy v11 replaces them with a unified binary package named cupy-cuda11x, which supports all CUDA 11.2 ~ 11.x releases. This allows you to upgrade your CUDA installation without reinstalling CuPy, and also improves interoperability with other libraries using CUDA, such as PyTorch.

For those using CUDA 11.1 or earlier, you can use the regular separate packages (cupy-cuda{102,110,111}), which is also continued to be available in CuPy v11.

Arm Server & JetPack 5

CuPy v11 now supports CUDA on the Arm Server Base System Architecture (SBSA) platform. This will allow users to deploy GPU workloads at a lower cost by using Arm-based servers like G5g instances on Amazon Web Services.

Support for JetPack 5, the latest SDK for Jetson embedded platform, is also added. We would like to thank NVIDIA for kindly providing the necessary help and access to Jetson platforms.

You can install the cupy-cuda11x binary package in Arm SBSA and JetPack 5 using:

$ pip install cupy-cuda11x -f https://pip.cupy.dev/aarch64

NumPy/SciPy API Coverage

CuPy v11 adds new 96 NumPy/SciPy-compatible APIs, increasing the coverage to 85% for NumPy top-level APIs (numpy.*), 82% for SciPy FFT APIs (scipy.fft.*), and 25% for SciPy Special APIs (scipy.special.*). It is worth mentioning that all of these works were done by community contributors. We appreciate everyone for their outstanding contributions, especially Gregory Lee, Corey J. Nolet, Khushi Agrawal, and Priya Nagda.

cupy.array_equiv
cupy.asarray_chkfinite
cupy.asfarray
cupy.ediff1d
cupy.fabs
cupy.float_power
cupy.format_float_positional
cupy.format_float_scientific
cupy.intersect1d
cupy.isneginf
cupy.isposinf
cupy.mask_indices
cupy.poly
cupy.real_if_close
cupy.row_stack
cupy.setdiff1d
cupy.setxor1d
cupy.trapz
cupy.tril_indices
cupy.tril_indices_from
cupy.triu_indices
cupy.triu_indices_from
cupy.union1d
cupy.vander
cupyx.scipy.fft.dct
cupyx.scipy.fft.dctn
cupyx.scipy.fft.dst
cupyx.scipy.fft.dstn
cupyx.scipy.fft.fht
cupyx.scipy.fft.idct
cupyx.scipy.fft.idctn
cupyx.scipy.fft.idst
cupyx.scipy.fft.idstn
cupyx.scipy.fft.ifht
cupyx.scipy.spatial.distance_matrix
cupyx.scipy.spatial.distance.cdist
cupyx.scipy.spatial.distance.minkowski
cupyx.scipy.special.bdtr
cupyx.scipy.special.bdtrc
cupyx.scipy.special.bdtri
cupyx.scipy.special.beta
cupyx.scipy.special.betainc
cupyx.scipy.special.betaincinv
cupyx.scipy.special.betaln
cupyx.scipy.special.boxcox
cupyx.scipy.special.boxcox1p
cupyx.scipy.special.btdtr
cupyx.scipy.special.btdtri
cupyx.scipy.special.cbrt
cupyx.scipy.special.chdtr
cupyx.scipy.special.chdtrc
cupyx.scipy.special.chdtri
cupyx.scipy.special.cosdg
cupyx.scipy.special.cotdg
cupyx.scipy.special.exp10
cupyx.scipy.special.exp2
cupyx.scipy.special.expit
cupyx.scipy.special.expm1
cupyx.scipy.special.expn
cupyx.scipy.special.fdtr
cupyx.scipy.special.fdtrc
cupyx.scipy.special.fdtri
cupyx.scipy.special.gammainc
cupyx.scipy.special.gammaincc
cupyx.scipy.special.gammainccinv
cupyx.scipy.special.gammaincinv
cupyx.scipy.special.gammasgn
cupyx.scipy.special.gdtr
cupyx.scipy.special.gdtrc
cupyx.scipy.special.i0e
cupyx.scipy.special.i1e
cupyx.scipy.special.inv_boxcox
cupyx.scipy.special.inv_boxcox1p
cupyx.scipy.special.log1p
cupyx.scipy.special.log_expit
cupyx.scipy.special.log_ndtr
cupyx.scipy.special.loggamma
cupyx.scipy.special.logit
cupyx.scipy.special.lpmv
cupyx.scipy.special.multigammaln
cupyx.scipy.special.nbdtr
cupyx.scipy.special.nbdtrc
cupyx.scipy.special.nbdtri
cupyx.scipy.special.ndtri
cupyx.scipy.special.pdtr
cupyx.scipy.special.pdtrc
cupyx.scipy.special.pdtri
cupyx.scipy.special.poch
cupyx.scipy.special.psi
cupyx.scipy.special.radian
cupyx.scipy.special.rgamma
cupyx.scipy.special.round
cupyx.scipy.special.sinc
cupyx.scipy.special.sindg
cupyx.scipy.special.sph_harm
cupyx.scipy.special.tandg
cupyx.scipy.special.xlog1py
cupyx.scipy.special.xlogy
cupyx.scipy.special.yn

And more!

  • Users can now subclass cupy.ndarray by following the same protocol as numpy.ndarray.
  • CUB is now enabled by default, improving performance for many reduction operations.
  • Enhanced support and improvement to the CuPy JIT compiler (cupyx.jit), including device functions, cooperative groups, access to the .shape / .stride array attributes, etc.
  • The cupy.typing module has been introduced to add type annotations to CuPy code.
  • The cupy.einsum() function is accelerated by cuTensorNet, part of the NVIDIA cuQuantum SDK. Note that this requires 1. cuquantum-python is installed, 2. cutensornet is prepended to the environment variable CUPY_ACCELERATORS.

Upgrading from v10 or earlier

You can refer to the Upgrade Guide for the summary of changes that may affect users upgrading from previous CuPy major versions. If you have any feedback, feel free to let us know on GitHub.

Join the community!

CuPy has an active and growing community of developers and users. If you are interested, you can start by talking to core developers in Gitter, filing an issue on GitHub for feature requests or bug reports, or sending a pull request to contribute code or documentation. If you are unsure where to start, take a look at one of the good first issues or try to implement one of the NumPy APIs in CuPy.

Finally, don’t forget to star us on GitHub and follow our Twitter and Medium to stay updated on the latest news!

--

--

Kenichi Maehashi
CuPy
Editor for

Working on CuPy & PyTorch development in the Deep Learning Ecosystem Team at Preferred Networks