fix(checkpoint): avoid DCP collectives during initialization - #3622
Draft
HuiyingLi wants to merge 1 commit into
Draft
fix(checkpoint): avoid DCP collectives during initialization#3622HuiyingLi wants to merge 1 commit into
HuiyingLi wants to merge 1 commit into
Conversation
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
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.
What does this PR do ?
Load base-model checkpoints independently on each rank instead of invoking
PyTorch DCP's distributed coordinator during initialization.
Initialization has already materialized each rank's local tensor destinations,
so the coordinator's gather/global-plan/scatter collectives are unnecessary.
With an NCCL process group, those object collectives leave persistent non-PyTorch
GPU allocations and disproportionately charge coordinator rank 0.
Training-checkpoint resume remains distributed and continues to use the
checkpointer's process group.
Changelog
no_dist=Trueto DCP only foris_init_stepbase-checkpoint loads.Before your PR is "Ready for review"
Pre checks:
Validation
ruff format --checkon both changed files: passed.ruff check nemo_automodel/components/checkpoint/checkpointing.py: passed.pytest -q tests/unit_tests/checkpoint/test_checkpointing.py: 202 passed, 5 skipped.One-node, eight-H100 A/B at the first base-checkpoint DCP boundary:
2.41 GiB on ranks 1-7. The rank-local path retained 1.98 GiB on every rank.
loss and gradient norm. Loss decreased from 7.6569 at step 0 to 0.0451 at
step 39.
The H100 qualification used the same
_do_loadbehavior as currentmain;changes to this file between the qualification base and
a41906d6are PEP 604annotation-only changes.
Additional Information
checkpoint tensor/CPU memory and route more initialization loads through DCP;
their current heads still pass
process_groupto_do_loadand thereforeretain the coordinator collectives addressed here.