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
9216b106
Unverified
Commit
9216b106
authored
Apr 25, 2024
by
Liangsheng Yin
Committed by
GitHub
Apr 25, 2024
Browse files
Improve performance when running with full parallel (#394)
parent
da19434c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
python/sglang/srt/managers/router/model_rpc.py
python/sglang/srt/managers/router/model_rpc.py
+3
-1
No files found.
python/sglang/srt/managers/router/model_rpc.py
View file @
9216b106
...
@@ -348,6 +348,7 @@ class ModelRpcServer:
...
@@ -348,6 +348,7 @@ class ModelRpcServer:
# Undo the insertion
# Undo the insertion
delta
=
self
.
tree_cache
.
dec_ref_counter
(
req
.
last_node
)
delta
=
self
.
tree_cache
.
dec_ref_counter
(
req
.
last_node
)
available_size
+=
delta
available_size
+=
delta
break
else
:
else
:
# Add this request to the running batch
# Add this request to the running batch
self
.
token_to_kv_pool
.
add_refs
(
req
.
prefix_indices
)
self
.
token_to_kv_pool
.
add_refs
(
req
.
prefix_indices
)
...
@@ -356,7 +357,8 @@ class ModelRpcServer:
...
@@ -356,7 +357,8 @@ class ModelRpcServer:
req
.
extend_input_len
+
req
.
max_new_tokens
()
req
.
extend_input_len
+
req
.
max_new_tokens
()
)
)
new_batch_input_tokens
+=
req
.
extend_input_len
new_batch_input_tokens
+=
req
.
extend_input_len
else
:
break
if
len
(
can_run_list
)
==
0
:
if
len
(
can_run_list
)
==
0
:
return
None
return
None
...
...
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