Skip to content
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

[WIP] ENH: dask+cupy, dask+sparse etc. namespaces #270

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

crusaderky
Copy link
Contributor

@crusaderky crusaderky commented Mar 6, 2025

Very early prototype inspired by https://github.com/mdhaber/marray/

FYI @mdhaber @lucascolley

Demo

>>> import dask.array as da, cupy as cp
>>> from array_api_compat import array_namespace
>>> x = da.from_array(cp.asarray(0))
>>> xp = array_namespace(x)
>>> xp
<module 'array_api_compat.dask.array.cupy'>
>>> y = xp.arange(10)
>>> y
dask.array<arange, shape=(10,), dtype=int64, chunksize=(10,), chunktype=cupy.ndarray>
>>> type(y.compute())
cupy.ndarray
>>> array_namespace(y) is xp
True

@crusaderky crusaderky force-pushed the dask_wrap_namespace branch from 5434a21 to 57d168e Compare March 26, 2025 17:02
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

Successfully merging this pull request may close these issues.

1 participant