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_glm5_next
The MTP layer a GLM-5.3-Flash checkpoint ships beside its trunk.
MTPGlm5NextDraftArchConfig
class max.pipelines.architectures.mtp_glm5_next.MTPGlm5NextDraftArchConfig(max_seq_len)
Bases: ArchConfigWithBoundedMaxSeqLen
The draft architecture’s config: its sequence bound, and no KV leaf.
-
Parameters:
-
max_seq_len (int)
build_module()
classmethod build_module(context)
Builds the MTP layer from the checkpoint that context names.
Its config is the target’s, with the precision map read off the whole checkpoint, MTP layer included, so its FP8 projections load as FP8. It embeds and projects through the target’s embedding and head, so spec decoding shares those onto it.
-
Raises:
-
ValueError – If the checkpoint ships no MTP layer.
-
Parameters:
-
context (ModelLoadContext)
-
Return type:
-
tuple[Glm5NextMTP, Glm5NextConfig]
construct_kv_params()
classmethod construct_kv_params(huggingface_config, pipeline_config, devices, kv_cache_config, cache_dtype)
Returns None, because the layer writes into the target’s caches.
It writes the last slot of the target’s latent, indexer and tail ring caches, which the target’s config declares when it speculates.
-
Raises:
-
ValueError – If the accelerator is neither an NVIDIA GPU nor a gfx950 AMD GPU, the only AMD target the KDA ops build for.
-
Parameters:
-
- huggingface_config (AutoConfig)
- pipeline_config (PipelineConfig)
- devices (list[DeviceRef])
- kv_cache_config (KVCacheConfig)
- cache_dtype (DType)
-
Return type:
-
None
initialize()
classmethod initialize(pipeline_config, model_config=None, *, max_seq_len)
Records the sequence length the pipeline resolved.
-
Parameters:
-
- pipeline_config (PipelineConfig)
- model_config (MAXModelConfig | None)
- max_seq_len (int)
-
Return type:
max_seq_len
max_seq_len: int