-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Matrix multiplication inconsistent for dask and sparse: dask @ sparse
works, sparse @ dask
fails
#9934
Comments
this is a side-effect of using sparse_da @ dask_da fails, this: with xr.set_options(use_opt_einsum=False):
sparse_da @ dask_da works (but is slower). You could also avoid this issue by converting (not sure what to do to fix this in |
Thanks for the suggestions! This is the ufunc we've been using instead: https://github.com/openghg/openghg_inversions/blob/sparse-xarray-fix/openghg_inversions/array_ops.py#L75. I might just rewrite it to apply Maybe xarray could check for the case of |
Used chunking suggestion from pydata/xarray#9934
Can you open an issue at |
Sure, I can see what they say. I think they would need to change |
What is your issue?
The order of matrix multiplication matters for dask and sparse arrays, but probably shouldn't.
Here is an example:
In the workflow where this is used, the dask array has no chunks along its common dimensions with the sparse array, so it seems like
sparse @ chunk
should be fine. Also, in this workflow, loading the dask array into memory or making the sparse array dense would use a very large amount of memory.The text was updated successfully, but these errors were encountered: