bridge.models.glm5next.glm53flash_config#

Builder-backed model config for GLM-5.3-Flash (glm5_next).

The language model is a Megatron Core HybridModel of KDA, DSA (MLA with a kpool indexer), dense MLP and MoE layers wrapped in mHC hyper-connections. GLM53FlashModel and the Hugging Face feature methods bound to it read the vision config and multimodal token IDs from the config the model is built with, so the transformer config declares them. Freeze options live on the outer config.

Module Contents#

Classes#

_GLM53FlashVLTransformerFields

Vision-language fields that GLM53FlashModel and its bound Hugging Face methods read.

GLM53FlashTransformerConfig

MLA transformer config with KDA layer fields and the vision-language fields of GLM-5.3-Flash.

GLM53FlashModelConfig

GLM-5.3-Flash as a Hybrid MLA language model with a Hugging Face vision tower.

Data#

API#

class bridge.models.glm5next.glm53flash_config._GLM53FlashVLTransformerFields#

Vision-language fields that GLM53FlashModel and its bound Hugging Face methods read.

vision_config: Any#

None

Hugging Face Glm5NextVisionConfig.

spatial_merge_size: int#

2

image_token_id: int#

154854

video_token_id: int#

154855

image_start_token_id: int#

154830

image_end_token_id: int#

154831

video_start_token_id: int#

154832

video_end_token_id: int#

154833

return_dict: bool#

True

Read by Hugging Face’s can_return_tuple-decorated feature extraction methods.

class bridge.models.glm5next.glm53flash_config.GLM53FlashTransformerConfig#

Bases: bridge.models.glm5next.glm53flash_config._GLM53FlashVLTransformerFields, megatron.bridge.models.transformer_config.MLATransformerConfig, megatron.core.ssm.kda_layer_config.KDALayerConfig

MLA transformer config with KDA layer fields and the vision-language fields of GLM-5.3-Flash.

class bridge.models.glm5next.glm53flash_config.GLM53FlashModelConfig#

Bases: megatron.bridge.models.hybrid.model_config.BridgeHybridModelConfig

GLM-5.3-Flash as a Hybrid MLA language model with a Hugging Face vision tower.

The builder counterpart of GLM53FlashModelProvider. finalize() places DSA-safe pipeline separators in hybrid_layer_pattern before the Hybrid finalization, as the provider does. The nested transformer config is an MLA config, but rotary_base and rotary_percent stay on this outer config, as in BridgeHybridModelConfig; GLM-5.3-Flash applies no rotary embedding (qk_pos_emb_head_dim=0) and keeps their defaults.

builder: ClassVar[str]#

‘megatron.bridge.models.glm5next.glm53flash_builder.GLM53FlashModelBuilder’

transformer_config_class: ClassVar[type[megatron.bridge.models.transformer_config.TransformerConfig]]#

None

freeze_language_model: bool#

False

freeze_vision_model: bool#

False

freeze_vision_projection: bool#

False

finalize() → None#

Add DSA-safe pipeline separators, then finalize the Hybrid config.

as_dict() → dict[str, Any]#

Serialize the config, with the Hugging Face vision config in the form provider checkpoints use.

Megatron Core serializes nested dataclasses field by field; Hugging Face configs are serialized through Bridge’s config container instead.

bridge.models.glm5next.glm53flash_config.__all__#

[‘GLM53FlashModelConfig’, ‘GLM53FlashTransformerConfig’]