nemo_automodel.components.models.glm5_next.state_dict_adapter
nemo_automodel.components.models.glm5_next.state_dict_adapter
Checkpoint conversion for the released GLM-5.3-Flash VLM.
The checkpoint already uses the native vision/text prefix layout. Conversion is needed for grouped EP experts, flat mHC/KDA parameters, the MTP layer, and 128x128 block-scaled FP8 training weights.
The MTP layer is stored after the decoder stack as
model.language_model.layers.{num_hidden_layers + depth} with its final norm
under shared_head.norm; natively it is mtp.layers.{depth} with
final_layernorm. With num_nextn_predict_layers=0 it is dropped on load.
Module Contents
Classes
Functions
Data
API
Bases: MoESplitExpertsStateDictMixin, StateDictAdapter
Convert GLM split experts and FP8 weights to trainable grouped BF16.
Rename a checkpoint key past the decoder stack to the native mtp.layers namespace.
Match the checkpoint’s quantized matrices, including DSA-only output projections.
Rename a native mtp.layers key to its checkpoint layer after the decoder stack.
Convert one native tensor, including split expert and FP8 load targets.
Dequantize, route flat parameters, aggregate experts and move MTP layers under mtp..
Checkpoint layers past num_hidden_layers + num_nextn_predict_layers
are dropped, so a model built with MTP disabled ignores the MTP layer.
Expand grouped experts and restore released checkpoint names.
Apply global-grid block scales to one possibly misaligned local shard.
Return the global start coordinate of a DTensor’s contiguous local shard.
Create the global FP8 block-scale load destination for a 2-D weight.
Dequantize an e4m3 weight with 128x128 fp32 inverse scales.