Expand description
SSOT for the SSM/linear-attention GPU reserve terms.
Every term here is computed TWICE — once by spark-server’s
preflight_reserve before the weights load, once by the allocating call
site (SsmStatePool::new, TransformerModel::new) after — and the two
MUST agree or a serve either under-reserves (runtime CUDA alloc failure)
or over-reserves (preflight refuses a configuration the runtime could
fund). Each function below is the one place that decision is made.
The Phase-C decode-rollback ring DEPTH — its publication cell, the
ATLAS_SSM_DECODE_RING / ATLAS_DISABLE_WATCHDOGS contract and the #915
auto-fit — lives in the decode_ring sibling module and is re-exported
here, so every existing ssm_reserve::decode_rollback_ring_slots path is
unchanged.
Structs§
- Decode
Ring Decision - Outcome of the ring-depth decision.
- Marconi
Slot Decision - Outcome of the Marconi snapshot-slot decision.
Enums§
- SsmRollback
Mode - SSM verify-rollback mode (
--ssm-rollback-mode, EXPERIMENTAL scaffold).
Constants§
- DECODE_
RING_ FIT_ LADDER - Depths preflight’s #915 auto-fit may choose from, LARGEST FIRST.
Functions§
- decode_
rollback_ ring_ slots - Decide the per-sequence decode-rollback ring depth.
- decode_
rollback_ ring_ slots_ with - Pure core of
decode_rollback_ring_slots(env-free, unit-testable). - fit_
decode_ ring_ slots - Largest
DECODE_RING_FIT_LADDERdepth<= start_slotswhose ring term still fits infree_memalongside everything else the reserve needs (#915). Pure — preflight owns the bytes, this owns the ladder. - marconi_
reserve_ full - The
ATLAS_SSM_MARCONI_FULLkill switch (PRESENCE, house convention). - marconi_
snapshot_ slots - Number of Marconi SSM-snapshot slots to RESERVE and ALLOCATE.
- marconi_
snapshot_ slots_ with - Pure core of
marconi_snapshot_slots(env-free, unit-testable). - mtp_
pool_ full_ width - The
ATLAS_MTP_POOL_FULL_WIDTHkill switch (PRESENCE, house convention —=0is NOT off), plus the EP-v2 implication (v2 pins slots in place for the worker mirror, so a high slot may legitimately speculate forever). SSOT for BOTH pool diets it disables: the bs>32 slot-count cap (mtp_state_slots) and the tiered per-slot verify capacity (verify_slot_drafts) — one switch restores the full-width, uniform-K sizing everywhere (pool, preflight, scheduler clamp). - mtp_
state_ slots - Number of SSM-pool slots the MTP/DFlash VERIFY state pools (per-token intermediates + pre-verify checkpoints) must cover.
- mtp_
state_ slots_ with - Pure core of
mtp_state_slots(env-free, unit-testable). - parse_
decode_ ring_ slots - SSOT parse for the
--ssm-decode-ring-slotsvalue:auto(None— size it from free memory at preflight) or an explicit0..=8. - prefix_
caching_ active - Whether the prefix cache this serve will actually install is a REAL cache.
- published_
decode_ ring_ slots - The published depth, or
Nonewhen nothing has been published. - set_
decode_ ring_ slots - Publish the decode-ring depth. Returns the value in force (first write
wins, matching
gdn_flags::set_from_cli): an explicit--ssm-decode-ring-slots Nis published before preflight runs, so the auto-fit’s later write is a no-op and an operator’s explicit depth is never silently shrunk. - set_
ssm_ rollback_ mode - Publish the command line’s mode. Returns the value in force (first
write wins, matching
gdn_flags::set_from_cli). - ssm_
h_ prefill_ stage_ bytes - FP32 h-state PREFILL STAGING bytes (stage 3 of
--ssm-h-dtype f16). - ssm_
h_ stored_ bytes - Storage width of one h-state blob in the SSM state pools (stage 3 of
--ssm-h-dtype f16): 2 bytes per element under the f16-SIZED pool, the FP32 4 bytes otherwise. SSOT —SsmStatePool::new(allocation strides),preflight_reserve(the pre-load reserve) and every byte-copier that moves h-state between pool regions derive their width from THIS, so sizing and copies cannot disagree. - ssm_
pool_ reserve_ bytes - SSM state-pool reserve bytes for the pre-load preflight — MUST mirror
what
SsmStatePool::newallocates (modulo the +1 dummy slot per pool, which preflight has never counted; the CUDA headroom term absorbs it): - ssm_
replay_ ring_ bytes - Replay-mode verify-window input ring:
k_ceiling - 1cached rows per covered slot per SSM layer (a partial accept replays at most K-1 tokens — rows 0..K-2; a full accept replays nothing). Reserved by preflight and allocated bySsmStatePool::newthrough THIS function so the two cannot disagree. Zero when speculation is off or the mode isSnapshot. - ssm_
replay_ row_ bytes - One cached verify-row of GDN inputs for replay, per SSM layer: the
deinterleaved qkvz row (
qkvz_elemsBF16 — what conv1d consumes; Z included, the gated norm needs it) + the gate/beta row (nv * 2FP32). These are exactly the per-token tensors the WY verify kernels read (ConvGdnArgs::deinterleaved/gates_bufrows), and re-running them through the sequential conv+GDN path from the checkpoint reproduces the snapshot the dropped intermediates used to hold. - ssm_
rollback_ mode - The mode in force.
Snapshotwhen nothing was published — mirroring the CLI’s explicit default for non-serve contexts (tests, examples), which never carry the flag. Production sizing/pool call sites take the mode as a PARAMETER and read this only at the outermost boundary, so unit tests never depend on the process-global cell. - verify_
slot_ drafts - Env-reading wrapper of
verify_slot_drafts_with: the ladder policy (with itsATLAS_MTP_K_LADDER/ATLAS_NO_MTP_K_LADDERoverrides — a disabled ladder returnsnum_draftsat every width, making the tiers vacuous) plus themtp_pool_full_widthkill switch. - verify_
slot_ drafts_ with - Per-slot verify DRAFT capacity — the tiered half of the verify-pool
diet (2026-08-16). Pure core;
drafts_at(n)is the ladder policy (speculative::mtp_ladder_drafts). - verify_
slot_ h_ intermediates - Number of per-token H-state intermediates the verify pools allocate for
pool slot
slot_idx: exactly the slot’s draft capacity (K-1 snapshots for a K-row verify).uniform_verify(DFlash-γ pools, whose verify width does not follow the MTP ladder) sizes every slot at the fullnum_drafts. - watchdogs_
disabled_ from_ value ATLAS_DISABLE_WATCHDOGStruthiness — trimmed, case-insensitive,1ortrueonly (mirrors spark-server’sparse_disable_watchdogs).