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

RegisteredDraftBuilder

RegisteredDraftBuilder​

class max.pipelines.lib.registration_draft.RegisteredDraftBuilder(architecture)

source

Bases: object

Constructs a registered draft without a pipeline model.

A graph-API draft loads its checkpoint as a registered decoder does. A ModuleV3 draft holds no weights: it compiles with those checkpoint_weights() returns.

Parameters:

architecture (SupportedArchitecture)

architecture​

architecture: SupportedArchitecture

source

build_module()​

build_module(context)

source

Loads the draft checkpoint and constructs its registered module.

Raises:

ValueError – If the requested method differs from the registration, or the checkpoint lacks a weight the draft owns, or strict loading finds unexpected owned weights.

Parameters:

context (ModelLoadContext)

Return type:

tuple[GraphApiModule | ModuleV3[…, Any], object]

checkpoint_weights()​

checkpoint_weights(context, config)

source

Returns the weights a ModuleV3 draft compiles with.

They are the checkpoint’s, named as the module names them, without the shared ones its target holds.

Parameters:

  • context (ModelLoadContext)
  • config (object)

Return type:

dict[str, Any]

weight_entries()​

weight_entries(context, config)

source

Returns the entry that names the draft’s weights.

Empty unless its checkpoint loads through rules, which then name the draft’s own weights and leave out those it shares with its target.

Parameters:

  • context (ModelLoadContext)
  • config (object)

Return type:

list[WeightEntry]