Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
e9056056
Unverified
Commit
e9056056
authored
Nov 21, 2025
by
Woosuk Kwon
Committed by
GitHub
Nov 21, 2025
Browse files
[Model Runner V2] Limit cudagraph size to max decode batch size (#29221)
Signed-off-by:
Woosuk Kwon
<
woosuk.kwon@berkeley.edu
>
parent
1489902b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
vllm/v1/worker/gpu/cudagraph_utils.py
vllm/v1/worker/gpu/cudagraph_utils.py
+9
-4
No files found.
vllm/v1/worker/gpu/cudagraph_utils.py
View file @
e9056056
...
@@ -27,9 +27,11 @@ class CudaGraphManager:
...
@@ -27,9 +27,11 @@ class CudaGraphManager:
device
:
torch
.
device
,
device
:
torch
.
device
,
):
):
self
.
vllm_config
=
vllm_config
self
.
vllm_config
=
vllm_config
self
.
scheduler_config
=
vllm_config
.
scheduler_config
self
.
device
=
device
self
.
device
=
device
self
.
max_model_len
=
vllm_config
.
model_config
.
max_model_len
self
.
max_model_len
=
vllm_config
.
model_config
.
max_model_len
self
.
max_num_reqs
=
self
.
scheduler_config
.
max_num_seqs
self
.
dp_size
=
vllm_config
.
parallel_config
.
data_parallel_size
self
.
dp_size
=
vllm_config
.
parallel_config
.
data_parallel_size
self
.
compilation_config
=
vllm_config
.
compilation_config
self
.
compilation_config
=
vllm_config
.
compilation_config
assert
self
.
compilation_config
is
not
None
assert
self
.
compilation_config
is
not
None
...
@@ -39,9 +41,11 @@ class CudaGraphManager:
...
@@ -39,9 +41,11 @@ class CudaGraphManager:
else
:
else
:
self
.
cudagraph_mode
=
self
.
compilation_config
.
cudagraph_mode
self
.
cudagraph_mode
=
self
.
compilation_config
.
cudagraph_mode
if
self
.
compilation_config
.
cudagraph_capture_sizes
is
not
None
:
if
self
.
compilation_config
.
cudagraph_capture_sizes
is
not
None
:
self
.
cudagraph_sizes
=
sorted
(
cudagraph_sizes
=
sorted
(
self
.
compilation_config
.
cudagraph_capture_sizes
)
self
.
compilation_config
.
cudagraph_capture_sizes
# Limit the cudagraph sizes to the max decode batch size.
)
self
.
cudagraph_sizes
=
[
x
for
x
in
cudagraph_sizes
if
x
<=
self
.
max_num_reqs
]
else
:
else
:
self
.
cudagraph_sizes
=
[]
self
.
cudagraph_sizes
=
[]
self
.
padded_sizes
=
self
.
_init_padded_sizes
()
self
.
padded_sizes
=
self
.
_init_padded_sizes
()
...
@@ -54,9 +58,10 @@ class CudaGraphManager:
...
@@ -54,9 +58,10 @@ class CudaGraphManager:
if
not
self
.
cudagraph_mode
.
has_full_cudagraphs
():
if
not
self
.
cudagraph_mode
.
has_full_cudagraphs
():
# Full cuda graphs are not used.
# Full cuda graphs are not used.
return
{}
return
{}
if
not
self
.
cudagraph_sizes
:
return
{}
padded_sizes
:
dict
[
int
,
int
]
=
{}
padded_sizes
:
dict
[
int
,
int
]
=
{}
assert
len
(
self
.
cudagraph_sizes
)
>
0
for
i
in
range
(
1
,
self
.
cudagraph_sizes
[
-
1
]
+
1
):
for
i
in
range
(
1
,
self
.
cudagraph_sizes
[
-
1
]
+
1
):
for
x
in
self
.
cudagraph_sizes
:
for
x
in
self
.
cudagraph_sizes
:
if
i
<=
x
:
if
i
<=
x
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment