nemo_automodel.components.speculative.dspark.config

View as Markdown

Module Contents

Functions

NameDescription
build_deepseek_v4_draft_configBuild a DeepSeek V4 DSpark draft config from a V4 target config.
build_draft_config-
build_gemma4_draft_configBuild a Gemma4 DSpark draft config from a Gemma4 target’s text sub-config.
build_glm_5_2_draft_configBuild a GLM-5.2 DSpark draft config from a GLM-5.2 (glm_moe_dsa) target config.
build_minimax_m3_draft_configBuild a MiniMax M3 DSpark draft config from a MiniMax M3 VL target’s text sub-config.
get_gemma4_text_configReturn a deep copy of a Gemma4 target’s text sub-config.
get_minimax_m3_text_configReturn a deep copy of a MiniMax M3 VL target’s text sub-config.

Data

TRAIN_ATTN_IMPLEMENTATION

__all__

API

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.

nemo_automodel.components.speculative.dspark.config.build_draft_config(
target_config,
model_args
)
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.

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.

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.

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

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

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.

nemo_automodel.components.speculative.dspark.config.TRAIN_ATTN_IMPLEMENTATION = 'flex_attention'
nemo_automodel.components.speculative.dspark.config.__all__ = ['build_draft_config', 'build_gemma4_draft_config', 'build_deepseek_v4_draft_con...