fix: resolve silent request skipping in PRIORITY scheduling (#49206)
Signed-off-by: Tejas-Raj01 <rajtejas.xyz@gmail.com>
This commit is contained in:
@@ -593,7 +593,16 @@ class Scheduler(SchedulerInterface):
|
||||
self.running,
|
||||
key=lambda r: (r.priority, r.arrival_time),
|
||||
)
|
||||
self.running.remove(preempted_req)
|
||||
# Record the index of the preemption victim to
|
||||
# maintain accurate loop state.
|
||||
victim_index = self.running.index(preempted_req)
|
||||
del self.running[victim_index]
|
||||
# Decrement the loop cursor if the removed request
|
||||
# preceded the current iteration, preventing the
|
||||
# silent omission of the subsequent request.
|
||||
if victim_index < req_index:
|
||||
req_index -= 1
|
||||
|
||||
if preempted_req in scheduled_running_reqs:
|
||||
preempted_req_id = preempted_req.request_id
|
||||
scheduled_running_reqs.remove(preempted_req)
|
||||
@@ -611,7 +620,6 @@ class Scheduler(SchedulerInterface):
|
||||
for i in preempted_encoder_inputs
|
||||
)
|
||||
encoder_compute_budget += num_embeds_to_restore
|
||||
req_index -= 1
|
||||
else:
|
||||
preempted_req = self.running.pop()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user