Skip to content

refactor(grpo): remove grpo_sync and the non-SC data plane path - #5433

Merged
terrykong merged 13 commits into
mainfrom
yukih/remove-grpo-sync
Dec 2, 2026
Merged

terrykong merged 13 commits into
mainfrom
yukih/remove-grpo-sync

Conversation

@yuki-97

@yuki-97 yuki-97 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor
  • I, the PR author, have personally reviewed every line of this PR.

What and why

Removes grpo_sync.py and the non-SingleController TransferQueue path it served. Breaking: data_plane.enabled=true is now rejected by the legacy launchers; the SingleController path is unchanged.

1. Delete the trainer and the code only it used. SyncRolloutActor, select_sync_trainer, make_policy_factory, and the TQPolicy step-lifecycle methods (prepare_step, prepare_val_partition, discard_samples, finish_step, tq_partition_id) plus TQDriverMixin.write_to_dataplane. SingleController registers its partitions in single_controller_utils/setup.py and never called these. Also removed, since only the trainer used or fed them: TQPolicy.train_from_meta, the policy_factory parameter of grpo.setup(), KVBatchMeta.stamp_tags, and the message-log decompose helpers (decompose_message_log, reconstruct_message_log, attach_message_log_view), whose only producer was SyncRolloutActor.

2. Reject data_plane.enabled=true in grpo.setup(). One check covers every legacy launcher. run_grpo_sliding_puzzle.py and run_grpo_nemo_gym.py used to ignore the key and run grpo_train, and the async branch of run_grpo.py built a TQPolicy for async_grpo_train; all now raise and point to the SingleController path. The two narrower data_plane.enabled checks in grpo.py (multimodal dedup with NeMo-Gym, async router replay) became unreachable and are removed.

3. Delete the 23 non-SC -tq_{simple,nixl,mooncake} recipes and their nightly drivers. The nightly GPU-hour cap drops from 5784 to 5226, both measured with DRYRUN=1 ./tools/launch. tests/test_suites/vlm/common-tq.env no longer has a user and is kept on purpose for future VLM SingleController drivers.

4. Docs. nemo_rl/data_plane/README.md loses the three sections that walked through grpo_train_sync, and data-plane-async-proposal.md is deleted because SingleController is the implemented async path.

Issues

None

Convergence / perf / functionality proof

No convergence or perf impact: this removes a trainer and its recipes, and the code of the remaining training paths is unchanged.

Deleting the recipes would leave no nightly on data_plane.backend=nixl, so grpo-llama3.1-8b-instruct-2n8g-async-1off-single-controller-streaming2.sh now runs on it. The changed nightly finished and all checks pass:

Status Check Value
PASS median(data["train/token_mult_prob_error"]) < 1.1 1.0107787251472473
PASS data["train/token_mult_prob_error"]["10"] < 1.1 1.0108246803283691
PASS mean(data["train/grad_norm"], 2, 0) > 0.06 0.15062200526396433
PASS max({**data.get("data_plane/cluster/step/hash/mismatches", {}), **data.get("data_plane/driver/step/hash/mismatches", {})}) == 0 0.0
PASS max({**data.get("data_plane/cluster/step/hash/rows_checked", {}), **data.get("data_plane/driver/step/hash/rows_checked", {})}) > 0 6144.0

Needs upstream changes

None

Dead code left for a follow-up decision

column_io.kv_first_write lost its last production caller in this PR and is intentionally not deleted here: nine files under tests/unit/ use it as their TQ write helper.

PR commands and CI
  • CI label, exactly one:
    • CI:Lfast: the default for most PRs. Runs a fast test subset.
    • CI:L1: dependency or container changes (pyproject.toml, uv.lock, Dockerfile) or broad core changes. Builds a new image and runs unit and functional tests.
    • CI:docs: docs-only changes. Runs doc tests only.
  • /ok to test <full-commit-sha>: start CI for that commit. Post again after each push.
  • /review: automated review comments. Add mode=strict for a stricter review, reset=true for a fresh full review.
  • /resolve-conflict: Autobot merges main into this PR and resolves the conflicts. PRs from forks must allow edits by maintainers.
  • Locally: /review-pr-team <pr-number> for a team review before you ask for human review.
  • Contributor guidelines

