From d0401ab561e8a8b8d84d1befa321c9c38d7aa681 Mon Sep 17 00:00:00 2001 From: George Gekov Date: Mon, 11 May 2026 17:17:20 +0100 Subject: [PATCH 1/2] Arm backend: Fix Smollm2 model test - Export & lower the smollm2 via extensions/llm/export_llm - Build the arm_executor_runner application - Fix the propagation of select_ops_list in the CMakeLists.txt - Test the application runs on FVP in fast mode Signed-off-by: George Gekov Change-Id: I8acd87c2f5c3e6b5b189bb987ceccfe4877e2254 --- backends/arm/scripts/build_executorch.sh | 4 ++- backends/arm/test/test_arm_backend.sh | 38 ++++++++++++++++++--- examples/arm/executor_runner/CMakeLists.txt | 1 - examples/arm/run.sh | 2 +- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/backends/arm/scripts/build_executorch.sh b/backends/arm/scripts/build_executorch.sh index 5ac2674f964..56e75299d7a 100755 --- a/backends/arm/scripts/build_executorch.sh +++ b/backends/arm/scripts/build_executorch.sh @@ -96,8 +96,10 @@ cmake_args=( -DEXECUTORCH_BUILD_DEVTOOLS=${build_devtools} -DEXECUTORCH_BUILD_ARM_ETDUMP=${build_with_etdump} -DEXECUTORCH_BAREMETAL_SKIP_INSTALL=OFF - "${extra_cmake_args[@]}" ) +if ((${#extra_cmake_args[@]})); then + cmake_args+=("${extra_cmake_args[@]}") +fi if [[ -n "${target_cpu}" ]]; then cmake_args+=(-DTARGET_CPU=${target_cpu}) diff --git a/backends/arm/test/test_arm_backend.sh b/backends/arm/test/test_arm_backend.sh index be48d7ad234..26f30974a9c 100755 --- a/backends/arm/test/test_arm_backend.sh +++ b/backends/arm/test/test_arm_backend.sh @@ -302,11 +302,41 @@ test_deit_e2e_ethos_u() { test_model_smollm2_135M() { echo "${TEST_SUITE_NAME}: Test SmolLM2-135M on Ethos-U85" - # Build common libs once - python3 backends/arm/test/test_model.py --test_output=arm_test/test_model --build_libs - - python3 backends/arm/test/test_model.py --test_output=arm_test/test_model --target=ethos-u85-128 --model=smollm2 --extra_flags="-DEXECUTORCH_SELECT_OPS_LIST=dim_order_ops::_to_dim_order_copy.out" --specify_ethosu_scratch + backends/arm/scripts/build_executorch.sh + # Build pte for smollm2 + python -m extension.llm.export.export_llm \ + base.model_class=smollm2 \ + base.params=examples/models/smollm2/135M_config.json \ + debug.verbose=True model.enable_dynamic_shape=False quantization.pt2e_quantize="ethosu_8a8w" \ + backend.ethosu.enabled=True backend.ethosu.target="ethos-u85-256" backend.ethosu.memory_mode=Dedicated_Sram_384KB + + # Build the arm_executor_runner application, pre-loading the pte in the DDR for faster linking + local pte_addr="0x76000000" + backends/arm/scripts/build_executor_runner.sh \ + --et_build_root="${et_root_dir}/arm_test" \ + --pte="${pte_addr}" \ + --build_type=Release \ + --target=ethos-u85-256 \ + --system_config=Ethos_U85_SYS_DRAM_Mid \ + --memory_mode=Dedicated_Sram_384KB \ + --ethosu_tools_dir="${scratch_dir}" \ + --toolchain=arm-none-eabi-gcc \ + --extra_build_flags="-DET_ARM_BAREMETAL_SCRATCH_TEMP_ALLOCATOR_POOL_SIZE=0x20000" \ + --select_ops_list="dim_order_ops::_to_dim_order_copy.out" + + + # Deploy the application on the FVP in fast mode + FVP_Corstone_SSE-320 -C mps4_board.subsystem.ethosu.num_macs=256 \ + -C mps4_board.visualisation.disable-visualisation=1 \ + -C vis_hdlcd.disable_visualisation=1 \ + -C mps4_board.telnetterminal0.start_telnet=0 \ + -C mps4_board.uart0.out_file='-' \ + -C mps4_board.uart0.shutdown_on_eot=1 \ + -a "${et_root_dir}"/arm_test/ethos-u85-256_${pte_addr}/cmake-out/arm_executor_runner \ + -C mps4_board.subsystem.ethosu.extra_args="--fast" \ + --data smollm2.pte@"${pte_addr}" + echo "${TEST_SUITE_NAME}: PASS" } diff --git a/examples/arm/executor_runner/CMakeLists.txt b/examples/arm/executor_runner/CMakeLists.txt index d84947a75ad..88050a2ae77 100644 --- a/examples/arm/executor_runner/CMakeLists.txt +++ b/examples/arm/executor_runner/CMakeLists.txt @@ -349,7 +349,6 @@ elseif(FOUND_OPS_IN_FILE) "gen_oplist: EXECUTORCH_SELECT_OPS_MODEL=${ET_PTE_FILE_PATH} is used to auto generate ops from" ) else() - set(EXECUTORCH_SELECT_OPS_LIST "") set(EXECUTORCH_SELECT_OPS_MODEL "") message( "gen_oplist: No non delagated ops was found in ${ET_PTE_FILE_PATH} no ops added to build" diff --git a/examples/arm/run.sh b/examples/arm/run.sh index cfbcae2dbad..3ef4b0b829b 100755 --- a/examples/arm/run.sh +++ b/examples/arm/run.sh @@ -659,7 +659,7 @@ configure_ethosu_scratch_if_requested() { return fi local scratch_size - scratch_size=$(get_ethosu_scratch_size "$pte_path" || true) + scratch_size=$(get_ethosu_scratch_size "$pte_path" | tail -n 1) if [[ -z "${scratch_size}" ]]; then echo "WARNING: Failed to derive Ethos-U scratch size from ${pte_path}" >&2 return From 4e7718d2856cbc9a8ad5717d58f975ae0c46f79f Mon Sep 17 00:00:00 2001 From: George Gekov Date: Fri, 29 May 2026 11:15:47 +0100 Subject: [PATCH 2/2] Change python to python3 in shell script Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- backends/arm/test/test_arm_backend.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/arm/test/test_arm_backend.sh b/backends/arm/test/test_arm_backend.sh index 26f30974a9c..1cb9e135d00 100755 --- a/backends/arm/test/test_arm_backend.sh +++ b/backends/arm/test/test_arm_backend.sh @@ -305,7 +305,7 @@ test_model_smollm2_135M() { backends/arm/scripts/build_executorch.sh # Build pte for smollm2 - python -m extension.llm.export.export_llm \ + python3 -m extension.llm.export.export_llm \ base.model_class=smollm2 \ base.params=examples/models/smollm2/135M_config.json \ debug.verbose=True model.enable_dynamic_shape=False quantization.pt2e_quantize="ethosu_8a8w" \