
针对 AMD Strix Halo (gfx1151) 的性能调优版 LLaMA.cpp: FA + MoE 预填修复,附带 curr
针对 AMD Strix Halo (gfx1151) 的性能调优版 LLaMA.cpp: FA + MoE 预填修复,附带 curr
A ready-to-run llama.cpp for AMD Strix Halo (Ryzen AI Max+ 395 / Radeon 8060S / gfx1151), tuned for long-context, quantized-KV workloads. It bundles a set of Flash-Attention and MoE-prefill fixes plus a current GPU driver, so quantized KV cache is fast instead of a penalty.
The measurements behind these fixes (matrices, methodology, raw data) live in the companion evidence pack.
v0.6.4 payload vs stock master, same box, same session (amd_iommu=off, pp512 / tg32 t/s, -b 512 -ub 512,
-r 3, captured 2026-08-18 between 05:28 and 06:04 UTC). Baseline is stock upstream 9f0d017 at f16 KV, the
commit this release merged; fixed is the released v0.6.4 payload (baf6360b on strix-halo-vulkan). Both arms
were built with the same pinned glslc and run against the same pinned Mesa, so only llama.cpp differs. Every cell
traces to a raw run under benchmarks/results/glance-20260818/.
| Model (arch) | KV | Prefill d0 | Prefill deep | Decode d0 | Decode deep |
|---|---|---|---|---|---|
| Qwen3-Coder-30B-A3B-Instruct (Q6_K_XL, hd128 MoE) | f16 stock | 1161 | 72 | 69 | 23 |
| f16 | 1242 = +7% | 235 = 3.26x | 69 = +1% | 23 = +0% | |
| q8_0 | 1230 = +6% | 233 = 3.24x | 69 = +0% | 32 = +41% | |
| Qwen3.6-35B-A3B (Q4_K_XL, hd256 MoE) | f16 stock | 1125 | 492 | 62 | 43 |
| f16 | 1507 = +34% | 618 = +26% | 62 = -0% | 43 = -0% | |
| q8_0 | 1524 = +35% | 616 = +25% | 62 = -1% | 50 = +14% | |
| Qwen2.5-7B-Instruct (Q4_K_M, hd128 dense) | f16 stock | 1350 | 358 | 48 | 34 |
| f16 | 1512 = +12% | 663 = 1.85x | 48 = +0% | 34 = -0% | |
| q8_0 | 1505 = +11% | 660 = 1.84x | 47 = -1% | 38 = +14% |
"deep" is d65536 for the two MoE models and d32768 for Qwen2.5-7B, whose trained context is 32768
(qwen2.context_length, no rope scaling). The 7B does keep scaling past that, 2.31x at d65536 on the
2026-08-10 capture, but that is outside the context the model was trained for, so it is not quoted beside two
models measured inside theirs. This capture takes d0 and the deep point only; full curves for all five depths
are in benchmarks/BENCHMARKS.md, from the 2026-08-10 capture.
All three stock arms reproduce their 2026-08-10 values within 0.5% on every cell, a week of upstream apart, so the movement in the fixed rows is this stack changing and not the baseline or the box drifting.
Depth scaling is a head-dim effect, not a dense-vs-MoE one. Both hd128 models climb hard with depth (Coder 1.07x at d0 rising to 3.26x at 64k; the dense 7B 1.12x rising to 1.85x at 32k) while the hd256 model is flat to slightly declining (1.34x at d0, 1.26x at 64k). One of those hd128 models is MoE and one is dense, so what tracks the depth win is KV channel count, not sparsity. The hd256 model never collapsed in the first place, so there is no collapse to recover.
What moved since the 2026-08-10 capture is the shallow end. The 35B went +22% to +34% at d0 and the dense 7B
+1% to +12%, while Coder-30B barely moved at d0 (+6% to +7%). That is the v0.6.4 matmul work: the wave32 retile
and LDS pad tune apply to the quantised dense coopmat pipelines, which is most of the 7B's prefill and much of
the 35B's, whereas Coder-30B-A3B pushes its GEMM through mul_mat_id, which already ran wave32. The 35B also
collects the transposed-concat default, a fix derived on exactly its delta-net conv-state path. Those
attributions come from the per-commit isolations in the release notes, not from this table, which measures the
whole stack at once.
Decode is untouched by the Vulkan fixes, by construction. Across all three models, fixed-f16 decode matches stock-f16 decode within 1% at every depth. So the decode column's q8 win is the KV type, not the patches: +41% on Coder, +14% on the 35B, +14% on the dense 7B at their deep points.
Read the prefill rows as a build comparison, not a KV-type one. f16 and q8 land within 1.2% of each
other at every depth on every model, so on this stack KV quantization is no longer a prefill-speed
decision. Keep -ctk q8_0 -ctv q8_0 anyway: it still buys KV memory and the decode throughput at depth
shown above. One caveat the earlier numbers missed: q8 costs a few percent of shallow prefill (-1.0% at
d0 on Coder, and up to -3.1% at the larger production ubatch), and that cost falls to zero by 64k. See
f16 catches up.
What each fix contributes:
| Fix / knob | Backend | Contribution |
|---|---|---|
| FA dequant-once (#25494) | Vulkan | the bulk of the 3.26x: dequantize q8 KV once in the FA kernel (prefill). Was measured at 2.66x on the 2026-07-25 build; the headline rose to 3.26x as the FA prefill stack landed on top, against an unchanged stock baseline (72 t/s @64k then and now) |
| all-quant transpose | Vulkan | extends it to q4/q5 KV (q4 lands the same 2.64x) |
| f16 KV contiguize | Vulkan | 2.63x f16 prefill at depth (Coder-30B pp512 @64k: 70.6 to 190.0 vs master 8161641). f16 KV only, prefill only, on by default (GGML_VK_FA_KV_CONTIG=0 opts out). It contributes nothing to the q8 headline above; it is what makes the f16 line match it. |
FA prefill stack (P-hoist / Psh relayout / wave32) |
Vulkan | +2.8 to +3.1% at d0 rising to +21.6 to +22.0% at d32768 on Coder-30B, consistent across f16/q8/q4 KV, decode unchanged. P-hoist alone +6.9/+8.1/+9.2% at d8k/16k/32k; the wave32 pin adds a further +2.7 to +11.9% on top, rising with depth; the Psh relayout measures ~0 on its own and rides along as the enabler for the vectorized GEMM2 A load. |
| dense wave32 retile (v0.6.4) | Vulkan | quantised dense coopmat pipelines run at wave32 on RDNA3.x, where WMMA is wave32-native. Standalone MUL_MAT at the dense FFN shapes: q6_K +5.2 to +10.8%, q8_0 +5.4 to +8.4%, q4_K +0.7 to +9.1%; the float paths are bandwidth-bound and left alone. PPL bit-identical. |
| coopmat LDS pad tune (v0.6.4) | Vulkan | per-path shared-memory pad on RADV: pad 2 reaches 16 of 32 banks against 8 for the old constant, +13% mean on the quantised path in a standalone sweep (q4_0 +32%, q8_0 +22%, q4_K +10%, q6_K +1%). Largest where the dequant is cheapest, the complement of what wave32 helps. Together with the retile: +11.0% / +7.7% pp2048 at ub256 / ub2048 on Qwen3-32B, payload A/B against v0.6.2. |
| transposed concat (v0.6.4) | Vulkan | default-on tiled transpose for the delta-net conv-state concat, which otherwise walks src1 at a stride that lands every read on one of 16 memory channels (13.7 GB/s against 138.9). +7.2% pp2048 at ub2048 on Qwen3.8-27B, +0.4% at ub256. Delta-net models only. |
| mmid row-list prepass | Vulkan | +8.4% MoE prefill on the 2026-07-14 window (q8 KV, base b805834); the current in-repo isolation on f16 measures +11.2% at d0 / +8.2% at d16384 (results/finalize/rowlists_{off,on}.md). Model-dependent; ~1–2% on Coder at depth. |
| mmid BM64 | Vulkan | +1.3% (13.5 t/s against ±3.5 — near noise). The scale-cache that used to sit here is disabled: it was obsoleted by later tile changes and regressed. |
| mmid WAVE32 / F16B | Vulkan | marginal. WAVE32 +2.8%, but its mechanism caps out ~1.7%, so treat it as noise-adjacent. F16B is quoted at +2.4% from an unvendored model; the only in-repo isolation (Coder-30B) measures +1.2% at d0. On by default. |
| mmid TILE16 / INT | Vulkan | −3.8% / −8% (documented negatives, never enabled). The −8% arm is INT+SMALLN and its control carried BM64 while neither INT arm did, so part of that loss is the missing BM64; INT alone is −7.9%. |
| HIP tile-dequant KV | HIP/ROCm | +128% / +232% decode @32k / 64k (beats f16) |
amd_iommu=off |
host | +1.0–7.3% prefill, decode within noise (optional host tuning) |
Honest read: on Coder the q8 prefill headline is almost entirely FA dequant-once, with the 2026-07-30 FA
stack adding roughly a fifth more at depth. The f16 contiguize is a win of comparable size on the f16 line,
which is why KV type is no longer a prefill-speed decision here. rowlists is the
real MoE-prefill fix (larger on other shapes); the rest are small waste-removals and the knob-tweaks are
marginal-to-negative — as expected on a bandwidth-bound kernel. The v0.6.4 matmul rows are the exception to
that last clause: they are the first knob-level changes here worth double digits, and they act at every
depth rather than only where FA collapses, which is why the shallow end of the table moved. Full per-depth
matrices + charts are below and in benchmarks/BENCHMARKS.md.
vulkan/ self-contained Vulkan/RADV build (recommended default backend on this hardware).
Bundles Mesa 26.3.0-devel RADV + libdrm 2.4.134, so it does not use or need the host
Mesa. Runs directly on the host with just the Vulkan loader and /dev/dri.hip/ ROCm/HIP build carrying the quantized-KV decode fix. Needs the ROCm runtime, so it
is built as a container image (Dockerfile.hip). Not published: no :hip tag exists on
ghcr and hip/bin is git-ignored, so this one is build-it-yourself today — see below.Three ways — the first two need no build and no Docker:
1. Portable tarball (recommended for a quick start). Self-contained — bundles the RADV driver, so it
doesn't use the host's Mesa; only needs libvulkan1 + read access to /dev/dri:
curl -L https://github.com/Nathanw1014/strix-halo-llamacpp/releases/download/v0.2/strix-halo-llamacpp-vulkan-portable.tar.gz | tar xz
./vulkan/llama-server -m /path/to/MODEL.gguf -ngl 99 -fa 1 -ctk q8_0 -ctv q8_0 --host 0.0.0.02. Container. docker pull ghcr.io/nathanw1014/strix-halo-llamacpp:vulkan (see Quickstart).
3. Build from source. Build the strix-halo-vulkan branch of the
fork (the complete Vulkan stack) — see BUILD.md
for the exact toolchain; build-from-source.sh then assembles the built binaries + driver into this layout.
The tarball (31 MB) ships via GitHub Releases and the Vulkan container image via ghcr; neither is tracked in git. The HIP image is not published — build it locally if you need the ROCm decode fix.
To check a tarball is really using the bundled GPU driver rather than falling back to CPU, run
./vulkan/llama-bench -m MODEL.gguf -ngl 99 -p 128 -n 8 -r 1 and confirm the backend column
says Vulkan (not CPU) and that it prints a ggml_vulkan: 0 = ...RADV STRIX_HALO line.
The v0.1 tarball fails this check — its ICD manifest was missing a required field, so the
bundled driver was skipped and it ran on CPU. Use v0.2 or later.
Which route gets which fixes. All three routes are cut from the same strix-halo-vulkan tip,
so they carry the same fixes. The benchmark tables further down were measured on an earlier build
(63f88cc, 2026-07-23) and therefore predate the f16 KV contiguize pass and the 2026-07-30 FA
stack: they understate the current artifacts rather than overstate them.
LLAMA_QSA_POOL_CACHE=0 turns it off.GGML_VK_DENSE_F16B conve暂无开放 Issues,或尚未同步最近议题。