minimind/trainer
FloatFrank 1191fc8e9f [fix] PPO: align mb_resp_logp with old_resp_logp under autocast
Move log_softmax for mb_resp_logp inside autocast_ctx so it is upcast
to fp32, matching the rollout path (compute_per_token_logps runs under
no_grad+autocast). Previously log_softmax ran outside autocast on
fp16/bf16 logits, introducing a ~1e-2 systematic bias between
mb_resp_logp and old_resp_logp, so ratio != 1 and KL != 0 even before
any weight update. Under sparse rule-based rewards (e.g. math PPO)
this bias destabilises training.

Also add:
- --rollout_eval_mode (default 1): switch actor to eval during rollout
  to disable dropout and keep old/new logp consistent.
- --debug_log_ratio: optional diagnostic printing |mb-old| on the first
  minibatch to verify ratio ~= 1.
2026-07-21 18:51:42 +08:00
..
rollout_engine.py [fix] inference bug 2026-05-03 20:48:48 +08:00
train_agent.py [fix] ddp exit hang 2026-06-01 17:50:39 +08:00
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 [fix] ddp exit hang 2026-06-01 17:50:39 +08:00
train_grpo.py [fix] ddp exit hang 2026-06-01 17:50:39 +08:00
train_lora.py [fix] ddp exit hang 2026-06-01 17:50:39 +08:00
train_ppo.py [fix] PPO: align mb_resp_logp with old_resp_logp under autocast 2026-07-21 18:51:42 +08:00
train_pretrain.py [fix] ddp exit hang 2026-06-01 17:50:39 +08:00
train_tokenizer.py [update] minimind-3 2026-03-25 23:57:45 +08:00
trainer_utils.py [update] minimind-3 2026-03-25 23:57:45 +08:00