Skip to content

Drafter: card gate, P6 support screen, panel-v2 baselines and output equality - #51

Merged
SamMausberg merged 9 commits into
mainfrom
drafter/arms
Oct 1, 2026
Merged

SamMausberg merged 9 commits into
mainfrom
drafter/arms

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Drafter results since #40: both gates before training (the card-reproduction check and the P6 support screen), baselines on the evaluation panel, and output equality. Also the serving and trainer housekeeping they needed. No trained drafter yet: the training data is still waiting in the GPU queue.

Results (all correctness runs, no timing claims)

Card-reproduction gate (evidence/drafter/card_gate_mtbench.json). The 80 MT-Bench first turns with the model card's settings (block 16, greedy, thinking on, up to 4,096 tokens, concurrency 1) give a mean accept length of 5.73 per request (bootstrap 95% interval 5.36-6.13; pooled 5.25). The card reports 5.93 on B200, so serving on sm_90 reproduces it. The panel's low chat acceptance comes from OASST1 prompts (4.06 per request), not MT-Bench (5.70).

P6 support screen (evidence/drafter/support/). At each block-16 verify cycle of the panel-v1 trace (21,067 of 21,274; the 207 cycles whose block runs past the output's end are excluded, which biases the kept subset's rates slightly upward: engine 6.204 kept vs 6.184 all), the drafter's top-K candidates are recomputed offline. U_K, the longest realized greedy prefix inside them, bounds any selector over the frozen candidates at that state. Averaged over the stock trajectory's cycles, tokens per cycle are 6.20 measured, 7.51 for U_2 and 10.14 for U_16; on chat, 3.99 measured and 7.17 for U_16. This is an oracle bound per cycle on the stock trajectory, not a bound on another selector's tokens per cycle. The offline recomputation matches the engine's drafted token at 97.4% of positions, with the same unary acceptance (6.200 vs 6.204).

Panel-v2 baselines and equality (evidence/drafter/panel_v2/). Tokens per cycle per request: public DFlash at block 16 6.81, native MTP (3 steps) 3.38. MTP accepts more at positions 1-3 (0.90, 0.86, 0.86 against 0.86, 0.79, 0.81). First divergences from plain decoding are classified with #37's convention (experiments/state_safety/compare.py). Only the plain run recorded logprobs, so the classes are one-sided: DFlash 3.06 per 1,000 compared tokens, 47 exact ties and 28 within one BF16 spacing on the plain side, 2 unknown (the speculative token is outside the plain top-2); MTP 2.50 per 1,000, 40 ties and 37 within one spacing. Plain at batch 1 vs 32 gives 3.42 per 1,000 (PR #37). A rerun with top-5 logprobs on every run, for both margins, is queued.

Code

  • serve_run.py: records foreign CPU load with bench.hostload (cpu_load.json) and starts servers with --stream-interval 4.
  • Trainers: print their peak GPU memory and a completion marker. run_train_segments.sh keeps one segment log per run and can keep its queue place when restarted.
  • run_gen_segment.sh: concurrency 160 at mem-fraction-static 0.25.

The evaluation panel measures acceptance only and contains benchmark test problems; it is never used for quality claims.

…runs

serve_run.py samples CPU use by processes outside the run while its clients
run (bench.server.foreign_cpu) and writes cpu_load.json, flagged when the mean
exceeds two cores; servers start with --stream-interval 4, the team default for
served comparisons.
A selector over the public drafter's frozen top-16 candidates could at most
raise tokens per verify cycle from 6.20 to 10.14 on the panel (chat 3.99 to
7.17; top-2 alone 7.51 and 4.92). serve_run.py records foreign CPU load with
bench.hostload.HostLoadSampler (bench.server.foreign_cpu was removed).
The trainers print 'final step reached' and their peak allocated GPU memory at
the end of a segment; run_train_segments.sh keeps one segment log per run
directory (so two arms can train at once) and can keep its first segment's
queue place when restarted.
…st plain decoding

