Skip to content

Commit a44e4ac

Browse files
authored
Updates to Arm Zephyr CI Add Model Test (#13115)
### Summary Previously, the `test-models-arm-zephyr` CI job ran the Add model to test and verify the flow for running ExecuTorch models on a simulated device running Zephyr RTOS. The original test relied on hard coded paths and artifacts that made the test unusable for other models. Now, the test has been templatized so that adding models can be done easily (and will follow in a future PR). ### Test plan Manually tested the commands, and the CI job will confirm that the test still passes.
1 parent 6c395e9 commit a44e4ac

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

.github/workflows/trunk.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
mkdir -p zephyr_scratch/
7979
cd zephyr_scratch
8080
export ZEPHYR_PROJ_ROOT=$(realpath $(pwd))
81+
export ARM_FVP_TUTORIALS_ROOT=$ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm-fvp-tutorials
8182
8283
download_arm_zephyr_sdk
8384
./zephyr-sdk-0.16.0/setup.sh -c -t arm-zephyr-eabi
@@ -90,13 +91,46 @@ jobs:
9091
.ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr
9192
source examples/arm/ethos-u-scratch/setup_path.sh
9293
source $ZEPHYR_PROJ_ROOT/zephyr/zephyr-env.sh
93-
cd $ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm/hello_world
94+
95+
# Get the model as PTE
96+
python -m examples.arm.aot_arm_compiler --model_name="${MODEL_NAME}" --output="${MODEL_NAME}.pte"
97+
98+
# Generate the C-style header
99+
cd $ARM_FVP_TUTORIALS_ROOT
100+
python build_model.py \
101+
--executorch-root $ZEPHYR_PROJ_ROOT/modules/lib/executorch \
102+
--pte-file $ZEPHYR_PROJ_ROOT/modules/lib/executorch/${MODEL_NAME}.pte \
103+
--output-path $ARM_FVP_TUTORIALS_ROOT/models/${MODEL_NAME}/src/
104+
105+
cd $ARM_FVP_TUTORIALS_ROOT/models/${MODEL_NAME}/
106+
107+
# Build the zephyr elf
94108
west build -p always -b mps3/corstone300/fvp
95-
FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 120
96109
97-
grep -qF "Output[0][0]: (float) 2.000000" sim.out
110+
# Run the simulation
111+
FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf \
112+
-C mps3_board.visualisation.disable-visualisation=1 \
113+
-C mps3_board.telnetterminal0.start_telnet=0 \
114+
-C mps3_board.uart0.out_file='sim.out' \
115+
-C cpu0.CFGITCMSZ=15 \
116+
-C cpu0.CFGDTCMSZ=15 \
117+
--simlimit 120
118+
119+
# Report failure if any of the ouptut verification checks fail
120+
grep -qF "ERROR" sim.out
121+
exit_status=$? #store 0 if found (failure), 1 if not (success)
122+
if [[ "$exit_status" -eq "0" ]]; then
123+
cat sim.out
124+
exit 1
125+
fi
126+
127+
# Report fail if simulation does not complete successfully
128+
grep -qF "SUCCESS: Program complete, exiting." sim.out
98129
exit_status=$? #store 0 if found (success), 1 if not (failure)
99-
exit $exit_status
130+
if [[ "$exit_status" -eq "1" ]]; then
131+
cat sim.out
132+
exit 1
133+
fi
100134
101135
test-models-linux-aarch64:
102136
name: test-models-linux-aarch64

0 commit comments

Comments
 (0)