Commit 6d051bc
committed
feat(v5-g22): hybrid optimizer per-bucket update delta divergence
Closes V5-G22 / cppmega-mlx-3p2. V4-9 only reported bucket sizes
(counts); G22 proves the underlying update math actually diverges
between Muon (sign-of-grad NS-orthogonalised 2-D matmul weights)
and AdamW (adaptive 2nd-moment 1-D / 3-D+ tensors).
Backend (stages.py):
- When optimizer_kind==muon_adamw_hybrid, snapshot per-bucket
parameters pre-train (split_param_groups predicate)
- Post-train: _compute_hybrid_deltas computes L2 update delta per
bucket; reports {muon_norm, adamw_norm, ratio}
- Different optimizer math → ratio ≠ 1.0
E2E (1 in 51_hybrid_delta.spec.ts):
- UI hybrid → Train → both bucket norms > 0 AND |ratio - 1| > 0.05
(5% divergence floor — would fail if both buckets received
identical updates)
43 stage_train pytest unchanged.1 parent b2b6f29 commit 6d051bc
2 files changed
Lines changed: 97 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
568 | 575 | | |
569 | 576 | | |
570 | 577 | | |
| |||
576 | 583 | | |
577 | 584 | | |
578 | 585 | | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
579 | 599 | | |
580 | 600 | | |
581 | 601 | | |
| |||
745 | 765 | | |
746 | 766 | | |
747 | 767 | | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
748 | 771 | | |
749 | 772 | | |
750 | 773 | | |
| |||
894 | 917 | | |
895 | 918 | | |
896 | 919 | | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
897 | 948 | | |
898 | 949 | | |
899 | 950 | | |
| |||
| 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 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments