Skip to content

Set drop_zero_std_reward_groups=False for debug configs - #3802

Merged
pzhan9 merged 2 commits into
pytorch:mainfrom
pzhan9:zero_rewards
Jun 30, 2026
Merged

pzhan9 merged 2 commits into
pytorch:mainfrom
pzhan9:zero_rewards

Conversation

@pzhan9

@pzhan9 pzhan9 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

These configs uses hf_assets_path="tests/assets/tokenizer", and will produce zero reward. Need to set drop_zero_std_reward_groups=False. Otherwise the job would hang since all responses from generator are discarded due to 0 reward.

@pzhan9
pzhan9 requested a review from tianyu-l June 26, 2026 19:53
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 26, 2026
@pzhan9
pzhan9 requested review from felipemello1 and wwwjn June 26, 2026 19:53
@felipemello1

Copy link
Copy Markdown
Contributor

if they are all producing STD=0, then theres something broken with the run, right?

setting it to False just masks the error

@wwwjn

wwwjn commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

if they are all producing STD=0, then theres something broken with the run, right?

setting it to False just masks the error

Debug model are expected to see garbage output, because it doesn't have real weights

@felipemello1 felipemello1 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! Please fix CI (if caused by this PR)

I approved, but would it make sense to try to get a debug model that actually works? e.g. take a small MoE and trim a bunch of layers? For example, fused_qkv was "working" but producing bad outputs.

Not for this PR, just an idea for the future

@pzhan9
pzhan9 merged commit 0052a38 into pytorch:main Jun 30, 2026
8 of 12 checks passed
@pzhan9
pzhan9 deleted the zero_rewards branch June 30, 2026 14:23
wwwjn added a commit that referenced this pull request Jul 8, 2026
The golden (rl_grpo_cuda.txt) held small non-zero losses from before #3802,
which set drop_zero_std_reward_groups=False for debug configs. With that + a
random-init model, every reward group is zero-std -> zero advantage -> the GRPO
loss is deterministically 0.0 (all 10 steps, confirmed in CI). Update the golden
to 0.0 (arch-independent) and document why in the workflow comment.
wwwjn added a commit that referenced this pull request Jul 9, 2026
The golden (rl_grpo_cuda.txt) held small non-zero losses from before #3802,
which set drop_zero_std_reward_groups=False for debug configs. With that + a
random-init model, every reward group is zero-std -> zero advantage -> the GRPO
loss is deterministically 0.0 (all 10 steps, confirmed in CI). Update the golden
to 0.0 (arch-independent) and document why in the workflow comment.
jemitche1 pushed a commit to jemitche1/torchtitan that referenced this pull request Jul 15, 2026
These configs uses `hf_assets_path="tests/assets/tokenizer",` and will
produce zero reward. Need to set `drop_zero_std_reward_groups=False`.
Otherwise the job would hang since all responses from generator are
discarded due to 0 reward.
wwwjn added a commit that referenced this pull request Sep 9, 2026
## Why

The Qwen3.5 debug integration test in
https://github.com/pytorch/torchtitan/actions/runs/34312737649/job/102342893821
generated rollouts indefinitely without producing a training step.
Random-init policies can give every rollout in a group the same reward.
With `drop_zero_std_reward_groups=True`, every such group is discarded,
so the generator keeps replenishing work while the trainer waits forever
for a batch.

This is the same invariant addressed for earlier debug configs in #3802;
the Qwen3.5 debug config added in #3957 omitted the override.

## What

- Set `drop_zero_std_reward_groups=False` for the Qwen3.5 debug config.
- Add the corresponding CLI override centrally to every command produced
by the RL CI integration-test launcher, including multi-run tests.
- Record consecutive untrainable groups at the batcher boundary:
- each complete batch-sized block of untrainable groups emits a warning;
  - any trainable group resets the count;
- 10 consecutive untrainable batches raise `RuntimeError` instead of
hanging indefinitely.
- Remove the resolved silent-hang TODO and add regression tests for the
CI override, warnings, reset behavior, and terminal error.

This follows Prime-RL’s generalized no-progress protection:
https://github.com/PrimeIntellect-ai/prime-rl/blob/main/src/prime_rl/orchestrator/train_sink.py

## Testing

- `python -m pytest
torchtitan/experiments/rl/tests/test_async_controller.py
torchtitan/experiments/rl/tests/test_rollout_utils.py -q` (27 passed)
- Targeted watchdog tests after the final naming change (3 passed).
- Targeted pre-commit hooks passed (Pyrefly skipped because RL
experiments/tests are excluded by repository configuration and the
configured local PyTorch tree is unavailable).
- Python compilation passed for all changed files.
- Validated that all 8 commands currently produced by the RL CI launcher
contain the override.

The focused launcher pytest could not be collected locally because this
checkout environment lacks `grain`; CI installs the project
requirements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rl ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants