Commit 5e03d33
authored
Add path for to_edge_transform_and_lower that avoids EDGE_DO_NOT_DECOMP namespace (#12564)
The current design of using EDGE_DO_NOT_DECOMP to prevent decomposition
has long standing issues, and often fails lowering when certain ops are
requested for preservation. This shows up most notably in the CoreML
backend, where most ops are requested for preservation.
As a band-aid, we introduced _remove_invalid_ops_for_not_decompose to
cover certain kinds of ops. But when an op is encountered that we do not
have an exception for, lowering still fails.
We also recently found another bug that shows up for SDPA related to
contiguous views
(https://fb.workplace.com/groups/pytorch.edge.users/permalink/1796069037930048/)
that we still do not fully understand the root cause of.
EDGE_DO_NOT_DECOMP is actually only used to support the
"check_op_support" argument in the partitioner; ops_to_not_decompose
only modifies the default composition table.
In CoreML's case, "check_op_support" is not used, and the issues with
EDGE_DO_NOT_DECOMP's design causes lots of lowering issues that are hard
to keep up with. This PR enables a new path that bypasses
EDGE_DO_NOT_DECOMP's when possible (_can_skip_using_EDGE_DO_NOT_DECOMP).
Long term, we need to address the buggy design of EDGE_DO_NOT_DECOMP.
There are some ideas here:
https://fb.workplace.com/groups/pytorch.edge2.team/permalink/1241898747065975/1 parent ab0c6c5 commit 5e03d33
1 file changed
+48
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1094 | 1094 | | |
1095 | 1095 | | |
1096 | 1096 | | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1097 | 1118 | | |
1098 | 1119 | | |
1099 | 1120 | | |
| |||
1113 | 1134 | | |
1114 | 1135 | | |
1115 | 1136 | | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
1116 | 1142 | | |
1117 | 1143 | | |
1118 | 1144 | | |
1119 | 1145 | | |
1120 | 1146 | | |
1121 | 1147 | | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1122 | 1152 | | |
1123 | 1153 | | |
1124 | | - | |
1125 | | - | |
1126 | | - | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1127 | 1158 | | |
1128 | 1159 | | |
1129 | 1160 | | |
1130 | 1161 | | |
1131 | 1162 | | |
1132 | | - | |
| 1163 | + | |
| 1164 | + | |
1133 | 1165 | | |
1134 | 1166 | | |
1135 | 1167 | | |
1136 | 1168 | | |
1137 | 1169 | | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
1142 | 1179 | | |
1143 | | - | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
1144 | 1183 | | |
1145 | 1184 | | |
1146 | | - | |
1147 | 1185 | | |
1148 | 1186 | | |
1149 | 1187 | | |
| |||
0 commit comments