Skip to content

State #175: the concurrency pair's cache check, plain-decoding switches and targeted tests (App D, notes) - #188

Merged
SamMausberg merged 3 commits into
mainfrom
paper/state-targeted
Oct 2, 2026
Merged

SamMausberg merged 3 commits into
mainfrom
paper/state-targeted

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Folds state's #175 results (merged at 13dada4) into Appendix D and the research notes. The text is state's, with two scoping constraints from main and the reviewer. First, the abort test ran on a small recurrent-state pool; slot reuse was its intent but was not measured, so it is never written as a tested condition, the register title included. Second, the chunked-prefill drifts in prompt-position log-probabilities are unexplained, and they are not read as a state error. The paper's main text is unchanged.

Appendix D (sections/app_exactness.tex)

  • Plain decoding at two concurrencies. The open item "equal caches not checked yet" (pending state-mech) is now measured (cachecheck_v4_plain_c1_vs_c32.json). The concurrency pair was rerun with the cache-hashing tap and identical fixed pools: at most 16 running, 98,304 attention-cache tokens and 80 recurrent-state slots, with both sessions serving all 320 prompts in the same order.
    • All 40 tapped prompts diverge again.
    • In every one, the caches entering each forward are identical up to the first differing module: a gated norm in decode in 30, layer 3's attention in decode in 5, and the batched-prefill down-projection in 5.
    • FlashInfer's decode attention itself gives different bits in a batch of 15 or 16 than alone.
    • At the divergence, the tie rule and the head GEMM account for 0 each. Rounding / order / ambiguous flips are 3 / 16 / 21 under the conservative model and 14 / 17 / 9 under the Hopper model.
  • The cache-hashing tap and Checks of the tap: one sentence each. The concurrency pair is now covered, and its tapped concurrency-1 session matches an untapped pass with the same fixed pools on all 40 tapped prompts.
  • Divergence given perturbation: adds the third floor, plain decoding at a cap of 8 without the prefix cache: 28 of 50, 0.56 (0.42 to 0.69), from perturbation_pinned.json. The sentence now says "any of the three floors".

Research notes

  • engine.tex, configuration switches: the plain-decoding counterparts are now measured.
    • The prefix cache off changes 96 of 320 plain outputs (MTP 98); the overlap scheduler off changes 166 (MTP 161). Neither effect is specific to speculation.
    • Without the prefix cache, plain decoding still diverges between concurrency 1 and 32 in 33 prompts.
    • Deterministic inference makes plain decoding batch-invariant, while deterministic MTP still departs from deterministic plain decoding at the first verify forward.
    • FP32-head counts are given.
    • A second MTP session reproduces the first bitwise.
  • engine.tex, targeted tests (closes state-targeted):
    • Aborts on a four-request pool: deterministic plain decoding keeps 40 of 40 probes token-identical; MTP keeps 28 of 40, the rest at ties or within one BF16 step. Slot assignment was not recorded.
    • Run-to-run repeats: 176 of 176 pairs are bitwise identical.
    • Chunked prefill changes generation only at ties or within one BF16 step. Prompt-position drifts of up to 5.22 nats remain unexplained; the alignment check was added afterwards and is exploratory.
  • engine.tex, open questions: shortened to the runs still queued.
  • serving.tex: adds the plain-decoding counterpart of the prefix-cache prefill change (192 of 193 long prompts, 0 of 127 short).
  • status.tex: the H5 row is updated.

Registers (both documents).

  • state-targeted becomes an entry (notes only, as only the notes cite it).
  • state-cache gains cachecheck_v4_plain_c1_vs_c32.json and run_tap_v4_batch.sh, and its description covers the concurrency pair.
  • state-pinned adds the plain-decoding switches, the second MTP session and the bench comparison.
  • state-mech shrinks to the runs still queued: the log-probabilities-off, retraction, FlashInfer and ReplaySSM runs, and the remaining cache checks.
  • The shared entries carry identical files and producers in both registers; the checker confirms it.

Review. Codex at d7e6a8f, one P2: the Appendix D figure caption still called the concurrency pair's cache check pending. Fixed in 66ffd68: the caption now separates the plotted runs (different pools) from the fixed-pool rerun (identical entering caches), and the file's header comment is updated to match. The thread has a reply.

