[FSDP] Include buffers for weight transfer
Feature request
Currently we do not send buffers from FSDP to rollout engines, which could result mismatch if these buffers got updated during training, such as model.layers.{i}.mlp.gate.e_score_correction_bias in DeepSeek V3 (including Moonlight) model.
Motivation
As above
Your contribution
Can help on end-to-end verifification
Thank you for raising this important issue.
You're correct that buffers (non-parameter tensors) in models like DeepSeek V3 (including Moonlight) need to be transferred alongside weights to ensure consistency during rollout.
Current Status:
In the existing FSDP weight transfer mechanism, only model parameters (trainable weights) are synchronized to rollout engines. Buffers such as e_score_correction_bias in DeepSeek V3's MoE layers are indeed not included.
Impact: This can cause:
- Inference quality degradation if buffers are modified during training
- Incorrect expert routing in MoE models
- Mismatch between training and serving behavior
Implementation Considerations:
- Buffer transfer needs to be added to the weight sync pipeline
- Need to handle buffers that should NOT be transferred (e.g., running stats in BatchNorm if applicable)
- Performance impact of additional tensor transfers
Would you be interested in contributing a PR for this? The key files would be:
verl/workers/rollout/vllm_rollout/utils.py- for vLLM backendverl/workers/rollout/sglang_rollout/- for SGLang backend- The bucketed weight transfer logic
This would be a valuable improvement for DeepSeek V3 / Moonlight model training support.
I opened a PR for this issue: #5801
The fix keeps parameter updates on the existing load_weights(...) path, applies registered buffer updates explicitly on the rollout model, and adds CPU tests for the rollout-side update behavior.
@chenshui223 Thanks for your contribution! @Luosuu May you use the implementation from @chenshui223 https://github.com/verl-project/verl/pull/5801 to run a verification?