@@ -1076,6 +1076,26 @@ def keep(op):
1076
1076
return list (filter (keep , preserve_ops ))
1077
1077
1078
1078
1079
+ def _can_skip_using_EDGE_DO_NOT_DECOMP (
1080
+ partitioner : Dict [str , List [Partitioner ]], aten_programs : Dict [str , ExportedProgram ]
1081
+ ) -> bool :
1082
+ # THe current design of using EDGE_DO_NOT_DECOMP to prevent decomposition
1083
+ # has long standing issues. _remove_invalid_ops_for_not_decompose was a band-aid to
1084
+ # fix some of the issues, but more issues are coming up over time, including a new issue with SDPA
1085
+ # and contiguous views: https://fb.workplace.com/groups/pytorch.edge.users/permalink/1796069037930048/
1086
+ # EDGE_DO_NOT_DECOMP is only needed by partitioners that specify check_op_support
1087
+ # As a temp fix, we give a more reliable path for backends that do not specify check_op_support
1088
+ can_skip_using_EDGE_DO_NOT_DECOMP = True
1089
+ for name , program in aten_programs .items ():
1090
+ if partitioner is not None :
1091
+ for curr_partitioner in partitioner .get (name , []):
1092
+ curr_ops_no_decomp , check_op_support = (
1093
+ curr_partitioner .ops_to_not_decompose (program )
1094
+ )
1095
+ if check_op_support is not None :
1096
+ can_skip_using_EDGE_DO_NOT_DECOMP = False
1097
+ return can_skip_using_EDGE_DO_NOT_DECOMP
1098
+
1079
1099
def _gen_edge_manager_for_partitioners (
1080
1100
partitioner : Dict [str , List [Partitioner ]],
1081
1101
aten_programs : Dict [str , ExportedProgram ],
0 commit comments