Skip to content

Commit 64c7eeb

Browse files
authored
Merge branch 'main' into 422
2 parents 666225a + 0ffe825 commit 64c7eeb

File tree

21 files changed

+355
-100
lines changed

21 files changed

+355
-100
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
version: 2
22
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
groups:
8+
actions:
9+
patterns:
10+
- "*"
11+
312
- package-ecosystem: "pip"
413
directory: "/"
514
exclude-paths:

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ jobs:
88
lint:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v5
11+
- uses: actions/checkout@v6
1212
- uses: tox-dev/action-pre-commit-uv@v1

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ jobs:
5252
python: "3.14"
5353
experimental: false
5454
steps:
55-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@v6
5656
- name: Set up Python ${{ matrix.python }}
57-
uses: actions/setup-python@v5
57+
uses: actions/setup-python@v6
5858
if: "!endsWith(matrix.python, '-dev')"
5959
with:
6060
python-version: ${{ matrix.python }}

.github/workflows/mypy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
name: Check code with mypy
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
18-
- uses: actions/setup-python@v5
17+
- uses: actions/checkout@v6
18+
- uses: actions/setup-python@v6
1919
with:
2020
cache: "pip"
2121
cache-dependency-path: "pyproject.toml"

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
id-token: write
1616

1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v6
1919
- name: Set up Python
20-
uses: actions/setup-python@v5
20+
uses: actions/setup-python@v6
2121
with:
2222
python-version: '3.x'
2323
cache: pip

azure-pipelines.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

doc/changelog.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
Changelog
22
=========
33

4+
Version 1.13.0 (2025-10-27)
5+
--------------
6+
* Re-enable xdsl benchmark
7+
* Remove code for Python 3.7 and previous versions
8+
* CI updates:
9+
* fix workflow ubuntu-latest
10+
* remove unused Azure Pipelines config
11+
* update checkout version
12+
* setup dependabot
13+
* update setup-python version
14+
415
Version 1.12.0 (2025-10-24)
516
--------------
617
* Add xdsl benchmark (but disabled by default due to a regression)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Benchmarking Scripts Toolkit
2+
3+
Companion assets for running `pyperformance` benchmarks on hosts that provide isolated CPUs and for backfilling historical CPython revisions to [speed.python.org](https://speed.python.org/).
4+
5+
## Contents
6+
- `run-pyperformance.sh` – shell wrapper that reserves an isolated CPU (175–191) via lockfiles, renders `benchmark.conf` from `benchmark.conf.in` with `m4`, sets up a virtual environment, and runs `pyperformance` with upload enabled.
7+
- `benchmark.conf.in` – template consumed by the wrapper; placeholders `TMPDIR` and `CPUID` are filled in so each run has its own working tree, build directory, and CPU affinity.
8+
- `backfill.py` – Python helper that reads revisions from `backfill_shas.txt` and launches multiple `run-pyperformance.sh` jobs in parallel, capturing stdout/stderr per revision under `output/`.
9+
- `backfill_shas.txt` – example list of `sha=branch` pairs targeted by the backfill script.
10+
11+
## Typical Workflow
12+
1. Ensure kernel CPU isolation (`isolcpus=175-191`) and the `lockfile` utility are available so the wrapper can pin workloads without contention.
13+
2. Invoke `./run-pyperformance.sh -- compile benchmark.conf <sha> <branch>` for an ad-hoc run; the script installs `pyperformance==1.13.0`, clones CPython, and uploads results using the environment label configured in `benchmark.conf.in`.
14+
3. Populate `backfill_shas.txt` with the revisions you want to replay and run `python backfill.py` to batch process them; individual logs land in `output/<branch>-<sha>.out|.err`.
15+
16+
Adjust `benchmark.conf.in` if you need to change build parameters (PGO/LTO, job count, upload target, etc.).
17+
18+
## Scheduled Runs
19+
If you want a daily unattended run, drop an entry like this into `crontab -e` on the host:
20+
21+
```
22+
0 0 * * * cd /home/user/pyperformance/examples/benchmarking-scripts && ./run-pyperformance.sh -- compile_all benchmark.conf > /home/pyperf/pyperformance/cron.log 2>&1
23+
```
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import signal
2+
import subprocess
3+
from multiprocessing import Pool
4+
from pathlib import Path
5+
6+
"""
7+
Parallel backfilling helper for pyperformance runs on isolated CPUs.
8+
9+
Reads `sha=branch` pairs from backfill_shas.txt, invokes run-pyperformance.sh
10+
for each revision, and lets that wrapper pin the workload to an isolated CPU,
11+
materialize benchmark.conf, build CPython, and upload results to
12+
speed.python.org. Stdout/stderr for each revision are captured under
13+
output/<branch>-<sha>.(out|err).
14+
"""
15+
16+
17+
def get_revisions() -> tuple[str, str]:
18+
revisions = []
19+
with open("backfill_shas.txt", "r") as f:
20+
for line in f:
21+
sha, branch = line.split("=")
22+
revisions.append((sha, branch.rstrip()))
23+
return revisions
24+
25+
26+
def run_pyperformance(revision):
27+
sha, branch = revision
28+
print(f"Running run-pyperformance.sh with sha: {sha}, branch: {branch}")
29+
output_dir = Path("output")
30+
output_dir.mkdir(parents=True, exist_ok=True)
31+
out_file = output_dir / f"{branch}-{sha}.out"
32+
err_file = output_dir / f"{branch}-{sha}.err"
33+
with open(out_file, "w") as output, open(err_file, "w") as error:
34+
subprocess.run(
35+
[
36+
"./run-pyperformance.sh",
37+
"-x",
38+
"--",
39+
"compile",
40+
"benchmark.conf",
41+
sha,
42+
branch,
43+
],
44+
stdout=output,
45+
stderr=error,
46+
)
47+
48+
49+
if __name__ == "__main__":
50+
original_sigint_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
51+
signal.signal(signal.SIGINT, original_sigint_handler)
52+
with Pool(8) as pool:
53+
res = pool.map_async(run_pyperformance, get_revisions())
54+
# Without the timeout this blocking call ignores all signals.
55+
res.get(86400)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
5d2edf72d25c2616f0e13d10646460a8e69344fa=main
2+
bd2c7e8c8b10f4d31eab971781de13844bcd07fe=main
3+
29b38b7aae884c14085a918282ea7f0798ed7a2a=main

0 commit comments

Comments
 (0)