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, devices, data_parallel_degree, input_spec, speculative_config=None, enable_structured_output=False)

source

Bases: Module

Drives the sequential speculative-decoding loop.

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

Parameters:

input_types()​

input_types(kv_params)

source

Builds the unified spec-decode graph signature.

See build_spec_decode_input_types for the canonical ordering.

Parameters:

kv_params (KVCacheParamInterface)

Return type:

tuple[TensorType | BufferType, …]