You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On AMD Strix Halo (Radeon 8060S Graphics, RADV GFX1151) with Vulkan, -ctk turbo3 -ctv turbo3 produces gibberish from the very first decode tokens on Gemma 4 31B. Reproduces with both a stock unsloth Q4_K_M and a custom 6-bit GGUF, so the weight quant is not the variable. Same binary, same hardware, same flags works cleanly on Qwen 3.6 35B-A3B (qwen35moe, head_dim K = 256) and on Gemma 4 31B with f16 KV.
Initial guess was Gemma 4's ISWA hybrid cache. After a quant-control test pass, head_dim K = 512 on Gemma 4 global-attention layers looks like a more likely trigger than the SWA/full alternation itself.
This is potentially the same family as #88 (Vulkan turbo3 incoherent decode while HIP works), but with a different repro (different model, different RDNA generation), so I'm filing it separately.
All four runs share the same binary, hardware, and flags -c 8192..16384 -ngl 999 -fa on --host 127.0.0.1 --port 8088 plus -ctk turbo3 -ctv turbo3 unless noted.
Run #2 is the key control: stock Q4_K_M, file type printed as Q4_K - Medium, general.quantization_version = 2. Same gibberish as the custom 6-bit. So this is not a custom-quant interaction.
Run #3 is the second key control: same backend (Vulkan), same binary, same flags, same hardware, including turbo3 KV, on a Q8-grade Qwen MoE. Coherent across short / 1k / 2.5k-token prompts. So this is not "Vulkan turbo3 general bug on GFX1151".
GGML_ABORT (expected per README — Vulkan only ships turbo3 attention kernels)
Suspected cause — K head_dim 512 on Gemma 4 global, not ISWA per se
I started out blaming the ISWA hybrid cache, but the Qwen control above narrows it. The discriminating axis between the broken Gemma runs and the working Qwen run is not archi-vs-archi or quant-vs-quant in the obvious way:
Gemma 4 31B (broken)
Qwen 3.6 35B-A3B (working)
Backend / hardware / driver
Vulkan, GFX1151, Mesa 25.3.6
identical
-ctk/-ctv turbo3 -fa on
yes
yes
KV layout
2 caches (ISWA), interleaved SWA(1024)/global
1 uniform cache
K head_dim
512 on global, 256 on SWA
256 uniform
V head_dim
256
128
WHT-rotated KV kernels typically operate on power-of-2 blocks (128 is the canonical block size for the turbo3 rotation in this fork's CUDA path; Vulkan coopmat is 16x16 / 32x16 tiled inside). A K head_dim of 512 forces the rotation to chain over four 128-blocks, which is unusual — most models (Llama-family, Qwen, Mistral) sit at 128 K head_dim, some Gemma variants and a few others sit at 256, but 512 is rare. If the Vulkan turbo3 K path is correct at 128 and 256 but mistiles or under-reduces at 512, the Gemma 4 global layers would corrupt write-side immediately, which is what we see.
ISWA itself is probably not the trigger: the SWA layers in Gemma 4 use K head_dim 256, same as Qwen, and Qwen is fine. So the broken layers in this scheme would be the 10 global-attention layers, head_dim 512, not the 50 SWA ones.
I have not bisected this — happy to instrument the K-write path if you can point me at it.
Eval bug: broken vulkan on Bazzite Linux #64 (Gemma-4-26B-A4B + turbo3 + flash-attn assertion failure on RX 9070 XT / Bazzite): same model family, but a hard GGML_ASSERT at warmup, not silent corruption. Probably a different code path (FA assert vs. K-write rotation).
What I'd find useful
A pointer to where K head_dim is dispatched in the Vulkan turbo3 KV write/read path, so I can patch-test with explicit 128-block chaining at head_dim 512.
Or a known-good Gemma 4 31B + turbo3 run on Vulkan from the maintainers (any GPU) — would confirm whether this is GFX1151 / Mesa 25.3.6 specific, vs. Vulkan-wide for Gemma 4 global layers.
Whether the CUDA turbo3 K path special-cases head_dim 512 in a way the Vulkan path doesn't.
Happy to run any test build / patch — Strix Halo is the only piece of hardware here so iteration is fast.
Other notes
MTP works perfectly on the same Gemma 4 31B model (--mtp-head + --spec-type mtp), ~2.3× speedup over baseline, with -ctk f16 -ctv f16. So the bug is purely on the -ctk turbo3 write-or-read path on Vulkan, not in MTP, not in the GGUF, not in flash-attn-on-Gemma in general.
Repro logs (load logs with the llama_kv_cache: block confirming head dims, full curl outputs, all four runs) available on request — kept under /tmp/turbo3-repro/ on my box.
TL;DR
On AMD Strix Halo (
Radeon 8060S Graphics, RADVGFX1151) with Vulkan,-ctk turbo3 -ctv turbo3produces gibberish from the very first decode tokens on Gemma 4 31B. Reproduces with both a stock unsloth Q4_K_M and a custom 6-bit GGUF, so the weight quant is not the variable. Same binary, same hardware, same flags works cleanly on Qwen 3.6 35B-A3B (qwen35moe, head_dim K = 256) and on Gemma 4 31B with f16 KV.Initial guess was Gemma 4's ISWA hybrid cache. After a quant-control test pass, head_dim K = 512 on Gemma 4 global-attention layers looks like a more likely trigger than the SWA/full alternation itself.
This is potentially the same family as #88 (Vulkan turbo3 incoherent decode while HIP works), but with a different repro (different model, different RDNA generation), so I'm filing it separately.
Environment
Radeon 8060S Graphics (RADV GFX1151), 124 GiB unified memory free6.19.14-200.fc43.x86_641.4.328, driver RADV, Mesa 25.3.62e81dc5f6(current default branch ofAtomicBot-ai/atomic-llama-cpp-turboquant, which forks this repo)-DGGML_VULKAN=ON -DCMAKE_BUILD_TYPE=Release -DGGML_RPC=ONGL_KHR_cooperative_matrixandGL_NV_cooperative_matrix2reported supported byglslcat configure timeRepro matrix
All four runs share the same binary, hardware, and flags
-c 8192..16384 -ngl 999 -fa on --host 127.0.0.1 --port 8088plus-ctk turbo3 -ctv turbo3unless noted.-ctk f16 -ctv f16Run #2 is the key control: stock Q4_K_M, file type printed as
Q4_K - Medium,general.quantization_version = 2. Same gibberish as the custom 6-bit. So this is not a custom-quant interaction.Run #3 is the second key control: same backend (Vulkan), same binary, same flags, same hardware, including turbo3 KV, on a Q8-grade Qwen MoE. Coherent across short / 1k / 2.5k-token prompts. So this is not "Vulkan turbo3 general bug on GFX1151".
Sample broken outputs (Gemma 4 31B stock Q4_K_M + turbo3)
Prompt:
"The capital of France is",n_predict=30,temp=0.7:Prompt ~1021 tokens of coherent text + summarize instruction,
n_predict=50,temp=0.3:Prompt ~2533 tokens (well past the 1024-token SWA window):
Symptom: garbage tokens (Latin + Cyrillic + CJK fragments) from the very first decoded token. No transient correctness then drift — broken from t=0.
Sample working outputs
Gemma 4 31B Q4_K_M, drop turbo3, keep everything else:
Qwen 3.6 35B-A3B, same binary, same
-ctk turbo3 -ctv turbo3, short prompt:Same Qwen on a 2.9k-token prompt: coherent summary, EOS at 32 tokens.
Mitigations attempted (none fix it)
-fa off(disable flash-attn)GGML_VK_DISABLE_COOPMAT=1 GGML_VK_DISABLE_COOPMAT2=1-ctk turbo3 -ctv f16(asymmetric)-ctk f16 -ctv turbo3(asymmetric)-ctk turbo4 -ctv turbo4GGML_ABORT(expected per README — Vulkan only ships turbo3 attention kernels)Suspected cause — K head_dim 512 on Gemma 4 global, not ISWA per se
I started out blaming the ISWA hybrid cache, but the Qwen control above narrows it. The discriminating axis between the broken Gemma runs and the working Qwen run is not archi-vs-archi or quant-vs-quant in the obvious way:
-ctk/-ctv turbo3 -fa onWHT-rotated KV kernels typically operate on power-of-2 blocks (128 is the canonical block size for the
turbo3rotation in this fork's CUDA path; Vulkan coopmat is 16x16 / 32x16 tiled inside). A K head_dim of 512 forces the rotation to chain over four 128-blocks, which is unusual — most models (Llama-family, Qwen, Mistral) sit at 128 K head_dim, some Gemma variants and a few others sit at 256, but 512 is rare. If the Vulkan turbo3 K path is correct at 128 and 256 but mistiles or under-reduces at 512, the Gemma 4 global layers would corrupt write-side immediately, which is what we see.ISWA itself is probably not the trigger: the SWA layers in Gemma 4 use K head_dim 256, same as Qwen, and Qwen is fine. So the broken layers in this scheme would be the 10 global-attention layers, head_dim 512, not the 50 SWA ones.
I have not bisected this — happy to instrument the K-write path if you can point me at it.
Relation to existing issues
GGML_ASSERTat warmup, not silent corruption. Probably a different code path (FA assert vs. K-write rotation).What I'd find useful
Happy to run any test build / patch — Strix Halo is the only piece of hardware here so iteration is fast.
Other notes
--mtp-head+--spec-type mtp), ~2.3× speedup over baseline, with-ctk f16 -ctv f16. So the bug is purely on the-ctk turbo3write-or-read path on Vulkan, not in MTP, not in the GGUF, not in flash-attn-on-Gemma in general.llama_kv_cache:block confirming head dims, full curl outputs, all four runs) available on request — kept under/tmp/turbo3-repro/on my box.