Skip to content

Commit d6e2269

Browse files
committed
Arm backend: Add OOTB tests
Signed-off-by: Tom Allsop <[email protected]> Change-Id: I6e3ce0a04c951a93039cf4154117f910c67f2bea
1 parent 3c33d29 commit d6e2269

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

.github/workflows/trunk.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,60 @@ jobs:
302302
exit 1
303303
fi
304304
305+
test-arm-ootb-linux:
306+
name: test-arm-ootb-linux
307+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
308+
permissions:
309+
id-token: write
310+
contents: read
311+
with:
312+
runner: linux.2xlarge
313+
docker-image: executorch-ubuntu-22.04-arm-sdk
314+
submodules: 'recursive'
315+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
316+
timeout: 90
317+
script: |
318+
# The generic Linux job chooses to use base env, not the one setup by the image
319+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
320+
conda activate "${CONDA_ENV}"
321+
322+
# Follow the steps required before running the notebooks
323+
# Try to mirror these as closely as possible
324+
install_executorch "--use-pt-pinned-commit"
325+
bash examples/arm/setup.sh --i-agree-to-the-contained-eula
326+
source examples/arm/ethos-u-scratch/setup_path.sh
327+
328+
# Install requirements for converting notebooks
329+
pip install notebook
330+
331+
# Run OOTB tests
332+
backends/arm/test/test_arm_ootb.sh
333+
334+
test-arm-ootb-macos:
335+
name: test-arm-ootb-macos
336+
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
337+
with:
338+
runner: macos-m1-stable
339+
python-version: '3.11'
340+
submodules: 'recursive'
341+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
342+
timeout: 90
343+
script: |
344+
bash .ci/scripts/setup-conda.sh
345+
eval "$(conda shell.bash hook)"
346+
347+
# Follow the steps required before running the notebooks
348+
# Try to mirror these as closely as possible
349+
${CONDA_RUN} sh install_executorch.sh "--use-pt-pinned-commit"
350+
${CONDA_RUN} sh examples/arm/setup.sh --i-agree-to-the-contained-eula
351+
${CONDA_RUN} source examples/arm/ethos-u-scratch/setup_path.sh
352+
353+
# Install requirements for converting notebooks
354+
${CONDA_RUN} pip install notebook
355+
356+
# Run OOTB tests
357+
${CONDA_RUN} sh backends/arm/test/test_arm_ootb.sh
358+
305359
nxp-build-test:
306360
name: nxp-build-test
307361
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main

backends/arm/test/test_arm_ootb.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2025 Arm Limited and/or its affiliates.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
set -e
9+
10+
run_ootb_tests_ethos_u() {
11+
echo "$FUNCNAME: Running out-of-the-box tests for Arm Ethos-U"
12+
jupyter nbconvert \
13+
--to notebook \
14+
--execute examples/arm/ethos_u_minimal_example.ipynb
15+
echo "${FUNCNAME}: PASS"
16+
}
17+
18+
run_ootb_tests_ethos_u

0 commit comments

Comments
 (0)