Conversation
…400)
SamplingParams.verify() still raises plain ValueError for some
request-caused validation failures (e.g. trace_decode_token_ids=[]).
Because InputProcessor._validate_params runs lazily inside
AsyncLLM.generate(), such errors fall into the generic exception
branch and get wrapped in a bare EngineGenerateError, so the API
server returns HTTP 500 with an empty message instead of a 400.
The schemathesis fuzz job (H200 Entrypoints OpenAI Part 1) found this
repeatedly through POST /inference/v1/generate: any fuzzed
sampling_params tripping a plain-ValueError validation produced
{"error":{"message":"","type":"InternalServerError",...,"code":500}}
(main builds 84796, 85124, 85154).
Convert ValueError from both params.verify() call sites into
VLLMValidationError at the _validate_params boundary, and migrate the
two remaining plain ValueError raises in the sampling branch. Client
errors then take the existing 'except VLLMClientError: raise'
pass-through in AsyncLLM.generate and map to 400 with the real message.
Verified live against the exact fuzzed payload on the CI image: the
request now returns 400 'trace_decode_token_ids must be a non-empty
list.' instead of the empty 500.
Co-authored-by: Sherlock <sherlock@agents.local>
Signed-off-by: Kevin Luu <51931015+khluu@users.noreply.github.com>
|
Exact CI validation is terminal green: isolated build #85158 at head Caveat stated plainly: the fuzz is randomized, so a single green run is supporting rather than conclusive evidence — the conclusive part is the deterministic live reproduction in the PR description (exact shrunk payload: empty 500 before the fix, |
|
Are you suggesting that exception handling exhibits a degree of nondeterminism? Our entrypoints appear to be haunted. LOL.... e.g.
|
|
Just closed #54402 in favor of this PR. |
Purpose
Fix the recurring randomized-Schemathesis failures in the H200
Entrypoints Integration (API Server OpenAI - Part 1)CI job: fuzzedPOST /inference/v1/generaterequests intermittently produced{"error":{"message":"","type":"InternalServerError","param":null,"code":500}}(main builds #84796, #85124, #85154 — the job now fails most runs).Root cause
SamplingParams.verify()still raises plainValueErrorfor some request-caused validation failures (e.g.trace_decode_token_ids=[], which passes pydantic and the endpoint's msgspec pre-check).InputProcessor._validate_paramsruns lazily insideAsyncLLM.generate(), whose exception handling deliberately passesVLLMClientErrorthrough — but a plainValueErrorfalls into the generic branch and is wrapped in a bareEngineGenerateError(async_llm.py), which the entrypoints error mapper classifies as a server error. Result: HTTP 500 with an empty message instead of a 400, and the fuzz check correctly flags every 5xx.Reproduced deterministically with the exact schemathesis-shrunk payload against the CI image (SmolVLM-256M, the schema-test server config): unpatched → empty 500 with the full
EngineGenerateErrorchain in--log-error-stack; patched →400 {"message":"trace_decode_token_ids must be a non-empty list.","type":"BadRequestError"}.Changes
InputProcessor._validate_params: convertValueErrorfrom bothparams.verify()call sites (sampling and pooling) intoVLLMValidationErrorat the validation boundary, so current and future plain-ValueErrorvalidations surface as 400s with their real message via the existingexcept VLLMClientError: raisepass-through.ValueErrorraises in the sampling branch (return_sampling_masktemperature/top_k gates) toVLLMValidationErrorwithparameter/value, matching the rest of the function.tests/v1/engine/test_input_processor_trace_replay.pyrunning the realverify()withtrace_decode_token_ids=[]and assertingVLLMValidationError; verified it fails without the fix.Duplicate-work check
Searched open PRs for
trace_decode_token_ids,EngineGenerateError 500, andschemathesis inference generate; no open PR addresses this classification bug.Test plan
tests/v1/engine/test_input_processor_trace_replay.py: 6/6 passed (new test fails without the fix).vllm serve HuggingFaceTB/SmolVLM-256M-Instructwith the schema-test args): exact fuzzed payload returns 400 with message after the fix, empty 500 before.entrypoints-integration-api-server-openai-part-1(the schemathesis job) to be linked in comments.AI-assistance disclosure
This change was prepared with AI assistance and reviewed before submission.