Repository navigation
fix(nemo-gym): clamp max_new_tokens to prompt + output <= max_model_len - #2514
Merged
Merged
Conversation
Contributor
Author
|
/ok to test 81c371f |
seonjinn
added a commit
that referenced
this pull request
May 20, 2026
Drops PR #2280 selective recompute overrides (structurally infeasible at TP=4 EP=8 PP=8 on Qwen3-235B per job 11941263 OOM finding: selective scope strictly < full uniform N=1 memory savings). Isolates PR #2514 (max_tokens clamp) effect vs HybridEP+to60 baseline 11891376 (median 413.95s/step). Target: cut exposed_gen long-tail from clamp logic in vllm_worker_async + rollouts.py active set. Signed-off-by: seonjinn <[email protected]>
seonjinn
added a commit
that referenced
this pull request
May 20, 2026
Scale EP 8 to 32 to reduce per-GPU expert activation memory ~4x, enabling selective recompute [core_attn,moe_act] to fit at expert FC2 forward (job 11941263 OOMd by 226 MiB at EP=8 PP=8). Megatron constraint: EP * ETP = world_train / PP. With cluster.num_nodes=40, inference=8 -> train=32 nodes -> 256 train GPUs. PP=8 -> EP_max=32 (ETP=1). Trade: 4x training nodes vs current 16-node baseline (8 train + 8 inf). Per-job cost rises 2.5x but unlocks selective recompute scope that the 8-train budget structurally cannot fit. Signed-off-by: seonjinn <[email protected]>
seonjinn
added a commit
that referenced
this pull request
May 20, 2026
A/B with submit_hybridep_pr2514_timeout60.sh to isolate Gym PR #2514 max_tokens clamp effect on H100 long-tail. No HybridEP, no PR #2280. Both variants share branch sj/super-v3-perf-patch+pr2280+pr2514 so PR #2514 NeMo-RL patch (vllm_worker_async.py + rollouts.py) applies automatically. 20 steps, timeout60, 16n x 8 H100. Signed-off-by: seonjinn <[email protected]>
…e_length" This reverts commit 90973ba. Signed-off-by: Yuki Huang <[email protected]>
Signed-off-by: Yuki Huang <[email protected]>
yuki-97
force-pushed
the
yukih/gym-max-tokens
branch
from
May 27, 2026 13:03
81c371f to
49437fd
Compare
Contributor
Author
|
/ok to test 49437fd |
terrykong
reviewed
May 27, 2026
terrykong
left a comment
Collaborator
There was a problem hiding this comment.
Review: PR #2514 — fix(nemo-gym): clamp max_new_tokens to prompt + output <= max_model_len
Clean, well-structured fix that reverts the hardcoded max_new_tokens from #2365 and replaces it with proper clamping logic. The approach matches vLLM's native async behavior (allowed_new_tokens). YAML config changes are consistent with the established ${policy.max_total_sequence_length} pattern used across all other GRPO configs.
Summary:
- Clamping logic in
_set_max_tokens/_clamp_max_tokensis correct - The
is not Noneguard removal inrollouts.pyis safe (max_new_tokensis a requiredintinGenerationConfig) - Both the normal path and prefix-replacement path correctly clamp after prompt tokenization
- One minor suggestion below regarding the
oroperator for extracting max tokens
Generated by Claude Code
Signed-off-by: Yuki Huang <[email protected]>
Contributor
Author
|
/ok to test 2affac8 |
terrykong
approved these changes
May 29, 2026
yuki-97
added a commit
that referenced
this pull request
Jun 1, 2026
Signed-off-by: Yuki Huang <[email protected]>
4 tasks done
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
max_new_tokensintroduced in fix(nemo-gym): plumb max_new_tokens into row-level max_output_tokens #2365.max_output_tokensso thatprompt_tokens + max_output_tokens <= max_model_len(analogous toallowed_new_tokensin vLLM's native async path).Changes
vllm_worker_async.py: add_set_max_tokens/_clamp_max_tokenshelpers; apply clamping in_preprocess_chatfor both the normal path and the prefix-replacement path.rollouts.py: always writegeneration_config["max_new_tokens"]intoresponses_create_params["max_output_tokens"](remove theis not Noneguard since it's alwaysnot None).grpo_nanov3.yaml,grpo_workplace_assistant_nemotron_nano_v2_9b.yaml,tests/functional/grpo_async_gym.sh.Test plan
tests/functional/grpo_async_gym.shpasses without overridingmax_new_tokens.cc @binhu-nv