Skip to content

Commit f3c08fc

Browse files
authored
[Cortex-M] Update CMSIS-NN to v8.0.0 (pytorch#22719)
### Summary Update CMSIS-NN to v8.0.0 and align the CMSIS pack dependency and smoke-test versions. Stop Arm runner scripts from automatically substituting the Ethos-U SDK checkout, so fresh runner builds use the backend CMake pin. Remove the transpose-convolution ReLU and Hardtanh expected failures resolved by the release's padding-row alignment fix. ### Test plan The original update was validated with an explicitly selected v8.0.0 M55 runner: 51 passed, 7 xfailed in the focused Cortex-M suite. For the runner-script correction, 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. cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell
1 parent e37af23 commit f3c08fc

7 files changed

Lines changed: 6 additions & 24 deletions

File tree

‎backends/arm/cmsis_pack/config/executorch_config.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
- pack: ARM::CMSIS
2323
version: "6.0.0:6.99.99"
2424
- pack: ARM::CMSIS-NN
25-
version: "7.0.0:7.99.99"
25+
version: "8.0.0:8.99.99"
2626
optional: true # Only for CMSIS-NN optimized backend
2727
- pack: ARM::ethos-u-core-driver
2828
version: "1.0.0:1.99.99"

‎backends/arm/cmsis_pack/test/smoke/smoke.csolution.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ solution:
1010

1111
packs:
1212
- pack: ARM::CMSIS@>=6.0.0
13-
- pack: ARM::CMSIS-NN@7.0.0
13+
- pack: ARM::CMSIS-NN@8.0.0
1414
- pack: ARM::Cortex_DFP@>=1.1.0
1515
- pack: PyTorch::ExecuTorch
1616

‎backends/arm/scripts/build_executor_runner.sh‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,6 @@ ethosu_tools_dir=$(realpath ${ethosu_tools_dir})
146146
ethos_u_root_dir="${ethosu_tools_dir}/ethos-u"
147147
mkdir -p "${ethos_u_root_dir}"
148148
ethos_u_root_dir=$(realpath ${ethos_u_root_dir})
149-
cmsis_nn_local_path=""
150-
if [[ -d "${ethos_u_root_dir}/core_software/cmsis-nn" ]]; then
151-
cmsis_nn_local_path=$(realpath "${ethos_u_root_dir}/core_software/cmsis-nn")
152-
fi
153149

154150
if [[ ${system_config} == "" ]]
155151
then
@@ -246,7 +242,6 @@ cmake \
246242
${flatc_flags} \
247243
-DEXECUTORCH_SELECT_OPS_LIST="${select_ops_list}" \
248244
-DETHOS_SDK_PATH:PATH=${ethos_u_root_dir} \
249-
${cmsis_nn_local_path:+-DCMSIS_NN_LOCAL_PATH:PATH=${cmsis_nn_local_path}} \
250245
${extra_build_flags}
251246

252247
echo "[${BASH_SOURCE[0]}] Configured CMAKE"

‎backends/cortex_m/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ include(FetchContent)
2323

2424
# CMSIS-NN configuration with dynamic path detection
2525
set(CMSIS_NN_VERSION
26-
"dbf45dbfcc515421dd6099037d3e2637b90748c8"
26+
"v8.0.0"
2727
CACHE STRING "CMSIS-NN version to download"
2828
)
2929
set(CMSIS_NN_LOCAL_PATH

‎backends/cortex_m/test/ops/test_conv_transpose.py‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,7 @@ def test_dialect_conv_transpose2d(test_case, cortex_m_target):
317317
tester.check_not(test_case.model.ops_after_absent)
318318

319319

320-
xfails_implementation: dict[str, xfail_type] = {
321-
"conv_transpose2d_relu": "Fused transpose-conv + relu lowers correctly but current implementation is numerically incorrect.",
322-
"conv_transpose2d_hardtanh": "Fused transpose-conv + hardtanh lowers correctly but current implementation is numerically incorrect.",
323-
}
324-
325-
326-
@parametrize("test_case", test_cases, xfails=xfails_implementation)
320+
@parametrize("test_case", test_cases)
327321
def test_implementation_conv_transpose2d(test_case, cortex_m_target):
328322
tester = CortexMTester(
329323
test_case.model, test_case.example_inputs, target_config=cortex_m_target

‎examples/arduino/build_arduino_library.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ done
318318
# it with FetchContent at cmake time -- so fetch it at the revision that backend
319319
# pins. Without it the Cortex-M ops compile against headers that are not there.
320320
if [ -z "$CMSIS_NN" ]; then
321-
CMSIS_NN_PIN=$(sed -n '/set(CMSIS_NN_VERSION/,/)/p' \
322-
"$ET_ROOT/backends/cortex_m/CMakeLists.txt" | grep -oE '"[0-9a-f]{40}"' | tr -d '"')
321+
CMSIS_NN_PIN=$(sed -n '/set(CMSIS_NN_VERSION/,/)/s/^[[:space:]]*"\([^"]*\)".*/\1/p' \
322+
"$ET_ROOT/backends/cortex_m/CMakeLists.txt")
323323
if [ -z "$CMSIS_NN_PIN" ]; then
324324
echo "ERROR: could not read CMSIS_NN_VERSION from backends/cortex_m/CMakeLists.txt"
325325
exit 1

‎examples/arm/run.sh‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,6 @@ arm_scratch_dir=$(realpath "${arm_scratch_dir}")
168168
ethos_u_root_dir="${arm_scratch_dir}/ethos-u"
169169
mkdir -p "${ethos_u_root_dir}"
170170
ethos_u_root_dir=$(realpath "${ethos_u_root_dir}")
171-
cmsis_nn_local_path=""
172-
if [[ -d "${ethos_u_root_dir}/core_software/cmsis-nn" ]]; then
173-
cmsis_nn_local_path=$(realpath "${ethos_u_root_dir}/core_software/cmsis-nn")
174-
fi
175171
setup_path_script=${arm_scratch_dir}/setup_path.sh
176172
_setup_msg="please refer to ${script_dir}/setup.sh to properly install necessary tools."
177173

@@ -335,9 +331,6 @@ configure_runner_build_dir() {
335331
-DETHOS_SDK_PATH:PATH="${ethos_u_root_dir}"
336332
-DEXECUTORCH_SELECT_OPS_LIST="${select_ops_list}"
337333
)
338-
if [[ -n "${cmsis_nn_local_path}" ]]; then
339-
cmake_cmd+=(-DCMSIS_NN_LOCAL_PATH:PATH="${cmsis_nn_local_path}")
340-
fi
341334
cmake_cmd+=(-DET_PTE_FILE_PATH:PATH="${pte_source}")
342335
if [[ "${pte_placement}" == "elf" ]]; then
343336
cmake_cmd+=(-DET_MODEL_PTE_ADDR=)

0 commit comments

Comments
 (0)