Reports · Qwen3.8-27B on one AMD Instinct MI300X · 8-bit cache
An 8-bit cache: 1.9 times the token slots, and no more streams
Storing the cache in 8-bit numbers makes the server report almost twice the token slots. The staircase still fills at 539 streams, against 541 without it. A running stream costs the same 196 MiB of cache either way.
- Test
- 8-bit cache
- Run
20261125T224501Z-series-kvfp8
Also as a PDF of 5 pages.
01Overview
The staircase stops letting streams in when the cache is full. So I stored the cache in 8-bit numbers instead of 16-bit ones, on the fast attention kernel, and played the top of the staircase again. The server reported 3,309,759 token slots instead of 1,679,893: 1.9 times as many. The staircase then filled at 539 streams, 2 fewer than the 541 without the setting. Output at the two top stairs was 0.9% and 6.6% higher, which one run each does not settle.
- 1.9 times the token slots the server reports: 3,309,759 against 1,679,893
- 539 streams running at once, at most; 541 with a 16-bit cache
- 196 MiB of cache for each running stream, with either cache: computed from each server's log
- 4,182 answer tokens a second with 2,048 streams asked for; 3,921 with a 16-bit cache
For each GiB of cache the two servers ran the same number of streams: 5.21 and 5.22. The 8-bit server had 103.36 GiB of cache against 103.65, which is 0.2% less, and ran 0.3% fewer streams.
One thing differs between the two servers: both had 2,048 stream slots, so that the stream limit could not be the ceiling. The first version of this document compared with a server of 1,024 slots and showed 20 fewer streams. 18 of them were the slots: a server with more slots sets more memory aside for its busiest step, 19.64 GiB against 16.31, and that comes out of the cache.
The machine, and the one setting
The top of the staircase, twice
- A closed loop: the load generator keeps 256, then 512, 1,024 and 2,048 requests open, 40 seconds each. A new request starts when one ends.
- Every prompt is 64 random token ids, so no two share a prefix; every answer is forced to 512 tokens.
- Two servers played it, both on the fast attention kernel: one with the cache in 16-bit numbers (run
20261126T013018Z-series-fa-seqs2048), this one with--kv-cache-dtype fp8. - Both had 2,048 stream slots. Nothing else differs between them.
- Beside each run a sampler read the server's counters, the card and the CPU once a second.
Speed and room only. vLLM's own log says of this setting that it "may cause accuracy drop without a proper scaling factor". The prompts here are random tokens; nothing in this test says anything about the answers.
Settings
| Model | Qwen3.8-27B: 27.8 billion parameters, BF16 weights, 262,144 tokens of context |
| Card | one AMD Instinct MI300X: 304 compute units, 191.7 GiB of memory |
| Server | vLLM 0.27.1+rocm723, ROCm 7.2.3, PyTorch 2.11.0+gitd0c8b1f |
| Machine | a cloud GPU virtual machine: 20 virtual cores, Intel Xeon Platinum 8568Y+ |
| This run | 20261125T224501Z-series-kvfp8, started 2026-11-25T22:45:15Z, server ready after 206 s |
This server was ready after 206 s, the other after 100 s. That is vLLM's compile cache, not a cost of the setting: this configuration's graphs had to be compiled first (36.5 s of compiling against 5.7 s).
Words used
- Cache
- (KV cache) the GPU memory where the server keeps what the model computed for every token of every open stream, so it need not be recomputed.
- "Cache for N tokens"
- what the server reports at start: how many token slots fit in the cache (about 1.82 million with default settings here).
- Stream
- one request being answered, from the moment it is sent until its last token.
- Closed loop
- the load keeps N requests in flight; a new one starts only when one ends. The server sets the pace.
- Capacity
- (waiting reason) the server's label for a request it cannot schedule now, because the cache or the step's token budget is used up. Reported in
vllm:num_requests_waiting_by_reason. - Engine step
- one pass of the model over a batch: one new token for every decoding stream, plus a bite of prefill.
Both servers stop a little above 512 streams
The exact record
| server | running at most | waiting at most | cache at most, % | answer tokens/s | prompt tokens/s | engine steps/s | tokens per step | first token, median s | TFLOPS, est. |
|---|---|---|---|---|---|---|---|---|---|
| 256 streams asked for | |||||||||
| 16-bit cache | 256 | 127 | 47.3 | 3,115 | 429 | 12.18 | 291 | 2.13 | 164 |
| 8-bit cache | 256 | 127 | 47.4 | 3,209 | 429 | 12.55 | 290 | 2.13 | 168 |
| 512 streams asked for | |||||||||
| 16-bit cache | 512 | 100 | 94.6 | 3,189 | 862 | 6.26 | 647 | 2.06 | 185 |
| 8-bit cache | 512 | 132 | 94.9 | 3,216 | 862 | 6.32 | 646 | 2.06 | 187 |
| 1,024 streams asked for | |||||||||
| 16-bit cache | 541 | 483 | 100.0 | 3,923 | 431 | 7.26 | 599 | 42.71 | 202 |
| 8-bit cache | 539 | 485 | 99.9 | 3,962 | 433 | 7.37 | 596 | 40.71 | 204 |
| 2,048 streams asked for | |||||||||
| 16-bit cache | 541 | 1,507 | 100.0 | 3,921 | 480 | 7.26 | 606 | ≥ 99.90 | 203 |
| 8-bit cache | 539 | 1,509 | 99.9 | 4,182 | 46 | 7.76 | 545 | ≥ 99.97 | 197 |
One row per stair and server, from the two summary.json files. Running, waiting and cache are the most seen in the stair; output, prompts and steps are the server's counters over it; the first-token time is the median for requests sent in that stair. A stage row spans 39 s of a 40 s stair, first to last one-second sample. TFLOPS is vLLM's estimate.
With 1,024 and with 2,048 streams asked for, 539 ran at most and the cache gauge read 99.9%. The line grew to 1,509 requests. The 16-bit server stopped at 541 with 1,507 waiting.
1,509 of this run's 2,843 requests were "cut at the end of the plan": still open when the generator's 60 s ran out, and closed by it. They are not refusals. All 2,843 got HTTP 200.
A stream costs the same bytes, whatever the slot is made of
In all five servers the most streams running divided by the cache's GiB comes to 5.21 or 5.22: about 196 MiB of cache for each running stream of this plan, the 8-bit cache included.
Counted in token slots a running stream took 3,105 with the 16-bit cache and 6,141 with the 8-bit one. The slot got half as big. The stream did not get smaller.
My reading: with streams this short the cache is filled by a fixed amount of state for each stream, in bytes, and 8-bit numbers do not shrink it. They halve what one token's entry takes, and a stream of at most 576 tokens has few tokens. Long streams may gain; this plan cannot say.
The five servers, exactly
| server | share of the card, % | consumed, GiB | set aside, GiB | cache, GiB | token slots | most streams running | streams per GiB | MiB of cache per stream | slots per stream | answer tokens/s: 1,024 asked | 2,048 asked |
|---|---|---|---|---|---|---|---|---|---|---|---|
| default kernel | 92 | 53.07 | 10.57 | 112.71 | 1,826,476 | 588 | 5.22 | 196.3 | 3,106 | 3,856 | 4,096 |
| fast kernel | 92 | 53.00 | 16.31 | 107.05 | 1,734,958 | 559 | 5.22 | 196.1 | 3,104 | 3,949 | 3,993 |
| fast, 2,048 stream slots | 92 | 53.06 | 19.64 | 103.65 | 1,679,893 | 541 | 5.22 | 196.2 | 3,105 | 3,923 | 3,921 |
| fast, 97% of the card | 97 | 53.06 | 19.64 | 113.23 | 1,835,008 | 591 | 5.22 | 196.2 | 3,105 | 4,102 | 3,941 |
| fast, 8-bit cache | 92 | 53.36 | 19.64 | 103.36 | 3,309,759 | 539 | 5.21 | 196.4 | 6,141 | 3,962 | 4,182 |
Memory is each server's own log; slots and streams are each run's summary.json; streams per GiB, MiB per stream and slots per stream are computed. The default-kernel server played the full staircase, the four others its top only. The three servers with 2,048 stream slots set 19.64 GiB aside, the fast-kernel server with 1,024 slots 16.31.
What I take from it, and what it does not show
What I take from it
- The 8-bit cache made the server report 1.9 times the token slots, and 539 streams ran at most where 541 had run.
- A running stream took about 196 MiB of cache in both servers. The streams that fit follow the cache's size in bytes, not its count of token slots.
- Output at the top is not told apart by one run each: 3,962 and 4,182 answer tokens a second at the two top stairs, against 3,923 and 3,921.
- For many short streams the 8-bit cache buys nothing. What limits them is state that is not counted per token.
What it does not show
- Whether long streams gain. A long stream is mostly tokens, and their entries are what the setting halves. No run here tried it.
- What the setting does to the answers. Prompts are random tokens and answers are not readable text.
- More than one run of each server, or another plan: this is the top of one staircase.
- One run each. A stair's output swings with the moment at which new prompts are read: at 2,048 asked for this server read 46 prompt tokens a second, the other 480.
Underneath: the card did the same work
| server | compute, TFLOPS (est.) | memory read, TB/s (est.) | matrix units in use, % | watts | CPU busy, % | engine cores |
|---|---|---|---|---|---|---|
| 1,024 streams asked for | ||||||
| 16-bit cache | 202.2 | 0.80 | 19.0 | 750 | 11.6 | 2.00 |
| 8-bit cache | 204.1 | 0.60 | 33.7 | 750 | 11.6 | 2.00 |
| 2,048 streams asked for | ||||||
| 16-bit cache | 203.0 | 0.61 | 36.0 | 749 | 11.7 | 1.99 |
| 8-bit cache | 196.6 | 0.53 | 27.1 | 750 | 11.7 | 1.98 |
Stage rows of the two summaries. Compute and memory read are vLLM's estimates from the model's shape, not hardware counters; matrix units and watts are readings of AMD's device exporter.
measured: read from a run file · computed: arithmetic on measured values · estimate: vLLM's, from the model's shape · my reading: interpretation, not measurement
Every number in this document was read from these files at build time (sha256, first 12 characters):
FACTS.json 160f5ca0d495 · GLOSSARY.md 98323be796af · plans/staircase-top.json 7671a9348c18 · runs/20261125T201346Z-series/server.log c008d4941d1a · runs/20261125T201346Z-series/summary.json aab3940eb12e · runs/20261125T215049Z-series-fa/server.log a2aa2d010fcc · runs/20261125T215049Z-series-fa/summary.json ec0c01913c37 · runs/20261125T224501Z-series-kvfp8/plan-staircase-top/timeline.json 627cc56c2714 · runs/20261125T224501Z-series-kvfp8/server.log 12a55b33336a · runs/20261125T224501Z-series-kvfp8/summary.json 561b6d9e405a · runs/20261125T225329Z-series-mem97/server.log 18247a4dd0d4 · runs/20261125T225329Z-series-mem97/summary.json ab4cc85f7ebd · runs/20261126T013018Z-series-fa-seqs2048/plan-staircase-top/timeline.json e5d5a112cf56 · runs/20261126T013018Z-series-fa-seqs2048/server.log 5a8a691ca70f · runs/20261126T013018Z-series-fa-seqs2048/summary.json 94ecccaf84b3
62 values bound by path, 6 figures drawn from data.
Supporting material · PDF
The report as a document
5 pages · A4 · 333 KB · every number traced to its run file