Repository navigation
Conversation
The RolloutImportanceSampling docstring described every threshold as a (lower, upper) pair and its example used (0.8, 1.2), which trips the upper > lower assertion in compute_rollout_importance_weights. It also described the veto as rejecting a rollout group, while it drops single sequences.
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.
Root Cause
The
RolloutImportanceSamplingdocstring describesrollout_is_threshold,rollout_is_mask_thresholdandrollout_is_veto_thresholdas(lower, upper)pairs.compute_rollout_importance_weightsactually unpacks them asupper, lower = thresholdand assertsupper > lower, so the documented examplerollout_is_threshold=(0.8, 1.2)fails on the first training step withAssertionError: upper_threshold must be greater than lower_threshold. The docstring also says the veto rejects "a rollout group", but the veto mask is per sequence: a sequence with any token outside the veto thresholds is dropped, and the other sequences are kept.Fix
This is a documentation-only change; behavior is unchanged.
(upper, lower), and document thatNonedisables IS, that aNonemask threshold falls back torollout_is_threshold, and that aNoneveto threshold disables the veto.levelvalues (token/sequence/geometric) andmodevalues (truncate/mask/both).(1.2, 0.8).Test Plan
New file
tests/loss/test_rollout_is_thresholds.py:[0.8, 1.2].(lower, upper)pair is rejected.pytest tests/loss/test_rollout_is_thresholds.py tests/loss/test_rollout_is_out_of_place.pypasses on CPU, andruff check/ruff format --checkare clean.ProduceBatchResult impact: not affected (docstring and tests only).