feat: judge cohort hardening - #2385
Conversation
|
/ok to test ddfa0e2 |
|
/claude review |
1 similar comment
|
/claude review |
|
SHIP WITH CARE This fixes a real deadlock: previously a cohort whose peer sub-request died upstream of One thing to settle before this drives a real run, raised inline:
No async-HTTP, |
|
|
||
| reward = await future | ||
| return BaseVerifyResponse( | ||
| self._resolve_cohort(stale_buf, *(stale_jit or ([], [])), cause="cohort_timeout") |
There was a problem hiding this comment.
RISK — partial-cohort timeout produces real (skewed) relative rewards, gated only by a field nobody may read.
WHAT: On timeout with ≥2 arrivals, _resolve_cohort(..., cause="cohort_timeout") aggregates the partial cohort and returns genuine per-rollout rewards, differing only from a full cohort in that failure_reason="cohort_timeout" is set on the response. aggregate_scores computes rewards relative to the cohort, so a 3/4 cohort yields a different reward distribution than the intended 4/4.
BLAST RADIUS: These rewards feed the training signal. If the downstream consumer (rollout collection / trainer) does not inspect GenRMCompareVerifyResponse.failure_reason, timed-out partial cohorts silently contribute miscalibrated relative rewards to RLHF — the exact silent-scoring-corruption failure mode. failure_reason is a brand-new field; nothing in this diff consumes it.
FIX: Confirm the training/eval consumer explicitly drops or down-weights rows where failure_reason is non-null (at minimum cohort_timeout/aggregation_failed/no_comparisons). If no consumer gates on it, the safer default here is to return default_score for timed-out partial cohorts rather than a partial relative reward. This is still strictly better than the prior infinite deadlock — flagging so the gating is a deliberate decision, not implicit.
There was a problem hiding this comment.
Thank you Claude, I appreciate the review.
This is intended.
If this is a concern to the maintainers of this repository, I will start a conversation with the training team and discuss this topic further.
ddfa0e2 to
4c7cc9b
Compare
4c7cc9b to
c01dd24
Compare
c01dd24 to
bb858c2
Compare
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
bb858c2 to
fc8a43b
Compare
|
#3181 now owns incomplete GenRM cohort behavior. This PR can proceed independently on timeout and cleanup, but its final policy must reconcile expected, arrived, missing, retried, and late members and must not turn partial membership into an unmarked ordinary reward. Persistence integration follows #2135/#3179; please link the PR to #3181 and resolve the blocked checks. |
A judge model will judge an entire GRPO group (labeled as
cohortin the Gym code) at once.This means that it must wait for all related episodes to finish.
Frequently, all related episodes are unable to finish. Commonly there will be at least 1 eternal hang within each cohort.
This PR introduces a timeout argument that causes the judge to stop waiting beyond a certain point.
If, at that point, there is a partial cohort (more than 1 episode) available, the judge will judge the partial cohort.
If not, the cohort will fail.
Regardless, this presents infinite hangs on the cohorts.