Expand description
2026-09-25: GPU reserve terms for SSM (linear-attention) state: verify-pool
slot counts and capacities, pool bytes, Marconi snapshot slots, and the
decode-rollback ring depth (decode_ring).
Owner: model-layers (SSM reserve). Invariants: none beyond the types.
The server’s preflight_reserve, which runs before the weights load, and the
allocating code (SsmStatePool::new, TransformerModel::new) call the same
functions here. If the two computed different sizes, a serve would fail a
CUDA allocation after load, or refuse a configuration it could run. 2026-09-30:
the pool itself is one plan both read (PoolPlan).
Structs§
- Copy
Tier - 2026-10-02: Copy-tier geometry.
- Decode
Ring Decision - 2026-09-25: Outcome of the ring-depth decision.
skip_reasonisSomeonly for the implicit skips (speculative decode, watchdogs disabled), so the allocating call site can log the saving. - Marconi
Slot Decision - 2026-09-25: Outcome of the Marconi snapshot-slot decision.
skip_reasonisSomeonly when the slots are dropped because prefix caching is inactive, so the allocating call site can log the saving. - Pool
Counts - 2026-09-30: The pool’s unit counts.
- Pool
Plan - 2026-09-30: The SSM pool of one model, sized.
- Pool
Shape - 2026-09-30: What decides the pool’s unit counts.
- Verify
Counts - 2026-09-30: The verify pools’ unit counts.
Enums§
- Pool
State - 2026-09-30: A recurrent state of the pool.
- SsmRollback
Mode - 2026-09-25: SSM verify-rollback mode (
--ssm-rollback-mode, experimental). - Unit
Source - 2026-09-30: Where a pool’s per-unit sizes come from.
Constants§
- DECODE_
RING_ FIT_ LADDER - 2026-09-25: Depths the preflight fit may choose, largest first. The first equals
metrale_kernels::DECODE_ROLLBACK_RING_SLOTS(8); each next depth halves the ring’s share of the reserve. - MTP_
STATE_ SLOTS_ FLOOR - 2026-09-29: The fewest slots the verify pools cover (when
max_batch_sizeallows): the verify table width before 2026-09-29, kept apart from it so a wider verify table does not grow every serve’s pools (137.6 MB per slot on Qwen3.6-35B-A3B).
Functions§
- copy_
tier - 2026-10-02: The published tier;
Nonewithout prompt lookup. - decode_
rollback_ ring_ slots - 2026-09-25: The per-sequence ring depth, from the published depth and the
environment (
decode_rollback_ring_slots_with). Preflight passesargs.speculative || args.dflashasuse_speculative; the allocation must receive the same flag, or the reserve and the ring differ. - decode_
rollback_ ring_ slots_ with - 2026-09-25: Env-free core of
decode_rollback_ring_slots. Precedence, highest first: - fit_
decode_ ring_ slots - 2026-09-25: Largest
DECODE_RING_FIT_LADDERdepth, at moststart_slots, withreserve_without_ring + depth * bytes_per_ring_slot <= free_mem(saturating arithmetic).bytes_per_ring_slotis one depth unit of the ring. Returns 0 also when no depth fits; the caller tells the two apart by comparing the total against its limit (preflight/decode_ring.rs). - marconi_
reserve_ full - 2026-09-25: Whether
METRALE_SSM_MARCONI_FULLis present, with any value. - marconi_
snapshot_ slots - 2026-09-25: Number of Marconi SSM-snapshot slots to reserve and allocate:
requested(--ssm-cache-slots, default 16), or 0 when prefix caching is inactive. - marconi_
snapshot_ slots_ with - 2026-09-25: Env-free core of
marconi_snapshot_slots. - mtp_
pool_ full_ width - 2026-09-25: True when
METRALE_MTP_POOL_FULL_WIDTHis present (any value,0included) orMETRALE_EP_PROTOCOLisv2. Thenmtp_state_slotsismax_batch_sizeandverify_slot_draftsisnum_draftsfor every slot. - mtp_
state_ slots - 2026-09-25: Number of SSM-pool slots the verify pools (per-token intermediates and the pre-verify checkpoint) cover.
- mtp_
state_ slots_ with - 2026-09-25: Env-free core of
mtp_state_slots. TheMTP_STATE_SLOTS_FLOOR(32) covers every slot whenmax_batch_sizeis at most 32, also whenMETRALE_NO_MTP_K_LADDERlowers the dispatch cap to 4. - parse_
decode_ ring_ slots - 2026-09-25: Parses
--ssm-decode-ring-slots:autogivesNone(fit at preflight), a number up toDECODE_ROLLBACK_RING_SLOTSgivesSome, and anything else an error.validate_serve_argsandpublish_kernel_flagsboth parse through this. - pool_
counts - 2026-09-30:
pool_counts_withwith the verify slotsmtp_state_slotsand the per-slot h intermediatesverify_slot_h_intermediates(the MTP ladder). - pool_
counts_ tiered - 2026-10-02:
pool_countswith the copy tier passed in, so tests need not publish it. The tier widensnum_intermediates(every slot’s conv intermediates and the dummy’s h) and raises the copy slots’ h; a uniform-h pool takes the widened depth everywhere. - pool_
counts_ with - 2026-09-30: Pure: the counts for
mtp_slotsverify slots, slotstiered toslot_h(s)h intermediates (capped atK - 1). The verify dummy, at indexmtp_slots, always getsK - 1: batched-verify padding rows may write any live token index. Replay keeps no intermediates, only the checkpoints. - prefix_
caching_ active - 2026-09-25: Whether the prefix cache the server will install is a real cache: the
flag and
ModelConfig::kv_only_prefix_cache_is_safe, the predicatebuild_prefix_cacheuses. Preflight calls this before the cache exists;TransformerModel::newasks the constructed cache (PrefixCache::is_active). - published_
decode_ ring_ slots - 2026-09-25: The published depth, or
None. Reads the cell without setting it. - recurrent_
units - 2026-09-30: One recurrent layer’s h and conv declarations, and where they came from.
- set_
copy_ tier - 2026-10-02: Publish the copy tier, before the preflight reserve.
- set_
decode_ ring_ slots - 2026-09-25: Publishes the ring depth and returns the depth in force; the first
write wins. Preflight skips its fit when a depth is already published
(
published_decode_ring_slots), so an explicit depth is not shrunk. - set_
ssm_ rollback_ mode - 2026-09-25: Publish the command line’s mode. Returns the mode in force (first write wins).
- ssm_
h_ prefill_ stage_ bytes - 2026-09-25: Bytes of the FP32 h-state prefill staging arena:
slots * h_layer_f32_byteswhenf16_pool, else 0. - ssm_
h_ stored_ bytes - 2026-09-25: Bytes of one stored h-state blob: half of
h_f32_byteswhenf16_pool(FP16 elements), elseh_f32_bytes.SsmStatePool::new, the preflight reserve (PoolPlan) and the SSM layer’s slot stride (ssm_h_fp16.rs) all take the stored width from here. - ssm_
replay_ ring_ bytes - 2026-09-25: Replay-mode verify-window input ring:
mtp_state_slots * (k_ceiling - 1) * num_ssm_layers * row_bytes, since a partial accept replays at most K-1 tokens. Preflight reserves andSsmStatePool::newallocates through this function, with different arguments: preflight passesnum_drafts + 1andmtp_state_slots, the pool itsnum_intermediatesandmtp_slots + 1(the dummy slot). - ssm_
replay_ row_ bytes - 2026-09-25: Bytes of one cached verify row of GDN inputs, per SSM layer: the
deinterleaved qkvz row (
qkvz_elemsBF16, the rows ofConvGdnArgs::deinterleaved) plus the gate/beta row (nv * 2FP32, the rows ofConvGdnArgs::gates_buf). - ssm_
rollback_ mode - 2026-09-25: The mode in force.
Snapshotwhen nothing was published (tests, examples); reading it that way also fixes it for the process. - state_
dims - 2026-09-30: The dims the circuits’ recurrent state shapes read, from this process’s config
(after tensor-parallel sharding,
topology.rs). - tier_h
- 2026-10-02: Slot
s’s h intermediates undertier:baseraised to the copy depth on a copy slot. - tier_
rows - 2026-10-02: Rows of the widest verify the pools must hold: the MTP
k(drafts + 1), widened to a copy’s. - verify_
slot_ drafts - 2026-09-25:
verify_slot_drafts_withwith the dispatch capmtp_max_seqs()and the laddermtp_ladder_drafts. Every slot getsnum_draftswhenmtp_pool_full_widthholds or the ladder is disabled. - verify_
slot_ drafts_ with - 2026-09-25: Verify draft capacity of pool slot
slot_idx: the largest countdrafts_at(n)gives for a widthninslot_idx + 1..=max(dispatch_cap, slot_idx + 1), clamped to1..=num_drafts; 0 whennum_draftsis 0. - verify_
slot_ h_ intermediates - 2026-09-25: H-state intermediates the verify pools hold for pool slot
slot_idx: the slot’s draft capacity, which is K-1 for a K-row verify. Withuniform_verify(set by the server’s preflight for DFlash) every slot getsnum_drafts. - watchdogs_
disabled_ from_ value - 2026-09-25:
METRALE_DISABLE_WATCHDOGStruthiness:1ortrue, trimmed and case-insensitive, as the server’sparse_disable_watchdogsreads it.