Skip to content

feat: Add configurable vLLM thinking token budget - #2947

Open
kota-row wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
kota-row:configurable-thinking-token-budget
Open

kota-row wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
kota-row:configurable-thinking-token-budget

Conversation

@kota-row

@kota-row kota-row commented Jun 26, 2026 •

Copy link
Copy Markdown

What does this PR do ?

Adds a policy.generation.thinking_token_budget config knob and forwards it to vLLM SamplingParams when set, so reasoning rollouts can cap the <think> segment.
https://docs.vllm.ai/en/latest/features/reasoning_outputs/#thinking-budget-control

This fix prevents the content length from becoming 0 due to cyclic thinking or thinking that exceeds the context length.

Issues

Related to #2946

Usage

  • Example Nemotron Omni vLLM rollout configuration:
uv run examples/run_vlm_grpo.py --config examples/configs/recipes/vlm/vlm_grpo-nemotron-omni-30ba3b-clevr-1n8g-automodel-ep8.v1.yaml \
    cluster.gpus_per_node=8 \
    cluster.num_nodes=1 \
    policy.generation.thinking_token_budget=1024 \
    ++policy.generation.vllm_kwargs.reasoning_config.reasoning_parser=nemotron_v3 \
    '++policy.generation.vllm_kwargs.reasoning_config.reasoning_start_str=<think>' \
    '++policy.generation.vllm_kwargs.reasoning_config.reasoning_end_str=</think>'

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

  • thinking_token_budget is only passed to vLLM when explicitly set, preserving existing behavior for configs that leave it unset or null.
  • vLLM requires reasoning_config when using thinking_token_budget; the Nemotron Omni guide now shows the required nemotron_v3 parser settings.

@copy-pr-bot

copy-pr-bot Bot commented Jun 26, 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 the Documentation Improvements or additions to documentation label Jun 26, 2026
@kota-row kota-row changed the title Add configurable vLLM thinking token budget feat: Add configurable vLLM thinking token budget Jun 26, 2026
@kota-row
kota-row marked this pull request as ready for review June 26, 2026 06:36
@kota-row
kota-row requested review from a team as code owners June 26, 2026 06:36
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Jun 28, 2026
@terrykong terrykong removed the Documentation Improvements or additions to documentation label Nov 28, 2026

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

community-request waiting-on-maintainers Waiting on maintainers to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants