Visitar URL original
Use valid einsum labels for Kronecker products with fourteen factors by austinchennn · Pull Request #712 · tensorly/tensorly · GitHub
Skip to content

Use valid einsum labels for Kronecker products with fourteen factors - #712

Open
austinchennn wants to merge 1 commit into
tensorly:mainfrom
austinchennn:codex/fix-einsum-kronecker-labels-20261113
Open

austinchennn wants to merge 1 commit into
tensorly:mainfrom
austinchennn:codex/fix-einsum-kronecker-labels-20261113

Conversation

@austinchennn

ghost commented Nov 13, 2026

Copy link
Copy Markdown

With the einsum tensor-algebra backend, a Kronecker product of14matrices fails because the equation builder walks past ASCII z into { and |. The core implementation succeeds on the same inputs, even when the result is only2x4.

Generate labels from lowercase and uppercase ASCII letters. The contraction, final shape, ordering and backend operations are unchanged. Add one compact regression with14factors and a literal2x4expected result, using the existing numerical/tensor-algebra backend selection rather than an extra parameter grid.

Fixes #711.

Validation on CPU Python3.11 with the actual editable SDK:

  • Original NumPy/einsum Kronecker module:1failed(new regression),1passed.
  • Complete tensorly/tenalg/tests: 360passed in each NumPy/PyTorch × core/einsum run,16warnings per run.
  • black --check .:171Python files unchanged; notebook files skipped because Black's Jupyter extras are not installed.
  • Changed-file Flake8 syntax/error checks and git diff --check:passed.

Full repository,documentation,GPU and remaining numerical backends were not run. This repairs invalid labels within the backend's supported range; it does not remove einsum symbol/dimension limits or claim a performance improvement.

AI assistance:Codex investigated,implemented and ran the reported local checks with the account owner's authorization. The account owner has not personally reviewed or tested the patch. Please let me know if a different label-generation boundary would be preferable.

@austinchennn

Copy link
Copy Markdown
Author

@JeanKossaifi, could you or another maintainer please approve the first-contributor Test TensorLy and Lint with Black workflows and review this focused label-generation fix when convenient?

Current head: 6db59bfb13ef162c9a3314231b5ddb8066419d14. Both runs report action_required, not executed test failures. Locally the new compact regression fails on the original einsum implementation; the complete tensor-algebra suite passes360 tests in each NumPy/PyTorch CPU × core/einsum run, and the Black Python check passes. Remaining backend/GPU matrix is not verified locally. I welcome feedback on the proposed scope and would appreciate merge consideration if ready. Thank you.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

Einsum Kronecker product generates invalid labels with fourteen matrices

1 participant