Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Benchmarks

These numbers come from the reports_latency_breakdown benchmark. They are indicative; measure on your own hardware.

CPU

Release, Qwen2.5-1.5B dense, F32:

PrefixStageBaseline+ CPU flash+ MKL
64prefill3.13 s2.34 s0.52 s
256prefill8.65 s4.97 s1.69 s
1024prefill28.23 s20.66 s13.13 s
645 batched suffixes1.44 s1.33 s0.25 s
2565 batched suffixes2.47 s1.98 s0.35 s
10245 batched suffixes4.74 s4.59 s2.57 s
64single next token655 ms699 ms159 ms
256single next token811 ms347 ms175 ms
1024single next token815 ms545 ms300 ms

GPU

Release, Qwen2.5-1.5B, F16, RTX 3070:

Prefixprefill5 batched suffixessingle next token
6414 ms36 ms52 ms
25631 ms81 ms65 ms
1024154 ms379 ms64 ms
---
accTitle: CPU cost by stage
accDescr: Prefill dominates CPU latency and improves most with MKL, while batched suffixes stay cheap.
---
xychart-beta
    title "CPU prefill by prefix (seconds, MKL)"
    x-axis ["64", "256", "1024"]
    y-axis "seconds" 0 --> 14
    bar [0.52, 1.69, 13.13]

How to read them

  • Prefill scales with the prefix length; the session cache removes it for repeated states.
  • Batched suffixes are cheap and grow slowly with the number of questions.
  • MKL is the single biggest CPU win; CUDA shifts the whole table to milliseconds.

Reproducing

The benchmark is a test with a latency report. Run it on your machine, keeping the model and dtype identical.

GPU runs belong in the devcontainer, which reserves the GPU and installs the CUDA toolkit. See Running the server.

Next steps