Expand description
2026-09-25: Per-step MTP draft count as a function of the number of active sequences (the K-vs-batch ladder), and the multi-sequence MTP width cap.
Owner: model-layers (speculative). Invariants:
mtp_ladder_draftsreturns 0 whennum_draftsis 0, and a value in1..=num_draftsotherwise.- The ladder, its kill switch and the cap are read from the environment once per process.
The default ladder is 4:3,8:3,16:1,32:1: three drafts up to 8 active
sequences, one draft above that. A width above the last step takes the last
step’s count. metrale_speculative::adaptive_rung uses this count as its
floor and may raise widths 9..=16 to two drafts; it keeps the static count
when METRALE_MTP_STATIC_RUNG or METRALE_MTP_K_LADDER is present.
Overrides:
METRALE_MTP_K_LADDER, e.g."4:3,8:2,16:1": comma-separatedn_max:draftssteps, sorted byn_max. A value that does not parse as a whole gives the default ladder. Draft counts are clamped to1..=num_drafts.METRALE_NO_MTP_K_LADDER, present with any value (0included): every width getsnum_drafts, and the default ofmtp_max_seqsdrops from 32 to 4.
Enums§
- MtpMax
Seqs Source - 2026-09-29: Where the serve’s dispatch cap came from.
Constants§
- DEFAULT_
MTP_ MAX_ SEQS - 2026-09-29: Engine default of the multi-sequence MTP dispatch cap, when neither
--mtp-max-seqsnor MODEL.toml[behavior] mtp_max_seqsgives one. 4 whenMETRALE_NO_MTP_K_LADDERis present. - MAX_
MTP_ MAX_ SEQS - 2026-09-29: The widest cap a serve accepts: one batched verify’s sequence width
(
layer::VERIFY_WY_TABLE_SEQS), which is also the serve’s widest batch.
Functions§
- ladder_
drafts_ from_ steps - 2026-10-03: The draft count of
stepsatn_activesequences under thenum_draftsceiling: the first step whose width coversn_active, else the last. - mtp_
ladder_ disabled - 2026-09-25: Whether
METRALE_NO_MTP_K_LADDERis present, with any value. Read once per process. - mtp_
ladder_ drafts - 2026-09-25: The per-step draft count for
n_activeconcurrent sequences. - mtp_
ladder_ pinned - 2026-10-03: Whether the serve runs an explicit ladder (
--mtp-k-ladder, orMETRALE_MTP_K_LADDERpresent with any value): the adaptive rung then keeps the static counts, so the operator gets exactly the rungs spelled out. - mtp_
max_ seqs - 2026-09-29: The multi-sequence MTP dispatch cap the serve published
(
set_mtp_max_seqs); before publication (unit tests, tools) the engine default. - parse_
mtp_ k_ ladder - 2026-10-03: Parses a
--mtp-k-laddervalue (n_max:drafts,...); an error names what does not parse, where the environment variable falls back to the default. - resolve_
mtp_ max_ seqs - 2026-09-29: Resolve the multi-sequence MTP dispatch cap:
--mtp-max-seqswhen given, else MODEL.toml[behavior] mtp_max_seqswhen above 0, else the engine default (DEFAULT_MTP_MAX_SEQS, 4 underMETRALE_NO_MTP_K_LADDER). A cap outside1..=MAX_MTP_MAX_SEQSis refused, from either source. - set_
mtp_ k_ ladder - 2026-10-03: Publish
--mtp-k-ladderonce, before the model sizes its verify pools (ssm_reserve::verify_slot_draftsreads the ladder) and the scheduler starts. It wins overMETRALE_MTP_K_LADDER. A second publication of a different ladder is refused. - set_
mtp_ max_ seqs - 2026-09-29: Publish the serve’s dispatch cap once, before the model sizes its verify pools and the scheduler reads its levers. A second publication of a different value is refused.