fix(automodel): align checkpoint lifecycle with consolidated save modes - #3935
Open
jQizhang wants to merge 7 commits into
Open
fix(automodel): align checkpoint lifecycle with consolidated save modes#3935jQizhang wants to merge 7 commits into
jQizhang wants to merge 7 commits into
Conversation
Signed-off-by: larkzhang-nv <larkz@nvidia.com>
Signed-off-by: larkzhang-nv <larkz@nvidia.com>
Signed-off-by: larkzhang-nv <larkz@nvidia.com>
Contributor
Author
|
/ok to test c573027 |
Signed-off-by: larkzhang-nv <larkz@nvidia.com>
Signed-off-by: larkzhang-nv <larkz@nvidia.com>
Signed-off-by: larkzhang-nv <larkz@nvidia.com>
jQizhang
marked this pull request as ready for review
September 2, 2026 06:49
Signed-off-by: larkzhang-nv <larkz@nvidia.com>
Contributor
Author
|
/ok to test 8cea42d |
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
This PR updates NeMo RL's Automodel checkpoint integration to match the checkpoint lifecycle and consolidated-save modes introduced in Automodel r0.6.0.
save_consolidatedmodes:"false","final", and"every"Checkpointeronce from the complete construction-time configuration instead of mutating or rebuilding it during each savefinalconsolidates only terminal or deliberate early-stop checkpoints, while timeout recovery checkpoints remain resumableFixes #3893. Follow-up to #3498 and related to #3624.
Why this is needed
Automodel r0.6.0 creates async stagers, dedicated process groups, consolidation groups, and save addons while constructing the
Checkpointer. The previous NeMo RL integration initialized a checkpointer from partial/default configuration, then updated checkpoint configuration at save time. Changing constructor-owned settings after construction could leave the runtime resources out of sync with the effective configuration and cause missing consolidation or distributed hangs.The same per-save configuration path also made load-time behavior depend on rank-local filesystem detection and did not carry Automodel's explicit final-checkpoint signal.
Before
flowchart LR A["Partial config C0"] --> B["Build Checkpointer<br/>resources R0"] --> C["Every save / load<br/>recomputes config"] --> D["Mutate to C1<br/>rebuild addons only"] --> E["Run with<br/>config C1 + resources R0"] --> F["C1 != R0<br/>missing resources or hang"] classDef config fill:#EDF3FC,stroke:#9FB5D6,color:#17213A classDef runtime fill:#FFF5DF,stroke:#DFB45D,color:#17213A classDef automodel fill:#F1EDFB,stroke:#AD9BD0,color:#17213A classDef risk fill:#FFF0EE,stroke:#D45B55,color:#7F302D class A config class C,D runtime class B,E automodel class F riskAfter
flowchart LR A["Complete config C<br/>at worker construction"] --> B["CheckpointingConfig.build()"] --> C["Stable Checkpointer<br/>resources R(C)<br/>load reuses it"] --> D["async_wait()<br/>finish previous save"] --> E["save_model(final flag)<br/>wait for staging"] --> F["Background upload<br/>false / final / every"] --> G["finalize_async_save()<br/>tmp_step_N → step_N"] classDef config fill:#EDF3FC,stroke:#9FB5D6,color:#17213A classDef lifecycle fill:#EAF7F3,stroke:#7EB7A4,color:#185D4A classDef automodel fill:#F1EDFB,stroke:#AD9BD0,color:#17213A class A config class B,C automodel class D,E,F,G lifecycleImplementation details
save_consolidated"false""final""every"Use quoted
"false"in YAML; replace legacyfalsewith"false"andtruewith"every".single_rank_consolidationremains supported for every mode.CheckpointingConfig.build(); known unsupported settings are rejected. Per-save config mutation and private-addon rebuilding are removed.is_final_checkpoint(final step or deliberate early stop, but not timeout recovery). Async Policy saves wait for prior work and staging, then finish upload/consolidation before atomic promotion; PPO Value saves remain synchronous.Validation
Static checks
ruff checkpassed for the modified Automodel manager and its unit testsgit diff --checkpassedDistributed checkpoint matrix
Ran a 24-case end-to-end Slurm matrix covering four representative algorithms and the complete consolidated-save configuration cross product.
Environment
model_save_format: safetensorssave_period: 1step_1: non-final checkpointstep_2: final checkpoint"false"/ distributed-consolidation caseResults
single_rank_consolidation"false"finaleveryfalsefalsefalsefalsetruetruetruetrueResult: 24/24 cases passed.
Consolidation semantics
save_consolidated"false"consolidated/directory"final"step_2contained consolidated Hugging Face weights"every"step_1andstep_2contained consolidated Hugging Face weightsFor PPO, these semantics were independently verified for both Policy and Value checkpoints. Every case also completed without leftover temporary checkpoint directories.