Questions tagged [cupy]

CuPy is an implementation of NumPy-compatible multi-dimensional array on CUDA.

About CuPy

From the CuPy homepage:

High Performance with CUDA

CuPy is an open-source matrix library accelerated with NVIDIA CUDA. It also uses CUDA-related libraries including cuBLAS, cuDNN, cuRand, cuSolver, cuSPARSE, cuFFT and NCCL to make full use of the GPU architecture.

Highly Compatible with NumPy

CuPy's interface is highly compatible with ; in most cases it can be used as a drop-in replacement. All you need to do is just replace numpy with cupy in your Python code. It supports various methods, indexing, data types, broadcasting and more.

CuPy consists of the core multi-dimensional array class, cupy.ndarray, and many functions on it. It supports a subset of numpy.ndarray interface.

Resources

339 questions
2
votes
2 answers

How to add correct distribution channel for pyculib for windows?

I'm trying to install Nvidia's GPU python packages via conda package distribution, but I'm running into the following errors: PackagesNotFoundError: The following packages are not available from current channels: - pyculib Current channels: -…
Mr.Drew
  • 939
  • 2
  • 9
  • 30
2
votes
0 answers

Intermittent OutOfMemoryError in Cupy

I'm making progress with Cupy and have been able to accelerate my iterative image reconstruction that previously used numpy and C++ by about a factor of 3. Now I have an intermittent issue that points out that I seem to miss something important. I'm…
2
votes
1 answer

Installing a pip package with cupy as a requirement puts install in never ending loop

I am trying to make a pip package with cupy as one of the requirements, but I include cupy in the requirement, the pip install ends up in a never ending loop. I am trying to install the package on Google Colab, which already has Cupy install, so it…
SantoshGupta7
  • 5,607
  • 14
  • 58
  • 116
2
votes
0 answers

Use Raspberry's VideoCore IV GPU for chainer model. Requires cupy? cuda?

I am trying to run Idein/chainer-pose-proposal-net on a Raspberry Pi 3 B+. This is a pose estimation model (specifically Pose Proposal Networks by Taiki Sekii) in Chainer. In the README it is suggested that it can use the Raspberry's VideoCore IV…
Martin
  • 1,141
  • 14
  • 24
2
votes
1 answer

Does cupy automatically use cuda and the gpu?

I know that with other libraries that allow one to use python with the GPU, you have to specify that you're using cuda, otherwise the functions will work but not use cuda, like numba. Is the same true for cupy, or does it automatically use the GPU?
Ipulatov
  • 175
  • 4
  • 11
2
votes
1 answer

How to subclass a CuPy array?

For NumPy one can use class A(np.ndarray): pass a = np.random.rand(10, 10).view(A) print(a) # OK But for Cupy, the following operation leads to segfault: class A(cp.ndarray): pass a = cp.random.rand(10, 10).view(A) print(a) # segfault I've looked…
liwt31
  • 918
  • 10
  • 10
2
votes
1 answer

Why do I get ModuleNotFoundError for import cupy?

I installed cupy using pip install cupy-cuda90. The installation went successfully (after installing MSVC 2017) and pip list shows cupy-cuda90. When I type import cupy I get the following error: Traceback (most recent call last): File…
Stiefel
  • 2,677
  • 3
  • 31
  • 42
2
votes
3 answers

Difference in the array type using numpy and cupy

I am using chainer library for my model and facing the below issue: Say I have a file of test data having 3 features and a label (last column) with them. It is imported in the form of a list. e.g. test_set =…
Gurpreet.S
  • 125
  • 2
  • 8
2
votes
1 answer

CuPy running out of memory

I have been testing the CuPy library and done a simple matrix multiplication using einsum: C = cp.einsum('pqrs,rs->pq', A, B) Dimensions of A and B are, (41, 41, 41, 41) (41, 41), receptively. I also checked their sizes, which are 22606088 bytes,…
EveSz
  • 61
  • 6
2
votes
2 answers

Solve rectangular sparse linear equation systems with cupy

I'm trying to solve a rectangular system for sparse features using cupy. I know the built-in function sparse.linalg.lsqr(A, b) do it for square matrix A. However I like to solve a rectangular sparse system. This is the way we can solve a squared…
Nacho
  • 792
  • 1
  • 5
  • 23
2
votes
3 answers

Can not import cupy with chainer 4.1.0

I have a project in python2.7.11 using chainer and cupy. After updating version of Chainer from 1.22 to 4.1.0, I can not using cupy >>> import cupy Traceback (most recent call last): File "", line 1, in ImportError: No module…
2
votes
1 answer

How to import different branch of a package(based on python) in GitHub to local computer?

I have a question about import different branch of a repo on Google Colab. Autograd(https://github.com/HIPS/autograd) have a cupy-adaptable version which lies in another branch(https://github.com/HIPS/autograd/tree/cupy).I want to import…
2
votes
1 answer

Will cupy support cython( eg. buffered index)?

I have implement myself defined a chainer Link, but because it is too slow. I have implemented cython CPU version of my code. But I want to further boost speed via GPU. So I test the following code , but it failed: %%cython import numpy as…
machen
  • 283
  • 2
  • 10
1
vote
1 answer

Looking for fast binary convolution on GPU

I have a large and small 2d numpy boolean array. I want to know all positions where this smaller array fits on the larger array. If for a specific location no element of the smaller and (sliced) larger array are True at the same time, the result…
F.Wessels
  • 179
  • 11
1
vote
0 answers

"Cupyx.scipy.sparse" problem: "cupy_backends.cuda.api.driver.CUDADriverError:an illegal memory access was encountered"

Take summary, we try to do human segmentation on a social media video using an unsupervised deep CNN. The processing extract each video frame (using OpenCV). The video frame is segmented by a CNN to output a coarse mask. Then, a bilateral filter is…