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

RegisteredDecoderBuilder

RegisteredDecoderBuilder​

class max.pipelines.lib.module_registration.RegisteredDecoderBuilder(pipeline_model)

source

Bases: object

Constructs a registered DECODER for a caller that composes modules.

A speculative pairing builds its target this way and compiles it beside its draft as one module, so the decoder holds no weights: it compiles with those checkpoint_weights() returns. The caller passes the decoder its image embeddings, which the registration’s VISION module, built by build_vision(), encodes.

Parameters:

pipeline_model (type[ModuleV3DecoderPipelineModel])

build_module()​

build_module(context)

source

Constructs the decoder from the checkpoint context names.

The config is finalized and completed with the deployment as serving completes it, on the caller’s KV params, and expert parallelism starts through context, which the caller may share with other modules.

Raises:

  • NotImplementedError – If the decoder keeps per-request state, which a composed module doesn’t pass it.
  • ValueError – If the deployment asks for expert or data parallelism the decoder doesn’t support.

Parameters:

context (ModelLoadContext)

Return type:

tuple[Module[…, Any], Any]

build_vision()​

build_vision(context, config, device)

source

Constructs the registration’s VISION module on device.

It is built as serving builds it, from config, the one build_module() returned, and the checkpoint context names.

Returns:

The VISION graph, or None when the registration has no VISION module or its is_enabled turns it off.

Parameters:

  • context (ModelLoadContext)
  • config (object)
  • device (Device)

Return type:

GraphSpec | None

checkpoint_weights()​

checkpoint_weights(context, config)

source

Returns the weights the built decoder compiles with.

They are the checkpoint’s DECODER weights, named as the module names them.

Parameters:

  • context (ModelLoadContext)
  • config (object)

Return type:

dict[str, Any]

pipeline_model​

pipeline_model: type[ModuleV3DecoderPipelineModel]

source

The pipeline model that serves the registration alone.

vision_weight_entries()​

vision_weight_entries(context)

source

Returns the entry that names the VISION module’s weights.

Empty when the registration has no VISION module, or the checkpoint doesn’t load through rules into its names.

Parameters:

context (ModelLoadContext)

Return type:

list[WeightEntry]

weight_entries()​

weight_entries(context, config)

source

Returns the entry that names the built decoder’s weights.

Empty when the checkpoint doesn’t load through rules into the decoder’s names; the decoder then compiles with checkpoint_weights().

Parameters:

  • context (ModelLoadContext)
  • config (object)

Return type:

list[WeightEntry]