Expand description
2026-09-25: Carry the MTP drafter’s KV from one turn of a session to the next, so a warm turn adopts the previous turn’s drafter rows and appends only the new span, plus the SSM snapshot restore threshold.
On a warm turn the reused prefix is not recomputed, so the whole-prompt
hidden capture does not cover the prompt and the drafter’s prompt prefill
does not run (the model’s ensure_drafter_context). Rebuilding it instead
was measured 2026-07-21 on GB10 at 1136 ms for 11,947 rows, about as long
as the warm TTFT of 1134 ms.
Conventions:
- Drafter row
rholds a pair keyk:(embed(t_{k+1}), hidden_k)at RoPEk + 1. Rows are compacted while RoPE stays in sequence space, so a skipped key leaves no hole. mtp_prefill_hiddenrowiholdshidden_i, by absolute position.
Owner: model-layers (MTP drafter). Invariants:
carry_armedis false whenevermtp_max_seqs() > 1.CarriedDrafter::usable_byreturnsNoneunless the request’s session hash is non-zero and equals the entry’s.StoreRange::visible_toreturns(0, 0)unless the reader’s ticket is non-zero and owns the range, andstamped_mergenever extends a range written by another owner.
Structs§
- Append
Plan - Carried
Drafter - 2026-09-25: The drafter KV of a finished turn, held in the model’s single carry slot for the next turn of the same session.
- Store
Range - 2026-09-25: The interval of
mtp_prefill_hiddenrows written, and the sequence ticket that wrote them. The buffer is model-level and indexed by absolute position, so the interval alone cannot say whose rows it holds.
Enums§
- Carry
Outcome - 2026-09-25: Result of a carry attempt, for logging and tests.
Constants§
- DEFAULT_
MARCONI_ MIN_ TOKENS - 2026-09-25: The default of
--marconi-min-tokensand of the env fallback.
Functions§
- carry_
armed - 2026-09-25:
carry_armed_withagainst the live dispatch cap. - carry_
armed_ with - 2026-09-25: Whether the carry is armed: configured on (
cfg.carry) and MTP not in multi-sequence mode. It takesmulti_seqas an argument so tests can set it;crate::speculative::mtp_max_seqscaches its env read. - hidden_
row_ offset - 2026-09-25: Address of hidden row
posin a[capacity, hidden_size]BF16 store starting atbase. - marconi_
min_ tokens - 2026-09-25: Minimum snapshot depth, in matched tokens, for restoring an SSM snapshot; a shallower snapshot is not restored. 0 removes the floor.
- merge_
interval - 2026-09-25: Merge a write of
[start, start + count)into the interval[lo, hi). An overlapping or abutting write extends it; a disjoint write replaces it, because one interval cannot describe two runs and claiming the gap would mark unwritten rows valid. - mtp_
carry_ debug - 2026-09-25:
METRALE_MTP_CARRY_DEBUG=1logs one line per carry store and per adopt decision. - mtp_
carry_ drafter_ enabled - plan_
append - 2026-09-25: The warm-turn append after
last_pair_keyfor a prompt ofprompt_lentokens, reading hidden rows[hidden_lo, hidden_hi). - set_
marconi_ min_ tokens - 2026-09-25: Pin the restore threshold. The first write or read fixes it for the process; a later call changes nothing and returns false, so the caller can warn that its value was not applied.
- stamped_
merge - 2026-09-25: Record a write of
[start, start + count)bywriter_gen. The same non-zero owner merges it withmerge_interval; any other owner, or an unclaimed range, is replaced by the write. Merging across owners would leave another sequence’s rows inside the interval.