Skip to content

Nanz/sc update - #4566

Draft
nanz-nv wants to merge 3 commits into
NVIDIA-NeMo:26.09-betafrom
nanz-nv:nanz/sc_update
Draft

nanz-nv wants to merge 3 commits into
NVIDIA-NeMo:26.09-betafrom
nanz-nv:nanz/sc_update

Conversation

@nanz-nv

@nanz-nv nanz-nv commented Oct 7, 2026

Copy link
Copy Markdown

What does this PR do ?

Adds TRT-LLM support to the single-controller path, including prefill/decode disaggregation, in-loss sequence filtering with legacy-compatible advantage baselines and gradient normalization, and offline evaluation. Rejects token capture with in-loss filtering to prevent placeholder rows from affecting group advantages

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

  • ...

nanz-nv and others added 2 commits October 7, 2026 18:32
Read loss_fn.seq_logprob_error_in_loss once in SingleControllerActor
__init__ instead of from _master_config inside _advantage_stage. The
advantage-stage unit tests stub _master_config without loss_fn and
would raise AttributeError; set the new flag on their controller stubs.

Reject token_capture.enabled with seq_logprob_error_in_loss: in-loss
mode uses all-response advantage baselines (valid_mask=None), which
would let token-capture placeholder rows (sample_mask=0) vote in their
siblings' baselines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Carlos Gomes <[email protected]>
@copy-pr-bot

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

Comment thread nemo_rl/algorithms/single_controller.py Resolved

def evaluation_only_checkpoints(master_config: MasterConfig) -> bool:
"""Opt-in weights-only endpoints are for evaluation, never SC recovery."""
deferred = getattr(algo_config(master_config), "deferred_evaluation", None)

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.

config.py:1265

1 action item — please fix in this PR.

TL;DR — grpo.deferred_evaluation is an undeclared, unvalidated extra key on GRPOConfig (extra="allow", grpo.py:326), so misconfigurations fail late or silently.

  • enabled: true without weights_only still overrides the save schedule (single_controller.py:3096-3101), but evaluation_only_checkpoints() is False so the guards at L1289-1298 (GRPO-only, checkpointing enabled, no save_optimizer) are skipped.
  • Missing first_step raises KeyError at the end of training step 1, not at setup.
  • first_step <= 0 or > max_num_steps is accepted, so the first endpoint is never saved.

Action: add a typed DeferredEvaluationConfig(BaseModel) (enabled: bool = False, first_step: int | None, weights_only: bool = False) as a GRPOConfig field, validate 1 <= first_step <= max_num_steps, run the guards whenever enabled is true, and add an exemplar YAML entry (config-conventions). While there, consider declaring evaluation_only / training_step_end_time_ms on GRPOSaveState; they are currently attached ad hoc and persist only via vars().

@hchings

hchings commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

We should also retest convergence and perf to ensure no regression, once this MR becomes more mature.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Nan Zheng <[email protected]>
@terrykong terrykong added CI:L1 Run doctests, unit tests, and functional tests 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 Nov 5, 2026
shuyixiong pushed a commit that referenced this pull request Nov 6, 2026
Cherry-picked from #4566, keeping only the TRT-LLM + SingleController
part; the in-loss sequence-logprob filtering and offline-evaluation
parts of that commit are not included.

- setup: TRT-LLM cluster topology, generation build, max sequence
  length, and NeMo-Gym support (build generation, then start Gym).
- TrtllmGeneration.validate_settings rejects SC options TRT-LLM cannot
  honor before any resources are reserved.

(cherry picked from commit b3c187a)
Signed-off-by: shuyixiong <[email protected]>
shuyixiong added a commit that referenced this pull request Nov 6, 2026
…E1 recipe

Follow-up to the TRT-LLM + SingleController cherry-pick from #4566:
- Size TRT-LLM replicas with main's disaggregation schema
  (replica_width) instead of the older trtllm_cfg.disaggregation keys.
- Build TRT-LLM generation in parallel with the trainer; NeMo-Gym waits
  for the generation future and fails if any shard lacks a server URL.
- Type validate_settings against MasterConfig and resolve PD layout via
  resolve_disagg_layout.
- Add the grpo-qwen3-1.7b-2n4g-megatron-trtllm-disagg-swe1-single-controller
  recipe and test-suite driver (PD disagg + NeMo-Gym SWE1).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: shuyixiong <[email protected]>

This branch has not been deployed

No deployments
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) community-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants