Repository navigation
Conversation
| TRUNCATED: truncated, | ||
| "total_reward": total_reward, | ||
| _VIOLATION_COUNTS_KEY: violation_counts, | ||
| **_reward_component_columns(completions), |
There was a problem hiding this comment.
C1 · 1 action item (stale error message; not a correctness bug). TL;DR: after this PR the SC payload writes reward/<name> columns, so the GDPO rejection in config.py now gives the wrong reason.
This line adds the per-component columns. The GDPO guard at config.py#L1510-L1522 still says:
the SC payload writes only total_reward
The rejection itself is still right. The advantage stage fetches only input_fields(), and repeated_batch_fields is empty, so it never reads reward/*. Only the stated reason is out of date.
AI-1
In config.py#L1510-L1522, change the comment and the message to the reason that still holds. This is not a suggestion block because the target lines are outside this PR's diff.
# Rejected here rather than at the first advantage call, which is a whole
# round of rollouts and logprobs later: the payload writes reward/<name>
# columns, but AdvantageConfig.repeated_batch_fields is never populated,
# so the advantage stage does not fetch them.
if algo_cfg.adv_estimator.name == "gdpo":
raise NotImplementedError(
"adv_estimator 'gdpo' is not supported on the SingleController "
"path. The advantage stage does not fetch the per-component reward "
"columns (reward/<name>), so the first advantage call would raise "
"'GDPO requires multiple reward components' after the run had "
"already paid for a full step of rollouts. Set adv_estimator.name "
"to 'grpo'."
)There was a problem hiding this comment.
Fixed in 9077840. The comment and the message in config.py now give the reason that still holds: the advantage stage does not fetch the reward/<name> columns.
eaa647a to
9077840
Compare
|
/ok to test 9077840 |
9077840 to
0d1a9a7
Compare
|
/ok to test 0d1a9a7 |
0d1a9a7 to
729b7a2
Compare
|
/ok to test 729b7a2 |
AsyncRolloutImpl accumulates a dict of rewards per component, keeps their sum as the completion reward, and the rollout payload writes one reward/<name> column per component. Signed-off-by: bg51717 <[email protected]>
729b7a2 to
6419ed9
Compare
|
/ok to test 6419ed9 |
RayenTian
left a comment
There was a problem hiding this comment.
LGTM. Would you please rebase main and solve conflicts?
What does this PR do ?
Lets the SingleController path roll out native environments that return several named rewards per turn (for example
math_multi_reward), instead of failing an assertion on the first step.AsyncRolloutImplaccumulates each reward component across turns. The completion'srewardis the sum of the components, as on the legacy path.Completiongainsreward_components; it isNonefor a single-reward environment.reward/<name>column per component next tototal_reward. It rejects a prompt group whose completions disagree on the component names, and component names that do not start withreward/.Single-reward environments are unchanged.
Issues
Part of the "GDPO / component-wise reward advantages" item in #5044.
Before your PR is "Ready for review"
Pre checks:
Additional Information
grpo_dp_single_controller.sh(native, single reward) andgrpo_async_gym_single_controller.sh(Gym, token capture off).math_multi_rewardon GSM8K (Qwen2.5-1.5B-Instruct, 8 prompts x 8 generations, 10 steps): completes, and the maximumtotal_rewardis 3.0 at every step, which only the sum of the three components can reach.