Skip to content
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

Fink optimal path for caching constant intermediates #199

Open
fangzhangmnm opened this issue Sep 12, 2022 · 3 comments
Open

Fink optimal path for caching constant intermediates #199

fangzhangmnm opened this issue Sep 12, 2022 · 3 comments

Comments

@fangzhangmnm
Copy link

For example:

i,ij,jk->k where sizes are [5],[5,100],[100,5], and the second and the third tensor is a constant
Then it is a good idea to cache ij,jk->ik

@dgasmith
Copy link
Owner

I believe the following will help you: https://dgasmith.github.io/opt_einsum/getting_started/sharing_intermediates/

@fangzhangmnm
Copy link
Author

I meant doing the optimization under the consumption that the constant tensors can be contracted beforehand offline. The above functionality only cache the intermediates, but the path planning might not consider which tensor is a constant

@dgasmith
Copy link
Owner

Yes, cache/intermediate aware paths are something we have discussed but have not implemented. It isn't clear that there is a general approach to solve the problem as straightforward approaches become combinatorial in nature.

Happy to take a PR which attempts this functionality!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants