llama.cpp 为 SYCL 新增量化 KV 的 DPAS flash attention 内核
原标题:b11980
AI 摘要
llama.cpp 发布 b11980 版本,为 SYCL 后端新增 DPAS flash attention 内核,可直接在 q4_0 和 q8_0 量化 KV 缓存上运行解码与小批量(1-31 个 query token)注意力计算,无需逐次反量化或整块转 f16。在 B580 上运行 Llama 3.1 8B Q4_K_M、q4_0 KV、16K 上下文时,tg128 从 31.3 t/s 提升至 54.2 t/s。该内核覆盖 64-512 头尺寸、最高 32 的 GQA 及 attention sinks,可通过 GGML_SYCL_FA_DPAS=0 关闭。
正文节选
<details open> [SYCL] add DPAS flash attention kernel for quantized KV cache (#31125) * sycl : add DPAS flash attention kernel for quantized KV cache Decode and small batches (1 to 31 query tokens) now run flash attention straight on q4_0 and q8_0 KV blocks, instead of scalar dequant or converting the whole cache to f16 per call. Q.K uses s8 x s4 and s8 x s8 DPAS on XMX, V.P stays f16. dpas.s4.s8 is inline vISA since joint_matrix has no s4. Covers head sizes 64 to 512, GQA up to 32 and atten