[Bugfix] Validate routed-expert prompt offsets before engine submission - #56844
Merged
aoshen02 merged 2 commits intoSep 15, 2026
Merged
Conversation
Consolidate the prompt boundary fixes from vllm-project#55764 and vllm-project#55765. Validate the inclusive offset range in InputProcessor before engine submission, and allow an empty prompt routing slice. Co-authored-by: Megha Agarwal <19240983+meghaagr13@users.noreply.github.com> Co-authored-by: Codex Signed-off-by: aoshen02 <aoshen@inferact.ai>
aoshen02
marked this pull request as ready for review
September 14, 2026 14:26
aoshen02
requested review from
ApostaC,
WoosukKwon,
alexm-redhat,
heheda12345,
ivanium,
njhill,
orozery,
robertgshaw2-redhat and
ywang96
as code owners
September 14, 2026 14:26
Collaborator
Author
|
/amd-ci run |
|
✅ Triggered Buildkite AMD CI #12919 for commit |
Collaborator
Author
|
/ci run |
Collaborator
Author
|
/ci run all |
|
✅ Triggered Buildkite CI #88846 for commit |
|
✅ CI is already running for this commit: https://buildkite.com/vllm/ci/builds/88846 |
Collaborator
Author
|
/ci cancel |
|
✅ Requested cancellation of 1 CI build for |
Collaborator
Author
|
/ci run |
|
✅ Triggered Buildkite CI #88847 for commit |
Collaborator
Author
|
@AndreasKaratzas Can I get a stamp? |
aoshen02
enabled auto-merge (squash)
September 15, 2026 00:37
jeejeelee
approved these changes
Sep 15, 2026
ItsRoy69
pushed a commit
to ItsRoy69/vllm
that referenced
this pull request
Sep 15, 2026
…on (vllm-project#56844) Signed-off-by: aoshen02 <aoshen@inferact.ai> Co-authored-by: Bhushan Asati <bhushanasati25@gmail.com> Co-authored-by: Megha Agarwal <19240983+meghaagr13@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Fixes #55750.
Validate
0 <= routed_experts_prompt_start <= prompt_lengthin InputProcessor, before EngineCore submission. Invalid offsets become validation errors instead of reaching the engine or overflowing MessagePack serialization. An offset equal to the prompt length is valid and returns an empty prompt routing slice.Only two production files change (net +4 lines): reuse the existing prompt-length calculation for one inline range check, and change the scheduler's boundary assertion from
<to<=. No clamping or new helper abstraction.Existing work and credit
This intentionally consolidates the overlapping fixes in #55764 and #55765 at the submitter's request; it is not a separate bug discovery. Both PRs are still open. Compared with those patches, the range check lives in one place, with no extra helper or scheduler clamping. This is limited to prompt offsets, not the broader validation changes in #51891.
Credit, in order:
Validation
Commands (existing uv-managed Python 3.12 environment with precompiled extensions):
.venv/bin/python -m pytest tests/test_request_input_bounds.py tests/v1/core/test_scheduler.py -k 'routed_experts_offset or routed_experts_prompt_start_at_prompt_end' -q .venv/bin/python -m pytest tests/test_request_input_bounds.py tests/v1/core/test_scheduler.py tests/v1/engine/test_input_processor_trace_replay.py -q --tb=short .venv/bin/pre-commit run --files vllm/v1/engine/input_processor.py vllm/v1/core/sched/scheduler.py tests/test_request_input_bounds.py tests/v1/core/test_scheduler.pyImplementation and testing were AI-assisted with Codex. Submitted as a draft pending the human submitter's line-by-line review and test confirmation; attribution does not imply approval of this consolidation by the original authors.