Expand description
Model trait (SDD: single trait, multiple implementations possible).
The Model trait defines the interface for running inference. Business logic (scheduler, engine) programs against this trait, not concrete types.
Structs§
- BeamReq
- One beam-search request for a translation model (NLLB). Carries the resolved per-request parameters the scheduler stamps onto the sequence; the model runs the whole beam search to completion and returns the winning hypothesis.
- Chunked
Prefill Page Metadata - Per-sequence paged attention metadata for chunked prefill.
- EpCommand
Failed - A worker command that was received and then FAILED TO EXECUTE.
- Mixed
Batch Result - Result of a fully-batched mixed forward pass: M decode tokens + N prefill chunks in one pass.
- Mixed
Forward Result - Result of a mixed forward pass (decode + prefill in one pass).
- Prefill
Slice - Per-stream input slice for batched prefill.
- Prompt
Token Logprob - One scored prompt position:
log P(tokens[i+1] | tokens[..=i])plus the top-k alternative tokens under the same distribution. - Sequence
State - Sequence state tracked across decode steps.
Traits§
Functions§
- bf16_
to_ f32 - BF16 → FP32 (upper 16 bits of the IEEE-754 f32 pattern).
- extract_
bf16 - Extract one position’s
PromptTokenLogprobfrom a BF16[vocab]logits slice (the layoutlm_head_batchedwrites per row). - logprob_
of - Log-softmax over
f32_logits; returns the target token’s logprob and the top-k alternatives sorted descending by logprob.k=0returns an empty top vector (chosen-token logprob only). A target outside the vocab yields-inf(fail-visible, never panics). - padded_
batch_ n - The multi-sequence batch padding ladder — the SSOT for
padded_n.