|
38 | 38 | class RemoveCloneOpsTransformImported(ExportPass): |
39 | 39 | def call(self, graph_module: torch.fx.GraphModule) -> PassResult: |
40 | 40 | finalize_passes: List[PassType] = [ |
41 | | - RemoveCloneOpsTransform(), |
| 41 | + RemoveCloneOpsTransform( |
| 42 | + eliminate_quant_dequant_pairs = False |
| 43 | + ), |
42 | 44 | ] |
43 | 45 | result = PassManager(passes=finalize_passes)(graph_module) |
44 | 46 | dead_code_elimination_pass(result.graph_module) |
@@ -356,19 +358,6 @@ def call(self, graph_module: torch.fx.GraphModule) -> PassResult: |
356 | 358 | return result |
357 | 359 |
|
358 | 360 |
|
359 | | -@register_cadence_pass(CadencePassAttribute(opt_level=1)) |
360 | | -class RemoveCloneOpPass(RemoveOrReplacePassInterface): |
361 | | - # If the op is a clone op, return the input and eliminate the op |
362 | | - @property |
363 | | - def targets(self) -> list[EdgeOpOverload]: |
364 | | - return [exir_ops.edge.aten.clone.default] |
365 | | - |
366 | | - def maybe_remove_or_replace(self, node: Node) -> bool: |
367 | | - input_node = node.args[0] |
368 | | - assert isinstance(input_node, Node) |
369 | | - node.replace_all_uses_with(input_node) |
370 | | - return True |
371 | | - |
372 | 361 |
|
373 | 362 | @register_cadence_pass(CadencePassAttribute(opt_level=1)) |
374 | 363 | class RemoveContiguousOpPass(RemoveOrReplacePassInterface): |
@@ -926,7 +915,6 @@ def maybe_remove_or_replace(self, node: Node) -> bool: |
926 | 915 |
|
927 | 916 | class CommonRemovePasses: |
928 | 917 | passes: List[Type[ExportPass]] = [ |
929 | | - RemoveCloneOpPass, |
930 | 918 | RemoveAliasCopyOpPass, |
931 | 919 | RemoveNopExpandOpPass, |
932 | 920 | RemoveNopSliceOrViewOpPass, |
|
0 commit comments