Skip to content

Commit f466583

Browse files
committed
Arm backend: Test TOSA, Ethos-U55 and Ethos-U85 on github
This will run some more models in the github test flow and also enable some unit tests to use Corston3x0 FVP. This structure up the Arm backend testing into separate runable scripts in the same structure as other backends. Signed-off-by: Zingo Andersen <[email protected]> Change-Id: I5e11b1aca19460845e330b84d0696513c400c0f0
1 parent 041b7d6 commit f466583

File tree

5 files changed

+76
-20
lines changed

5 files changed

+76
-20
lines changed

.ci/scripts/setup-arm_baremetal.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
# Copyright 2024 Arm Limited and/or its affiliates.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
# NB: This function could be used to install Arm dependencies
8+
# Setup arm example environment (including TOSA tools)
9+
git config --global user.email "[email protected]"
10+
git config --global user.name "Github Executorch"
11+
bash examples/arm/setup.sh --i-agree-to-the-contained-eula
12+

.ci/scripts/test_arm_baremetal.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
# Copyright 2024 Arm Limited and/or its affiliates.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
TEST_SUITE=$1
8+
9+
if [[ -z "${TEST_SUITE:-}" ]]; then
10+
echo "Missing test suite name, exiting..."
11+
exit 1
12+
else
13+
echo "Run Arm baremetal test suite ${TEST_SUITE}"
14+
fi
15+
16+
TEST_SUITE_NAME="$(basename "$0") ${TEST_SUITE}"
17+
18+
test_pytest() {
19+
echo "${TEST_SUITE_NAME}: Run pytest"
20+
# Run arm baremetal pytest tests without FVP
21+
pytest -c /dev/null -v -n auto backends/arm/test
22+
}
23+
24+
test_pytest_ethosu_fvp() {
25+
echo "${TEST_SUITE_NAME}: Run pytest with fvp"
26+
# Run arm baremetal pytest tests with FVP
27+
pytest -c /dev/null -v -n auto backends/arm/test -p executorch.backends.arm.test.common --arm_quantize_io --arm_run_corstone300
28+
}
29+
30+
test_run_ethosu_fvp() {
31+
echo "${TEST_SUITE_NAME}: Test ethos-u delegate examples with run.sh"
32+
33+
# TOSA quantized
34+
echo "${TEST_SUITE_NAME}: Test ethos-u target TOSA"
35+
PYTHON_EXECUTABLE=python bash examples/arm/run.sh --target=TOSA --model_name=mv2
36+
PYTHON_EXECUTABLE=python bash examples/arm/run.sh --target=TOSA --model_name=esdr
37+
PYTHON_EXECUTABLE=python bash examples/arm/run.sh --target=TOSA --model_name=emformer_join
38+
PYTHON_EXECUTABLE=python bash examples/arm/run.sh --target=TOSA --model_name=w2l
39+
40+
# Ethos-U55
41+
echo "${TEST_SUITE_NAME}: Test ethos-u target Ethos-U55"
42+
PYTHON_EXECUTABLE=python bash examples/arm/run.sh --target=ethos-u55-128 --model_name=mv2
43+
44+
# Ethos-U85
45+
echo "${TEST_SUITE_NAME}: Test ethos-u target Ethos-U85"
46+
PYTHON_EXECUTABLE=python bash examples/arm/run.sh --target=ethos-u85-128 --model_name=mv2
47+
}
48+
49+
${TEST_SUITE}

.ci/scripts/utils.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,6 @@ install_flatc_from_source() {
5555
popd || return
5656
}
5757

58-
install_arm() {
59-
# NB: This function could be used to install Arm dependencies
60-
# Setup arm example environment (including TOSA tools)
61-
git config --global user.email "[email protected]"
62-
git config --global user.name "Github Executorch"
63-
bash examples/arm/setup.sh --i-agree-to-the-contained-eula
64-
65-
# Test tosa_reference flow
66-
source examples/arm/ethos-u-scratch/setup_path.sh
67-
}
68-
6958
build_executorch_runner_buck2() {
7059
# Build executorch runtime with retry as this step is flaky on macos CI
7160
retry buck2 build //examples/portable/executor_runner:executor_runner

.github/workflows/pull.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,14 @@ jobs:
354354
EXECUTORCH_BUILD_ARM_BAREMETAL=ON \
355355
.ci/scripts/setup-linux.sh "${BUILD_TOOL}"
356356
357-
source .ci/scripts/utils.sh
358357
# Install Arm dependencies
359-
install_arm
360-
361-
# Run pytest with coverage
362-
pytest -c /dev/null -v -n auto --cov=./ --cov-report=xml backends/arm/test
358+
.ci/scripts/setup-arm_baremetal.sh
359+
360+
# Test tosa_reference flow
361+
source examples/arm/ethos-u-scratch/setup_path.sh
363362
363+
# Run pytest
364+
.ci/scripts/test_arm_baremetal.sh test_pytest
364365
365366
test-llama-runner-qnn-linux:
366367
name: test-llama-runner-qnn-linux

.github/workflows/trunk.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,17 @@ jobs:
146146
source .ci/scripts/utils.sh
147147
install_executorch
148148
149-
install_arm
149+
.ci/scripts/setup-arm_baremetal.sh
150+
# Test tosa_reference flow
151+
source examples/arm/ethos-u-scratch/setup_path.sh
150152
151153
# Increase number of files user can monitor to bypass buck failures.
152154
# Hopefully this is high enough for this setup.
153155
sudo sysctl fs.inotify.max_user_watches=1048576 # 1024 * 1024
154156
155157
# Test ethos-u delegate examples with run.sh
156-
PYTHON_EXECUTABLE=python bash examples/arm/run.sh examples/arm/ethos-u-scratch/
158+
.ci/scripts/test_arm_baremetal.sh test_run_ethosu_fvp
159+
157160
158161
test-arm-reference-delegation:
159162
name: test-arm-reference-delegation
@@ -172,10 +175,12 @@ jobs:
172175
source .ci/scripts/utils.sh
173176
install_executorch
174177
175-
install_arm
178+
.ci/scripts/setup-arm_baremetal.sh
179+
# Test tosa_reference flow
180+
source examples/arm/ethos-u-scratch/setup_path.sh
176181
177182
# Run arm unit tests
178-
pytest -c /dev/null -v -n auto --cov=./ --cov-report=xml backends/arm/test
183+
.ci/scripts/test_arm_baremetal.sh test_pytest_ethosu_fvp
179184
180185
test-coreml-delegate:
181186
name: test-coreml-delegate

0 commit comments

Comments
 (0)