-
Notifications
You must be signed in to change notification settings - Fork 1
325 lines (316 loc) · 11.7 KB
/
Copy pathgpu-validation.yml
File metadata and controls
325 lines (316 loc) · 11.7 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
325
name: GPU validation
on:
workflow_dispatch:
inputs:
target:
description: "Accelerator lane to validate"
type: choice
required: true
default: cuda
options: [cuda, metal, all]
mode:
description: "Quick validates selected lanes; full is release-grade and requires all"
type: choice
required: true
default: quick
options: [quick, full]
coverage-base-ref:
description: "Git revision used as the changed-line coverage base in full mode"
type: string
required: false
default: "v0.6.2"
permissions:
contents: read
concurrency:
group: gpu-validation-${{ github.sha }}-${{ inputs.target }}-${{ inputs.mode }}
cancel-in-progress: ${{ inputs.mode == 'quick' }}
env:
CARGO_TERM_COLOR: always
J2K_COVERAGE_BASE: ${{ inputs.coverage-base-ref }}
RUSTFLAGS: "-D warnings"
jobs:
validate-inputs:
name: Validate GPU request
runs-on: ubuntu-latest
steps:
- name: Reject unsafe or contradictory requests
env:
MODE: ${{ inputs.mode }}
TARGET: ${{ inputs.target }}
run: |
if [ "${MODE}" = full ] && [ "${TARGET}" != all ]; then
echo "full GPU validation requires target=all" >&2
exit 1
fi
cuda-quick:
name: CUDA quick validation
needs: [validate-inputs]
if: ${{ inputs.mode == 'quick' && (inputs.target == 'cuda' || inputs.target == 'all') }}
runs-on: [self-hosted, Linux, X64, cuda]
# Quick timing is telemetry until representative warm-cache runs establish a budget.
timeout-minutes: 90
env:
J2K_REQUIRE_CUDA_RUNTIME: "1"
J2K_REQUIRE_CUDA_OXIDE_BUILD: "1"
J2K_REQUIRE_CUDA_JPEG_HARDWARE_DECODE: "1"
RUST_TEST_THREADS: "1"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c
with:
toolchain: "1.96"
- name: Fingerprint CUDA cache environment
run: |
{
nvidia-smi --query-gpu=driver_version --format=csv,noheader
nvcc --version
} | sha256sum | awk '{print "J2K_GPU_CACHE_ENV=cuda-" $1}' \
>> "${GITHUB_ENV}"
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
with:
shared-key: gpu-cuda-${{ runner.os }}-${{ runner.arch }}-1.96
key: profiles-gpu-quick-release-v1
env-vars: "CARGO CC CFLAGS CXX CMAKE RUST J2K_GPU_CACHE_ENV"
cache-bin: false
save-if: false
- name: Show CUDA runner diagnostics
run: |
uname -a
rustc -Vv
cargo -V
nvidia-smi
command -v nvcc
nvcc --version
- name: Configure CUDA Oxide bindgen
run: bash scripts/configure-cuda-bindgen.sh
- name: Run fail-closed quick CUDA validation
run: |
started="$(date +%s)"
status=0
cargo xtask release-cuda --mode quick || status=$?
elapsed="$(( $(date +%s) - started ))"
echo "CUDA quick wall time: ${elapsed}s" | tee -a "${GITHUB_STEP_SUMMARY}"
exit "${status}"
metal-quick:
name: Metal quick validation
needs: [validate-inputs]
if: ${{ inputs.mode == 'quick' && (inputs.target == 'metal' || inputs.target == 'all') }}
runs-on: [self-hosted, macOS, ARM64, metal]
# Keep the 15-minute target informational until runner variance is measured.
timeout-minutes: 60
env:
J2K_REQUIRE_METAL_RUNTIME: "1"
RUST_TEST_THREADS: "1"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c
with:
toolchain: "1.96"
components: clippy
- name: Fingerprint Metal cache environment
run: |
{
sw_vers
xcrun metal --version
} | shasum -a 256 | awk '{print "J2K_GPU_CACHE_ENV=metal-" $1}' \
>> "${GITHUB_ENV}"
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
with:
shared-key: gpu-metal-${{ runner.os }}-${{ runner.arch }}-1.96
key: profiles-gpu-quick-release-v1
env-vars: "CARGO CC CFLAGS CXX CMAKE RUST J2K_GPU_CACHE_ENV"
cache-bin: false
save-if: false
- name: Show Metal runner diagnostics
run: |
uname -a
system_profiler SPDisplaysDataType
rustc -Vv
cargo -V
- name: Run fail-closed quick Metal validation
run: |
started="$(date +%s)"
status=0
cargo xtask release-metal --mode quick || status=$?
elapsed="$(( $(date +%s) - started ))"
echo "Metal quick wall time: ${elapsed}s (telemetry target: <=900s)" \
| tee -a "${GITHUB_STEP_SUMMARY}"
exit "${status}"
cuda-full:
name: CUDA full release validation
needs: [validate-inputs]
if: ${{ inputs.mode == 'full' && inputs.target == 'all' }}
runs-on: [self-hosted, Linux, X64, cuda]
timeout-minutes: 90
env:
J2K_REQUIRE_CUDA_RUNTIME: "1"
J2K_REQUIRE_CUDA_OXIDE_BUILD: "1"
J2K_REQUIRE_CUDA_JPEG_HARDWARE_DECODE: "1"
RUST_TEST_THREADS: "1"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c
with:
toolchain: "1.96"
components: clippy
- name: Fingerprint CUDA cache environment
run: |
{
nvidia-smi --query-gpu=driver_version --format=csv,noheader
nvcc --version
} | sha256sum | awk '{print "J2K_GPU_CACHE_ENV=cuda-" $1}' \
>> "${GITHUB_ENV}"
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
with:
shared-key: gpu-cuda-${{ runner.os }}-${{ runner.arch }}-1.96
key: profiles-gpu-quick-release-v1
env-vars: "CARGO CC CFLAGS CXX CMAKE RUST J2K_GPU_CACHE_ENV"
cache-bin: false
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Show CUDA runner diagnostics
run: |
uname -a
rustc -Vv
cargo -V
nvidia-smi
command -v nvcc
nvcc --version
- name: Configure CUDA Oxide bindgen
run: bash scripts/configure-cuda-bindgen.sh
- name: Run fail-closed full CUDA validation
run: |
started="$(date +%s)"
status=0
cargo xtask release-cuda --mode full || status=$?
elapsed="$(( $(date +%s) - started ))"
echo "CUDA full wall time: ${elapsed}s" | tee -a "${GITHUB_STEP_SUMMARY}"
exit "${status}"
- name: Compile packaged CUDA adapter and dependencies as an external consumer
run: cargo xtask package-consumer-smoke --target cuda --cuda-runtime
- name: Generate exact-reference CUDA adapter evidence
if: ${{ always() }}
run: |
status=0
cargo xtask t803 fetch || status=$?
if [ "${status}" -eq 0 ]; then
cargo xtask t803 run --iut cuda --out-dir target/t803/reports || status=$?
fi
echo "T803_STATUS=${status}" >> "${GITHUB_ENV}"
- name: Upload CUDA T.803 reports only
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: j2k-t803-cuda-linux-x86_64-${{ github.sha }}
path: |
target/t803/reports/cuda.json
target/t803/reports/cuda.md
if-no-files-found: error
- name: Ensure pinned coverage tool
run: scripts/ensure-cargo-llvm-cov.sh
- name: Collect changed-line CUDA host coverage
run: cargo xtask coverage cuda
- name: Compile CUDA benchmark lane
run: cargo xtask bench-build --lane cuda
- name: Upload CUDA coverage evidence
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: j2k-cuda-full-coverage-${{ github.sha }}
path: |
lcov-cuda.info
coverage-cuda-summary.json
coverage-cuda-regions.json
if-no-files-found: error
- name: Enforce CUDA T.803 result after evidence upload
if: ${{ always() }}
run: exit "${T803_STATUS:-1}"
metal-full:
name: Metal full release validation
needs: [validate-inputs]
if: ${{ inputs.mode == 'full' && inputs.target == 'all' }}
runs-on: [self-hosted, macOS, ARM64, metal]
timeout-minutes: 60
env:
J2K_REQUIRE_METAL_RUNTIME: "1"
RUST_TEST_THREADS: "1"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c
with:
toolchain: "1.96"
components: clippy
- name: Fingerprint Metal cache environment
run: |
{
sw_vers
xcrun metal --version
} | shasum -a 256 | awk '{print "J2K_GPU_CACHE_ENV=metal-" $1}' \
>> "${GITHUB_ENV}"
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
with:
shared-key: gpu-metal-${{ runner.os }}-${{ runner.arch }}-1.96
key: profiles-gpu-quick-release-v1
env-vars: "CARGO CC CFLAGS CXX CMAKE RUST J2K_GPU_CACHE_ENV"
cache-bin: false
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Show Metal runner diagnostics
run: |
uname -a
system_profiler SPDisplaysDataType
rustc -Vv
cargo -V
- name: Run fail-closed full Metal validation
run: |
started="$(date +%s)"
status=0
cargo xtask release-metal --mode full || status=$?
elapsed="$(( $(date +%s) - started ))"
echo "Metal full wall time: ${elapsed}s" | tee -a "${GITHUB_STEP_SUMMARY}"
exit "${status}"
- name: Compile packaged Metal adapter and dependencies as an external consumer
run: cargo xtask package-consumer-smoke --target metal
- name: Generate exact-reference Metal adapter evidence
if: ${{ always() }}
run: |
status=0
cargo xtask t803 fetch || status=$?
if [ "${status}" -eq 0 ]; then
cargo xtask t803 run --iut metal --out-dir target/t803/reports || status=$?
fi
echo "T803_STATUS=${status}" >> "${GITHUB_ENV}"
- name: Upload Metal T.803 reports only
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: j2k-t803-metal-macos-aarch64-${{ github.sha }}
path: |
target/t803/reports/metal.json
target/t803/reports/metal.md
if-no-files-found: error
- name: Ensure pinned coverage tool
run: scripts/ensure-cargo-llvm-cov.sh
- name: Collect changed-line Metal host coverage
run: cargo xtask coverage metal
- name: Compile Metal benchmark lane
run: cargo xtask bench-build --lane metal
- name: Upload Metal coverage evidence
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: j2k-metal-full-coverage-${{ github.sha }}
path: |
lcov-metal.info
coverage-metal-summary.json
coverage-metal-regions.json
if-no-files-found: error
- name: Enforce Metal T.803 result after evidence upload
if: ${{ always() }}
run: exit "${T803_STATUS:-1}"