Announcing CuPy v10

Kenichi Maehashi
CuPy
Published in
3 min readDec 9, 2021

The CuPy team is pleased to announce the availability of CuPy v10 today. This release contains more than 2,500 commits in 530 pull requests made by 34 contributors. We would like to thank all the contributors who made the release possible.

Highlights

Enhanced Multi-Node/GPU Features

The new cupyx.distributed module has been added, which provides collective and peer-to-peer communication primitives for cupy.ndarray, backed by NVIDIA NCCL. This opens the possibility of using CuPy in distributed cluster environments. Here is a simple example:

Support for peer access has also been added. When calling CuPy functions with ndarray residing in the memory of a different GPU, CuPy automatically enables peer access between devices so that the kernel can access data on another GPU.

Arm Architecture Support

With many requests from the community, CuPy now provides official support for the Arm (aarch64) platform. Prebuilt binaries (wheels) for NVIDIA Jetson are also available on PyPI, enabling the use of CuPy in edge environments.

Improved Just-in-time Transpiler (JIT)

First introduced in CuPy v9, the JIT transpiler allows you to define GPU kernels in Python.

In this release, it is now possible to transpile lambda functions. This is especially handy when using JIT in conjunction with cupy.vectorize:

JIT APIs have also improved to cover all CUDA atomic functions (cupyx.jit.atomic_add, etc.) and several Python built-in functions (max, min, range, len).

More NumPy/SciPy APIs

As always, this release contains a lot of newly covered NumPy/SciPy APIs. CuPy v10 comes with 51 new APIs (including aliases) under cupy and cupyx.scipy namespaces:

  • cupy.alltrue
  • cupy.array2string
  • cupy.cumproduct
  • cupy.frombuffer
  • cupy.fromfunction
  • cupy.fromiter
  • cupy.fromstring
  • cupy.genfromtxt
  • cupy.loadtxt
  • cupy.positive
  • cupy.product
  • cupy.savetxt
  • cupy.sometrue
  • cupy.DataSource
  • cupy.broadcast_shapes
  • cupy.cdouble
  • cupy.cfloat
  • cupy.disp
  • cupy.get_array_wrap
  • cupy.get_printoptions
  • cupy.index_exp
  • cupy.int0
  • cupy.iterable
  • cupy.ndindex
  • cupy.printoptions
  • cupy.s_
  • cupy.safe_eval
  • cupy.set_printoptions
  • cupy.set_string_function
  • cupy.singlecomplex
  • cupy.uint0
  • cupy.random.Generator.geometric
  • cupy.random.Generator.f
  • cupy.random.Generator.hypergeometric
  • cupy.random.Generator.logseries
  • cupy.random.Generator.power
  • cupy.random.Generator.chisquare
  • cupy.random.Generator.binomial
  • cupy.random.Generator.dirichlet
  • cupyx.scipy.fft.hfft2
  • cupyx.scipy.fft.hfftn
  • cupyx.scipy.fft.ihfft2
  • cupyx.scipy.fft.ihfftn
  • cupyx.scipy.sparse.kronsum
  • cupyx.scipy.sparse.linalg.cgs
  • cupyx.scipy.sparse.linalg.lsmr
  • cupyx.scipy.sparse.linalg.minres
  • cupyx.scipy.sparse.coo_matrix.reshape
  • cupyx.scipy.sparse.csr_matrix.reshape
  • cupyx.scipy.sparse.csc_matrix.reshape
  • cupyx.scipy.stats.trim_mean

The development of new distributions in cupy.random.Generator and sparse matrix routines are done by Praveen Sahu through Google Summer of Code 2021.

Adopting the Python Array API Standard

The Python array API Standard is a community effort to define a standard API set for array libraries, making it easy for downstream packages to switch between or support multiple backend libraries. CuPy participates in and supports this standardization as we believe it will give freedom of choice and better interoperability for libraries and users.

In CuPy v10, cupy.array_api, a counterpart of numpy.array_api (NEP 47, to be included in NumPy v1.22), has been added to provide an Array object compliant with the v2021 specification of the Array API Standard.

The implementation is based on numpy.array_api initially written by Aaron Meurer from Quansight and modified for CuPy by Leo Fang from Brookhaven National Lab (now NVIDIA). We would like to acknowledge their efforts here.

Upgrading from v9

We prepared an Upgrade Guide that summarizes (possibly) breaking changes between major releases. Check it out, and get ready to dive into CuPy v10!

Join the Growing Community!

CuPy has a great and active community. During the v10 development, 22 out of 34 contributors were first-time participants in CuPy. We are always open to and welcome new contributors! Join Gitter to talk with core developers and users, file an issue for feature request or bug report, and send a pull request to contribute code or documentation. If you are interested but not sure where to start, take a look at one of the good first issues.

Finally, don’t forget to star the repository on GitHub and follow us on 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