Repository navigation
Conversation
…ly when a rollout has none left Since #3351 one failed judge comparison (no completed answer, judge HTTP error or request deadline) fails the whole cohort, so all of its rollouts are masked even when every other comparison succeeded. With 16 rollouts and a long judge answer, one comparison that exhausts max_output_tokens on both attempts discards 15 good comparisons. Drop each comparison that raises a JudgeError and score every rollout from the comparisons it has left; nothing is masked per rollout. As soon as a rollout has no comparison left that could succeed, fail the cohort as a judge failure exactly as before (every member masked through the judge failsafe) and cancel the comparisons still running, so an outage still ends the group early. Under circular comparisons only two adjacent failures leave a rollout uncovered. Non-judge errors still fail the group with 503, malformed completed answers keep the default-score fallback, and cohort_evaluation_timeout_s still bounds the group. The fixed-baseline path and /compare follow the same rule; /compare leaves dropped comparisons out of comparison_results. There is no configuration key. Report genrm_failed_comparison_rate_per_group and log each drop. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test f6d207d |
…_pairs - Log a dropped comparison when it fails, not after the loop. A later failure, a non-judge error or the group deadline can end the group first, and the group error carries only the last failure's text. - README: a connection error or a non-JSON judge reply is dropped too. A request deadline drops a comparison only if it fires before the group deadline, and by default the group deadline fires first. HTTP 503 applies to /verify. - README: name the position effect of a dropped circular comparison. - Test all_pairs, where each rollout has three comparisons, and test that an earlier failure is logged when the group fails. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test a66283d |
…comparison A failed judge comparison is still dropped. A rollout whose comparisons all failed is now masked alone through the judge failsafe (reward 0.0, mask_sample, failure_kind judge_failed), and its siblings keep their scores. Before, it failed the whole group. The masked rollout is left out of the group's length and style adjustments. When every rollout is left uncovered, the whole group fails as a judge failure, as before. - The server now waits for every comparison to finish or fail, within cohort_evaluation_timeout_s. A non-judge error still fails the group at once and cancels the comparisons still running. - The fixed_baseline path follows the same rule. /compare has no per-response mask, so it still returns 503 when a response keeps no comparison. - Checkpoints save and restore a member masked alone (masked_alone). - New metric: genrm_masked_rollout_rate_per_group. The masked rollout's reward is a placeholder, so a trainer must keep it out of the group statistics: in NeMo RL, grpo.masked_reward_policy exclude_infra (NVIDIA-NeMo/RL#4968) or exclude. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test d94066c |
A failed judge comparison now masks its two rollouts, and every other rollout is scored from all of its comparisons. Before, the two rollouts were scored from their remaining comparison. In a group-relative trainer that mixed rewards averaged over two comparisons with rewards from one, and a judge that favors one position moved the two scores in opposite directions. - A masked rollout's successful comparisons still score its neighbors. The group's length and style adjustments see only the scored rollouts. - The same rule covers all_pairs, several judge passes and the fixed_baseline path: a rollout with any failed comparison or pass is masked. The whole group fails only when every rollout is masked. - /compare has no per-response mask, so any failed comparison returns 503 there, as on main. - The masked-member reason now reads "GenRM rollout_index=N lost a comparison to a judge failure (k of n comparisons failed): ...". Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test 6aeff06 |
There was a problem hiding this comment.
Thanks for working on this, @yfw! I left one inline comment about returning promptly after a judge failure in /compare.
I also have an earlier performance PR, #3625, that touches some of the same scoring and checkpoint code. It already incorporates main’s newer failure reporting, so I’d recommend landing that first, then rebasing this PR and rechecking the combined changes. I think that would make the overlap easier to reconcile.
Would that order work for you, or would you prefer a different approach? Happy to coordinate. We’d still keep NVIDIA-NeMo/RL#4968 ahead of this PR, as you’ve documented.
…ed-comparisons Main added failure reports (#5072 and its follow-ups), which reach the same GenRM code. The conflicts kept both sides: masked_alone next to failure_report in the saved member state, member_failures next to failure_report when a cohort is published, and the cohort failure next to the restored report. A member masked alone now fails with its failed comparison's Gym failure as its cause, as a failed group does. The cohort's report keeps that failure, so the cause survives a checkpoint restore: the member's saved report names it, and the restore clears it for the cohort. When every member is masked, the group's JudgeError is caused by the first failed comparison. Tests: main's one_failed report test now expects two masked rows and two scored ones; the masked-alone restore test uses main's export signature and checks the restored report. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
/compare has no per-response mask, so it cannot use a partial result. Since this PR, it waited for every comparison before it failed the request, so one quick judge failure and one slow judge call delayed the 503 until the slow call finished, with no group deadline. Now its first failed comparison is raised at once and the comparisons still running are cancelled, as before this PR. /verify still waits for every comparison and masks only the members of a failed one. The regression test has one failing and one blocked judge call. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
@yuhezhang-ai Thanks for the review. Landing #3625 first works for me, and NVIDIA-NeMo/RL#4968 still goes before this PR. I checked the overlap at the new head. I merged
The |
|
/ok to test 5bf85a5 |
|
@yfw Thanks for catching the missing checkpoint IDs. Fixed in #3625 at I reproduced all 13 failures, then updated the nine export call sites to pass Agreed on the order: #3625 lands before #5330, and NVIDIA-NeMo/RL#4968 must also land before #5330. The merge here preserves the digest-scheme check and each member's saved scheme for the two overlap points you identified. Please merge main and rerun the combined suite once #3625 lands; your 400-test trial remains separate from this validation. |
…ed-comparisons Brings in #3625 (response compaction and retention) and #6337 (per-request length coefficients). Four conflict blocks in genrm_compare/app.py, each resolved by keeping both sides: - typing imports: the union of both lists. - verify: main's digest-scheme check runs first, then this branch's rule that a member masked alone gets its recorded failure even for a regenerated answer. - verify: a completed cohort still answers through _completed_member_response, so a member masked alone gets its judge failure. - _finished_member_state: the member's own digest scheme from main, next to the member's own failure report from this branch. Two more changes keep the merged code working: - _aggregate_results takes main's length_coefficients keyword and passes it to _score_results, so the per-request coefficients apply over the scored members. Without it, every /verify group failed with a TypeError. - main's saved-coefficient check reads cohort.results with .get: a member masked alone has no saved result, so it has no recorded coefficients. Without it, a replay of a masked member raised KeyError. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test 91fe22c |
|
@yuhezhang-ai Thanks for fixing the checkpoint IDs. #3625 has landed, so I merged The four conflict blocks in Two more changes were needed, because #6337 does not conflict with this PR in text but does in behavior:
Combined suite on the merged tree: all 414 tests pass ( |
…placeholder A masked member's reward is the judge-failure placeholder. It is 0.0 on main today; once Gym #6675 and #6673 land it is the server's judge_failure_reward(), which for genrm_compare is default_score (3.0 by default). The README now says this in the failsafe paragraph, the Masking bullet and the consumer note. The failed-comparison /run test also checks that each masked member carries the server's placeholder: judge_failure_reward() where the server has it, else 0.0, so the test holds in either merge order. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test 3bc59ad |
…der_reward() and the exclude_infra default #6675 renamed the hook judge_failure_reward() to judge_failure_placeholder_reward(). The lifecycle test reads the hook by name, so it now looks up the new name, and the README names it too. NVIDIA-NeMo/RL#4968 makes masked_reward_policy: exclude_infra the default. The README said that include is the default and that exclude is the setting to choose. It now says that the default exclude_infra keeps a judge-failure row out of the group baseline, and that include is an explicit choice that counts the placeholder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test eaa24cc |
yuhezhang-ai
left a comment
There was a problem hiding this comment.
Two nonblocking README documentation clarifications.
| siblings. Also keep `env.should_mask_flagged_samples` on, its default. With it off, NeMo RL trains the | ||
| masked members on their placeholder rewards. | ||
| - **Reporting:** | ||
| - `/verify` reports `genrm_failed_comparison_rate_per_group` and `genrm_masked_rollout_rate_per_group` on |
There was a problem hiding this comment.
Please document that run-level means of these group-rate fields are weighted by surviving scored rows and exclude fully masked groups. Point readers to group summaries and failure counts when estimating overall masking.
| not enable individual judge-only reverification: reconstructing and retrying a full group remains the | ||
| caller's responsibility. The batch `/compare` endpoint returns HTTP 503 for judge failures. | ||
| A late request to a retained failed explicit-ID group, or to a member masked alone in a retained completed | ||
| group, receives its recorded failure, even if it contains a regenerated answer. To judge again, advance the |
There was a problem hiding this comment.
Please qualify the checkpoint section’s changed-answer and slot-conflict wording. A restored masked_alone member intentionally replays its saved judge failure for a regenerated answer; scored members still reject changed answers.
yuhezhang-ai
left a comment
There was a problem hiding this comment.
The earlier /compare concern is addressed, and NVIDIA-NeMo/RL#4968 has merged. The two README suggestions are nonblocking. Looks good to me.
…ed-comparisons Brings in #6675 (a server chooses the placeholder reward of a judge failure) and #6673 (genrm_compare's placeholder is default_score, 3.0). One conflict block, in genrm_compare/README.md: this branch said the placeholder is 0.0 until #6675 and #6673 land, and main said it is default_score. Both have landed, so the sentence now names the server's judge_failure_placeholder_reward() and its value for this server, default_score (3.0 by default). One more change: test_failed_comparisons_through_run no longer falls back to 0.0 when the server has no judge_failure_placeholder_reward(). Main has the hook, and assert_judge_failure already checks that each masked member carries 3.0. No silent clash in app.py: a member masked alone raises JudgeError with the default judge_failed kind, which main's judge_failsafe keeps, and /verify now gives it default_score as its placeholder reward. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
…mber's changed answer Two README requests from the review: - Only scored members carry genrm_failed_comparison_rate_per_group and genrm_masked_rollout_rate_per_group. A run-level mean of either field therefore weights each group by its scored members and leaves out groups whose members were all masked. The README now says so and points to the per-group rows of <rollouts>_reward_profiling.jsonl and the judge_failed rows in the failures sidecar for the run's overall masking. - The checkpoint section said that a changed answer is refused and that a member started over from its input gets a conflicting response. That holds for scored members. A restored member masked alone answers a changed answer with its saved judge failure, on purpose, like a failed group's members. The checkpoint section and the transport retry list now say so. test_members_masked_alone_get_their_judge_failure_back_after_a_restore now also sends a changed answer after the restore: the member masked alone gets its judge failure, and a scored member gets 409. Without the masked-alone rule in verify, the check fails. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test 8dfd937 |
yuhezhang-ai
left a comment
There was a problem hiding this comment.
Thanks, both README requests are addressed, and the new checkpoint assertions cover regenerated answers. I rechecked the main merge, /compare cancellation, and masked replies with the updated placeholder. Looks good to me.
What does this PR do?
Since #3351, one failed judge comparison fails the whole cohort. A failed comparison is one with no completed answer, or a judge HTTP request that fails (an HTTP error, a connection error or a reply that is not JSON, after any retries). All of the cohort's rollouts are then masked, even when every other comparison succeeded. With 16 rollouts and a long judge answer, one comparison that exhausts
max_output_tokenson both attempts discards 15 good comparisons.This PR masks only the two rollouts of a failed comparison, and scores every other rollout from all of its comparisons. There is no new configuration key.
JudgeErrorare masked throughjudge_failsafe(the server's placeholder reward,mask_sample,failure_kind: judge_failed). Undercircular, one failed comparison (5, 6) masks rollouts 5 and 6, not all 16. Underall_pairs, or with several judge passes, a rollout with any failed comparison is masked.cohort_evaluation_timeout_s./verifygroup with HTTP 503 at once, and cancels the comparisons still running.cohort_evaluation_timeout_sstill bounds the group. Ajudge_request_timeout_sexpiry fails a comparison only if it comes before that deadline; both default to 1,800 seconds, so by default the group deadline fires first and the group fails./comparehas no per-response mask, so its first failed comparison still returns 503 at once and cancels the comparisons still running.fixed_baselinepath follows the same rule: a rollout with a failed judge pass against the baseline is masked.masked_alonein its saved state); its siblings replay their rewards.--resumethat reruns a masked row records it as masked again, instead of getting HTTP 409 and stopping the collection.group_answer_length_penalty_coeffandgroup_reasoning_length_penalty_coeffapply over the scored rollouts only, like the other group adjustments. A member masked alone has no saved result, so a replay with the group's overrides gets its recorded judge failure, not the 409 for a saved result without the requested pair.genrm_failed_comparison_rate_per_groupandgenrm_masked_rollout_rate_per_groupmetrics. Each failed comparison is logged when it fails, and each masked rollout is logged with its reason.circular, the comparison that is left also shows one rollout only asresponse_1and the other only asresponse_2, so a judge that favors one position moves their scores in opposite directions.Consumer requirement. A masked rollout carries a placeholder reward, not a GenRM score: the server's
judge_failure_placeholder_reward()(#6675), which for this server isdefault_score(3.0 by default, #6673). It must stay out of the group's baseline and normalization, or it shifts its siblings' advantages. NeMo RL's defaultgrpo.masked_reward_policy: exclude_infra(NVIDIA-NeMo/RL#4968) keeps it out, becausejudge_failedis not a policy failure kind, and so doesexclude.includeis an explicit choice that counts the placeholder. For example, underinclude: 16 rollouts, comparison (5, 6) fails, and the other 14 average 3.4. With the placeholder of 3.0 the group mean is 3.35, which moves every scored rollout's advantage, before the division by the std, up by 0.05. A placeholder of 0.0, the failsafe's default for other servers, would give a mean of 2.98 and a shift of 0.43. Underexclude_infrathere is no shift. NeMo RL also needsenv.should_mask_flagged_sampleson, its default. With it off, NeMo RL trains the masked rows on their placeholder rewards.Validation
Against the final diff at
8dfd93722(merged withmainat10b2317a9, after #6675 and #6673), Python 3.13.14:Earlier heads: at
91fe22c21(merged withmainat1883e257f, after #3625 and #6337),3bc59ad24andeaa24ccd86,gym env testfor genrm_compare gave 414 passed. The merge ofmainafter #6675 and #6673 had one conflict, the README's placeholder sentence.New tests in
tests/test_failed_comparisons.py,tests/test_checkpoint.pyandtests/test_http_lifecycle.py:all_pairs: one failed pair masks its two rollouts, and the other two are scored from all three comparisons; when every rollout is masked, the group fails./compare: with one failing and one blocked judge call, the request returns 503 at once, and the blocked call is cancelled./verify.main's failure-report test through collection: one failed comparison now gives two masked rows and two scored rows, and each masked row's report has the judge failure in its cause chain./runand the failsafe, 16 rollouts: one failed comparison, and two adjacent failures, mask exactly their rollouts withjudge_failed; the other rollouts return their rewards. Each masked row carries the server's placeholder,default_score(3.0).main's server code, 15 of these 20 test cases fail. The other 5 cover behaviour that does not change, including the/comparecase.Rollouts
This PR's arm ran at
6aeff06e4. The next commit,9ee859305, changes only the reply to a regenerated answer for a masked member, the reason text when every rollout is masked, docs and tests; scoring and masking are the same. The later merges ofmainand the/comparefix do not change how/verifyscores or masks rollouts. Themainarm ran at5911d628c(the base of this PR) in an earlier run, with the same judge, policy, data and settings.Setup
nvidia/Qwen3-Nemotron-235B-A22B-GenRM, served by vLLM 0.27.1 with tensor parallel size 4 on one GB200 node.Qwen/Qwen3.5-4Bwith thinking off, served by vLLM on one GPU of a second node.resources_servers/genrm_compare/data/example.jsonl. Each run holds one task with a new_ng_group_id, so it makes one 16-rollout circular group.genrm_comparesettings, with two changes that cause real judge failures:genrm_responses_create_params.max_output_tokens: 1341. We first ran 16 judge comparisons with a 16,384-token budget. The answers were 531 to 2,981 tokens long, and 1,341 is their 55th percentile. So some answers run out of budget before the verdict.genrm_parse_retries: 1, so each comparison gets 2 attempts.Commands. Each arm starts its servers once, and they stay up for all 4 tasks.
genrm_5330_run.yaml
genrm_compare_resources_serverandgenrm_simple_agentare the same as inconfigs/genrm_compare.yaml, withmax_output_tokens: ${genrm_max_output_tokens}. The two model servers point at the external vLLM servers:Results (one 16-rollout group per task and arm)
6aeff06e4)main(5911d628c)"Rates" are
genrm_failed_comparison_rate_per_groupandgenrm_masked_rollout_rate_per_group, as reported on each scored row.This PR scored 48 of the 64 rollouts, and
mainscored 16. On this PR, the masked rollouts are exactly the rollouts of the failed comparisons, and no group failed as a whole. On both arms, every masked row hasmask_sample: true,failure_kind: judge_failedand reward 0.0 (the failsafe's placeholder before #6673), and lands in the collector's_failures.jsonlsidecar.The two arms ran separately, and each sampled its own policy and judge answers. Tasks 1, 3 and 4 had failed comparisons on both arms, but not the same ones. On
main, a group fails at its first failed comparison, so its log shows one failed comparison per masked group.Server log lines
This PR, task 4 (one failed comparison, two rollouts masked):
main, task 1 (one failed comparison, group failed):Compatibility and benchmark impact
exclude_infra(feat(grpo): add exclude_infra masked-reward policy for infra-masked rollouts RL#4968) andexcludekeep it out. A recipe that setsincludecounts it./compare. Unchanged: its first failed comparison returns 503 at once./verify, andmasked_alonein a checkpointed member's state.Checklist
resources_servers/genrm_compare/README.md).pre-commit run --all-files).git commit -s).🤖 Generated with Claude Code