Expand description
2026-09-25: The Model trait, the per-sequence state it works on (SequenceState), and the
input and result types of its forward passes.
Owner: model-engine. Invariants: none beyond the types.
Structs§
- BeamReq
- 2026-09-26: One beam-search request for a translation model (NLLB): the per-request
parameters the scheduler copies from the sequence.
ModelForward::generate_beam_batchruns the search to completion. - Chunked
Prefill Page Metadata - 2026-09-25: Per-sequence device copies of the paged-attention metadata for chunked prefill, kept across chunks so each chunk uploads only the block-table entries it added.
- EpCommand
Failed - 2026-09-25: An EP worker command that was received and then failed to execute. The worker
loop (
serve_phases/build.rs) logs it and keeps running, since the head raises the same error for the same command and answers the client with it. Any other error fromModel::ep_worker_stepcame from the receive, and the worker exits. - Forward
Disclosure - 2026-09-28: What a record states about the forward.
- Mixed
Batch Result - 2026-09-25: Result of a batched mixed forward pass: M decode rows plus N prefill chunks.
- Mixed
Forward Result - 2026-09-25: Result of a mixed forward pass (decode rows plus one prefill chunk).
- Prefill
Slice - 2026-09-25: One prefilling stream’s chunk.
prefill_batch_chunkandmixed_forward_batchtake a&mut [PrefillSlice<'_>]and run every stream’s chunk in one forward pass. - Prefix
Reclaim - 2026-09-30: What
ModelLifecycle::reclaim_prefix_blocks_forleft: the free-block count a prefill of the prompt needs (target) and the count reached (free).free < targetmeans nothing more was evictable. - Prompt
Token Logprob - 2026-09-25: One scored prompt position:
log P(tokens[i+1] | tokens[..=i])plus the top-k alternatives under the same distribution. - Sequence
State - 2026-09-25: One sequence’s state across prefill and decode.
- Verify
Batched Opts - 2026-09-26: Per-call options for
ModelVerify::decode_verify_batched.
Enums§
- Feed
Source - 2026-09-25: Where a fed decode row’s input token comes from.
- Forward
Select - 2026-09-28: The forward a model’s decode runs.
Constants§
- DECODE_
BATCH_ LADDER - 2026-09-28: The rungs
padded_batch_npads to.
Traits§
- Model
- 2026-09-26: The whole scheduler-facing model interface:
Send + Syncand every supertrait below. An implementor writes oneimplper supertrait and an emptyimpl Model. - Model
Adapters - 2026-09-26: LoRA adapters: rotation, slot refs, disk swap and promotion.
- Model
Circuit - 2026-09-28: Forward selection; see the module header.
- Model
Device Feed - 2026-09-26: The device token feed of the asynchronous scheduler router, with the event queries, async copies and pinned host memory it uses.
- Model
Draft - 2026-09-26: Draft proposers: MTP and DFlash proposals, the hidden-state saves and stashes they read, and the DFlash context appends.
- ModelEp
- 2026-09-26: The multi-rank (EP) command protocol.
- Model
Forward - 2026-09-26: Prefill, decode and mixed forward passes, beam search, and the model-shape queries
is_mla,hc_multandkv_block_size. - Model
Lifecycle - 2026-09-26: The model’s lifecycle and memory: teardown, thread binding, sequence allocation and release, sequence swap, and the KV pool counts.
- Model
Logits - 2026-09-26: Reading a forward pass’s output: the logits buffers, device argmax and the post-norm hidden state.
- Model
SsmState - 2026-09-26: Recurrent (SSM) state: checkpoint and rollback around a verify, decode-rollback snapshots, and the commit of an accepted prefix on the secondary stream.
- Model
Streams - 2026-09-26: Streams, events and host synchronisation.
- Model
Verify - 2026-09-26: Speculative verify passes: the fixed-width, γ-wide, DFlash and batched verifies, and the GDN fold after a write-on-accept batch.
- Model
Vision - 2026-09-26: Vision-encoder input for prompts with images.
Functions§
- bf16_
to_ f32 - 2026-09-25: BF16 to FP32: the two little-endian bytes become the upper 16 bits of an f32.
- extract_
bf16 - 2026-09-25: One position’s
PromptTokenLogprobfrom a row ofvocabBF16 logits. - logprob_
of - 2026-09-25: Log-softmax over
f32_logits: the target token’s logprob and the top-k alternatives, highest first.k == 0returns no alternatives. A target outside the vocab, or empty logits, gives-infrather than a panic. - padded_
batch_ n - 2026-09-25: The padded batch size for
nlive sequences: the smallest rung of the ladder that is at leastn, ornitself above 128. Batched decode pads to a rung so its CUDA graphs are keyed by a few batch shapes instead of one pern.
Type Aliases§
- RowMask
- 2026-09-25: The two token ids the host would re-pick around for a row on the
argmax fast path (
u32::MAX= none): the closed-thinking mask.