Skip to content

fix(grpo): apply effort shaping to async Gym rollouts - #3885

Merged
yuki-97 merged 1 commit into
mainfrom
yifu/fix-async-effort-main
Aug 28, 2026
Merged

yuki-97 merged 1 commit into
mainfrom
yifu/fix-async-effort-main

Conversation

@yfw

@yfw yfw commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Problem

Legacy async GRPO calls run_async_nemo_gym_rollout without effort_config. Runs configured with env.nemo_gym.effort_levels therefore shape synchronous and validation rewards but silently skip the same shaping during async training.

Change

  • resolve the existing validated effort config in AsyncTrajectoryCollector
  • pass it to every NeMo Gym stream attempt for GRPO
  • keep the shared PPO collector behavior unchanged
  • cover the collector-to-rollout wiring, including a partial-stream retry

This addresses the gap identified in #3770 (comment).

Validation

  • pytest -q tests/unit/algorithms/test_async_utils.py -k nemo_gym_batch_retry_forwards_effort_config_without_duplicates
  • pytest -q tests/unit/test_effort_shaping.py tests/unit/single_controller/test_setup.py -k effort
  • ruff check nemo_rl/algorithms/async_utils/trajectory_collector.py tests/unit/algorithms/test_async_utils.py
  • ruff format --check nemo_rl/algorithms/async_utils/trajectory_collector.py tests/unit/algorithms/test_async_utils.py

Legacy async GRPO forwarded reward penalties to NeMo Gym rollout postprocessing but omitted the configured effort levels. As a result, training silently skipped length-based effort shaping even though synchronous rollouts and validation applied it.

Resolve the existing validated effort config in the async trajectory collector and pass it to every NeMo Gym stream attempt. Add regression coverage at the collector-to-rollout boundary, including the retry path.

Signed-off-by: Yi-Fu Wu <[email protected]>
@yfw
yfw requested review from a team as code owners August 27, 2026 21:48
@copy-pr-bot

copy-pr-bot Bot commented Aug 27, 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 added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Aug 28, 2026
@yuki-97

yuki-97 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

/ok to test fbc6a88

@yuki-97
yuki-97 enabled auto-merge (squash) August 28, 2026 00:11
@yuki-97
yuki-97 merged commit 4c6e5c8 into main Aug 28, 2026
84 checks passed
@yuki-97
yuki-97 deleted the yifu/fix-async-effort-main branch August 28, 2026 01:54
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