Skip to content

test(single-controller): add token-capture dynamic-sampling nightlies - #5244

Merged
yuki-97 merged 2 commits into
mainfrom
ruit/dapo_token_capture_nightly
Nov 16, 2026
Merged

yuki-97 merged 2 commits into
mainfrom
ruit/dapo_token_capture_nightly

Conversation

@RayenTian

@RayenTian RayenTian commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What

Two SingleController nightlies that run DAPO dynamic sampling on the token-capture path, one per streaming sampler added in #4784:

  • dapo-qwen2.5-1.5b-instruct-1n8g-windowed-single-controller-token_capture
  • dapo-qwen2.5-1.5b-instruct-1n8g-ready-first-single-controller-token_capture (inherits the windowed recipe; only async_rl.sampler.name differs)

Covers the dynamic sampling that #4784 added for these samplers.

Setup

  • Qwen2.5-1.5B-Instruct, 1n8g: 4 Megatron training GPUs and 4 single-GPU vLLM replicas.
  • 8 prompts x 8 generations per step, max_total_sequence_length=8192, 100 steps.
  • OpenMathReasoning through NeMo-Gym math_with_judge, judge off, prepared from HF with ng_prepare_data. Token capture is only wired up on the Gym rollout path, so the built-in math env cannot be used here.
  • Dynamic sampling on, dynamic_sampling_max_gen_batches=30.

Gates

Calibrated on 100-step runs of both recipes. The table shows the worse of the two.

Gate Measured Threshold
token_mult_prob_error median 1.0088, max 1.0131 median < 1.02, max < 1.05
gen_kl_error median 0.0003 < 0.001
unfiltered_reward median 0.058 > 0.03
zero_variance_groups_total at step 100 3073 >= 1500
finalize/invalid_row_rate, finalize/capture_poisoned_rollouts 0 == 0
skipped_step, dropped_prompt_groups 0 == 0
replaced_prompt_groups (sampler check) windowed 0 every step; ready_first median 7 windowed: max == 0; ready_first: median >= 1
total_step_time median 55 s (max 130 s) < 90 s

The replaced_prompt_groups gate is what tells the two drivers apart: only ready_first refills a filtered group from its replacement pool, so the gate fails if a run silently uses the other sampler.

unfiltered_reward is low because OpenMathReasoning is hard for a 1.5B model. Most groups come back all-wrong, so the zero-variance filter and its replacement path run on every step.

NUM_MINUTES=130: the two runs took 103 and 99 minutes including startup. Each test costs 17 GPU hours, and the nightly total goes from 5350 to 5384 (cap 5400).

image

🤖 Generated with Claude Code

@copy-pr-bot

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

@RayenTian
RayenTian force-pushed the ruit/dapo_token_capture_nightly branch from 04da625 to 388ab17 Compare November 16, 2026 09:39
@RayenTian RayenTian changed the title test(single-controller): add token-capture dynamic-sampling nightlies for windowed and ready_first test(single-controller): add token-capture dynamic-sampling nightlies Nov 16, 2026
@RayenTian RayenTian added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Nov 16, 2026
@RayenTian
RayenTian marked this pull request as ready for review November 16, 2026 09:56
Base automatically changed from ruit/dapo_dynamic_sampling_sc_streamingsampler to main November 16, 2026 09:57

@svcnvidia-nemo-ci svcnvidia-nemo-ci 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.

I found two test-correctness issues in the new drivers:

  1. C1: An incomplete run can exit successfully without running any metric assertions.
  2. C2: Capture failures in dynamically filtered groups escape the finalizer health checks.

I inspected all five changed files and their affected paths, with three delegated topic reviews. This was a static review; I did not run tests or lint. The mounted Gym and Megatron-Bridge submodule directories were empty, so I could not verify their implementations directly.

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

@RayenTian
RayenTian force-pushed the ruit/dapo_token_capture_nightly branch from 388ab17 to ccdd0fd Compare November 16, 2026 11:17
@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Nov 16, 2026
@RayenTian
RayenTian force-pushed the ruit/dapo_token_capture_nightly branch from ccdd0fd to d035c05 Compare November 16, 2026 11:21
@RayenTian

Copy link
Copy Markdown
Contributor Author

/ok to test d035c05

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

Great to have the windowed and ready_first samplers from #4784 covered by token-capture dynamic-sampling nightlies: each now runs DAPO dynamic sampling through the Gym rollout path every night.

Thanks for posting the 100-step runs of both recipes and the in_order control in the description, along with the gate-calibration table: every threshold can be read off clearly against what the runs measured.

Scope: the two recipes, the two nightly drivers and the nightly.txt entries, at d035c05

Checked:

  • Nightly GPU-hour budget: the DRYRUN total goes from 5350 to 5384, within the 5400 cap in test_recipes_and_test_suites.py:263-296, so no cap bump is needed.
  • Sampler identity: the replaced_prompt_groups gates fail each driver if the run silently uses the other sampler, since only ready_first refills from its pool; a good call that the dapo-llama nightly pair does not have.
  • Gate coverage: every gate key is logged each step and check_metrics fails on a missing key, and the unconditional len(train/loss) == MAX_STEPS check turns an early stop into a failure instead of skipped gates.
  • Gym data prep: ng_prepare_data writes exactly the data/math_with_judge/train.jsonl that data.train.data_path reads, and the prep block and env.yaml handling match the existing Gym nightlies.

Remaining comments are on:

  • the unread env.math override in the windowed recipe
  • capture failures in dynamically filtered groups escaping the finalizer health gates

Generated by Claude Code

@RayenTian
RayenTian force-pushed the ruit/dapo_token_capture_nightly branch 2 times, most recently from 4ffda1c to f7c2be4 Compare November 16, 2026 14:58
RayenTian and others added 2 commits November 16, 2026 07:04
Run SingleController DAPO dynamic sampling on the token-capture path under the
two streaming samplers, windowed and ready_first. Qwen2.5-1.5B-Instruct on 1n8g,
OpenMathReasoning through NeMo-Gym math_with_judge (token capture is only wired
up on the Gym rollout path). The two recipes differ only in
async_rl.sampler.name.

Gates and NUM_MINUTES are calibrated on 100-step runs of both recipes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: ruit <[email protected]>
- Fail both drivers on any finalizer rollout rejection in the run log;
  dynamic sampling filters groups before their finalize/* metrics are
  stored, so the metric gates alone miss rejections in filtered groups.
- Drop the unused env.math block from the windowed recipe; the NeMo-Gym
  path never builds MathEnvironment.

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

Copy link
Copy Markdown
Contributor Author

/ok to test 1c9e518

@RayenTian
RayenTian force-pushed the ruit/dapo_token_capture_nightly branch from f7c2be4 to 1c9e518 Compare November 16, 2026 15:08
@RayenTian
RayenTian requested a review from yuki-97 November 16, 2026 15:09
@yuki-97
yuki-97 enabled auto-merge (squash) November 16, 2026 15:49
@yuki-97
yuki-97 merged commit aa0f77a into main Nov 16, 2026
167 of 179 checks passed
@yuki-97
yuki-97 deleted the ruit/dapo_token_capture_nightly branch November 16, 2026 17:58
@RayenTian RayenTian mentioned this pull request Nov 17, 2026
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) Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants