Repository navigation
77 lines (75 loc) · 3.09 KB
/
Copy pathBenchmark-SolidModel.yml
File metadata and controls
77 lines (75 loc) · 3.09 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
name: Benchmark SolidModel
# Manual only: the QPU17 render takes tens of minutes. Compares a head ref against a base
# ref in the same job so both run on the same runner, then uploads the JSON results and the
# markdown comparison as artifacts. See benchmark/solidmodel/README.md.
on:
workflow_dispatch:
inputs:
base_ref:
description: "Base git ref to compare against (empty = single run, no comparison). Must include benchmark/solidmodel's example setup functions."
required: false
default: "main"
workload:
description: "Workload"
required: true
default: "single_transmon"
type: choice
options:
- single_transmon
- qpu17
- both
options:
description: "Extra options passed to the run scripts (e.g. --order=2 --scales=1.0,0.5)"
required: false
default: "--order=1 --scales=1.0"
jobs:
benchmark:
runs-on: ubuntu-latest
timeout-minutes: 300
permissions:
contents: read
env:
WORKLOADS: ${{ inputs.workload == 'both' && 'single_transmon qpu17' || inputs.workload || 'single_transmon' }}
OPTIONS: ${{ inputs.options || '--order=1 --scales=1.0' }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: julia-actions/setup-julia@v3
with:
version: '1.12'
- uses: julia-actions/cache@v3
- name: Instantiate benchmark environment
run: julia --project=benchmark -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Run head
run: |
mkdir -p results
for w in $WORKLOADS; do
julia --project=benchmark benchmark/solidmodel/run_$w.jl $OPTIONS --out=results/$w-head.json 2>&1 | { grep -v '^Info :' || true; }
done
- name: Run base
if: ${{ github.event_name == 'pull_request' || inputs.base_ref != '' }}
env:
BASE_REF: ${{ github.event_name == 'pull_request' && github.sha || inputs.base_ref }}
run: |
# The harness (benchmark/solidmodel) stays at head; the package under test and the
# example workloads it includes move to the base ref.
git worktree add --detach ../base "$BASE_REF"
julia --project=benchmark -e 'using Pkg; Pkg.develop(PackageSpec(path="../base")); Pkg.instantiate()'
for w in $WORKLOADS; do
julia --project=benchmark benchmark/solidmodel/run_$w.jl $OPTIONS --out=results/$w-base.json 2>&1 | { grep -v '^Info :' || true; }
done
- name: Compare
if: ${{ github.event_name == 'pull_request' || inputs.base_ref != '' }}
run: |
status=0
for w in $WORKLOADS; do
julia --project=benchmark benchmark/solidmodel/compare.jl results/$w-base.json results/$w-head.json | tee results/$w-comparison.md || status=1
cat results/$w-comparison.md >> "$GITHUB_STEP_SUMMARY"
done
exit $status
- uses: actions/upload-artifact@v4
if: always()
with:
name: solidmodel-benchmark
path: results/