-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add more backends #9
Comments
@MridulS is working on the Dask backend! (Thanks!) |
I added the CuPy and PyData/Sparse backends! |
@hameerabbasi Have you ran any benchmarks for CuPy yet? |
Time for calculating the exponential of an array of length float64: 119 ms vs 25.1 ms |
Another potential candidate for inclusion is MXNet which also provides some subset of the NumPy API. I was recently contacted by their team as a potential user, but have not yet tried it out. There is a nice overview given in this post Specifically there appears to be CPU and GPU implementations of NumPy functions (in C++/CUDA) here: |
I'd personally prefer depth rather than breadth at this point in development - i.e. implement a small number of backends well rather than trying to implement (and support) every possible framework out there. |
This conceptually seems like an awesome project and I look forward to seeing its development. I'm wondering if I am trying to jump onto it too soon though or I am using it wrong. Trying to elaborate on your docs with the following example, I cannot get it to work with a import uarray as ua
import unumpy as np
import unumpy.cupy_backend as cupy_backend
import unumpy.numpy_backend as numpy_backend
def main():
x = np.zeros(5)
return np.exp(x)
print(ua.__version__)
print(np.__version__)
# works
with ua.set_backend(numpy_backend):
print(main())
# does not work
with ua.set_backend(cupy_backend):
print(main()) 0.6.0
|
@jbogaardt Unfortunately, I cannot test CuPy on CI, so it tends to lag behind. #34 fixes this. Thanks, @grlee77. |
Excellent. I look forward to the next release. |
follow up question @hameerabbasi , Do you envision the backend setup ever supporting combo backends like |
This is already possible. You just do the following: with ua.set_backend(cupy_backend), ua.set_backend(dask_backend):
... The order is reversed from what one would normally expect, but think of it in the following manner: The inner backend gets set last, and then dominates, and then, inside its own code, skips "itself", and dispatches to the next prominent backend. I guess one could provide a utility in |
That is awesome. This is truly an amazing library you're building. Thank you @hameerabbasi ! |
@jbogaardt |
The text was updated successfully, but these errors were encountered: