Commit Graph

37 Commits (d4b1c2244765fdc326820a946c4e4ae755e9daa0)

Author SHA1 Message Date
jingyaogong 1e6e909f88 [update] trim redundant comments 2026-09-20 20:33:40 +08:00
jingyaogong 7f5ba40a4e
Merge pull request #821 from lycDragonSlayer/refactor/remove-redundant-update-policy
[refactor] remove redundant rollout update_policy after torch.compile
2026-09-20 20:13:29 +08:00
jingyaogong 7a9137d2e9 [update] trim verbose ddp comments 2026-09-15 14:53:11 +08:00
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
basil-k-aji-dev 9c088dd3a5 [fix] route RL trainer forward through DDP so gradients all-reduce
train_grpo.py, train_ppo.py and train_agent.py wrap the policy in
DistributedDataParallel but run the loss-bearing forward through
.module, bypassing the wrapper. DDP arms its gradient all-reduce hooks
inside DistributedDataParallel.forward(), so calling .module directly
means backward() performs no all-reduce: every rank steps on purely
local gradients and the replicas silently diverge. Only rank 0 is
saved, so multi-GPU RL training quietly degrades to single-GPU
training on 1/N of the data with no error.

The supervised trainers are unaffected; they already call the wrapped
module. no_grad uses of .module (rollout generation, checkpoint
saving) are left untouched, where unwrapping is correct.

Single-GPU behaviour is unchanged: with no process group, model is the
bare module and these calls are identical to before.
2026-09-14 14:54:07 +05:30
jingyaogong a3c7b01cc0 [fix] keep agent rollout token-aligned #850 2026-09-10 11:44:05 +08:00
TOPSAIL\78190 0c91dea4a2 [refactor] remove redundant rollout update_policy after torch.compile 2026-08-24 12:43:50 +08:00
jingyaogong 3f1a7cc25b [fix] ddp exit hang 2026-06-01 17:50:39 +08:00
jingyaogong 4497610ec0 [fix] issue#771 2026-05-19 17:40:03 +08:00
jingyaogong 802c15b2b4 [feat] reduce RL memory 2026-05-06 15:07:28 +08:00
TKiteRunner 10776417aa fix: resolve CUDA OOM in train_grpo.py on GPUs with <=8GB VRAM 2026-05-06 14:14:15 +08:00
jingyaogong 773e451b11 [fix] bugs 2026-04-27 19:16:08 +08:00
jingyaogong 6361510016 [fix] rollout bugs 2026-04-27 17:54:09 +08:00
jingyaogong 5416a44471 [fix] bugs 2026-04-21 13:03:34 +08:00
jingyaogong 101d7df2da [update] minimind-3 2026-03-25 23:57:45 +08:00
readlnh cf4b49a348 [fix] align log/save last-step check and ETA with 1-indexed step 2026-03-24 02:01:40 +01:00
readlnh d25500d363 [fix] gradient accumulation step alignment 2026-03-24 01:45:04 +01:00
jingyaogong fea69cf338 [fix] data skip 2026-01-18 16:56:29 +08:00
jingyaogong f7ffdf1fdb [update] shuffle data 2026-01-18 16:39:34 +08:00
jingyaogong e119db8478 [fix] compile unpack 2026-01-14 20:13:32 +08:00
jingyaogong 81d24a4f16 [feat] add compile 2026-01-14 14:42:30 +08:00
jingyaogong 42a4e8c86a [fix] dist cleanup 2026-01-02 22:25:55 +08:00
jingyaogong 9d898576ac [update] aux loss 2026-01-01 22:41:46 +08:00
jingyaogong c65335b56f [fix] experts unused 2025-12-31 21:47:04 +08:00
jingyaogong 5dd4df7e18 [fix] moe unused 2025-12-31 21:00:06 +08:00
jingyaogong 7eae14f3ce [feat] remove empty_cache 2025-12-27 07:14:36 +08:00
jingyaogong 5e1447b913 [fix] cuda memory #559 2025-12-01 16:17:43 +08:00
jingyaogong 509d8dacf1 [feat] clear cache 2025-11-06 13:12:28 +08:00
jingyaogong bf123b585d [feat] add args 2025-10-30 10:05:12 +08:00
jingyaogong 1713c24114 [fix] model device 2025-10-29 10:36:28 +08:00
jingyaogong 8f7e07b8ef [feat] update trainer 2025-10-28 23:30:10 +08:00
jingyaogong e8484874f5 [feat] pause-training 2025-10-26 18:49:52 +08:00
jingyaogong a82526da11 [feat] shuffle data 2025-10-23 20:13:28 +08:00
jingyaogong 805744e60a [fix] loss-issues-430 2025-10-23 19:08:42 +08:00
jingyaogong 463044e92a [fix] sampler-ddp 2025-10-23 15:03:19 +08:00
jingyaogong fa7dff8291 [fix] graph-oom & ddp-pos_cis 2025-10-23 14:22:13 +08:00
jingyaogong 7d877db79b [feat] minimind-2510 2025-10-21 21:19:47 +08:00