What is CuPy? - Nvidia
[Pages:47]GTC 2019
CuPy
NumPy compatible GPU library for fast computation in Python
Preferred Networks Crissman Loomis crissman@preferred.jp Shunta Saito shunta@preferred.jp
What is CuPy?
CuPy is...
a library to provide NumPy-compatible features with GPU
import numpy as np X_cpu = np.zeros((10,)) W_cpu = np.zeros((10, 5)) y_cpu = np.dot(x_cpu, W_cpu)
import cupy as cp x_gpu = cp.zeros((10,)) W_gpu = cp.zeros((10, 5)) y_gpu = cp.dot(x_gpu, W_gpu)
y_cpu = cp.asnumpy(y_gpu)
y_gpu = cp.asarray(y_cpu)
import numpy as np X_cpu = np.zeros((10,)) W_cpu = np.zeros((10, 5)) y_cpu = np.dot(x_cpu, W_cpu)
import cupy as cp x_gpu = cp.zeros((10,)) W_gpu = cp.zeros((10, 5)) y_gpu = cp.dot(x_gpu, W_gpu)
for xp in [np, cp]: x = xp.zeros((10,)) W = xp.zeros((10, 5)) y = xp.dot(x, W)
Support both CPU and GPU with the same code!
Why develop CuPy? (1)
? Chainer functions had separate implementations in NumPy and PyCUDA to support both CPU and GPU
Even writing simple functions like "Add" or "Concat" took several lines...
Why develop CuPy? (2)
? Needed a NumPy-compatible GPU array library
? NumPy is complicated
? dtypes ? Broadcast ? Indexing
Why develop CuPy? (3)
? There was no convenient library ? gnumpy ? Consists of a single file which has 1000 lines of code ? Not currently maintained ? CUDA-based NumPy ? No pip package is provided
Needed to develop it ourselves
CuPy was born as a GPU backend of Chainer
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- numpy and torch david i inouye
- machine learning pytorch tutorial 國立臺灣大學
- operationalizing pytorch models using onnx and onnx runtime
- eleg5491 introduction to deep learning pytorchbasics tutorial
- pytorch numpy like functions cheat sheet
- pytorch tutorial for beginner edu
- array to tensor pytorch
- nlp university of michigan
- automatic differentiation in pytorch github pages
- what is cupy nvidia
Related searches
- what is best erectile medication
- what is central dogma
- what is customer relationship management
- it is what is meaning
- and nothing is but what is not
- what is and is not
- what is good and what is evil
- variance is 9 what is standard deviation
- what is something that is 32 feet
- octogenarian is 80 what is 90
- what is viral pneumonia is it contagious
- k is thousand what is a million