IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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)

source

Bases: SpecDecodeGraphSignature, Module, Generic[_TargetHiddenT]

Drives the sequential speculative-decoding loop.

Each iteration runs merge, verify, mask, accept, shift, propose, and pack.

Parameters:

ep_input_types()​

ep_input_types()

source

The target’s expert-parallel inputs; empty when EP is off.

Return type:

Sequence[TensorType | BufferType]

input_spec​

property input_spec: SpecDecodeInputTypeSpec

source

The spec both directions are derived from.