Commit 51b53c3
committed
[SYSTEMDS-3836] Fix distributive binary ops rewrite for broadcasting
The distributive binary operation rewrite, transforms the pattern
X-X*Y into (1-Y)*X but was so far not aware of broadcasting semantics.
If Y is a row or column vector but X a matrix, the rewrite yields
mismatching dimension exceptions during runtime. We now simply rewrite
the pattern to X*(1-Y) if Y is indeed a vector and X is not. Always
rewriting the pattern to the latter cause the mmchain rewrite to
no longer trigger (which is crucial for many end-to-end algorithms).
The tests have, however, also shown that for the multiLogReg test
we are not compiling mmchain (independent of this rewrite change)
something that needs fixing before the release.1 parent cd16f7a commit 51b53c3
File tree
4 files changed
+22
-5
lines changed- src
- main/java/org/apache/sysds/hops/rewrite
- test
- java/org/apache/sysds/test/functions/rewrite
- scripts/functions/rewrite
4 files changed
+22
-5
lines changedLines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
889 | | - | |
| 889 | + | |
890 | 890 | | |
891 | 891 | | |
892 | | - | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
893 | 897 | | |
894 | 898 | | |
895 | 899 | | |
| |||
908 | 912 | | |
909 | 913 | | |
910 | 914 | | |
911 | | - | |
| 915 | + | |
912 | 916 | | |
913 | 917 | | |
914 | | - | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
915 | 922 | | |
916 | 923 | | |
917 | 924 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| |||
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
107 | | - | |
| 112 | + | |
108 | 113 | | |
109 | 114 | | |
110 | 115 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
0 commit comments