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
ad56e684
Unverified
Commit
ad56e684
authored
Aug 06, 2024
by
Liangsheng Yin
Committed by
GitHub
Aug 06, 2024
Browse files
Fix stuck in `get_new_prefill_batch` (#948)
parent
ffb15744
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
python/sglang/srt/managers/tp_worker.py
python/sglang/srt/managers/tp_worker.py
+5
-4
No files found.
python/sglang/srt/managers/tp_worker.py
View file @
ad56e684
...
@@ -364,12 +364,13 @@ class ModelTpServer:
...
@@ -364,12 +364,13 @@ class ModelTpServer:
# Compute matched prefix length
# Compute matched prefix length
for
req
in
self
.
waiting_queue
:
for
req
in
self
.
waiting_queue
:
req
.
input_ids
=
req
.
origin_input_ids
+
req
.
output_ids
req
.
input_ids
=
req
.
origin_input_ids
+
req
.
output_ids
try_match_ids
=
req
.
input_ids
if
req
.
return_logprob
:
try_match_ids
=
req
.
input_ids
[:
req
.
logprob_start_len
]
# NOTE: the prefix_indices must always be aligned with last_node
prefix_indices
,
last_node
=
self
.
tree_cache
.
match_prefix
(
prefix_indices
,
last_node
=
self
.
tree_cache
.
match_prefix
(
rid
=
req
.
rid
,
rid
=
req
.
rid
,
key
=
try_match_ids
key
=
req
.
input_ids
,
)
)
if
req
.
return_logprob
:
prefix_indices
=
prefix_indices
[:
req
.
logprob_start_len
]
req
.
extend_input_len
=
len
(
req
.
input_ids
)
-
len
(
prefix_indices
)
req
.
extend_input_len
=
len
(
req
.
input_ids
)
-
len
(
prefix_indices
)
req
.
prefix_indices
=
prefix_indices
req
.
prefix_indices
=
prefix_indices
req
.
last_node
=
last_node
req
.
last_node
=
last_node
...
...
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