2727from executorch .exir .backend .utils import format_delegated_graph
2828from executorch .exir .capture ._config import EdgeCompileConfig , ExecutorchBackendConfig
2929
30- from executorch .exir .pass_manager import PassType
30+ from executorch .exir .pass_base import ExportPass
3131from executorch .exir .passes import MemoryPlanningPass
3232from executorch .exir .passes .quant_fusion_pass import QuantFusionPass
3333from executorch .exir .passes .sym_shape_eval_pass import ConstraintBasedSymShapeEvalPass
@@ -421,12 +421,11 @@ def to_backend(self, partitioners: Optional[List[Partitioner]]) -> "LLMEdgeManag
421421 return self
422422
423423 def to_executorch (
424- self , passes : Optional [List [PassType ]] = None
424+ self , passes : Optional [List [ExportPass ]] = None
425425 ) -> "LLMEdgeManager" :
426426 """
427427 Lower the model to executorch and get an ExecutorchProgram.
428428 """
429- assert self .edge_manager , "Need to run export_to_edge() first"
430429 to_executorch_passes = [
431430 # If there are Linear operations left in the graph, let's execute
432431 # them with the optimized op_linear rather than materializing a
@@ -435,11 +434,19 @@ def to_executorch(
435434 QuantFusionPass (),
436435 ]
437436 if passes :
437+ # pyre-fixme[6]: In call `list.extend`, for 1st positional argument,
438+ # expected `Iterable[Union[ConvertToLinearPass, QuantFusionPass]]` but
439+ # got `List[ExportPass]
438440 to_executorch_passes .extend (passes )
439441
442+ assert self .edge_manager , "Need to run export_to_edge() first"
440443 self .export_program = self .edge_manager .to_executorch (
441444 ExecutorchBackendConfig (
442445 extract_delegate_segments = True ,
446+ # pyre-fixme[6]: In call `ExecutorchBackendConfig.__init__`, for
447+ # argument `passes`, expected `List[typing.Callable[[GraphModule],
448+ # Optional[PassResult]]]` but got `List[Union[ConvertToLinearPass,
449+ # QuantFusionPass]]`.
443450 passes = to_executorch_passes ,
444451 memory_planning_pass = MemoryPlanningPass (alloc_graph_input = False ),
445452 sym_shape_eval_pass = ConstraintBasedSymShapeEvalPass (),
0 commit comments