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
Using multiple backends #173
Comments
I think it's just that the variable names in that test are backwards:
I think to properly support meta-arrays, the backend need be written with uarray support in mind. At the moment |
@peterbell10 thanks for the quick answer.
I see, thanks for clarifying.
So once Dask is uarray-aware, the example above would work as I thought it would, is that correct? |
Yes, I think you're correct. |
@pentschev To elaborate, you would have to do basically what was done in the blogpost, and replace This will require an effort to define Multimethods for unumpy. Quite a few already exist. |
What blogpost are you referring to?
Would you mind pointing me to some of them? |
https://github.com/Quansight-Labs/uarray/blob/master/unumpy/multimethods.py contain all the multimethods.
I updated it with a composition example using XArray and Dask that illustrates the principle. |
Great, thanks @hameerabbasi, I will try to take a look at this soon! |
Closing this as the original question has been answered. |
Following the discussion we had in numpy/numpy#13831, I was trying uarray out, and wanted to test multiple backends.
@peterbell10 commented that it should be
with ua.set_backend(inner_array_backend), ua.set_backend(outer_array_backend):
, and while I couldn't find any examples, this test suggests it should be the other way around.Nevertheless, I'm trying to create Dask arrays that use CuPy as a backend, and I tried both orders of inner/outer arrays. It would also be interesting to clarify somewhere what's the inner and outer arrays, I assume in the test I'm trying, CuPy would be inner and Dask would be outer, but feel free to correct me if I'm looking it in the wrong way. Here's what I could get:
I expected in this case to have
type(a._meta)
andtype(a.compute())
to be CuPy arrays, but got NumPy. Am I doing something wrong?If I invert the
cupy_backend
/dask_backend
orders, thena
is a CuPy array, so it can't wrap other arrays.cc @hameerabbasi
The text was updated successfully, but these errors were encountered: