Skip to content
Peter Styk HPC & AI Platform Engineer

Reports · Qwen3.8-27B on one AMD Instinct MI300X · Watermark

A tenth of the cache kept free: 21 streams thrown out instead of 47

The same 400 requests, one setting apart. The server lets in 235 streams instead of 261, their answers grow into the room that was kept, and the first wave of throwing out does not happen. The second does. The price is 26 fewer streams writing at first; all 400 answers arrive, 26 seconds sooner.

Test
Watermark
Run
20261125T230017Z-series-watermark

Also as a one-minute video and a PDF of 6 pages.

01Overview

I played the plan that had overfilled the cache once more, with one setting changed: keep a tenth of the cache free when letting requests in. The server then let in 235 streams at first instead of 261. Their answers grew into the room that was kept, and the first wave of throwing out did not happen. The second did: the cache filled all the same. 21 streams were thrown out instead of 47, and all 400 answers had arrived 26 s sooner. One run each.

  • 21 streams thrown out of the cache; 47 with nothing kept free
  • 72 s longest silence inside one answer; 171 s with nothing kept free
  • 235 streams let in at first; 261 with nothing kept free: the price
  • 10 min 4 s until all 400 had ended; 10 min 30 s with nothing kept free
Streams runningnothing kept freea tenth kept freelet inwritewriteredoline let inrest write0100200Streams thrown out of the cache, running totalnothing kept freea tenth kept free02040Cache in use, %nothing kept freea tenth kept free050100060120180240300360420480540600seconds since the requests were sent
Figure 1The two runs on one clock: this one in colour, the run with nothing kept free in grey. Top: streams running. Middle: streams thrown out of the cache, counted up. Bottom: the cache. With the room kept, the cache stops at 89.85% when requests are let in and fills later, as the answers grow. Shaded bands are the phases of this run.Source: plan-kv-growth/timeline.json of this run and of run 20261125T201346Z-series (vLLM's gauges and preemption counter)

Both servers are left with the same 214 streams running once the throwing out is over, and no request had ended by then. The cache gauge reads 100% in both from there on: the room did not keep the cache from filling.

In this plan nothing was refused and nothing failed, in either run: all 400 requests got HTTP 200 and their full 2,000 tokens. Whoever was thrown out was let back in and finished.

02How it was run

The machine, and the one setting

AMD Instinct MI300XQwen3.8-27B · vLLM 0.27.1streams235 let in at firstthis testengine stepprefilldecodeattentioncachea tenth kept free when letting inthis testcompute unitsclientsCPU · 20 cores
Figure 2The card as every document in this series draws it: seven parts wired left to right, the clients outside, the host CPU below. This test changes how the cache is given out: a tenth of it is kept free when requests are let in.Source: FACTS.json; summary.json plans.plan-kv-growth.stages[stage=grow-400].running_max, server.non_default_args

The same burst, with room kept at the door

clients400 requests atonce, each a4,000-tokenpromptthe linerequests notlet in yet, andstreams thrownoutlet in?only while atenth of thecache wouldstay freecachea runningstream's slicegrows with itsanswer, intothat room tooanswer2,000 tokens,streamed back
Figure 3The rule that was added sits at the door, not inside: a waiting request is let in only while a tenth of the cache would stay free. A stream that is already running may grow into that room.Source: config.conf (--watermark 0.1); vLLM's help text for the setting; plans/kv-growth.json
  1. The same plan and the same seed as before: 400 requests in one instant, each with 4,000 tokens in and 2,000 out, the same prompts in the same order.
  2. One setting differs: --watermark 0.1. Nothing else in the command changed.
  3. The rest is the same in both runs: the default attention kernel, a cache of 1,826,476 token slots (1,826,476 in the other run), 1,024 stream slots.
  4. Beside each run a sampler read the server's counters, the card and the CPU once a second.

One run each. The two servers were started separately, almost three hours apart, on the same machine; this one was ready after 100 s, the other after 94 s.

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 20261125T230017Z-series-watermark, started 2026-11-25T23:00:31Z, server ready after 100 s

The load is made on the same machine as the server and shares its CPU cores. No request leaves the machine.

Words used

Watermark
a share of the cache kept free when admitting requests (--watermark), to avoid preemption.
Preempted
a running stream thrown out of a full cache and put back in line; its work is redone later.
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.
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.
Prefill
the server reading the prompt. Every prompt token passes through the model once before the first answer token.
Decode
the server writing the answer, one token per stream per engine step.
Engine step
one pass of the model over a batch: one new token for every decoding stream, plus a bite of prefill.

03Side by side

The same plan, moment by moment

Answer tokens written a second (7-second centred mean)nothing kept freea tenth kept freelet inwritewriteredoline let inrest write01,0002,000Engine steps a second (7-second centred mean)nothing kept freea tenth kept free010060120180240300360420480540600seconds since the requests were sent
Figure 4What the two engines did (7-second centred means): this run in colour, the other in grey. With the room kept, writing starts 16 s sooner, because fewer prompts are read first, and every later phase starts sooner too.Source: plan-kv-growth/timeline.json of both runs (vLLM's token and step counters)

The exact record

the same moment in both runsnothing kept freea tenth kept free
All that fit are let in, after s153137
Streams let in at first261235
Cache gauge then, %99.7989.85
First stream thrown out, after s214274
Streams thrown out, wave by wave26 + 2121
Streams left running after that214214
First answer ended, after s345325
No new prompt read for, s4221
The line empty, after s476438
All 400 ended, after s629.7603.6
Answer tokens a second over the plan1,271.81,325.8
First token, median s118.8118.7
First token, 99th percentile s476.0437.2
Longest silence inside one answer, s171.072.2

Moments are found in each run's per-second record: the first second with the most streams running, the first preemption, the first answer ended, the first prompt tokens read after that, the line empty.

all that fit are in16 s soonerfirst answer ended20 s soonerthe line empty38 s soonerall 400 ended26 s sooner
Figure 5The gain in time: how much sooner four moments of the plan come with the room kept.Source: timeline.json and summary.json of both runs; differences computed
nothing kept freea tenth kept free01,0002,000answer tokens a second2,4912,376mean over the stretch2,6102,350the typical second (median)
Figure 6The price: answer tokens a second in the first stretch of writing, the seconds with the most streams running and no prompt being read (59 s with nothing kept free, 135 s with a tenth). Drawn twice: the mean over the stretch, and the typical second.Source: plan-kv-growth/timeline.json of both runs (output_tok_s, running, prompt_tok_s)

With 26 fewer streams writing, the first stretch gave 4.6% fewer answer tokens a second as a mean, and 9.9% fewer in the typical second. Over the whole plan this run wrote more: 1,326 against 1,272.

04Why the first wave does not happen

The room that was kept is what the growing answers need next

Cache blocks in use, of 2,354nothing kept freea tenth kept freewith a tenth kept free, nothing new is let in above this linelet inwritewriteredo01,0002,000Cache blocks per running streamnothing kept freea tenth kept free910110306090120150180210240270300330seconds since the requests were sent
Figure 7Until the first answers end. Top: the cache in blocks, both runs, and the level above which this run lets nothing new in. Bottom: blocks per running stream: 9, then 10, then 11 in both. With the room kept, the step from 9 to 10 fits and nobody is thrown out; the step to 11 does not fit in either run.Source: plan-kv-growth/samples.jsonl of both runs (vllm:kv_cache_usage_perc, vllm:num_requests_running); blocks computed, see the text

What the block count asks for, and what each server did

runblockscomputedmeasuredstreams running afterblocks in use after
Letting in, 9 blocks a stream
nothing kept free2,354 may be used261 fit261 let in2612,349
a tenth kept free2,118 may be used235 fit235 let in2352,115
Each stream takes a 10th block
nothing kept free5 free26 must go26 thrown out2352,350
a tenth kept free239 freenone must gonone thrown out2352,350
Each stream takes an 11th block
nothing kept free4 free21 must go21 thrown out2142,354
a tenth kept free4 free21 must go21 thrown out2142,354

Cut the cache into 2,354 equal blocks, and every value its gauge took in these two plans is a whole number of them. A stream holds 9 blocks at first, then 10, then 11 as its answer grows. From that count alone come the streams let in and the streams thrown out, in both runs, to the stream.

The gauge rose from 89.85% to 99.83% between seconds 194 and 206 with nobody thrown out. The room is kept only at the door, as vLLM's help text says of the setting: blocks are kept free "when admitting waiting or preempted requests". A running stream may grow into it.

My reading: the room does not make the cache larger. It keeps out the streams that would otherwise be let in and then thrown out. A tenth was what one step of growth needed in this plan; the next step still overflowed.

vLLM's help text speaks of "KV cache blocks"; how many there are and what a stream takes is my arithmetic on the gauge, not read in its source. By the same count a setting of 0.2 would let in 209 streams, fewer than the 214 that fit at full length, so none would be thrown out. That is a prediction. I did not run it.

05Who gained, who paid

The same 400 requests, one by one

the same request with a tenth kept freekept runningthrown outlet in latekept running21400thrown out, wave 10026thrown out, wave 20210let in late00139nothing kept freedarker = more: requests
Figure 8Every request of the burst, by what happened to it in the two runs. The requests are the same in both, in the same order.Source: plan-kv-growth/requests.jsonl of both runs, matched by request id
nothing kept freea tenth kept free214 kept in both37826 kept out by the room60121 thrown out in both480139 late in both6030200400600mean seconds until the answer ended
Figure 9Mean seconds until the answer ended, for the four kinds of request. Three kinds gain; the 26 that the room kept out end later.Source: plan-kv-growth/requests.jsonl of both runs
requestsnothing kept freea tenth kept freefirst token, mean s: withoutwithlongest silence, s: withoutwithanswer ended, mean s: withoutwithchange, s
214Kept runningKept running646412.98.2418378-39.9
26Thrown out, first waveLet in late147355171.04.0583601+17.9
21Thrown out, second waveThrown out13413372.572.2518480-37.5
139Let in lateLet in late4374046.65.3629603-25.6
let in at once, never thrown outlet in at once, then thrown outlet in only when room came freeNothing kept free21447139A tenth kept free21421165060120180240300360420480540600seconds since the requests were sent
Figure 10Every request as one thin line from its first token to the end of its answer (grey before it: waiting for the first token), both runs on one clock. The red band, streams thrown out, is narrower with the room kept; the last band, requests let in late, is wider by the same number.Source: plan-kv-growth/requests.jsonl of both runs (t_sent, t_first, t_end, gap_max)

Matched by their place in the burst, 374 of the 400 requests ended sooner with a tenth kept free, by 19 to 47 s. The other 26 ended 13 to 23 s later: they are the streams that the room kept out at first.

06What it means

What I take from it, and what it does not show

What I take from it

  • Keeping a tenth of the cache free more than halved the streams thrown out, 21 against 47, and the longest silence inside an answer, 72.2 s against 171.0 s.
  • It did not remove them. The cache still reached 100.0% as the answers grew.
  • The price was paid at the door: 26 fewer streams let in at first. The whole plan still ended 26 s sooner.
  • Both runs settle at 214 streams: 261 less 47, and 235 less 21.
  • Throwing a stream out wastes its place twice: its work is done again, and while it was in, it held room that the others needed.

What it does not show

  • One run each. A second pair could differ by a stream or a second.
  • One plan, in which every stream has the same length and so needs room at the same moment. With mixed lengths the same setting may buy more, or less.
  • Whether a larger share kept free would remove the throwing out. The block count says so; no run does.
  • Prompts are random tokens: nothing repeats, and answers are not readable text.

Underneath: the card did the same work

means over the whole plannothing kept freea tenth kept free
Compute, TFLOPS (vLLM's estimate)213.3212.9
Memory read, TB a second (vLLM's estimate)2.002.09
Engine steps a second6.476.75
Card power, watts (AMD's exporter)710724
CPU busy, % of 20 cores10.910.9

Stage rows of the two summaries: means over each run's whole plan. Compute and memory read are vLLM's estimates from the model's shape, not hardware counters.

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/kv-growth.json 89c49daf377d · runs/20261125T201346Z-series/plan-kv-growth/client.jsonl a3a0ed7fb3ae · runs/20261125T201346Z-series/plan-kv-growth/requests.jsonl 38cbadbcd5d8 · runs/20261125T201346Z-series/plan-kv-growth/samples.jsonl 015baec3f8a7 · runs/20261125T201346Z-series/plan-kv-growth/timeline.json 630fd28b7c90 · runs/20261125T201346Z-series/summary.json aab3940eb12e · runs/20261125T230017Z-series-watermark/plan-kv-growth/client.jsonl 2eb5527fd787 · runs/20261125T230017Z-series-watermark/plan-kv-growth/requests.jsonl c6403acc2b19 · runs/20261125T230017Z-series-watermark/plan-kv-growth/samples.jsonl 941e5a17bd97 · runs/20261125T230017Z-series-watermark/plan-kv-growth/timeline.json 2144e8aaaaf2 · runs/20261125T230017Z-series-watermark/summary.json 55f891019fda

67 values bound by path, 10 figures drawn from data.

Supporting material · video

The same result in a minute

The whole series

Supporting material · PDF

The report as a document

6 pages · A4 · 369 KB · every number traced to its run file

Download the PDF