Repository navigation
State safety: pinned MTP switch pairs, checkpoint reuse and the MTP radix-off history control - #147
Conversation
…t bench's radix-off runs pairs_pinned.json gains the radix-off floor (plain c1 vs c32 without the radix cache), radix-off speculation against radix-off plain decoding at c1 and c32, overlap off against radix off (overlap off also switches the GDN radix strategy to no_buffer at this pin), and deterministic plain vs MTP at c32. pairs_cross_bench.json compares the pinned radix-off runs with the bench workstream's unpinned radix-off equality runs at batch 1.
…summaries Each pair's summary now counts prompts whose tokens and top-k logprobs are bitwise identical, prompts by the first output index where they differ, and, by prompt length against the 64-token GDN prefill chunk, prompts whose first output token (a product of the prefill alone) differs.
Evidence regenerated with STATE_ALLOW_MISSING=1 experiments/state_safety/analyze_all.sh at 530ca00 from the B6 line-1 runs (mtp_s3 with the radix cache off, the overlap scheduler off, deterministic inference and the FP32 head, c1 and c32, pinned pools), the prefix tests and the MTP radix-off history test. Every earlier value reproduces; the changes are new pairs, new runs, three new summary keys and a shorter missing_pairs.
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4566540162
ℹ️ 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".
| row['bitwise_identical'] = ta == tb and top_a == top_b | ||
| # The first output token comes from the prefill alone: a difference there is a | ||
| # difference in the prefill computation, before any decode or verify step. | ||
| row['output0_differs'] = ta[:1] != tb[:1] or top_a[:1] != top_b[:1] |
There was a problem hiding this comment.
Treat absent logprobs as unavailable
When the queued plain__nolp and mtp_s3__nolp controls land, one side intentionally has an empty top_logprobs list. This comparison consequently marks every prompt as output0_differs, sets bitwise_identical false, and records first_difference_index as 0 even when all generated tokens match, falsely reporting a prefill/output difference caused only by disabled instrumentation. Distinguish unavailable logprobs from unequal logprobs and compare them only when both runs collected them.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in fdf2197: logprobs are compared only when both runs recorded them (any(top_a) and any(top_b)). Otherwise bitwise_identical, output0_differs and first_difference rest on the tokens alone, and each summary counts the prompts whose logprobs were compared (logprobs_compared). Unit test test_run_without_logprobs_is_compared_on_tokens_only. Evidence regenerated in d00d0af; the only change is the new count (320 everywhere, since no current run lacks logprobs).
|
Verdict: REQUEST CHANGES (4566540, 1 blocking: Codex r4159245466; every evidence number checks out) Reproduction of main's values. Compared value by value with main:
Findings: every number matches the files.
Code. The Blocking: Codex r4159245466 is valid.
My tests and pre-commit run on the fix head. |
A run made without logprobs (the queued logprobs-off controls) has an empty top_logprobs list. bitwise_identical, output0_differs and first_difference now rest on the tokens alone for such a prompt, instead of reporting a difference at output index 0, and each summary counts the prompts whose logprobs were compared (logprobs_compared). Raised by Codex on #147.
STATE_ALLOW_MISSING=1 experiments/state_safety/analyze_all.sh at the previous commit. The only change is the new logprobs_compared count in each pair's summary (320 for every pair: all current runs recorded logprobs).
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Verdict: APPROVE (d00d0af) fdf2197 resolves my item, Codex's comment on absent logprobs.
Optional: once the logprobs-off control pairs are compared, the state README should say that |
Results that landed since #118: the MTP half of the pinned switch matrix, the GDN checkpoint-reuse tests, and the MTP radix-off history control. Nothing here is a state error; every divergence is rounding-level.
What ran
--disable-radix-cache,--disable-overlap-schedule,--enable-deterministic-inferenceand--enable-fp32-lm-head, each at c1 and c32 on one server, pools pinned (cap 8, 49,152 KV tokens, 40 GDN slots). Runs from~/vp-wt/stateata493cbf(runner files identical to main), enginebd66ce34clean:scripts/gpu_lock.sh -x python run_matrix.py --configs mtp_s3_noradix,mtp_s3_nooverlap,mtp_s3_det,mtp_s3_fp32head --passes c1,c32 --port 30055.targeted.py prefixfor MTP steps 3 (12 prompts), the tree and plain decoding (8 each), shared hold, same checkout.targeted.py history --config mtp_s3_noradixwith the 12 history prompts, shared hold, same checkout.Code (commit before the evidence)
pairs_pinned.json: adds the radix-off floor (plain c1 vs c32 without the radix cache), radix-off MTP against radix-off plain at c1 and c32, overlap off against radix off, and deterministic plain vs MTP at c32. The plain runs are still queued, so these pairs are listed inmissing_pairsfor now.pairs_cross_bench.jsonand a block inanalyze_all.sh: compares the pinned radix-off runs with bench's unpinned radix-off equality runs at batch 1.compare.py: each pair's summary now recordsbitwise_identical,first_difference_index(prompts by the first output index where tokens or top-k logprobs differ) andoutput0_differs(prompts whose first output token, a product of the prefill alone, differs, split at the 64-token GDN prefill chunk). Logprobs are compared only where both runs recorded them (logprobs_comparedcounts those prompts), so the queued logprobs-off controls are judged on their tokens. Additive keys; the CSV columns are unchanged. Unit tests added.Findings (evidence/state_safety/README.md)
mtp_s3_noradix/c1run is bitwise identical (320/320, tokens and top-5 logprobs) to bench's unpinned radix-off MTP s3 run (cap 16, 426,043 KV tokens;cross_bench.json). Bench's README states as reasoning that pools do not matter at c=1 without the radix cache; for MTP it is now measured. The plain counterpart is queued.large, nonot_argmax.--disable-overlap-schedulealso switchesextra_buffertono_buffer. Radix off or overlap off changes the first output token's logprobs (prefill only) in 192 of 193 prompts longer than 64 tokens and 0 of 127 shorter ones, which extends tap v4's 6/6 to the full set. The cause (checkpoint tracking in the extend kernel) is still code reading.Validation
pytest tests/test_state_safety_compare.py(pinned to one core): passes.STATE_ALLOW_MISSING=1 experiments/state_safety/analyze_all.shat530ca00regenerated the evidence. A script compared every value of the committed JSON files on main with the regenerated ones: all reproduce, apart frommissing_pairsand, inpools.json(a list), 8 added entries with all 38 old ones unchanged.missing_pairsgoes from 26 to 30: the four line-1 MTP pairs left it, and the eight new pairs whose plain runs are still queued joined it. The CSV diffs are additions only.Not done here: the plain-decoding half of the switch matrix (queued), the logprobs-off and retraction controls, the second MTP session, the ReplaySSM and FlashInfer decode paths, aborts, chunked prefill and repeats (queued), and the declared first-cycle test (queued, unchanged).
Review
fdf2197. A run without logprobs is compared on its tokens alone, with a unit test. Evidence regenerated atfdf2197ind00d0af: the only change is the newlogprobs_comparedcount, 320 for every pair, since all current runs recorded logprobs. A script checked that no other value changed.missing_pairsis 30, not shorter. The 26 on main lose the four line-1 MTP pairs and gain eight new pairs whose plain runs are queued. The body above is corrected. The message of4566540says "shorter"; this note supersedes it.