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. |
Data#
API#
- class bridge.models.gpt.model_config.BridgeGPTModelConfig#
Bases:
megatron.bridge.models.gpt.gpt_builder.GPTModelConfigGPT 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.- __setattr__(name: str, value: Any, /) None#
Assign a declared outer or nested field and reject phantom fields.
- 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.
- classmethod from_dict(
- data: dict[str, Any],
Deserialize a config while restoring its activation callable.
- bridge.models.gpt.model_config.__all__#
[‘BridgeGPTModelConfig’]