html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/7764#issuecomment-1526489103,https://api.github.com/repos/pydata/xarray/issues/7764,1526489103,IC_kwDOAMm_X85a_GAP,1217238,2023-04-27T21:15:23Z,2023-04-27T21:15:23Z,MEMBER,"Allowing for explicitly passing a function matching the `einsum` interface is certainly more flexible than a boolean or enum argument, so @TomNicholas's suggestion of `einsum_func=np.einsum` is the version I would suggest.

The overhead from optimizing contraction paths is probably very small relative to the overhead of Xarray in general, so I would support setting `optimize=True` by default in Xarray, and/or using opt-einsum automatically if it is installed. JAX always use opt-einsum  (opt-einsum is actually a hard dependency) and I have never heard any complaints.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1672288892
https://github.com/pydata/xarray/issues/7764#issuecomment-1526241680,https://api.github.com/repos/pydata/xarray/issues/7764,1526241680,IC_kwDOAMm_X85a-JmQ,2448579,2023-04-27T19:26:13Z,2023-04-27T19:26:13Z,MEMBER,I think I agree with `use_opt_einsum: bool`,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1672288892
https://github.com/pydata/xarray/issues/7764#issuecomment-1526240154,https://api.github.com/repos/pydata/xarray/issues/7764,1526240154,IC_kwDOAMm_X85a-JOa,2448579,2023-04-27T19:25:29Z,2023-04-27T19:25:29Z,MEMBER,"`numpy.einsum` has some version of `opt_einsum` implemented under the `optimize` kwarg. IIUC this is False by default because it adds overhead to small problems ([comment](https://github.com/numpy/numpy/pull/5488#issuecomment-246496342))
> The complete overhead for computing a path (parsing the input, finding the path, and organization that data) with default options is about 150us. Looks like einsum takes a minimum of 5-10us to call as a reference. So the worst case scenario would be that the optimization overhead makes einsum 30x slower. Personally id go for turning optimization off by default and then revisiting if someone tackles the parsing issue to reduce the overhead.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1672288892
https://github.com/pydata/xarray/issues/7764#issuecomment-1525068958,https://api.github.com/repos/pydata/xarray/issues/7764,1525068958,IC_kwDOAMm_X85a5rSe,14808389,2023-04-27T08:11:25Z,2023-04-27T08:11:25Z,MEMBER,"we still want to be able to explicitly switch it off as we did for bottleneck (mostly for debugging purposes), so the kwarg / option would be good to have either way. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1672288892
https://github.com/pydata/xarray/issues/7764#issuecomment-1524332001,https://api.github.com/repos/pydata/xarray/issues/7764,1524332001,IC_kwDOAMm_X85a23Xh,1197350,2023-04-27T00:56:21Z,2023-04-27T00:56:21Z,MEMBER,"Is there ever a case where it would be preferable to use numpy if opt_einsum were installed? If not, I would propose that, like bottleneck, we just automatically use it if available.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1672288892
https://github.com/pydata/xarray/issues/7764#issuecomment-1524029516,https://api.github.com/repos/pydata/xarray/issues/7764,1524029516,IC_kwDOAMm_X85a1thM,35968931,2023-04-26T20:50:59Z,2023-04-26T20:50:59Z,MEMBER,"I support this (seems just like what we do for bottleneck) but maybe don't use the word `backend` for the kwarg again :sweat_smile: In fact as we're only talking about one function could our kwarg literally point to that function? i.e.

```python
def dot(..., einsum_func=np.einsum):
    ....
```
","{""total_count"": 1, ""+1"": 0, ""-1"": 0, ""laugh"": 1, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1672288892