Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
71e2a277
Commit
71e2a277
authored
Dec 05, 2024
by
Lianmin Zheng
Committed by
zhyncs
Dec 06, 2024
Browse files
Fix the cuda graph capture range for small #max-running-requests (#2359)
parent
4a63c181
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
python/sglang/srt/model_executor/cuda_graph_runner.py
python/sglang/srt/model_executor/cuda_graph_runner.py
+14
-0
No files found.
python/sglang/srt/model_executor/cuda_graph_runner.py
View file @
71e2a277
...
...
@@ -130,6 +130,20 @@ class CudaGraphRunner:
self
.
capture_bs
=
list
(
range
(
1
,
32
))
+
[
64
,
128
]
else
:
self
.
capture_bs
=
[
1
,
2
,
4
]
+
[
i
*
8
for
i
in
range
(
1
,
21
)]
if
max
(
self
.
capture_bs
)
>
model_runner
.
req_to_token_pool
.
size
:
# In some case (e.g., with a small GPU or --max-running-requests), the #max-running-requests
# is very samll. We add more values here to make sure we capture the maximum bs.
self
.
capture_bs
=
list
(
sorted
(
set
(
self
.
capture_bs
+
[
model_runner
.
req_to_token_pool
.
size
-
1
]
+
[
model_runner
.
req_to_token_pool
.
size
]
)
)
)
self
.
capture_bs
=
[
bs
for
bs
in
self
.
capture_bs
...
...
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