vLLM KV cache layout: block ID → byte address
One flat byte array; block table maps logical → physical
b
, no addresses. Each same-shape layer group gets its own
KVCacheTensor
view:
addr = offset + l × layer_stride + b × block_stride + slot × row_width
layout
BLHNC (block-outer)
LBNHC (layer-outer)
block_size
16
64
num_blocks
3
4
8
scenario
DeepSeek sparse attention: MLA (compressed latent KV) 656 B/token × 2 layers + Indexer (sparse index keys) 132 B/token × 2 layers, sharing one block table
KVCacheTensor params per spec
spec
offset
layer_stride
block_stride
row width
page size
Memory map (flat byte array, to scale)
Hover for byte range; green = selected token.
MLA L0
MLA L1
Indexer L0
Indexer L1
Look up a token's address
token t
layer
MLA L0
MLA L1
Indexer L0
Indexer L1