feat(models): add AR value head and GAE wiring - #256
Conversation
ed4fccd to
719cc08
Compare
87c5630 to
6728292
Compare
6728292 to
bf54bf5
Compare
bf54bf5 to
c6aae06
Compare
|
Updated this PR on current Review fixes included:
Validation result: pre-commit and compileall passed. An uncommitted GPU correctness smoke with a tiny Qwen3 checkpoint confirmed eager/meta loaded states are identical ( No test files were added. |
|
Added a full-model integration check through the stacked PPO PR #259: Qwen3-4B-Base on 8 x H20, BF16, with both colocated SGLang and trainside rollout. Three nonzero-gradient PPO rounds completed on both paths. This exercised #256's value head, token-aligned critic replay, terminal reward/GAE preparation, backward, and repeated optimizer updates on the real 4B checkpoint. The loss curves were close:
All rewards were |
Summary
Part 2/3 of #86: add the critic/value and GAE data path required by AR PPO. This branch has been rebuilt on the current
main.ValueHeadfor Qwen3.ReplayResult.values.values,returns, andtoken_advantagesfields toTextSegment.loss_maskas an optimization mask, not as an artificial trajectory boundary.The PPO optimizer and trainer wiring remain in #259.
Related Issue
Part of #86. #259 is stacked on this PR and should be reviewed/merged after this one.
Test Plan
No PR-specific test files are included.
SKIP=no-commit-to-branch pre-commit run --all-files --show-diff-on-failure— all hooks passed.python -m compileall -q unirl— passed.max_state_diff=0.0);Compatibility / Risk
use_value_headdefaults tofalse; existing Qwen3 GRPO behavior is unchanged.return_values=falsepreserves the legacy replay return type.Reviewer Notes
Please review packed/padded replay alignment and the meta-init post-load zeroing first. AI assistance was used; the final diff was reviewed and validated against the current repository state.
Checklist