Commit 63f58d3
Add Mixtral MoE training recipes (FSDP2 + TransformerEngine)
Two self-contained recipes following existing Llama3/ESM2 recipe
conventions:
- bionemo-recipes/recipes/mixtral_native_te/: TE-accelerated Mixtral
FSDP2 training with a Lingua-style DCLM Baseline 1.0 pre-training
config for Mixtral-8x1B and 8x7B. Includes DDP and FSDP2 entry points.
- bionemo-recipes/recipes/opengenome2_mixtral_native_te/: TE Mixtral for
autoregressive DNA on OpenGenome2 metagenomes, mirroring
opengenome2_llama_native_te (THD packing, genomic label masking,
validation, nucleotide tokenizer packaged with the recipe).
Key design decisions:
- Self-contained KISS: fused MoE kernels (fused_a2a, fused_token_router,
fused_indices_converter), collator, checkpoint, and perf logger are
duplicated across both recipes rather than shared, matching repo
convention.
- Configurable expert parallelism via all-to-all token dispatch;
expert_parallel_size=1 by default for parity with the Llama3 recipe.
- MXFP8 alignment: pad post-alltoall MoE expert input to a multiple of
32 before GroupedLinear (attribute padding to the last expert so
m_splits sums correctly; slice padding off the output). No-op for
non-MXFP8 and already-aligned batches. Verified on 8x B300 SXM6 with
Mixtral-8x7B EP=8 at SEQ=8192: FP8 1.196 s/step, MXFP8 1.248 s/step.
- FSDP2 checkpointing uses DCP format (.distcp files), covered by
dedicated distributed checkpointing tests.
- CI-robust tests: session-scoped local WordLevel tokenizer fixture
avoids HuggingFace Hub dependency; expanded train coverage (7
single-GPU, 4 two-GPU tests per recipe) plus dataset and distributed
checkpoint tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Timur Rvachov <trvachov@nvidia.com>1 parent 86c8329 commit 63f58d3
70 files changed
Lines changed: 13844 additions & 11 deletions
File tree
- bionemo-recipes
- models/mixtral
- recipes
- mixtral_native_te
- hydra_config
- model_configs
- mixtral-8x1B
- mixtral-8x7B
- tests
- opengenome2_mixtral_native_te
- hydra_config
- model_configs
- og2-mixtral-8x1B
- og2-mixtral-8x7B
- tests
- tokenizers/nucleotide_fast_tokenizer
- ci/scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
283 | | - | |
284 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
285 | 298 | | |
286 | 299 | | |
287 | 300 | | |
| |||
298 | 311 | | |
299 | 312 | | |
300 | 313 | | |
301 | | - | |
| 314 | + | |
| 315 | + | |
302 | 316 | | |
303 | 317 | | |
304 | 318 | | |
305 | 319 | | |
306 | 320 | | |
307 | | - | |
| 321 | + | |
| 322 | + | |
308 | 323 | | |
309 | 324 | | |
310 | 325 | | |
| |||
394 | 409 | | |
395 | 410 | | |
396 | 411 | | |
397 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
398 | 434 | | |
399 | 435 | | |
400 | 436 | | |
| |||
503 | 539 | | |
504 | 540 | | |
505 | 541 | | |
506 | | - | |
507 | | - | |
| 542 | + | |
| 543 | + | |
508 | 544 | | |
509 | | - | |
510 | | - | |
511 | | - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
512 | 556 | | |
513 | 557 | | |
514 | 558 | | |
| |||
857 | 901 | | |
858 | 902 | | |
859 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
860 | 908 | | |
861 | 909 | | |
862 | 910 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
0 commit comments