Skip to content

Einsum, initial PR (after rebase)#2312

Closed
HubertKrawczyk wants to merge 28 commits into
apache:mainfrom
HubertKrawczyk:einsum-initial-rebase
Closed

Einsum, initial PR (after rebase)#2312
HubertKrawczyk wants to merge 28 commits into
apache:mainfrom
HubertKrawczyk:einsum-initial-rebase

Conversation

@HubertKrawczyk

@HubertKrawczyk HubertKrawczyk commented Aug 20, 2025

Copy link
Copy Markdown
Contributor

This PR introduces initial version of einsum operator to SystemDS.
Einsum operator follows structure of Numpy einsum https://numpy.org/doc/stable/reference/generated/numpy.einsum.html

For tests, R package einsum https://cran.r-project.org/web/packages/einsum/einsum.pdf is used

Implemented so far:

  • validation of einsum instruction
  • preprocessing: simplifying inputs by contracting dimensions that can be contracted at the beginning
  • preprocessing: identifying diagonal of matrix
  • plan generation
  • plan execution using individual operands (matrixMultiply, multiply, transpose, sumR, sumC, sumAll)
  • fallback: Cell template with for-loops for einsums that cannot be solved using further 2D summations (e.g AB,BD->ABD)

(M Thesis at TU Berlin "Efficient Einstein Summation in Apache SystemDS")

… does matrix muls and elemwise muls with sums
…degen is needed, elementwise mutliplication between matrix and vector works
@mboehm7

mboehm7 commented Aug 21, 2025

Copy link
Copy Markdown
Contributor

LGTM - thanks for this first version of the new einsum framework @HubertKrawczyk. I also appreciate the clean rebased PR. Overall, the code looks fine - during the merge, I only resolved a few warnings (imports, unused code, generic typing).

@mboehm7 mboehm7 closed this in 3741895 Aug 21, 2025
@github-project-automation github-project-automation Bot moved this from In Progress to Done in SystemDS PR Queue Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants