Skip to content

fix(grpo_sync): skip refit for colocated MegatronGeneration - #2967

Merged
yuki-97 merged 1 commit into
mainfrom
fix/grpo-sync-megatron-refit
Jun 30, 2026
Merged

fix(grpo_sync): skip refit for colocated MegatronGeneration#2967
yuki-97 merged 1 commit into
mainfrom
fix/grpo-sync-megatron-refit

Conversation

@ZhiyuLi-Nvidia

@ZhiyuLi-Nvidia ZhiyuLi-Nvidia commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

closes #2942.

Summary

  • In grpo_train_sync, NEED_REFIT was unconditionally True for any non-None policy_generation, so colocated MegatronGeneration ran refit_policy_generation, which dispatches to the IPC ZMQ path.
  • MegatronGeneration only overrides update_weights_from_collective, so the colocated IPC ZMQ branch raised NotImplementedError.
  • Mirror the legacy grpo.py:2155-2158 guard so the sync and legacy trainers behave identically for this case.
  • introduction of the failure: PR feat: Update Megatron Inference #2355 (48d13ec) made MegatronGeneration a real worker and added a NEED_REFIT guard for colocated-megatron in grpo.py:1983-1986 — but missed the same guard in grpo_sync.py. With data_plane.enabled=true, the sync trainer runs and calls update_weights_via_ipc_zmq, which MegatronGeneration doesn't implement → NotImplementedError.

Test plan

  • Run vlm_grpo with policy_generation=MegatronGeneration and colocated.enabled=true on grpo_train_sync and confirm it no longer raises NotImplementedError during refit.
  • Confirm non-colocated and non-Megatron generation paths still take the refit branch (loss/reward parity with legacy grpo.py).

🤖 Generated with Claude Code

@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia requested a review from a team as a code owner June 26, 2026 23:53
@copy-pr-bot

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

@ZhiyuLi-Nvidia ZhiyuLi-Nvidia added CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) r0.7.0 labels Jun 26, 2026
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 5e33776

In grpo_train_sync, NEED_REFIT was unconditionally True for any non-None
policy_generation, so colocated MegatronGeneration ran refit_policy_generation
which dispatched to the IPC ZMQ path. MegatronGeneration only overrides
update_weights_from_collective, so the colocated IPC ZMQ branch raised
NotImplementedError. Mirror the legacy grpo.py:1983-1986 guard so the two
trainers behave identically for this case.

Signed-off-by: Zhiyu Li <zhiyul@NVIDIA.com>
@ZhiyuLi-Nvidia
ZhiyuLi-Nvidia force-pushed the fix/grpo-sync-megatron-refit branch from 5e33776 to 439b585 Compare June 30, 2026 05:26
@ZhiyuLi-Nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 439b585

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

thanks for the fix!

@yuki-97
yuki-97 enabled auto-merge (squash) June 30, 2026 05:27
@yuki-97
yuki-97 merged commit 5a26131 into main Jun 30, 2026
139 of 141 checks passed
@yuki-97
yuki-97 deleted the fix/grpo-sync-megatron-refit branch June 30, 2026 06:37
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) r0.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nightly Test failure NotImplementedError

2 participants