mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
The tensor-core prompt attention (D-1) refused Q4_0 pools, so --kv q4_0 read every prompt through the FP32 per-query kernel. Mode 4 is mode 1 (int8) with a scale per 32 values: each q4_0 block's 16 code bytes become 32 exact int8 codes (code - 8) at gather, its fp16 scale goes to the per-group scales, which are applied in FP32 as int8's are (q.k per 32-dim group; p.v folds each group's scale into p, two groups per warp). The p.v fold is bounded by the chunk's largest |scale|: q4_0 scales are signed (ggml's d = max / -8). The caller's rotation of q and of the output is unchanged. STRATA_PROMPT_ATTN_Q4=0: the old kernel (A/B). qsa_prompt_attn_parity gets Q4_0 cases with signed scales spread over two decades, as a pool holds them (32K and 1.5K contexts), against FP64 and the old kernel.