Skip to content

feat: support router replay (R3) without the dataplane - #2849

Merged
terrykong merged 1 commit into
NVIDIA-NeMo:mainfrom
zyzhou5:zezhou/r3-dataplane-off
Jun 17, 2026
Merged

terrykong merged 1 commit into
NVIDIA-NeMo:mainfrom
zyzhou5:zezhou/r3-dataplane-off

Conversation

@zyzhou5

@zyzhou5 zyzhou5 commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do ?

grpo_train (the legacy in-memory driver path, data_plane.enabled=false) built train_data and logprob_data from a fixed key allowlist and dropped routed_experts, so R3 only worked with the dataplane. Thread routed_experts from flat_messages into both train_data (for policy.train) and logprob_data (for the prev-logprob get_logprobs), gated on router_replay_enabled + key presence. The Megatron worker's require=True guards (train + prev-logprob) then find routed_experts on the driver path.

@zyzhou5
zyzhou5 requested review from a team as code owners June 16, 2026 18:24
@copy-pr-bot

copy-pr-bot Bot commented Jun 16, 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.

@zyzhou5 zyzhou5 added the CI:L1 Run doctests, unit tests, and functional tests label Jun 16, 2026
@zyzhou5
zyzhou5 force-pushed the zezhou/r3-dataplane-off branch from e79ac70 to bb66ffa Compare June 16, 2026 18:35
@zyzhou5

zyzhou5 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test bb66ffa

grpo_train (the legacy in-memory driver path, data_plane.enabled=false)
built train_data and logprob_data from a fixed key allowlist and dropped
routed_experts, so R3 only worked with the TransferQueue dataplane. Thread
routed_experts from flat_messages into both train_data (for policy.train)
and logprob_data (for the prev-logprob get_logprobs), gated on
router_replay_enabled + key presence. The Megatron worker's require=True
guards (train + prev-logprob) then find routed_experts on the driver path.

Add a unit test asserting routed_experts survives
batched_message_log_to_flat_message as a 4D [B, S, L, K] tensor,
right-padded and row-aligned to token_ids.

Validated end-to-end (2 GRPO steps, no guard error) on Moonlight-16B-A3B
(1 node) and the official Qwen3-30B-A3B cp2-r3 recipe (8 nodes) with
data_plane.enabled=false.

Signed-off-by: Zeyu Zhou <[email protected]>
@zyzhou5
zyzhou5 force-pushed the zezhou/r3-dataplane-off branch from bb66ffa to 75ef86a Compare June 16, 2026 18:50
@zyzhou5

zyzhou5 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 75ef86a

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

Thank you @zyzhou5. LGTM!

@terrykong
terrykong merged commit 1ff6e11 into NVIDIA-NeMo:main Jun 17, 2026
200 of 205 checks passed
@terrykong

Copy link
Copy Markdown
Collaborator

@qiaochuz-nv

ashors1 pushed a commit that referenced this pull request Jun 27, 2026

This branch was previously deployed

2 inactive deployments
public — 75ef86ad Deployed Jun 16, 2026 by copy-pr-bot[bot] via release / finalize / publish-docs #1179
test — 75ef86ad Deployed Jun 16, 2026 by copy-pr-bot[bot] via Wait in test approval queue #12440
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 QA:Verified Ready for QA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants