Skip to content

fix: Reconcile #2315 and #2612 - #2902

Merged
terrykong merged 6 commits into
NVIDIA-NeMo:mainfrom
tdene:tde/minf_topology
Aug 7, 2026
Merged

fix: Reconcile #2315 and #2612#2902
terrykong merged 6 commits into
NVIDIA-NeMo:mainfrom
tdene:tde/minf_topology

Conversation

@tdene

@tdene tdene commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What does this PR do ?

Sets up the GPU cluster with correct topology, making sure NVLS works properly.

Issues

#2850

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 23, 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 23, 2026 16:12
@tdene
tdene requested a review from a team as a code owner June 23, 2026 16:12
@copy-pr-bot

copy-pr-bot Bot commented Jun 23, 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 23, 2026
@tdene

tdene commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test f20856b

@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.

Thanks for reconciling the Megatron generation backend with the topology-aware placement from #2612 — focused, well-scoped change.

The grpo.py placement-group logic looks correct:

  • Both MegatronGeneration.init_cluster_placement_groups(..., policy_config) call sites pass the full PolicyConfig (the method needs megatron_cfg, which only exists on policy_config, not generation_config).
  • No harmful double-init: colocated megatron reuses the training policy (its __init__ early-returns before its internal PG init), so the eager call is the sole init; the non-colocated path calls it twice but _init_placement_groups early-returns when PGs already exist.
  • gpus_per_instance = TP*PP*CP matches the model_parallel_size formula inside the megatron method, and the vLLM/SGLang else branch is unchanged.

Two inline asks (validation coverage for the nvls switch and the new megatron+topology placement path), plus a minor process note.

Process note (non-blocking): The PR description is the empty template, and the title references #2315, which is "docs: add SECURITY.md" — likely a typo for the PR/issue that introduced the Megatron generation backend. A one-line "what/why" and the correct issue references would help reviewers.

Generated by Claude Code

Comment thread nemo_rl/algorithms/grpo.py
@terrykong
terrykong requested a review from shanmugamr1992 July 10, 2026 16:02
@terrykong

Copy link
Copy Markdown
Collaborator

@tdene just checking on this PR, is this still needed?

also @shanmugamr1992 for review

@tdene

tdene commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@tdene just checking on this PR, is this still needed?

also @shanmugamr1992 for review

This is still needed, and I will update it and pass CI by 07/14

@tdene

tdene commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

This is still needed, and I will update it and pass CI by 07/14

Waiting until after the next NeMo RL release (which should happen this week?)

@tdene tdene added CI:L2 Run doctests, unit tests, functional tests, and convergence tests and removed CI:L1 Run doctests, unit tests, and functional tests labels Jul 29, 2026
@tdene
tdene force-pushed the tde/minf_topology branch from f20856b to 30f5bbf Compare July 29, 2026 11:08
shanmugamr1992
shanmugamr1992 previously approved these changes Jul 29, 2026
@tdene
tdene force-pushed the tde/minf_topology branch from 30f5bbf to 7091e86 Compare August 4, 2026 05:33
@tdene tdene added CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) and removed CI:L2 Run doctests, unit tests, functional tests, and convergence tests labels Aug 4, 2026
@tdene

tdene commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ddaab4c

@tdene
tdene requested a review from a team as a code owner August 4, 2026 09:26
shanmugamr1992
shanmugamr1992 previously approved these changes Aug 4, 2026
@tdene

tdene commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test d06f7a7

1 similar comment
@tdene

tdene commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test d06f7a7

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

tdene commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 6af15ba

tdene and others added 3 commits August 6, 2026 00:51
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
@tdene
tdene force-pushed the tde/minf_topology branch from 6af15ba to 48edb3d Compare August 6, 2026 05:53
@tdene

tdene commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 48edb3d

@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.

Re-reviewed at 48edb3d0 after your push, with a team of six agents. The new functional test is a genuine improvement — it exercises segment_size + backend: megatron in CI, and the synthetic-Ray-resource setup with anti-fallback grep guards is the right way to build it. I've replied on the June thread it addresses.

Two things to act on:

  • The new megatron branch reads training parallelism where generation parallelism applies (non-colocated only). Traces for both paths inline — the colocated one is correct, the non-colocated one lays out placement groups from the pre-merge config and the corrective call is a no-op. Silent, and inert on today's numbers, but it's the path this PR exists to enable.
  • The new unit test is collected by zero CI lanes — one-line fix, but as it stands it can never catch a regression.

Also one genuine question (not a finding) about whether TP*PP*CP is the right NVLink-domain span for MoE, and evidence on the still-open nvls thread.

Two things I want to flag rather than bury. An earlier draft asked you to guard a KeyError: 'sglang' in the dispatch block — that was wrong and is dropped, since gpus_per_server isn't a key in the SGLang schema at all, so the branch is unreachable. (Separately, and not yours to fix: that also makes SGLang's topology-constraint path dead code; the real field is sglang_server_config.num_gpus_per_engine.) And an earlier draft overstated the EP/ETP point as a defect — I could not build a shipped config that hits it, so it's demoted to a question.

Caveat: I could not run the test suite or the repo linters — uv.lock targets linux only, so the env doesn't resolve on my host. Every claim comes from reading source, with permalinks so you can check the reasoning rather than take my word for it.

Generated by Claude Code

Comment thread nemo_rl/algorithms/grpo.py
Comment thread tests/unit/models/generation/test_megatron_generation.py Outdated
Comment thread examples/nemo_gym/grpo_nanov3.yaml
Comment thread tests/functional/grpo_megatron_generation_topology.sh
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
@tdene
tdene requested a review from a team as a code owner August 6, 2026 07:01
@tdene

tdene commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 90a202a

@tdene
tdene force-pushed the tde/minf_topology branch from 022838d to 2fa6990 Compare August 6, 2026 17:54
@tdene

tdene commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2fa6990

Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
@tdene
tdene force-pushed the tde/minf_topology branch from 2fa6990 to 3afd33a Compare August 6, 2026 22:00
@tdene

tdene commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 3afd33a

terrykong
terrykong previously approved these changes Aug 7, 2026
@terrykong
terrykong enabled auto-merge (squash) August 7, 2026 07:21
@terrykong
terrykong disabled auto-merge August 7, 2026 07:23
@terrykong

Copy link
Copy Markdown
Collaborator

/ok to test 3afd33a

@terrykong
terrykong enabled auto-merge (squash) August 7, 2026 07:23
@terrykong terrykong added CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) and removed CI:L1 Run doctests, unit tests, and functional tests labels Aug 7, 2026
@terrykong

Copy link
Copy Markdown
Collaborator

/ok to test 73663dd

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

tdene commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test eb17aa8

@terrykong
terrykong merged commit e496258 into NVIDIA-NeMo:main Aug 7, 2026
81 checks passed
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.

3 participants