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

GraphRole

GraphRole​

class max.pipelines.lib.graph_specs.GraphRole(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

source

Bases: str, Enum

The roles of the graphs MAX’s pipelines run.

DECODER​

DECODER = 'decoder'

source

The forward pass: tokens and KV cache to logits.

DRAFT​

DRAFT = 'draft'

source

A speculative proposal model, composed with a target decoder.

ENCODER​

ENCODER = 'encoder'

source

The single forward pass of a model without a KV cache, such as an embedding model: inputs to embeddings or hidden states.

EP_INIT​

EP_INIT = 'ep_init'

source

The one-time expert-parallel setup graph run at engine startup.

SAMPLER​

SAMPLER = 'sampler'

source

Samples the next token from the decoder’s logits.

SAMPLER_BITMASK​

SAMPLER_BITMASK = 'sampler_bitmask'

source

Samples the next token, masked by a structured-output bitmask.

SPEC_DECODER​

SPEC_DECODER = 'spec_decoder'

source

One speculative-decoding step, the target and draft models fused: tokens, the previous drafts and KV cache to the accepted tokens and the next drafts.

VISION​

VISION = 'vision'

source

The vision encoder: image patches to soft-token embeddings.

VISION_PREPROCESS​

VISION_PREPROCESS = 'vision_preprocess'

source

One image’s preprocessing, on the CPU: decoded pixels and the size to resize them to, to the vision encoder’s inputs for that image. Only max export builds it, for a serving engine; MAX serve preprocesses in its tokenizers.

VISION_PREPROCESS_VIDEO​

VISION_PREPROCESS_VIDEO = 'vision_preprocess_video'

source

One encoder attention segment of a video clip’s preprocessing, on the CPU: the segment’s decoded frames and the sizes to resize them to, to the vision encoder’s inputs for that segment. Only max export builds it, for a model whose segment is not a one-frame image.