Skip to content

Commit 0e36ffa

Browse files
committed
ExtensionLLM: Make it possible to pass memory mode for the Ethos-U
Signed-off-by: George Gekov <george.gekov@arm.com> Change-Id: I9be36752f199c32a26a69fb8b4a99edde5a6f2a2
1 parent fda2451 commit 0e36ffa

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

examples/models/llama/export_llama_lib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,8 @@ def _to_edge_and_lower_llama_arm(
10351035
partitioners.append(
10361036
get_ethosu_partitioner(
10371037
llm_config.backend.ethosu.target,
1038+
llm_config.backend.ethosu.system_config,
1039+
llm_config.backend.ethosu.memory_mode,
10381040
)
10391041
)
10401042
modelname = f"ethosu_{modelname}"

extension/llm/export/partitioner_lib.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,19 @@ def get_tosa_partitioner(version: str):
248248
return TOSAPartitioner(compile_spec)
249249

250250

251-
def get_ethosu_partitioner(target: str):
251+
def get_ethosu_partitioner(
252+
target: str,
253+
system_config: Optional[str] = None,
254+
memory_mode: Optional[str] = None,
255+
):
252256
from executorch.backends.arm.ethosu.compile_spec import EthosUCompileSpec
253257
from executorch.backends.arm.ethosu.partitioner import EthosUPartitioner
254258

255-
compile_spec = EthosUCompileSpec(target)
259+
compile_spec = EthosUCompileSpec(
260+
target,
261+
system_config=None if system_config == "default" else system_config,
262+
memory_mode=None if memory_mode == "default" else memory_mode,
263+
)
256264

257265
return EthosUPartitioner(compile_spec)
258266

0 commit comments

Comments
 (0)