Skip to content

[Bugfix][Core] Reject non-positive output processing chunk sizes - #54409

Open
git-jxj wants to merge 1 commit into
vllm-project:mainfrom
git-jxj:fix/output-proc-chunk-size-validation
Open

[Bugfix][Core] Reject non-positive output processing chunk sizes#54409
git-jxj wants to merge 1 commit into
vllm-project:mainfrom
git-jxj:fix/output-proc-chunk-size-validation

Conversation

@git-jxj

@git-jxj git-jxj commented Aug 30, 2026

Copy link
Copy Markdown

Purpose

VLLM_V1_OUTPUT_PROC_CHUNK_SIZE controls how many engine outputs the V1
async output handler processes before yielding to the event loop. The value is
used as the step argument to range() without validation:

  • 0 raises ValueError and stops the output handler.
  • A negative value produces an empty range, so pending outputs are silently
    skipped.

Validate the value when the environment variable is read so invalid
configurations fail early with a clear error. The default value (128) and all
positive overrides keep their existing behavior.

Duplicate check: no matching issue or open PR was found after searching for
VLLM_V1_OUTPUT_PROC_CHUNK_SIZE, output processing chunk size, and
output_proc_chunk_size in vllm-project/vllm.

Changes

  • Parse and validate VLLM_V1_OUTPUT_PROC_CHUNK_SIZE in a dedicated getter.
  • Reject zero and negative values with a descriptive ValueError.
  • Cover the default, a positive override, zero, and a negative value in the
    existing environment-variable test suite.

Test Plan

.venv/bin/python -m pytest tests/test_envs.py -v
.venv/bin/pre-commit run --files vllm/envs.py tests/test_envs.py

Test Result

Before the fix, the new non-positive-value regression cases fail because both
0 and -1 are accepted. Downstream, zero crashes range() while a negative
step skips the output-processing loop.

After the fix:

59 passed, 16 warnings in 15.60s
All applicable pre-commit hooks passed.

Model evaluation: not applicable. This change only rejects invalid
configuration values and does not change model outputs, accuracy, or valid
serving behavior.

AI Assistance

OpenAI Codex assisted with this change.

Reject zero and negative output-processing chunk sizes before the async output handler can crash or skip all pending outputs.

Assisted-by: OpenAI Codex
Signed-off-by: git-jxj <65210887+git-jxj@users.noreply.github.com>
@mergify mergify Bot added the bug Something isn't working label Aug 30, 2026
@git-jxj
git-jxj marked this pull request as ready for review August 30, 2026 08:53

@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.

@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

PRs do not trigger a full CI run by default. Reviewers with write access and configured trusted contributors can comment /ci run for upstream CI or /amd-ci run for AMD CI only whenever CI signals are needed.

Once the PR is approved or has the ready label, the PR author can also use the corresponding /ci run, /ci retry, and /ci cancel commands, or their /amd-ci variants. New commits do not start upstream CI automatically.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

Agent Guidelines

IMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban.

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant