nemo_automodel.components.models.gpt_oss.state_dict_adapter
nemo_automodel.components.models.gpt_oss.state_dict_adapter
Module Contents
Classes
Data
API
Bases: StateDictAdapter
hf_to_internal_map
internal_to_hf_map
Convert the mxfp4 weights to bfloat16.
Convert a single tensor from native format to HuggingFace format.
Parameters:
fqn
Fully qualified name of the tensor in native format
tensor
The tensor to convert
**kwargs
Additional arguments for conversion
Returns: list[tuple[str, Any]]
List of (fqn, tensor) tuples in HuggingFace format
Convert HF checkpoint to native format in-place.
- Apply key mappings from HF to internal format
- Dequantize block/scale tensors (freeing originals)
Operates in-place on the input dict to avoid allocating a full copy, reducing peak memory from 2x to ~1x model size.
Convert from native model state dict to HuggingFace format.