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

PipelinedModel

PipelinedModel​

class max.pipelines.lib.pipeline_parallel.PipelinedModel(pipeline_config, session, devices, kv_cache_config, weights, adapter, return_logits, *, memory_plan, return_hidden_states=ReturnHiddenStates.NONE, max_batch_size=1)

source

Bases: PipelineModel[BaseContextType, Any, Any]

Mixin for a pipeline model whose decoder can run as pipeline stages.

Its graph builds through stage_graph(), or traces or compiles on stage_input_types(), and outputs what stage_outputs() returns, for the stage its config carries. Every stage’s graph takes the whole model’s graph inputs, so the engine that serves the stages prepares each stage’s inputs as it would the whole model’s. A stage after the first takes what the previous stage’s decoder returned after them.

Parameters:

stage_speculation_error()​

classmethod stage_speculation_error(pipeline_config)

source

Returns why this model can’t build a speculating last stage.

Returns None if it can under pipeline_config. A model that speculates only inherits a stage’s layers from its target, so it refuses unless it overrides this. An exporter asks before anything loads.

Parameters:

pipeline_config (PipelineConfig)

Return type:

str | None