PagedAttention & Continuous Batching
LLM serving must manage many sequences whose KV caches grow at different rates. Paged KV-memory techniques allocate cache in blocks/pages rather than requiring one large contiguous region per sequence. Continuous batching lets the scheduler add and remove requests as sequences progress instead of waiting for a fixed batch to finish.
type KvBlock = { blockId: number; sequenceId: string; tokens: number };
Why it improves utilization
Traditional static batching wastes time when short sequences finish early. Continuous scheduling keeps accelerator work populated while paged KV allocation reduces fragmentation.
Practice
- What memory problem does paged KV allocation address?
- Why does continuous batching improve utilization?
- How can aggressive batching hurt latency?
- What admission-control signals should the scheduler consider?