Reviewer 2 at 66ffd68 (REQUEST CHANGES), two notes summaries, fixed in ad45fbd. First, serving.tex now says the switches change the first output token's top-five log-probabilities, which come from the prefill alone; in tokens they change 96 and 166 plain outputs. Second, the H5 row in status.tex now gives MTP's 28 of 40 abort probes, the rest at ties or within one BF16 step, and the unexplained prefill drifts of up to 5.22 nats. Optional: App D's "different pools" sentence now excepts the fixed-pool concurrency rerun.

Build. CPU window, one core, latexmk -g, at d7e6a8f; the rebuild at the head is queued.

  • Paper: 48 pages, 0 warnings.
  • Notes: 53 pages, 0 warnings.
  • scripts/check_paper_references.py --rev HEAD: clean.
  • pre-commit: the host-identity guard passed. codespell, run by hand, was clean.

… pairs and targeted tests

App D: the concurrency pair rerun with the cache-hashing tap and fixed pools enters every
differing kernel with identical caches (gated norm 30, decode attention 5, batched-prefill
down-projection 5; tie rule and head GEMM 0). Notes: the plain-decoding switches change
plain outputs as often as MTP's, so neither effect is specific to speculation; aborts on a
small recurrent-state pool (slot assignment not recorded), run-to-run repeats (176 of 176
bitwise) and chunked prefill (changes only at ties or one step; prompt-position drifts
unexplained, not read as a state error). state-targeted becomes a register entry;
state-mech shrinks to the runs still queued.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 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-10-02T05:18:07.410838Z ad45fbd Manual request
ℹ️ 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.

@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: d7e6a8f12f

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

\paragraph{Plain decoding against MTP} For plain decoding against MTP speculation with three draft steps, both at batch 1, it is layer 0's GDN recurrence output at the first speculative cycle, in all 167 prompts analysed, while that layer's causal-convolution output, the recurrence's immediate input, is bitwise equal. At that commit, decode and target verify call different Triton kernels (\code{fused\_recurrent\_gated\_delta\_rule\_packed\_decode} and \code{fused\_sigmoid\_gating\_delta\_rule\_update}), which fuse the gating and the state update differently. Rerun with the cache-hashing tap on 40 of these prompts, every cache entering every forward is identical up to that output, and the first cache to differ is layer 0's recurrent state, which the differing kernel writes~\ev{state-cache}; the two kernels therefore produce different bits from identical inputs and identical state. The two tapped servers had different pools, and MTP's draft layer attends over its own cached prefix, so a different copy of a shared prefix could change the proposals, the accepted lengths and the later verify forwards without any target attention output differing first. The location of the first difference bounds the pools only for that difference, which is at output index 1, the first position of the first verify forward, whose layer-0 recurrence output depends on its token and on the state left by the prefill, not on the proposals or on cached attention values (reasoning from the row-wise structure of the kernels); whether the pools contributed to the divergences that follow is not yet known~\pend{state-mech}.

\paragraph{Plain decoding at two concurrencies} For plain decoding at concurrency 1 against 32 (batches of up to 16; 40 tapped prompts), it is a GDN gated RMSNorm in decode in 29 prompts, a full-attention layer's output in decode in 6, and the MLP down-projection of a prefill batched with other requests in 5; never the GDN recurrence and never a decode GEMM. These two tapped servers also had different pools. A different copy of a shared prefix's attention values would first show at a full-attention output, so for the 6 prompts that first differ there the pools and the prefix cache's history are possible causes besides the attention kernel's dependence on the batch; for the other 34, every attention output before the first difference agrees. The gated norm chooses how many positions each program reduces from the batch's size (one per program for a batch of 1, two for a batch of 16), which changes the reduction tile and so the FP32 sum order of a position; the same function returns a constant in batch-invariant mode. FlashInfer's decode plan and cuBLAS's GEMM choice also depend on the batch. For this pair these are first differing module \emph{outputs} only; that both runs enter the differing kernel with equal caches has not been checked yet~\pend{state-mech}.
\paragraph{Plain decoding at two concurrencies} For plain decoding at concurrency 1 against 32 (batches of up to 16; 40 tapped prompts), it is a GDN gated RMSNorm in decode in 29 prompts, a full-attention layer's output in decode in 6, and the MLP down-projection of a prefill batched with other requests in 5; never the GDN recurrence and never a decode GEMM. These two tapped servers also had different pools. A different copy of a shared prefix's attention values would first show at a full-attention output, so for the 6 prompts that first differ there the pools and the prefix cache's history are possible causes besides the attention kernel's dependence on the batch; for the other 34, every attention output before the first difference agrees. The gated norm chooses how many positions each program reduces from the batch's size (one per program for a batch of 1, two for a batch of 16), which changes the reduction tile and so the FP32 sum order of a position; the same function returns a constant in batch-invariant mode. FlashInfer's decode plan and cuBLAS's GEMM choice also depend on the batch. Rerun with the cache-hashing tap and identical fixed pools (at most 16 running, 98,304 attention-cache tokens, 80 recurrent-state slots), with both sessions serving all 320 prompts in the same order, all 40 prompts diverge again, and in every one the caches entering every forward are identical up to the first differing module output: a gated norm in decode in 30, layer 3's attention in decode in 5 and the batched-prefill down-projection in 5~\ev{state-cache}. The 5 attention cases are 5 of the 6 above and enter with identical attention values, so FlashInfer's decode attention itself gives different bits in a batch of 15 or 16 than alone; the sixth, \code{mt\_bench-0056}, first differs at a gated norm at output index 29 once both sessions share one request history. At the divergence: tie rule 0, head GEMM 0; \modelcons{} 3 rounding flips, 16 order flips, 21 ambiguous; \modelhopper{} 14, 17, 9.

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 Update the figure caption with the completed cache check

