bridge.models.gpt.model_config#
Serializable Bridge extension of Megatron-LM’s GPT model config.
Module Contents#
Classes#
GPT model config with strict overrides and callable serialization. |
|
GPT model config with Multi-Latent Attention (MLA), the builder counterpart of |
Data#
API#
- class bridge.models.gpt.model_config.BridgeGPTModelConfig#
Bases:
megatron.bridge.models.common.base.ModelConfigOverrideMixin,megatron.bridge.models.gpt.gpt_builder.GPTModelConfig,megatron.bridge.models.common.base.ModelConfigGPT model config with strict overrides and callable serialization.
Outer GPT build fields and nested transformer fields keep one declared owner. Flat assignment remains convenient, but unknown names fail instead of silently creating phantom configuration.
Hugging Face source provenance (model id and revision) is not declared as a dedicated field here. It is recorded in the inherited serializable
extra_checkpoint_metadatamapping so it round-trips throughrun_config.yamlwithout adding model-specific config fields.hf_model_text_onlyrecords that the source checkpoint was projected to its language model, so a restored config reopens the same projection.- transformer_config_class: ClassVar[type[megatron.bridge.models.transformer_config.TransformerConfig]]#
None
- hf_model_text_only: bool#
False
Whether the source HF checkpoint was projected to its language model.
- get_builder_cls() type#
Resolve the configured builder through Bridge’s target allowlist.
- as_dict() dict[str, Any]#
Serialize the config with a symbolic activation function and a restorable pipeline layout.
- classmethod from_dict(
- data: dict[str, Any],
Deserialize a config while restoring its activation callable.
- class bridge.models.gpt.model_config.BridgeGPTMLAModelConfig#
Bases:
megatron.bridge.models.common.base.MLAModelConfigMixin,bridge.models.gpt.model_config.BridgeGPTModelConfigGPT model config with Multi-Latent Attention (MLA), the builder counterpart of
MLAModelProvider.The nested transformer config is an
MLATransformerConfig. It alone stores and serializesrotary_baseandrotary_percent, because MLA attention applies RoPE from them; on this config they are constructor arguments and views of the nested values (seeMLAModelConfigMixin). GPT MLA families such as Kimi K3 and Sarvam MLA use it, as their providers combineGPTModelProviderwith an MLA config.
- bridge.models.gpt.model_config.__all__#
[‘BridgeGPTMLAModelConfig’, ‘BridgeGPTModelConfig’]