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

ReuseSpec

ReuseSpecโ€‹

class max.pipelines.speculative.driver.ReuseSpec(dim, split_prefix)

source

Bases: object

A per-step result the draft carries beside its hidden state.

Declaring it is what lets the driver gather and rebind the reused result exactly as it does the hidden carry, rather than the model threading a second tensor through a loop of its own. Both halves arrive together, so a dim without a name to gather under is unrepresentable.

Parameters:

dimโ€‹

dim: int | str | Dim | integer | TypedAttr

source

Trailing dim of Proposed.reuse.

split_prefixโ€‹

split_prefix: str

source

Names the gather that carries it across steps.