Skip to content

Commit e748172

Browse files
committed
up
1 parent a73e269 commit e748172

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

exir/program/_program.py

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,22 +1098,6 @@ def _can_skip_using_EDGE_DO_NOT_DECOMP(
10981098
return can_skip_using_EDGE_DO_NOT_DECOMP
10991099

11001100

1101-
def _replace_view_with_view_copy(program: ExportedProgram) -> ExportedProgram:
1102-
program = program.run_decompositions({})
1103-
new_gm = ReplaceViewOpsWithViewCopyOpsPass()(program.graph_module).graph_module
1104-
program = ExportedProgram(
1105-
root=new_gm,
1106-
graph=new_gm.graph,
1107-
graph_signature=_get_updated_graph_signature(program.graph_signature, new_gm),
1108-
state_dict=program.state_dict,
1109-
range_constraints=program.range_constraints,
1110-
module_call_graph=program.module_call_graph,
1111-
example_inputs=program.example_inputs,
1112-
constants=program.constants,
1113-
)
1114-
return program
1115-
1116-
11171101
def _gen_edge_manager_for_partitioners(
11181102
partitioner: Dict[str, List[Partitioner]],
11191103
aten_programs: Dict[str, ExportedProgram],
@@ -1166,9 +1150,9 @@ def _gen_edge_manager_for_partitioners(
11661150
# check on which ops need to be preserved and which ops need to be decomposed
11671151
# Those which are truly preserved will be replaced with transformed ops
11681152
if can_skip_using_EDGE_DO_NOT_DECOMP:
1169-
ops_set_to_not_decompose_by_program[
1170-
name
1171-
] = all_ops_no_decomp_needing_preservation
1153+
ops_set_to_not_decompose_by_program[name] = (
1154+
all_ops_no_decomp_needing_preservation
1155+
)
11721156
else:
11731157
ops_set_to_not_decompose_by_program[name] = (
11741158
_replace_aten_ops_with_transformed_ops(name, program, partitioner)
@@ -1179,8 +1163,6 @@ def _gen_edge_manager_for_partitioners(
11791163
program = program.run_decompositions(_default_decomposition_table())
11801164
_restore_transformed_ops_to_aten_ops(program)
11811165

1182-
# Edge will complain if there are view ops requested for preservation, so we replace them with view_copy
1183-
program = _replace_view_with_view_copy(program)
11841166
edge_programs[name] = program
11851167
edge_programs[name] = _generate_edge_program(
11861168
config,

0 commit comments

Comments
 (0)