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 module

max.pipelines.lib.registration_runtime

Completes a registered module’s config with its deployment.

A config built from the checkpoint doesn’t know where it runs. After the config is finalized, and before any module is constructed, the framework hands it a ModuleRuntime: the device mesh, the batch limits the memory planner chose and, under expert parallelism, the initialized EPConfig.

A registered config takes part by subclassing DeploymentConfig, or ExpertParallelDeploymentConfig when it serves its experts across devices. Their fields declare what the deployment adds to the decoder’s inputs and how the checkpoint splits between roles.

Deployment​

DeploymentConfigA registered config that the deployment completes.
ExpertParallelDeploymentConfigA registered config whose decoder serves its experts across devices.
ModuleRuntimeThe deployment a registered module's config is completed with.

Expert parallelism​

ExpertParallelExchangeThe initialized exchange's buffers, as each batch passes them.
ExpertParallelInputsHow a decoder's graph takes the expert-parallel exchange.
ep_input_treeReturns the decoder's ep input types for an initialized config.
initialize_ep_comm_buffersSizes and initializes the expert-parallel communication buffers.
uses_expert_parallel_exchangeReturns whether expert sharding requires exchange initialization.

Weights​

prepare_weightsPrepares a checkpoint before selecting registered role weights.
role_weightsReturns the weights of one role, named as its module names them.

Graph constants​

ConstantInputsThe declared graph types and lifetime-owned deployment buffers.

Batch context lengths​

BatchContextLengthsEach replica's page-aligned KV context length, refreshed per batch.
batch_context_length_typesReturns the batch_context_lengths input types.