bridge.models.exaone.exaone_moe.exaone_moe_bridge#

Module Contents#

Classes#

ExaoneMoeBridge

Megatron Bridge for Hugging Face EXAONE MoE causal language models.

API#

class bridge.models.exaone.exaone_moe.exaone_moe_bridge.ExaoneMoeBridge#

Bases: megatron.bridge.models.conversion.model_bridge.MegatronModelBridge

Megatron Bridge for Hugging Face EXAONE MoE causal language models.

.. rubric:: Example

from megatron.bridge import AutoBridge bridge = AutoBridge.from_hf_pretrained(“LGAI-EXAONE/K-EXAONE-236B-A23B”) model_config = bridge.get_model_config()

MODEL_CONFIG_CLASS#

None

USE_MODEL_CONFIG_FOR_CONVERSION#

True

classmethod megatron_to_hf_config(
provider: megatron.bridge.models.exaone.exaone_moe.exaone_moe_provider.ExaoneMoeModelProvider | megatron.bridge.models.exaone.exaone_moe.exaone_moe_config.ExaoneMoeModelConfig,
) → dict#

Preserve EXAONE’s distinction between physical and repeated MTP layers.

dtype_from_hf(
config: transformers.PretrainedConfig,
default: torch.dtype | None = None,
) → torch.dtype#

Read the model dtype from torch_dtype, or from dtype when the config has no torch_dtype.

hf_config_to_model_config_kwargs(
hf_config: transformers.PretrainedConfig,
) → dict[str, Any]#

Convert a Hugging Face K-EXAONE config to builder config kwargs.

Translates EXAONE’s per-layer MLP, attention-window, SwiGLU-limit and MTP schedules and validates them against the decoder depth.

hf_config_to_provider_kwargs(
hf_config: transformers.PretrainedConfig,
) → dict[str, Any]#

Adapt the canonical builder mapping to the deprecated provider path.

mapping_registry() → megatron.bridge.models.conversion.mapping_registry.MegatronMappingRegistry#