Skip to content

Zero3 defragment utility#7940

Merged
sfc-gh-truwase merged 14 commits intodeepspeedai:masterfrom
nathon-lee:zero3-defragment-utility
Mar 31, 2026
Merged

Zero3 defragment utility#7940
sfc-gh-truwase merged 14 commits intodeepspeedai:masterfrom
nathon-lee:zero3-defragment-utility

Conversation

@nathon-lee
Copy link
Copy Markdown
Contributor

refactor(zero3): factor out defragment method to zero utils

Resolves a TODO in the codebase by extracting the defragment logic out
of DeepSpeedZeroOptimizer_Stage3 and moving it to deepspeed/runtime/zero/utils.py
as an independent utility function. This decouples the memory defragmentation logic
from the core optimizer class and improves code maintainability and reusability.

Copilot AI and others added 12 commits February 27, 2026 06:30
This reverts commit ff88670.

Co-authored-by: nathon-lee <248585198+nathon-lee@users.noreply.github.com>
Revert "fix: update 1 file reformatted." (ff88670)
Revert accidental Muon optimizer code re-introduction from copilot PRs
Signed-off-by: nathon-lee <leejianwoo@gmail.com>

refactor(zero3): factor out defragment method to zero utils

Signed-off-by: nathon-lee <leejianwoo@gmail.com>
@sfc-gh-truwase sfc-gh-truwase enabled auto-merge (squash) March 31, 2026 15:59
@sfc-gh-truwase sfc-gh-truwase merged commit 5dce124 into deepspeedai:master Mar 31, 2026
1 check passed
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.

3 participants