Skip to content

Pin gpu-kernels 08bb2241: HIP prompt flash attention with causal block skipping (Qwen3-4B pp4096 +45%) - #491

Merged
bong-water-water-bong merged 1 commit into
mainfrom
1bit/pin-gpu-kernels-08bb2241
Oct 21, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
1bit/pin-gpu-kernels-08bb2241

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

gpu-kernels 08bb2241 adds, since e85b7547:

Measured on strixhalo gfx1151, performance mode, private build (llama.cpp 5dcf6623 +
hrx-system 82804197 + the add-on):
Qwen3-4B Q5_K_M 4096-token prompt: attention 916.5 -> 296.0 ms at ub 2048; llama-bench
pp4096 ub2048 2103.0 -> 3043.8 (+44.7%), pp4096 ub512 +6.3%, pp2048 ub2048 +7.5%.
Qwen3.8-27B unchanged (interleaved x3, within +-0.3%).
Correctness: fa-prompt-bench vs a double reference PASS on 7+ shapes; KLD vs the Loom kernel
4B 0.000002, Coder-30B-A3B 0.000912, ZAYA1-8B 0.007729 (top-1 routing amplifies it; against a
CPU reference the new kernel is as close as Loom: ZAYA ub128 0.0412 vs 0.0417, Qwen3-1.7B
0.007708 vs 0.007716).

scripts/hw-gate.sh --bin (ops,kat,kld,needle,placement) on that build: PASS on every row except
kat zaya1-8b varied-1620w, which diverged at token 5 - the near-tie noted in #487 (the answer
is unchanged, 7341). tests/golden/hw-gate/kat-zaya1-8b.json re-recorded at this pin
(scripts/hw-gate.sh --phases kat --models zaya1-8b --record --bin ).

Auto-merge is off on purpose: merge by hand after the hw_gate job passes.

🤖 Generated with Claude Code

…k skipping (Qwen3-4B pp4096 +45%)

gpu-kernels 08bb2241 adds, since e85b7547:
- #19: W4A4 prompt prefill on the iu4 WMMA (Q4_0, off by default).
- #20: fa_prompt_f16_d128, a WMMA prompt flash attention for f16 KV caches, head 128, that
  skips KV blocks whose mask is -inf for a whole query tile; no 2048-row limit.

Measured on strixhalo gfx1151, performance mode, private build (llama.cpp 5dcf6623 +
hrx-system 82804197 + the add-on):
  Qwen3-4B Q5_K_M 4096-token prompt: attention 916.5 -> 296.0 ms at ub 2048; llama-bench
  pp4096 ub2048 2103.0 -> 3043.8 (+44.7%), pp4096 ub512 +6.3%, pp2048 ub2048 +7.5%.
  Qwen3.8-27B unchanged (interleaved x3, within +-0.3%).
Correctness: fa-prompt-bench vs a double reference PASS on 7+ shapes; KLD vs the Loom kernel
4B 0.000002, Coder-30B-A3B 0.000912, ZAYA1-8B 0.007729 (top-1 routing amplifies it; against a
CPU reference the new kernel is as close as Loom: ZAYA ub128 0.0412 vs 0.0417, Qwen3-1.7B
0.007708 vs 0.007716).

scripts/hw-gate.sh --bin (ops,kat,kld,needle,placement) on that build: PASS on every row except
kat zaya1-8b varied-1620w, which diverged at token 5 - the near-tie noted in #487 (the answer
is unchanged, 7341). tests/golden/hw-gate/kat-zaya1-8b.json re-recorded at this pin
(scripts/hw-gate.sh --phases kat --models zaya1-8b --record --bin <that build>).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bong-water-water-bong bong-water-water-bong added the hw-gate Run the HRX hardware gate on Strix Halo (docs/hw-gate.md) label Oct 21, 2026
@bong-water-water-bong
bong-water-water-bong merged commit c14d2c6 into main Oct 21, 2026
8 of 10 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/pin-gpu-kernels-08bb2241 branch October 21, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hw-gate Run the HRX hardware gate on Strix Halo (docs/hw-gate.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant