@@ -34,20 +34,25 @@ def __init__(
3434 module : Optional [torch .nn .Module ],
3535 use_portable_ops : bool = False ,
3636 timeout : int = 120 ,
37+ build_dir_suffix : str = "" ,
3738 ):
3839 """
3940 Args:
4041 compile_spec: CompileSpecs to be used for serialization.
4142 module: Original Module to be used for serialization. Optional - can be used for reference output generation.
4243 portable_ops: If True tests with compiled in portable ops, default is to test without this to get error if not fully delegated
4344 timeout: Timeout for fvp. Default is 120 seconds.
45+ build_dir_suffix: Suffix appended to the executor-runner build dir
46+ name when resolving the ELF, letting callers select a runner
47+ built for a specific target (e.g. a Cortex-M variant).
4448 """
4549 super ().__init__ ()
4650 self .module = module
4751 self .timeout = timeout
4852 self .executorch_program_manager : ExecutorchProgramManager | None
4953 self .compile_spec = compile_spec
5054 self .use_portable_ops = use_portable_ops
55+ self .build_dir_suffix = build_dir_suffix
5156
5257 def run (self , artifact : ExecutorchProgramManager , inputs = None ) -> None :
5358 super ().run (artifact , inputs )
@@ -62,7 +67,9 @@ def run_artifact(self, inputs):
6267 inputs_flattened , _ = tree_flatten (inputs )
6368 intermediate_path = self .compile_spec ._get_intermediate_path ()
6469 target_board = get_target_board (self .compile_spec )
65- elf_path = get_elf_path (target_board , self .use_portable_ops )
70+ elf_path = get_elf_path (
71+ target_board , self .use_portable_ops , build_dir_suffix = self .build_dir_suffix
72+ )
6673
6774 if not os .path .exists (elf_path ):
6875 raise FileNotFoundError (
0 commit comments