-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Please expose __cuda_array_interface__ via the xarray.__array__() function if present #6847
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
Comments
Do you have to go through We could also add some properties under the It'd be good to see a minimal example showcasing the operations you'd like to work. This would also make a great contribution to https://cupy-xarray.readthedocs.io/ |
This comment was marked as off-topic.
This comment was marked as off-topic.
I think ideally you could pass a |
My thoughts were similar until I read @rabernat's comments as well and I see his point. |
Yes, I'll share a workflow example shortly. Ideally I'd like it to be agnostic, rather than CuPy, for example using Numba mapped arrays for arrays which are larger then GPU RAM. I have several which are a lot larger then the 48GB on the RTX8000 GPUs I'm using for this. I have a mix of a dataframe with points of interest, spatial references tables for coordinate transformation (similar to NTv2 grids), and then use interpolation to estimate characteristics from data in a NetCDF file around the local points of interest. At present I have a workaround where I convert the NetCDF file into a dictionary of arrays which is pickled. The image below shows the mapped output of this process on UK rainfall in 2019 (Data source: UK Met Office) |
Is your feature request related to a problem?
When using an array type with GPU support, such as CuPy arrays, Numba device arrays or Numba mapped arrays (shared),
__cuda_array_interface__
is not exposed by thexarray.__array()
function.I'm using large NetCDF files which I wish to process against reference dataframes and use GPU acceleration to do this.
For example, Numba mapped array:
When copied to xarray:
Array interface confirms same address for the base (CPU) array as above, i.e. Zero Copy
However the
__cuda_array_interface__
is not exposedDescribe the solution you'd like
Expose
__cuda_array_interface__
via thexarray.__array()
function so it is available to CuPy and Numba CUDA functions.Describe alternatives you've considered
As a workaround, I'm not using xarray for NetCDF files. Instead I'm converting them into an dictionary of arrays which provides me with the GPU interfaces.
Additional context
No response
The text was updated successfully, but these errors were encountered: