Skip to content

Commit e225bb2

Browse files
committed
clarify source and fix verbose
Signed-off-by: mihara-bot <1147220090@qq.com>
1 parent a731cea commit e225bb2

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

emerging_optimizers/orthogonalized_optimizers/muon_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@
5656
(1.8750, -1.2500, 0.3750),
5757
],
5858
"cans": [
59+
# CANS from: http://arxiv.org/abs/2506.10935
5960
# CANS iteration (Remez + adaptive interval) based coefficients.
60-
# Source (generation): accelerating_orthogonalization/polynomials.py
61+
# Source (for generating CANS coefficients): https://github.com/GrishKate/accelerating_orthogonalization/blob/main/polynomials.py
6162
(8.4703, -25.1081, 18.6293),
6263
(4.1828, -3.1087, 0.5806),
6364
(3.9619, -2.9541, 0.5630),

tests/test_muon_utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,7 @@ def test_get_cans_9steps_close_to_reference(self, dim1, dim2):
247247
out_cans9 = muon_utils.newton_schulz(x, steps=9, coefficient_type="cans")
248248
coeff = deepcopy(muon_utils._COEFFICIENT_SETS["cans"])
249249
# CANS uses repeat_last, so repeat the last tuple for remaining steps.
250-
coeff.append(coeff[-1])
251-
coeff.append(coeff[-1])
252-
coeff.append(coeff[-1])
253-
coeff.append(coeff[-1])
250+
coeff.extend([coeff[-1]] * 4)
254251
out_ref = newton_schulz_ref(x, coefficient_sets=coeff)
255252
torch.testing.assert_close(out_cans9, out_ref, atol=2e-6, rtol=1e-7)
256253

0 commit comments

Comments
 (0)