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
)
| 837 | |
| 838 | |
| 839 | def 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 | |
| 860 | def _generate_edge_program( |
no test coverage detected