Skip to content

[Bugfix][Scheduler] Respect disabled chunked prefill for multimodal requests - #65399

Merged
njhill merged 4 commits into
vllm-project:mainfrom
jzakrzew:fix/nonchunked-pooling-encoder-admission
Nov 4, 2026
Merged

njhill merged 4 commits into
vllm-project:mainfrom
jzakrzew:fix/nonchunked-pooling-encoder-admission

Conversation

@jzakrzew

@jzakrzew jzakrzew commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Fix partial prefill of multimodal pooling requests when chunked prefill is disabled. Bidirectional MEAN-pooling models can crash under async encoder-cache pressure or an explicit long-prefill threshold.

Claims

  • Defer the whole request when encoder limits would force partial prefill, releasing acquired cache references and restoring the compute budget.
  • Ignore long_prefill_token_threshold when chunked prefill is disabled.
  • Add scheduler and real-model regression coverage for both triggers.

Validation

Reproduced with real weights for nvidia/llama-nemotron-embed-vl-1b-v2, using Model Runner V2. Both cases queue two distinct images with chunked prefill disabled:

  • Encoder-cache pressure: async scheduling, a 384-token budget/cache, and 256 tokens per image. The second request fits the next step's token budget while the first image still occupies the encoder cache.
  • Prefill threshold: synchronous scheduling with long_prefill_token_threshold=128, which incorrectly splits the queued prompts.

With the unchanged upstream scheduler (c7a7607519), both cases raise RuntimeError: partial prefill is not supported with MEAN pooling. With this fix, both complete and every batched embedding matches its individually processed reference with cosine similarity ≥0.999.

Focused regressions, 2 passed each:

python -m pytest \
  tests/v1/core/test_scheduler.py \
  -k encoder_cache_pressure_respects_disabled_chunked_prefill -v

python -m pytest \
  tests/models/multimodal/pooling/test_llama_nemotron_vl.py \
  -k test_image_embeddings_without_chunked_prefill -v

Details

The scheduler checks the token budget before scheduling encoder inputs. Encoder-cache exhaustion can subsequently shorten the request to the text before an image, violating disabled chunked prefill. Async scheduling exposes this when an earlier batch still holds encoder-cache references. An explicit long-prefill threshold provides a separate path to partial prefill under synchronous scheduling.

The encoder check lives in _try_schedule_encoder_inputs. The threshold is applied only when chunked prefill is enabled.

Open-PR searches found no equivalent fix. Related work: #63033 adds a PaliGemma-specific whole-prompt guard; #61733 rejects permanently oversized prompts at admission. Neither covers these two triggers.


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

…equests

Defer whole requests when encoder capacity would force partial prefill,
releasing cache references acquired during the abandoned admission attempt.
Ignore long-prefill thresholds when chunked prefill is disabled.

Cover async encoder-cache pressure and synchronous prefill thresholds with
scheduler regressions and real image-embedding comparisons.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Jakub Zakrzewski <jzakrzewski@nvidia.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.

@mergify mergify Bot added pooling llama Related to Llama models multi-modality Related to multi-modality (#4194) bug Something isn't working scheduler labels Nov 3, 2026
@Isotr0py Isotr0py self-assigned this Nov 4, 2026
@Isotr0py
Isotr0py requested review from Isotr0py and removed request for ZJY0516, robertgshaw2-redhat and ywang96 November 4, 2026 13:06
Comment thread vllm/v1/core/sched/scheduler.py Resolved
Comment thread vllm/v1/core/sched/scheduler.py Resolved
jzakrzew and others added 2 commits November 4, 2026 18:39
Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Jakub Zakrzewski <jzakrzewski@nvidia.com>
Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Jakub Zakrzewski <jzakrzewski@nvidia.com>

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

Thanks @jzakrzew

@njhill

njhill commented Nov 4, 2026

Copy link
Copy Markdown
Member

/ci run

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #99993 for commit 2a9aa6d34873.

ℹ️ This PR is 151 commits behind upstream main. Merged upstream main into this branch as 2a9aa6d34873 before starting CI. Pull the branch before pushing more changes.

@njhill
njhill merged commit 947bd30 into vllm-project:main Nov 4, 2026
234 checks passed
ejrtks1020 added a commit to ejrtks1020/vllm that referenced this pull request Nov 4, 2026
…mask

Resolve the scheduler conflict with vllm-project#65399: keep both deferral guards
(whole-prompt prefix LM and disabled chunked prefill), and release
encoder cache references in the whole-prompt guard as well, since it
also defers the request after encoder inputs were scheduled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kang Nahoon <ejrtks102020@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 llama Related to Llama models multi-modality Related to multi-modality (#4194) pooling scheduler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants