Skip to content

fix: make logprobs capture robust to top_logprobs=null in vllm model - #1612

Merged
ananthsub merged 1 commit into
NVIDIA-NeMo:mainfrom
ananthsub:ansubramania/fix-top-logprobs-null
Jun 16, 2026
Merged

ananthsub merged 1 commit into
NVIDIA-NeMo:mainfrom
ananthsub:ansubramania/fix-top-logprobs-null

Conversation

@ananthsub

@ananthsub ananthsub commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

vLLM computes logprobs = top_logprobs if logprobs else None, so a request carrying an explicit top_logprobs field makes vLLM return no logprobs. That empties the captured token ids and silently zeroes the training loss mask, which freezes RL training with no error.

  • Pin top_logprobs=0 when return_token_id_information is set, so capture is independent of any value inherited from the request or dataset
  • Drop a null top_logprobs on the non-capture path before forwarding
  • Raise a clear error when capture is requested but vLLM returns no logprobs, instead of an opaque TypeError or silently empty training data

supersedes #1013

vLLM computes `logprobs = top_logprobs if logprobs else None`, so a request
carrying an explicit top_logprobs=null (common in replayed rollout JSONL) makes
vLLM return no logprobs. That empties the captured token ids and silently
zeroes the training loss mask, which freezes RL training with no error.

- Pin top_logprobs=0 when return_token_id_information is set, so capture is
  independent of any value inherited from the request or dataset.
- Drop a null top_logprobs on the non-capture path before forwarding.
- Raise a clear error when capture is requested but vLLM returns no logprobs,
  instead of an opaque TypeError or silently empty training data.

Add unit tests covering all three.

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
@ananthsub
ananthsub merged commit 25c8896 into NVIDIA-NeMo:main Jun 16, 2026
22 checks passed
@ananthsub
ananthsub deleted the ansubramania/fix-top-logprobs-null branch June 16, 2026 19:04
ritaneves pushed a commit that referenced this pull request Jun 25, 2026
…1612)

vLLM computes `logprobs = top_logprobs if logprobs else None`, so a
request carrying an explicit `top_logprobs` field makes vLLM return no
logprobs. That empties the captured token ids and silently zeroes the
training loss mask, which freezes RL training with no error.

- Pin `top_logprobs=0` when `return_token_id_information` is set, so
capture is independent of any value inherited from the request or
dataset
- Drop a null `top_logprobs` on the non-capture path before forwarding
- Raise a clear error when capture is requested but vLLM returns no
logprobs, instead of an opaque TypeError or silently empty training data

supersedes #1013

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Rita Fernandes Neves <rfernandesne@nvidia.com>

This branch was previously deployed

1 inactive deployment
public — c6ff3c03 Deployed Jun 16, 2026 by copy-pr-bot[bot] via release / finalize / notify #362
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Log probabilities are not returned by vLLM when top_logprobs is set to null

2 participants