Repository navigation
fix(megatron): compact actor logits before projection - #2310
liuhao-labs wants to merge 1 commit into
Conversation
|
CPU/pre-commit CI is green (58 successful checks). Could a maintainer add |
1a71617 to
1a2a046
Compare
|
Rebased this PR onto the latest Local validation is still green: the focused CPU suite passes ( |
97a3f17 to
f3367c0
Compare
|
Rebased onto the current v0.4 mainline and resolved the provider-test conflict, retaining the upstream MLA compatibility coverage. The compact path now falls back for score centering, MuP scaling, and custom Megatron output processors, with focused regression tests. The upstream isolated checkpoint/optimizer fixture was also updated for the new schedule context. Local validation: 117 CPU tests plus 12 checkpoint/optimizer tests passed, and the direct compact-model runner has 35 passes. The full refreshed PR Test run is green with 90 successful jobs and no failures; pre-commit also passed. Could a maintainer please add |
f3367c0 to
26a8b9f
Compare
|
Rechecked and synchronized with main The new upstream critic tests needed import stubs for the existing MLA module and this PR's compact module. Their fixture now also fails if a critic provider attempts actor-compaction eligibility, and the file is registered in the permanent CPU matrix. Local related coverage is The refreshed PR Test run completed successfully: 91 successful jobs, 7 conditional skips, 0 failures, including the new critic job. Pre-commit passed. Real TP=2/NCCL parity remains pending the previously requested GPU CI authorization; these CPU results do not replace it. |
Signed-off-by: Hao Liu <liuaho6@gmail.com>
26a8b9f to
ddfff56
Compare
|
Resolved the #2457 conflict against main Added compact/full top-p replay output and gradient parity to the existing response-span tests. Local validation: 134 related CPU tests, 82 single-process score-centering tests (including the nine new centered-scalar regressions), and 18 non-disk distributed score-centering gradient tests passed. This does not replace the pending real TP=2/NCCL test. The new PR Test run completed successfully with 101 successful jobs and 7 conditional skips; pre-commit also passed. The workflow template/YAML preserve the Sunabako 8-GPU/35-minute E2E, container lifecycle/proxy/cache setup and evidence artifacts, plus this PR's critic and compact CPU registrations. The PR is mergeable again. The previously recorded GPU authorization dependency is unchanged. |
Summary
Long masked prompts still produce full
[T, V]vocabulary logits before Slime selects trainable tokens, causing the projection and fp32 conversion peaks in #2253. Add opt-in--compact-actor-logitsto project only theNloss-masked rows for eligible built-in actor policy/SFT paths.A Slime-owned
CompactLogitsGPTModelis selected only for eligible actor post-process chunks. Log-probability/entropy computation accepts[N, V], builds compact top-p masks, and scatters scalar results back to the existing response/CP layout. Empty masks retain zero-gradient connections.Critics, custom providers/hooks/losses, MTP, TIS/mismatch metrics, debug capture, rollout log-probs, PPO reward-KL, score centering, MuP scaling, and custom Megatron output processors preserve the full-logit path. The optimization is disabled by default and can be enabled with
--compact-actor-logitsfor eligible built-in paths.Normal forward and combined 1F1B both resolve the model's
_postprocessmethod dynamically. The context covers the pipeline schedule call. Model state-dict keys and checkpoint ownership are unchanged.Fixes #2253.
Validation
58b08786, covering compact model dispatch, provider ownership, VLM/plain critic isolation, compact/full loss and gradient parity with and without top-p replay, top-p/reference handling, empty masks, vocab-parallel log-probability/entropy, and import-time collective rebinding.train_one_stepfixture. The newtest_model_provider_critic.pyfixture is compatible with the actor-only compact import and is registered in the permanent CPU CI matrix.git diff --checkpassed.tests/test_ppo_logprob_entropy_gpu.pycompares selected logits plus hidden/output-weight gradients with sequence parallel off/on. All 13 CUDA cases are skipped on this CPU-only local Python environment and still require the self-hosted GPU job.4b4acac9was audited for the actualPostProcessNodecall. Full CUDA scheduler integration is not claimed as locally tested.straw-queuewheel.