From 1cba3ab467956f8d26caee95aac9c6c5541aa1b3 Mon Sep 17 00:00:00 2001 From: fzyzcjy <5236035+fzyzcjy@users.noreply.github.com> Date: Tue, 19 May 2026 09:20:00 +0800 Subject: [PATCH] Stop returning the unused prefix-computed flag from priority calc (#25718) --- python/sglang/srt/managers/schedule_policy.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/python/sglang/srt/managers/schedule_policy.py b/python/sglang/srt/managers/schedule_policy.py index 2ee02b2e7..55366c334 100644 --- a/python/sglang/srt/managers/schedule_policy.py +++ b/python/sglang/srt/managers/schedule_policy.py @@ -160,19 +160,17 @@ class SchedulePolicy: def calc_priority( self, waiting_queue: List[Req], running_batch: Optional[ScheduleBatch] = None - ) -> bool: + ) -> None: if self.policy == CacheAgnosticPolicy.FCFS: if self.enable_priority_scheduling: SchedulePolicy._sort_by_priority_and_fcfs( waiting_queue, self.priority_sign ) - return False + return policy = self._determine_active_policy(waiting_queue) - prefix_computed = False if isinstance(policy, CacheAwarePolicy): - prefix_computed = True temporary_deprioritized = self._compute_prefix_matches( waiting_queue, policy ) @@ -200,7 +198,6 @@ class SchedulePolicy: SchedulePolicy._sort_by_routing_key(waiting_queue, running_batch) else: raise ValueError(f"Unknown CacheAgnostic Policy: {policy=}") - return prefix_computed def _determine_active_policy(self, waiting_queue: List[Req]) -> Policy: if self.policy == CacheAwarePolicy.LPM and len(waiting_queue) > 128: