Repository navigation
Pin gpu-kernels 08bb2241: HIP prompt flash attention with causal block skipping (Qwen3-4B pp4096 +45%) - #491
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gpu-kernels 08bb2241 adds, since e85b7547:
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 ).
Auto-merge is off on purpose: merge by hand after the hw_gate job passes.
🤖 Generated with Claude Code