fix: always capture default prefill CUDA graph - #33352
Merged
mickqian merged 1 commit intoAug 8, 2026
Merged
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
mickqian
marked this pull request as ready for review
August 7, 2026 04:40
mickqian
requested review from
Fridge003,
Ying1123,
hnyls2002,
ispobock and
merrymercy
as code owners
August 7, 2026 04:40
mickqian
force-pushed
the
codex/remove-prefill-graph-memory-gate
branch
from
August 7, 2026 04:44
5c744cd to
25099dd
Compare
Collaborator
Author
|
/tag-and-rerun-ci |
This was referenced Aug 8, 2026
Xia-Weiwen
pushed a commit
to Xia-Weiwen/sglang
that referenced
this pull request
Aug 10, 2026
saturn-acc
pushed a commit
to saturn-acc/sglang
that referenced
this pull request
Aug 16, 2026
This was referenced Aug 21, 2026
jakki-amd
pushed a commit
to jakki-amd/sglang
that referenced
this pull request
Sep 9, 2026
Atituiset
pushed a commit
to Atituiset/sglang
that referenced
this pull request
Sep 10, 2026
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.
Summary
getattrand replace the obsolete threshold tests with a regression test that verifies capture still proceeds with 3.99 GiB freeExisting explicit disable and model/backend compatibility guards are unchanged.
Root cause
The memory gate used a model-agnostic fixed threshold after weights, KV cache, and eager buffers were allocated. That allowed default configurations to disable prefill CUDA graphs at runtime and introduced a silent performance regression for otherwise supported models.
Memory sizing should be handled by the configured cache/capture parameters. An automatically selected prefill graph should not be overridden by a hard-coded free-memory threshold.
Validation
pre-commit run --files python/sglang/srt/model_executor/model_runner_components/cuda_graph_setup.py test/registered/unit/model_executor/test_prefill_cuda_graph_runner.pypython3 -m pytest -q test/registered/unit/model_executor/test_prefill_cuda_graph_runner.py: 5 passed, 2 subtests passedsglang serve --model-path Qwen/Qwen3-8B(only host/port added):prefill.backend='breakable'cuda graph: TrueFollow-up to #31204 and its review feedback.
CI States
Latest PR Test (Base): ✅ Run #31148378656
Latest PR Test (Extra): ❌ Run #31148378484