llama.cpp b11635:修复 x86 FP16 转 FP32 性能回退
原标题:b11635
AI 摘要
llama.cpp 发布 b11635 版本,修复了 ggml-cpu 在 x86 平台上的 FP16->FP32 转换性能回退问题。此前 #30270 将标量转换统一走 F16C 指令,导致 Clang 20.1.8 下 FP16->FP32 转换被编译为 vpinsrw 并合并进量化点积的累加寄存器,使循环串行化,Q8_0/Q4_0 MUL_MAT_ID 内核实测慢 45-65%。本次改动保留 FP32->FP16 使用 F16C,而 FP16->FP32 恢复查表方式,并附带各平台预编译二进制。
正文节选
<details open> ggml-cpu : keep the FP16->FP32 lookup table on x86 with F16C (#30342) (#30343) * ggml-cpu : keep the FP16->FP32 lookup table on x86 with F16C (#30342) #30270 routed both scalar conversions through F16C. For FP16->FP32, Clang 20.1.8 lowers the intrinsic to a vpinsrw merging into the live accumulator register of the quantized dot products, which serialises the loop (19 vs 4 cycles/iteration estimated, 45-65% slower Q8_0/Q4_0 MUL_MAT_ID kernels measured). Keep F16C for FP32->FP16