Skip to content

Conversation

@behroozazarkhalili
Copy link
Collaborator

Summary

With FSDP2 now stable, this PR removes all FSDP1-specific code to reduce maintenance burden.

Changes

Code Changes

  • Removed _sync_fsdp1_params_to_vllm() method from RLOO, GRPO, and Online DPO trainers
  • Removed fsdp_version detection and conditional logic in all trainers
  • Replaced FSDP1 version checks with direct calls to _sync_fsdp2_params_to_vllm()
  • All vLLM weight synchronization now uses FSDP2 methods exclusively

Configuration Changes

  • Deleted trl/accelerate_configs/fsdp1.yaml
  • Deleted examples/accelerate_configs/fsdp1.yaml

Documentation Changes

  • Updated docs/source/clis.md to remove fsdp1 from predefined config profiles table

Technical Details

FSDP1 Implementation (Removed):

  • Used recursive post-order traversal of FSDP modules
  • Required FSDP.summon_full_params(module, recurse=False, writeback=False) for each module
  • Manually tracked visited parameters to avoid duplication

FSDP2 Implementation (Now Standard):

  • Uses module.state_dict() which automatically handles all parameters
  • No manual recursion or parameter tracking needed
  • Simpler and more maintainable code

Files Changed

  • trl/trainer/rloo_trainer.py
  • trl/trainer/grpo_trainer.py
  • trl/trainer/online_dpo_trainer.py
  • docs/source/clis.md
  • trl/accelerate_configs/fsdp1.yaml (deleted)
  • examples/accelerate_configs/fsdp1.yaml (deleted)

With FSDP2 now stable, this commit removes all FSDP1-specific code to reduce maintenance burden.

Changes:
- Removed _sync_fsdp1_params_to_vllm() method from RLOO, GRPO, and Online DPO trainers
- Removed fsdp_version detection and conditional logic in all trainers
- Replaced FSDP1 version checks with direct calls to _sync_fsdp2_params_to_vllm()
- Deleted fsdp1.yaml config files from trl/accelerate_configs and examples/accelerate_configs
- Updated docs/source/clis.md to remove fsdp1 from predefined config profiles table

Technical Details:
- FSDP1 used recursive post-order traversal with FSDP.summon_full_params()
- FSDP2 uses module.state_dict() which covers all parameters automatically
- All vLLM weight synchronization now uses FSDP2 methods exclusively
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@behroozazarkhalili behroozazarkhalili enabled auto-merge (squash) October 16, 2025 02:29
@qgallouedec
Copy link
Member

It seems like QLoRA isn't supported for FSDP2, let's make this on hold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants