@@ -19,15 +19,8 @@ set -u
1919
2020# Valid targets for MCU model validation
2121VALID_TARGETS=(
22- " ethos-u55-32"
23- " ethos-u55-64"
24- " ethos-u55-128"
25- " ethos-u55-256"
26- " ethos-u85-128"
27- " ethos-u85-256"
28- " ethos-u85-512"
29- " ethos-u85-1024"
30- " ethos-u85-2048"
22+ " cortex-m55"
23+ " cortex-m85"
3124)
3225
3326# Default models for MCU validation with portable kernels
@@ -71,6 +64,22 @@ validate_models() {
7164 return 0
7265}
7366
67+ cpu_to_ethos_target () {
68+ local cpu=$1
69+ case $cpu in
70+ cortex-m55)
71+ echo " ethos-u55-128"
72+ ;;
73+ cortex-m85)
74+ echo " ethos-u85-128"
75+ ;;
76+ * )
77+ echo " Unknown CPU: $cpu " >&2
78+ return 1
79+ ;;
80+ esac
81+ }
82+
7483# Function to show usage
7584show_usage () {
7685 echo " Usage: $0 --target=<target> [--models=<model1,model2,...>]"
224233echo " ✅ ExecuteTorch libraries built successfully"
225234echo " "
226235
236+ ETHOS_TARGET=$( cpu_to_ethos_target " $TARGET " )
237+ if [[ $? -ne 0 ]]; then
238+ echo " Invalid CPU target: $TARGET "
239+ exit 1
240+ fi
241+ echo " Using ETHOS target: $ETHOS_TARGET "
242+
227243# Process each model
228244for model in " ${MODELS[@]} " ; do
229245 echo " === 🚀 Processing $model for $TARGET ==="
@@ -239,7 +255,7 @@ for model in "${MODELS[@]}"; do
239255 echo " ⚙️ AOT compilation for $model "
240256 if ! python3 -m examples.arm.aot_arm_compiler \
241257 -m " $model " \
242- --target=" $TARGET " \
258+ --target=" $ETHOS_TARGET " \
243259 --quantize \
244260 --output=" arm_test/$model " ; then
245261 echo " ❌ AOT compilation failed for $model "
@@ -250,8 +266,8 @@ for model in "${MODELS[@]}"; do
250266 if [[ " $MODEL_SUCCESS " == true ]]; then
251267 echo " 🔨 Building executor runner for $model "
252268 if ! backends/arm/scripts/build_executor_runner.sh \
253- --pte=" arm_test/$model /${model} _arm_${TARGET } .pte" \
254- --target=" $TARGET " \
269+ --pte=" arm_test/$model /${model} _arm_${ETHOS_TARGET } .pte" \
270+ --target=" $ETHOS_TARGET " \
255271 --output=" arm_test/$model " ; then
256272 echo " ❌ Executor runner build failed for $model "
257273 MODEL_SUCCESS=false
@@ -263,7 +279,7 @@ for model in "${MODELS[@]}"; do
263279 echo " 🏃 Running $model on FVP with portable kernels"
264280 if ! backends/arm/scripts/run_fvp.sh \
265281 --elf=" arm_test/$model /arm_executor_runner" \
266- --target=" $TARGET " ; then
282+ --target=" $ETHOS_TARGET " ; then
267283 echo " ❌ FVP execution failed for $model "
268284 MODEL_SUCCESS=false
269285 fi
0 commit comments