Einsum, initial PR#2265
Conversation
… does matrix muls and elemwise muls with sums
@Baunsgaard Would it be possible to install the R einsum package on the build server? |
yes, but preferably no. Is the operation you want to import easy to write in R linear algebra? |
For some easy operations such as matrix multiplications - yes, for more complex chains it can be hard to write, unreadable and easy to do mistakes. And finally there can be some special ones that cannot be solved using 2D matrix operations e.g. 'fx,fg,fz,xg,zx,zg->g' (test 11) (the first intermediate would be 3 dimensional matrix) so the only option would be 4 for loops: so if we don't want the package then this can be solution, but I think it would be just more readable with a simple einsum call |
|
Okay, feel free to assume that we installed the einsum package, and we will add it to the image soon. |
…d also by refresh size method
…outermultpl. change
…degen is needed, elementwise mutliplication between matrix and vector works
… optimal; by default no codegen is used
|
Hi @HubertKrawczyk - could you please rebase this PR to main, unfortunately I'm getting lots of merge conflicts, and I would be afraid of corrupting existing or your code. Maybe the easiest would be to take your code and create a new PR without these cross-merge commits. Once the commit is prepared I will merge it in, but remove the einsum tests from our github workflow actions until the docker container is including the respective R package. |
Hi @mboehm7 , sure - here is link to new MR: #2312 |
This PR introduces initial version of einsum operator to SystemDS.
Einsum operator follow 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
The aim is to use codegen to potentially fuse multiple operations together.
Fusion is not implemented yet.
Implemented so far:
(M Thesis at TU Berlin "Efficient Einstein Summation in Apache SystemDS")