# Paged KV cache store (`paged_kv_cache_store`) | ServingStudio Kernel Library

Encodes bf16 rows into a DeepInfer paged KV cache through a slot map.

Every row reads its slot; rows with a slot are quantized to the cache encoding and written to that page position. In the prefill SWA store only the last ring's worth of rows of a sequence has a slot.

Category: Attention; group: Compressed sparse MLA. Interactive page: https://servingstudio.cs.washington.edu/kernels.html?kind=paged_kv_cache_store. All kernel kinds: https://servingstudio.cs.washington.edu/kernels.md.

## Formula

- `bytes = 4·T slots + stored·(2·512 + bytes_per_token)`

## How it is measured

GPU kernel time from CUPTI activity records, averaged over repeated launches in one capture. The L2 cache is flushed before each launch, so the numbers are cold-cache times.

## Arguments

| Argument | Type | Unit | Meaning |
| --- | --- | --- | --- |
| `num_tokens` | number | tokens | Rows in the slot map. |
| `block_size` | number | tokens | Tokens per cache page (the SWA ring); the last block_size rows are stored. |
| `cache_format` | label |  | Cache encoding: mxfp8, nvfp4 or mxfp4. |
| `dtype` | dtype |  | Row element type (bf16). |

## Metrics

- Time (`time_ms`, ms)
- Throughput (`tflops`, TFLOPS)
- Memory bandwidth (`memory_bandwidth_gbps`, GB/s)
- Energy (`energy_j`, J)

## Backends

- `tilelang`: DeepInfer's TileLang store_kv_cache, checked bit-exact against store_kv_cache_ref. dtypes `bf16`, compute capability 9.0 or newer, GPUs H100-SXM5-80GB, H100-PCIe-80GB, H200-SXM-141GB, B200-SXM-180GB, B300-SXM-288GB, GB200-Superchip, H800-SXM5-80GB, H20-SXM-96GB.

## Measured rows

70 rows in all.

| GPU | Backend | Precision | Rows |
| --- | --- | --- | --- |
| NVIDIA B200 | `tilelang` | `bf16` | 70 |

## Used by these deployments

- [DeepSeek V4.1 Flash 1017: vLLM or DeepInfer, DP attention, EP MoE](https://servingstudio.cs.washington.edu/models/DeepSeek-V4.1-Flash-1017/deepseek_v41_vllm_dp_attn_ep_moe.md) (`DeepSeek-V4.1-Flash-1017/deepseek_v41_vllm_dp_attn_ep_moe`)
- [DeepSeek V4.1 Flash 1017: vLLM, DP attention, EP MoE, DSpark speculative decoding](https://servingstudio.cs.washington.edu/models/DeepSeek-V4.1-Flash-1017/deepseek_v41_vllm_dp_attn_ep_moe_dspark.md) (`DeepSeek-V4.1-Flash-1017/deepseek_v41_vllm_dp_attn_ep_moe_dspark`)

## API

- This kind: https://servingstudio.cs.washington.edu/api/public/v1/kernels/paged_kv_cache_store
- Measured rows: https://servingstudio.cs.washington.edu/api/public/v1/kernels/paged_kv_cache_store/rows (filter by any column, such as `?gpu=NVIDIA%20H200`; `format=csv` for CSV)
- Configs the public deployments ask of it: https://servingstudio.cs.washington.edu/api/public/v1/kernels/paged_kv_cache_store/configs

---

This page as Markdown: https://servingstudio.cs.washington.edu/kernels/paged_kv_cache_store.md. A guide to the whole site for AI agents: [llms.txt](https://servingstudio.cs.washington.edu/llms.txt).
