Skip to content

LLMs on NPU

End-to-end decoder-only LLM inference (prefill + autoregressive decode) mapped to the AMD NPU2 in bf16 via MLIR-AIR. Coverage and performance below are refreshed nightly. Per-model details and source are in programming_examples/llms/.

Nightly LLM Benchmark (NPU2)

End-to-end LLM inference performance on the AMD Ryzen AI 5 PRO 340 (Krackan Point, NPU2) benchmark runner โ€” 2ร—32 GB DDR5-5600 SODIMM โ€” refreshed nightly. TTFT is time to first token (prefill latency); Decode is steady-state generation throughput.

Verify: ๐ŸŸข pass   ๐Ÿ”ด fail   โšช skipped.   โ€” not measured.

Decode throughput vs context (tok/s)

Steady-state decode throughput at increasing KV-cache depth.

The models below reimplement AMD NPU LLM designs originally developed by the FastFlowLM team, using the higher-level abstractions of the MLIR-AIR dialect.

Model 1k 2k 4k 8k 16k 32k 64k 128k Verify
gemma3_4b_q4nx (HF) 20.96 19.83 17.83 14.93 11.13 7.25 3.70 1.92 ๐ŸŸข
gemma4_e2b_q4nx (HF) 24.11 23.75 23.18 22.06 20.14 17.14 13.21 6.79 ๐ŸŸข
lfm2_1_2b_q4nx (HF) 69.43 65.65 59.16 49.42 37.25 24.95 15.01 8.36 ๐ŸŸข
llama31_8b_q4nx (HF) 13.38 12.94 12.10 10.74 8.61 6.27 3.73 1.92 ๐ŸŸข
llama32_1b (HF) 10.31 8.49 6.81 4.51 2.83 1.22 0.50 0.22 ๐ŸŸข
llama32_1b_int4 (HF) 13.83 11.25 8.26 4.94 2.77 1.09 0.48 0.19 ๐ŸŸข
llama32_1b_q4nx (HF) 70.26 66.88 59.90 49.92 37.51 25.07 15.07 8.38 ๐ŸŸข
llama32_3b (HF) 4.04 3.52 2.71 1.84 0.82 0.36 โ€” โ€” ๐ŸŸข
llama32_3b_q4nx (HF) 28.21 25.86 22.13 17.29 12.01 7.46 3.97 2.13 ๐ŸŸข
phi4_mini_q4nx (HF) 23.56 21.73 18.73 14.72 10.30 6.44 3.46 1.86 ๐ŸŸข
qwen25_0_5b (HF) 10.74 10.82 9.45 5.91 3.89 1.78 0.77 0.36 ๐ŸŸข
qwen25_1_5b (HF) 6.64 5.92 5.03 3.52 1.80 0.77 0.42 0.21 ๐ŸŸข
qwen25_3b (HF) 4.14 3.82 3.04 1.95 1.06 0.48 0.25 0.09 ๐ŸŸข
qwen25_3b_q4 (HF) 22.90 21.76 19.72 16.81 12.96 8.89 5.46 3.08 ๐ŸŸข
qwen25_7b_q4nx (HF) 13.40 12.84 11.87 10.30 8.15 5.76 3.63 2.09 ๐ŸŸข
qwen3_0_6b (HF) 8.53 6.45 4.00 2.87 1.30 0.55 โ€” โ€” ๐ŸŸข
qwen3_1_7b (HF) 6.24 4.93 3.73 2.57 1.18 0.52 โ€” โ€” ๐ŸŸข
qwen3_4b (HF) 3.19 2.54 1.71 1.20 0.54 0.23 โ€” โ€” ๐ŸŸข
qwen3_4b_q4nx (HF) 21.01 19.33 16.64 13.03 9.10 5.59 3.08 1.63 ๐ŸŸข
qwen3_8b_q4nx (HF) 12.73 12.07 10.93 9.26 7.07 4.75 2.82 1.56 ๐ŸŸข
smollm2_1_7b (HF) 5.91 5.00 3.59 2.13 1.13 โ€” โ€” โ€” ๐ŸŸข

โ€” not swept at this context, or an expected failure.

Prefill latency vs padded prefill length (TTFT, ms)

Time to first token at increasing padded prefill length. Each column is a separate build of the prefill ELFs: the prompt is padded to the built length, so TTFT tracks that length rather than the number of real prompt tokens.

Model 512 1k 2k 4k Verify
gemma3_4b_q4nx (HF) 985 1739 3428 7028 ๐ŸŸข
gemma4_e2b_q4nx (HF) 865 1377 2493 โ€” ๐ŸŸข
lfm2_1_2b_q4nx (HF) 376 610 1044 81875 ๐ŸŸข
llama31_8b_q4nx (HF) 1269 2337 5416 11606 ๐ŸŸข
llama32_1b (HF) 286 496 931 1919 ๐ŸŸข
llama32_1b_int4 (HF) 279 514 936 1934 ๐ŸŸข
llama32_1b_q4nx (HF) 271 448 840 1778 ๐ŸŸข
llama32_3b (HF) 622 1073 2230 5091 ๐ŸŸข
llama32_3b_q4nx (HF) 611 1050 2243 5014 ๐ŸŸข
phi4_mini_q4nx (HF) 707 1212 2520 5756 ๐ŸŸข
qwen25_0_5b (HF) 360 485 805 โœ— ๐ŸŸข
qwen25_1_5b (HF) 631 1101 2114 4334 ๐ŸŸข
qwen25_3b (HF) 1126 2049 4002 8252 ๐ŸŸข
qwen25_3b_q4 (HF) 1163 2148 3969 8105 ๐ŸŸข
qwen25_7b_q4nx (HF) 2035 3830 7609 15632 ๐ŸŸข
qwen3_0_6b (HF) 379 644 1242 2689 ๐ŸŸข
qwen3_1_7b (HF) โ€” โ€” 1787 3755 ๐ŸŸข
qwen3_4b (HF) 1255 2401 4778 10197 ๐ŸŸข
qwen3_4b_q4nx (HF) 1243 2415 4713 9945 ๐ŸŸข
qwen3_8b_q4nx (HF) 1757 3315 6586 13469 ๐ŸŸข
smollm2_1_7b (HF) 451 817 1571 3268 ๐ŸŸข

โ€” not swept at this length, or an expected failure.

โœ— unexpected failure.

Vision-Language-Action policies

Not autoregressive: these emit one action chunk per observation rather than a token stream, so there is no decode throughput and no context to sweep. Action chunk is the latency to the model's first usable output. Prefix is the token count the backbone attends over.

Model Prefix Action chunk (ms) Measured Verify
smolvla 241 616.7 2026-10-15 ๐ŸŸข
smolvla_all 241 366.8 2026-10-15 ๐ŸŸข

๐Ÿ“ˆ Performance history over time โ€” per-nightly TTFT and decode throughput plotted per model.

Last updated 2026-10-16 ยท mlir-air 9b81b5d ยท mlir-aie e7048fa ยท llvm-aie 22.0.0.2026101201+83ba9ea9