diff --git a/examples/models/llama/export_llama_lib.py b/examples/models/llama/export_llama_lib.py index 9cf1b4b4bf0..46c9113a211 100644 --- a/examples/models/llama/export_llama_lib.py +++ b/examples/models/llama/export_llama_lib.py @@ -1035,6 +1035,8 @@ def _to_edge_and_lower_llama_arm( partitioners.append( get_ethosu_partitioner( llm_config.backend.ethosu.target, + llm_config.backend.ethosu.system_config, + llm_config.backend.ethosu.memory_mode, ) ) modelname = f"ethosu_{modelname}" diff --git a/extension/llm/export/partitioner_lib.py b/extension/llm/export/partitioner_lib.py index 16b8d8a2a9a..0abb4b663fb 100644 --- a/extension/llm/export/partitioner_lib.py +++ b/extension/llm/export/partitioner_lib.py @@ -248,11 +248,19 @@ def get_tosa_partitioner(version: str): return TOSAPartitioner(compile_spec) -def get_ethosu_partitioner(target: str): +def get_ethosu_partitioner( + target: str, + system_config: Optional[str] = None, + memory_mode: Optional[str] = None, +): from executorch.backends.arm.ethosu.compile_spec import EthosUCompileSpec from executorch.backends.arm.ethosu.partitioner import EthosUPartitioner - compile_spec = EthosUCompileSpec(target) + compile_spec = EthosUCompileSpec( + target, + system_config=None if system_config == "default" else system_config, + memory_mode=None if memory_mode == "default" else memory_mode, + ) return EthosUPartitioner(compile_spec)