Repository navigation
Confirmation harness: exactness classes, session-paired ratios, envelopes - #66
Conversation
Each label carries its arm's exactness class (blank, pending or lossy), read from the current arms.toml when the run's flags still match the arm there, so a later classification reaches the plot without a rerun. Runs that set a buffered-GDN flag through an override count as pending. envelope.csv adds the best stock-arithmetic arm per concurrency; envelope-all.dat and envelope-stock.dat hold the Pareto envelopes for PGFPlots; the PNG draws both and dashes pending and lossy arms.
A full repeat of the seven tuned arms takes about 50 minutes, longer than one exclusive hold should. Part a holds plain-tuned with the FlashInfer speculative arms (MTP, DFlash block 8 and block 4), part b holds the Triton plain baseline with the Triton speculative arms, so every matched pair stays within one hold.
Plain decoding and DFlash block 16 under Triton target attention join the pairs against plain c=1 (the reference uses FlashInfer). A configuration that fails to run no longer stops the others; the script still fails at the end if any pair is missing.
Every arm in arms.toml declares stock, exact-up-to-floor, pending or lossy, and resolve_arm fails without one, or when a stock arm sets a numerics-changing flag (buffered GDN state, non-FlashInfer target attention, FP8, FP32 head, deterministic kernels). An override that adds such a flag makes the arm pending. plain-tuned-triton and dflash-tuned-b16 are pending (Triton target attention). The Pareto builder takes the class from arms.toml, the manifest or the flags, never from a missing note, and its second envelope covers stock and exact-up-to-floor arms only. bench.sweep --session records the repeat a run belongs to, and paired_ratios pairs test and baseline runs within a session, dropping (and counting) pairs with an invalid side instead of shifting to another repeat's run. Repeat 0 predates sessions and is assigned by confirm_evidence.sh. The supplementary hold gets its own plain-tuned baseline.
446 and 5,386 match points.csv. Depth 3-5 are within 4% at c=1 only; at c=8 deeper chains lead by up to 6.5% with stock verify, and under the low-concurrency arm's buffered Triton configuration depth 4 leads depth 3 by at most 3.2%.
bench/README.md declares, before any run on it, a sensitivity workload with each confirmation prompt's own greedy length under plain decoding (capped at 2,048), the rule that selects its arms, its repeats and how its results are reported beside the primary fixed-length panel. Each point now records the scheduler's generation rate across log windows with at least 0.9 x the largest batch running, as tokens over time, next to the window median; points.csv and frontier.csv carry it as a diagnostic.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
SGLang's decode-log timer is not reset when the server idles, so the first decode line of a point covers the time since the previous point (flush, quiet wait, client start-up). Both full-batch rates now skip it; the token-weighted rate would otherwise charge that idle time to the point.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b028c6cf19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| python experiments/state_safety/compare.py --runs "$RUNS" --pairs "$OUT/pairs.json" \ | ||
| --out-json "$OUT/summary.json" --out-csv "$OUT/divergences.csv" \ | ||
| --out-table "$OUT/table.csv" | tee "$OUT/compare.log" | ||
| python -m bench.divergence "$OUT/summary.json" --out "$OUT/report.json" |
There was a problem hiding this comment.
Propagate comparison and report failures
After removing set -e, neither this pipefail pipeline nor the following bench.divergence command contributes to status. On an incremental rerun, if compare.py exits nonzero while an older complete summary.json remains—or if only report generation fails—the later pair-presence check can still pass against stale data and the script exits successfully, allowing invalid equality evidence to be treated as complete. Capture both exit statuses and set the final status nonzero.
Useful? React with 👍 / 👎.
| if self.lossy and self.exactness in ('', 'stock'): | ||
| note = self.lossy.lower() | ||
| object.__setattr__( | ||
| self, 'exactness', 'pending' if note.startswith('pending') else 'lossy' |
There was a problem hiding this comment.
Classify explicit lossy overrides as lossy
When a programmatic arm applies a recognized numerical override such as quantization or kv-cache-dtype, resolve_arm first assigns exactness='pending'. The moonshot builders then replace the generated pending note with an explicit FP8 lossy description, but this condition does not recompute an already-pending class, so those deliberately lossy configurations remain labeled pending in manifests and Pareto reports. Treat a non-pending: lossy note as lossy when the inherited class is pending as well.
Useful? React with 👍 / 👎.
bench.natural_workload freezes each prompt's natural greedy length (from a natural-stopping point that served every prompt once) into a workload file with a manifest. bench.sweep sends a record's output_length per request (aiperf single-turn output_length) and checks osl_mismatch per prompt. natural_lengths_confirm.sh measures the lengths under plain-tuned and checks that they reach the server; sensitivity.sh runs one session of the declared arms at c=32 and 128.
|
Verdict: REQUEST CHANGES Reviewed head 8f885eb (seven commits on main; harness only, with no confirmation results). Session pairing, the hold layout and the envelope classes are right. The exactness check lets several arithmetic-changing flags through as Checked and correct
BlockingB1.
B2.
B3. Codex P1: equality failures no longer fail the script (
B4. Codex P2: an explicit lossy note on an already-pending arm stays
B5. The declaration time does not match its commit (
Suggestion (not blocking)
|
B1: a stock arm may set only flags in NEUTRAL_FLAGS (capacity, memory, prefix cache, CUDA-graph sizes, observability, frontend, the vision encoder's backend, stock speculation settings) and FlashInfer target attention. Any other flag, any environment variable outside NEUTRAL_ENV, or another model makes it pending; tests cover each flag class the review named. B2: the Pareto builder checks the run's flags before a recorded stock class, and derives stock only for runs whose flags are all neutral on the reference model. B3: equality_tuned.sh deletes earlier outputs and fails when compare.py or bench.divergence fails. B4: an explicit lossy note on an arm that inherited the pending class makes it lossy. B5: the sensitivity declaration cites its commit, and its arm rule uses the mean y over sessions with invalid points excluded, running both arms when the second is within 2%.
|
Verdict: APPROVE Re-reviewed head 6b25b9f (8ab13d9 and 6b25b9f on 8f885eb). All five blocking items are fixed.
Before the first sensitivity run (not blocking this merge).
|
Appendix E.8: describe the confirmation protocol (#66)
Harness changes for the confirmation sweep and its evidence. This PR has no confirmation results yet: repeat 0 is running, and repeats 1-2, the supplementary hold and two quality holds are queued one at a time. The evidence will land on a new branch.
Exactness classes (coordinator fix 1). Every arm in
bench/arms.tomldeclaresexactness = stock | exact-up-to-floor | pending | lossy.resolve_armfails in three cases:lossynote saying why;stockarm changes anything outside an allowlist (NEUTRAL_FLAGS).The allowlist covers capacity and memory, the prefix cache, CUDA-graph sizes, observability and frontend flags, the vision encoder's backend, and the stock speculation settings, including the draft attention backend. It also allows FlashInfer target attention,
NEUTRAL_ENV, and the reference model and revision. An override outside the allowlist makes an exact armpending. An explicit lossy note on an arm built in code makes itlossy, even when the arm inheritedstockorpending(moonshot's levers).plain-tuned-tritonanddflash-tuned-b16arepending(Triton target attention, per the #60 ruling).The Pareto builder takes each label's class from:
A run whose flags are all neutral on the reference model is
stockby that rule. A run with no model recorded isunclassified. A class is never inferred from a missing note.--class LABEL=CLASSoverrides all three. The second envelope (envelope-exact.dat,best_exactinenvelope.csv) covers onlystockandexact-up-to-floorarms. The plot dashes the other classes.Pairing by session (coordinator fix 2).
bench.sweep --sessionrecords which repeat a run belongs to.paired_ratiospairs test and baseline runs within a session at each concurrency. A pair with an invalid point on either side is dropped and counted (dropped_invalid), never re-paired with another repeat's run. Two runs of one label in one session at one concurrency are an error. Repeat 0 predates sessions;confirm_evidence.shassigns it with--session-of. The supplementary hold now starts with its ownplain-tunedrun, so its arms pair within the session.Equality check.
equality_tuned.shadds plain and DFlash block 16 under Triton target attention against plain c=1. A configuration that fails to run no longer stops the others. The script deletes earlier outputs first, and exits non-zero if any pair is missing or if compare.py or bench.divergence fails.Confirmation holds. A full repeat takes about 50 minutes, so
confirm.sh <repeat> a|bruns it as two holds:plain-tunedwith the FlashInfer speculative arms;plain-tuned-tritonwith the Triton arms.Every matched pair stays in one hold.
Sensitivity workload, declared before any run (b028c6c).
bench/README.mddeclares a natural-length workload: each confirmation prompt's own greedy length under plain decoding, capped at 2,048. It also fixes the arm rule (mean y over sessions, invalid points excluded, both arms if within 2%), the repeats, and how it is reported beside the primary fixed-length panel.Implementation:
bench.natural_workloadfreezes the measured lengths into a workload file with a manifest.bench.sweepsends a per-recordoutput_lengthand checksosl_mismatchper prompt.natural_lengths_confirm.shmeasures the lengths and checks that they reach the server.sensitivity.shruns one session. Each point now also records the scheduler's generation rate at full batch as a diagnostic column (server_full_batch_tps). It is tokens over time across log windows, skipping each point's first window, which spans the idle gap before the point.Other changes.
envelope.csv,envelope-all.dat,envelope-exact.datand a PNG with both envelopes.Checks:
pytest tests/test_bench_harness.py(33 passed), pre-commit clean.Reproduce:
scripts/gpu_lock.sh -s bench/campaigns/equality_tuned.sh scripts/gpu_lock.sh -x bench/campaigns/confirm.sh 1 a # then 1 b, 2 a, 2 b scripts/gpu_lock.sh -x bench/campaigns/confirm_supplementary.sh bench/campaigns/confirm_evidence.sh