Skip to content

[Bugfix] Validate scale-out transfer params - #54324

Merged
yewentao256 merged 3 commits into
vllm-project:mainfrom
taneem-ibrahim:fix/validate-scale-out-transfer-params
Aug 30, 2026
Merged

yewentao256 merged 3 commits into
vllm-project:mainfrom
taneem-ibrahim:fix/validate-scale-out-transfer-params

Conversation

@taneem-ibrahim

Copy link
Copy Markdown
Contributor

Purpose

Fixes #54116.

The /inference/v1/generate endpoint validated sampling_params for MessagePack compatibility before dispatch, but omitted kv_transfer_params and ec_transfer_params. Oversized integers in either field therefore failed later during engine serialization and surfaced as HTTP 500 InternalServerError.

This change validates all three values together before engine dispatch. Serialization errors now use the existing HTTP 400 BadRequestError response path, while valid generation remains unchanged.

Reproducer

Start the server:

PATH="$PWD/.venv/bin:$PATH" CUDA_VISIBLE_DEVICES=0 \
vllm serve Qwen/Qwen3-0.6B \
  --dtype bfloat16 \
  --max-model-len 1024 \
  --enforce-eager \
  --no-enable-prefix-caching

Send requests to /inference/v1/generate using:

{
  "model": "Qwen/Qwen3-0.6B",
  "token_ids": [1, 2, 3],
  "sampling_params": {
    "max_tokens": 1,
    "temperature": 0.0,
    "seed": 0
  },
  "stream": false,
  "kv_transfer_params": {
    "oversized_integer": 158541820065335999920888242752337176824
  }
}

Repeat with ec_transfer_params in place of kv_transfer_params, then omit both fields for the ordinary-generation control request.

Output on main

{"error_type": null, "has_choices": true, "probe": "ordinary_generation", "runtime_seconds": 0.031, "status": 200}
{"error_type": "InternalServerError", "has_choices": false, "probe": "kv_transfer_params", "runtime_seconds": 0.003, "status": 500}
{"error_type": "InternalServerError", "has_choices": false, "probe": "ec_transfer_params", "runtime_seconds": 0.001, "status": 500}

Output on branch

{"error_type": "BadRequestError", "probe": "kv_transfer_params", "runtime_seconds": 0.004, "status": 400}
{"error_type": "BadRequestError", "probe": "ec_transfer_params", "runtime_seconds": 0.001, "status": 400}
{"has_choices": true, "probe": "ordinary_generation", "runtime_seconds": 0.029, "status": 200}

Test Plan

PATH="$PWD/.venv/bin:$PATH" CUDA_VISIBLE_DEVICES=0 \
HF_HUB_CACHE=/tmp/vllm-hf-cache  \
.venv/bin/python -m pytest \
  tests/entrypoints/openai/test_openai_schema.py::test_openapi_stateless \
  -q --tb=short
1 passed, 27 subtests passed, 0 failed, 0 skipped
450.85s pytest; 461.96s wall
PATH="$PWD/.venv/bin:$PATH" CUDA_VISIBLE_DEVICES=0 \
HF_HUB_CACHE=/tmp/vllm-hf-cache  \
.venv/bin/python -m pytest \
  tests/entrypoints/scale_out/token_in_token_out/ \
  -q --tb=short
38 passed, 0 failed, 0 skipped
261.64s pytest; 272.57s wall

AI assistance disclosure

OpenAI Codex (GPT-5) assisted with drafting the code.

Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@taneem-ibrahim taneem-ibrahim changed the title [Bugfix][Frontend] Validate scale-out transfer params [Bugfix] Validate scale-out transfer params Aug 29, 2026
@mergify mergify Bot added frontend bug Something isn't working labels Aug 29, 2026

@yewentao256 yewentao256 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the work!

@yewentao256 yewentao256 added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 30, 2026
@github-actions

Copy link
Copy Markdown

✅ @taneem-ibrahim, CI is now available for this PR.

  • /ci run starts upstream CI; /amd-ci run starts AMD CI only.
  • /ci retry retries failed jobs in the CI build for the current PR head. If the current head has no CI build, it starts a new CI build for the current head containing only jobs that failed in the latest earlier CI build for this PR.
  • /amd-ci retry retries failed jobs in AMD CI for the current PR head. Use /amd-ci run when the current head has no AMD CI build.
  • /ci cancel cancels scheduled or running CI builds for this PR branch; /amd-ci cancel does the same for AMD CI only.

@taneem-ibrahim

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #86196 for commit bfa3e3f799e2.

@yewentao256
yewentao256 merged commit fe6db3e into vllm-project:main Aug 30, 2026
67 checks passed
@taneem-ibrahim
taneem-ibrahim deleted the fix/validate-scale-out-transfer-params branch August 30, 2026 17:20
am-cohere pushed a commit to am-cohere/vllm that referenced this pull request Sep 1, 2026
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
mylibrar pushed a commit to tanyuqian/vllm that referenced this pull request Sep 3, 2026
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
D-G-Dimitrov pushed a commit to D-G-Dimitrov/vllm that referenced this pull request Sep 5, 2026
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
(cherry picked from commit fe6db3e)
michael-gpu pushed a commit to practical-inference/vllm-ampere-extended that referenced this pull request Oct 20, 2026
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

2 participants