TECHNOLOGY

llama.cpp Gemma prefill: how to test the multi-sequence optimization

In this article
THE QUICK TAKE

Compare the same weights at matched prompt lengths and concurrency, and include correctness in acceptance.

On November 20, 2026, llama.cpp prerelease b12588 included an optimization for prompt processing with Gemma 4 E4B and E2B. The patch skips computation for rows that do not need logits when processing multiple sequences. The author’s benchmark used an M3 MacBook Air with 16 GB of RAM and reports a sizable prompt-processing gain in that setup. Its tables show why overall throughput, prompt throughput and generation throughput should be reported separately.

Fix the model and runtime configuration

Use the same weight file and quantization on the build before the change and the build containing it. Record the backend, model artifact, context limit and batching options. Changing the file format or falling back to another backend introduces a second variable. Test a single active sequence and a representative group of concurrent sequences, recording the count that was active rather than just the client-side target.

Treat the input and decode phases separately

Start with a fixed short output budget and use several input lengths. Measure prompt-processing throughput and first-token latency for each group. Record generation throughput separately. A faster prefill can bring the first answer forward even when the token rate after the first token stays similar. Queueing can change observed latency on a shared server, so capture when a request arrived and when work on it began.

Test more than identical prompts

Compare inputs with deliberately different lengths, and validate an ordinary set of tasks before interpreting the performance charts. Use the same prompts and decoding policy across builds and note whether speculative decoding or caching is enabled. Where possible verify that all expected query outputs are associated with the right requests.

Set a rollout threshold for the real workload

Report throughput and slow requests per input and concurrency group. Include the effects of model loading and warm-up separately. The contributor’s numbers are evidence for a particular test machine, model and quantization. A deployment decision should use its own workload and require both acceptable output and a benefit at the relevant operating point.

Sources

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles