Skip to content

Commit 7f4b8ad

Browse files
authored
arm: extend CMSIS-Pack smoke test to Cortex-M (pytorch#22113)
## Summary Extend the CMSIS-Pack smoke consumer to exercise a Cortex-M operator instead of only a Portable operator. This change: - adds the CMSIS-NN component to the smoke project; - selects `Cortex-M quantized_add`; uses `ARM::CMSIS-NN@7.0.0` to keep the smoke test on the currently supported CMSIS-NN major version; - copies the smoke project into a writable container-local directory so the test does not depend on host bind-mount ownership. This directly exercises the Cortex-M / CMSIS-NN path on the ARMCM55 target. ## Testing ```text python -m pytest \ backends/arm/cmsis_pack/test/test_generate_register_all_kernels.py \ backends/arm/cmsis_pack/test/all_ops/test_gen_cproject.py -q 21 passed ``` ```text DOCKER_IMAGE=ghcr.io/arm-software/avh-mlops/arm-mlops-docker-licensed-community:latest-amd64 \ bash backends/arm/cmsis_pack/test/smoke/run.sh Build summary: 1 succeeded, 0 failed === PASS === ``` Related to pytorch#14880. cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani --------- Signed-off-by: Ricardo Alves de Souza <ricardoasouz@hotmail.com>
1 parent 72b2536 commit 7f4b8ad

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎backends/arm/cmsis_pack/test/smoke/run.sh‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ python3 "${TEST_DIR}/../validate_pack.py" "${PACK_FILE}"
5050
echo
5151
echo "=== Consumer build (${DOCKER_IMAGE}) ==="
5252
docker run --rm \
53-
-v "${TEST_DIR}:/workspace" \
53+
-v "${TEST_DIR}:/workspace-src:ro" \
5454
-v "${OUTPUT_DIR}:/pack-output:ro" \
5555
"${DOCKER_IMAGE}" \
5656
bash -lc '
5757
set -euo pipefail
58-
cd /workspace
58+
rm -rf /tmp/executorch-smoke
59+
cp -a /workspace-src /tmp/executorch-smoke
60+
cd /tmp/executorch-smoke
5961
6062
# Acquire the toolchain set declared in vcpkg-configuration.json
6163
# (cmsis-toolbox + arm-none-eabi-gcc + cmake + ninja).

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ project:
99

1010
components:
1111
- component: ARM::CMSIS:CORE
12+
- component: ARM::CMSIS:NN Lib
1213
- component: ARM::Device:Startup&C Startup
1314
- component: Machine Learning:ExecuTorch:Runtime
1415
- component: Machine Learning:ExecuTorch:Kernel Utils
1516
- component: Machine Learning:ExecuTorch:Kernel Registration
1617
- component: Machine Learning:ExecuTorch Operators:Portable add
18+
- component: Machine Learning:ExecuTorch Operators:Cortex-M quantized_add
1719

1820
groups:
1921
- group: App

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

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

1111
packs:
1212
- pack: ARM::CMSIS@>=6.0.0
13+
- pack: ARM::CMSIS-NN@7.0.0
1314
- pack: ARM::Cortex_DFP@>=1.1.0
1415
- pack: PyTorch::ExecuTorch
1516

0 commit comments

Comments
 (0)