> 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.speculative.dspark.config

## Module Contents

### Functions

| Name                                                                                                                    | Description                                                                           |
| ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [`build_deepseek_v4_draft_config`](#nemo_automodel-components-speculative-dspark-config-build_deepseek_v4_draft_config) | Build a DeepSeek V4 DSpark draft config from a V4 target config.                      |
| [`build_draft_config`](#nemo_automodel-components-speculative-dspark-config-build_draft_config)                         | -                                                                                     |
| [`build_gemma4_draft_config`](#nemo_automodel-components-speculative-dspark-config-build_gemma4_draft_config)           | Build a Gemma4 DSpark draft config from a Gemma4 target's text sub-config.            |
| [`build_glm_5_2_draft_config`](#nemo_automodel-components-speculative-dspark-config-build_glm_5_2_draft_config)         | Build a GLM-5.2 DSpark draft config from a GLM-5.2 (glm\_moe\_dsa) target config.     |
| [`build_minimax_m3_draft_config`](#nemo_automodel-components-speculative-dspark-config-build_minimax_m3_draft_config)   | Build a MiniMax M3 DSpark draft config from a MiniMax M3 VL target's text sub-config. |
| [`get_gemma4_text_config`](#nemo_automodel-components-speculative-dspark-config-get_gemma4_text_config)                 | Return a deep copy of a Gemma4 target's text sub-config.                              |
| [`get_minimax_m3_text_config`](#nemo_automodel-components-speculative-dspark-config-get_minimax_m3_text_config)         | Return a deep copy of a MiniMax M3 VL target's text sub-config.                       |

### Data

[`TRAIN_ATTN_IMPLEMENTATION`](#nemo_automodel-components-speculative-dspark-config-TRAIN_ATTN_IMPLEMENTATION)

[`__all__`](#nemo_automodel-components-speculative-dspark-config-__all__)

### API

```python
nemo_automodel.components.speculative.dspark.config.build_deepseek_v4_draft_config(
    target_config,
    model_args
)
```

Build a DeepSeek V4 DSpark draft config from a V4 target config.

The draft shares the target's frozen `embed_tokens` / `lm_head` and fuses
its hidden states, so it keeps the target's attention and embedding dims and
only shrinks the depth, then adds the DSpark-specific fields. The draft is
always dense: V4's sparse machinery (DSA `compress_ratios`), hash routing,
and MTP are disabled.

```python
nemo_automodel.components.speculative.dspark.config.build_draft_config(
    target_config,
    model_args
)
```

```python
nemo_automodel.components.speculative.dspark.config.build_gemma4_draft_config(
    target_config,
    model_args
)
```

Build a Gemma4 DSpark draft config from a Gemma4 target's text sub-config.

```python
nemo_automodel.components.speculative.dspark.config.build_glm_5_2_draft_config(
    target_config,
    model_args
)
```

Build a GLM-5.2 DSpark draft config from a GLM-5.2 (glm\_moe\_dsa) target config.

The draft shares the target's frozen `embed_tokens` / `lm_head` and fuses its
hidden states, so it keeps the target's MLA and embedding dims and only shrinks the
depth, then adds the DSpark-specific fields. The draft is always dense: GLM's DSA
sparse machinery (the top-k indexer + IndexShare layer sharing) and its MoE are
disabled -- every draft layer is a plain dense SwiGLU block with a dense MLA.

```python
nemo_automodel.components.speculative.dspark.config.build_minimax_m3_draft_config(
    target_config,
    model_args
)
```

Build a MiniMax M3 DSpark draft config from a MiniMax M3 VL target's text sub-config.

```python
nemo_automodel.components.speculative.dspark.config.get_gemma4_text_config(
    target_config
)
```

Return a deep copy of a Gemma4 target's text sub-config.

```python
nemo_automodel.components.speculative.dspark.config.get_minimax_m3_text_config(
    target_config
)
```

Return a deep copy of a MiniMax M3 VL target's text sub-config.

```python
nemo_automodel.components.speculative.dspark.config.TRAIN_ATTN_IMPLEMENTATION = 'flex_attention'
```

```python
nemo_automodel.components.speculative.dspark.config.__all__ = ['build_draft_config', 'build_gemma4_draft_config', 'build_deepseek_v4_draft_con...
```