Reports · Qwen3.8-27B on one AMD Instinct MI300X · Attention kernel: AITER flash
AITER flash attention is the fastest of the four kernels
The four lower rungs of the context ladder on AMD's flash-attention kernel, chosen by hand. At 128,000 tokens of context it writes 14.9 times as fast as the kernel vLLM picks by itself and reaches the first token after 24 seconds instead of 76.
- Test
- Attention kernel: AITER flash
- Run
20261125T212632Z-series-attn-rocm-aiter-fa
Also as a one-minute video and a PDF of 6 pages.
01Overview
The context ladder showed the kernel vLLM picks by itself collapsing as the prompt grows. I replayed its four lower rungs on each of the three other attention kernels this install offers, one server per kernel. This is the one for AMD's flash-attention kernel, ROCM_AITER_FA. It is the fastest of the four: at 128,000 tokens of context it writes 14.9 times as fast as the default and reaches the first token after 24 s instead of 76 s.
- 54.8 answer tokens a second at 128,000 tokens of context; 3.7 on the default kernel
- 14.9 times as fast in writing as the default at 128,000 tokens, from the two servers' writing seconds
- 24 s before the first token at 128,000 tokens; 76 s on the default kernel
- 5,234 prompt tokens read a second at 128,000, averaged over the prompt; 1,686 on the default kernel
In writing this kernel leads at every rung. In reading it leads at three rungs and ties at the fourth: at 16,000 tokens AITER unified reaches the first token after 2.222 s and this kernel after 2.224 s.
From 4,000 to 128,000 tokens this kernel keeps 83.2% of its writing speed and 58.2% of its reading speed. The default kernel keeps 8.4% and 20.0%.
The machine, and the one part that was changed
Four servers, one for each kernel
| server | attention kernel | chosen | environment set | cache slots | start-up graphs | ready, s | compiling, s |
|---|---|---|---|---|---|---|---|
| AITER flash | ROCM_AITER_FA | by hand | VLLM_ROCM_USE_AITER=1 | 1,723,325 | 12.90 GiB | 206 | 37.3 |
| AITER unified | ROCM_AITER_UNIFIED_ATTN | by hand | VLLM_ROCM_USE_AITER=1 | 1,812,820 | 7.42 GiB | 194 | 36.8 |
| Triton | TRITON_ATTN | by hand | VLLM_ROCM_USE_AITER=1 | 1,816,394 | 6.83 GiB | 185 | 37.0 |
| default | ROCM_ATTN | by vLLM | none | 1,826,476 | 6.83 GiB | 94 | 4.9 |
Like for like. The three servers with a kernel chosen by hand differ in --attention-backend only; all three have AMD's AITER library switched on. Against the default two things differ: the kernel, and AITER being on. The default's rungs come from its full ladder, which has the same seed.
The slower starts are not a cost of a kernel. My reading: vLLM's compile cache did not hold these three configurations' graphs yet, so each compiled for about 37 s where the default's server needed 4.9 s.
- A warm-up request of 1,000 tokens goes first. It is not a rung.
- Then four requests, one at a time: 4,000, 16,000, 64,000 and 128,000 random token ids in, 64 tokens forced back. The next is sent only when the last token of the answer before has arrived.
- Beside it a sampler reads the server's counters, the card and the CPU once a second.
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 | 20261125T212632Z-series-attn-rocm-aiter-fa, started 2026-11-25T21:26:45Z, server ready after 206 s |
The load is made on the same machine as the server and shares its CPU cores. It talks to the server on the loopback address: no request leaves the machine.
Prompt length by kernel: the whole grid
The exact record of this run
| prompt tokens | first token, s | reading, s (server) | prompt tokens/s | writing, s (server) | answer tokens/s (server) | bracket at the client | ms per answer token | writing, against the default | cache in use, % |
|---|---|---|---|---|---|---|---|---|---|
| 4,000 | 0.45 | 0.44 | 8,979 | 0.957 | 65.8 | 66.0 to 66.0 | 15.2 | 1.5× | - |
| 16,000 | 2.22 | 2.21 | 7,194 | 0.972 | 64.8 | 65.6 to 65.6 | 15.4 | 3.0× | 1.1 |
| 64,000 | 9.69 | 9.63 | 6,604 | 1.053 | 59.8 | 61.4 to 62.4 | 16.7 | 8.6× | 3.8 |
| 128,000 | 24.46 | 24.36 | 5,234 | 1.149 | 54.8 | 55.8 to 58.6 | 18.2 | 14.9× | 7.5 |
| Not a rung: the warm-up request, 16 tokens asked back | |||||||||
| 1,000 | 0.15 | 0.15 | 6,534 | 0.252 | 59.5 | 43.9 to 59.9 | 16.8 | - | - |
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. Answer tokens a second: the answer's tokens less one, divided by the writing seconds. The bracket: a token that carries no visible text sends no chunk, and these answers are random tokens, so counting chunks gives too low a speed and spreading all tokens over the time from the first chunk to the last too high a one; the server's own timer can sit just below it, because tokens without text at either end of an answer shorten the client's window.
04Why
Why it leads: the cheapest look back of the four
The 128,000-token prompt went in as 16 bites of at most 8,192 tokens. On this kernel the first three took 1.3 s each on average and the last three full ones 2.0 s; on the default kernel the same bites took 2.0 s and 7.7 s.
One answer token took 15.2 ms at 4,000 tokens of context and 18.2 ms at 128,000: 0.025 ms more for every 1,000 tokens of context. On the default kernel that figure is 2.01 ms, 81 times as much.
One prompt, four kernels, second by second
| server | the rung took, s | TFLOPS, vLLM's estimate | % of AMD's stated peak | estimated work, quadrillion operations | CPU busy, % | engine cores |
|---|---|---|---|---|---|---|
| AITER flash | 25 | 784 | 60.3 | 19.6 | 10.7 | 2.03 |
| AITER unified | 46 | 429 | 32.9 | 19.7 | 10.6 | 2.00 |
| Triton | 66 | 290 | 22.2 | 19.1 | 10.7 | 2.01 |
| default | 92 | 207 | 15.9 | 19.1 | 10.6 | 2.00 |
The 128,000-token rung on each server. TFLOPS is vLLM's estimate from the model's shape over the whole request, not a hardware counter, and the peak it is divided by is AMD's stated figure. The estimated work is about the same on every kernel; only the time differs.
vLLM's estimate counts too much attention for this model. What it adds for every bite already read is attention over the context in 64 layers; the model's configuration has full attention in 16 of its 64. At 128,000 tokens 67% of the estimated work is that attention. Counted for 16 layers, the same arithmetic gives 377 TFLOPS on this kernel, 29.0% of AMD's stated peak. My reading, not vLLM's figure.
All four kernels pay for the look back over the context; they differ in how much. This one pays least, in writing and in reading, which is why it leads at every length. It is not what vLLM picks when nothing is set: the default is the first in its own preference list.
This kernel then played the whole ladder and a prompt of 990,000 tokens on other servers. With the model's context full it wrote at 45.7 tokens a second and reached the first token after 1 min 13 s. Each has its own document.
What I take from it
- With AITER flash attention chosen by hand, a request of 128,000 tokens waits 24 s for its first token and is then written at 54.8 tokens a second.
- That is 14.9 times the default kernel's writing speed and 3.1 times as soon to the first token.
- It is the fastest of the four in writing at every rung, and in reading at every rung but one, where it ties.
- Of the four kernels this is the one to choose for long prompts on this card. vLLM does not choose it by itself.
Not results, and limits
The 1,000-token request at the start is a warm-up, not a rung.
- Speed and behaviour only: random-token prompts and answers of 64 forced tokens say nothing about the quality of an answer.
- One request at a time on an otherwise idle server, each rung once. Two starts of one configuration differed by up to about 2% on these rungs.
- Four rungs, up to half the model's context.
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
- 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). - 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.
- Context
- all tokens a request holds: prompt plus answer so far. This model's native limit is 262,144.
- 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. - 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-short.json b6a8613ab993 · runs/20261125T201346Z-series/plan-context-ladder/timeline.json 7ee787305964 · runs/20261125T201346Z-series/summary.json aab3940eb12e · runs/20261125T211511Z-series-attn-rocm-aiter-unified-attn/plan-context-ladder-short/timeline.json 49ed1e646107 · runs/20261125T211511Z-series-attn-rocm-aiter-unified-attn/summary.json 12b96900e2e1 · runs/20261125T212044Z-series-attn-triton-attn/plan-context-ladder-short/timeline.json f30fdb834d79 · runs/20261125T212044Z-series-attn-triton-attn/summary.json 6ecc28a27410 · runs/20261125T212632Z-series-attn-rocm-aiter-fa/plan-context-ladder-short/timeline.json 66856580a6bb · runs/20261125T212632Z-series-attn-rocm-aiter-fa/summary.json 0272c72e9f27 · runs/20261125T215049Z-series-fa/summary.json ec0c01913c37
40 values bound by path, 13 figures drawn from data.
Supporting material · video
The same result in a minute
Supporting material · PDF
The report as a document
6 pages · A4 · 385 KB · every number traced to its run file