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.architectures.mtp_deepseekV3

The NextN head a DeepseekV3 checkpoint ships beside its trunk.

MTPDeepseekV3DraftArchConfig​

class max.pipelines.architectures.mtp_deepseekV3.MTPDeepseekV3DraftArchConfig(max_seq_len)

source

Bases: ArchConfigWithBoundedMaxSeqLen

The draft architecture’s config: its sequence bound and KV leaf.

Parameters:

max_seq_len (int)

build_module()​

classmethod build_module(context)

source

Builds the NextN head from the target’s checkpoint, which context names.

It embeds and projects through the target’s embedding and head, so spec decoding shares those onto it.

Raises:

KeyError – If the checkpoint has no NextN layer.

Parameters:

context (ModelLoadContext)

Return type:

tuple[DeepseekV3NextN, DeepseekV3NextNConfig]

construct_kv_params()​

classmethod construct_kv_params(huggingface_config, pipeline_config, devices, kv_cache_config, cache_dtype)

source

Returns a one-layer view of the target’s cache, for the one decoder layer the head has.

Parameters:

Return type:

KVCacheParams

initialize()​

classmethod initialize(pipeline_config, model_config=None, *, max_seq_len)

source

Records the sequence length the pipeline resolved.

Parameters:

Return type:

MTPDeepseekV3DraftArchConfig

max_seq_len​

max_seq_len: int

source

convert_mtp_safetensor_state_dict()​

max.pipelines.architectures.mtp_deepseekV3.convert_mtp_safetensor_state_dict(state_dict, huggingface_config, **unused_kwargs)

source

Returns the NextN layer’s weights, under the NextN module’s names.

The trunk’s weights load through the target’s own adapter, which drops this layer.

Parameters:

  • state_dict (dict[str, Weights])
  • huggingface_config (PreTrainedConfig)

Return type:

dict[str, WeightData]