Skip to content

feat: expose paged cache serving settings - #49

Open
0z5a wants to merge 1 commit into
ViperEkura:mainfrom
0z5a:codex/expose-paged-cache-settings-0z5a
Open

feat: expose paged cache serving settings#49
0z5a wants to merge 1 commit into
ViperEkura:mainfrom
0z5a:codex/expose-paged-cache-settings-0z5a

Conversation

@0z5a

@0z5a 0z5a commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose paged KV cache token capacity and page size through the serving CLI and YAML config
  • propagate the settings through the HTTP server, engine, and scheduler while preserving contiguous defaults
  • validate invalid capacity/page combinations and report effective cache mode through /stats
  • document CLI, YAML, Docker, paged allocation, and prefix-caching behavior

L20 capacity benchmark

Exact PR commit 323f907, NVIDIA L20 (SM89), BF16, PyTorch 2.11.0+cu128, CUDA 12.8. The allocation uses the real AstrAI 1.2B KV geometry: 24 layers, 4 KV heads, head dimension 64, maximum batch 16, and maximum sequence length 32,768.

serving configuration reserved token slots page size prefix cache CUDA allocation cold init
default contiguous 524,288 1 off 12.002 GiB 13.04 ms
kv_cache_tokens=131072, kv_cache_page_size=64 131,072 64 on 3.002 GiB 5.05 ms

For a workload that needs four rather than sixteen simultaneous full 32k contexts, the exposed capacity setting saves exactly 9.0 GiB of KV-cache allocation (about 75%). This is a capacity/configurability result, not a claim that paged attention itself is 75% faster; throughput still depends on prompt sharing, occupancy, and backend.

GET /stats makes the effective mode, capacity, page size, and prefix-cache state visible so deployments can verify that the requested setting took effect.

Validation

  • ruff format --check .
  • ruff check . --select I
  • python -u -m pytest tests/ -q (664 passed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant