Repository navigation
Fix/muon legacy checkpoint resume - #389
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
…point-resume # Conflicts: # kempnerforge/checkpoint/manager.py
7 tasks done
timothyngo
previously approved these changes
Oct 26, 2026
timothyngo
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, see the comment I added: a short warning would be helpful when something is missing.
timothyngo
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
orthogonalizeis in every Muon param group, andDCP requires every key of the load template (
Missing key in checkpoint state_dict: optimizer.param_groups.0.orthogonalize).Muon.LEGACY_GROUP_DEFAULTS = {"orthogonalize": "local"}:Muon.__setstate__fills listed keys into loadedgroups that lack them, and
stepreadsgroup["orthogonalize"].CheckpointManager.loadleaves a listed key out of the DCP template only where the checkpoint lacks it, andlogs it. Any other missing key still fails the load.
"local", the mode it was trained with.Testing
uv run ruff check kempnerforge/ tests/passesuv run ruff format --check kempnerforge/ tests/ scripts/passesuv run pyright kempnerforge/passes (0 errors)uv run pytest tests/unit/ -v --timeout=60passes (CPU: 2324 passed, 3 skipped, 1 xfailed)uv run torchrun --nproc_per_node=4 -m pytest tests/distributed/ -vuv run pytest tests/e2e/ --e2e -vNew tests in
TestMuonResume: a checkpoint withoutorthogonalizeresumes as "local" and matches anuninterrupted run bitwise; it stays "local" with "exact" configured; a checkpoint with the key keeps its saved
mode; a checkpoint missing
ns_stepsstill fails; the oldest layout (no inner AdamW, noorthogonalize)resumes Muon.
Checked with real checkpoints from older code: one saved at fb23328 resumes with step 3 bitwise equal to the
uninterrupted run; one saved at 8776509 (before #258) resumes, with only the inner AdamW's parameters
differing, as that layout's warning says. Both fail on 000e803.
Closes #388