This rerun resolves the concurrency-pair question by finding identical entering caches and identical fixed pools, but the caption immediately below still says that cache agreement is pending and that each pair's tapped servers had different pools. As a result, Appendix D gives contradictory statuses for the same concurrency mechanism; update the caption to distinguish the original plotted run from this completed fixed-pool rerun and remove the stale pending claim.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 66ffd68. The caption now says the plotted runs' tapped servers had different pools, and that 40-prompt reruns with the cache-hashing tap find the entering caches identical for both pairs: for the concurrency pair with identical fixed pools, up to the first differing module (30, 5 and 5 against the plotted 29, 6 and 5). The stale 'pending' clause is gone, and so is the matching line in the file's header comment.

@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES at 66ffd68

Reviewer 2 (paper fidelity). I read every changed sentence against evidence/state_safety/ on main (13dada4: README, cachecheck_v4_plain_c1_vs_c32.json, perturbation_pinned.json). Nearly every number holds, and the three constraints main set are respected in engine.tex, App D and the register:

  • slot reuse is never written as tested;
  • the chunked-prefill drifts are unexplained and not read as a state error;
  • the alignment check is exploratory and was added after the fact.

Two summary sentences in the notes drop or overstate something, and those two block approval.

Checked and correct

  • App D, concurrency pair, against cachecheck_v4_plain_c1_vs_c32.json and README:832-860:
    • 40 prompts; origin is module in all 40, and no_hash_difference_before_divergence is 0.
    • The 13 linear_attn.norm modules together make 30; layers.3.attn makes 5 and layers.0.mlp.down_proj 5.
    • Classes: conservative 3/16/21, Hopper 14/17/9.
    • tap_check: 40/40 identical in tokens and log-probabilities.
    • Pins of 16 running, 98,304 KV tokens and 80 GDN slots. The FlashInfer batch-15/16 inference and mt_bench-0056 at output index 29 both match the README.
  • The third floor: "radix off, plain c1 vs c32", onset 0-31, 28/50 = 0.56, Wilson interval 0.4231-0.6884. The post-onset rate of 3.582 falls inside "3.5 to 4.1".
  • Switch pairs (README tables at :420-437 and the bullets at :449-515):
    • 96 and 166 (MTP 98 and 161);
    • 33/320 at 0.50 against 41 at 0.63;
    • 177 and 178 at 3.95 and 3.90, against 171 and 181;
    • deterministic plain decoding bitwise at all 320, with deterministic MTP against plain at 175 and 168 and output index 1 in 315;
    • FP32 head: 24 (0.36, at most 0.17 nats), and 136 and 138;
    • overlap off against prefix cache off: 176 at index 1;
    • the second MTP session perturbs 0 prompts at c1 and c32 (repeat session, mtp_s3);
    • "No divergence large ... own top-1" holds for all 32 pinned runs.
  • Targeted tests (README "Aborts on a small GDN pool", "Run-to-run repeats", "Chunked prefill"):
    • aborts: 40/40, and MTP 28/40 with radix off (12 ties) and on (11 ties, 1 one-step);
    • repeats: 176 = 44 prompts x 4 pairs;
    • chunked prefill: 20 and 21 of 40 diverging, at most 0.25 nats; prompt-position drifts up to 3.53 and 5.22, with 94 and 90 of 33,853 above 1 nat, 13 and 1 in the first chunk;
    • the state-targeted title says "slot assignment not recorded".
  • Codex P2 4163040616 (stale Fig. D caption) is fixed at 66ffd68. The caption now separates the plotted runs, which had different pools, from the 40-prompt reruns that hash the caches, and gives 30/5/5 against the plotted 29/6/5.

