Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/models/llama/export_llama_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Comment on lines 1035 to +1039
)
)
modelname = f"ethosu_{modelname}"
Expand Down
12 changes: 10 additions & 2 deletions extension/llm/export/partitioner_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Comment on lines +259 to +263

return EthosUPartitioner(compile_spec)

Expand Down
Loading