Commit 3aa6f82
committed
fix(zero): reject Muon + reduce_scatter in ZeRO-1/2
Muon's Newton-Schulz orthogonalization requires the full all-reduced gradient
matrix on each rank. With reduce_scatter (the default), ZeRO-1/2 delivers each
rank only its own partition slice, so a parameter whose flattened gradient
crosses a partition boundary is orthogonalized on a partially-reduced,
rank-divergent gradient and silently receives an incorrect update (#7807).
Raise a clear error at initialization when Muon is combined with reduce_scatter,
consistent with the existing ZeRO-3 guard (#7919), and add a regression test.
Users should set "reduce_scatter": false to run Muon with ZeRO-1/2, as the
Muon tests already do.
Closes #7807
Signed-off-by: whycoming <alwaysxd666@gmail.com>1 parent 3a47d1d commit 3aa6f82
2 files changed
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
221 | 228 | | |
222 | 229 | | |
223 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
0 commit comments