@copy-pr-bot

copy-pr-bot Bot commented Nov 24, 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.

@github-actions github-actions Bot added Documentation Improvements or additions to documentation CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) labels Nov 24, 2026
@yuki-97 yuki-97 added CI:L1 Run doctests, unit tests, and functional tests and removed CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) labels Nov 24, 2026
@yuki-97

yuki-97 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 0e147b4

@terrykong terrykong removed the Documentation Improvements or additions to documentation label Nov 28, 2026
@yuki-97
yuki-97 force-pushed the yukih/remove-grpo-sync branch from 0e147b4 to 6543486 Compare December 1, 2026 14:00
@svcnvidia-nemo-ci svcnvidia-nemo-ci added complexity:high Large or cross-cutting change. Set by Autobot PR classify (skills/pr-classify) convergence-risk:none Cannot change training results. Set by Autobot PR classify (skills/pr-classify) proof:functionality Needs proof that it works. Set by Autobot PR classify (skills/pr-classify) labels Dec 1, 2026

@yuki-97 yuki-97 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Self-review via /review-pr-team: 6 agents (rl-expert, test-agent, bug-finder, design-reviewer, comment-reviewer, comment-editor) + devil's-advocate pass.

Verdict — 9 inline comments: code only the deleted trainer used that is still in TQPolicy / TQDriverMixin (C1, C2, C3), the unbumped review-skill REVISION (C4), docs and comments that still describe the deleted trainer (C5, C6), no nightly left for the nixl backend (C7), and nits on the new guard message and the test README counts (C8, C9; C3 is a nit too); none is a correctness bug in the surviving training paths.

Verified clean

  • All four legacy GRPO launchers (run_grpo.py, run_vlm_grpo.py, run_grpo_sliding_puzzle.py, nemo_gym/run_grpo_nemo_gym.py) reach the new grpo.setup() rejection before any policy or generation worker is built. Every shipped config, driver and functional script that sets data_plane.enabled=true runs examples/run_grpo_single_controller.py.
  • No removed non-test name has an import, attribute, string or patch-target reference left: the grpo_sync module and its functions, SyncRolloutActor, select_sync_trainer, make_policy_factory, the removed TQPolicy / TQDriverMixin methods, and the ACTOR_ENVIRONMENTS entry. nemo_rl.data_plane.factory no longer imports grpo, so the new import in grpo.py adds no cycle.
  • The nightly budget matches the suite: the total computed with tools/launch's formula is 5194 GPU-hours at head and 5752 at base. No suite list, --deselect entry or lane script names a deleted driver, recipe or test. pyrefly-baseline.json loses exactly the 36 entries of the two deleted files.
  • Every deleted or narrowed unit test covered only deleted code, apart from the two tests in the notes below. SimpleStorage SSD offload and router replay over the data plane keep SingleController coverage.
  • outdated_config_checks.py is rightly not used: data_plane.enabled is still accepted, and SingleController requires it.

Lower-priority notes that are not inline

  • No test lane has run on this head. The unit, lint and functional lanes last ran green on the pre-rebase commit, and pyrefly was not run locally. The launchers now call the typed grpo_train directly, so the Lint job is worth a look once CI runs.
  • Two small tests of surviving code went away with the trainer's tests: the empty-input case of group_index_column and the cluster-scope branch of TQPolicy.get_data_plane_step_metrics.
  • tests/test_suites/llm/common-tq.env still limits TQ wrappers to grpo- / dapo- / prorlv2- recipes, a limit that came from the deleted trainer.

nemo-rl-review: kind=self harness=claude-code/2.1.333 model=claude-fable-5-2 effort=medium review-pr-team=v3 reviewed=27191c0

