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
@@ -417,12 +417,11 @@ def to_backend(self, partitioners: Optional[List[Partitioner]]) -> "LLMEdgeManag
417417 return self
418418
419419 def to_executorch (
420- self , passes : Optional [List [PassType ]] = None
420+ self , passes : Optional [List [ExportPass ]] = None
421421 ) -> "LLMEdgeManager" :
422422 """
423423 Lower the model to executorch and get an ExecutorchProgram.
424424 """
425- assert self .edge_manager , "Need to run export_to_edge() first"
426425 to_executorch_passes = [
427426 # If there are Linear operations left in the graph, let's execute
428427 # them with the optimized op_linear rather than materializing a
@@ -431,11 +430,19 @@ def to_executorch(
431430 QuantFusionPass (),
432431 ]
433432 if passes :
433+ # pyre-fixme[6]: In call `list.extend`, for 1st positional argument,
434+ # expected `Iterable[Union[ConvertToLinearPass, QuantFusionPass]]` but
435+ # got `List[ExportPass]
434436 to_executorch_passes .extend (passes )
435437
438+ assert self .edge_manager , "Need to run export_to_edge() first"
436439 self .export_program = self .edge_manager .to_executorch (
437440 ExecutorchBackendConfig (
438441 extract_delegate_segments = True ,
442+ # pyre-fixme[6]: In call `ExecutorchBackendConfig.__init__`, for
443+ # argument `passes`, expected `List[typing.Callable[[GraphModule],
444+ # Optional[PassResult]]]` but got `List[Union[ConvertToLinearPass,
445+ # QuantFusionPass]]`.
439446 passes = to_executorch_passes ,
440447 memory_planning_pass = MemoryPlanningPass (alloc_graph_input = False ),
441448 sym_shape_eval_pass = ConstraintBasedSymShapeEvalPass (),
0 commit comments