Skip to content
Peter Styk HPC & AI Platform Engineer

Reports · Qwen3.8-27B on one AMD Instinct MI300X · Small steps on the fast kernel

Small engine steps keep every stream answering while long prompts are read

The mixed load on the fast attention kernel, with room for 2,048 tokens in an engine step instead of 8,192. The engine makes three to four steps a second where it made under one, and no second passes without an answer token. The price: prompts are read about a fifth slower.

Test
Small steps on the fast kernel
Run
20261125T223438Z-series-fa-batch2k

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

01Overview

On the fast attention kernel the mixed load still starved decoding: while a long prompt was read the engine made about one step a second, and every stream gets one token per step. I gave a step room for 2,048 tokens instead of 8,192, with a long prompt capped at the same 2,048. The engine then made 3.5 steps a second at 128 streams instead of 1.0, and the server wrote 3.7 times the answer tokens.

  • 0 seconds without an answer token in the four loaded minutes; 46 with large steps
  • 4.40 engine steps a second at 32 streams, 3.46 at 128, 2.81 at 256
  • 122.7 answer tokens a second at 32 streams; 11.1 with large steps, in a minute disturbed by kernel builds
  • 23.3% fewer prompt tokens read a second at 128 streams: the price
Answer tokens a secondthis run, each secondlarge stepssmall steps and the cap (this run)8 streams32 streams128 streams256 streams0500Engine steps a secondthis run, each secondlarge stepssmall steps and the cap (this run)02550Prompt tokens read a second (counted when a prompt's reading ends)large stepssmall steps and the cap (this run)010K0306090120150180210seconds since the plan started
Figure 1The four loaded minutes of both runs. Grey: the run with steps of 8,192 tokens. Colour: this run, with its single seconds thin and grey behind the 7-second centred mean. Small steps lift answers and steps, and lower the reading of prompts, in the two minutes with the most streams.Source: plan-mixed-overlap/timeline.json of this run and of 20261125T215049Z-series-fa

At 128 and 256 streams the server wrote 282.0 and 256.2 answer tokens a second; with large steps 75.9 and 118.0. That is 3.7 times and 2.1 times.

At 32 streams the ratio is 11.0 times, and it flatters this run: in that minute the run with large steps stood still for 27 seconds building kernels it had never used. The page on that minute takes it apart.

02How it was run

The machine, and the part that was changed

AMD Instinct MI300XQwen3.8-27B · vLLM 0.27.1streamsengine step4.40 a second at 32this testprefillbites of up to 2,048this testdecodeone token per streamthis testattentionROCM_AITER_FAcachecompute unitsclientsCPU · 20 cores
Figure 2The card as every document in this series draws it. An engine step carries one new token for every stream that is answering and a bite of a prompt that is being read. This run makes the step smaller.Source: FACTS.json; summary.json config and plans.plan-mixed-overlap.stages[stage=mix-32]

What differs between the two runs

Attention kernel ROCM_AITER_FA in both
Room in one engine step 2,048 tokens here; 8,192 in the run before
Long-prompt cap at most 2,048 tokens of one prompt in a step here; none before
Cache 1,728,754 token slots here; 1,734,958 before
The run before 20261125T215049Z-series-fa

Two settings differ at once. This run cannot say which of the two does the work.

The plan

  1. Four stages of 60 seconds: 8, 32, 128, then 256 requests kept open. A new one starts only when one ends.
  2. Each request draws its prompt from a mix: 70% short (256 to 2,000 tokens), 25% medium (4,000 to 16,000), 5% long (32,000 to 64,000); answers of 64 to 1,024 tokens.
  3. Then 120 seconds with no new requests; what is still open after that is closed by the load generator.

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 20261125T223438Z-series-fa-batch2k, started 2026-11-25T22:34:51Z, server ready after 185 s
streams asked for832128256large steps0466small steps0476darker = more: long prompts sent in that minute
Figure 3Long prompts sent in each minute, in both runs. The plan is a closed loop: a server that ends requests sooner is sent more of them. At 32 streams both runs were sent the same four long prompts as the minute began.Source: plan-mixed-overlap/requests.jsonl of both runs (stage, asked_in)

The two runs were not sent the same requests: 342 here, 297 before. Request number N has the same lengths in both, and a faster server gets further down the list. The 32-stream minute is the like-for-like one in what was sent.

One engine step, large steps: room for 8,192 tokensstreams that are answeringeach takes one token of the stepa prompt being readtakes what is left: a bite of upto 8,192 tokensthe step ends1.02 s later at 128 streams: onemore token for every streamthe lineeverything else waits for thenext stepOne engine step, small steps: room for 2,048 tokensstreams that are answeringeach takes one token of the stepa prompt being readtakes what is left: a bite of upto 2,048 tokensthe step ends0.29 s later at 128 streams: onemore token for every streamthe lineeverything else waits for thenext step
Figure 4What one engine step holds in the two runs. The time is computed: one second divided by the engine steps a second at 128 streams.Source: each run's summary.json (config, plans.plan-mixed-overlap.stages[stage=mix-128].engine_steps_per_s); FACTS.json

03Stage by stage

Minute by minute, before and after

a second in which at least one answer token left the servera second with none, for anyone8 streams, large steps0 of 60 silent8 streams, small steps0 of 60 silent32 streams, large steps33 of 60 silent32 streams, small steps0 of 60 silent128 streams, large steps5 of 60 silent128 streams, small steps0 of 60 silent256 streams, large steps8 of 60 silent256 streams, small steps0 of 60 silent0102030405060seconds into the minute
Figure 5Every second of the four loaded minutes in both runs. With small steps no second is silent.Source: plan-mixed-overlap/timeline.json of both runs (output_tok_s per one-second row)
Answer tokens a second, all streams togetherlarge stepssmall steps8 streams298.032 streams122.7128 streams282.0256 streams256.20100200300
Figure 6The gain. More answers in every loaded minute but the first, where no long prompt was in the mix.Source: both runs' summary.json stages[].server_output_tok_s
Prompt tokens read a secondlarge stepssmall steps8 streams1,76332 streams5,969128 streams6,665256 streams5,82702,5005,0007,500
Figure 7The price. Prompts are read faster at 32 streams and slower at 128 and 256.Source: both runs' summary.json stages[].server_prompt_tok_s

The exact record of both runs

answer tokens/sprompt tokens/sengine steps/sseconds with no answer tokenrunning at mostwaiting at mostcache at most, %first token, median srequests sentcard, W
8 streams
large steps299.91,70137.640 of 60803.90.2639695
small steps298.01,76337.460 of 60813.90.2638610
32 streams
large steps11.13,0950.4733 of 60302219.06.7725316
small steps122.75,9694.400 of 60322226.37.1731744
128 streams
large steps75.98,6960.985 of 601259761.331.3096744
small steps282.06,6653.460 of 601049552.526.70121748
256 streams
large steps118.07,2660.888 of 6017413191.865.19137746
small steps256.25,8272.810 of 6010017059.8≥ 95.66152724
drain: no new requests
large steps744.84,5274.139 of 12120774100.0-0750
small steps495.45,6643.081 of 12119515689.9-0745

From each run's summary.json; seconds with no answer token are counted from its timeline.json. Tinted rows are this run. A stage row spans 59 s of its 60 s. The server counts a prompt's tokens when its reading ends. Running and waiting are the server's gauges, which move only when a step ends.

04The minute at 32 streams

The minute at 32 streams, taken apart

Answer tokens a second, each secondlarge stepssmall steps and the cap (this run)kernel build, 21.7 s0500Engine steps in the secondlarge stepssmall steps and the cap (this run)05Engine process, CPU cores in use: large steps024Card power, watts (AMD's exporter): large steps050060708090100110120130seconds since the plan started (the 32-stream minute runs from 60 to 120)
Figure 8Both runs from second 56 to 132, without smoothing. Shaded: the seconds in which the engine process of the run with large steps used no CPU. Its card fell to idle power in the same seconds, and its log reports a kernel build of that length for each.Source: plan-mixed-overlap/timeline.json of both runs; server.log of 20261125T215049Z-series-fa ("[aiter] finish build ... cost")

In its 32-stream minute the run with large steps did nothing for 27 seconds: no CPU for the engine process, the card at 196 W. Its log gives the reason: three attention kernels built on first use, 21.7, 3.8 and 3.7 s. This run started later and found them built.

Counting only the seconds in which its engine worked, the run with large steps wrote 22.2 answer tokens a second in that minute and made 1.15 steps a second. Counted the same way this run wrote 132.6 and made 4.85: 5.9 times the tokens, not 11.0 times.

The four long prompts sent as the minute began had their first token after 18.6 to 48.1 s here, and after 46.0 to 70.2 s with large steps, builds included. Once they are read, this run's last seconds of the minute reach 767 answer tokens a second.

My reading: every decoding stream gets one token per engine step, so shorter steps mean more turns for everyone. The price is that each step reads less of the waiting prompts.

Seconds per engine step: large steps832128256drain0.01 s0.1 s1 s10 s100 s060120180240300360seconds since the plan started
Figure 9Large steps: once long prompts are in the mix a step takes about a second. The three gaps of 22, 4 and 4 seconds are the builds.Source: timeline.json of 20261125T215049Z-series-fa (steps_s)
Seconds per engine step: small steps832128256drain0.01 s0.1 s1 s10 s100 s060120180240300360seconds since the plan started
Figure 10Small steps: a third of a second, for the whole plan. Computed from the step counter as in the other plot.Source: plan-mixed-overlap/timeline.json (steps_s)

05The requests

What the clients saw

Every request: large stepsat 8: 39at 32: 25at 128: 96at 256: 137832128256drain060120180240300360seconds since the plan started
Figure 11Every request of the run with large steps as one line, in the order sent. Violet: no answer token yet. Blue: answering. Green dot: ended well. Black dot: a long prompt.Source: requests.jsonl of 20261125T215049Z-series-fa
Every request: small stepsat 8: 38at 32: 31at 128: 121at 256: 152832128256drain060120180240300360seconds since the plan started
Figure 12The same for this run. The violet wedge at the top right is the price: at 256 streams requests wait longer for their first token.Source: plan-mixed-overlap/requests.jsonl (t_sent, t_first, t_end, end)
requests sentlong prompts among themfirst token, median slongest, sended inside the plancut while answeringcut before a first token
sent at 8 streams
large steps3900.31.73900
small steps3800.31.83800
sent at 32 streams
large steps2546.871.915100
small steps3147.248.12920
sent at 128 streams
large steps96631.393.659370
small steps121726.7109.072490
sent at 256 streams
large steps137665.2146.454830
small steps152691.7172.22710718
all requests of the plan
large steps2971643.6146.41671300
small steps3421764.4172.216615818

From each run's requests.jsonl. Tinted rows are this run. The median and the longest first-token time are over the requests that got a first token. "Ended inside the plan" compares within this pair only, and best at the 32-stream stair, where both runs were sent the same long prompts.

Of the requests sent at 32 streams, 29 of 31 ended inside the plan here and 15 of 25 with large steps. Over the whole plan the two runs ended almost the same number: 166 and 167.

Requests "cut at the end of the plan" (176 here) are not refusals and not failures: the load generator closed them when the plan's time was over. All 342 requests got HTTP 200.

06Underneath, and what it means

The same card, the same work, in a different order

Card power, watts (AMD's exporter)large stepssmall steps and the cap (this run)8 streams32 streams128 streams256 streamsdrain: no new requests0500Cache in use, %large stepssmall steps and the cap (this run)050100Requests running (the server's gauge)large stepssmall steps and the cap (this run)0100200060120180240300360seconds since the plan started
Figure 13Both runs over the whole plan. Grey: large steps. Colour: this run. With large steps the server takes in more requests sooner and fills its cache; with small steps it holds fewer at once and stays below a full cache.Source: plan-mixed-overlap/timeline.json of both runs (watts, cache_percent, running)

Over the whole plan, drain included, this run wrote 117,480 answer tokens and the run with large steps 119,182 (the per-second counts of each timeline, added up): 1.4% apart.

The price shows at the top: at 256 streams this run kept at most 100 requests running against 174, the median first token came after at least 95.7 s against 65.2 s, and 18 requests were cut before a first token.

What I take from it

  • With steps of 2,048 tokens and the cap, the engine makes three to four steps a second under this load and no second is silent.
  • The gain in answer tokens is 2.1 times to 3.7 times where nothing disturbed the comparison.
  • Prompts are read 19.8% to 23.3% slower at 256 and 128 streams.
  • Shorter steps give every stream more turns and each prompt less of every turn. Answers come earlier; capacity is not added.

Not results, and limits

  • The ratio at 32 streams is inflated by the other run's kernel builds. Two settings changed together; which one works is open.
  • A closed loop: the two runs met different requests after the 32-stream minute began. The bench has a second plan with the same requests at the same moments for every server.
  • Prompts are random tokens. Nothing here is about the quality of an answer.

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

Engine step
one pass of the model over a batch: one new token for every decoding stream, plus a bite of 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.

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

FACTS.json 160f5ca0d495 · GLOSSARY.md 98323be796af · plans/mixed-overlap.json b86c1f4ef044 · runs/20261125T215049Z-series-fa/plan-mixed-overlap/requests.jsonl 694b08ff0653 · runs/20261125T215049Z-series-fa/plan-mixed-overlap/t0 2ee118d3a1b0 · runs/20261125T215049Z-series-fa/plan-mixed-overlap/timeline.json 2136a1e512e7 · runs/20261125T215049Z-series-fa/server.log a2aa2d010fcc · runs/20261125T215049Z-series-fa/summary.json ec0c01913c37 · runs/20261125T223438Z-series-fa-batch2k/plan-mixed-overlap/requests.jsonl c524013589a6 · runs/20261125T223438Z-series-fa-batch2k/plan-mixed-overlap/t0 ddda6d548584 · runs/20261125T223438Z-series-fa-batch2k/plan-mixed-overlap/timeline.json e18647ef421b · runs/20261125T223438Z-series-fa-batch2k/summary.json 35fa706c2022

88 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 · 766 KB · every number traced to its run file

Download the PDF