From 47ff0b00879012db28610d7ed83d802917124883 Mon Sep 17 00:00:00 2001 From: RJ Ascani Date: Thu, 10 Sep 2026 16:41:05 -0700 Subject: [PATCH 1/3] [Cortex-M] Update CMSIS-NN to v8.0.0 Use the release tag and align the CMSIS pack dependency and smoke-test versions. Remove the transpose-convolution ReLU and Hardtanh expected failures resolved by the release's padding-row alignment fix. Validated with an explicitly selected v8.0.0 M55 runner: 51 passed, 7 xfailed in the focused Cortex-M suite. Runner-script changes and the scratch-allocation workaround are not included. Authored with Codex. --- backends/arm/cmsis_pack/config/executorch_config.yml | 2 +- backends/arm/cmsis_pack/test/smoke/smoke.csolution.yml | 2 +- backends/cortex_m/CMakeLists.txt | 2 +- backends/cortex_m/test/ops/test_conv_transpose.py | 8 +------- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/backends/arm/cmsis_pack/config/executorch_config.yml b/backends/arm/cmsis_pack/config/executorch_config.yml index 91bae4fca79..369756c8220 100644 --- a/backends/arm/cmsis_pack/config/executorch_config.yml +++ b/backends/arm/cmsis_pack/config/executorch_config.yml @@ -22,7 +22,7 @@ dependencies: - pack: ARM::CMSIS version: "6.0.0:6.99.99" - pack: ARM::CMSIS-NN - version: "7.0.0:7.99.99" + version: "8.0.0:8.99.99" optional: true # Only for CMSIS-NN optimized backend - pack: ARM::ethos-u-core-driver version: "1.0.0:1.99.99" diff --git a/backends/arm/cmsis_pack/test/smoke/smoke.csolution.yml b/backends/arm/cmsis_pack/test/smoke/smoke.csolution.yml index e861f16b13a..452eba70b40 100644 --- a/backends/arm/cmsis_pack/test/smoke/smoke.csolution.yml +++ b/backends/arm/cmsis_pack/test/smoke/smoke.csolution.yml @@ -10,7 +10,7 @@ solution: packs: - pack: ARM::CMSIS@>=6.0.0 - - pack: ARM::CMSIS-NN@7.0.0 + - pack: ARM::CMSIS-NN@8.0.0 - pack: ARM::Cortex_DFP@>=1.1.0 - pack: PyTorch::ExecuTorch diff --git a/backends/cortex_m/CMakeLists.txt b/backends/cortex_m/CMakeLists.txt index 3c901b513de..a7c1d7c3ab2 100644 --- a/backends/cortex_m/CMakeLists.txt +++ b/backends/cortex_m/CMakeLists.txt @@ -23,7 +23,7 @@ include(FetchContent) # CMSIS-NN configuration with dynamic path detection set(CMSIS_NN_VERSION - "dbf45dbfcc515421dd6099037d3e2637b90748c8" + "v8.0.0" CACHE STRING "CMSIS-NN version to download" ) set(CMSIS_NN_LOCAL_PATH diff --git a/backends/cortex_m/test/ops/test_conv_transpose.py b/backends/cortex_m/test/ops/test_conv_transpose.py index 14bc8d98b5d..5388a130062 100644 --- a/backends/cortex_m/test/ops/test_conv_transpose.py +++ b/backends/cortex_m/test/ops/test_conv_transpose.py @@ -317,13 +317,7 @@ def test_dialect_conv_transpose2d(test_case, cortex_m_target): tester.check_not(test_case.model.ops_after_absent) -xfails_implementation: dict[str, xfail_type] = { - "conv_transpose2d_relu": "Fused transpose-conv + relu lowers correctly but current implementation is numerically incorrect.", - "conv_transpose2d_hardtanh": "Fused transpose-conv + hardtanh lowers correctly but current implementation is numerically incorrect.", -} - - -@parametrize("test_case", test_cases, xfails=xfails_implementation) +@parametrize("test_case", test_cases) def test_implementation_conv_transpose2d(test_case, cortex_m_target): tester = CortexMTester( test_case.model, test_case.example_inputs, target_config=cortex_m_target From d88ff083b3a2b0c6df4b77b29e06078e08023c2a Mon Sep 17 00:00:00 2001 From: RJ Ascani Date: Mon, 14 Sep 2026 09:10:44 -0700 Subject: [PATCH 2/3] Cortex-M: honor the CMSIS-NN pin in Arm runner builds Stop the Arm runner scripts from automatically overriding CMSIS_NN_LOCAL_PATH with the Ethos-U SDK checkout. Fresh runner builds now use the Cortex-M backend CMake pin, including the v8.0.0 transpose-convolution fix. Explicit CMake overrides remain available through extra_build_flags. Shell syntax, ShellCheck error checks, and git diff checks pass. The CMake-selected v8 library cross-compiles for M55, M7, and M0+ with the expected MVE, DSP, and scalar paths. Complete runner builds and FVP tests have not been rerun for this correction. Authored with OpenAI Codex. --- backends/arm/scripts/build_executor_runner.sh | 5 ----- examples/arm/run.sh | 7 ------- 2 files changed, 12 deletions(-) diff --git a/backends/arm/scripts/build_executor_runner.sh b/backends/arm/scripts/build_executor_runner.sh index eeec9c14166..b83bcc531d3 100755 --- a/backends/arm/scripts/build_executor_runner.sh +++ b/backends/arm/scripts/build_executor_runner.sh @@ -146,10 +146,6 @@ ethosu_tools_dir=$(realpath ${ethosu_tools_dir}) ethos_u_root_dir="${ethosu_tools_dir}/ethos-u" mkdir -p "${ethos_u_root_dir}" ethos_u_root_dir=$(realpath ${ethos_u_root_dir}) -cmsis_nn_local_path="" -if [[ -d "${ethos_u_root_dir}/core_software/cmsis-nn" ]]; then - cmsis_nn_local_path=$(realpath "${ethos_u_root_dir}/core_software/cmsis-nn") -fi if [[ ${system_config} == "" ]] then @@ -246,7 +242,6 @@ cmake \ ${flatc_flags} \ -DEXECUTORCH_SELECT_OPS_LIST="${select_ops_list}" \ -DETHOS_SDK_PATH:PATH=${ethos_u_root_dir} \ - ${cmsis_nn_local_path:+-DCMSIS_NN_LOCAL_PATH:PATH=${cmsis_nn_local_path}} \ ${extra_build_flags} echo "[${BASH_SOURCE[0]}] Configured CMAKE" diff --git a/examples/arm/run.sh b/examples/arm/run.sh index 007c7c63cd2..846fdfec5d2 100755 --- a/examples/arm/run.sh +++ b/examples/arm/run.sh @@ -168,10 +168,6 @@ arm_scratch_dir=$(realpath "${arm_scratch_dir}") ethos_u_root_dir="${arm_scratch_dir}/ethos-u" mkdir -p "${ethos_u_root_dir}" ethos_u_root_dir=$(realpath "${ethos_u_root_dir}") -cmsis_nn_local_path="" -if [[ -d "${ethos_u_root_dir}/core_software/cmsis-nn" ]]; then - cmsis_nn_local_path=$(realpath "${ethos_u_root_dir}/core_software/cmsis-nn") -fi setup_path_script=${arm_scratch_dir}/setup_path.sh _setup_msg="please refer to ${script_dir}/setup.sh to properly install necessary tools." @@ -335,9 +331,6 @@ configure_runner_build_dir() { -DETHOS_SDK_PATH:PATH="${ethos_u_root_dir}" -DEXECUTORCH_SELECT_OPS_LIST="${select_ops_list}" ) - if [[ -n "${cmsis_nn_local_path}" ]]; then - cmake_cmd+=(-DCMSIS_NN_LOCAL_PATH:PATH="${cmsis_nn_local_path}") - fi cmake_cmd+=(-DET_PTE_FILE_PATH:PATH="${pte_source}") if [[ "${pte_placement}" == "elf" ]]; then cmake_cmd+=(-DET_MODEL_PTE_ADDR=) From 2285071f6fb2b8e7f7ed07e71ca9b170937b4a3f Mon Sep 17 00:00:00 2001 From: RJ Ascani Date: Mon, 14 Sep 2026 11:06:04 -0700 Subject: [PATCH 3/3] Arduino: accept CMSIS-NN release tags from the backend pin Read the quoted CMSIS_NN_VERSION value from the Cortex-M CMake configuration without restricting it to a 40-character commit hash. This lets Arduino packaging fetch v8.0.0 while retaining the backend pin as its source of truth and preserving the explicit diagnostic for an empty pin. The actual fetch-and-copy block passes with both the v8.0.0 tag and its commit hash, resolving to the expected revision. Empty-pin diagnostics, shell syntax, ShellCheck error checks, and git diff checks pass. Full Arduino compilation was not rerun locally. Authored with OpenAI Codex. --- examples/arduino/build_arduino_library.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/arduino/build_arduino_library.sh b/examples/arduino/build_arduino_library.sh index 70b1135e485..7cc3aca9bd2 100755 --- a/examples/arduino/build_arduino_library.sh +++ b/examples/arduino/build_arduino_library.sh @@ -318,8 +318,8 @@ done # it with FetchContent at cmake time -- so fetch it at the revision that backend # pins. Without it the Cortex-M ops compile against headers that are not there. if [ -z "$CMSIS_NN" ]; then - CMSIS_NN_PIN=$(sed -n '/set(CMSIS_NN_VERSION/,/)/p' \ - "$ET_ROOT/backends/cortex_m/CMakeLists.txt" | grep -oE '"[0-9a-f]{40}"' | tr -d '"') + CMSIS_NN_PIN=$(sed -n '/set(CMSIS_NN_VERSION/,/)/s/^[[:space:]]*"\([^"]*\)".*/\1/p' \ + "$ET_ROOT/backends/cortex_m/CMakeLists.txt") if [ -z "$CMSIS_NN_PIN" ]; then echo "ERROR: could not read CMSIS_NN_VERSION from backends/cortex_m/CMakeLists.txt" exit 1