Commit c32778d
authored
feat: Support for nano-v2 (#1514)
Signed-off-by: Yi-Fu Wu <[email protected]>1 parent 775fc34 commit c32778d
File tree
9 files changed
+191
-5
lines changed- 3rdparty/Megatron-Bridge-workspace
- examples/configs/recipes/llm
- nemo_rl/models
- megatron
- policy
- tests/test_suites
- llm
9 files changed
+191
-5
lines changedSubmodule Megatron-Bridge updated 48 files
- .github/workflows/cicd-main.yml+5
- README.md+1-1
- docs/models/vlm/index.md+1
- docs/models/vlm/nemotron-nano-v2-vl.md+192
- examples/conversion/compare_hf_and_megatron/compare.py+2-2
- examples/conversion/hf_megatron_roundtrip.py+1-1
- src/megatron/bridge/models/deepseek/deepseek_provider.py+2
- src/megatron/bridge/models/gemma/gemma3_provider.py+1-4
- src/megatron/bridge/models/gpt_provider.py+7-6
- src/megatron/bridge/models/llama/llama_provider.py+10-8
- src/megatron/bridge/models/mamba/mamba_provider.py+14-1
- src/megatron/bridge/models/model_provider.py+12-11
- src/megatron/bridge/models/nemotron/nemotron_provider.py+3-4
- src/megatron/bridge/models/nemotronh/nemotron_h_bridge.py+1
- src/megatron/bridge/models/nemotronh/nemotron_h_provider.py+4-3
- src/megatron/bridge/models/qwen/qwen_provider.py+2
- src/megatron/bridge/recipes/nemotronh/nemotronh.py+2-2
- src/megatron/bridge/recipes/qwen/qwen3_moe.py-2
- src/megatron/bridge/training/config.py+13-10
- src/megatron/bridge/training/initialize.py+18-1
- src/megatron/bridge/training/utils/train_utils.py+10
- src/megatron/bridge/utils/fusions.py+12-106
- tests/functional_tests/data/test_loaders.py+3
- tests/functional_tests/models/test_gemma2_conversion.py+2-12
- tests/functional_tests/models/test_gemma2_provider.py+1-10
- tests/functional_tests/models/test_gemma3_conversion.py+3-11
- tests/functional_tests/models/test_gemma3_provider.py+1-7
- tests/functional_tests/models/test_gemma_conversion.py+2-12
- tests/functional_tests/models/test_gemma_provider.py+1-10
- tests/functional_tests/models/test_glm45_provider.py+1-10
- tests/functional_tests/recipes/test_llama_recipes_pretrain_1b.py+16-11
- tests/functional_tests/recipes/test_mamba_recipes_pretrain.py+13-22
- tests/functional_tests/recipes/test_qwen_recipes_pretrain.py+13-7
- tests/functional_tests/recipes/test_qwen_vl_recipes_finetune.py+13-4
- tests/functional_tests/recipes/utils.py+13-3
- tests/functional_tests/training/test_inprocess_restart.py+3-2
- tests/functional_tests/training/test_megatron_fsdp.py+5-5
- tests/functional_tests/training/test_pretrain.py+5-4
- tests/functional_tests/training/test_pretrain_resume.py+3-3
- tests/functional_tests/training/test_sample_based_training.py+1
- tests/unit_tests/models/llama/test_llama_provider.py-1
- tests/unit_tests/models/nemotronh/test_nemotron_h_provider.py+1-1
- tests/unit_tests/recipes/nemotronh/test_nemotronh.py+10-5
- tests/unit_tests/training/test_config.py+146
- tests/unit_tests/training/test_initialize.py+311
- tests/unit_tests/training/test_tokenizer.py+250-1
- tests/unit_tests/training/utils/test_train_utils.py+68
- tests/unit_tests/utils/test_fusions.py+41-391
Lines changed: 34 additions & 0 deletions
| 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 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
Lines changed: 44 additions & 0 deletions
| 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 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
351 | 356 | | |
352 | 357 | | |
353 | 358 | | |
354 | 359 | | |
355 | 360 | | |
356 | | - | |
| 361 | + | |
357 | 362 | | |
358 | 363 | | |
359 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| |||
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
126 | 134 | | |
127 | 135 | | |
128 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| |||
1271 | 1271 | | |
1272 | 1272 | | |
1273 | 1273 | | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
1274 | 1279 | | |
1275 | 1280 | | |
1276 | 1281 | | |
1277 | 1282 | | |
1278 | | - | |
1279 | 1283 | | |
| 1284 | + | |
1280 | 1285 | | |
1281 | 1286 | | |
1282 | 1287 | | |
| |||
1550 | 1555 | | |
1551 | 1556 | | |
1552 | 1557 | | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
1553 | 1562 | | |
1554 | 1563 | | |
1555 | 1564 | | |
1556 | 1565 | | |
1557 | | - | |
| 1566 | + | |
1558 | 1567 | | |
1559 | 1568 | | |
1560 | 1569 | | |
| |||
| 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 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 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 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
| |||
0 commit comments