Follow-up to the review on #854. DDP re-broadcasts every registered buffer from rank 0 on each forward. The only buffers here are freqs_cos / freqs_sin, which each rank computes deterministically from config and never mutates from data, so the broadcast moves identical bytes every step for nothing. Verified with a two-rank CPU/Gloo run: with broadcast_buffers=False the gradients stay identical across ranks and so do the buffers. Also document the critic's tied-embedding assumption. CriticModel.forward never calls lm_head, which is only safe under DDP because tie_word_embeddings (default True) makes lm_head.weight the same Parameter as embed_tokens.weight. Untied, it becomes a genuinely unused parameter and DDP raises. |
||
|---|---|---|
| .. | ||
| rollout_engine.py | ||
| train_agent.py | ||
| train_distillation.py | ||
| train_dpo.py | ||
| train_full_sft.py | ||
| train_grpo.py | ||
| train_lora.py | ||
| train_ppo.py | ||
| train_pretrain.py | ||
| train_tokenizer.py | ||
| trainer_utils.py | ||