Skip to content

Commit f7f486d

Browse files
authored
Enabling Dtype Selective Build for Zephyr CI Add Model Test (#13191)
### Summary In the baseline version of this test, only operator selective build is used. A CMake command line option was created to pass in an exported model's PTE file via command line so that the model API for data type selective build can be used. Adding verbose error checking to make logs more informative. ### Test plan Ran with and without the flag set, and saw that enabling data type selective build reduces memory footprint. Specifically for the example add model, operator library shrinks from ~127KB to ~83KB.
1 parent 5635941 commit f7f486d

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

.github/workflows/trunk.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,23 @@ jobs:
8080
export ZEPHYR_PROJ_ROOT=$(realpath $(pwd))
8181
export ARM_FVP_TUTORIALS_ROOT=$ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm-fvp-tutorials
8282
83+
# TODO @Bujji: Should see if this can be moved into the docker image itself
8384
download_arm_zephyr_sdk
8485
./zephyr-sdk-0.16.0/setup.sh -c -t arm-zephyr-eabi
85-
8686
cd $ZEPHYR_PROJ_ROOT
8787
setup_zephyr_et_module
8888
89+
# Run setup scripts for Arm FVP and Arm AOT Compilation
8990
cd $ZEPHYR_PROJ_ROOT/modules/lib/executorch
9091
install_executorch "--use-pt-pinned-commit"
9192
.ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr
9293
source examples/arm/ethos-u-scratch/setup_path.sh
9394
source $ZEPHYR_PROJ_ROOT/zephyr/zephyr-env.sh
9495
9596
# Get the model as PTE
96-
python -m examples.arm.aot_arm_compiler --model_name="${MODEL_NAME}" --output="${MODEL_NAME}.pte"
97+
python -m examples.arm.aot_arm_compiler \
98+
--model_name="${MODEL_NAME}" \
99+
--output="${MODEL_NAME}.pte"
97100
98101
# Generate the C-style header
99102
cd $ARM_FVP_TUTORIALS_ROOT
@@ -105,7 +108,8 @@ jobs:
105108
cd $ARM_FVP_TUTORIALS_ROOT/models/${MODEL_NAME}/
106109
107110
# Build the zephyr elf
108-
west build -p always -b mps3/corstone300/fvp
111+
west build -p always -b mps3/corstone300/fvp -- \
112+
-DET_PTE_FILE_PATH_FOR_SELECTIVE_BUILD=$ZEPHYR_PROJ_ROOT/modules/lib/executorch/${MODEL_NAME}.pte
109113
110114
# Run the simulation
111115
FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf \
@@ -116,21 +120,29 @@ jobs:
116120
-C cpu0.CFGDTCMSZ=15 \
117121
--simlimit 120
118122
123+
# Disable exit on error
124+
set +e
119125
# Report failure if any of the ouptut verification checks fail
126+
# store 0 if found (failure), 1 if not (success)
120127
grep -qF "ERROR" sim.out
121-
exit_status=$? #store 0 if found (failure), 1 if not (success)
128+
exit_status=$?
122129
if [[ "$exit_status" -eq "0" ]]; then
123-
cat sim.out
124-
exit 1
130+
cat sim.out
131+
set -e
132+
exit 1
125133
fi
126134
127135
# Report fail if simulation does not complete successfully
136+
# store 0 if found (success), 1 if not (failure)
128137
grep -qF "SUCCESS: Program complete, exiting." sim.out
129-
exit_status=$? #store 0 if found (success), 1 if not (failure)
138+
exit_status=$?
130139
if [[ "$exit_status" -eq "1" ]]; then
131-
cat sim.out
132-
exit 1
140+
cat sim.out
141+
set -e
142+
exit 1
133143
fi
144+
# Re-enable exit on error
145+
set -e
134146
135147
test-models-linux-aarch64:
136148
name: test-models-linux-aarch64

0 commit comments

Comments
 (0)