Every divergence of DFlash (3.06 per 1,000 tokens) and MTP (2.50) from plain
decoding at concurrency 1 is at an exact BF16 tie or a top-2 gap of at most
0.25 nats, the same noise floor as plain decoding at two batch sizes.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T23:58:40.655592Z 0a7c72f PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

train_selector.py --objectives prefix,vat keeps one selector and optimizer per
objective, identically initialized, and feeds every arm the same sequences,
anchors and top-K candidates (computed once), which halves the target and
drafter work and makes the objective comparison matched by construction.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0a7c72f5dd

ℹ️ 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".

Comment thread evidence/drafter/README.md Outdated
Comment on lines +81 to +82
`support/zlab_b16_panel_v1_summary.json`, `support/zlab_b16_panel_v1_survival.csv`: for each of
the 21,067 verify cycles of the block-16 panel-v1 trace, the drafter's block at that cycle's

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Account for the selector-screen cycles that were omitted

The block-16 panel-v1 trace contains 21,274 cycles according to evidence/drafter/acceptance_summary.csv, but this report covers only 21,067 because support_screen.py drops cycles without 15 remaining realized tokens via prefix_len + block - 1 < len(sequence). Those 207 terminal cycles are therefore absent from every reported bound, and the resulting subset's engine rate (6.204) already differs from the full trace's pooled 6.184; presenting the result as covering the trace can overstate the selector bound unless terminal cycles are incorporated or the exclusion and its bias are explicitly reported.

Useful? React with 👍 / 👎.

Comment on lines +93 to +94
PYTHONPATH=~/vp-data/drafter/pylib:~/vp-data/drafter/src/SpecForge \
scripts/gpu_lock.sh -s python experiments/drafter/support_screen.py \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Source the SGLang environment before the GPU command

When this reproduction command is run from a fresh shell, its python is not guaranteed to be the pinned SGLang virtualenv and it lacks the CUDA 13 compatibility-library settings exported by scripts/sglang_env.sh, so the support screen can fail during imports or CUDA initialization. Source that script before invoking gpu_lock.sh, as required for every GPU/SGLang command on this host.

AGENTS.md reference: AGENTS.md:L7-L10

Useful? React with 👍 / 👎.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES

Reviewed head 0d9b75c (59 behind main; a trial merge into main is clean and pre-commit passes). The gate and the screen are sound. The equality classification does not yet use the state workstream's margin convention, and two sentences claim more than the data show.

Blocking

B1. The equality classes use a different margin convention from #37's noise floor, and two DFlash divergences have no measured margin (panel_v2/equality_*.json; README, panel-v2 section).

  • The two conventions.

    • State safety: differential harness and tensor-level divergence mechanisms #37 (experiments/state_safety/compare.py) classifies a divergence by the margins between the two competing tokens in both runs: margin_a = lp_A(tok_a) - lp_A(tok_b) and margin_b likewise. The classes are tie (either run tied), one_ulp (both at most one ulp) and near, and it reports the largest margin.
    • compare_outputs.py classifies by the plain run's top-1 minus top-2 gap only, whatever the competing token is.
  • Where they diverge. They agree only when the speculative run's token is the plain run's second choice. That holds for all 77 MTP divergences and 75 of 77 DFlash ones. In the other two, the speculative token is outside the plain run's top-2:

    • math500-test/algebra/634.json, position 1,168: plain top-2 are tokens 3648 and 1987, tied; the test token is 561. It is classed tie.
    • oasst1-1a248423-..., position 409: plain top-2 are 78195 and 2199; the test token is 19361. It is classed gap<=0.125.

    Their competing margins are unknown (at least the recorded gap), so "every divergence at an exact tie or a top-2 gap of at most 0.25 nats ... No divergence has a larger margin" is not established for them.

  • Mismatched buckets. The JSON classes (tie, gap<=0.125, gap<=0.375) are not the README's "at most 0.25 nats". The observed gaps are 0, 0.0625, 0.125 and 0.25.

  • Fix.

    1. Classify with State safety: differential harness and tensor-level divergence mechanisms #37's convention, using margins between the competing tokens: record more plain logprobs (top-5, as State safety: differential harness and tensor-level divergence mechanisms #37 does) or query the competing token's logprob. Otherwise report these two as "margin unknown, test token outside the plain top-2".
    2. Say that only the plain run's margin is available if the speculative runs record no logprobs.
    3. Report counts in State safety: differential harness and tensor-level divergence mechanisms #37's classes, so that 3.06 and 2.50 per 1,000 compare with 3.42 per 1,000 like for like.