Blocking

  1. notes/serving.tex:84. "For plain decoding on the same 320 prompts either switch changes the first output token in 192 of the 193 prompts longer than 64 tokens". The evidence (output0_differs, README:456-459) says that either switch changes the top-five log-probabilities of the first output token, which come from the prefill alone. It does not say the token changes, and only 96 or 166 prompts diverge in tokens at all. Fix: "either switch changes the first output token's top-five log-probabilities, which come from the prefill alone, in 192 of the 193 ...". The preceding MTP sentence in the same paragraph ("changes the same first tokens for MTP") has the same ambiguity, so please fix both.

  2. notes/status.tex:20 (H5, which asks whether hybrid state stays correct under speculative verification). The new clause gives only deterministic plain decoding's abort result (40 of 40) and says chunked prefill "changes generation only at ties or one step". It leaves out the two results that bear on H5:

    • MTP keeps 28 of 40 abort probes token-identical, the rest at exact ties or one step;
    • prompt-position log-probabilities under chunked prefill drift by up to 5.22 nats, for unexplained reasons.

    As written, the status table presents both tests as clean. Add both clauses, for example "...aborts on a four-request pool leave deterministic plain decoding's probes token-identical (40 of 40) and MTP's 28 of 40, the rest at ties or one step (slot assignment not recorded); ...; chunked prefill changes generation only at ties or one step, while prompt-position log-probabilities drift by up to 5.22 nats, unexplained~\ev{state-targeted}".

Optional

  • O1 app_exactness.tex:74. "Outside the cap-8 runs below, every comparison in this section across two servers had different pools" now has an exception: the concurrency-pair rerun pinned both servers to the same pools. Add "and the concurrency pair's cache-check rerun".

Build: my build of d7e6a8f is queued in the CPU window. I will build the next head and check it together with Codex.

…he token; H5 row adds MTP's 28 of 40 aborts and the unexplained prefill drifts (reviewer 2 on #188)
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: ad45fbdfde

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

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE at ad45fbd

Reviewer 2. I checked the delta from 66ffd68, where I had requested changes, to ad45fbd. Both blocking items and the optional item are fixed.

  • notes/serving.tex: for plain decoding, "either switch changes the top-five log-probabilities of the first output token, which come from the prefill alone, in 192 of the 193 ...; in tokens, the prefix cache off changes 96 plain outputs and the overlap scheduler off 166". For MTP the sentence now reads "changes the same first-token log-probabilities". Both match output0_differs and the README tables (:420-423, :456-459).
  • notes/status.tex (H5): the row now includes MTP's 28 of 40 abort probes, with the rest at exact ties or one step, which the batch shape or request history can give alone, and keeps "slot assignment not recorded". It also adds "prompt-position log-probabilities drift by up to 5.22 nats, unexplained". The status table now reports both tests as the README does.
  • App D:74: the pools sentence now excepts the fixed-pool rerun of the concurrency pair.
  • Earlier rounds: the numbers, the Fig. D caption (Codex P2 4163040616, fixed and replied) and the three scope constraints are unchanged since my check at 66ffd68.

Build at ad45fbd, CPU window, one core: 0 LaTeX warnings, 0 overfull or underfull boxes. The paper is 48 pages, unchanged, with the Conclusion and the References heading on p10. The notes are 54 pages. check_paper_references.py --rev HEAD is clean. numdiff 7e9c85c..ad45fbd: no token dropped, and every added token belongs to the new App D sentences (98,304 pins, 30/5/5, 3/16/21, 14/17/9, 28/50, 0.56, 0.42-0.69). Codex is clean on ad45fbd.

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