Closed yaroslavvb closed 2 years ago
Two ways to look at this: 1) As structured, the only performance improvement seen is to exploit memory locality which is best left to other libraries. 2) If you are restructuring this to observe the fact that there may be a shared intermediate, we do have capability for this operation.
Considering co-optimizing paths has been discussed, but tricky to do correctly. As before, there are several greedy heuristics which may perform well in practice however.
I see, thanks for the info, shared intermediates seem appropriate here
I'm wondering if there are any plans to add a way to optimize a sum of einsums (or a related tool that does this?)
For instance
There's a way to turn this into a single einsum, but this doubles the size of most tensors and makes them structured, while einsum seems to be optimized for unstructured tensors