Repository navigation
fix(ppo): enable Automodel value dynamic batching with equivalence coverage - #3321
Conversation
|
/ok to test c9a8bcb |
c9a8bcb to
64e7a82
Compare
|
/ok to test db5cf5f |
@fujial-code, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
|
/ok to test db5cf5f |
@fujial-code, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
|
/ok to test 64e7a82 |
yuki-97
left a comment
There was a problem hiding this comment.
@fujial-code thanks for verifying and adding the tests.
besides one inline comment, according to our discussion offline, dynamic batching for dtensor PPO is fine (curve in the PR description), but the critic/loss in #2953 may be related to the random init weights of value model.
- could you update the PR description adding how you tested it to get the correct result? (I remember you saved a ckpt for test)
- file a new issue (or change the title & content of #2953) to track this, since the mismatch is not due to dynamic batching.
- for changing the threshold in nightly test, let's do it after we figure out the init weights things.
then I think there's no other block for this PR.
e84b33c to
c502f33
Compare
|
/ok to test c502f33 |
@fujial-code, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
|
/ok to test 4fed1ba |
|
/ok to test 1a9f496 |
|
/ok to test 10b73a0 |
|
/ok to test ab44ef9 |
|
/ok to test ee75aa1 |
ee75aa1 to
49bbca0
Compare
|
/ok to test 49bbca0 |
49bbca0 to
e618cb5
Compare
|
/ok to test e618cb5 |
There was a problem hiding this comment.
Merge blockers — please rebase on main and resolve conflicts, and CI is red at e618cb5 on 1 failure caused by this PR.
Tracking the #2953 critic-loss gap down to the unseeded value-head init rather than dynamic batching is a great find; this PR lifts the Automodel value dynamic-batching guard on that basis and seeds each Automodel value worker before model construction.
Thanks for posting the 100-step pinned OFF/ON comparison with the critic-loss and reward curves in the description: the two runs line up clearly. Thanks also for the extensive self-review.
Scope: the full PR, at e618cb5
Checked:
- Previous review threads — all six fixes hold at the current head
- Seed placement —
set_seedruns before the meta-device build andinitialize_model_weights, and the DTensor RNG tracker broadcasts rank 0's state, so the score head matches across shards Value(...)call sites — every one in the repo passesseedexcepttest_lm_value.py- Removed guard — DB + sequence packing, CP>1 and PP>1 are still rejected elsewhere, and no doc still calls Automodel value dynamic batching unsupported
- New tests — all three Automodel value tests run and pass in L0_Unit_Tests_Automodel, none skipped
Remaining comments are on:
- The
test_lm_value.pycall that misses the new requiredseed
PR title — please change "DTensor" to "Automodel" to match the rest of the repo.
|
/ok to test bd88c7a |
Signed-off-by: fujial <[email protected]>
Signed-off-by: fujial <[email protected]>
Signed-off-by: fujial <[email protected]>
Signed-off-by: fujial <[email protected]>
Signed-off-by: fujial <[email protected]>
Signed-off-by: fujial <[email protected]>
Signed-off-by: fujial <[email protected]>
Signed-off-by: fujial <[email protected]>
Signed-off-by: fujial <[email protected]>
bd88c7a to
01005ab
Compare
|
/ok to test 01005ab |
Signed-off-by: fujial <[email protected]>
|
/ok to test 445a4e7 |
What does this PR do?
Enables dynamic batching for the Automodel (DTensor/FSDP2) PPO value-model path and makes fresh Hugging Face value-head initialization deterministic across Ray value-worker launches.
Dynamic batching was temporarily disabled after #2953 reported a substantially higher critic loss at the beginning of training. The investigation found two separate concerns:
Issues
Closes #2953
Summary of Changes
value.dynamic_batching.enabled=truewith the Automodel value backend.-dynbatch, explicitly enable value dynamic batching in the recipe, and update the PPO guide and nightly manifest.The Megatron value-model runtime behavior is unchanged.
What the equivalence tests cover
The pinned-weight test compares the deterministic value training signal across dynamic batching OFF and ON:
It compares aggregated
loss,values_mean,returns_mean, andresidual_sq_mean. Metrics are reduced to microbatch-order-independent scalars because dynamic batching can change the number and ordering of microbatches. The test useseval_mode=Trueso dropout masks do not confound the execution-path comparison.The separate fresh-initialization test deliberately does not share weights. Matching valid-token values confirm that the PPO seed reaches both Ray value workers before the regression head is constructed, while the elementwise comparison also covers restoration to the original sample order on the value-inference path.
Validation
Ran a 100-step pinned PPO comparison with:
Results:
train/critic/lossfollows the same decay and convergence behavior.train/rewardfollows the same learning trajectory.0.90reward by step 100.Remaining scope
The remaining vLLM 0.25 critic-fit and gradient-norm investigation is tracked in #3412 and is outside this PR. The comparison above deliberately uses the same checkpoint and matched configuration, so it isolates dynamic batching from value-head initialization.
Critic Loss
Reward
These results support removing the temporary Automodel value dynamic-batching guard.