Skip to content

Commit e7fecdf

Browse files
authored
[Backend Tester] Refactor workflows into one workflow per backend (#14137)
Split the backend test workflows out of the nightly job. This should make it easier to read the summary job as it won't cram all of the jobs onto one page.
1 parent 3ef7cc1 commit e7fecdf

File tree

6 files changed

+187
-48
lines changed

6 files changed

+187
-48
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Test Backend
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
backend:
7+
description: 'Backend to test (xnnpack, coreml, vulkan, qnn)'
8+
required: true
9+
type: string
10+
flows:
11+
description: 'JSON array of flows to test'
12+
required: true
13+
type: string
14+
ref:
15+
description: 'Git ref to checkout'
16+
required: false
17+
type: string
18+
default: ${{ github.sha }}
19+
timeout:
20+
description: 'Job timeout in minutes'
21+
required: false
22+
type: number
23+
default: 120
24+
run-linux:
25+
description: 'Whether to run Linux tests'
26+
required: false
27+
type: boolean
28+
default: false
29+
run-macos:
30+
description: 'Whether to run macOS tests'
31+
required: false
32+
type: boolean
33+
default: false
34+
35+
jobs:
36+
test-backend-linux:
37+
if: ${{ inputs.run-linux }}
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
flow: ${{ fromJSON(inputs.flows) }}
42+
suite: [models, operators]
43+
44+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
45+
with:
46+
ref: ${{ inputs.ref }}
47+
runner: linux.4xlarge.memory
48+
docker-image: ci-image:executorch-ubuntu-22.04-clang12
49+
submodules: recursive
50+
timeout: ${{ inputs.timeout }}
51+
upload-artifact: test-report-${{ matrix.flow }}-${{ matrix.suite }}
52+
script: |
53+
set -eux
54+
55+
source .ci/scripts/test_backend_linux.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"
56+
57+
test-backend-macos:
58+
if: ${{ inputs.run-macos }}
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
flow: ${{ fromJSON(inputs.flows) }}
63+
suite: [models, operators]
64+
65+
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
66+
with:
67+
ref: ${{ inputs.ref }}
68+
runner: macos-m1-stable
69+
python-version: "3.12"
70+
submodules: recursive
71+
timeout: ${{ inputs.timeout }}
72+
upload-artifact: test-report-${{ matrix.flow }}-${{ matrix.suite }}
73+
script: |
74+
set -eux
75+
76+
# This is needed to get the prebuilt PyTorch wheel from S3
77+
${CONDA_RUN} --no-capture-output pip install awscli==1.37.21
78+
79+
source .ci/scripts/test_backend_macos.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"

.github/workflows/nightly.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -36,51 +36,3 @@ jobs:
3636
uses: ./.github/workflows/_link_check.yml
3737
with:
3838
ref: ${{ github.sha }}
39-
40-
backend-test-linux:
41-
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
42-
strategy:
43-
fail-fast: false
44-
matrix:
45-
flow: [
46-
qnn, qnn_16a16w, qnn_16a8w, qnn_16a4w, qnn_16a4w_block, qnn_8a8w,
47-
vulkan, vulkan_static_int8_per_channel,
48-
xnnpack, xnnpack_dynamic_int8_per_channel, xnnpack_static_int8_per_channel, xnnpack_static_int8_per_tensor
49-
]
50-
suite: [models, operators]
51-
with:
52-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
53-
runner: linux.4xlarge.memory
54-
docker-image: ci-image:executorch-ubuntu-22.04-clang12
55-
submodules: recursive
56-
timeout: 120
57-
upload-artifact: test-report-${{ matrix.flow }}-${{ matrix.suite }}
58-
script: |
59-
set -eux
60-
61-
source .ci/scripts/test_backend_linux.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"
62-
63-
backend-test-macos:
64-
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
65-
permissions:
66-
id-token: write
67-
contents: read
68-
strategy:
69-
fail-fast: false
70-
matrix:
71-
flow: [coreml, coreml_static_int8]
72-
suite: [models, operators]
73-
with:
74-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
75-
runner: macos-m1-stable
76-
python-version: 3.12
77-
submodules: recursive
78-
timeout: 120
79-
upload-artifact: test-report-${{ matrix.flow }}-${{ matrix.suite }}
80-
script: |
81-
set -eux
82-
83-
# This is needed to get the prebuilt PyTorch wheel from S3
84-
${CONDA_RUN} --no-capture-output pip install awscli==1.37.21
85-
86-
source .ci/scripts/test_backend_macos.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test CoreML Backend
2+
3+
on:
4+
schedule:
5+
- cron: 0 2 * * *
6+
push:
7+
tags:
8+
- ciflow/nightly/*
9+
pull_request:
10+
paths:
11+
- .github/workflows/test-backend-coreml.yml
12+
- .github/workflows/_test_backend.yml
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: ${{ github.workflow }}--${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
test-coreml:
21+
uses: ./.github/workflows/_test_backend.yml
22+
with:
23+
backend: coreml
24+
flows: '["coreml", "coreml_static_int8"]'
25+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
26+
timeout: 120
27+
run-macos: true
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test QNN Backend
2+
3+
on:
4+
schedule:
5+
- cron: 0 2 * * *
6+
push:
7+
tags:
8+
- ciflow/nightly/*
9+
pull_request:
10+
paths:
11+
- .github/workflows/test-backend-qnn.yml
12+
- .github/workflows/_test_backend.yml
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: ${{ github.workflow }}--${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
test-qnn:
21+
uses: ./.github/workflows/_test_backend.yml
22+
with:
23+
backend: qnn
24+
flows: '["qnn", "qnn_16a16w", "qnn_16a8w", "qnn_16a4w", "qnn_16a4w_block", "qnn_8a8w"]'
25+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
26+
timeout: 120
27+
run-linux: true
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test Vulkan Backend
2+
3+
on:
4+
schedule:
5+
- cron: 0 2 * * *
6+
push:
7+
tags:
8+
- ciflow/nightly/*
9+
pull_request:
10+
paths:
11+
- .github/workflows/test-backend-vulkan.yml
12+
- .github/workflows/_test_backend.yml
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: ${{ github.workflow }}--${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
test-vulkan:
21+
uses: ./.github/workflows/_test_backend.yml
22+
with:
23+
backend: vulkan
24+
flows: '["vulkan", "vulkan_static_int8_per_channel"]'
25+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
26+
timeout: 120
27+
run-linux: true
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test XNNPACK Backend
2+
3+
on:
4+
schedule:
5+
- cron: 0 2 * * *
6+
push:
7+
tags:
8+
- ciflow/nightly/*
9+
pull_request:
10+
paths:
11+
- .github/workflows/test-backend-xnnpack.yml
12+
- .github/workflows/_test_backend.yml
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: ${{ github.workflow }}--${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
test-xnnpack:
21+
uses: ./.github/workflows/_test_backend.yml
22+
with:
23+
backend: xnnpack
24+
flows: '["xnnpack", "xnnpack_dynamic_int8_per_channel", "xnnpack_static_int8_per_channel", "xnnpack_static_int8_per_tensor"]'
25+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
26+
timeout: 120
27+
run-linux: true

0 commit comments

Comments
 (0)