Skip to content
Peter Styk HPC & AI Platform Engineer

Reports · Qwen3.8-27B on one AMD Instinct MI300X · Million-token context

990,000 tokens read in 12 min 26 s, then answered at 26.4 tokens a second

The model was trained for 262,144 tokens of context. With the model card's own stretch setting and the fast attention kernel, one card took prompts of 500,000, 750,000 and 990,000 tokens, one at a time. Speed and behaviour only: the prompts are random tokens.

Test
Million-token context
Run
20261125T220624Z-ctx1m

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

01Overview

I set the server's context limit to 1,000,000 tokens, with the stretch setting the model card gives for going past its own 262,144, chose the fast attention kernel, and sent three prompts one at a time: 500,000, 750,000 and 990,000 tokens, each asking for 64 tokens back. All three were answered. The longest was read in 12 min 26 s and then written at 26.4 tokens a second. This says how fast, not how well: the prompts are random tokens.

  • 12 min 26 s before the first token of the 990,000-token prompt: 746 s
  • 26.4 answer tokens a second after it, by the server's timer; 37.2 at 500,000
  • 1,327 prompt tokens read a second at 990,000, averaged over the whole prompt
  • 68.4% of the cache in use at most: one such request fits, two do not
Seconds before the first tokeninside the model's own limit (another run, same kernel)this run0500the model's own limit: 262,144218 s448 s746 sPrompt tokens read a second (prefill, averaged over the whole prompt)05,00010K2,2961,6761,327Answer tokens written a second (decode, the server's own timer; grey bars: the bracket at the client)0504K16K64K128K200K262K500K750K990Ktokens in the prompt (logarithmic scale)37.230.826.4
Figure 1The three stretched prompts in colour, and in grey the same kernel's ladder inside the model's own limit (another run). Top: the wait for the first token. Middle: how fast the prompt was read, averaged over the whole prompt. Bottom: how fast the answer was written; the grey bars are the two figures the client can compute, shown only as a bracket.Source: summary.json plans.plan-context-ladder-1m.single_requests[] and, in grey, run 20261125T215049Z-series-fa, both read through cross/ladder.json

Speed and behaviour only. Every prompt is a list of random tokens and every answer is forced to 64 tokens. Nothing here says whether the model answers well at this length, or at any length past the one it was trained for.

All 4 requests of the plan ended well, the warm-up included, and the server counted exactly the tokens I asked for. The longest prompt is 3.7 times the model's own limit.

02How it was run

The machine, and the three parts this test leans on

AMD Instinct MI300XQwen3.8-27B · vLLM 0.27.1streamsone at a timeengine stepprefill1,327 tokens/s, topthis testdecode26.4 tokens/s, topattentionROCM_AITER_FAthis testcache68.4% in usethis testcompute unitsclientsCPU · 20 cores
Figure 2The card as every document in this series draws it. One request runs at a time: what is measured is how long prefill takes as attention has more to look back over, and whether the prompt fits in the cache.Source: FACTS.json; summary.json server.attention_kernel and plans.plan-context-ladder-1m

What was changed, and what the server made of it

Three settings on top of the series' settings for the fast kernel:

  • VLLM_ALLOW_LONG_MAX_MODEL_LEN=1
  • --max-model-len 1000000
  • the model card's position override: rope_type: yarn, factor: 4.0, original_max_position_embeddings: 262144

YaRN stretches the model's sense of position, so that it can be given more tokens than it was trained for.

what the server reported at startown limit (20261125T215049Z-series-fa)stretched (this run)
context limit, tokens262,1441,000,000
cache, token slots1,734,9581,448,006
requests of full context that fit6.621.45
card memory taken by the start-up graphs12.90 GiB30.06 GiB
server ready after, s97203
of which compiling, s5.736.3

Both columns are the fast kernel (ROCM_AITER_FA) on the same card. With the longer limit the start-up graphs took more of the card's memory and the cache got 16.5% fewer token slots.

  1. A warm-up request of 1,000 tokens goes first. It is not a rung.
  2. Then three requests, one at a time: 500,000, 750,000 and 990,000 random tokens in, 64 tokens asked back. The next is sent only when the last token of the answer before has arrived.
  3. Beside it a sampler reads the server's counters, the card and the CPU once a second.
Prompt plus answer of each request, against the two limitsthe model's own limit262,144 tokens1,000 in warm-up, not a rung1,016 tokens500,000 in500,064 tokens750,000 in750,064 tokens990,000 in990,064 tokensthe limit set for this run1,000,000 tokens
Figure 3The plan against the two limits: the one the model was trained with and the one set for this run. Grey bar of 1,000 tokens: the warm-up.Source: plans/context-ladder-1m.json; FACTS.json model.native_context_tokens; summary.json server.max_model_len

The slower start is not a cost of this setting. My reading: vLLM's compile cache did not hold this configuration's graphs yet, so it compiled for 36.3 s where the other server needed 5.7 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 20261125T220624Z-ctx1m, started 2026-11-25T22:06:37Z, server ready after 203 s

The load is made on the same machine as the server and shares its CPU cores. The generator runs inside the server's container and talks to it on the loopback address: no request leaves the machine.

03The record

The three requests, second by second

Cache in use, %500,000750,000990,00002550Card power, watts (AMD's exporter)0500Answer tokens a second (the server's counter)each second7-second centred mean020400120240360480600720840960108012001320seconds since the plan started
Figure 4The whole plan. Top: the cache filling as each prompt goes in; it empties when the answer has been written. Middle: the card's power. Bottom: answer tokens, each second in grey and a 7-second centred mean in blue: 64 tokens at the end of each band, written in about two seconds. Shaded bands are the three prompts, labelled with their length.Source: plan-context-ladder-1m/timeline.json (the server's gauges and counters every second; AMD's device exporter, which refreshes every 11 to 16 s)

The exact record

prompt tokensfirst token, sthat isreading, s (server)prompt tokens/swriting, s (server)answer tokens/s (server)bracket at the clientms per answer tokencache in use, %
500,000217.753 min 38 s217.362,2961.6937.238.0 to 45.226.934.6
750,000447.567 min 28 s447.011,6762.0530.830.5 to 37.632.551.9
990,000746.0612 min 26 s745.151,3272.3826.414.3 to 37.637.868.4
Not a rung: the warm-up request, 16 tokens asked back
1,0000.150.15 s0.156,6060.2560.227.6 to 69.016.6-

One row per request, from summary.json and cross/ladder.json. First token: at the client, from sending to the first text chunk. Reading and writing seconds: the server's own prefill and decode timers for that request. Prompt tokens a second: the prompt's tokens divided by the first-token time. Answer tokens a second: the answer's tokens less one, divided by the writing seconds. Cache: the most seen while the request played.

At 500,000 tokens the first token came after 3 min 38 s and the answer ran at 37.2 tokens a second. At 750,000: 7 min 28 s and 30.8. At 990,000: 12 min 26 s and 26.4.

Why the server's timer. The answers are random tokens, and a token that carries no visible text sends no chunk to the client. Counting chunks gives too low a speed; spreading all the tokens over the time from the first chunk to the last gives too high a one. At 990,000 tokens those two are 14.3 and 37.6: a bracket, not a measurement. The server's own decode timer says 26.4. At 500,000 it sits just below the bracket, because tokens without text at either end of an answer shorten the client's window.

04Why twelve minutes

Why twelve minutes: every bite costs more than the one before

Cache in use, %050060120180240300360420480540600660720seconds since the request was sent
Figure 5The 990,000-token request, second by second. The cache gauge climbs in steps as the bites of the prompt go in, and the steps get longer: the curve bends over all the way.Source: plan-context-ladder-1m/timeline.json (vllm:kv_cache_usage_perc sampled every second), stage in-990000
Seconds for one biteinside the model's own limit (another run)this run05100262K500K750K990Ktokens of the prompt already read when the bite began (linear scale)
Figure 6Reading. The seconds each bite of the 990,000-token prompt took, against what had been read before it. Whole seconds: the record has one sample a second. Grey: the 262,000-token prompt inside the model's own limit.Source: timeline.json of both runs: the seconds between two moves of the server's work counter (est_tflops), which moves once per bite
Milliseconds for one answer tokeninside the model's own limit (another run)this run020400262K500K750K990Ktokens of context (linear scale)26.932.537.8
Figure 7Writing. The time for one answer token against the context, on plain scales. The stretched prompts carry on the line of the ones inside the limit.Source: computed from single_requests[].server_decode_s, this run and 20261125T215049Z-series-fa (cross/ladder.json)

The 990,000-token prompt went in as 121 bites of at most 8,192 tokens. The first three took 1.0 s each on average, the last three full ones 11.3 s. Its first token came 298.5 s later than that of the 750,000-token prompt: the last 240,000 tokens went in at 804 tokens a second.

One answer token took 26.9 ms at 500,000 tokens of context and 37.8 ms at 990,000: 0.022 ms more for every 1,000 tokens. Inside its own limit the same kernel showed 0.026 ms (from 4,000 to 262,000 tokens, another run). Past the model's own limit a token of context costs no more than inside it.

Reading speed, by the part of the promptthe first 500,0002,296 tokens/s500,000 to 750,0001,088 tokens/s750,000 to 990,000804 tokens/s
Figure 8Reading once more, from the first-token times of the three requests: how fast the tokens that each longer prompt adds went in.Source: computed from single_requests[].first_token_s of neighbouring rungs: tokens added divided by seconds added

The same thing slows reading and writing: each new token looks back over all the tokens before it, and that costs time in proportion to how many there are. With 990,000 tokens the sum of those looks is what takes twelve minutes.

vLLM's estimate counts too much attention for this model. For every bite already read it adds 105.6 million million operations to a bite, which is what attention over the context costs in 64 layers of this size (24 heads of 256 numbers). The model's configuration has full attention in 16 of its 64 layers.

Over the longest request the estimate is 1,097 TFLOPS, 84.4% of AMD's stated peak, and 94% of that work is attention over the context. Counted for 16 layers, the same arithmetic gives 324 TFLOPS, 24.9%. That last figure is my reading, not vLLM's: the card is busy, but not near its stated peak.

05Scale, and what fits

For scale: the same card at the model's own limit

Seconds before the first tokendefault kernel, 262,000 tokens292 sfast kernel, 262,000 tokens73 sthis run, 500,000 tokens218 sthis run, 750,000 tokens448 sthis run, 990,000 tokens746 s
Figure 9The wait for the first token: this run's three prompts, and in grey the full-context request of two other runs.Source: summary.json single_requests[].first_token_s of this run, 20261125T215049Z-series-fa and 20261125T201346Z-series
Answer tokens written a seconddefault kernel, 262,000 tokens1.8 tokens/sfast kernel, 262,000 tokens45.7 tokens/sthis run, 500,000 tokens37.2 tokens/sthis run, 750,000 tokens30.8 tokens/sthis run, 990,000 tokens26.4 tokens/s
Figure 10The same five requests: how fast the answer was written, by each server's own timer.Source: summary.json single_requests[].decode_tok_s_server of the same three runs

Against the same kernel at the model's full context: the longest prompt here is 3.7 times as long, its first token took 10.2 times as long, and writing kept 57.8% of its speed.

On the default attention kernel this would not have been practical: it already needed 292 s and gave 1.8 tokens a second at 262,000 tokens. Here 500,000 tokens were read in 218 s.

The grey rows are other runs, there for scale and not like for like. The fast kernel's row differs in the context setting, the plan's seed and the size of the cache; the default kernel's row differs in the kernel as well.

What fits

Cache slots held at most, of the cache this server started with500,000 tokens in501,010 of 1,448,006 slots750,000 tokens in751,515 of 1,448,006 slots990,000 tokens in990,436 of 1,448,006 slots
Figure 11Each prompt against the cache this server started with. A slot holds one token, so a prompt takes about as many slots as it has tokens.Source: summary.json plans.plan-context-ladder-1m.stages[].cache_in_use_max times server.kv_cache_tokens

The longest request held 68.4% of the 1,448,006 slots. One such request fits and two do not. Nor would the 500,000-token prompt fit beside it: together they need 103.0%.

Underneath

prompt tokenscard power, W (mean)TFLOPS, vLLM's estimate% of AMD's stated peakCPU busy, %engine coreslongest gap in the answer, ms
500,0006731,02178.510.82.0529
750,0007041,07482.510.92.0665
990,0007021,10084.510.82.0579

Power is the mean of the exporter's readings over each request; new readings every 11 to 16 s. TFLOPS is vLLM's estimate from the model's shape, not a hardware counter, and the peak it is divided by is AMD's stated figure; the page before says why I read it as too high. CPU and engine cores are measured on the host. The longest gap is the longest silence between two chunks of the answer.

06What it means

What I take from it

  • With the model card's stretch setting and the fast kernel, one card reads a prompt of 990,000 tokens in 12 min 26 s and then writes at 26.4 tokens a second.
  • The wait grows faster than the prompt: 3 min 38 s at 500,000 tokens, 7 min 28 s at 750,000.
  • Past the model's own limit a token of context costs no more than inside it: reading and writing go on slowing along the same lines.
  • The longest request used 68.4% of this server's cache. One fits; two do not.
  • vLLM's estimate for it is 1,097 TFLOPS, 84.4% of AMD's stated peak. That is too high for this model: counted for the 16 layers that have full attention it comes to 324 TFLOPS, 24.9% (computed).
  • On the default kernel this would not have been practical.

Not results, and limits

The 1,000-token request at the start is a warm-up, not a rung. It asked for 16 tokens back and got its first one after 0.15 s.

  • Speed and behaviour only. Random-token prompts and answers of 64 forced tokens say nothing about the quality of an answer at this length.
  • The position setting is the model card's own. I did not test what it does to answers inside the model's own limit either.
  • One request at a time on an otherwise idle server, each prompt once. Writing speed is taken over 64 tokens, about two seconds.

measured: read from a run file · computed: arithmetic on measured values · estimate: vLLM's, from the model's shape · my reading: interpretation, not measurement

Words used

Context
all tokens a request holds: prompt plus answer so far. This model's native limit is 262,144.
YaRN
a way of stretching the model's sense of position so it can read past the context length it was trained for.
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.
First token
(time to first token) from sending the request to receiving the first answer token. It contains waiting in line and prefill.
Chunked prefill
a long prompt is read in bites across several engine steps, at most max_num_batched_tokens (8,192 here by default) per step for all requests together.
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.
Attention kernel
(--attention-backend) the GPU code that lets each token look back over the context. Four exist here: ROCM_ATTN (the default pick), ROCM_AITER_FA (AITER flash attention), ROCM_AITER_UNIFIED_ATTN, TRITON_ATTN.
AITER
AMD's library of GPU kernels for inference. Off by default in this install (VLLM_ROCM_USE_AITER).
TFLOPS
trillions of arithmetic operations per second. Here always vLLM's estimate from the model's shape (--enable-mfu-metrics), not a hardware counter. It counts attention in all 64 layers where this model has it in 16: 1.7% high for short prompts, over half too high from 128,000 tokens of context.

Every number in this document was read from these files at build time (sha256, first 12 characters):

FACTS.json 160f5ca0d495 · GLOSSARY.md 98323be796af · cross/compute-estimate.json b36121710947 · cross/ladder.json 3511faec1269 · facts/box/20261125T192138Z/model-config.json 191e0af23210 · plans/context-ladder-1m.json c0deac13164b · runs/20261125T201346Z-series/summary.json aab3940eb12e · runs/20261125T215049Z-series-fa/plan-context-ladder/timeline.json 6d9043e58e9a · runs/20261125T215049Z-series-fa/summary.json ec0c01913c37 · runs/20261125T220624Z-ctx1m/plan-context-ladder-1m/timeline.json f24b8af25366 · runs/20261125T220624Z-ctx1m/summary.json dc630cf24d26

65 values bound by path, 11 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 · 418 KB · every number traced to its run file

Download the PDF