-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (170 loc) · 5.2 KB
/
benchmark.yml
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
# Generated file: !!! DO NOT EDIT !!!
---
env:
PYPERFORMANCE_HASH: ebb37f3583e26ea22cee34126b3b8a815112370b
PYSTON_BENCHMARKS_HASH: 004743ccbd9e54598c543d7eb71fd3b8e10d5750
name: benchmark
run-name: benchmarking ${{ inputs.fork }}/${{ inputs.ref }} ${{ inputs.tier2 == true
&& 'T2' || '' }} ${{ inputs.jit == true && 'JIT' || '' }} ${{ inputs.nogil == true
&& 'NOGIL' || '' }}
on:
workflow_dispatch:
inputs:
fork:
description: Fork of cpython to benchmark
default: python
ref:
description: Branch, tag or (full) SHA commit to benchmark
default: main
machine:
description: Machine to run on
default: linux-amd64
type: choice
options:
- linux-x86_64-linux
- all
benchmarks:
description: Benchmarks to run (comma-separated; empty runs all benchmarks)
type: string
benchmark_base:
description: Also benchmark the base of this commit
type: boolean
default: false
pystats:
description: Also collect pystats for this commit
type: boolean
default: false
tier2:
description: tier 2 interpreter
type: boolean
default: false
jit:
description: JIT
type: boolean
default: false
nogil:
description: free threading
type: boolean
default: false
jobs:
# Determine the base commit of the selected commit. The output is passed to
# the `base` job below. If the data already exists for this commit, it will be
# skipped.
determine_base:
runs-on: ubuntu-latest
outputs:
head: ${{ steps.base.outputs.head }}
date: ${{ steps.base.outputs.date }}
version: ${{ steps.base.outputs.version }}
ref: ${{ steps.base.outputs.ref }}
need_to_run: ${{ steps.base.outputs.need_to_run }}
steps:
- name: Checkout benchmarking
uses: actions/checkout@v4
- name: Setup system Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
- name: Checkout CPython
uses: actions/checkout@v4
with:
repository: ${{ inputs.fork }}/cpython
path: cpython
ref: ${{ inputs.ref }}
fetch-depth: 0
- name: Install dependencies from PyPI
run: |
pip install -r requirements.txt
- name: Determine base
id: base
run: |
python -m bench_runner get_merge_base ${{ inputs.benchmark_base }} ${{ inputs.machine }} ${{ inputs.pystats }} ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
env:
flags: ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true &&
'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }}
head:
uses: ./.github/workflows/_benchmark.yml
with:
fork: ${{ inputs.fork }}
ref: ${{ inputs.ref }}
machine: ${{ inputs.machine }}
benchmarks: ${{ inputs.benchmarks }}
pgo: true
perf: false
force: true
tier2: ${{ inputs.tier2 }}
jit: ${{ inputs.jit }}
nogil: ${{ inputs.nogil }}
secrets: inherit
base:
uses: ./.github/workflows/_benchmark.yml
needs: determine_base
if: ${{ needs.determine_base.outputs.need_to_run != 'false' }}
with:
fork: python
ref: ${{ needs.determine_base.outputs.ref }}
machine: ${{ inputs.machine }}
benchmarks: ${{ inputs.benchmarks }}
pgo: true
perf: false
force: false
tier2: ${{ inputs.tier2 }}
jit: ${{ inputs.jit }}
nogil: ${{ inputs.nogil }}
secrets: inherit
pystats-head:
uses: ./.github/workflows/_pystats.yml
if: ${{ inputs.pystats }}
with:
fork: ${{ inputs.fork }}
ref: ${{ inputs.ref }}
benchmarks: ${{ inputs.benchmarks }}
individual: true
force: true
tier2: ${{ inputs.tier2 }}
jit: ${{ inputs.jit }}
nogil: ${{ inputs.nogil }}
secrets: inherit
pystats-base:
uses: ./.github/workflows/_pystats.yml
needs: determine_base
if: ${{ inputs.pystats && needs.determine_base.outputs.need_to_run != 'false'
}}
with:
fork: python
ref: ${{ needs.determine_base.outputs.ref }}
benchmarks: ${{ inputs.benchmarks }}
individual: true
force: false
tier2: ${{ inputs.tier2 }}
jit: ${{ inputs.jit }}
nogil: ${{ inputs.nogil }}
secrets: inherit
generate:
uses: ./.github/workflows/_generate.yml
with:
force: false
if: ${{ always() }}
needs: [head, base, pystats-head, pystats-base]
secrets: inherit
publish:
uses: ./.github/workflows/_publish.yml
if: ${{ always() }}
needs: [generate]
secrets: inherit
notify:
uses: ./.github/workflows/_notify.yml
if: ${{ always() }}
needs: [publish, determine_base]
with:
fork: ${{ inputs.fork }}
ref: ${{ inputs.ref }}
head: ${{ needs.determine_base.outputs.head }}
date: ${{ needs.determine_base.outputs.date }}
version: ${{ needs.determine_base.outputs.version }}
tier2: ${{ inputs.tier2 }}
jit: ${{ inputs.jit }}
nogil: ${{ inputs.nogil }}
secrets: inherit