From 9921067b044f7a2b0a6bd4c9aad1b62216e461f0 Mon Sep 17 00:00:00 2001 From: keptn42 Date: Fri, 23 Oct 2026 21:41:06 +0200 Subject: [PATCH] gemma4_bf16: name the fused q|k|v row by class, not by k_eq_v A global class with its own v projection (attention_k_eq_v false, Gemma 4 E2B/E4B) named its row attn_qkvs like the sliding class, and the second declaration failed at w4a8. --- arch/gemma4_bf16/gemma4_bf16.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/gemma4_bf16/gemma4_bf16.cpp b/arch/gemma4_bf16/gemma4_bf16.cpp index 0e4d036c..75a54ec1 100644 --- a/arch/gemma4_bf16/gemma4_bf16.cpp +++ b/arch/gemma4_bf16/gemma4_bf16.cpp @@ -382,7 +382,9 @@ int Gemma4Attn::declare(RadBuilder* b, Names& nm, const Geom& geom, int l, const if (fused) { if (!qkv_slot) return RAD_E_INVAL; if (!*qkv_slot) - *qkv_slot = decl_b(b, nm.f(cls.has_v ? "attn_qkvs" : "attn_qkvg"), g.act_dtype, + /* named by class, not by the value path: a global class with its own v (E2B/E4B, + * attention_k_eq_v false) has one too, and the two rows differ in width */ + *qkv_slot = decl_b(b, nm.f(cls.head_ladder ? "attn_qkvg" : "attn_qkvs"), g.act_dtype, {g.max_tok, qkvd}); w.qkv = *qkv_slot; if (cls.has_v)