-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path_benchmark.src.yml
More file actions
176 lines (168 loc) · 6.07 KB
/
_benchmark.src.yml
File metadata and controls
176 lines (168 loc) · 6.07 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
---
name: _benchmark
"on":
workflow_call:
inputs:
fork:
description: "Fork of cpython to benchmark"
type: string
ref:
description: "Branch, tag or (full) SHA commit to benchmark"
type: string
machine:
description: "Machine to run on"
type: string
benchmarks:
description: "Benchmarks to run (comma-separated; empty runs all benchmarks)"
type: string
pgo:
description: "Build with PGO"
type: boolean
force:
description: "Rerun and replace results if commit already exists"
type: boolean
perf:
description: "Collect Linux perf profiling data (Linux only)"
type: boolean
workflow_dispatch:
inputs:
fork:
description: "Fork of cpython to benchmark"
type: string
default: "python"
ref:
description: "Branch, tag or (full) SHA commit to benchmark"
type: string
default: "main"
machine:
description: "Machine to run on"
default: "linux-amd64"
type: choice
options:
- linux-amd64
- windows-amd64
- darwin-arm64
- all
benchmarks:
description: "Benchmarks to run (comma-separated; empty runs all benchmarks)"
type: string
force:
description: "Rerun and replace results if commit already exists"
type: boolean
perf:
description: "Collect Linux perf profiling data (Linux only)"
type: boolean
jobs:
benchmark-windows:
runs-on: [self-hosted, windows, bare-metal]
steps:
# Tell git to checkout repos with symlinks (required by pyston
# benchmarks).
# Requires "Developer Mode" switched on in Windows 10/11
- name: Enable symlinks for git
run: |
git config --global core.symlinks true
- name: Checkout benchmarking
uses: actions/checkout@v4
- name: git gc
run: |
git gc
- name: Building Python and running pyperformance
run: |
py workflow_bootstrap.py ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.machine }} ${{ inputs.benchmarks || 'all' }} "${{ env.flags }}" ${{ inputs.force && '--force' || '' }} ${{ inputs.pgo && '--pgo' || '' }} --run_id ${{ github.run_id }}
# Pull again, since another job may have committed results in the meantime
- name: Pull benchmarking
run: |
# Another benchmarking task may have created results for the same
# commit while the above was running. This "magic" incantation means
# that any local results for this commit will override anything we
# just pulled in in that case.
git pull -s recursive -X ours --autostash --rebase
- name: Add data to repo
uses: EndBug/add-and-commit@v9
with:
add: results
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: benchmark
path: |
benchmark.json
overwrite: true
benchmark-linux:
runs-on: [self-hosted, linux, bare-metal]
timeout-minutes: 1440
steps:
- name: Checkout benchmarking
uses: actions/checkout@v4
- name: git gc
run: |
git gc
- uses: fregante/setup-git-user@v2
- name: Setup system Python
if: ${{ runner.arch == 'X64' }}
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Building Python and running pyperformance
run: |
python workflow_bootstrap.py ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.machine }} ${{ inputs.benchmarks || 'all' }} ${{ env.flags }} ${{ inputs.force && '--force' || '' }} ${{ inputs.pgo && '--pgo' || '' }} ${{ inputs.perf && '--perf' || '' }} --run_id ${{ github.run_id }}
# Pull again, since another job may have committed results in the meantime
- name: Pull benchmarking
if: ${{ !inputs.perf }}
run: |
# Another benchmarking task may have created results for the same
# commit while the above was running. This "magic" incantation means
# that any local results for this commit will override anything we
# just pulled in in that case.
git pull -s recursive -X ours --autostash --rebase
- name: Adding data to repo
if: ${{ !inputs.perf }}
uses: EndBug/add-and-commit@v9
with:
add: results
- name: Upload benchmark artifacts
if: ${{ !inputs.perf }}
uses: actions/upload-artifact@v4
with:
name: benchmark
path: |
benchmark.json
overwrite: true
- name: Upload perf artifacts
if: ${{ inputs.perf }}
uses: actions/upload-artifact@v4
with:
name: perf
path: |
profiling/results
benchmark-darwin:
runs-on: [self-hosted, macos, bare-metal]
steps:
- name: Checkout benchmarking
uses: actions/checkout@v4
- name: git gc
run: |
git gc
- name: Building Python and running pyperformance
run: |
python3 workflow_bootstrap.py ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.machine }} ${{ inputs.benchmarks || 'all' }} ${{ env.flags }} ${{ inputs.force && '--force' || '' }} ${{ inputs.pgo && '--pgo' || '' }} --run_id ${{ github.run_id }}
# Pull again, since another job may have committed results in the meantime
- name: Pull benchmarking
run: |
# Another benchmarking task may have created results for the same
# commit while the above was running. This "magic" incantation means
# that any local results for this commit will override anything we
# just pulled in in that case.
git pull -s recursive -X ours --autostash --rebase
- name: Add data to repo
uses: EndBug/add-and-commit@v9
with:
add: results
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: benchmark
path: |
benchmark.json
overwrite: true