Skip to content

Add GPU support for NumPy operations with CuPy #9146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ClimbsRocks opened this issue Jun 17, 2017 · 10 comments
Closed

Add GPU support for NumPy operations with CuPy #9146

ClimbsRocks opened this issue Jun 17, 2017 · 10 comments

Comments

@ClimbsRocks
Copy link
Contributor

Description

In their own words, "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."

I recognize that building both CPU and GPU compatible versions is a significant undertaking, and might ultimately be out of the scope of scikit-learn.

I wanted to start a conversation about adding in GPU support (wither with CuPy, or any other library), and see if people were interested in taking on this endeavor.

@amueller
Copy link
Member

@amueller
Copy link
Member

I would add to that that it would require rewriting any cython-based code, which is most of our code.

@jmschrei
Copy link
Member

I think it's also worth mentioning that we would love to see/reference a sklearn-contrib project where specific algorithms that can utilize GPUs do so.

@jnothman
Copy link
Member

jnothman commented Jun 19, 2017 via email

@jmschrei
Copy link
Member

jmschrei commented Jun 19, 2017 via email

@ClimbsRocks
Copy link
Contributor Author

Thanks for the discussion points, everybody! @jmschrei keep us posted if you do spend more time on the Cython level operations in CuPy.

@yuyu2172
Copy link

What kind of operations do you want to call at Cython level? Right now, low level functions such as wrappers for cuBLAS are exported at Cython level.

@jmschrei
Copy link
Member

I'll keep you in the loop when I play around with it, but as Andreas mentioned I wouldn't keep my hopes up for it being added to sklearn anytime soon.

@Pezhvuk
Copy link

Pezhvuk commented Aug 24, 2019

Any updates on integrating Cupy into scikit-learn? Maybe at least for more computationally expensive operations like t-SNE first and then gradually building up?

@ogrisel
Copy link
Member

ogrisel commented Jun 25, 2020

t-SNE is precisely one such algorithms that is currently written in Cython. But other estimators such as preprocessors that only use pure numpy functions could potentially use one of NEP-18 / NEP-35 / NEP-37 or a combination to accept non-numpy inputs (e.g. CuPy arrays) and avoid forcing the arrays to be converted to a numpy array. See: #16196 and #16574 for instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants