← Ramblings

Local LLM throughput is tokens per step times steps per second

TL;DR: I spent a week tuning two local inference setups: Qwen3.8-27B under vLLM on a Radeon AI PRO R9700, and Qwen3-VL 8B under llama.cpp on a 12 GB RTX 4070 Ti. One went from 52 to 105 tokens/s per request and the other from 3.5 s to 1.3 s per photo. Neither win came from a faster model or a magic flag. Both came from treating decode as a memory-bandwidth problem and asking how many useful tokens each pass over the weights produces.

The model in one paragraph

Generating a token means reading every weight in the model once. On a GPU that read is limited by memory bandwidth, not compute, and it costs nearly the same whether the pass produces one token or twenty. So throughput is two numbers multiplied together: how many passes per second the card can do, and how many tokens you keep from each pass.

The ceiling is easy to estimate. The R9700 has about 640 GB/s of memory bandwidth, and a 4-bit 27B model is 18 to 19 GB of weights. That is about 34 passes per second at best and closer to 20 in practice. One token per pass gives 20 to 30 tokens/s, and no flag changes that.

Three levers

Which lever matters depends on the workload, and my two were opposites:

R9700, Qwen3.8-27B 4070 Ti, Qwen3-VL 8B
Server vLLM llama.cpp behind llama-swap
Requests 40 to 50k token prompts, two at a time 2 to 3k tokens each, thousands of them
What I care about Speed of one request Photos per minute
Lever Longer draft, then cheaper passes More streams per pass
Before 51.8 tok/s per request about 3.5 s per photo
After 105.3 tok/s per request 1.3 to 1.4 s per photo

The details are in two companion posts, “Doubling decode speed on a Radeon AI PRO R9700 with vLLM” and “Batch photo tagging with Qwen3-VL: eight slots, one KV pool”.

Measure the two terms separately

The most useful thing I did was stop looking at tokens/s in the log and graph the two terms on their own. vLLM exports what you need to Prometheus:

# decode tokens/s per request
increase(vllm:generation_tokens_total[1h]) / increase(vllm:request_decode_time_seconds_sum[1h])

# accepted draft tokens per verification pass
increase(vllm:spec_decode_num_accepted_tokens_total[1h]) / increase(vllm:spec_decode_num_drafts_total[1h])

This mattered twice. Per-position acceptance showed the drafter was still right about 74% of the time at the last position I allowed it, which meant the draft was too short. And when I switched quantization, acceptance per pass went down (2.99 to 2.74) while passes per second went up 38%. Looking at acceptance alone, I would have called that a regression. The product went from 67 to 97 tokens/s.

The log, on the other hand, misled me twice. The Avg prompt throughput line is a 10-second average, not prefill speed. And reasoning tokens count as generation, so a server running flat out at 73 tokens/s looked idle because the answer box was empty.

What caps each lever

What I would tell myself a week ago

  1. Work out the bandwidth ceiling first. If you are already near it, stop tuning flags and change a term in the equation.
  2. Graph tokens per pass and passes per second separately. A change can move them in opposite directions.
  3. Make every experiment an A/B you can undo. Same names, same port, separate caches. Switching back should be boring.
  4. Write down every default you depend on. My longest wait was a 40-minute restart caused by flags I had never set.
  5. Load models from fast local disk. I was loading from slow network storage, and added a pre-flight step that pulls the models to a local SSD before the server starts.
  6. Know your request shape before choosing a lever. Long prompts and short prompts want different servers configured in different ways.