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
zhaoyu6
sglang
Commits
7c162fa9
"torchvision/vscode:/vscode.git/clone" did not exist on "7d83be5e880e9d36cb39242c1b9f785ece8773db"
Unverified
Commit
7c162fa9
authored
Sep 17, 2024
by
Liangsheng Yin
Committed by
GitHub
Sep 17, 2024
Browse files
Fix schedule bug (#1451)
parent
36078fb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
python/sglang/srt/managers/policy_scheduler.py
python/sglang/srt/managers/policy_scheduler.py
+2
-1
No files found.
python/sglang/srt/managers/policy_scheduler.py
View file @
7c162fa9
...
@@ -229,6 +229,7 @@ class PrefillAdder:
...
@@ -229,6 +229,7 @@ class PrefillAdder:
else
:
else
:
add_req_state
(
req
,
insert_sort
=
True
)
add_req_state
(
req
,
insert_sort
=
True
)
cur_rem_tokens
=
self
.
cur_rem_tokens
-
len
(
req
.
origin_input_ids
)
tokens_freed
=
0
tokens_freed
=
0
for
i
,
(
tokens_left
,
tokens_occupied
)
in
enumerate
(
self
.
req_states
):
for
i
,
(
tokens_left
,
tokens_occupied
)
in
enumerate
(
self
.
req_states
):
decode_steps
=
(
decode_steps
=
(
...
@@ -237,7 +238,7 @@ class PrefillAdder:
...
@@ -237,7 +238,7 @@ class PrefillAdder:
else
tokens_left
else
tokens_left
)
)
bs
=
len
(
self
.
req_states
)
-
i
bs
=
len
(
self
.
req_states
)
-
i
if
self
.
cur_rem_tokens
+
tokens_freed
-
decode_steps
*
bs
<=
0
:
if
cur_rem_tokens
+
tokens_freed
-
decode_steps
*
bs
<=
0
:
return
False
return
False
tokens_freed
+=
tokens_occupied
tokens_freed
+=
tokens_occupied
...
...
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