[Core] Add kvcache watermark to reduce preemptions (#44594)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Hill
2026-06-11 08:27:31 -07:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 23eb7c8fbb
commit 4085ff7cb4
7 changed files with 291 additions and 8 deletions
+7
View File
@@ -143,6 +143,13 @@ class SchedulerConfig:
checking the first chunk. Prevents over-admission and KV cache thrashing
with chunked prefill."""
watermark: float = Field(default=0.0, ge=0.0, lt=1.0)
"""Fraction of total KV cache blocks to keep free (the watermark) when
admitting waiting or preempted requests into the running queue. This headroom
helps avoid frequent KV cache eviction and the resulting repeated preemption
of requests when GPU memory is scarce. Must be in the range [0.0, 1.0); 0.0
(the default) disables the watermark."""
async_scheduling: bool | None = None
"""If set to False, disable async scheduling. Async scheduling helps to
avoid gaps in GPU utilization, leading to better latency and throughput.