Repository navigation
491 lines (475 loc) · 20.5 KB
/
Copy pathCI.yml
File metadata and controls
491 lines (475 loc) · 20.5 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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
name: CI
on:
push:
branches:
- master
tags: '*'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
permissions:
actions: write
contents: read
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
timeout-minutes: 180
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
env:
JULIA_NUM_THREADS: '1'
strategy:
fail-fast: false
matrix:
include:
- {version: '1.10', os: ubuntu-latest, arch: x64}
- {version: '1.11', os: ubuntu-latest, arch: x64}
- {version: '1.12', os: ubuntu-latest, arch: x64}
- {version: '1', os: ubuntu-latest, arch: x64}
- {version: '1', os: windows-latest, arch: x64}
- {version: '1', os: macos-26, arch: arm64}
- {version: 'pre', os: ubuntu-latest, arch: x64}
- {version: 'nightly', os: ubuntu-latest, arch: x64}
steps:
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v3
- name: Develop local TimespanLogging
run: julia --project=. -e 'using Pkg; Pkg.develop(path="lib/TimespanLogging")'
- name: Instantiate
run: julia --project=. -e 'using Pkg; Pkg.instantiate()'
- name: Run tests
run: julia --code-coverage=user test/runtests.jl -t 2
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v7
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
test-multithreaded:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} (${{ matrix.arch }}) (multithreaded)
runs-on: ${{ matrix.os }}
timeout-minutes: 120
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
strategy:
fail-fast: false
matrix:
include:
- {version: '1.10', os: ubuntu-latest, arch: x64}
- {version: '1.11', os: ubuntu-latest, arch: x64}
- {version: '1.12', os: ubuntu-latest, arch: x64}
- {version: '1', os: ubuntu-latest, arch: x64}
- {version: '1', os: windows-latest, arch: x64}
- {version: '1', os: macos-26, arch: arm64}
- {version: 'pre', os: ubuntu-latest, arch: x64}
- {version: 'nightly', os: ubuntu-latest, arch: x64}
steps:
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v3
- name: Develop local TimespanLogging
run: julia --project=. -e 'using Pkg; Pkg.develop(path="lib/TimespanLogging")'
- name: Instantiate
run: julia --project=. -e 'using Pkg; Pkg.instantiate()'
- name: Run tests (multithreaded, no extra workers)
run: julia --code-coverage=user -t auto test/runtests.jl -p 0
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v7
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
finch:
name: Julia 1.11 (Finch)
runs-on: ubuntu-latest
timeout-minutes: 90
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
env:
JULIA_NUM_THREADS: '1'
CI_TEST_FINCH: '1'
steps:
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: '1.11'
arch: x64
- uses: julia-actions/cache@v3
- name: Develop local TimespanLogging
run: julia --project=. -e 'using Pkg; Pkg.develop(path="lib/TimespanLogging")'
- name: Instantiate
run: julia --project=. -e 'using Pkg; Pkg.instantiate()'
- name: Run Finch tests
run: julia --code-coverage=user test/runtests.jl
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v7
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
opencl:
name: Julia 1.11 (OpenCL)
runs-on: ubuntu-latest
timeout-minutes: 30
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
env:
JULIA_NUM_THREADS: '1'
CI_USE_OPENCL: '1'
steps:
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: '1.11'
arch: x64
- uses: julia-actions/cache@v3
- name: Develop local TimespanLogging
run: julia --project=. -e 'using Pkg; Pkg.develop(path="lib/TimespanLogging")'
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v7
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
timespanlogging:
name: Julia 1 - TimespanLogging
runs-on: ubuntu-latest
timeout-minutes: 20
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
steps:
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: '1'
arch: x64
- uses: julia-actions/cache@v3
- name: Test TimespanLogging
run: julia --project=. -e 'using Pkg; Pkg.develop(;path="lib/TimespanLogging"); Pkg.instantiate(); Pkg.test("TimespanLogging")'
daggerwebdash:
name: Julia 1 - DaggerWebDash
runs-on: ubuntu-latest
timeout-minutes: 20
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
steps:
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: '1'
arch: x64
- uses: julia-actions/cache@v3
- name: Test DaggerWebDash
run: julia -e 'using Pkg; Pkg.develop([PackageSpec(path=pwd()), PackageSpec(path="lib/TimespanLogging"), PackageSpec(path="lib/DaggerWebDash")]); include("lib/DaggerWebDash/test/runtests.jl")'
benchmarks:
name: Benchmarks (vs master, ${{ matrix.suite }})
runs-on: ubuntu-latest
timeout-minutes: 120
# Each suite compares both revisions on the same free 4-vCPU runner.
# Split compilation/setup across jobs without reducing coverage.
strategy:
fail-fast: false
matrix:
suite: [array, linalg, sparse, stencil]
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[skip benchmarks]') }}
env:
BENCHMARK: '${{ matrix.suite }}:dagger'
# `benchmark/ci.jl` compares the working tree ("dirty") against this base
# revision and fails the job if any benchmark regresses past the threshold.
BENCHMARK_BASE_REV: master
BENCHMARK_REGRESSION_THRESHOLD: '0.25'
BENCHMARK_CI_THREADS: '4'
# Parallelism belongs to Dagger; avoid a separate BLAS pool per process.
OPENBLAS_NUM_THREADS: '1'
BENCHMARK_OUTPUT_DIR: benchmark_results
# Keep the problem sizes/sampling modest: GitHub-hosted runners are shared,
# 4 vCPU / ~16 GB, and noisier than dedicated benchmarking hardware. The
# orchestrator is OOM-robust, but smaller scales keep wall-clock bounded.
BENCHMARK_SCALE: '[256, 1024]'
# Tile size matters as much as N here, and one tile is not enough. At 512
# alone, N=256 is a *single* chunk (`square_block` returns N when N <= tile)
# and N=1024 is only 2x2, so anything touching data distribution or halo
# exchange is barely exercised. But small tiles are not simply "better":
# tile size sets the ratio of per-tile task overhead to bytes moved per
# transfer, and a data-movement change can be a large win at one tile size
# and a regression at the other. Measure both regimes.
BENCHMARK_BLOCKSIZE: '[128, 512]'
# Setup and GC count against this budget; 3 s often yielded one sample.
BENCHMARK_SECONDS: '30'
BENCHMARK_SAMPLES: '5'
steps:
- uses: actions/checkout@v7
with:
# Full history so the base revision (`master`) is resolvable by
# AirspeedVelocity when it checks out the comparison revision.
fetch-depth: 0
- name: Fetch base revision
run: git fetch -f origin "$BENCHMARK_BASE_REV:$BENCHMARK_BASE_REV" || git fetch origin "$BENCHMARK_BASE_REV" || true
- uses: julia-actions/setup-julia@v3
with:
version: '1'
arch: x64
- uses: julia-actions/cache@v3
- name: Test benchmark comparison
run: julia --startup-file=no benchmark/compare_tests.jl
- name: Run benchmarks (current vs master)
run: julia --color=yes benchmark/ci.jl
- name: Write job summary
if: always()
run: |
if [ -f "${BENCHMARK_OUTPUT_DIR}/report.md" ]; then
# `artifact://` plot refs only render in Buildkite annotations; drop
# them here. The plots are still uploaded as job artifacts below.
grep -v 'artifact://' "${BENCHMARK_OUTPUT_DIR}/report.md" >> "$GITHUB_STEP_SUMMARY"
else
echo "No benchmark report was produced." >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload benchmark artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: benchmark-results-default-${{ matrix.suite }}
path: ${{ env.BENCHMARK_OUTPUT_DIR }}/
if-no-files-found: ignore
# PR comment posting is handled by the `benchmarks-report` job below,
# once this job and its Distributed/MPI siblings have all finished --
# a single writer avoids the suite jobs racing to read-modify-write the
# same PR comment.
benchmarks-distributed:
name: Benchmarks (${{ matrix.topology.name }}, vs master, ${{ matrix.suite }})
runs-on: ubuntu-latest
timeout-minutes: 120
# Each suite compares both revisions on the same free 4-vCPU runner.
# Split compilation/setup across jobs without reducing coverage.
strategy:
fail-fast: false
matrix:
suite: [array, linalg, sparse, stencil]
topology:
- {name: Distributed, artifact: distributed, threads: '1', workers: '3:1'}
- {name: Distributed+Threads, artifact: distributed-threads, threads: '2', workers: '1:2'}
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[skip benchmarks]') }}
env:
BENCHMARK: '${{ matrix.suite }}:dagger'
BENCHMARK_BASE_REV: master
# Multiple OS processes on a shared runner are noisier than the
# single-process default job, so allow more slack before flagging a
# regression.
BENCHMARK_REGRESSION_THRESHOLD: '0.35'
# Count the driver too: either 4×1 or 2×2, within the free 4-vCPU budget.
BENCHMARK_CI_THREADS: '${{ matrix.topology.threads }}'
BENCHMARK_PROCS: '${{ matrix.topology.workers }}'
# Parallelism belongs to Dagger; avoid a separate BLAS pool per process.
OPENBLAS_NUM_THREADS: '1'
BENCHMARK_OUTPUT_DIR: benchmark_results_distributed
BENCHMARK_SCALE: '[256, 1024]'
# See the `benchmarks` job: both tiles, so neither the many-small-chunks
# nor the few-large-chunks regime goes unmeasured.
BENCHMARK_BLOCKSIZE: '[128, 512]'
# Setup and GC count against this budget; 3 s often yielded one sample.
BENCHMARK_SECONDS: '30'
BENCHMARK_SAMPLES: '5'
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Fetch base revision
run: git fetch -f origin "$BENCHMARK_BASE_REV:$BENCHMARK_BASE_REV" || git fetch origin "$BENCHMARK_BASE_REV" || true
- uses: julia-actions/setup-julia@v3
with:
version: '1'
arch: x64
- uses: julia-actions/cache@v3
- name: Run benchmarks (current vs master, Distributed)
run: julia --color=yes benchmark/ci.jl
- name: Write job summary
if: always()
run: |
if [ -f "${BENCHMARK_OUTPUT_DIR}/report.md" ]; then
grep -v 'artifact://' "${BENCHMARK_OUTPUT_DIR}/report.md" >> "$GITHUB_STEP_SUMMARY"
else
echo "No benchmark report was produced." >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload benchmark artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: benchmark-results-${{ matrix.topology.artifact }}-${{ matrix.suite }}
path: ${{ env.BENCHMARK_OUTPUT_DIR }}/
if-no-files-found: ignore
benchmarks-mpi:
name: Benchmarks (${{ matrix.topology.name }}, vs master, ${{ matrix.suite }})
runs-on: ubuntu-latest
timeout-minutes: 120
# Each suite compares both revisions on the same free 4-vCPU runner.
# Split compilation/setup across jobs without reducing coverage.
strategy:
fail-fast: false
matrix:
suite: [array, linalg, sparse, stencil]
topology:
- {name: MPI, artifact: mpi, threads: '1', ranks: '4'}
- {name: MPI+Threads, artifact: mpi-threads, threads: '2', ranks: '2'}
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') && !contains(github.event.head_commit.message, '[skip benchmarks]') }}
env:
BENCHMARK: '${{ matrix.suite }}:dagger'
BENCHMARK_BASE_REV: master
# See benchmarks-distributed: shared-runner multi-process noise.
BENCHMARK_REGRESSION_THRESHOLD: '0.35'
# 4×1 and 2×2 both use four compute threads. MPI_RANKS selects the SPMD worker.
BENCHMARK_CI_THREADS: '${{ matrix.topology.threads }}'
BENCHMARK_MPI_RANKS: '${{ matrix.topology.ranks }}'
# Parallelism belongs to Dagger; avoid a separate BLAS pool per process.
OPENBLAS_NUM_THREADS: '1'
BENCHMARK_OUTPUT_DIR: benchmark_results_mpi
BENCHMARK_SCALE: '[256, 1024]'
# See the `benchmarks` job: both tiles, so neither the many-small-chunks
# nor the few-large-chunks regime goes unmeasured.
BENCHMARK_BLOCKSIZE: '[128, 512]'
# Setup and GC count against this budget; 3 s often yielded one sample.
BENCHMARK_SECONDS: '30'
BENCHMARK_SAMPLES: '5'
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Fetch base revision
run: git fetch -f origin "$BENCHMARK_BASE_REV:$BENCHMARK_BASE_REV" || git fetch origin "$BENCHMARK_BASE_REV" || true
- uses: julia-actions/setup-julia@v3
with:
version: '1'
arch: x64
- uses: julia-actions/cache@v3
- name: Run benchmarks (current vs master, MPI)
run: julia --color=yes benchmark/ci.jl
- name: Write job summary
if: always()
run: |
if [ -f "${BENCHMARK_OUTPUT_DIR}/report.md" ]; then
grep -v 'artifact://' "${BENCHMARK_OUTPUT_DIR}/report.md" >> "$GITHUB_STEP_SUMMARY"
else
echo "No benchmark report was produced." >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload benchmark artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: benchmark-results-${{ matrix.topology.artifact }}-${{ matrix.suite }}
path: ${{ env.BENCHMARK_OUTPUT_DIR }}/
if-no-files-found: ignore
benchmarks-report:
name: Benchmarks (PR comment)
needs: [benchmarks, benchmarks-distributed, benchmarks-mpi]
runs-on: ubuntu-latest
timeout-minutes: 10
if: ${{ always() && github.event_name == 'pull_request' }}
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v7
- name: Test benchmark report rendering
run: node --test .github/scripts/benchmark-report.test.cjs .github/scripts/benchmark-comment.test.cjs
- name: Download benchmark results
if: always()
continue-on-error: true
uses: actions/download-artifact@v7
with:
pattern: benchmark-results-*
path: results
- name: Comment combined results on PR
# Best-effort: fork PRs get a read-only token, so the comment will 403;
# don't fail the job over it.
if: always()
continue-on-error: true
uses: actions/github-script@v9
with:
script: |
const { buildReport, marker } = require('./.github/scripts/benchmark-report.cjs');
const runUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
let body = buildReport('results', runUrl);
const head = context.payload.pull_request.head.sha;
const { mergeCPUReport } = require('./.github/scripts/benchmark-comment.cjs');
const { owner, repo } = context.repo;
const issue_number = context.issue.number;
const { data: currentPR } = await github.rest.pulls.get({ owner, repo, pull_number: issue_number });
if (currentPR.head.sha !== head) return;
const comments = await github.paginate(github.rest.issues.listComments, {
owner, repo, issue_number,
});
const existing = comments.find(c => c.body && c.body.includes(marker));
if (existing) {
body = mergeCPUReport(body, existing.body, head);
await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body });
} else {
body = mergeCPUReport(body, null, head);
await github.rest.issues.createComment({ owner, repo, issue_number, body });
}
mpi-cpu:
name: MPI CPU - Julia ${{ matrix.version }} / ${{ matrix.ranks }} ranks
runs-on: ubuntu-latest
# 4 ranks has less headroom than 2: a clean local run of test/mpi/cpu.jl at 4
# ranks takes ~12-13 minutes on an idle 12-core workstation (matching the
# ~12m historical benchmark in c13465a8's commit message, with all 398
# tests passing and no hang), but shared/oversubscribed `ubuntu-latest`
# runners reportedly take ~40 minutes and occasionally exceed 60 -- a
# timeout-margin problem on slower CI hardware, not a reproducible
# deadlock. Give the 4-rank job more slack than 2-rank needs.
timeout-minutes: ${{ matrix.ranks == 4 && 90 || 60 }}
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
strategy:
fail-fast: false
matrix:
version:
- '1.10' # LTS
- '1.11'
- '1' # latest stable
- 'pre' # latest prerelease
ranks:
- 2
- 4
steps:
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.version }}
arch: x64
- uses: julia-actions/cache@v3
# test/mpi/env pulls MPI (MPICH_jll by default) plus the checked-out Dagger;
# no system MPI installation is required. We `develop` the checkout rather
# than relying on the `[sources]` entry because `[sources]` is a Julia 1.11+
# feature and is silently ignored on 1.10 (LTS), which would otherwise
# resolve a stale registered Dagger lacking the MPI API (`accelerate!`).
- name: Instantiate CPU MPI environment
run: julia --project=test/mpi/env -e 'using Pkg; Pkg.develop([PackageSpec(path=pwd()), PackageSpec(path="lib/TimespanLogging")]); Pkg.instantiate()'
- name: Run CPU MPI tests
run: julia --project=test/mpi/env test/mpi/run.jl ${{ matrix.ranks }} 2 test/mpi/cpu.jl
mpi-opencl:
# OpenCL runs against a CPU-backed ICD (no physical GPU required), unlike
# the other MPI x GPU backends (test/mpi/{cuda,rocm,oneapi,metal}.jl),
# which need real hardware and only run on the Buildkite GPU queues (see
# .buildkite/pipeline.yml). This mirrors those Buildkite jobs' structure
# (Julia 1.11, 2 ranks, 2 threads) but runs here since GitHub-hosted
# runners are sufficient.
name: Julia 1.11 (OpenCL, MPI)
runs-on: ubuntu-latest
timeout-minutes: 30
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
env:
CI_USE_OPENCL: '1'
steps:
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: '1.11'
arch: x64
- uses: julia-actions/cache@v3
- name: Instantiate OpenCL MPI environment
run: julia --project=test/openclenv -e 'using Pkg; Pkg.develop([PackageSpec(path=pwd()), PackageSpec(path="lib/TimespanLogging")]); Pkg.instantiate()'
- name: Run OpenCL MPI tests
run: julia --project=test/openclenv test/mpi/run.jl 2 2 test/mpi/opencl.jl