Repository navigation
CodSpeed: interpreter switch for a CPython baseline - #28
Merged
Merged
Conversation
elide-codspeed.yml gets an interpreter switch: DEFAULT_INTERPRETER at the top of the file (graalpy) or the input "interpreter" of a manual run. With graalpy the workflow measures as before. With cpython it skips the GraalPy and wheel builds, installs a pinned python-build-standalone CPython 3.12 (PGO and LTO) with uv and PyPI's wheels of the pinned package versions, and runs the same benchmarks with the same row names and arguments, so that CodSpeed compares CPython with GraalPy on the base branch. CPython runs are refused on pushes and on develop and elide-*.x. codspeed-bench gets --interpreter: cpython leaves out the GraalPy options of the suite interp and skips the rows of CPYTHON_SKIP, and both modes check sys.implementation.name of the interpreters they run. The summary gets the keys "interpreter" and "skipped".
GraalPy implements Python 3.13 (PY_VERSION in its patchlevel.h). The CPython build is now cpython-3.13.17-linux-x86_64-gnu, and check and walltime compare its version with patchlevel.h instead of a fixed 3.12.
…onal (#31) Each timed row reports one value to CodSpeed, the median of the second half of its iterations; walltime-summary.json keeps every iteration. Eight rows that land on different speeds for identical source are measured and listed in the summary but not reported. codspeed-diagnose selects rows of all suites and fails when nothing was measured; the diagnose job runs when the CPython job is skipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets
elide-codspeed.ymlrun the same benchmarks on CPython, so that CodSpeed can compare CPython with GraalPy row by row. CodSpeed only compares a row with the same row of the base branch. The comparison is therefore a run of this workflow on CPython in a pull request that is never merged ("CPython baseline for CodSpeed (do not merge)", branchbench/cpython). On its report every GraalPy row ofdevelopis set against the same row on CPython.What changes
DEFAULT_INTERPRETER: graalpynear the top of the workflow, plus the inputinterpreterfor manual runs.configpicks the interpreter.cpythonon pushes, ondevelopand onelide-*.x, so CPython times never become those branches' history. It also refusescpythontogether withdiagnose.graalpythe workflow measures exactly as before: same rows, same arguments and iteration counts.cpython:cpython, installs CPython and downloads PyPI's wheels for the versions inpackages/requirements.txt. The benchmark host installs them withpackage-venvwithout a network, as for GraalPy.walltimeruns at most four iterations per row (--max-iterations 4), because the sizes are chosen for GraalPy's compiled code. The second half is still what is reported. The job timeout is 240 minutes instead of 120.cpython-3.13.17-linux-x86_64-gnu, the latest 3.13 build that uv offers. Python 3.13 is the version this GraalPy implements (PY_VERSION "3.13.14"in itspatchlevel.h). It is a python-build-standalone build with PGO and LTO, installed by uv 0.13.5; uv pins the build and checks its hash. CPython's experimental JIT is compiled in but off, as in CPython's default (--enable-experimental-jit=yes-off).checkandwalltimeprintsys.versionandCONFIG_ARGS.patchlevel.h, or if--enable-optimizationsor--with-ltois missing, because a slower CPython would make GraalPy look better than it is.codspeed-bench --interpreter graalpy|cpython:cpythonleaves out the GraalPy options of the suiteinterp, so those rows measure CPython's interpreter on the same small sizes.CPYTHON_SKIPwith a reason. The table is empty for now: every row ran on a local CPython exceptc-arith-binop, which only hit my local timeout (it is slow, not broken).sys.implementation.nameof the interpreter is not the one named.walltime-summary.jsongets two new keys,interpreterandskipped. The existing keys are unchanged.numpy-vectorizedtherefore compares different libraries..github/elide/README.mdgets a section "CPython baseline".Checks
micro-native,interp,startup,memoryandpackagesrow ran, including the result checks. The exception isc-arith-binop, which hit my local timeout.interp,startup,memoryand the three C API rows ofcheckran with--interpreter graalpy.packages,interp,startupandmemoryrows and the three C API rows ofcheckrun. The version check accepts 3.13.17 and rejects 3.12.mesowas not run on CPython locally.perf:benchwas removed. The GraalPy path changes only in that the jobs pass--interpreter graalpyand the interpreter is unpacked in a shared step; the rows, arguments and iteration counts are the same.Also in this branch
#31 was merged into this branch: one reported value per row (the median of the second half of the iterations), eight unstable rows kept informational, and fixes to the diagnose job. Its description has the details and the review changes.
A GraalPy-mode run of the combined change on the benchmark host passed: 82 rows measured with unchanged names, none failed, 8 informational.
Reviewed with sol-loop: 5 rounds with gpt-6.2-sol. Sol verdict: approved
🤖 Generated with Claude Code