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
8f790ac1
".github/vscode:/vscode.git/clone" did not exist on "2255a0fc9f6b204f152da7920f116a0c22a1da35"
Unverified
Commit
8f790ac1
authored
Aug 14, 2024
by
Lianmin Zheng
Committed by
GitHub
Aug 14, 2024
Browse files
Fix a bug in cuda graph runner (#1094)
parent
616b59f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
python/sglang/srt/model_executor/cuda_graph_runner.py
python/sglang/srt/model_executor/cuda_graph_runner.py
+5
-5
No files found.
python/sglang/srt/model_executor/cuda_graph_runner.py
View file @
8f790ac1
...
...
@@ -98,8 +98,8 @@ class CudaGraphRunner:
self
.
req_pool_indices
=
torch
.
zeros
(
(
self
.
max_bs
,),
dtype
=
torch
.
int32
,
device
=
"cuda"
)
self
.
seq_lens
=
torch
.
one
s
((
self
.
max_bs
,),
dtype
=
torch
.
int32
,
device
=
"cuda"
)
self
.
position_ids_offsets
=
torch
.
zero
s
(
self
.
seq_lens
=
torch
.
zero
s
((
self
.
max_bs
,),
dtype
=
torch
.
int32
,
device
=
"cuda"
)
self
.
position_ids_offsets
=
torch
.
one
s
(
(
self
.
max_bs
,),
dtype
=
torch
.
int32
,
device
=
"cuda"
)
self
.
out_cache_loc
=
torch
.
zeros
(
...
...
@@ -201,7 +201,7 @@ class CudaGraphRunner:
out_cache_loc
=
out_cache_loc
,
return_logprob
=
False
,
top_logprobs_nums
=
0
,
positions
=
(
seq_lens
-
1
).
to
(
torch
.
int64
),
positions
=
(
seq_lens
-
1
+
position_ids_offsets
).
to
(
torch
.
int64
),
flashinfer_decode_wrapper
=
flashinfer_decode_wrapper
,
)
...
...
@@ -225,8 +225,8 @@ class CudaGraphRunner:
index
=
bisect
.
bisect_left
(
self
.
batch_size_list
,
raw_bs
)
bs
=
self
.
batch_size_list
[
index
]
if
bs
!=
raw_bs
:
self
.
seq_lens
.
fill
_
(
1
)
self
.
position_ids_offsets
.
zero
_
()
self
.
seq_lens
.
zero
_
()
self
.
position_ids_offsets
.
fill
_
(
1
)
self
.
out_cache_loc
.
zero_
()
# Common inputs
...
...
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