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
62d54ba4
Unverified
Commit
62d54ba4
authored
Nov 23, 2025
by
Woosuk Kwon
Committed by
GitHub
Nov 23, 2025
Browse files
[Model Runner V2] Optimize CUDA graph capture time (#29275)
Signed-off-by:
Woosuk Kwon
<
woosuk.kwon@berkeley.edu
>
parent
b004c004
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
vllm/v1/worker/gpu/cudagraph_utils.py
vllm/v1/worker/gpu/cudagraph_utils.py
+4
-1
vllm/v1/worker/gpu/model_runner.py
vllm/v1/worker/gpu/model_runner.py
+1
-0
No files found.
vllm/v1/worker/gpu/cudagraph_utils.py
View file @
62d54ba4
...
...
@@ -106,7 +106,10 @@ class CudaGraphManager:
input_buffers
.
query_start_loc
.
np
[:
batch_size
+
1
]
=
np
.
arange
(
batch_size
+
1
)
input_buffers
.
query_start_loc
.
np
[
batch_size
:]
=
batch_size
input_buffers
.
query_start_loc
.
copy_to_gpu
()
input_buffers
.
seq_lens
[:
batch_size
]
=
self
.
max_model_len
# HACK(woosuk): To optimize warmup time, we use 1 (instead of max_model_len)
# for seq_lens. This leads to a mismatch between seq_lens (GPU) and
# seq_lens_np (CPU), which might cause issues in some attention backends.
input_buffers
.
seq_lens
[:
batch_size
]
=
1
input_buffers
.
seq_lens
[
batch_size
:]
=
0
input_block_tables
=
[
x
[:
batch_size
]
for
x
in
block_tables
.
input_block_tables
]
...
...
vllm/v1/worker/gpu/model_runner.py
View file @
62d54ba4
...
...
@@ -313,6 +313,7 @@ class GPUModelRunner(LoRAModelRunnerMixin, KVConnectorModelRunnerMixin):
return
0
start_time
=
time
.
perf_counter
()
gc
.
collect
()
torch
.
cuda
.
empty_cache
()
start_free_gpu_memory
=
torch
.
cuda
.
mem_get_info
()[
0
]
...
...
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