Repository navigation
chore: remove fsdp_cpu_offload - #3049
Merged
Merged
Conversation
The knob was effectively unusable: it breaks NCCL weight broadcast in RL (state-dict tensors stay on CPU and the communicator asserts), muon rejects it, it is mutually exclusive with optim_cpu_offload, and no config in the repo uses it. Remove the field and all wiring instead of patching around it: FSDP CPUOffloadPolicy selection, the buffer-migration helper, the gloo backend plumbing in setup_torch_distributed, both muon validators, and docs. optim_cpu_offload remains the supported CPU-offload knob. Default behavior is unchanged: fully_shard's own default offload policy is OffloadPolicy(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mikasenghaas
marked this pull request as ready for review
July 15, 2026 23:36
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 65e5d3a. Configure here.
samsja
previously approved these changes
Jul 15, 2026
Three fully_shard call sites passed offload_policy=offload_policy directly (not via fsdp_config) and were missed by the removal — setup_fsdp raised NameError. fully_shard's default is OffloadPolicy(), so omitting the kwarg is behavior-identical. Verified by importing the trainer modules and checking setup_fsdp's symbol table. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
Good catch — confirmed real: three |
This was referenced Jul 16, 2026
mikasenghaas
added a commit
that referenced
this pull request
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.

Supersedes #3045 — rather than fixing
fsdp_cpu_offloadfor NCCL weight broadcast, remove the knob entirely.Why
broadcast_state_dictpasses them straight to the NCCL communicator →AssertionError: this nccl communicator is created to work on cuda:0, but the input tensor is on cpu(hit during bring-up of a 196k Nemotron Super run).optim_cpu_offload, which remains the supported CPU-offload knob.What's removed
ModelConfig.fsdp_cpu_offload+ the mutual-exclusion validator + both muon validatorsCPUOffloadPolicyselection insetup_fsdp(behavior unchanged:fully_shard's own default isOffloadPolicy())_move_buffers_to_cudahelper + 4 call sites; CPUto_emptydevice forksenable_glooplumbing insetup_torch_distributed(existed solely for CPU offload)Mechanical removal; default path byte-identical. Note for the record: FSDP CPU offload was worth ~19–25 GiB/GPU of param baseline in fp32 long-context SFT measurements — if that headroom is ever needed again, the NCCL fix from #3045 is the alternative.
🤖 Generated with Claude Code
Note
Medium Risk
Touches core distributed init and FSDP sharding defaults; behavior changes only if configs still set the removed flag, but that path was broken with NCCL weight broadcast.
Overview
Removes the
fsdp_cpu_offloadtraining knob end-to-end so FSDP always uses the default in-GPU offload policy andoptim_cpu_offloadremains the only supported CPU memory lever.Config & validation: Drops
ModelConfig.fsdp_cpu_offloadand related validators (mutual exclusion withoptim_cpu_offload, Muon + FSDP CPU offload checks in trainer and SFT configs). Docs inscaling.mdno longer document FSDP CPU offload.Trainer runtime:
setup_fsdpno longer passesCPUOffloadPolicy; weight init paths always useto_empty(device="cuda")and the_move_buffers_to_cudahelper is deleted. RL and SFT callsetup_torch_distributedwithoutenable_gloo(Gloo was only for CPU-offload collectives).Reviewed by Cursor Bugbot for commit 76d79b2. Bugbot is set up for automated code reviews on this repo. Configure here.