Skip to content

Commit 5c3cdea

Browse files
committed
[Backend Tester] Refactor workflows into one workflow per backend
ghstack-source-id: 8cc6394 ghstack-comment-id: 3272769283 Pull-Request: #14137
1 parent 8478830 commit 5c3cdea

File tree

6 files changed

+175
-48
lines changed

6 files changed

+175
-48
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
runner:
15+
description: 'Runner to use'
16+
required: true
17+
type: string
18+
docker-image:
19+
description: 'Docker image to use (Linux only)'
20+
required: false
21+
type: string
22+
python-version:
23+
description: 'Python version to use (macOS only)'
24+
required: false
25+
type: string
26+
ref:
27+
description: 'Git ref to checkout'
28+
required: false
29+
type: string
30+
default: ${{ github.sha }}
31+
timeout:
32+
description: 'Job timeout in minutes'
33+
required: false
34+
type: number
35+
default: 120
36+
37+
jobs:
38+
test-backend:
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
flow: ${{ fromJSON(inputs.flows) }}
43+
suite: [models, operators]
44+
45+
uses: ${{ contains(inputs.runner, 'macos') && 'pytorch/test-infra/.github/workflows/macos_job.yml@main' || 'pytorch/test-infra/.github/workflows/linux_job_v2.yml@main' }}
46+
permissions:
47+
id-token: write
48+
contents: read
49+
with:
50+
ref: ${{ inputs.ref }}
51+
runner: ${{ inputs.runner }}
52+
docker-image: ${{ inputs.docker-image }}
53+
python-version: ${{ inputs.python-version }}
54+
submodules: recursive
55+
timeout: ${{ inputs.timeout }}
56+
upload-artifact: test-report-${{ matrix.flow }}-${{ matrix.suite }}
57+
script: |
58+
set -eux
59+
60+
${{ contains(inputs.runner, 'macos') && '# This is needed to get the prebuilt PyTorch wheel from S3
61+
${CONDA_RUN} --no-capture-output pip install awscli==1.37.21
62+
63+
source .ci/scripts/test_backend_macos.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"' || 'source .ci/scripts/test_backend_linux.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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
runner: macos-m1-stable
26+
python-version: "3.12"
27+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
28+
timeout: 120
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
runner: linux.4xlarge.memory
26+
docker-image: ci-image:executorch-ubuntu-22.04-clang12
27+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
28+
timeout: 120
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
runner: linux.4xlarge.memory
26+
docker-image: ci-image:executorch-ubuntu-22.04-clang12
27+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
28+
timeout: 120
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
runner: linux.4xlarge.memory
26+
docker-image: ci-image:executorch-ubuntu-22.04-clang12
27+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
28+
timeout: 120

0 commit comments

Comments
 (0)