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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support symmetry in einsum #105697

Open
fellideal opened this issue Jul 20, 2023 · 1 comment
Open

Support symmetry in einsum #105697

fellideal opened this issue Jul 20, 2023 · 1 comment
Labels
module: linear algebra Issues related to specialized linear algebra operations in PyTorch; includes matrix multiply matmul triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@fellideal
Copy link

fellideal commented Jul 20, 2023

馃殌 The feature, motivation and pitch

PyTorch is an incredibly powerful tool, particularly due to its capability to parallelize and leverage GPU resources for operations like einsum. One area where I'd love to see development is in the support for tensor symmetries.

For example, let's consider a tensor contraction like A[a,b,c,d,e] * B[d,e,f,g,h] = C[a,b,c,f,g,h]. If we have symmetries such as A[a,b,c,d,e] = A[b,a,c,d,e] or B[d,e,f,g,h]=B[d,e,f,h,g], it would be great if we could use these symmetries to boost computational efficiency significantly.

Alternatives

The ctf package does offer some functionality along these lines, but it seems limited to symmetric/antisymmetric operations for adjacent indices. Here's the GitHub repository for ctf:

https://github.com/cyclops-community/ctf

For more specifics, the documentation can be found here:

https://solomon2.web.engr.illinois.edu/ctf_python/ctf.html#module-ctf.core

That said, from my observations, the performance isn't quite as efficient as one might hope. You can check out the issue I'm referring to here:

cyclops-community/ctf#136

Additional context

No response

cc @jianyuh @nikitaved @pearu @mruberry @walterddr @IvanYashchuk @xwang233 @lezcano

@fellideal fellideal changed the title Support symmetry in tensor contraction Support symmetry in einsum Jul 20, 2023
@lezcano lezcano added triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module module: linear algebra Issues related to specialized linear algebra operations in PyTorch; includes matrix multiply matmul labels Jul 21, 2023
@lezcano
Copy link
Collaborator

lezcano commented Jul 21, 2023

We do not have anyone actively developing einsum, and it's not even clear to me how we could potentially implement this with the current tools we have. That being said, if you think that this could be done, feel free to put up a PR and tag me as a reviewer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: linear algebra Issues related to specialized linear algebra operations in PyTorch; includes matrix multiply matmul triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants