Support symmetry in einsum #105697
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
馃殌 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 asA[a,b,c,d,e] = A[b,a,c,d,e]
orB[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 forctf
: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
The text was updated successfully, but these errors were encountered: