For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python class
SequentialDriver
SequentialDriver
class max.pipelines.speculative.driver.SequentialDriver(target, proposer, *, target_model, draft_model, input_spec, speculative_config=None, enable_structured_output=False, use_greedy_acceptance=False, num_draft_steps=None, vocab_size=None)
Bases: SpecDecodeGraphSignature, Module, Generic[_TargetHiddenT]
Drives the sequential speculative-decoding loop.
Each iteration runs merge, verify, mask, accept, shift, propose, and pack.
-
Parameters:
-
- target (SpecDecodeTarget[SequentialBatch, _TargetHiddenT])
- proposer (SequentialProposer[_TargetHiddenT])
- target_model (Module)
- draft_model (Module)
- input_spec (SpecDecodeInputTypeSpec)
- speculative_config (SpeculativeConfig | None)
- enable_structured_output (bool)
- use_greedy_acceptance (bool)
- num_draft_steps (int | None)
- vocab_size (int | None)
ep_input_types()
ep_input_types()
The target’s expert-parallel inputs; empty when EP is off.
-
Return type:
input_spec
property input_spec: SpecDecodeInputTypeSpec
The spec both directions are derived from.