128K Context on One 24 GB Radeon: 18 Failed Tests and a 256-Entry Table
Published 19 min read
This report covers October 25 to November 25, 2026, plus one 24-hour check that closed on November 26. The numbers come from internal run records on my own two cards. They describe those cards, that model and those dates; they are not general throughput guarantees.
TL;DR
- The always-on lane serves a 64K window from an fp16 KV cache at 69.0 tokens/s for a 2K prompt. A month earlier the choice was 64K at about 41 tokens/s or 32K at 66 to 68. A rewritten weight kernel then took that to 74.8 tokens/s at 2K and 64.6 at 60K in a solo reading.
- A second lane serves a 131,072-token window on one 24 GB card by storing the KV cache in fp8. That cost decode speed at depth: 18.8 tokens/s at a 120K prompt.
- The cost was not the fp8 data. It was the fp8-to-fp16 conversion inside the attention kernel. Replacing it with a 256-entry lookup table, with bit-identical output, took 120K decode from 18.8 to 38.5 tokens/s and 64K from 28.2 to 47.9.
- Each experiment ran against a row written before the run, with pass bars and kill rules. Of the 57 rows for these two cards dated in this window, 49 have a verdict: 21 passed or were promoted, 6 are conditional, 18 failed, 3 were skipped and 1 was parked. Eight are still pending.
- A short request beside a long prompt waited 8 to 10 seconds for its first token: two scheduling effects, not a slow kernel. A scheduler patch cut that to 4.5 s on the always-on lane. It makes a long prompt 5 % slower alone and 11 % slower with short requests beside it, and it passed a 24-hour live trial.
Setup
Hardware. Two Radeon RX 7900 XTX cards (24 GB, the gfx1100 family in ROCm's naming), one per host. One card carries the always-on text lane. The other is a flex card: it holds the long-context text lane until an image, video or audio lane asks for it.
Model. Qwen3.8-27B in a community 4-bit AutoRound build (4-bit weights, 16-bit activations), served with the model's multi-token-prediction head as a draft for speculative decoding, two draft tokens per step.
Engine. vLLM 0.33.0 built against ROCm 7.2, with a small FlexInfer plugin layer that installs kernels and flags at startup. FlexInfer's controller turns a model manifest into the pod, and its proxy routes requests and replays a prompt that is too long for one lane on the next lane up.
Terms.
- A lane is a named model deployment the proxy routes to.
- Prefill is the engine processing a prompt before the first output token. An engine step is one forward pass that advances every running request.
- Sequence slots are the engine's limit on requests it runs at once.
- The KV pool is how many tokens of attention cache fit on the card beside the weights. It bounds the context window.
- A needle bench plants a fact in a long prompt and asks for it back.
Workload. The main caller is Mills, my agent factory. Across the same 15 research tasks, a 120K window raised the share of the right source files that the agent's notes named by 0.14 over a 60K window (standard error 0.07): 7 tasks better, 1 worse, 7 tied. That is why a 128K lane was worth building.
How numbers were taken. Most decode numbers are tokens per second for one request, measured from inside the lane's pod, on the second of two passes. The first pass after a boot pays for compiling attention kernels on first use, twelve of them on the 128K lane. Where a run had other traffic, or was timed from outside the pod, the line says so.
Method: write the bar before the run
Each experiment gets a row in a validation matrix before anything is applied. The row names the riskiest assumption, the pass bars, the kill rules and the rollback. Amendments are dated and made before the counted run. A row ends as pass or promote, conditional, fail, skip or parked, or stays pending.
"Before the counted run" is weaker than "before any data". Twice in this window a bar was rewritten after an earlier row had failed and its diagnostics had been seen, and once a live trial got a looser bar than its canary had missed. Those cases are marked below.
An AI coding agent wrote the rows, ran the measurements and prepared each change. I made the call at every gate that touched a live lane.
The discipline matters most when a result is close. On November 25 a scheduler setting produced the improvement I wanted and still failed its row, because one of the two scored runs had another caller's request in it and the row had no rerun rule for that case. I kept the setting. The row says conditional, and it says that the decision was mine and came after the data.
Result 1: the always-on lane, 64K without the slow cache
On October 25, the first day of this window, the always-on lane served 64K from an fp8 KV cache at a median of about 41 tokens/s. The next day I traded that for a 32K window with an fp16 cache and speculative decoding, at 66 to 68 tokens/s. This section is about getting 64K back without giving up the speed.
With an fp16 cache the window is limited by the KV pool. Two attempts to grow the pool failed first (they are in the ledger below). The change that worked was plain: move the token-embedding table off the card and into host memory. That freed 2.37 GiB: the model's footprint on the card went from 16.92 to 14.55 GiB. With vLLM 0.33 it gave the lane a 64K window.
| Date | Configuration | KV pool (tokens) | Decode at 2K / 16K / 60K prompt (tokens/s) |
|---|---|---|---|
| October 26 | 32K window, fp16 KV, vLLM 0.32 | 52,932 | 68.5 / 65.9 / not served |
| November 22 | 64K window, fp16 KV, vLLM 0.33, embeddings in host memory | 92,906 | 69.0 / 66.7 / 57.7 |
| November 23 | the same, with the rewritten weight kernel and its image | 94,448 | 77.0 / 74.4 / 64.5 |
| November 25 (solo) | same kernel and image, after the 416-token prefill cap | 94,448 | 74.8 / 74.2 / 64.6 |
The November 23 run did not exclude other callers, and the November 22 row does not record whether any were present. The November 25 reading was taken with no other request running.
A 59,534-token prompt took 64.2 s to its first token, cold. Prompts between 64K and 128K overflow to the second lane through the proxy: a 90,564-token prompt sent to the always-on lane's name was answered correctly by the 128K lane in 221.8 s.
The weight kernel
A profile on November 5, at the always-on lane's settings on the flex card, showed the GPU idle for 16 % of a decode step at a 2K prompt. Of the time it was busy, 62 % went to the 4-bit weight matrix multiplies and 17 % to the draft heads. So the weight kernel was the place to look.
The stock kernel moved weight data at 72–79 % of the card's measured read ceiling on the four largest layer shapes. A rewritten inner loop reaches 89–94 %. In a canary on the flex card, engine steps per second went from 28.10 with the stock kernel to 31.77, and decode at a 2K prompt was 1.107× stock.
It is not bit-identical. The new loop accumulates in a different order. One of three parity prompts (fixed prompts decoded greedily, whose output should not change) produced a different completion, and at a 2K prompt the average number of accepted draft tokens fell 3.1 % against a ±1.5 % bar.
Its quality gate was meant to run on the flex card first. That card was dropping off the bus that day, so the kernel went to the always-on lane on November 23 as a watched trial instead, with a fixed 15-task research benchmark as the quality check. Mean recall came out at 0.506 against a 0.51 bar. Task by task against the old kernel, 4 were better, 4 tied and 7 worse. I read that as meeting the bar on November 24 and kept the kernel when the trial closed the next day. The row records that the reading was mine.
An earlier, bit-identical variant of the same kernel removed about 264 small fill operations per step and gained 2.2 %. It was recorded as conditional and superseded.
Result 2: 128K on one card, and where the decode speed went
Getting the window
A 131,072-token window does not fit in fp16 beside this model on 24 GB. The route that fit was fp8 KV on vLLM's segmented attention backend for ROCm, plus the embedding move. Upstream enables fp8 on that backend only for the newer gfx12 cards; the plugin lifts the gate for gfx11.
fp8 on segmented attention had been killed on November 5 for the 32K lane, where it decoded at 0.74× fp16 at a 16K prompt and bought nothing the lane needed. At 128K the trade is different: there is no fp16 alternative to compare against. The November 21 canary, timed from the other host at the lane's own address, passed:
- Pool: 159,599 tokens at a 131,072 window.
- Decode: 59.4 / 46.7 / 27.1 / 18.7 tokens/s at 2K / 16K / 64K / 119.5K prompts.
- Needle recall: the bench found its target at 33,057, 67,304, 101,574 and 127,265 prompt tokens, 5 of 5 needles at 127,296, and at 0 %, 50 % and 100 % depth near 127K.
- Cold time to first token at 119,511 tokens: 360 s.
The lane went live that evening. It worked, and it was slow at depth.
A tempting move that failed
On November 22 I moved the always-on lane itself to the 128K recipe, so research would have a 120K window without waiting for the flex card. The pool was fine (182,729 tokens). Under live traffic the lane decoded 17–19 tokens/s at 64K and 9–13 at 120K against bars of 24 and 15, and production requests queued behind 120K prefills on its two sequence slots. I rolled it back to 64K the next day.
Finding the cost
The useful number was time per engine step as a function of context. On November 24 I compared the two lanes:
- fp16 lane: about 0.11 ms per 1K context tokens per step (31.0 ms at 2K, 37.1 ms at 60K).
- fp8 lane: about 0.74 ms per 1K context tokens (40.2 ms at 2K, 127.8 ms at 120K).
fp8 reads half the bytes and cost about seven times more per context token. The compiled kernel showed why. The attention kernel converts each fp8 value to fp16 before using it, and Triton 3.8 lowered that cast to nine compare-and-select pairs per element.
Kill test
Before touching the engine I wrote a microbenchmark row: build variants of the conversion, run only the attention stage on an otherwise empty card, and stop if the best exact variant was still more than 2.0× fp16. A second rule guarded the test itself: if stock fp8 was not at least 4× fp16 in the microbenchmark, it did not model the lane and nothing would be concluded.
| Conversion | Attention time for one modeled step at 64K | At 120K | Output equal to stock fp8 |
|---|---|---|---|
| fp16 KV (reference) | 11.4 ms (1.00×) | 20.2 ms (1.00×) | n/a |
| Stock fp8 conversion | 66.6 ms (5.84×) | 122.7 ms (6.08×) | yes |
| 256-entry lookup table | 13.3 ms (1.17×) | 23.7 ms (1.17×) | yes, on all six shapes |
| Exact arithmetic | 2.59× | 2.67× | yes |
| Arithmetic, no NaN handling | 2.05× | 2.12× | yes on these inputs |
| Approximate arithmetic | 1.58× | 1.60× | no |
Measured November 24, second of two runs, 120 timed iterations. The first run gave 1.24× and 1.13× for the table.
An fp8 value has 256 possible bit patterns, so the exact conversion is a table read. The table beat every arithmetic form, including the one with no select operations at all.
In the engine
The table kernel shipped in the plugin behind a flag, off by default, and went to a canary that copied the 128K lane's manifest on the same card. The baseline was the live lane measured hours earlier.
| 128K lane, November 25 | 2K | 16K | 64K | 120K |
|---|---|---|---|---|
| Before, stock conversion (tokens/s) | 61.6 | 45.5 | 28.2 | 18.8 |
| Canary, table lookup | 67.0 | 58.7 | 47.8 | 38.5 |
| Live lane after the change | 66.6 | 58.5 | 47.9 | 38.5 |
| Ratio, live lane after / before | 1.08× | 1.29× | 1.70× | 2.05× |
Other readings from the same runs:
- Step time per 1K context tokens: 0.772 ms to 0.213 ms in these runs. The fp16 lane's figure is 0.11 ms, so a gap remains.
- Cold time to first token at 120K: 354 s to 211 s.
- Pool: 158,828 tokens, against 159,599 before.
- Needle recall and drafts: needles found at 67,304 and 127,265 tokens, 5 of 5 at 127,296; the first draft token was accepted 82 % of the time; tool calls round-tripped.
- Two requests at once: a 5-minute soak at concurrency 2 ran 120 requests at a median 54.5 tokens/s each. Two 67,304-token prompts started together both answered correctly in 231 s each, against 92.6 s for one alone.
The lane has served on the table kernel since November 25, 03:28 UTC.
Result 3: sharing the always-on lane
The always-on lane has two sequence slots and took 70 to 125 requests in every hour of the 48 I checked on November 25. When one of them is a 56K-token prompt, everything else on the lane slows down for about a minute. Three settings and one patch went at that.
More slots (failed). The bar was to halve the wait for a 2K request that arrives during a long prefill. With two slots its median time to first token was 27.1 and 27.7 s in two runs. With four it was 14.3 and 26.7 s, against a 13.5 s bar, and decode during the prefill fell from 11.4 and 17.8 tokens/s to 2.7 and 6.4. Every engine step still carried the long prompt's 1,664-token chunk, so extra slots admitted more requests into equally slow steps. Rolled back.
A smaller prefill chunk (kept, conditional). Capping the long prompt at 416 tokens per step cut the gap between a neighbor's stream chunks from 1.90 s to about 0.60 s. In the run with no outside caller, a short request beside the long one finished in 14.7 s against 32.9 s before. The long prompt pays for it: time to first token rose from 65.7 s to about 80 s when it has company, and is unchanged when it is alone.
A prefill cadence (not run). Holding prefill three steps in four while a neighbor decodes needed two baseline runs with no other caller. Eight attempts produced none; the lane rarely has 85 quiet seconds. I shelved it rather than loosen the rule after the fact. Its row sits in an unmerged draft and is not among the 57.
Why a short request waits 9 seconds
A 2K request that arrives beside a long prefill waited 8.8 to 10.2 s for its first token in those runs, with the cap or without it. My first explanation, that a step carrying two prefill chunks is unusually slow, was inferred from the total. It was wrong.
On November 25 I ran one probe that sampled the engine's KV-usage gauge twenty times a second. The gauge moves once per engine step, so the trace shows when each step ended and how much it carried. One 56,220-token prompt prefilled for 77.5 s while 2K requests ran back to back beside it. No outside caller arrived during the prefill.
| Short request | Waiting before its first chunk ran | Its own five prefill steps | Time to first token |
|---|---|---|---|
| 1 | 3.81 s | 3.91 s | 7.72 s |
| 2 | 4.13 s | 4.31 s | 8.40 s |
| 3 | 4.62 s | 4.71 s | 9.33 s |
| 4 | 5.03 s | 5.06 s | 10.06 s |
- The wait. The 416-token cap switches off whenever the long prompt is the only request. It then takes a 3,744-token step, which ran 3.2 s early in the prompt and 4.4 s deeper in. The engine schedules one step ahead, so a new request sits through the rest of the step in flight plus one whole uncapped step.
- The five steps. The cap applies to every request, so it also cuts the 2K prompt into five 416-token chunks. Those steps took 0.75 to 1.10 s each, median 0.90 s, against a median of 0.60 s for a step with one chunk and a decode token. That is about 1.5×, in line with the extra tokens.
From this one run I built a scheduler patch, off by default: a lone long prompt keeps an 832-token cap per step and a prompt of up to 2,080 tokens skips the cap. It ran as a canary on the flex card at the always-on lane's settings, stock and patched on one image, then as a watched trial on the always-on lane against a same-day baseline. Short-request times are medians:
| 2K request beside a 56K prefill | Canary, stock → patched | Live lane, before → after |
|---|---|---|
| First token, back to back | 9.28 → 4.86 s | 9.13 → 4.50 s |
| First token, arriving while the long one is alone | 10.79 → 4.68 s | 10.20 → 4.31 s |
| Long prompt's first token, with short ones beside | 1.122× (bar 1.10×, missed) | 1.112× (bar 1.20×) |
| Long prompt's first token, alone | 1.066× (bar 1.15×) | 1.054× (bar 1.10×) |
The canary missed two bars: that long-prompt cost, and decode at 60K at 0.962× against a 0.97× bar, on a sample whose time per step was unchanged. Six patched runs, repeated after a CI job left the host, agreed. No kill rule fired; the row is conditional.
The trial's 1.20× bar was written after the canary, with the 12 % cost known. That is the kind of bar-moving this report is otherwise strict about. Running the trial on it was my decision, made before the baseline ran. Decode step time, the KV pool and parity outputs held; the roll took the lane down about 2 minutes. All seven checks passed, the last over 24 hours and about 2,216 requests, the trial's own probes among them, with no restart, GPU error or failed request.
Result 4: image, video and audio lanes in one pod
The flex card used to start a separate pod for each creative lane. Four lanes now load inside one long-lived runtime pod instead, which removes the pod start from every swap. I gated each lane on whether its output repeats, not on swap time. The first request after a load now carries a warm-up, about four minutes for image-to-video.
- Video (Wan 2.1 text-to-video) failed three configurations in one day. The fourth passed: a compiled model plus a warm-up at the request's own shape gave byte-identical output within a load and across loads. That day, after two of the failures, I also changed its fidelity bar against the dedicated pod from PSNR to structural similarity plus a side-by-side look. One clip of the passing run scored 21.5 dB, under the old 22 dB bar.
- Image-to-video (Wan 2.1 VACE) is never byte-identical, in either mode. After one failed gate and four diagnostic runs, and before the counted run, its bar was rewritten as quality floors between repeats: PSNR, a pixel-level similarity score, of at least 35 dB and a structural-similarity score of at least 0.99. It passed at about 42 dB, against 43.96 dB for the dedicated pod.
- Audio (Stable Audio Open) passed byte-identical.
- Image (Qwen-Image) passed on its third attempt, after its memory-allocator settings were pinned.
A separate row that set a floor for swap time in this mode failed its decode and output-hash bars. I kept the in-pod text lane anyway; that row still reads fail.
What failed
Eighteen rows for the two cards failed in the window. The table lists the ones that changed the plan, plus two that never reached a card and are outside the 57: an offline check, and the cadence row, which was never merged.
| Date | What I tried | Bar | What happened |
|---|---|---|---|
| Nov 5 | Octave, a more compact KV cache format in vLLM 0.33 | pool at least 3.0× fp16 | 1.29× and 1.19×. About 1.9 GiB of fixed activation memory ate the gain. Decode speed held. |
| Nov 5 | fp8 KV on segmented attention, 32K lane | decode at least 0.95× fp16 at 2K and 16K | 0.74× at 16K. Killed for that lane; revived for 128K. |
| Nov 6 | Smaller vocabulary for the draft head (offline) | 98.5 % token coverage | 93.4 % and 95.7 % at the two sizes tried. The misses were mostly non-English text. |
| Nov 21 | Video lane inside the shared pod | repeatable output, fidelity to the dedicated pod | Failed three configurations before the fourth passed. |
| Nov 22 | 128K fp8 on the always-on lane | 24 / 15 tokens/s at 64K / 120K | 17–19 / 9–13 under live traffic. Rolled back. |
| Nov 23 | Four sequence slots | 2K first token at half the two-slot median (13.5 s) | 14.3 s and 26.7 s, and decode beside the prefill fell to 2.7 and 6.4 tokens/s. Rolled back. |
| Nov 25 | Prefill cadence (not run) | two undisturbed baseline runs | 0 of 8. Shelved unmeasured. |
Two of these fed the result that worked. Octave's failure sent me to fp8, and the fp8 failure at 32K left a tested, switched-off code path that the 128K lane later needed.
What the tests caught along the way
- A short first boot. After any change that invalidates the compile cache, the first boot measures a small KV pool and fails the engine's own capacity check once. The automatic restart is warm and passes. Rows now allow one such restart.
- A stall detector that killed a healthy prefill. vLLM adds prompt tokens to its counters only when a prefill completes. The controller's stall detector read a 119.5K cold prefill as five minutes of frozen counters and deleted the pod. The lane now sets a 20-minute window.
- Tuning time. The fp8 attention kernels autotune on first boot: 817 s cold on the table kernel. A second boot reuses the table and was ready in 2 min 9 s. Copying the canary's table into the live lane's cache before the change made that roll ready in 2 min 17 s.
- Marginal hardware. The flex card dropped off the PCIe bus under load several times between early October and November 2, and no software setting helped. After hardware work on November 2 the card came back with its link at half width and held for about a week. Its host was then out from November 8 to 16 with disk errors. It returned at full link width, and the card dropped four times on November 23. I do not know the cause. Tests on that card wait for a healthy window, and one row is pending for that reason alone.
Limits
- The table kernel has run only on the flex card. Nothing here has been tried on any GPU other than these two RX 7900 XTX cards.
- The table-kernel numbers are solo probes and a short soak, not a production record. In the 41 hours to the afternoon of November 25, which cover the change, the proxy sent the 128K lane five requests, all probes. The overflow from the always-on lane fired once in the seven days to November 25.
- Two requests above 100K tokens each, at once, are untested. The autotuner skips the eleven batch-of-two workloads at this window on both kernels, so that case runs on default kernel settings.
- The 416-token cap rests on a
conditionalrow: one clean run, several contaminated ones. The step trace is a single run. The scheduler patch was tested only with two slots, one long prompt and 2K short ones. - The weight kernel changes outputs slightly. I kept it on a 15-task benchmark that landed 0.004 under its bar, with more tasks worse than better. That is a judgment about my own workload, not a general quality evaluation.
- The creative lanes repeat at the shape their warm-up covers (832×480, 33 frames for video). Other sizes may differ.
What's next
- Retry 128K on the always-on card with the table kernel. The November 22 failure was measured on the stock conversion.
- Put the rewritten weight kernel on the 128K lane when the flex card has a healthy window.
- Profile what is left of the fp8 gap: 0.213 ms against 0.11 ms per 1K context tokens.
- Shorten what is left of the short-request wait. Of the 4.5 s, about 1.5 s is still spent behind the long prompt's solo steps and about 2.9 s is the short prompt's own two prefill steps.
- Offer the table conversion upstream. I have not posted it yet.
Related posts
12 min read
Twin Life on a Doubled Pool: One Day of Canary-Driven Inference Engineering
A twin-lane canary promoted prefix caching, FP8 KV cache, and a larger context pool while catching five regressions before they reached the primary workload.
Shared tags: flexinfer · fp8 · vllm
5 min read
Finding the Real Context Ceiling: Needle-Benchmarking Forced RoPE Extrapolation
Needle-retrieval tests on a 35B model passed near 63,000 prompt tokens and failed at longer contexts, even when vLLM loaded without a memory error.
Shared tags: flexinfer · vllm · long-context
6 min read
Standing Up a GPU-Ready Private AI Platform (Harvester + K3s + Flux + GitLab)
Field notes from building and operating a small private GPU platform with Harvester, K3s, and a GitLab -> Flux delivery loop.
Shared tags: rocm · inference
Comments
Join the discussion. Be respectful.