Repository navigation
refactor: use the shared zero-variance check for native Tinker advantages - #1122
Open
bradhilton wants to merge 1 commit into
Open
bradhilton wants to merge 1 commit into
bradhilton wants to merge 1 commit into
Conversation
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.
Agent: Tarkin
Problem: #1115 inlined the equal-reward check (
abs(reward - rewards[0]) <= 1e-12) intinker_native, because #1118's sharedrewards_have_zero_variancehelper hadn't merged yet.Behavior after this change:
compute_advantagescallsart.utils.grpo.rewards_have_zero_variance, so tokenization, the pipeline trainer, the trainable-group metric andtinker_nativeall use one definition of an equal-reward group. Behavior is unchanged: same tolerance and the same handling of single-reward groups.Validation:
tests/unit/test_tinker_native_advantages.pypasses (12 tests); ruff and ruff-format pass.