Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_continuous-batching-kv-cache

vLLM Continuous Batching & PagedAttention KV-Cache Internals

8 COMPONENTS · 7 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![vLLM Continuous Batching & PagedAttention KV-Cache Internals — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_continuous-batching-kv-cache/opengraph-image)](https://archos.sageideas.dev/d/dgm_continuous-batching-kv-cache)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_continuous-batching-kv-cache)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_continuous-batching-kv-cache" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="vLLM Continuous Batching & PagedAttention KV-Cache Internals — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["LLM Gateway"]
  sched_1["Iteration Scheduler"]
  pfix_2[("Radix Prefix Cache")]
  btab_3[("PagedAttention Table")]
  hbm_4[("GPU HBM KV Blocks")]
  kern_5["Attention & FFN Kernel"]
  swap_6[("CPU Swap / Preempt")]
  downstream_7["Downstream & OTel"]
  client_0 -->|"1. Enqueue · gRPC/SSE"| sched_1
  sched_1 -->|"2a. Hash · RAM"| pfix_2
  sched_1 -->|"2b. Allocate · CUDA"| btab_3
  btab_3 -->|"3a. Gather · HBM3"| hbm_4
  kern_5 -->|"Decode · TensorCo"| hbm_4
  btab_3 -->|"3b. Preempt if · PCIe"| swap_6
  swap_6 -.->|"4. Emit / · OTLP/API"| downstream_7

COMPONENT STACK (8)

  • LLM GatewaySTATELESS
    Streaming SSE Prompts
  • Iteration SchedulerSTATELESS
    Continuous batch + chunked prefill
  • Radix Prefix CacheSTATEFUL
    Shares static system-prompt KV
  • PagedAttention TableSTATEFUL
    Maps logical -> physical 16-tok
  • GPU HBM KV BlocksSTATEFUL
    Non-contiguous VRAM
  • Attention & FFN KernelSTATELESS
    Prefill / Decode
  • CPU Swap / PreemptSTATEFUL
    Evicts low-prio seq on HBM pressure
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (7)

  1. LLM Gateway → Iteration Scheduler (Enqueue)[gRPC/SSE]
  2. Iteration Scheduler → Radix Prefix Cache (Hash)[RAM]
  3. Iteration Scheduler → PagedAttention Table (Allocate)[CUDA]
  4. PagedAttention Table → GPU HBM KV Blocks (Gather)[HBM3]
  5. Attention & FFN Kernel → GPU HBM KV Blocks (Decode)[TensorCo]
  6. PagedAttention Table → CPU Swap / Preempt (Preempt if)[PCIe]
  7. CPU Swap / Preempt → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →