Skip to content

Commit 149e23d

Browse files
authored
Arm backend: Cherry-pick tosa patch to speed up large models (#15592)
* Only affects models >2gb Signed-off-by: Ryan O'Shea <ryan.oshea3@arm.com>
1 parent 2b02316 commit 149e23d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

backends/arm/tosa/backend.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,14 @@ def _preprocess( # noqa: C901
133133
if not artifact_path:
134134
artifact_path = ""
135135

136-
tosa_graph = ts.TosaSerializer(artifact_path)
136+
version = tosa_spec.version
137+
tosa_graph = ts.TosaSerializer(
138+
artifact_path,
139+
targetMajor=version.major,
140+
targetMinor=version.minor,
141+
targetPatch=version.micro,
142+
targetDraft=False,
143+
)
137144

138145
if not (
139146
tosa_spec.version.major == ts.TOSA_VERSION_MAJOR

examples/arm/setup.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ if [[ $is_script_sourced -eq 0 ]]; then
290290
fi
291291

292292
pushd tosa-tools
293+
git fetch origin main
293294
git checkout 8468d041c50c6d806f3c1c18c66d7ef641e46580 # serialization lib pybindings
295+
git cherry-pick 368f0cd745b2a1569bf36f077daeba95775de192 # perf fix for >2gb models
294296
if [[ ! -d "reference_model" ]]; then
295297
log_step "main" "[error] Missing reference_model directory in tosa-tools repo."
296298
exit 1

0 commit comments

Comments
 (0)