Revert "chore: remove fsdp_cpu_offload"#3052
Merged
Merged
Conversation
This reverts commit c9acaa3.
Member
Author
|
Validation complete: with |
samsja
approved these changes
Jul 16, 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.
Reverts #3049 — decision reversed after measuring the 2-node ceilings for Nemotron Super at cp=8 without it:
Without FSDP param offload, fp32 master weights+grads (~60 GiB/GPU on 2 nodes) cap trainable context at ~96–120k; with it, 131k–196k fit. Restoring the knob; validation runs at 131k with it re-enabled are in flight (results to follow).
Note: combining fsdp_cpu_offload with NCCL weight broadcast still needs the staging fix from #3045 (closed; can be reopened) — trainer-only / filesystem-broadcast paths are unaffected.
🤖 Generated with Claude Code
Note
Medium Risk
Touches core FSDP sharding, weight loading, and distributed backends; misconfiguration is guarded but throughput and NCCL weight broadcast interactions remain sensitive.
Overview
Restores the
trainer.model.fsdp_cpu_offloadoption (reverting its removal) so FSDP can offload parameters, gradients, and optimizer state to CPU with pinned memory—needed for long-context SFT/RL on tight GPU memory.Trainer wiring:
setup_fsdpappliesCPUOffloadPolicyacross FSDP units; weight load /to_emptyuses CPU when offload is on, with_move_buffers_to_cudabecause FSDP does not offload buffers. RL and SFT callsetup_torch_distributed(..., enable_gloo=True)when offload is enabled (cpu:gloo,cuda:nccl).Config/docs:
fsdp_cpu_offloadis mutually exclusive withoptim_cpu_offload; Muon rejects FSDP CPU offload.docs/scaling.mddocuments the knob and tradeoffs.Reviewed by Cursor Bugbot for commit b1cecf5. Bugbot is set up for automated code reviews on this repo. Configure here.