Repository navigation
perf(sampler): capture CUDA graphs for power-of-two batch sizes only - #359
Merged
Merged
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
hodaaaaaaaaaa
force-pushed
the
perf/pow2-cudagraph-sizes
branch
from
October 22, 2026 13:30
e78be8a to
cb8d47d
Compare
hodaaaaaaaaaa
marked this pull request as draft
October 22, 2026 16:25
hodaaaaaaaaaa
force-pushed
the
perf/pow2-cudagraph-sizes
branch
from
October 23, 2026 00:05
cb8d47d to
152090a
Compare
hodaaaaaaaaaa
commented
Oct 23, 2026
| } | ||
|
|
||
|
|
||
| def cudagraph_capture_sizes(max_num_seqs: int) -> list[int]: |
Collaborator
Author
There was a problem hiding this comment.
i didn't add an env var for the capture sizes, I wanted to avoid growing the list of knobs when nothing needs it yet. VLLM_ENFORCE_EAGER=1 still turns graphs off completely. If a real need comes up, adding the variable back is a small change.
hodaaaaaaaaaa
marked this pull request as ready for review
October 23, 2026 00:08
droot
approved these changes
Oct 23, 2026
ShubyM
approved these changes
Oct 23, 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.
Problem
At start-up, vLLM records a CUDA graph for every batch size it might see (172 sizes for gemma-4-E2B) and records them twice. That takes up to a minute.
Change
The sampler records graphs only for powers of two up to the maximum batch size (9 sizes at 256). A batch runs on the next recorded size up.
Results
From the latest fleet test on GKE (eight GSM8K GRPO jobs launched together: gemma-4-E2B on H100, Qwen3-0.6B on L4, LoRA and full fine-tuning), with all three sampler start-up changes (#358, #359, #360):