> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/automodel/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/automodel/_mcp/server.

# nemo_automodel.components.models.qwen3.state_dict_adapter

Passthrough state-dict adapter for dense Qwen3 checkpoints.

## Module Contents

### Classes

| Name                                                                                                        | Description                                                            |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [`Qwen3StateDictAdapter`](#nemo_automodel-components-models-qwen3-state_dict_adapter-Qwen3StateDictAdapter) | Convert dense Qwen3 checkpoints whose HuggingFace and NeMo keys match. |

### API

```python
class nemo_automodel.components.models.qwen3.state_dict_adapter.Qwen3StateDictAdapter(
    config: transformers.Qwen3Config
)
```

Convert dense Qwen3 checkpoints whose HuggingFace and NeMo keys match.

```python
nemo_automodel.components.models.qwen3.state_dict_adapter.Qwen3StateDictAdapter.from_hf(
    hf_state_dict: dict[str, torch.Tensor],
    kwargs: object = {}
) -> dict[str, torch.Tensor]
```

Copy a HuggingFace state dict and materialize a tied LM head if needed.

**Parameters:**

Mapping from parameter names to checkpoint tensors.
Tensor shapes, dtypes, devices, and storage aliases are preserved.

Compatibility arguments accepted by the checkpoint adapter
interface; they do not alter dense Qwen3 tensors.

**Returns:** `dict[str, torch.Tensor]`

A new mapping with the same tensor values and arbitrary parameter

```python
nemo_automodel.components.models.qwen3.state_dict_adapter.Qwen3StateDictAdapter.to_hf(
    state_dict: dict[str, torch.Tensor],
    exclude_key_regex: str | None = None,
    kwargs: object = {}
) -> dict[str, torch.Tensor]
```

Copy a NeMo state dict, optionally excluding matching keys.

**Parameters:**

Mapping from parameter names to checkpoint tensors with
arbitrary parameter shapes; values are returned without mutation.

Optional regular expression selecting keys to omit.

Compatibility arguments accepted by the checkpoint adapter
interface; they do not alter dense Qwen3 tensors.

**Returns:** `dict[str, torch.Tensor]`

A new HuggingFace-format mapping whose tensor shapes, dtypes,