Add --colocate-memory-peak-device: overlap the trainer/rollout handoff on the GPU - #2781
Merged
Merged
Conversation
yueming-yuan
requested review from
Shi-Dong,
Zhichenzzz,
fzyzcjy,
guapisolo,
jybsuper,
maocheng23 and
yushengsu-thu
as code owners
August 27, 2026 07:17
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
…e, drop a redundant guard
…RA paths never resume or double-pause the region
Zhichenzzz
approved these changes
Aug 31, 2026
…ry-peak-device # Conflicts: # scripts/run_deepseek_v4.py
maocheng23
approved these changes
Sep 1, 2026
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.
--colocate-memory-peak-device {cpu,gpu}(defaultcpu= current behavior). In colocate mode with--offload-train --offload-rollout, the step-boundary handoff briefly holds both the engine's host weight mirror and the trainer's backup in host RAM.gpumode reorders the handoff so the two host copies never coexist — the overlap moves to GPU memory instead:offload_kvonly) through trainer initoffload_kv→ onload trainer →offload_weightsclear_memory+ grad-buffer release → engine weight resume →offload_train--offload-train --offload-rollout, rejects the critic pathrun_deepseek_v4.pypassesgpuwhen the resolved--hardwareis GB300: host RAM there (898 GiB cgroup) is smaller than the engine weight mirror plus the trainer backup.Split out of #2706 (it is orthogonal to the dual-backend work). Validated on the 8×GB300 DSv4 50+ step runs in #2706's A/B (jobs 2695/2703); the
cpudefault path is unchanged.