Skip to content
Peter Styk HPC & AI Platform Engineer

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
Seconds before the first token0500.45 s2.22 s9.69 sdefault 75.9 sTriton 64.9 sAITER unified 45.7 sAITER flash 24.5 sPrompt tokens read a second (prefill, averaged over the whole prompt)05,00010K8,9797,1946,604AITER flash 5,234AITER unified 2,799Triton 1,973default 1,686Answer tokens written a second (decode, each server's own timer; grey bars: the bracket at the client)0504,00016,00064,000128,000tokens in the prompt (logarithmic scale)65.864.859.8AITER flash 54.8AITER unified 46.7Triton 38.1default 3.7
Figure 1The four rungs on the four kernels. This document's kernel is in colour with its values; the other three are grey, each named at the end of its line with its value at 128,000 tokens. 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: cross/ladder.json: each run's summary.json single_requests[] (first_token_s, prefill_tok_s, decode_tok_s_server)

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%.

02How it was run

The machine, and the one part that was changed

AMD Instinct MI300XQwen3.8-27B · vLLM 0.27.1streamsone at a timeengine stepprefill5,234 tokens/s, topdecode54.8 tokens/s, topattentionROCM_AITER_FAthe one changecache7.5% in usecompute unitsclientsCPU · 20 cores
Figure 2The serving settings are those of the context ladder; the attention kernel is the one change. "Top" is the 128,000-token rung.Source: FACTS.json; summary.json server.attention_kernel and plans.plan-context-ladder-short

Four servers, one for each kernel

serverattention kernelchosenenvironment setcache slotsstart-up graphsready, scompiling, s
AITER flashROCM_AITER_FAby handVLLM_ROCM_USE_AITER=11,723,32512.90 GiB20637.3
AITER unifiedROCM_AITER_UNIFIED_ATTNby handVLLM_ROCM_USE_AITER=11,812,8207.42 GiB19436.8
TritonTRITON_ATTNby handVLLM_ROCM_USE_AITER=11,816,3946.83 GiB18537.0
defaultROCM_ATTNby vLLMnone1,826,4766.83 GiB944.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.

  1. A warm-up request of 1,000 tokens goes first. It is not a rung.
  2. 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.
  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 model's limit1,000 in warm-up, not a rung1,016 tokens4,000 in4,064 tokens16,000 in16,064 tokens64,000 in64,064 tokens128,000 in128,064 tokensthe model's limit262,144 tokens
Figure 3The plan against the model's limit: the four rungs reach half of it.Source: plans/context-ladder-short.json; summary.json server.max_model_len

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.

03The record

Prompt length by kernel: the whole grid

Answer tokens a second, by kernel and prompt length02040604K16K64K128KAITER flashAITER unifiedTritondefaulttokens in the prompt
Figure 4Writing speed on the four attention kernels at the four rungs. A view only: the exact values are in the first matrix beside it. The default kernel is the front row.Source: cross/ladder.json decode_tok_s_server (each run's summary.json)
tokens in the prompt4K16K64K128KAITER flash65.864.859.854.8AITER unified65.261.753.946.7Triton65.361.047.838.1default43.621.36.93.7darker = more: answer tokens a second
Figure 5Writing: the same values as the view, exactly.Source: cross/ladder.json decode_tok_s_server
tokens in the prompt4K16K64K128KAITER flash8,9797,1946,6045,234AITER unified8,3297,2004,2972,799Triton8,2396,3123,2571,973default8,3936,2322,9141,686darker = more: prompt tokens read a second
Figure 6Reading, averaged over each prompt.Source: cross/ladder.json prefill_tok_s
tokens in the prompt4K16K64K128KAITER flash0.452.229.6924.5AITER unified0.482.2214.945.7Triton0.492.5419.764.9default0.482.5722.075.9darker = more: seconds before the first token (shaded by order of magnitude)
Figure 7The wait for the first token, in seconds.Source: cross/ladder.json first_token_s
tokens in the prompt4K16K64K128KAITER flash1.5×3.0×8.6×14.9×AITER unified1.4×2.8×7.7×12.7×Triton1.4×2.8×6.8×10.3×darker = more: times as fast in writing as the default kernel
Figure 8Writing against the default kernel: the default's writing seconds divided by each kernel's, cut to one decimal.Source: computed from cross/ladder.json server_decode_s

The exact record of this run

prompt tokensfirst token, sreading, s (server)prompt tokens/swriting, s (server)answer tokens/s (server)bracket at the clientms per answer tokenwriting, against the defaultcache in use, %
4,0000.450.448,9790.95765.866.0 to 66.015.21.5×-
16,0002.222.217,1940.97264.865.6 to 65.615.43.0×1.1
64,0009.699.636,6041.05359.861.4 to 62.416.78.6×3.8
128,00024.4624.365,2341.14954.855.8 to 58.618.214.9×7.5
Not a rung: the warm-up request, 16 tokens asked back
1,0000.150.156,5340.25259.543.9 to 59.916.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

Milliseconds for one answer token0200default 273AITER flash 18The three chosen kernels, enlarged020016,00064,000128,000tokens of context (linear scale)Triton 26.2AITER unified 21.4AITER flash 18.2
Figure 9Writing. The time for one answer token against the context, on plain scales. Top: the four kernels on one scale. Bottom: the three chosen kernels, enlarged.Source: computed from cross/ladder.json server_decode_s (each run's summary.json)
Seconds for one bite05064,000128,000tokens already read when the bite began (linear scale)default 8.0 sTriton 7.0 sAITER unified 4.5 sAITER flash 2.0 s
Figure 10Reading. The seconds each full bite of the 128,000-token prompt took, against what had been read before it. The record has whole seconds, so each line is a centred mean over three bites.Source: each run's timeline.json: the seconds between two moves of the server's work counter (est_tflops), which moves once per bite

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.

Added to one answer token by 1,000 tokens of contextAITER flash0.025 msAITER unified0.049 msTriton0.088 msdefault2.01 ms
Figure 11Writing: what 1,000 more tokens of context add to the time for one answer token, on each kernel.Source: computed from cross/ladder.json server_decode_s: the rise from the 4,000-token rung to the 128,000-token rung
Reading speed for the tokens from 64,000 to 128,000AITER flash4,334 tokens/sAITER unified2,076 tokens/sTriton1,415 tokens/sdefault1,186 tokens/s
Figure 12Reading: how fast the second half of the longest prompt went in, on each kernel.Source: computed from cross/ladder.json first_token_s: tokens added over the rung before, divided by seconds added

05Second by second

One prompt, four kernels, second by second

Cache slots in use, thousands0100010203040506070seconds since the request was sentAITER unified 45.7 sTriton 64.9 sdefault 75.9 sAITER flash 24.5 s
Figure 13The 128,000-token prompt going into the cache on the four servers, from the second it was sent to its first token. The same prompt, token for token, on each. The steps are the bites; where a line ends, that server's first answer token left.Source: each run's timeline.json (vllm:kv_cache_usage_perc every second, times its summary.json server.kv_cache_tokens) and its single_requests[stage=in-128000].first_token_s
serverthe rung took, sTFLOPS, vLLM's estimate% of AMD's stated peakestimated work, quadrillion operationsCPU busy, %engine cores
AITER flash2578460.319.610.72.03
AITER unified4642932.919.710.62.00
Triton6629022.219.110.72.01
default9220715.919.110.62.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.

06What it means

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

The whole series

Supporting material · PDF

The report as a document

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

Download the PDF