CuPy is a GPU array backend that implements a subset of NumPy interface.
Every NumPy function doesn’t have CuPy equivalent. Check out the list here. However, most frequently used NumPy functions do have a CuPy equivalent.
If you already have CUDA toolkit installed, check out these commands.
For installing CUDA toolkit, here is one blog which talks about CUDA toolkit installation.
NumPy runs on CPU and thus limiting speed. In the colab notebook, you can realize the difference in time required for same operations on CuPy and NumPy.
To get started with CuPy, following operations are tracked for the time taken and how to use the syntax:
- Copying one 2D array to another
- Broadcasting Operation
- Checking the shape of the 2D arrays and printing the elements
- Initializing the 2D arrays
- Changing CuPy arrays to NumPy
- Changing NumPy arrays back to Cupy