返回全部动态
llama.cpp b10532:Metal 后端 KV 反量化优化 Flash Attention
原标题:b10532
AI 摘要
llama.cpp 发布 b10532 版本,在 Metal 后端为 flash attention 新增 KV 缓存反量化预处理,将 Q8_0、Q4_0、Q4_1、Q5_0、Q5_1 等量化 KV 反量化为 F16 后运行注意力内核,并优化了 MLA 模型中 V 为 K 视图时的冗余反量化。该版本在 M2 Ultra 上通过全部 4798 项测试,Qwen2.5-0.5B 的困惑度与 F16 KV 参考一致。
以上摘要由 AI 生成,可能存在误差。事实请以原文为准。
正文节选
<details open> metal : dequantize quantized KV to F16 before flash attention (#27390) * metal: dequantize q8_0 KV to f16 before flash attention Add a preprocessing pass for GGML_OP_FLASH_ATTN_EXT on the Metal backend: when the KV cache is quantized (Q8_0 for now), dequantize K and V into a contiguous F16 scratch buffer and run the existing F16 flash attention kernels on it, instead of the in-kernel dequantization path. - new kernel kernel_flash_attn_ext_dequant_to_f16<block_t, QK, deq_t4x4>:
发布时间:2026-08-21 08:42
抓取时间:2026-08-21 09:35
来源机构:ggml-org