Comment thread nemo_rl/models/policy/tq_policy.py Resolved
Comment thread nemo_rl/models/policy/tq_policy.py Resolved
Comment thread nemo_rl/data_plane/driver_mixin.py Resolved
Comment thread docs/observability/span-groups.md Resolved
Comment thread nemo_rl/data_plane/observability.py Resolved
Comment thread tests/test_suites/nightly.txt Resolved
Comment thread nemo_rl/algorithms/grpo.py Resolved
Comment thread tests/unit/data_plane/README.md Resolved
@yuki-97
yuki-97 marked this pull request as ready for review December 1, 2026 15:29
@yuki-97

yuki-97 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test e2aa55e

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

Clean, well-scoped deletion. Putting the one data_plane.enabled check in grpo.setup() is the right spot: all four legacy launchers go through it and SingleController never does. A MasterConfig validator would also reject SingleController, since it reuses that class. Replacing the two narrower checks, which could no longer be reached, with this one is a good cleanup.

The self-review fixes for C2, C3 and C5–C9 hold at e2aa55e. Moving the streaming2 nightly to nixl (C7) covers that backend with no extra GPU hours. A repo-wide grep finds no reference left to any removed symbol, recipe or script, and every nightly and L1 entry resolves.

Seven items, all for this PR:

  1. (C10) Add a unit test for the new data_plane.enabled guard in grpo.setup(); it is now the only thing keeping legacy launchers off the data plane.
  2. (C11) Drop "synchronous data-plane training" from the seq_logprob_error_in_loss paragraph in docs/guides/grpo.md.
  3. (C12) Delete the message-log decompose helpers, their three calls (which now always return early), and what their deletion leaves unused.
  4. (C13) Delete the policy_factory parameter of grpo.setup().
  5. (C14) Delete KVBatchMeta.stamp_tags.
  6. (C15) Delete TQPolicy.train_from_meta and the unused timer parameters, plus what their deletion leaves unused (reply on the C1 thread).
  7. (C16) Drop the unused pad_value_dict parameter of read_columns (the next layer down from the C3 fix).

C12–C15 come from the description's "Dead code left for a follow-up decision" list, and C16 is one more case of the same kind. Per dead-code.md, a test-only caller does not count as a consumer, so please delete all five here rather than in a follow-up.

nemo-rl-review: kind=expert harness=claude-code/2.1.333 model=claude-opus-5-5 effort=medium review-pr-team=v3 reviewed=e2aa55e

Comment thread nemo_rl/algorithms/grpo.py Resolved
Comment thread docs/guides/grpo.md Resolved
Comment thread nemo_rl/data/llm_message_utils.py Resolved
Comment thread nemo_rl/algorithms/grpo.py Resolved
Comment thread nemo_rl/data_plane/interfaces.py Resolved
Comment thread nemo_rl/models/policy/tq_policy.py Resolved
Comment thread nemo_rl/data_plane/driver_mixin.py Resolved
@yuki-97
yuki-97 force-pushed the yukih/remove-grpo-sync branch from e2aa55e to 5040d83 Compare December 2, 2026 06:48
@yuki-97

yuki-97 commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5040d83

@terrykong
terrykong enabled auto-merge (squash) December 2, 2026 07:17
@terrykong
terrykong merged commit f4e47ea into main Dec 2, 2026
188 of 244 checks passed
@terrykong
terrykong deleted the yukih/remove-grpo-sync branch December 2, 2026 15:13
macandro96 added a commit that referenced this pull request Dec 2, 2026
Resolve the nightly GPU-hour cap conflict: main's #5433 lowered it to 5226,
and this branch's SC fused-linear-logprobs nightly adds 18, so the cap is 5244.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Anish Mahishi <[email protected]>
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 complexity:high Large or cross-cutting change. Set by Autobot PR classify (skills/pr-classify) convergence-risk:none Cannot change training results. Set by Autobot PR classify (skills/pr-classify) proof:functionality Needs proof that it works. Set by Autobot PR classify (skills/pr-classify)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants