fix: add group_id to StartSessionRequest for online GRPO session grouping#1392
fix: add group_id to StartSessionRequest for online GRPO session grouping#1392Oxygen56 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for passing a pre-declared group_id in StartSessionRequest to ensure concurrent requests in online mode are routed to distinct workers. Feedback on the changes points out a misleading comment in workflow.py where a comment about group_id was added inside the payload dictionary, but the parameter is neither accepted by _start_session nor actually included in the payload. It is recommended to either update _start_session to accept and forward group_id or remove the comment.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Oxygen56
left a comment
There was a problem hiding this comment.
Good catch — the original commit only added a comment about group_id but didn't actually wire it through. Fixed in 51d20a3:
_start_sessionnow accepts an optionalgroup_id: str | None = Noneparameter- When provided,
group_idis included in the POST payload to the data proxy - Replaced the misleading inline comment with a proper docstring
The data proxy side was already updated (in the original commit) to accept and reuse a caller-provided group_id in StartSessionRequest.
|
LGTM,Thanks for your contribute! Please run 'pre-commit' before submit. |
|
Ran
The code-relevant formatting hooks are all green. Thanks for the review! |
|
It looks good to me. Thank you for your contribution! |
|
@TaoZex Thanks for the review! Here's the correctness verification:
The fix is purely additive — all existing callers pass |
|
This pull request has been automatically marked as stale because it has not had recent activity within the last 14 days. Please add a comment or push new commits to keep it active. Thank you for your contribution! |
Add an optional group_id to StartSessionRequest and forward it through the inference service workflow so concurrent online GRPO requests can declare the same group while still being routed as distinct sessions. Fixes areal-project#1304
51d20a3 to
aaeefad
Compare
|
Rebased this PR onto current Validation run locally:
|
|
This pull request has been automatically marked as stale because it has not had recent activity within the last 14 days. Please add a comment or push new commits to keep it active. Thank you for your contribution! |

What
Fixes #1304 — In online RL mode with
group_size > 1, GRPO advantage normalization was silently wrong because unrelated user conversations were merged into the same group.Root Cause
GroupedRolloutWorkflow.arun_episodecalls_start_sessionN times in parallel forgroup_size=N. Each call generates a randomgroup_id, so N unrelated external sessions get merged into one GRPO group — makingA_i = (r_i - mean(r_group)) / std(r_group)mathematically invalid.Fix
Adds optional
group_idfield toStartSessionRequest:group_id, it is reused (enabling grouped routing)group_id=Nonebehaves exactly as beforeThis is the infrastructure fix. The controller-side changes for full grouped-online support build on this.
Files Changed
data_proxy/session.py— Addgroup_idtoStartSessionRequestdata_proxy/app.py— Reuse caller-providedgroup_idcontroller/workflow.py— Docs and payload update