MCPcopy Create free account
hub / github.com/pytorch/executorch / edge_to_executorch_passes

Function edge_to_executorch_passes

exir/program/_program.py:839–857  ·  view source on GitHub ↗

Returns a list of passes to lower from edge to executorch. Get the pre memory planning passes based on the method name, if the pass is not in the dict, use the default pass.

(
    config: ExecutorchBackendConfig, name: Optional[str] = None
)

Source from the content-addressed store, hash-verified

837
838
839def edge_to_executorch_passes(
840 config: ExecutorchBackendConfig, name: Optional[str] = None
841) -> List[PassType]:
842 """
843 Returns a list of passes to lower from edge to executorch.
844 Get the pre memory planning passes based on the method name, if the pass is not in the dict, use the default pass.
845 """
846 passes: List[PassType] = [
847 # ExecuTorch backend ops are unable to handle unbacked symints. So after
848 # this pass, passes cannot be Interpreter-based, because it will fail if
849 # there exists an unbacked symint operation.
850 *config.passes,
851 SpecPropPass(),
852 PropagateDevicePass(),
853 EdgeToBackendOpsPass(),
854 RemoveGraphAssertsPass(),
855 ] + pre_memory_planning_passes(config, name)
856
857 return passes
858
859
860def _generate_edge_program(

Callers 2

to_executorchMethod · 0.85
to_executorchMethod · 0.85

Calls 5

SpecPropPassClass · 0.90
PropagateDevicePassClass · 0.90

Tested by

no test coverage detected