Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
merrymercy committed Dec 17, 2024
1 parent 441ece9 commit 61f9266
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/sglang/srt/managers/schedule_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def calc_priority(self, waiting_queue: List[Req]):
prefix_computed = False
if policy == "lpm" or policy == "dfs-weight":
# rid to deprioritize in the current run for in-batch prefix caching.
temporary_deprioritized = {}
temporary_deprioritized = set()
self.waiting_queue_radix_tree.reset()

for r in waiting_queue:
Expand All @@ -100,8 +100,9 @@ def calc_priority(self, waiting_queue: List[Req]):
len(in_batch_matching_prefixes)
>= IN_BATCH_PREFIX_CACHING_DEPRIORITIZE_THRESHOLD
):
temporary_deprioritized[r.rid] = r
temporary_deprioritized.add(r.rid)
else:
# Insert with a dummy key
self.waiting_queue_radix_tree.insert(
prefix_ids, torch.empty(len(prefix_ids), dtype=torch.bool)
)
Expand Down

0 comments on commit 61f9266

Please sign in to comment.