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
34dad19e
Unverified
Commit
34dad19e
authored
Jul 09, 2025
by
zhrrr
Committed by
GitHub
Jul 09, 2025
Browse files
[Bugfix] set default set cuda_graph_sizes to min(self.max_num_seqs * 2, 512) (#20628)
Signed-off-by:
izhuhaoran
<
izhuhaoran@qq.com
>
parent
6db31e7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
vllm/config.py
vllm/config.py
+12
-4
No files found.
vllm/config.py
View file @
34dad19e
...
@@ -2147,11 +2147,12 @@ class SchedulerConfig:
...
@@ -2147,11 +2147,12 @@ class SchedulerConfig:
NOTE: This will be replaced by speculative config in the future; it is
NOTE: This will be replaced by speculative config in the future; it is
present to enable correctness tests until then."""
present to enable correctness tests until then."""
cuda_graph_sizes
:
list
[
int
]
=
field
(
default_factory
=
lambda
:
[
512
])
cuda_graph_sizes
:
list
[
int
]
=
field
(
default_factory
=
list
)
"""Cuda graph capture sizes, default is 512.
"""Cuda graph capture sizes
1. if one value is provided, then the capture list would follow the
1. if none provided, then default set to [min(max_num_seqs * 2, 512)]
2. if one value is provided, then the capture list would follow the
pattern: [1, 2, 4] + [i for i in range(8, cuda_graph_sizes + 1, 8)]
pattern: [1, 2, 4] + [i for i in range(8, cuda_graph_sizes + 1, 8)]
2
. more than one value (e.g. 1 2 128) is provided, then the capture list
3
. more than one value (e.g. 1 2 128) is provided, then the capture list
will follow the provided list."""
will follow the provided list."""
delay_factor
:
float
=
0.0
delay_factor
:
float
=
0.0
...
@@ -2316,6 +2317,13 @@ class SchedulerConfig:
...
@@ -2316,6 +2317,13 @@ class SchedulerConfig:
self
.
max_num_partial_prefills
,
self
.
max_long_partial_prefills
,
self
.
max_num_partial_prefills
,
self
.
max_long_partial_prefills
,
self
.
long_prefill_token_threshold
)
self
.
long_prefill_token_threshold
)
# NOTE: Default set cuda_graph_sizes to [min(max_num_seqs * 2, 512)].
# This avoids OOM in tight memory scenarios with small max_num_seqs,
# and prevents capture of many large graphs (>512) that would greatly
# increase startup time with limited performance benefit.
if
not
self
.
cuda_graph_sizes
:
self
.
cuda_graph_sizes
=
[
min
(
self
.
max_num_seqs
*
2
,
512
)]
@
model_validator
(
mode
=
'after'
)
@
model_validator
(
mode
=
'after'
)
def
_verify_args
(
self
)
->
Self
:
def
_verify_args
(
self
)
->
Self
:
if
(
self
.
max_num_batched_tokens
<
self
.
max_model_len
if
(
self
.
max_num_batched_tokens
<
self
.
max_model_len
...
...
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