Skip to content

feat: async colocated GRPO with Megatron inference - #2884

Merged
yuki-97 merged 13 commits into
NVIDIA-NeMo:mainfrom
tdene:tde/async_colocated
Aug 21, 2026
Merged

feat: async colocated GRPO with Megatron inference#2884
yuki-97 merged 13 commits into
NVIDIA-NeMo:mainfrom
tdene:tde/async_colocated

Conversation

@tdene

@tdene tdene commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What does this PR do ?

This PR adds async colocated capability to NeMo RL, which currently only supports async non-colocated and sync colocated.

Example of functionality: https://wandb.ai/nvidia/nemo-rl?nw=i2hxg54gbtq

Issues

List issues that this PR closes (syntax):

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

Additional Information

  • ...

@copy-pr-bot

copy-pr-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@tdene
tdene marked this pull request as ready for review June 22, 2026 16:51
@tdene
tdene requested review from a team as code owners June 22, 2026 16:51
@copy-pr-bot

copy-pr-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@tdene tdene added the CI:L1 Run doctests, unit tests, and functional tests label Jun 22, 2026
@tdene

tdene commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test b4265ac

@tdene

tdene commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 34c41e9

cspades
cspades previously approved these changes Jul 29, 2026

@cspades cspades left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Have some n00b questions but particularly the main RL loop LGTM!

Comment thread nemo_rl/algorithms/grpo.py Outdated
Comment thread nemo_rl/algorithms/grpo.py Outdated
Comment thread nemo_rl/models/generation/megatron/megatron_worker.py
@tdene

tdene commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test bd52c73

shanmugamr1992
shanmugamr1992 previously approved these changes Aug 4, 2026
@tdene

tdene commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 9ef4202

@tdene tdene mentioned this pull request Aug 17, 2026
4 tasks
@tdene
tdene force-pushed the tde/async_colocated branch from 607e2c3 to 206cc69 Compare August 18, 2026 10:05
@tdene

tdene commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 206cc69

@tdene
tdene force-pushed the tde/async_colocated branch from 206cc69 to bdf7125 Compare August 19, 2026 14:09
tdene and others added 8 commits August 19, 2026 09:13
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Co-authored-by: Anil Thomas <anlthms@users.noreply.github.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Co-authored-by: Anil Thomas <anlthms@users.noreply.github.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Co-authored-by: Anil Thomas <anlthms@users.noreply.github.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
@tdene
tdene force-pushed the tde/async_colocated branch from bdf7125 to 7b3a56a Compare August 19, 2026 14:41
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
@tdene

tdene commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 3fd09e2

Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
@tdene

tdene commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test b3b51bb

Comment thread nemo_rl/algorithms/grpo.py
Comment thread nemo_rl/models/generation/megatron/megatron_worker.py
Comment thread nemo_rl/models/generation/interfaces.py Outdated
Comment thread nemo_rl/algorithms/grpo.py Outdated
Comment thread nemo_rl/models/generation/megatron/config.py
Comment thread nemo_rl/models/generation/megatron/megatron_worker.py Outdated
Comment thread nemo_rl/models/generation/vllm/vllm_generation.py Outdated
Comment thread tests/functional/grpo_megatron_generation_colocated_async_grpo.sh
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
@tdene

tdene commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 8772e04

Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
@tdene

tdene commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ab0c137

Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
@tdene

tdene commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test a53fc02

@yuki-97
yuki-97 merged commit 8863ebe into NVIDIA-NeMo:main Aug 21, 2026
180 of 182 checks passed
rrs45 added a commit that referenced this pull request Aug 21, 2026
Resolve two conflicts against main's async colocated GRPO work (#2884):

- grpo.py: adopt main's refit restructuring (the defer_wake_for_save
  branch, the dropped NEED_REFIT gate, and the hoisted
  generation_logger_metrics init) and re-apply the idle/refit_bubble
  efficiency span over the wake path. The save-bound branch keeps main's
  0.0 seed with no span, since a zero-length bubble is only waterfall
  noise.
- vllm_worker.py: keep both additions, native-tracing setup and main's
  torchcodec video loader registration.

Signed-off-by: Raj Singh <rajsin@nvidia.com>
seonjinn added a commit to seonjinn/RL that referenced this pull request Aug 26, 2026
Rebuilds the MXFP8 refit-prequantize path on main's CollectiveSenderSpec
model (NVIDIA-NeMo#3391): the generation side now owns refit buffer geometry, so the
PR's consumer-side buffer_size_bytes plumbing and
_resolve_target_packed_tensor_size are dropped in favor of main's
interfaces, with the producer-side buffer_size_bytes > 0 guard re-added.
Narrows main's grouped-MoE MXFP8 refit guard (NVIDIA-NeMo#3477) to reject only
on-the-fly quantization, letting trainer-prequantized E4M3 slabs pass
through. Rebuilds the refit trigger on main's unconditional
prepare_for_generation structure (NVIDIA-NeMo#2884) while keeping the
MegatronGeneration reshard branch. Adds a sender/receiver MXFP8
bit-equivalence test.

Signed-off-by: seonjinn <sna@nvidia.com>
@yuki-97 yuki-97 mentioned this pull request Aug 26, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L1 Run doctests, unit tests, and functional tests Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants