Skip to content

CICD-454 · KV cache performance benchmarking ​

Encyclopedia · GPU and inference infrastructure · All snippets

Previous · CICD-453 · Next · CICD-455

1. Where it fits ​

  • Placement CI run step or authorized lab terminal.
  • Prerequisites dedicated GPU lab, approved images and model revision, fixed benchmark profile.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters ENGINE_METRICS.

2. Copy the snippet ​

bash
curl -fsS "${ENGINE_METRICS:?}/metrics" | awk '/^vllm:(kv_cache_usage_perc|gpu_cache_usage_perc)(\{| )/{print; found=1} END{exit !found}'

3. How it works ​

The scrape extracts the engine's active KV cache occupancy series. Repeated and unique prompts should be measured separately because they exercise cache reuse differently.

4. Verify the result ​

Confirm the metric name and unit in the running engine. Replay repeat and unique prompts separately when measuring cache effects.

Validation version-dependent (Bash parse). Status definitions.