absorb_q

Function absorb_q 

Source
pub fn absorb_q(
    cfg: &Glm5NextDsaConfig,
    q_b: &[f32],
    kv_b: &[f32],
    full_heads: usize,
) -> Result<Vec<f32>>
Expand description

q_absorb[h*kvl + c][k] = Σ_r kv_b[h*(nope+vd) + r][c] · q_b[h*nope + r][k].

Per head this is W_k^Tᐧq_b — an A^T B contraction, which the A @ B^T GEMM kernel cannot express without a transpose, so it runs on the host once at load.

🪤 q_b_proj and kv_b_proj carry different per-head widths (qk_head_dim = 256 vs nope + v_head_dim = 512). Using one stride for the other still yields a well-formed 2-D tensor of plausible values.