Skip to content

Commit b8c9f40

Browse files
Prajjwal Chittoripjdurden
authored andcommitted
Fix reversed FCFS priority in PagedAttentionScheduler preemption
sort_running_by_priority_fcfs sorted self.running ascending by timestamp (oldest first) and then reversed it to newest first. The decode loop then schedules with pop_front and preempts under KV-cache pressure with pop_back, so the reverse made the oldest (highest priority) sequences get preempted first and the newest scheduled first, the opposite of FCFS and of the function's own name. Drop the reverse so running stays oldest-first: pop_front schedules the oldest sequence first and pop_back preempts the newest (lowest priority) first. This matches DefaultScheduler, which sorts ascending without reversing.
1 parent ea2a5eb commit b8c9f40

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

mistralrs-core/src/paged_attention/scheduler.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,6 @@ impl PagedAttentionScheduler {
589589
self.running
590590
.make_contiguous()
591591
.sort_by_key(|seq| get_mut_arcmutex!(seq).timestamp());
592-
self.running.make_contiguous().reverse();
593592
}
594593
}
595594

0 commit comments

Comments
 (0)