-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Recommend optimize=True
in xr.dot
docstring
#8017
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
We use numpy for such things, so this is really up to them (and which BLAS kernel they end up calling). xr.dot uses EDIT: Funnily enough |
Related issues: |
Ah just pass
|
I now remember why we can't do this. Not all array types support it, e.g. sparse. Perhaps make a recommendation in the docstring? |
I can confirm that
From my side, you can close this issue, however, you can also leave it open to track if the docstring has been update. |
@
about 20x faster than xr.dot
optimize=True
in xr.dot
optimize=True
in xr.dot
optimize=True
in xr.dot
docstring
Closes pydata#7764 Closes pydata#8017
* Use `opt_einsum` by default if installed. Closes #7764 Closes #8017 * docstring update * _ * _ Co-authored-by: Maximilian Roos <[email protected]> * Update xarray/core/computation.py Co-authored-by: Maximilian Roos <[email protected]> * Fix docs? * Add use_opt_einsum option. * mypy ignore * one more test ignore * Disable navigation_with_keys * remove intersphinx * One more skip --------- Co-authored-by: Maximilian Roos <[email protected]>
What happened?
If I multiply several arrays with each other, using
da0 @ da1 @ da2 @ ...
is much faster compared to usingxr.dot(da0, da1, da2, ...)
.For me personally it is not clear at all that this actually can be the case, and I only discovered this by accident.
What did you expect to happen?
I would expect that
xr.dot
is equivalent toda.dot
in the sense thatxr.dot(da0, da1, ...)
is comparable toda0 @ da1 @ ...
.Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
No response
Anything else we need to know?
No response
Environment
INSTALLED VERSIONS
commit: None
python: 3.11.3 | packaged by conda-forge | (main, Apr 6 2023, 08:57:19) [GCC 11.3.0]
python-bits: 64
OS: Linux
OS-release: 4.12.14-122.162-default
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.14.0
libnetcdf: None
xarray: 2023.6.0
pandas: 1.5.3
numpy: 1.25.0
scipy: 1.10.1
netCDF4: None
pydap: None
h5netcdf: 1.2.0
h5py: 3.8.0
Nio: None
zarr: None
cftime: None
nc_time_axis: None
PseudoNetCDF: None
iris: None
bottleneck: None
dask: 2023.4.1
distributed: 2023.4.1
matplotlib: 3.7.1
cartopy: None
seaborn: None
numbagg: None
fsspec: 2023.4.0
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 67.7.2
pip: 23.1.2
conda: None
pytest: 7.4.0
mypy: 1.4.1
IPython: 8.13.2
sphinx: None
The text was updated successfully, but these errors were encountered: