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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the Einsum operator #2772

Merged
merged 42 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e98cf49
Add support for the Einsum operator [WIP]
mirza-halilcevic Feb 14, 2024
8472cce
Merge remote-tracking branch 'upstream/develop' into einsum_support
mirza-halilcevic Feb 28, 2024
b44d80b
Add support for ... broadcasting and limited diagonal support
music-dino Mar 6, 2024
d7c7793
Implement more onnx_verify tests
music-dino Mar 6, 2024
d31932d
Merge remote-tracking branch 'upstream/develop' into einsum_support
music-dino Mar 6, 2024
bcf5015
Add missing gen_onnx.py tests for Einsum.
mirza-halilcevic Mar 6, 2024
fd38cf0
Add missing .onnx verify test files
music-dino Mar 7, 2024
047022e
Add two more einsum diagonal onnx verify tests
music-dino Mar 7, 2024
e2c6279
Add partial documentation
music-dino Mar 7, 2024
31c8aa6
Additional refactoring and documentation.
mirza-halilcevic Mar 7, 2024
dd1306a
Additional refactoring and renaming.
mirza-halilcevic Mar 11, 2024
26637f2
Re-enable onnx backend tests.
mirza-halilcevic Mar 11, 2024
a15ee68
Merge remote-tracking branch 'upstream/develop' into einsum_support
mirza-halilcevic Mar 11, 2024
4ff489e
Refactor gather_diagonal.
mirza-halilcevic Mar 11, 2024
c1448dd
Merge remote-tracking branch 'upstream/develop' into einsum_support
mirza-halilcevic Mar 11, 2024
596f1b9
Addressed several PR review comments.
mirza-halilcevic Mar 20, 2024
8a7e55d
Merge remote-tracking branch 'upstream/develop' into einsum_support
mirza-halilcevic Mar 20, 2024
8537b14
Merge remote-tracking branch 'upstream/develop' into einsum_support
mirza-halilcevic Mar 25, 2024
66de4ba
Address PR review comments
mirza-halilcevic Mar 27, 2024
34c3426
Merge remote-tracking branch 'upstream/develop' into einsum_support
mirza-halilcevic Mar 27, 2024
6b20225
Fix licensing, tidy and format checks.
mirza-halilcevic Mar 27, 2024
01d1cef
Add negative tests.
mirza-halilcevic Mar 28, 2024
3dceee1
Fix formatting and address review comments.
mirza-halilcevic Apr 3, 2024
8df341d
Merge branch 'develop' into einsum_support
causten Apr 19, 2024
366f6dc
Address code review comments.
mirza-halilcevic Apr 29, 2024
53d78db
Add comments explaining unsqueeze_transpose.
mirza-halilcevic Apr 30, 2024
40c9e28
Fix formatting.
mirza-halilcevic May 14, 2024
3db8573
Merge remote-tracking branch 'upstream/develop' into einsum_support
mirza-halilcevic May 14, 2024
3185360
Merge remote-tracking branch 'upstream/develop' into einsum_support
mirza-halilcevic May 14, 2024
45e4ec5
Refactor unsqueeze_transpose and squeeze_transpose.
mirza-halilcevic May 14, 2024
2c3144d
Rename unsqueeze_transpose to transpose_unsqueeze and transpose_squeeze
mirza-halilcevic May 14, 2024
c35c66c
Merge branch 'develop' into einsum_support
causten May 15, 2024
36279ff
Replace ssize_t with int64_t because windows build is failing.
mirza-halilcevic May 16, 2024
350b27c
Merge remote-tracking branch 'upstream/einsum_support' into einsum_su…
mirza-halilcevic May 16, 2024
02418fa
Merge branch 'develop' into einsum_support
causten May 17, 2024
6813ef2
Merge branch 'develop' into einsum_support
causten May 17, 2024
bc7d5cb
Merge remote-tracking branch 'upstream/develop' into einsum_support
mirza-halilcevic May 23, 2024
2542894
Fix onnx test loading.
mirza-halilcevic May 29, 2024
6034347
Merge branch 'develop' into einsum_support
mirza-halilcevic May 29, 2024
2641933
Fix clang-tidy error.
mirza-halilcevic May 29, 2024
980dffc
Merge remote-tracking branch 'upstream/einsum_support' into einsum_su…
mirza-halilcevic May 29, 2024
7140ae2
Fix string_view iterator issue with windows build.
mirza-halilcevic May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
766 changes: 766 additions & 0 deletions src/onnx/parse_einsum.cpp

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions test/onnx/einsum_2d_3d_multiplication_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
  einsum_2d_3d_multiplication_test:
*
x1
x2y"Einsum*
equation"ij,jkl  einsum_2d_3d_multiplication_testZ
x1


Z
x2



b
y


B
25 changes: 25 additions & 0 deletions test/onnx/einsum_3_inputs_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
 einsum_3_inputs_test:²
7
x1
x2
x3y"Einsum*
equation"bac,cd,def->ebc einsum_3_inputs_testZ
x1



Z
x2


Z
x3



b
y



B
20 changes: 20 additions & 0 deletions test/onnx/einsum_3d_broadcast_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
 einsum_3d_broadcast_test:™
0
x1
x2y"Einsum*
equation" bik,bkj->bij einsum_3d_broadcast_testZ
x1



Z
x2



b
y



B
13 changes: 13 additions & 0 deletions test/onnx/einsum_3d_diagonal_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
 einsum_3d_diagonal_test:n
%
xy"Einsum*
equation"iii->i einsum_3d_diagonal_testZ
x



b
y


B
20 changes: 20 additions & 0 deletions test/onnx/einsum_3d_opposite_broadcast_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
 !einsum_3d_opposite_broadcast_test:¢
0
x1
x2y"Einsum*
equation" bik,bkj->bij !einsum_3d_opposite_broadcast_testZ
x1



Z
x2



b
y



B
13 changes: 13 additions & 0 deletions test/onnx/einsum_batch_matrix_diagonal_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
 !einsum_batch_matrix_diagonal_test:}
*
xy"Einsum*
equation" ...ii->...i !einsum_batch_matrix_diagonal_testZ
x



b
y


B
20 changes: 20 additions & 0 deletions test/onnx/einsum_batch_matrix_multiplication_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
 'einsum_batch_matrix_multiplication_test:¨
0
x1
x2y"Einsum*
equation" ijk,ikl->ijl 'einsum_batch_matrix_multiplication_testZ
x1



Z
x2



b
y



B
23 changes: 23 additions & 0 deletions test/onnx/einsum_bilinear_transformation_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
 #einsum_bilinear_transformation_test:·
5
x1
x2
x3y"Einsum*
equation"ik,jkl,il->ij #einsum_bilinear_transformation_testZ
x1


Z
x2



Z
x3


b
y


B
Expand Down
17 changes: 17 additions & 0 deletions test/onnx/einsum_broadcast_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
 einsum_broadcast_test:Š
0
x1
x2y"Einsum*
equation" ij, jk -> ik einsum_broadcast_testZ
x1


Z
x2


b
y


B
12 changes: 12 additions & 0 deletions test/onnx/einsum_column_sum_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
 einsum_column_sum_test:d
$
xy"Einsum*
equation"ij->j einsum_column_sum_testZ
x


b
y


B
23 changes: 23 additions & 0 deletions test/onnx/einsum_common_1_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
 einsum_common_1_test:¤
3
x1
x2y"Einsum*
equation"bsnh,btnh->bnts einsum_common_1_testZ
x1




Z
x2




b
y




B
22 changes: 22 additions & 0 deletions test/onnx/einsum_common_2_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
 einsum_common_2_test:Ÿ
2
x1
x2y"Einsum*
equation"bsnh,ctnh->nts einsum_common_2_testZ
x1




Z
x2




b
y



B
22 changes: 22 additions & 0 deletions test/onnx/einsum_common_3_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
 einsum_common_3_test:Ÿ
2
x1
x2y"Einsum*
equation"bnst,chst->shn einsum_common_3_testZ
x1




Z
x2




b
y



B
23 changes: 23 additions & 0 deletions test/onnx/einsum_common_4_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
 einsum_common_4_test:¤
3
x1
x2y"Einsum*
equation"bcxd,bcyd->bcxy einsum_common_4_testZ
x1




Z
x2




b
y




B
23 changes: 23 additions & 0 deletions test/onnx/einsum_common_5_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
 einsum_common_5_test:ª
9
x1
x2y"Einsum*$
equation"...qhd,...khd->...hqk einsum_common_5_testZ
x1




Z
x2




b
y




B
20 changes: 20 additions & 0 deletions test/onnx/einsum_common_6_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
 einsum_common_6_test:›
6
x1
x2y"Einsum*!
equation"i...k,k...j->i...j einsum_common_6_testZ
x1



Z
x2



b
y



B
12 changes: 12 additions & 0 deletions test/onnx/einsum_common_7_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
 einsum_common_7_test:f
(
xy"Einsum*
equation" ...j->... einsum_common_7_testZ
x


b
y


B
17 changes: 17 additions & 0 deletions test/onnx/einsum_common_8_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
 einsum_common_8_test:†
-
x1
x2y"Einsum*
equation" ii,jj->ij einsum_common_8_testZ
x1


Z
x2


b
y


B
17 changes: 17 additions & 0 deletions test/onnx/einsum_diag_vector_multiply_test.onnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
  einsum_diag_vector_multiply_test:ˆ
+
x1
x2y"Einsum*
equation"ii,i->i  einsum_diag_vector_multiply_testZ
x1


Z
x2


b
y


B
Loading
Loading