All Questions
Llm Inference Serving hard

Under continuous batching, running sequences keep growing until KV cache blocks run out mid-decode. Long-running requests that are close to finishing are the most latency-sensitive. Which preemption policy is best?

  1. A Preempt the newest sequences, free their blocks, and restore them later by recomputing via prefill, or by swapping KV to host memory if long.
  2. B Reserve worst-case KV for every request at admission, so preemption is never needed and no sequence can run out of memory during decode.
  3. C Preempt the oldest running sequences first, since they hold the most KV blocks and freeing them reclaims the largest amount of memory fastest.
  4. D Truncate the oldest tokens in every sequence's KV cache to a sliding window, so all sequences keep decoding and none of them are paused.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions