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

Method get_edge_program_manager

export/export.py:505–536  ·  view source on GitHub ↗

Get the EdgeProgramManager after edge lowering stages. This method checks multiple stages in order of preference: 1. TO_EDGE_TRANSFORM_AND_LOWER (combined stage) 2. TO_BACKEND (separate stage with backend delegation) 3. EDGE_PROGRAM_MANAGER_TRANSFORM (separa

(self)

Source from the content-addressed store, hash-verified

503 return exported_programs[method_name]
504
505 def get_edge_program_manager(self) -> "EdgeProgramManager":
506 """
507 Get the EdgeProgramManager after edge lowering stages.
508
509 This method checks multiple stages in order of preference:
510 1. TO_EDGE_TRANSFORM_AND_LOWER (combined stage)
511 2. TO_BACKEND (separate stage with backend delegation)
512 3. EDGE_PROGRAM_MANAGER_TRANSFORM (separate stage after TO_EDGE)
513 4. TO_EDGE (separate stage without backend delegation)
514
515 Returns:
516 The EdgeProgramManager
517
518 Raises:
519 RuntimeError: If no edge stage has been run
520 """
521 # Check stages in order of preference
522 for stage_type in [
523 StageType.TO_EDGE_TRANSFORM_AND_LOWER,
524 StageType.TO_BACKEND,
525 StageType.EDGE_PROGRAM_MANAGER_TRANSFORM,
526 StageType.TO_EDGE,
527 ]:
528 artifact = self._stage_to_artifacts.get(stage_type)
529 if artifact is not None and artifact.data is not None:
530 logging.info(f"Returning edge program manager from stage {stage_type}")
531 return artifact.data
532
533 raise RuntimeError(
534 "Edge program manager is not available. "
535 "Run one of the edge stages first: TO_EDGE_TRANSFORM_AND_LOWER, TO_EDGE, EDGE_PROGRAM_MANAGER_TRANSFORM, or TO_BACKEND."
536 )
537
538 def get_executorch_program(self) -> Program:
539 """

Calls 2

infoMethod · 0.80
getMethod · 0.45