Skip to content

Commit accepted speculative prefixes in fixed state pools - #2455

Closed
Tianlei Wu (tianleiwu) wants to merge 7 commits into
tlwu/20260823/gdn-paged-checkpointsfrom
tlwu/20260823/gdn-paged-prefix-state
Closed

Commit accepted speculative prefixes in fixed state pools#2455
Tianlei Wu (tianleiwu) wants to merge 7 commits into
tlwu/20260823/gdn-paged-checkpointsfrom
tlwu/20260823/gdn-paged-prefix-state

Conversation

@tianleiwu

Copy link
Copy Markdown
Contributor

Summary

  • let fixed-state reservations commit an accepted prefix using exported checkpoints
  • plumb speculative checkpoint capture from the step plan through cache management and hybrid decoder IO
  • preserve rollback and ownership invariants for mixed paged and fixed state

Stack

PR 2/6. Depends on tlwu/20260823/gdn-paged-checkpoints.

Validation

  • final stacked branch: engine_unit_tests 322/322 passed
  • focused fixed-state prefix and rollback tests are included in this PR

@tianleiwu

Copy link
Copy Markdown
Contributor Author

Stack: #24542/6#2456#2457#2458#2459

Tianlei Wu (tianleiwu) and others added 6 commits August 28, 2026 23:22
Replace dense recurrent checkpoints with packed convolution values and GDN capsules that replay accepted prefixes into fixed-state banks. Integrate fixed state with paged dynamic batching through explicit manifest bindings and a validated two-phase cache commit.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit c8648296919d85a9fb65949a8953920be3971273)
The packed varlen operators already produce the per-token state series a
speculative decoder needs to roll back a partially accepted draft
(VarlenCausalConvWithState.prefix_states, GatedDeltaNet.checkpoints), but the
builder hardcoded both windows to zero and rejected state_window outright on the
paged path.

Emit them as a separate third output per operator instead of widening the
committed state the way the dense export does, so the Engine's fixed-state bank
contract is unchanged and a model exported with a window still runs unmodified
when the outputs are not fetched. genai_config carries the window as
checkpoint_count plus a checkpoint_alignment, because the conv writes slot j
after local token j while GatedDeltaNet writes slot W-1 after the last token.
A speculative step runs more tokens than it ends up keeping. The operators
already publish the state after each of those tokens, so rolling back a rejected
draft only needs the pool to stage a different source row: FixedStateReservation
now binds the checkpoint series when the step asks for it, and CommitPrefix
selects the slot for the accepted prefix instead of the step's final state. The
slot depends on the group's alignment, which is why the manifest carries it.

Capture is opt-in per reservation, so a non-speculative step allocates exactly
the staging it did before and every existing caller is unchanged.
@tianleiwu
Tianlei Wu (tianleiwu) force-pushed the tlwu/20260823/gdn-paged-checkpoints branch from c8e0d4a to 0830990 Compare August 28, 2026 23:50
RequestStepPlan carries a draft count, the composite planner turns any nonzero
count into a checkpoint-capturing fixed reservation (and sizes its staging for
it), and the hybrid decoder binds the checkpoints output only on such a step, so
the operators skip writing it entirely otherwise. Nothing sets a draft count yet,
so every step still plans and reserves exactly what it did before.
@tianleiwu
Tianlei Wu (tianleiwu) force-pushed the tlwu/20260823/gdn-paged-prefix-state branch from d4abc79 to 492022d Compare August 29, 2026 00:02
@tianleiwu
Tianlei Wu (tianleiwu) force-pushed the tlwu/20260823/gdn-paged-checkpoints branch 3 times, most recently from 4631a59 to 1fd351c Compare August 29, 2026 08:27
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