bridge.models.mamba.mamba_builder#
Module Contents#
Classes#
Backward-compatible wrapper around :class: |
|
Backward-compatible wrapper around :class: |
Functions#
Backward-compatible alias for |
|
Backward-compatible alias for |
|
Backward-compatible alias for |
API#
- class bridge.models.mamba.mamba_builder.MambaModelConfig#
Bases:
megatron.bridge.models.hybrid.hybrid_builder.HybridModelConfigBackward-compatible wrapper around :class:
HybridModelConfig.- builder: ClassVar[str]#
‘megatron.bridge.models.mamba.MambaModelBuilder’
- mamba_stack_spec: megatron.core.transformer.ModuleSpec | Callable[[], megatron.core.transformer.ModuleSpec] | Callable[[bridge.models.mamba.mamba_builder.MambaModelConfig], megatron.core.transformer.ModuleSpec] | None#
None
- __post_init__() None#
Normalize the deprecated Mamba stack-spec field to the Hybrid field.
- as_dict() dict[str, Any]#
Serialize without the deprecated
mamba_stack_specfield.
- _to_dict() dict[str, Any]#
Bridge config serialization hook.
- class bridge.models.mamba.mamba_builder.MambaModelBuilder#
Bases:
megatron.bridge.models.hybrid.hybrid_builder.HybridModelBuilderBackward-compatible wrapper around :class:
HybridModelBuilder.- 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 a Hybrid model while resolving legacy Mamba stack-spec factories.
- Parameters:
pg_collection – Process groups used to construct the model.
pre_process – Whether to include input processing on this stage.
post_process – Whether to include output processing on this stage.
vp_stage – Virtual pipeline stage to construct.
- Returns:
The constructed Hybrid model.
- bridge.models.mamba.mamba_builder.transformer_engine_mamba_stack_spec() megatron.core.transformer.ModuleSpec#
Backward-compatible alias for
transformer_engine_hybrid_stack_spec.
- bridge.models.mamba.mamba_builder.modelopt_mamba_stack_spec(
- config: MambaModelConfig | None = None,
Backward-compatible alias for
modelopt_hybrid_stack_spec.
- bridge.models.mamba.mamba_builder.get_default_mamba_stack_spec( ) megatron.core.transformer.ModuleSpec#
Backward-compatible alias for
get_default_hybrid_stack_spec.