Skip to content

Commit 30f7c34

Browse files
Gasoonjiafacebook-github-bot
authored andcommitted
make ExecuTorch program always has valid debug handle map and delegate map (pytorch#13149)
Summary: Currently ExecuTorchProgram's debug handle map and delegate map will be empty if we didn't call its _get_emitter_output function directly or indrectly before. This behavior doesn't make sense because: a. the empty result can not reflect the executorch program's state b. not in line with ExecuTorchProgramManager behavior c. other attributes, like self.buffer and self.program, do not have such behavir and can always return valid result. This PR makes them always has valid value.. Differential Revision: D79706058
1 parent 414fc32 commit 30f7c34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exir/program/_program.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,15 +613,15 @@ def program(self) -> Program:
613613
def debug_handle_map(self) -> Dict[int, Union[int, List[int]]]:
614614
if self._emitter_output:
615615
return self._emitter_output.debug_handle_map
616-
return {}
616+
return self._get_emitter_output().debug_handle_map
617617

618618
@property
619619
def delegate_map(
620620
self,
621621
) -> Dict[str, Dict[int, Dict[str, Union[str, _DelegateDebugIdentifierMap]]]]:
622622
if self._emitter_output:
623623
return self._emitter_output.method_to_delegate_debug_id_map
624-
return {}
624+
return self._get_emitter_output().debug_handle_map
625625

626626
@property
627627
def graph_module(self) -> torch.fx.GraphModule:

0 commit comments

Comments
 (0)