Commit 09e1ca1
FlagScale Train Upgrade: Synchronization with Megatron-LM Core0.17.0 (#1193)
**FlagScale Training Upgrade**
Sync FlagScale training layer with upstream Megatron-LM core_r0.17.0.
Key changes:
- Replace training/ and legacy/ with upstream 0.17.0 content, then
re-apply FlagScale patches
- Unify tokenizer system with registration-based factory dispatch,
remove legacy_tokenizer flag
- Replace torch.cuda calls with cur_platform abstraction in
training/models
- Sync arguments.py with upstream FP4 param gather changes, guard
hetero-specific args
- Fix loss accumulator reset bug (halved lm_loss at iter 2)
- Remove FlagScale-forked Muon optimizer code, use upstream 0.17.0
implementation
- Remove stale moe_use_legacy_grouped_gemm references
- Found that test_train_robobrain_x0.py was leaking MagicMock objects
into sys.modules during collection, breaking test_parallel_context.py.
Applied the fix by restoring modules immediately after import instead of
deferring cleanup.
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: heavyrain <1528794076@qq.com>1 parent b65bca6 commit 09e1ca1
137 files changed
Lines changed: 5683 additions & 9769 deletions
File tree
- docs
- examples
- aquila/conf/train
- deepseek_v3/conf/train
- llava_onevision/conf/train
- qwen2_5_vl/conf/train
- qwen2_5/conf/train
- qwen3_vl/conf/train
- qwen3/conf/train
- qwq/conf/train
- robobrain_x0/conf/train
- flagscale
- models/megatron
- engram
- qwen2_5_vl
- qwen3_vl
- runner/auto_tuner
- train
- megatron
- legacy
- data
- fused_kernels
- tests
- model
- vision
- mpu/tests
- training
- config
- datasets
- tokenizer
- processor
- utils
- tests
- functional_tests
- benchmark/qwen3/conf/train
- hetero_train/aquila
- conf/train
- gold_values
- train
- aquila
- conf/train
- gold_values
- deepseek
- conf/train
- gold_values
- mixtral
- conf/train
- gold_values
- qwen3/conf/train
- unit_tests
- train/megatron
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 | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | | - | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
0 commit comments