Skip to content

feat: add AsyncRolloutManager for native async per-prompt rollouts - #2566

Merged
terrykong merged 12 commits into
mainfrom
yukih/per-prompt-rollout-native-async
Jun 9, 2026
Merged

terrykong merged 12 commits into
mainfrom
yukih/per-prompt-rollout-native-async

Conversation

@yuki-97

@yuki-97 yuki-97 commented May 26, 2026

Copy link
Copy Markdown
Contributor

Issue

Part of RL-729. Based on #2528.

Summary

Adds AsyncRolloutManager to rollout_manager.py to support native async per-prompt multi-turn rollouts.

  • run_rollout fans out num_generations_per_prompt concurrent _run_single_rollout coroutines via asyncio.gather and returns a PromptGroupRecord.
  • _run_single_rollout is a pure mirror of run_sample_multi_turn_rollout (multi-reward support dropped for now).
  • _generate_response mirrors async_generate_response_for_sample_turn + generate_responses_async, with simplified logic (single-sample path, no batching indirection).

Tests

  • Extended tests/unit/experience/test_rollouts.py with unit tests for AsyncRolloutManager.

@copy-pr-bot

copy-pr-bot Bot commented May 26, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yuki-97
yuki-97 force-pushed the yukih/per-prompt-rollout-gym branch from 904ec08 to e1e70f1 Compare May 31, 2026 08:28
Base automatically changed from yukih/per-prompt-rollout-gym to main June 3, 2026 04:30
@yuki-97
yuki-97 force-pushed the yukih/per-prompt-rollout-native-async branch from 4f25097 to 1ceeb56 Compare June 3, 2026 06:21
@yuki-97 yuki-97 added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Jun 3, 2026
@yuki-97

yuki-97 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 1bcc539

@yuki-97
yuki-97 marked this pull request as ready for review June 3, 2026 06:33
@yuki-97
yuki-97 requested review from a team as code owners June 3, 2026 06:33
@yuki-97
yuki-97 requested review from mehraakash and terrykong June 3, 2026 06:33
yuki-97 added a commit that referenced this pull request Jun 8, 2026
Signed-off-by: Yuki Huang <[email protected]>

@terrykong terrykong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AsyncRolloutManager review

Thanks for this — it's a clean, faithful port. Two independent passes verified the "pure mirror" claim line-by-line against run_sample_multi_turn_rollout / async_generate_response_for_sample_turn / generate_responses_async (truncation/overflow, stop-string & metadata updates, token accounting, logprobs slicing, gen_leader_worker_idx, and _response_truncated handling all match), and both new tests pass on a real GPU. The for/else max_turns_reached refactor is behaviorally equivalent to the original's turn_count >= max_rollout_turns, and the interfaces.py type-widening is safe (Optional/VLMMessageLogType are both imported; env_extras=None is unreachable in both manager paths).

One item is worth fixing before merge — the new tests are missing the @pytest.mark.skipif GPU guard that all sibling vLLM tests carry, so they'd error (not skip) on a CPU/no-GPU runner. The rest are low-severity suggestions and informational notes (validation guard, a clearer multi-reward failure, a verified truncation test, and two optional notes).

Generated by Claude Code

Comment thread tests/unit/experience/test_rollouts.py Resolved
Comment thread tests/unit/experience/test_rollouts.py Resolved
Comment thread nemo_rl/experience/rollout_manager.py Resolved
Comment thread nemo_rl/experience/rollout_manager.py Resolved
Comment thread tests/unit/experience/test_rollouts.py Resolved
Comment thread tests/unit/experience/test_rollouts.py Resolved
Comment thread nemo_rl/experience/rollout_manager.py Resolved
Comment thread nemo_rl/experience/rollout_manager.py Resolved
@yuki-97

yuki-97 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 16eda62

@yuki-97
yuki-97 force-pushed the yukih/per-prompt-rollout-native-async branch from 16eda62 to ba23172 Compare June 9, 2026 12:56
@yuki-97

yuki-97 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ba23172

@terrykong
terrykong merged commit 55fb0d0 into main Jun 9, 2026
129 of 132 checks passed
@terrykong
terrykong deleted the yukih/per-prompt-rollout-native-async branch June 9, 2026 16:07
pengdurice pushed a commit to pengdurice/RL that referenced this pull request Jun 12, 2026

This branch was previously deployed

2 inactive deployments
public — ba231723 Deployed Jun 9, 2026 by copy-pr-bot[bot] via release / finalize / publish-docs #877
test — ba231723 Deployed Jun 9, 2026 by copy-pr-bot[bot] via Wait in test approval queue #12144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants