Skip to content

Commit 321c029

Browse files
authored
Factor Cortex-M FVP e2e job into a reusable workflow and add nightly (#19070)
### Summary Introduces .github/workflows/_test_cortex_m_e2e.yml as a local reusable workflow that wraps pytorch/test-infra/linux_job_v2.yml with typed models and timeout inputs. Both the existing per-commit trunk job and a new nightly job now call it with only their matrix entries and timeouts. The trunk matrix is unchanged ([mv2, mv3]). The new test-cortex-m-e2e-nightly job covers four additional models on a daily cadence: ds_cnn (MLPerf Tiny keyword spotting), mobilenet_v1_025 (MLPerf Tiny Visual Wake Words / person-detection reference), resnet8 (MLPerf Tiny image classification), and deep_autoencoder (MLPerf Tiny anomaly detection). This follows the same pattern as _test_cadence.yml. This change was authored with Claude (claude-opus-4-7[1m]). ### Test plan CI
1 parent 06d6943 commit 321c029

3 files changed

Lines changed: 62 additions & 27 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test Cortex-M e2e
2+
3+
permissions:
4+
id-token: write
5+
contents: read
6+
7+
on:
8+
workflow_call:
9+
inputs:
10+
models:
11+
description: 'JSON array of model names to run on the Corstone-300 FVP, e.g. ["mv2", "mv3"]'
12+
required: true
13+
type: string
14+
timeout:
15+
description: 'Per-matrix-entry timeout in minutes'
16+
required: false
17+
type: number
18+
default: 120
19+
20+
jobs:
21+
run:
22+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
23+
strategy:
24+
matrix:
25+
model: ${{ fromJSON(inputs.models) }}
26+
fail-fast: false
27+
with:
28+
job-name: ${{ matrix.model }}
29+
runner: linux.2xlarge.memory
30+
docker-image: ci-image:executorch-ubuntu-22.04-arm-sdk
31+
submodules: 'recursive'
32+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
33+
timeout: ${{ inputs.timeout }}
34+
script: |
35+
# The generic Linux job chooses to use base env, not the one setup by the image
36+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
37+
conda activate "${CONDA_ENV}"
38+
39+
source .ci/scripts/utils.sh
40+
install_executorch "--use-pt-pinned-commit"
41+
42+
# Install arm dependencies
43+
.ci/scripts/setup-arm-baremetal-tools.sh
44+
source examples/arm/arm-scratch/setup_path.sh
45+
46+
# Build cortex-m test runner with bundled IO support
47+
backends/cortex_m/test/build_test_runner.sh
48+
49+
# Export model and run on FVP
50+
bash .ci/scripts/test_cortex_m_e2e.sh ${{ matrix.model }}

.github/workflows/nightly.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ jobs:
3737
with:
3838
ref: ${{ github.sha }}
3939

40+
test-cortex-m-e2e-nightly:
41+
name: test-cortex-m-e2e-nightly
42+
permissions:
43+
id-token: write
44+
contents: read
45+
uses: ./.github/workflows/_test_cortex_m_e2e.yml
46+
with:
47+
models: '["ds_cnn", "mobilenet_v1_025", "resnet8", "deep_autoencoder"]'
48+
timeout: 180
49+
4050
test-static-hf-llm-qnn-linux:
4151
name: test-static-hf-llm-qnn-linux
4252
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main

.github/workflows/trunk.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,34 +1091,9 @@ jobs:
10911091
10921092
test-cortex-m-e2e:
10931093
name: test-cortex-m-e2e
1094-
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
1095-
strategy:
1096-
matrix:
1097-
model: [mv2, mv3]
1098-
fail-fast: false
10991094
permissions:
11001095
id-token: write
11011096
contents: read
1097+
uses: ./.github/workflows/_test_cortex_m_e2e.yml
11021098
with:
1103-
runner: linux.2xlarge.memory
1104-
docker-image: ci-image:executorch-ubuntu-22.04-arm-sdk
1105-
submodules: 'recursive'
1106-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
1107-
timeout: 120
1108-
script: |
1109-
# The generic Linux job chooses to use base env, not the one setup by the image
1110-
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
1111-
conda activate "${CONDA_ENV}"
1112-
1113-
source .ci/scripts/utils.sh
1114-
install_executorch "--use-pt-pinned-commit"
1115-
1116-
# Install arm dependencies
1117-
.ci/scripts/setup-arm-baremetal-tools.sh
1118-
source examples/arm/arm-scratch/setup_path.sh
1119-
1120-
# Build cortex-m test runner with bundled IO support
1121-
backends/cortex_m/test/build_test_runner.sh
1122-
1123-
# Export model and run on FVP
1124-
bash .ci/scripts/test_cortex_m_e2e.sh ${{ matrix.model }}
1099+
models: '["mv2", "mv3"]'

0 commit comments

Comments
 (0)