Skip to content

Fix ZeRO-3 checkpoint conversion with --debug - #8530

Open
vineethsaivs wants to merge 1 commit into
deepspeedai:masterfrom
vineethsaivs:fix-debug-zero3-export-20260915
Open

vineethsaivs wants to merge 1 commit into
deepspeedai:masterfrom
vineethsaivs:fix-debug-zero3-export-20260915

Conversation

@vineethsaivs

Copy link
Copy Markdown
Contributor

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.

Print individual group shapes and reuse the existing total element count.

Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com>
@vineethsaivs

Copy link
Copy Markdown
Contributor Author

Could a maintainer approve CI for this PR? The focused regression tests and repository lint checks pass locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant