Skip to content

fix(vllm): return 400 for plain context overflow - #3878

Merged
yfw merged 1 commit into
super-v3.5-posttrainingfrom
yifu/vllm-context-overflow-http-400
Sep 1, 2026
Merged

yfw merged 1 commit into
super-v3.5-posttrainingfrom
yifu/vllm-context-overflow-http-400

Conversation

@yfw

@yfw yfw commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • translate plain vLLM 0.25 context-length ValueErrors into HTTP 400 responses
  • preserve existing handling for all typed VLLMValidationErrors and re-raise unrelated plain ValueErrors
  • make locally detected overflow messages recognizable by NeMo Gym so deterministic oversized requests are not retried

Motivation

vLLM 0.25 may raise a plain ValueError while preprocessing an oversized chat prompt. The embedded NeMo RL server previously surfaced it as HTTP 500, causing NeMo Gym to retry the same request even though it cannot succeed.

Validation

  • focused vLLM HTTP server unit tests: 5 passed
  • Ruff lint and format checks for the modified files

vLLM 0.25 can raise a plain ValueError when a chat prompt exceeds the model context. The embedded endpoint surfaced that as HTTP 500, causing NeMo Gym to retry a deterministic request that cannot succeed.

Translate only context-length-shaped ValueErrors to HTTP 400 while preserving all typed VLLMValidationError handling and re-raising unrelated ValueErrors. Keep local clamp errors recognizable by Gym and cover each exception path with unit tests.

Signed-off-by: Yi-Fu Wu <[email protected]>
@yfw
yfw requested review from a team as code owners August 27, 2026 19:18
@copy-pr-bot

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

@yfw
yfw merged commit 00295c5 into super-v3.5-posttraining Sep 1, 2026
10 checks passed
@yfw
yfw deleted the yifu/vllm-context-overflow-http-400 branch September 1, 2026 00:19
yfw added a commit that referenced this pull request Sep 2, 2026
Conflicts in vllm_worker_async.py: both sides converted context-length
overflow errors to HTTP 400. Kept this branch's version, which keys on the
"context length" marker that Gym's vllm_model proxy actually checks and is
pinned by tests/unit/models/generation/test_vllm_context_length_overflow.py.
Dropped the now-unreachable plain-ValueError handler from #3878 and replaced
its test parameter that lacked the marker with the two real vLLM messages.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
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.

1 participant