Repository navigation
[CI] Restore the full prefill CUDA graph capture range in test launches - #33847
Merged
Merged
Conversation
5 tasks done
saturn-acc
pushed a commit
to saturn-acc/sglang
that referenced
this pull request
Aug 16, 2026
Atituiset
pushed a commit
to Atituiset/sglang
that referenced
this pull request
Sep 10, 2026
awesome-pro
added a commit
to awesome-pro/sglang
that referenced
this pull request
Sep 27, 2026
…overage post_capture_kv_sizing_planned() returned False for the prefill-coverage case without logging anything, so passing --cuda-graph-max-bs-prefill below chunked_prefill_size turned the feature off with no diagnostic (the sgl-project#33847 case, where a CI-wide 1024 silenced it on H100-class machines whose chunked_prefill_size defaults to 8192). Split the compound condition so the two genuinely-inapplicable gates (backend == DISABLED, chunked_prefill_size <= 0) stay silent and only the coverage shortfall warns, naming both values and the flag that fixes it. The number quoted is max_prefill_buffer_tokens(), so under PP dynamic chunking it is the ceiling the graph actually has to cover. The gate is not relaxed: the return value is unchanged for every input.
awesome-pro
added a commit
to awesome-pro/sglang
that referenced
this pull request
Sep 30, 2026
…overage post_capture_kv_sizing_planned() returned False for the prefill-coverage case without logging anything, so passing --cuda-graph-max-bs-prefill below chunked_prefill_size turned the feature off with no diagnostic (the sgl-project#33847 case, where a CI-wide 1024 silenced it on H100-class machines whose chunked_prefill_size defaults to 8192). Split the compound condition so the two genuinely-inapplicable gates (backend == DISABLED, chunked_prefill_size <= 0) stay silent and only the coverage shortfall warns, naming both values and the knob that fixes it. The number quoted is max_prefill_buffer_tokens(), so under PP dynamic chunking it is the ceiling the graph actually has to cover. The remedy names a value that actually works: * Capture buckets are quantised (256-wide to 4096, then 512-wide) and --cuda-graph-max-bs-prefill does not append its own value, so advising the raw ceiling can be a no-op -- setting it to 10000 leaves the largest bucket at 9728 and the warning fires again. required_prefill_capture_bucket() quotes the smallest bucket that covers the ceiling instead (10240 there). * When the bucket list came from --cuda-graph-bs-prefill, the capture ceiling is not what is short and raising it changes nothing, so the warning points at the list. Detected through _cuda_graph_config_locked, which the calling hook already reads. The gate is not relaxed: the return value is unchanged for every input.
3 of 5 tasks
Eliaaazzz
added a commit
to Eliaaazzz/sglang
that referenced
this pull request
Oct 21, 2026
… under post-capture KV sizing post_capture_kv_sizing_planned() returned False whenever max_prefill_buffer_tokens() exceeded the largest captured prefill bucket. Passing --cuda-graph-max-bs-prefill below chunked_prefill_size therefore turned the feature off without a log line, and the mem_fraction heuristic fell back to estimating graph memory (sgl-project#33847). Decode already handles the same gap: a captured decode max_bs below max_running_requests keeps the feature on and reserves activation headroom. Apply that treatment to prefill, as proposed in RFC sgl-project#33852: - The prefill gate keeps only the hard conditions: a disabled prefill graph or chunked prefill off. - compute_post_capture_kv_resize() detects a prefill coverage shortfall, logs both token counts and raises the headroom to pre_capture_activation_reserve_mb(). - The reserve is sized for the prefill buffer ceiling. Under PP dynamic chunking the ceiling is max(chunked_prefill_size, max_prefill_tokens, 1.25 x chunked_prefill_size), and the chunk-size profiler runs eager prefills of up to 1.25 x chunked_prefill_size after the resize, so pre_capture_activation_reserve_mb() takes an optional prefill_tokens. Its other callers are unchanged. Nothing changes while post-capture KV sizing is off (SGLANG_ENABLE_POST_CAPTURE_KV_SIZING defaults to False). With it on, configs whose largest captured prefill bucket covers the prefill buffer ceiling are unchanged. Tests: - test_server_args: a coverage shortfall keeps the gate True; a disabled prefill graph or chunked prefill off still returns False. - test_kv_canary_headroom: the reserve applies only with a coverage gap, and under PP dynamic chunking it is sized for the 8192-token ceiling with the real reserve formula. - test_post_capture_kv_sizing (GPU e2e): a second server with --chunked-prefill-size 2048 --cuda-graph-max-bs-prefill 512 checks that sizing ran, the warning fired and an eager prefill chunk is served.
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.
Reverts the
--cuda-graph-max-bs-prefill 1024default injection added topopen_launch_serverin #33776: it setsprefill.max_bsin_handle_cuda_graph_config()before_handle_gpu_memory_settings()would derive it fromchunked_prefill_size, which gates off post-capture KV sizing (test_post_capture_kv_sizing.pyfails on H100-class GPUs, wherechunked_prefill_sizeis 8192) and conversely inflates capture from 128 to 1024 for fixtures that set a smallerchunked_prefill_size.CI States
Latest PR Test (Base): ❌ Run #31085624619
Latest PR Test (Extra): ❌ Run #31085627008