B2. The mechanism sentence goes beyond the evidence (README: "speculative verification computes the target at a different batch shape, and near-ties flip").

B3. The support screen's bound needs its scope (README and PR body: "the bound is 7.51 with the top 2 and 10.14 with the top 16").

  • What U_K bounds. U_K bounds the accepted prefix of any selector over the frozen candidates within a cycle, at the anchors the stock drafter visited. A selector that accepted more would visit different anchors, so tau_U_16 = 10.14 is the mean of per-cycle oracle bounds along the stock trajectory. It is a strong diagnostic, not a bound on another selector's tokens per cycle.
  • Fix. Call it an "oracle bound per cycle, averaged over the stock trajectory's cycles".
  • Already right. The 97.4% offline-reproduction caveat is stated correctly.

Checked and correct

  • Card gate (card_gate_mtbench.json).
    • 80 requests: per-request mean 5.732, bootstrap 95% interval 5.364-6.125, median 5.630, pooled 5.254.
    • The card's 5.933 (DFlash block 16, MT-Bench, my copy of the card at 9a1996c) lies inside the interval.
    • The settings match the card: greedy, thinking on, at most 4,096 tokens. 26 of 80 requests hit that cap, as the card's limit allows.
    • The foreign-load note (1.99 cores, a correctness run with no timing claimed) is stated in the JSON and the README.
    • The OASST1 and MT-Bench split of panel-v1 chat (4.06 and 5.70) matches.
  • Support screen (zlab_b16_panel_v1_summary.json): 21,067 cycles; tau_U_2 7.51 and tau_U_16 10.14; chat 3.99 rising to 7.17; tau_L_hf 6.200 against tau_L_engine 6.204; agreement 97.4%.
  • Panel-v2 baselines (acceptance_summary.csv): DFlash per request 6.81 and pooled 6.11; MTP 3.38 and 3.34; the position alphas match.
  • Equality counts. DFlash has 77/80 diverged, 25,187 compared tokens, 3.057 per 1,000 and 48 ties. MTP has 77/80, 30,801 tokens, 2.50 per 1,000 and 40 ties.
  • Panel-v2 is disjoint from the training prompts. panel-v2.jsonl has sha256 3ff884b4..., the same as the entry in prompts-v2.manifest.json, with hash_matches = id_matches = 0.
  • The new multi-objective selector trainer. Each arm gets identical initialization, its own optimizer and its own clipping, and all arms see the same batches. The checkpoint and resume format (state['arms']) and the per-arm export are consistent.
  • Attribution. There are no AI co-author lines.
  • Codex. It was still running (👀) when I posted. Any finding it adds will be checked on re-review.

Suggestions (not blocking)

  • Naming. Use the paper's names: τ̄_req for the per-request mean (the card's "accept length") and τ for the pooled mean, instead of "tokens per cycle per request (pooled)".
  • Disjointness. Say in the panel-v2 section that the panel is disjoint from the training prompts, citing the manifest check.
  • Panel-v1 against panel-v2. DFlash's chat and code rows are identical to seven digits (the same prompts), but MATH-500 differs, 7.81 against 7.77 per request, on the same 32 problems. If a flag differed between the two runs (memory fraction, capacity), say so. If not, it is a launch-to-launch difference worth noting beside State safety: differential harness and tensor-level divergence mechanisms #37's pending fresh-server repeats.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES

Addendum: Codex finished after my review and left two comments. I agree with both, so they are blocking alongside B1-B3.

