ReferenceFull Library ReferenceNemo AutomodelNemo AutomodelComponentsModelsLagunanemo_automodel.components.models.laguna.state_dict_adapter
nemo_automodel.components.models.laguna.state_dict_adapter
nemo_automodel.components.models.laguna.state_dict_adapter
This page is for version 0.5.0 · 26.06.
For other versions, use one of these documentation indexes:
- Nightly (default): https://docs.nvidia.com/nemo/automodel/nightly/llms.txt
- Latest: https://docs.nvidia.com/nemo/automodel/latest/llms.txt
- 0.5.0 · 26.06: https://docs.nvidia.com/nemo/automodel/v0.5/llms.txt
- 0.4.0 · 26.04: https://docs.nvidia.com/nemo/automodel/v0.4/llms.txt
Module Contents
Classes
| Name | Description |
|---|---|
LagunaStateDictAdapter | Convert Laguna HF checkpoints to Automodel’s grouped-MoE layout. |
Functions
| Name | Description |
|---|---|
_apply_renames | - |
Data
API
class nemo_automodel.components.models.laguna.state_dict_adapter.LagunaStateDictAdapter(config: typing.Any,moe_config: nemo_automodel.components.moe.config.MoEConfig,dtype: torch.dtype = torch.bfloat16)
Bases: MoESplitExpertsStateDictMixin, StateDictAdapter
Convert Laguna HF checkpoints to Automodel’s grouped-MoE layout.
nemo_automodel.components.models.laguna.state_dict_adapter.LagunaStateDictAdapter.convert_single_tensor_to_hf(fqn: str,tensor: typing.Any,kwargs = {}) -> list[tuple[str, typing.Any]]
nemo_automodel.components.models.laguna.state_dict_adapter.LagunaStateDictAdapter.from_hf(hf_state_dict: dict[str, typing.Any],device_mesh: torch.distributed.device_mesh.DeviceMesh | None = None,kwargs = {}) -> dict[str, typing.Any]
nemo_automodel.components.models.laguna.state_dict_adapter.LagunaStateDictAdapter.to_hf(state_dict: dict[str, typing.Any],exclude_key_regex: str | None = None,kwargs = {}) -> dict[str, typing.Any]
nemo_automodel.components.models.laguna.state_dict_adapter._apply_renames(key: str,renames: tuple[tuple[re.Pattern[str], str], ...]) -> str
nemo_automodel.components.models.laguna.state_dict_adapter._HF_TO_NATIVE_RENAMES: tuple[tuple[Pattern[str], str], ...] = ((re.compile('\\.mlp\\.shared_expert\\.'), '.mlp.shared_experts.'), (re.compile(...
nemo_automodel.components.models.laguna.state_dict_adapter._NATIVE_TO_HF_RENAMES: tuple[tuple[Pattern[str], str], ...] = ((re.compile('\\.mlp\\.shared_experts\\.'), '.mlp.shared_expert.'), (re.compile(...