Repository navigation
324 lines (301 loc) · 11.4 KB
/
Copy pathgithub-multigpu.yml
File metadata and controls
324 lines (301 loc) · 11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Multi-GPU CI: the nightly schedule runs both marker streams in full and
# publishes their coverage shards, which the canonical coverage report
# (nightly and PR Coverage jobs) merges in. On PR mirror branches the
# streams are opt-in: apply the `ci:multi-gpu` label before the next
# mirror push, or use the manual dispatch for an immediate run on any ref.
name: Multi-GPU GitHub CI
on:
schedule:
# Run ahead of the 02:00 UTC canonical nightly (static has a 90-minute
# ceiling) so tonight's coverage shards are published before the
# canonical coverage job merges them -- one coherent nightly view
# instead of an off-by-one-night report. The shared uv/JIT caches
# restored here are fail-open, so consuming the previous nightly's
# slots only costs wheel downloads on the rare day uv.lock changed.
- cron: "47 23 * * *"
workflow_dispatch:
inputs:
stream:
description: Multi-GPU stream to run
type: choice
options:
- both
- dynamic
- static
default: both
required: true
publish-coverage:
description: Publish coverage shards (default-branch dispatches only)
type: boolean
default: false
required: false
push:
# copy-pr-bot mirrors ready PRs into these trusted repository branches.
branches:
- "pull-request/[0-9]+"
permissions:
contents: read
concurrency:
group: multigpu-ci-${{ github.ref }}
# Cancel obsolete PR revisions, but never interrupt nightly cache publishers.
cancel-in-progress: ${{ github.event_name == 'push' }}
defaults:
run:
shell: bash
env:
PYTHON_VERSION: "3.12"
UV_VERSION: "0.13.5"
EXTRAS_TAG: "cu13,natten-cu13,utils-extras,mesh-extras,nn-extras,model-extras,datapipes-extras,uq-extras,gnns,sym,transformer-engine-cu13"
UV_CACHE_KEY_PREFIX: "uv-cache-nightly-cuda13.3.1-devel-ubuntu24.04-py3.12-uv0.13.5-torch2.13-fullextras"
JIT_CACHE_KEY: "jit-cache-cuda13.3.1-devel-ubuntu24.04-py3.12-latest"
JIT_CACHE_DIR: "/root/.cache/jit"
# Two GPUs match the runner inventory already used by this repository.
# Set both static repository variables together to exercise the cases that
# intentionally require four ranks when that pool becomes available.
MULTIGPU_DYNAMIC_NPROC: ${{ vars.MULTIGPU_DYNAMIC_NPROC || '2' }}
MULTIGPU_STATIC_NPROC: ${{ vars.MULTIGPU_STATIC_NPROC || '2' }}
UV_FROZEN: "1"
UV_NO_SYNC: "1"
PYVISTA_OFF_SCREEN: "true"
jobs:
select:
name: multi-GPU selection
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
pull-requests: read
outputs:
run: ${{ steps.gate.outputs.run }}
steps:
- name: Check multi-GPU opt-in label
id: gate
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REF_NAME: ${{ github.ref_name }}
REPOSITORY: ${{ github.repository }}
run: |
set -euo pipefail
if [[ "$REF_NAME" =~ ^pull-request/([1-9][0-9]*)$ ]]; then
pr_number="${BASH_REMATCH[1]}"
else
echo "::error::Unexpected PR mirror ref: $REF_NAME"
exit 2
fi
labels=$(gh api "repos/${REPOSITORY}/pulls/${pr_number}" \
--jq '[.labels[].name] | join("\n")')
run=false
if grep -qxF "ci:multi-gpu" <<<"$labels"; then
run=true
fi
echo "run=${run}" >> "$GITHUB_OUTPUT"
{
echo "## Multi-GPU PR selection"
echo
echo "PR #${pr_number}: multi-GPU=${run}"
echo
echo "Opt in with the \`ci:multi-gpu\` label before the next"
echo "mirror push, or use the manual workflow dispatch."
} >> "$GITHUB_STEP_SUMMARY"
multigpu_dynamic:
name: multigpu-dynamic
needs: select
if: >-
${{ !cancelled() &&
(github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' &&
(inputs.stream == 'both' || inputs.stream == 'dynamic')) ||
needs.select.outputs.run == 'true') }}
runs-on: ${{ vars.MULTIGPU_DYNAMIC_RUNNER || 'linux-amd64-gpu-h100-latest-2' }}
timeout-minutes: 45
permissions:
actions: read
contents: read
container:
image: nvidia/cuda:13.3.1-devel-ubuntu24.04
options: --shm-size=2g
steps:
- uses: actions/checkout@v5
- name: Run dynamic multi-GPU stream
uses: ./.github/actions/run-multigpu-tests
with:
stream: dynamic
nproc: ${{ env.MULTIGPU_DYNAMIC_NPROC }}
collect-coverage: >-
${{ github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' &&
inputs['publish-coverage'] && github.ref_type == 'branch' &&
github.ref_name == github.event.repository.default_branch) }}
python-version: ${{ env.PYTHON_VERSION }}
uv-version: ${{ env.UV_VERSION }}
extras: ${{ env.EXTRAS_TAG }}
uv-cache-key-prefix: ${{ env.UV_CACHE_KEY_PREFIX }}
jit-cache-key: ${{ env.JIT_CACHE_KEY }}
jit-cache-dir: ${{ env.JIT_CACHE_DIR }}
hf-token: ${{ secrets.HF_CI_DATA_TOKEN }}
multigpu_static:
name: multigpu-static
needs: select
if: >-
${{ !cancelled() &&
(github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' &&
(inputs.stream == 'both' || inputs.stream == 'static')) ||
needs.select.outputs.run == 'true') }}
runs-on: ${{ vars.MULTIGPU_STATIC_RUNNER || 'linux-amd64-gpu-h100-latest-2' }}
timeout-minutes: 90
permissions:
actions: read
contents: read
container:
image: nvidia/cuda:13.3.1-devel-ubuntu24.04
options: --shm-size=2g
steps:
- uses: actions/checkout@v5
- name: Run static multi-GPU stream
uses: ./.github/actions/run-multigpu-tests
with:
stream: static
nproc: ${{ env.MULTIGPU_STATIC_NPROC }}
collect-coverage: >-
${{ github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' &&
inputs['publish-coverage'] && github.ref_type == 'branch' &&
github.ref_name == github.event.repository.default_branch) }}
python-version: ${{ env.PYTHON_VERSION }}
uv-version: ${{ env.UV_VERSION }}
extras: ${{ env.EXTRAS_TAG }}
uv-cache-key-prefix: ${{ env.UV_CACHE_KEY_PREFIX }}
jit-cache-key: ${{ env.JIT_CACHE_KEY }}
jit-cache-dir: ${{ env.JIT_CACHE_DIR }}
hf-token: ${{ secrets.HF_CI_DATA_TOKEN }}
report_multigpu:
name: report multi-GPU results
needs: [multigpu_dynamic, multigpu_static]
if: >-
${{ always() && !cancelled() &&
(needs.multigpu_dynamic.result != 'skipped' ||
needs.multigpu_static.result != 'skipped') }}
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
actions: read
checks: write
contents: read
steps:
- name: Check out repository for report annotations
id: checkout
continue-on-error: true
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Download dynamic JUnit artifact
id: download_dynamic
if: ${{ needs.multigpu_dynamic.result != 'skipped' }}
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: junit-multigpu-dynamic
path: ${{ runner.temp }}/multigpu-junit/dynamic
- name: Publish dynamic test report
if: >-
${{ always() && steps.checkout.outcome == 'success' &&
steps.download_dynamic.outcome == 'success' }}
continue-on-error: true
uses: dorny/test-reporter@v3
with:
name: Multi-GPU dynamic Results
path: ${{ runner.temp }}/multigpu-junit/dynamic/*.xml
reporter: java-junit
fail-on-error: "false"
fail-on-empty: "false"
- name: Download static JUnit artifact
id: download_static
if: ${{ needs.multigpu_static.result != 'skipped' }}
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: junit-multigpu-static
path: ${{ runner.temp }}/multigpu-junit/static
- name: Publish static test report
if: >-
${{ always() && steps.checkout.outcome == 'success' &&
steps.download_static.outcome == 'success' }}
continue-on-error: true
uses: dorny/test-reporter@v3
with:
name: Multi-GPU static Results
path: ${{ runner.temp }}/multigpu-junit/static/*.xml
reporter: java-junit
fail-on-error: "false"
fail-on-empty: "false"
publish_dynamic_coverage:
name: publish dynamic coverage
needs: multigpu_dynamic
if: >-
${{ !cancelled() && needs.multigpu_dynamic.result == 'success' &&
(github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' && inputs['publish-coverage'] &&
github.ref_type == 'branch' &&
github.ref_name == github.event.repository.default_branch)) }}
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- uses: actions/checkout@v5
- name: Download dynamic coverage shards
uses: actions/download-artifact@v4
with:
name: coverage-multigpu-dynamic
path: .
- name: Replace dynamic coverage cache
uses: ./.github/actions/replace-cache
with:
path: .coverage.pytest.multigpu-dynamic*
key: coverage-multigpu-dynamic-latest
description: dynamic multi-GPU coverage shards
github-token: ${{ secrets.GITHUB_TOKEN }}
publish_static_coverage:
name: publish static coverage
needs: multigpu_static
if: >-
${{ !cancelled() && needs.multigpu_static.result == 'success' &&
(github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' && inputs['publish-coverage'] &&
github.ref_type == 'branch' &&
github.ref_name == github.event.repository.default_branch)) }}
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- uses: actions/checkout@v5
- name: Download static coverage shards
uses: actions/download-artifact@v4
with:
name: coverage-multigpu-static
path: .
- name: Replace static coverage cache
uses: ./.github/actions/replace-cache
with:
path: .coverage.pytest.multigpu-static*
key: coverage-multigpu-static-latest
description: static multi-GPU coverage shards
github-token: ${{ secrets.GITHUB_TOKEN }}