Skip to navigation

nemo_automodel.components.models.minimax_m3_vl.config

View as Markdown

Typed configuration classes for the MiniMax M3 VL family.

The released checkpoint ships configuration_minimax_m3_vl.py which coerces the vision_config/text_config sub-dicts into generic PretrainedConfig instances (the text backbone’s model_type="minimax_m2" is not in HF’s CONFIG_MAPPING). For the native AutoModel implementation we declare typed sub-configs so that fields such as sparse_attention_config, moe_layer_freq and the SwiGLU-OAI parameters are real, defaulted attributes.

Mirrors the canonical sglang reference sglang.srt.configs.minimax_vl and the field set in the checkpoint’s config.json; keep them in sync.

Module Contents

Classes

NameDescription
MiniMaxM3DSparkConfigValidated settings of the MiniMax M3 DSpark draft.
MiniMaxM3DSparkReleasedConfigDraft contract read from a target checkpoint’s dspark/config.json.
MiniMaxM3QuantizationConfigquantization_config block of the released MiniMax M3 checkpoints.
MiniMaxM3VLConfigTop-level configuration for MiniMax M3 vision-language checkpoints.
MiniMaxM3VLTextConfigConfiguration for the MiniMax M3 (mixed sparse/dense MoE) text backbone.
MiniMaxM3VLVisionConfigConfiguration for the MiniMax M3 VL CLIP-style vision tower (Conv3d + 3D RoPE).
_DSparkDraftOptionsDeclarative DSpark settings supplied by the generic training recipe.

Functions

NameDescription
_json_safe_valueConvert config values that are valid in-memory but not JSON serializable.

Data

_DSPARK_DRAFT_ATTN_IMPLEMENTATION

_DSPARK_RELEASED_ARCHITECTURE

_DSPARK_RELEASED_BACKBONE_FIELDS

_DSPARK_RELEASED_REQUIRED_FIELDS

logger

API

class nemo_automodel.components.models.minimax_m3_vl.config.MiniMaxM3DSparkConfig(
num_draft_layers: int,
target_layer_ids: tuple[int, ...],
block_size: int,
num_anchors: int,
mask_token_id: int,
markov_rank: int,
markov_head_type: str,
confidence_head_alpha: float,
confidence_head_with_markov: bool,
)
Dataclass

Validated settings of the MiniMax M3 DSpark draft.

block_size
int

Number of tokens drafted per anchor.

confidence_head_alpha
float

Confidence loss weight, zero to disable the head.

confidence_head_with_markov
bool

Whether the confidence head reads Markov embeddings.

markov_head_type
str

Markov head variant.

markov_rank
int

Rank of the Markov head, zero to disable it.

mask_token_id
int

Vocabulary id of the noise token.

num_anchors
int

Number of anchors sampled per training row.

num_draft_layers
int

Number of draft decoder layers.

released
MiniMaxM3DSparkReleasedConfig | None = None

Contract shipped by the target checkpoint, when it has one.

target_layer_ids
tuple[int, ...]

Target layers whose features the draft consumes.

text_config
MiniMaxM3VLTextConfig

Text configuration of the target model.

nemo_automodel.components.models.minimax_m3_vl.config.MiniMaxM3DSparkConfig._validate_released(
) -> None

Reject recipe settings that disagree with the target’s released contract.

nemo_automodel.components.models.minimax_m3_vl.config.MiniMaxM3DSparkConfig.build() -> nemo_automodel.components.models.minimax_m3_vl.dspark.MiniMaxM3DSparkModel

Validate the settings and build the draft.

Returns: MiniMaxM3DSparkModel

Newly initialized draft ready for device placement.

Raises:

  • ValueError: If a setting is out of range or disagrees with released.
class nemo_automodel.components.models.minimax_m3_vl.config.MiniMaxM3DSparkReleasedConfig(
num_draft_layers: int,
target_layer_ids: tuple[int, ...],
block_size: int,
mask_token_id: int,
markov_rank: int,
markov_head_type: str,
ffn_hidden_size: int,
sliding_window: int,
exported_config: dict[str, typing.Any]
)
Dataclass

Draft contract read from a target checkpoint’s dspark/config.json.

block_size
int

Number of tokens drafted per anchor.

exported_config
dict[str, Any]

Released config without quantization metadata, written next to the draft weights because the export is not quantized.

ffn_hidden_size
int

Hidden width of the draft’s dense FFN.

markov_head_type
str

Markov head variant.

markov_rank
int

Rank of the Markov head.

mask_token_id
int

Vocabulary id of the noise token.

num_draft_layers
int

Number of draft decoder layers.

sliding_window
int

Context window of every draft layer, in tokens.

target_layer_ids
tuple[int, ...]

Target layers whose features the draft consumes.

classmethod

Read the contract a target checkpoint ships for its DSpark draft.

Parameters:

target_name_or_path
str

Hub id or local directory of the target checkpoint.

Returns: MiniMaxM3DSparkReleasedConfig | None

The parsed contract, or None when the target has no dspark/config.json.

Raises:

  • ValueError: If the file does not describe a dense, sliding-window DSparkMiniMaxDraftModel.
class nemo_automodel.components.models.minimax_m3_vl.config.MiniMaxM3QuantizationConfig

Bases: typing.TypedDict

quantization_config block of the released MiniMax M3 checkpoints.

M3 stores MXFP8 projections described by quant_method, activation_scheme, weight_block_size and ignored_layers. M3.1 adds NVFP4 packed routed experts described by moe_quant_algo, moe_quant_format and group_size.

activation_scheme
str
group_size
int
ignored_layers
list[str]
moe_quant_algo
str
moe_quant_format
str
quant_method
Required[str]
weight_block_size
list[int]
class nemo_automodel.components.models.minimax_m3_vl.config.MiniMaxM3VLConfig(
image_token_index: int = 200025,
video_token_index: int = 200026,
image_seq_length: int = 576,
process_image_mode: str = 'dynamic_res',
projector_hidden_act: str = 'gelu',
projector_hidden_size: int = 6144,
multimodal_projector_bias: bool = True,
patch_merge_bias: bool = True,
vision_feature_layer: int = -1,
vision_feature_select_strategy: str = 'full',
img_token_compression_config: dict | None = None,
image_grid_pinpoints: str | None = None,
kwargs = {}
)

Bases: PretrainedConfig

Top-level configuration for MiniMax M3 vision-language checkpoints.

hidden_size
= text_config.hidden_size
img_token_compression_config
= img_token_compression_config or {}
max_position_embeddings
= text_config.max_position_embeddings
model_type
= 'minimax_m3_vl'
sub_configs
nemo_automodel.components.models.minimax_m3_vl.config.MiniMaxM3VLConfig.build_dspark_draft(

Build the model-owned DSpark draft.

A target that ships dspark/config.json fixes the draft contract, and options must agree with it.

Parameters:

options
_DSparkDraftOptions

Declarative draft settings supplied by the DSpark recipe.

Returns: MiniMaxM3DSparkModel

Newly initialized draft ready for device placement.

nemo_automodel.components.models.minimax_m3_vl.config.MiniMaxM3VLConfig.to_dict()
class nemo_automodel.components.models.minimax_m3_vl.config.MiniMaxM3VLTextConfig(
hidden_size: int = 6144,
intermediate_size: int = 3072,
dense_intermediate_size: int = 12288,
shared_intermediate_size: int = 3072,
num_hidden_layers: int = 60,
num_attention_heads: int = 64,
num_key_value_heads: int = 4,
head_dim: int = 128,
vocab_size: int = 200064,
max_position_embeddings: int = 524288,
rms_norm_eps: float = 1e-06,
use_gemma_norm: bool = True,
attention_output_gate: bool = False,
rope_theta: float = 5000000.0,
rotary_dim: int = 64,
partial_rotary_factor: float = 0.5,
hidden_act: str = 'swigluoai',
use_qk_norm: bool = True,
qk_norm_type: str = 'per_head',
tie_word_embeddings: bool = False,
num_local_experts: int = 128,
num_experts_per_tok: int = 4,
n_shared_experts: int = 1,
scoring_func: str = 'sigmoid',
use_routing_bias: bool = True,
routed_scaling_factor: float = 2.0,
moe_layer_freq: list[int] | None = None,
swiglu_alpha: float = 1.702,
swiglu_limit: float = 7.0,
sparse_attention_config: dict | None = None,
num_mtp_modules: int = 1,
pad_token_id: int | None = None,
kwargs = {}
)

Bases: PretrainedConfig

Configuration for the MiniMax M3 (mixed sparse/dense MoE) text backbone.

architectures
= ['MiniMaxM3SparseForCausalLM']
model_type
= 'minimax_m3'
nemo_automodel.components.models.minimax_m3_vl.config.MiniMaxM3VLTextConfig.to_dict()
class nemo_automodel.components.models.minimax_m3_vl.config.MiniMaxM3VLVisionConfig(
hidden_size: int = 1280,
num_attention_heads: int = 16,
num_hidden_layers: int = 32,
intermediate_size: int = 5120,
patch_size: int = 14,
image_size: int = 672,
projection_dim: int = 6144,
num_channels: int = 3,
position_embedding_type: str = 'rope',
rope_mode: str = '3d',
rope_theta: float = 10000.0,
attention_dropout: float = 0.0,
hidden_act: str = 'gelu',
layer_norm_eps: float = 1e-05,
img_token_compression_config: dict | None = None,
vision_segment_max_frames: int = 4,
kwargs = {}
)

Bases: PretrainedConfig

Configuration for the MiniMax M3 VL CLIP-style vision tower (Conv3d + 3D RoPE).

img_token_compression_config
model_type
= 'minimax_m3_vision'
nemo_automodel.components.models.minimax_m3_vl.config.MiniMaxM3VLVisionConfig.to_dict()
class nemo_automodel.components.models.minimax_m3_vl.config._DSparkDraftOptions()
Protocol

Declarative DSpark settings supplied by the generic training recipe.

block_size
int
confidence_head_alpha
float
confidence_head_with_markov
bool
markov_head_type
str
markov_rank
int
mask_token_id
int
num_anchors
int
num_draft_layers
int
target_layer_ids
list[int]
nemo_automodel.components.models.minimax_m3_vl.config._json_safe_value(
value: typing.Any
) -> typing.Any

Convert config values that are valid in-memory but not JSON serializable.

nemo_automodel.components.models.minimax_m3_vl.config._DSPARK_DRAFT_ATTN_IMPLEMENTATION = 'flex_attention'
nemo_automodel.components.models.minimax_m3_vl.config._DSPARK_RELEASED_ARCHITECTURE = 'DSparkMiniMaxDraftModel'
nemo_automodel.components.models.minimax_m3_vl.config._DSPARK_RELEASED_BACKBONE_FIELDS = ('hidden_size', 'num_attention_heads', 'num_key_value_heads', 'head_dim', 'rms_n...
nemo_automodel.components.models.minimax_m3_vl.config._DSPARK_RELEASED_REQUIRED_FIELDS = (*_DSPARK_RELEASED_BACKBONE_FIELDS, 'dspark_block_size', 'dspark_ffn_hidden_size...
nemo_automodel.components.models.minimax_m3_vl.config.logger = logging.getLogger(__name__)