bridge.models.common.base#
Module Contents#
Classes#
Route flat overrides to their declared owner and reject unknown fields. |
|
Bridge compatibility wrapper for Megatron-LM model configs. |
Functions#
Deserialize a builder config, including persisted enum and dtype values. |
API#
- bridge.models.common.base.deserialize_model_config(
- data: dict[str, Any],
Deserialize a builder config, including persisted enum and dtype values.
- class bridge.models.common.base.ModelConfigOverrideMixin#
Route flat overrides to their declared owner and reject unknown fields.
Builder-backed model configs store Megatron-Core transformer settings in a nested
transformerdataclass while exposing flat assignment for recipe compatibility. This mixin keeps that convenience without allowing typos to create phantom configuration attributes. Subclasses declare the nested config type throughtransformer_config_class.- transformer_config_class: ClassVar[type[megatron.bridge.models.transformer_config.TransformerConfig]]#
None
- __setattr__(name: str, value: Any, /) None#
Assign a declared outer or nested field and reject phantom fields.
- class bridge.models.common.base.ModelConfig#
Bases:
megatron.training.models.base.ModelConfigBridge compatibility wrapper for Megatron-LM model configs.
- get_builder_cls() type#
Get the appropriate builder type for this config.
- classmethod from_dict(
- data: dict[str, Any],
Deserialize config from dictionary with Bridge target validation.