Repository navigation
fix(verl): reject non-finite and overflowing outcome rewards - #702
Open
Ovi Poddar (Ovi-Poddar) wants to merge 1 commit into
Open
Ovi Poddar (Ovi-Poddar) wants to merge 1 commit into
Ovi Poddar (Ovi-Poddar) wants to merge 1 commit into
Conversation
Fail with the rollout ID before invalid outcome rewards reach float32 training scores. Preserve finite validation metrics and configured missing-reward fallback behavior.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues blocking the reward-validation changes.
No open issues 🎉
What changed in this PR
This PR prevents invalid outcome rewards from entering the verl training adapter’s float32 score tensors while preserving large finite rewards in validation metrics.
Changes:
- Reject non-finite rewards and missing-reward fallbacks, with errors identifying the rollout.
- Reject training rewards outside the finite float32 range before conversion.
- Add regression coverage and document the validation rules and their limits.
| File | Description |
|---|---|
tests/verl/test_reward_range.py |
Tests invalid rewards, finite boundaries, fallbacks, and the event API-to-training path. |
docs/20-trainer-configuration.md |
Documents reward constraints and distinguishes training from validation behavior. |
agentlightning/verl/rollout_adapter.py |
Adds shared finiteness checks and training-only float32 range checks. |
Review effort: Balanced
Author
|
@microsoft-github-policy-service agree |
This branch has not been deployed
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.
Summary
A finite JSON reward such as
1e40survives event storage and rollout conversion, then becomes infinity when the training adapter creates float32 outcome scores. The training reward metric still reports the finite original value, making the invalid training tensor easy to miss.Reject non-finite rewards and fallbacks with the rollout ID, and reject out-of-range training rewards before their float32 conversion. Preserve valid rewards and configured finite fallbacks. Validation metrics remain float64 and accept large finite rewards that do not undergo the training cast.
Reproduction
On main
bc3a9e80417d731744040df5d37117f9cc48005f, a CPU reproduction through the real local event API, rollout manager and training adapter produced:The new public-API regression pins this path and checks that the error names the affected rollout.
Verification
No model inference, GPU training or learning-gain experiment was performed. The guard prevents invalid score inputs; it does not guarantee finite arithmetic throughout optimization. Invalid rewards raise rather than being silently clipped or replaced by zero.
AI assistance
Codex investigated the code, prepared the patch and regression tests, and ran the listed checks. No independent human review is claimed.