[training_utils, env, doc] feat: use Liger fused linear PPO kernel - #7461
Open
kolehma8 wants to merge 1 commit into
Open
[training_utils, env, doc] feat: use Liger fused linear PPO kernel#7461kolehma8 wants to merge 1 commit into
kolehma8 wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
jkolehma seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Closes #7424.
Replaces verl's experimental fused linear PPO output-head implementation with Liger Kernel v0.8.2's
LigerFusedLinearScaledCrossEntropyFunctionwhen Liger is installed. The wrapper preserves log-probability sign, entropy output, 2D/3D shapes, and gradients; without Liger it keeps the existing chunkedFusedLinearForPPOFunctionunchanged.This does not duplicate an existing PR: searches for issue-linked and fused-linear-PPO work found no open implementation PR.
AI assistance: GitHub Copilot CLI assisted with implementation, testing, benchmark automation, and PR drafting. The human submitter reviewed every changed line and supervised all validation.
Checklist Before Starting
[{modules}] {type}: {description}.Test
python -m pytest -q tests/utils/test_experimental_torch_functional_on_cpu.py— 4 passed.python -m pre_commit run --all-files --show-diff-on-failure --color=always— all hooks passed.uv lock --check --python 3.12— 337 packages resolved; lock is current.Four-seed actor update performance
Liger reduced actor update time/token on every seed.
Four-seed peak memory
Liger reduced actor allocated memory by 5.56% and physical peak memory by 4.64% versus the existing verl fused baseline.
Four-seed reward behavior
The paired Liger-minus-Verl final-reward difference was -0.0141 with a 95% CI of [-0.0494, 0.0213]. The interval crosses zero, so these four seeds do not resolve a reward regression; both methods converge to the same reward range.
Benchmark Figures
Figures are attached below and are intentionally not committed to the repository.
Actor update time/token across seeds
GSM8K reward across seeds
Peak GPU memory across seeds
API and Usage Example
No configuration change is required for existing fused-kernel users:
With
liger-kernel>=0.8.2, the torch backend uses Liger fused scaled linear cross entropy. If Liger is absent, it uses verl's existing chunked fallback.Design & Code Changes
chunk_sizebehavior as the no-Liger fallback.liger-kernel>=0.8.2in setup, development, FSDP, and Megatron dependency manifests; regenerateuv.lock.Checklist Before Submitting
pre-commit run --all-files --show-diff-on-failure --color=always.tests/utils/test_experimental_torch_functional_on_cpu.pyfollows the CPU CI naming convention.ci-requestchannel in the verl Slack workspace.recipesubmodule, update its reference. Not applicable; this PR does not changerecipe.