bridge.models.glm5next.glm53flash_builder#
Model builder for GLM-5.3-Flash.
It constructs GLM53FlashModel as the legacy GLM53FlashModelProvider does: the Hugging Face
vision tower first on the pre-process stage, then the Hybrid language model.
Module Contents#
Classes#
Combine the GLM-5.3-Flash Hybrid language model with the Hugging Face vision tower. |
Data#
API#
- class bridge.models.glm5next.glm53flash_builder.GLM53FlashModelBuilder#
Bases:
megatron.bridge.models.hybrid.hybrid_builder.BridgeHybridModelBuilderCombine the GLM-5.3-Flash Hybrid language model with the Hugging Face vision tower.
- build_model(
- pg_collection: megatron.core.process_groups_config.ProcessGroupCollection,
- pre_process: bool | None = None,
- post_process: bool | None = None,
- vp_stage: int | None = None,
Build one GLM-5.3-Flash pipeline stage.
- Parameters:
pg_collection – Process groups used for distributed construction.
pre_process – Whether this stage owns the embeddings and the vision tower.
post_process – Whether this stage owns the language-model output layer.
vp_stage – Virtual pipeline stage.
- Returns:
A GLM-5.3-Flash model stage.
- Raises:
TypeError – If the builder was given another model config.
- _build_language_model(
- pg_collection: megatron.core.process_groups_config.ProcessGroupCollection,
- pre_process: bool,
- post_process: bool,
- vp_stage: int | None,
Build the Hybrid language model with the arguments
HybridModelProvider.providepasses.GLM53FlashModelinserts vision features into full-sequence embeddings and scatters them for sequence parallelism itself, so the embedding does not scatter. Megatron Core’s Hybrid builder has no argument for that, so this builds the model directly.
- bridge.models.glm5next.glm53flash_builder.__all__#
[‘GLM53FlashModelBuilder’]