nemo_automodel.components.models.qwen3_moe.state_dict_adapter
nemo_automodel.components.models.qwen3_moe.state_dict_adapter
Module Contents
Classes
Data
API
Bases: MoESplitExpertsStateDictMixin, StateDictAdapter
Converts between HF Qwen3-MoE checkpoints and our grouped-experts native format.
Qwen3 MoE is validated for fused PEFT v5 ParamWrapper export.
Convert a single tensor from native format to HuggingFace format.
When v4_compatible=False (the default), LoRA expert tensors are
emitted in PEFT v0.18+ ParamWrapper format so that
PeftModel.from_pretrained() can load them directly. When
v4_compatible=True, the legacy per-expert split is used instead
(via the parent mixin).
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
Convert HF checkpoint to native format, handling ParamWrapper LoRA keys.
Before delegating to the parent _from_hf_w_merged_experts (which
handles legacy per-expert LoRA format), this method scans for
ParamWrapper-format LoRA keys and converts them back to the native
grouped format expected by GroupedExpertsLoRA.