minimind/trainer
basil-k-aji-dev 37ac206e9a [perf] skip the per-forward RoPE buffer broadcast in the RL trainers
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.
2026-09-14 22:22:00 +05:30
..
rollout_engine.py [fix] keep agent rollout token-aligned #850 2026-09-10 11:44:05 +08:00
train_agent.py [perf] skip the per-forward RoPE buffer broadcast in the RL trainers 2026-09-14 22:22:00 +05:30
train_distillation.py [fix] ddp exit hang 2026-06-01 17:50:39 +08:00
train_dpo.py [fix] ddp exit hang 2026-06-01 17:50:39 +08:00
train_full_sft.py [update] remove expert args 2026-09-04 22:16:38 +08:00
train_grpo.py [perf] skip the per-forward RoPE buffer broadcast in the RL trainers 2026-09-14 22:22:00 +05:30
train_lora.py [fix] ddp exit hang 2026-06-01 17:50:39 +08:00
train_ppo.py [perf] skip the per-forward RoPE buffer broadcast in the RL trainers 2026-09-14 22:22:00 +05:30
train_pretrain.py [update] remove expert args 2026-09-04 22:16:38 +08:00
train_tokenizer.py [update] minimind-3 2026-03-25 23:57:45 +08:00
trainer_utils.py [update] simplify safe math eval 2026-09-14 23:55:32 +08:00