Repository navigation
llama-graph: make norm inputs contiguous for qwen4exp only (qwen35 one-token decode back on the fused GDN kernel) - #152
Merged
bong-water-water-bong merged 1 commit intoOct 25, 2026
Conversation
…e-token decode back on the fused GDN kernel) #142 (a25b4b8) made build_norm wrap every view / reshape input in a CONT for all arches. On qwen35 (Qwen3.5 / 3.8, Ternary-Bonsai) the CONT before RMS_NORM(VIEW(gated-delta-net output)) broke the HRX add-on's fused one-token GDN match (hip.q36.gdn_decode): decode fell back to the Loom llm_gated_delta_net_f32_wmma_head128 path plus 112 copies, 1432 -> 1608 dispatches per token. The CONT now applies to LLM_ARCH_QWEN4EXP only, the arch it was added for. HRX dispatch profile, Ternary-Bonsai-2-27B PQ2_0, one-token decode, 31 steps, medians (fork 6ded110 + gpu-kernels 2b626798a -> this): 1608 -> 1432 dispatches, step period 50.20 -> 48.05 ms (GDN 1.24 ms Loom -> 0.51 ms q36_gdn_decode_f32; state get_rows 2.18 -> 1.06 ms; copy_f32 0.51 ms -> gone). llama-bench tg128 -r 3, three interleaved rounds (performance mode): PQ2_0 20.17 / 20.36 / 20.46 -> 20.94 / 21.31 / 21.31 tok/s; Qwen3.8-27B UD-Q4_K_XL 11.70 / 11.79 / 11.78 -> 12.13 / 11.89 / 12.11. KLD vs the Bonsai F16 CPU logits (8 x 512): -ub 1 0.000000 (same top 100%, as before); -ub 8 0.000074. No kernel changed (gpu-kernels 2b626798a in both builds). Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Base:
1bit/hrx-vulkan-patchedat6ded110(#147). One commit,278997f.Fork #142 (a25b4b8, Flash-Next on HRX) added a contiguous copy in front of every norm input for all architectures. On qwen35 models (Qwen3.8-27B, Bonsai-2-27B) that copy broke the match for the fused one-token GDN kernel (
q36_gdn_decode): decode fell back to the Loom GDN path plus 112 extra copy dispatches per token. This restricts the copy to qwen4exp, which is the architecture #142 needed it for.Measured (loom agent, strixhalo, gpu-kernels 2b626798a + hrx-system 82804197, performance mode):
KLD vs the F16 reference at
-ub 1unchanged (0.000000). hw-gate ops + kat on qwen3.8-27b: PASS on a build carrying this commit. Flash-Next (qwen4exp) keeps the copy and is unaffected.Full log: strixhalo
~/wt/loom-bonsai/REPORT.md(section "Bonsai one-token decode profile").🤖 Generated with Claude Code