Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Which is a numpy-like api accelerated with cuda?


Asked by Briella Conner on Dec 08, 2021 FAQ



CuPy : NumPy-like API accelerated with CUDA. CuPy is an implementation of NumPy-compatible multi-dimensional array on CUDA. CuPy consists of the core multi-dimensional array class, cupy.ndarray, and many functions on it. It supports a subset of numpy.ndarray interface.
In respect to this,
CuPy is an implementation of NumPy-compatible multi-dimensional array on CUDA. CuPy consists of the core multi-dimensional array class, cupy.ndarray, and many functions on it. It supports a subset of numpy.ndarray interface.
Keeping this in consideration, CuPy utilizes CUDA Toolkit libraries including cuBLAS, cuRAND, cuSOLVER, cuSPARSE, cuFFT, cuDNN and NCCL to make full use of the GPU architecture. The figure shows CuPy speedup over NumPy. Most operations perform well on a GPU using CuPy out of the box. CuPy speeds up some operations more than 100X.
And,
Another project by the Numba team, called pyculib, provides a Python interface to the CUDA cuBLAS (dense linear algebra), cuFFT (Fast Fourier Transform), and cuRAND (random number generation) libraries. Many applications will be able to get significant speedup just from using these libraries, without writing any GPU-specific code.
Accordingly,
The incredible part was that even though this was only array creation, CuPy was still much faster. Numpy created the array of 1 Billion 1’s in 1.68 seconds while CuPy only took 0.16; that’s a 10.5X speedup! But we can still do more.