Repository navigation
[Bugfix][Model Runner] Bound dummy seq_lens by max_model_len - #53671
Draft
zupengwang wants to merge 1 commit into
Draft
zupengwang wants to merge 1 commit into
zupengwang wants to merge 1 commit into
Conversation
Co-authored-by: OpenAI <support@openai.com> Signed-off-by: Zupeng Wang <71580390+zupengwang@users.noreply.github.com>
zupengwang
marked this pull request as draft
September 12, 2026 05:31
This branch has not been deployed
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 #53658.
V1
GPUModelRunner._dummy_runcould assign every dummy request a sequencelength equal to the total CUDA graph capture size. When that capture size was
larger than
max_model_len, a dummy request claimed more KV pages than itsblock-table row could address. This could cause an out-of-bounds block-table
read in TRITON_ATTN or a page-mask shape mismatch in FLEX_ATTENTION.
This change:
max_model_len;max_model_lenbecause it represents multiple batched requests;
exceeds the model length.
I checked open PRs by issue number and relevant keywords immediately before
publishing. I found no duplicate PR and no existing PR from this branch.
Test Plan
attention reproducer at 4096, 4097, and 4128 tokens for
max_model_len=4096.FLEX_ATTENTION, FULL cudagraph mode,
max_model_len=1024, and capture size1032.
git diff --check.Test Result
RC=0)CUDA error: an illegal memory access was encountered(
RC=1)CUDA error: an illegal memory access was encountered(
RC=1)CUDA_VISIBLE_DEVICES=5 .venv/bin/python -m pytest -q -s tests/v1/cudagraph/test_cudagraph_mode.py::test_full_cudagraph_capture_size_exceeds_max_model_len1 passed, 14 warnings in 32.26s.venv/bin/python -m pytest -q tests/v1/cudagraph/test_cudagraph_dispatch.py tests/v1/cudagraph/test_cudagraph_manager.py16 passed, 14 warnings in 35.37spre-commit run ruff-check --files tests/v1/cudagraph/test_cudagraph_mode.py vllm/v1/worker/gpu_model_runner.pypre-commit run ruff-format --files tests/v1/cudagraph/test_cudagraph_mode.py vllm/v1/worker/gpu_model_runner.pypre-commit run mypy-3.12 --hook-stage manual --files tests/v1/cudagraph/test_cudagraph_mode.py vllm/v1/worker/gpu_model_runner.pygit diff --checkThe umbrella changed-files pre-commit command did not complete because the
unrelated
actionlinthook initialization hitSSL: UNEXPECTED_EOF_WHILE_READING;a retry later hung and was stopped. The relevant Ruff, format, and mypy hooks
listed above completed successfully.
No model evaluation was run because this change only constrains invalid dummy
capture metadata and does not alter real-request model outputs.
AI assistance was used for issue analysis, implementation, and test execution.
I reviewed every changed line and verified the behavior and test results.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.