nemo_automodel.components.checkpoint.state_dict_adapter
nemo_automodel.components.checkpoint.state_dict_adapter
Module Contents
Classes
API
Abstract base class for state dict transformations.
This class defines the interface for converting between native model state dict format and other model state dict formats.
Convert a single tensor from native format to HuggingFace format.
Parameters:
Fully qualified name of the tensor in native format
The tensor to convert
Additional arguments for conversion
Returns: list[tuple[str, Any]]
List of (fqn, tensor) tuples in HuggingFace format.
Obtain native model state dict from HuggingFace format.
Parameters:
The HuggingFace format state dict
Optional device mesh for DTensor expert parallelism. If provided, only loads experts needed for the current rank.
Returns: dict[str, Any]
The converted native model state dict
Convert from native model state dict to HuggingFace format.
Parameters:
The native model state dict
Returns: dict[str, Any]
The converted HuggingFace format state dict