Fix ZeRO-3 checkpoint conversion with --debug - #8530
Open
vineethsaivs wants to merge 1 commit into
Open
vineethsaivs wants to merge 1 commit into
vineethsaivs wants to merge 1 commit into
Conversation
Print individual group shapes and reuse the existing total element count. Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com>
vineethsaivs
requested review from
loadams,
tjruwase and
tohtana
as code owners
September 15, 2026 22:57
Contributor
Author
|
Could a maintainer approve CI for this PR? The focused regression tests and repository lint checks pass locally. |
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.
The checkpoint converter crashes with --debug on ZeRO-3 checkpoints.
The debug path treats each rank's list of optimizer groups as a tensor, reading .shape and .numel() from the list. Print individual group shapes and reuse the existing total element count.
Tests:
DS_ACCELERATOR=cpu python -m pytest tests/unit/checkpoint/test_convert_checkpoint.py -k 'not TestCheckpointConvert' -q. Debug export fails before. Five converter tests pass after. A separate real ZeRO-3 Adam step with two parameter groups, checkpoint save and debug export produces matching weights. Changed-file pre-commit passes. Apple M2 Pro CPU, PyTorch 2.10, one-rank Gloo; no GPU run.