You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5d6d2e5
Browse filesBrowse the repository at this point in the historyBrowse files
[MiniMax-M3](https://huggingface.co/MiniMaxAI/MiniMax-M3) is a natively multimodal sparse MoE model from MiniMaxAI (428B total, ~23B active parameters). Megatron Bridge supports the M3 *language model* through the `MiniMaxM3Bridge`: the text backbone of the `MiniMaxM3SparseForConditionalGeneration` checkpoint is converted to a Megatron-Core `GPTModel`.
4
+
5
+
## Supported Variants
6
+
7
+
| Variant | Hugging Face ID | Notes |
8
+
|---------|-----------------|-------|
9
+
| MiniMax-M3 |`MiniMaxAI/MiniMax-M3`| Language model only (bf16 weights) |
10
+
11
+
## Architecture Notes
12
+
13
+
- Mixed dense/MoE decoder: 60 layers, the first 3 dense, the rest with 128 routed experts (top-4) plus one shared expert.
14
+
- Sigmoid router with expert-bias correction and `routed_scaling_factor` applied to the normalized top-k weights (DeepSeek-V3-style routing); the checkpoint's FP32 router weights remain FP32 during import.
15
+
- SwiGLU-OAI activation in every MLP and expert: clamped gate/up projections with a `+1` linear offset, mapped to `activation_func_clamp_value` / `glu_linear_offset` (same mechanism as GPT-OSS).
16
+
- Gemma-style RMSNorm (`x * (1 + w)`) on every norm, mapped to `layernorm_zero_centered_gamma`.
17
+
- GQA attention (64 query heads, 4 KV heads) with per-head QK RMSNorm and partial RoPE (64 of 128 head channels rotated, theta 5e6).
18
+
19
+
## Known Limitations
20
+
21
+
-**Language model only.** The CLIP-style vision tower, multimodal projector, and patch-merge MLP are not mapped.
22
+
-**Full attention only.** The lightning-indexer block-sparse attention branch (`self_attn.index_*` weights) is not mapped; the Megatron model runs full causal attention on every layer. Block selection keeps `index_topk_blocks * index_block_size` (2048) key tokens per query, so full attention is mathematically identical up to that sequence length and an approximation beyond it.
23
+
-**MTP modules are not mapped.** The released checkpoint advertises `num_nextn_predict_layers` in its config but ships no `mtp.*` weights.
24
+
-**Auxiliary-loss scoring differs for training.** The recipes use MCore's token-global load-balancing loss over normalized sigmoid scores. Hugging Face leaves its optional router loss disabled by default and uses softmax scores when enabled.
25
+
- The MXFP8 variant (`MiniMaxAI/MiniMax-M3-MXFP8`) is not supported; use the bf16 checkpoint.
The bridge imports the language backbone from the multimodal checkpoint.
37
+
Standalone Hugging Face checkpoint export is not supported because the vision,
38
+
projector, lightning-indexer, and MTP weights are intentionally not mapped;
39
+
native Megatron checkpoints and in-memory weight round-trip verification are
40
+
supported.
41
+
42
+
## Examples
43
+
44
+
For real-checkpoint Slurm conversion, inference, hardware requirements, and
45
+
validated parallelism settings, see the [MiniMax-M3 examples README](https://github.com/NVIDIA-NeMo/Megatron-Bridge/blob/main/examples/models/minimax/minimax_m3/README.md).
46
+
47
+
## Recipes
48
+
49
+
Pretraining and packed-sequence (THD) SFT recipes are available under [`src/megatron/bridge/recipes/minimax`](https://github.com/NVIDIA-NeMo/Megatron-Bridge/tree/main/src/megatron/bridge/recipes/minimax) (`minimax_m3_pretrain_256gpu_h100_bf16_config`, `minimax_m3_sft_128gpu_h100_bf16_config`), using a TP=2 / PP=4 / EP=32 baseline layout.
For local processor-native image JSONL and sharded Energon preparation patterns, see the [multimodal data tutorials](https://github.com/NVIDIA-NeMo/Megatron-Bridge/blob/main/tutorials/data/README.md).
126
+
125
127
## Example Datasets
126
128
127
129
Megatron Bridge supports various vision-language dataset examples which can be used to finetune Qwen 2.5 VL:
Copy file name to clipboardExpand all lines: docs/fern/versions/nightly/pages/recipe-usage.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ Training mode follows the recipe and dataset type:
23
23
| LLM pretraining or continued pretraining |`GPTDatasetConfig`|`pretrain()`| No checkpoint for from-scratch runs; use `checkpoint.load` for full resume or `checkpoint.pretrained_checkpoint` for model-weight initialization |
24
24
| Full SFT |`GPTSFTDatasetConfig` for local JSONL or Hugging Face source data |`finetune()`| Use `checkpoint.pretrained_checkpoint` for the base model, or `checkpoint.load` for a full native Megatron resume |
25
25
| PEFT / LoRA / DoRA | Same as SFT, plus `cfg.peft`|`finetune()`|`checkpoint.pretrained_checkpoint` is required for the frozen base model; `checkpoint.load` resumes adapter training |
26
-
| VLM SFT or PEFT |`DirectHFSFTDatasetConfig`+ builder, Energon, or a specialized/preloaded provider|`finetune()` with a VLM step function | Use the model-specific checkpoint guidance in the recipe or model docs |
26
+
| VLM SFT or PEFT |`DirectHFSFTDatasetConfig`with a Hugging Face source, including its JSON loader, or Energon|`finetune()` with a VLM step function | Use the model-specific checkpoint guidance in the recipe or model docs |
27
27
28
28
For dataset fields, prefer `seq_length` in Bridge examples. LLM pretraining uses `GPTDatasetConfig` with `data_path`, `blend`, or `blend_per_split`; SFT and PEFT use `dataset_root` for local JSONL data. Do not use `data_path` for SFT/PEFT JSONL roots.
0 commit comments