Skip to content

fix(vllm): resolve unset sampling params to neutral defaults - #3685

Closed
lonexreb wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
lonexreb:fix/3497-vllm-neutral-sampling-defaults
Closed

lonexreb wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
lonexreb:fix/3497-vllm-neutral-sampling-defaults

Conversation

@lonexreb

Copy link
Copy Markdown
Contributor

What does this PR do ?

Passes generation_config="vllm" in the shared engine kwargs built by BaseVllmGenerationWorker._load_model (consumed by both the sync vllm.LLM engine and the async AsyncEngineArgs path), so sampling parameters NeMo-RL leaves unset on a request (min_p, repetition_penalty, and formerly top_p) resolve to vLLM's neutral defaults instead of the model's generation_config.json.

Without this, a model shipping non-neutral values (e.g. Qwen2.5-0.5B-Instruct with repetition_penalty: 1.1) silently samples off-policy while the train-side logprob rescaling replicates the distribution recorded in policy.generation.* — the mismatch is invisible to the existing async-server guard, which only covers top_k/temperature/top_p. This is the engine-level fix proposed in the issue: it removes the whole class of drift rather than patching one parameter at the guard, and makes policy.generation.* the single source of truth.

Details:

  • The new kwarg sits before **vllm_kwargs, so generation.vllm_kwargs.generation_config can deliberately restore model-default behavior (e.g. if that is ever wanted for validation rollouts).
  • The async server's explicit top_p is not None assert is kept as defense-in-depth; its comment is updated since its old rationale (resolution from generation_config.json) no longer applies at the engine level.

Issues

Fixes #3497

Usage

No user-facing config change. To intentionally restore per-model sampling defaults:

policy:
  generation:
    vllm_kwargs:
      generation_config: "auto"

Before your PR is "Ready for review"

  • One-line engine-arg change + comment updates; verified generation_config is an EngineArgs/ModelConfig field on the pinned vllm==0.25.1
  • Functional coverage: existing L1 tests exercise the vLLM engine; token_mult_prob_error-style checks guard sampling/train distribution agreement

…el generation_config.json

vLLM's ModelConfig.generation_config defaults to "auto", which resolves
any sampling parameter left unset on an OpenAI request (min_p,
repetition_penalty, and formerly top_p) from the model's
generation_config.json rather than neutral defaults. NeMo-RL never
overrode this, so models shipping non-neutral values (e.g.
Qwen2.5-0.5B-Instruct's repetition_penalty: 1.1) silently sampled
off-policy while the train-side logprob rescaling replicated the
distribution recorded in policy.generation.* -- an invisible mismatch.

Pass generation_config="vllm" when building the shared engine kwargs so
unset parameters resolve to vLLM's neutral defaults and
policy.generation.* stays the single source of truth. Placed before
**vllm_kwargs, so generation.vllm_kwargs.generation_config can restore
the previous behavior if a model-default is ever wanted.

The async server's explicit top_p assert is kept as defense-in-depth;
its comment is updated to reflect the engine-level pin.

Fixes NVIDIA-NeMo#3497

Signed-off-by: Shubhankar Tripathy <[email protected]>
@lonexreb
lonexreb requested a review from a team as a code owner August 17, 2026 19:14
@copy-pr-bot

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

@lonexreb

Copy link
Copy Markdown
Contributor Author

/ok to test fdec4b6

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Aug 19, 2026
@lonexreb lonexreb changed the title fix(vllm): resolve unset sampling params to neutral defaults, not the model's generation_config.json fix(vllm): resolve unset sampling params to neutral defaults Aug 31, 2026
@lonexreb

Copy link
Copy Markdown
Contributor Author

@terrykong @youngeunkwon0405 — gentle ping when you have bandwidth. This one fixes the off-policy sampling drift from #3497 (model generation_config.json silently overriding unset sampling params) at the engine level. All pre-CI checks are green and the branch is mergeable against current main; it still needs a CI:* label to run the full tier. Happy to address any feedback or rebase again if it goes stale.

@lonexreb

Copy link
Copy Markdown
Contributor Author

Closing. #5006 fixed this on main: vLLM workers now default to generation_config="vllm", so unset sampling fields get neutral values. Details on #3497.

@lonexreb lonexreb closed this Nov 30, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-maintainers Waiting on maintainers to respond label Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vLLM resolves unset sampling params from the model's generation_config.json, not neutral defaults

2 participants