Skip to content

Methodology 0.5: four code layouts per run, a pause before every iteration, t-intervals - #3

Open
MatejKocourek wants to merge 1 commit into
mainfrom
methodology-0.5
Open

MatejKocourek wants to merge 1 commit into
mainfrom
methodology-0.5

Conversation

@MatejKocourek

Copy link
Copy Markdown
Collaborator

Methodology 0.5, from the run-design and noise studies on the kabylake machine (R 4.5.2).

What changes

  • Four code layouts of every build. Where the linker puts R's code moved some benchmarks by up to 20% (MMM-T1), 5% (heat) or 1–3% (rw2d1, reversecomplement, hmc2, knucleotide). build/build-r.sh now also links R three more times with 1000, 2100 and 3300 bytes of filler in front of R's code and installs each in PREFIX/layout/PAD. Only R.bin is relinked (under 1 s each); the rest of the installation is hard links, plus the few text files naming the prefix. The layouts are part of the build id.
  • A run is one pass of the suite per layout, one process per benchmark in each (speedr-node run). speedr merge-passes turns the 4 pass reports into one timing.json, with pass k as process k. The layouts are recorded in run.env and meta.json (run_design.layouts).
  • A 1 ms pause before every iteration: rbench is pinned to harness: idle 1 ms before each iteration's clock starts r-benchmarks#6. Without it, what one iteration left in the branch predictors carried into the next one (convolution: about 1 iteration in 15 ran 37% slower; att3_5, em and matmult_triplp shifted by whole processes).
  • Statistics: 95% t-intervals (n − 1 df for a run, n_a + n_b − 2 for a comparison, also on the compare page) and a 0.1% floor on each run's log standard error. These apply to every methodology the site renders.
  • mathkernel/MMM-T1 is left out (PRUNED in drivers/common.py, applied to both drivers). Its smallest resolvable change is about 10%, and matmult_triplp runs the same scalar triple loop. heat, rw2d1 and pidigits (2–3%) stay for now.
  • methodology/0.5.qmd (with how the design was chosen), versions.csv, guidelines.

Evidence

Six runs of R 4.5.2 under this design, 117 benchmarks, comparing every pair of runs (same build, so nothing to find):

  • the interval excluded no change in 2.1% of comparisons (nominal 5%);
  • 0 of 1755 were flagged;
  • the smallest resolvable change was 0.43% at the median benchmark and 1.20% at the 90th percentile.

Tested

  • pytest: 51 passed.
  • Site statistics exercised on the mock data. Quarto isn't installed locally, so the compare page's JavaScript was only checked by reading; CI renders it.
  • Builds on bench4 with the new build-r.sh (scratch prefix):
    • R 4.5.2: all three layout binaries are byte-identical to the full padded builds from the study, and the base binary is identical to the production build.
    • R 3.0.2 (lib64 installation): all three layouts link and run.
    • Each build grows by about 50 MB.

🤖 Generated with Claude Code

…ation, t-intervals

- Every build is also linked at three more code layouts (1000, 2100 and
  3300 bytes of filler in front of R's code; build-r.sh relinks R.bin,
  byte-identical to compiling with the filler, and hard-links the rest of
  the installation). A run is one pass of the suite per layout, one process
  per benchmark each; speedr merge-passes makes the k-th pass process k.
- rbench pinned to PRL-PRG/r-benchmarks#6: the harness idles 1 ms before
  each iteration's clock starts, so no iteration inherits the branch
  predictor state of the one before.
- Statistics: 95% t-intervals (n - 1 df for a run, n_a + n_b - 2 for a
  comparison) and a 0.1% floor on every run's log standard error.
- mathkernel/MMM-T1 left out (drivers/common.py PRUNED): one layout in
  eleven made it 20% slower, and matmult_triplp runs the same kernel.

Measured on R 4.5.2, six runs under this design: same-build comparisons
excluded no change in 2.1% of cases (95% intervals allow 5%), flagged
none, and resolve 0.43% at the median benchmark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant