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
4080e822
Unverified
Commit
4080e822
authored
Aug 11, 2024
by
Lianmin Zheng
Committed by
GitHub
Aug 11, 2024
Browse files
Fix the case where r.prefix_indices is None (#1031)
parent
c245b789
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
python/sglang/srt/managers/policy_scheduler.py
python/sglang/srt/managers/policy_scheduler.py
+6
-7
No files found.
python/sglang/srt/managers/policy_scheduler.py
View file @
4080e822
...
...
@@ -35,13 +35,12 @@ class PolicyScheduler:
self
.
tree_cache
=
tree_cache
def
calc_priority
(
self
,
waiting_queue
:
List
[
Req
]):
if
self
.
policy
in
[
"lpm"
,
"dfs-weight"
]:
# Compute matched prefix length
for
r
in
waiting_queue
:
# NOTE: the prefix_indices must always be aligned with last_node
r
.
prefix_indices
,
r
.
last_node
=
self
.
tree_cache
.
match_prefix
(
rid
=
r
.
rid
,
key
=
r
.
adjust_max_prefix_ids
()
)
# Compute matched prefix length
for
r
in
waiting_queue
:
# NOTE: the prefix_indices must always be aligned with last_node
r
.
prefix_indices
,
r
.
last_node
=
self
.
tree_cache
.
match_prefix
(
rid
=
r
.
rid
,
key
=
r
.
adjust_max_prefix_ids
()
)
if
self
.
policy
==
"lpm"
:
# Longest Prefix Match
...
...
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