MODULE 3 DEEP DIVE · CONTAINERS FOR GENAI & AGENTIC AI
The swap that made this worth doing
The lab's two-variable swap onto vLLM — this deck opens the machinery behind it.
Gourav Shah · School of DevOps & AI · Deep Dive (Part 2)
M3-DD·01
A naive server books the whole floor for a maybe
Naive KV-cache allocation reserves a contiguous worst-case span per request.
M3-DD·02
PagedAttention runs the hotel by the room, not the floor
PagedAttention hands out rooms on demand — a ledger tracks who holds which.
M3-DD·03
Block tables map logical tokens to scattered physical blocks
Fixed-size KV blocks map logical position to scattered physical blocks.
M3-DD·04
98% reserved, unused, and still unavailable to anyone else
A 1024-token reservation for a 20-token answer — the rest sits empty, locked.
M3-DD·05
40% free in aggregate, but no single gap big enough
Contiguity, not total free memory, is what naive allocation runs out of.
M3-DD·06
A static-batch table waits for the slowest guest to leave
A static batch reseats only once the whole dining room has finished.
M3-DD·07
vLLM reseats the moment a table clears
The instant a table clears, a new party is seated — no batch boundary.
M3-DD·08
The scheduler checks every slot, every single step
Every decoding step, vLLM frees finished slots and admits a waiting request.
M3-DD·09
Continuous batching helps throughput; static batching hurts short jobs twice
Static batching pads to the slowest job; continuous batching stays always-busy.
M3-DD·10
Paging is what makes admitting a request every step affordable
Cheap paged allocation is what makes admitting a request every step affordable.
M3-DD·11
Two flags spend the same memory two different ways
Two flags — dtype and max-model-len × max-num-seqs — spend one shared budget.
M3-DD·12
`--swap-space` is accepted, validated, and does nothing here
`--swap-space` is accepted and validated, but contributes zero blocks here.
M3-DD·13
The engine log already did the arithmetic for you
This run's own startup log ties the KV budget straight to a concurrency number.
M3-DD·14
Three gauges tell you which lever to pull
Running, waiting, and cache-usage gauges read together diagnose the bottleneck.
M3-DD·15
One developer at a time never creates the problem this machinery solves
Paging and batching only pay off once requests overlap and compete for memory.
M3-DD·16
Ollama wins the scoreboard; vLLM wins the scaling curve
Ollama wins raw tok/s here; vLLM-CPU scales 3.13x to Ollama's 1.10x.
M3-DD·17
MODULE 3 DEEP DIVE · TAKEAWAYS
What to carry into a real deployment
Next: apply these levers to a real concurrent deployment. · Gourav Shah · School of DevOps & AI
M3-DD·18