﻿# How can a shared llama-bench KV parser improve benchmark comparisons?

How can a shared llama-bench KV parser improve benchmark comparisons? Record the effective key and value cache formats and compare them with the serving configuration.

Author: Retrivium editorial team
Updated: 2026-11-30
Canonical URL: https://retrivium.ai/journal/daily-20261130-compute-llama-kv-parser-benchmark-parity/
Language: en

The llama.cpp b12854 prerelease shares the KV argument parser with llama-bench. A shared parsing implementation reduces the chance of one executable interpreting a cache option differently. Serving and benchmarking still differ in defaults, workload shape and the path a particular backend selects. Check effective settings in both processes.

## Verify the input and outcome

Capture the full arguments, version and effective format of the key cache and the value cache. Each can be set separately. For existing benchmark recipes, test a supported combination and an invalid value using small prepared workloads. Confirm which combinations start, which are rejected, and what effective configuration is reported. A successful startup alone is weak evidence of semantic parity.

## Match the service to the benchmark

Use the same model revision and accelerator for a small serving run. Record its cache configuration alongside the benchmark run, including attention mode and device placement where relevant. Match prompt shapes and decoder length for a narrow comparison. A service with several requests and changing context lengths will exercise different allocation patterns from a microbenchmark.

## Interpret a speed delta carefully

Track prompt and generation rates separately, with the cache footprint and error status. If a recipe previously produced another effective format, repeat the old comparison with settings made explicit. The measured change may reflect the test contract rather than kernel performance. Store the resolved options with every benchmark row. Check how the benchmark reports omitted options versus options explicitly passed by the recipe. Preserve a compact table of the arguments and resolved formats for each run. This makes a data series explainable when an older runner had defaults different from the service.

## Publish a reproducible comparison

Accept a result as evidence for capacity planning after both the effective cache and the request profile were verified. State which aspects of the production setup the benchmark covers. Use live-shaped traffic to measure the effects of concurrency and long conversations separately.

## Sources

- [Primary source · llama.cpp b12854](https://github.com/ggml-org/llama.cpp/releases/tag/b12854)
- [Primary source · llama.cpp #32831](https://github.com/ggml-org/llama.cpp/pull/32831)

## Related reading

- [llama.cpp quantized KV: reserve attention workspace before generation](/journal/llama-cpp-quantized-kv-flash-attention-workspace-reservation/)
- [How do you reproduce a point on the public Radeon benchmark dashboard?](/journal/research-20261129-radeon-raw-runs-reproducibility/)
