Code Monkey home page Code Monkey logo

Comments (18)

ericmjl avatar ericmjl commented on August 27, 2024 9

@mattjj I'm out of grad school now! 😄

What more needs to be done to support CuPy? Could we chat about this sometime?

from autograd.

ericmjl avatar ericmjl commented on August 27, 2024 6

@matjj I started a branch on my fork! https://github.com/ericmjl/autograd/tree/cupy

Still familiarizing myself with both CuPy and autograd's codebase. However, one small win I have now is that I can import autograd.cupy as cp and no errors show up. The next thing I need help with is error messages that show up when I try to instantiate an array.

cc: @samuela, @MInner, @iaroslav-ai, @oeway, @kastnerkyle, @outlace, @tscohen I definitely can't do this on my own, and I'd love to get your input on the branch, especially w.r.t. testing and finding problems that show up!

from autograd.

ericmjl avatar ericmjl commented on August 27, 2024 5

@JarvisDevon, if you're interested in what I've done thus far, you can look at https://github.com/ericmjl/autograd-cupy.

Otherwise, I'd suggest going to jax: it provides autodiff on the NumPy API with JIT compilation to GPU/TPU!

from autograd.

kastnerkyle avatar kastnerkyle commented on August 27, 2024 1

Any updates? I and a few others are very interested, and @tscohen 's comment makes me think it could be pretty straightforward.

from autograd.

mattjj avatar mattjj commented on August 27, 2024

Hey Taco! Thanks for the suggestion. We had noticed CuPy, and I think a student is currently looking into the necessary adaptations. This github issue is probably a good place to track any progress on that front. If you have any further thoughts on getting autograd+CuPy working, let us know!

from autograd.

outlace avatar outlace commented on August 27, 2024

Please support OpenCL if you're planning to add GPU support.

from autograd.

mattjj avatar mattjj commented on August 27, 2024

No updates, but pull requests are welcome :)

from autograd.

oeway avatar oeway commented on August 27, 2024

+1
looking forward to this feature.

from autograd.

iaroslav-ai avatar iaroslav-ai commented on August 27, 2024

+1

from autograd.

MInner avatar MInner commented on August 27, 2024

Did anybody try using numpy linked with nvblas - a drop-in replacement for BLAS that uses cuBLAS under the hood? If all numpy ops are automatically GPU-accelerated this way, autograd should get accelerated too, right?

from autograd.

mattjj avatar mattjj commented on August 27, 2024

It's not too hard to wrap numerical libraries with autograd. The trouble has been that there isn't really a good "GPU-backed numpy" to wrap. That is, the challenge is finding a well-developed GPU-backed numerical library for expressing functions to be differentiated; if we had that, wrapping it in autograd to add autodiff support wouldn't be much work.

As an example, a few weeks ago I made a cupy wrapper in a branch, including a gpu-accelerated MNIST net example. Take a look at the autograd/cupy directory in that branch to see the wrapping code. Basically, it requires three files: cupy_wrapper.py to wrap the cupy functions in primitives, cupy_extra.py to set up a cupy array boxed data type, and cupy_grads.py to define the VJPs. However, cupy is a bit rough around the edges, and I haven't pushed on developing that wrapper further.

I haven't looked at nvblas, but because I haven't heard of it being used, I suspect it is under-developed. I'd like to hear more about it, though!

from autograd.

samuela avatar samuela commented on August 27, 2024

@mattjj I'm also not personally familiar with nvblas but it appears to be an Nvidia project, so it should be actively maintained.

from autograd.

bingo619 avatar bingo619 commented on August 27, 2024

Any updates guys?

from autograd.

ericmjl avatar ericmjl commented on August 27, 2024

Please check my branch: https://github.com/ericmjl/autograd/tree/cupy

from autograd.

ericmjl avatar ericmjl commented on August 27, 2024

Also, some progress has been made.

from autograd.

bingo619 avatar bingo619 commented on August 27, 2024

Thanks, will check it out.

from autograd.

JarvisDevon avatar JarvisDevon commented on August 27, 2024

Any progress on this? The branch at https://github.com/ericmjl/autograd/tree/cupy seems to be gone too?

from autograd.

WilliamTambellini avatar WilliamTambellini commented on August 27, 2024

https://github.com/google/jax

from autograd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.