B4 (Codex P2, README:82). The support screen drops the 207 terminal cycles without saying so.

  • What happens. support_screen.py keeps only cycles with 15 realized tokens after the anchor (prefix_len + block - 1 < len(sequence)). It therefore covers 21,067 of the trace's 21,274 cycles.
  • Why it matters. The subset's engine rate (6.204) is already above the full trace's pooled 6.184, because the dropped terminal cycles accept less. The screen's 6.20 and 10.14 describe that subset, while the README says "each of the 21,067 verify cycles of the ... trace".
  • Fix. Either include the terminal cycles, bounding U_K by the tokens that remain, or state the exclusion (207 cycles, 1.0%) and its direction next to every bound. This fits with B3's wording about what the bound is an average over.

B5 (Codex P1, README:94). The support-screen reproduction command does not source the SGLang environment.

  • The problem. AGENTS.md requires source scripts/sglang_env.sh before every GPU or SGLang command. Without it, python may not be the pinned venv, and the CUDA 13 compatibility libraries are not set.
  • Fix. Add source scripts/sglang_env.sh before the gpu_lock.sh line, and do the same for the other GPU commands in this section.

…bound

compare_outputs.py reuses experiments/state_safety/compare.py: both runs'
margins between the two competing tokens (tie, one_ulp, near, large) when both
recorded logprobs, otherwise a one-sided class from the reference run and
'unknown' when the test token is outside its top-k. The panel-v2 equality
files are reclassified (DFlash: 47 ties and 28 within one BF16 spacing on the
plain side, 2 unknown); the probe now records top-5 logprobs and
run_equality.sh records them on every run for a two-sided rerun. The README
states that U_K is an oracle bound per cycle on the stock trajectory, states
the 207 excluded terminal cycles and the direction of their bias, and adds the
environment setup to the support-screen command.
@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE

This re-review covers head 02a5d3b (with main merged in). B1-B5, including both Codex comments, are fixed.

  • B1.
    • compare_outputs.py now imports margin, infer_ulp and classify from experiments/state_safety/compare.py, so the classes are State safety: differential harness and tensor-level divergence mechanisms #37's by construction.
    • The existing runs have logprobs on the plain side only, so the classes are one-sided (ref: prefix) and labelled as such.
    • DFlash gives 47 ref:tie, 28 ref:one_ulp and 2 unknown: the two divergences whose test token is outside the plain top-2. MTP gives 40 and 37.
    • I reran compare_outputs.py on the raw requests.jsonl files, and it reproduces the committed DFlash classes and counts exactly.
    • The two-sided rerun with top-5 logprobs is stated as queued.
  • B2. The batch-shape sentence is gone. The margins are stated as observations, the MTP kernel location is cited to State safety: differential harness and tensor-level divergence mechanisms #37, and the DFlash divergences are stated as not yet traced.
  • B3. tau_U_16 = 10.14 is described as an oracle bound per cycle along the stock trajectory, not a bound on another selector's tokens per cycle.
  • B4. The 207 excluded terminal cycles (21,274 traced, 21,067 kept) and the upward bias (6.204 against 6.184) are stated.
  • B5. The support-screen command now sources scripts/sglang_env.sh.
  • Tests and hooks. tests/test_drafter_tools.py and tests/test_state_safety_compare.py pass (11 tests), and pre-commit passes on the changed files.

Everything verified in my first review still holds: the card gate, the screen numbers, the panel-v2 baselines and disjointness, and the trainer.

@SamMausberg
SamMausberg merged commit cc364ad into main Oct 1, 2026
SamMausberg added a commit that referenced this pull request Oct 1, 2026
The card-reproduction gate (5.73 per request, 95% interval 5.36-6.13,
against the card's 5.93), the second panel's DFlash and MTP acceptance,
one-sided output-equality margins for both drafters, and the P6 support
screen (oracle bound 10.14 against 6.20 tokens per cycle) become register
entries; the pending list keeps the cycle split, two-sided margins with a
kernel trace, and the matched-objective comparison.
SamMausberg added a commit that referenced this pull request Oct 1, 2026
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