llama.cpp b11985:Metal 后端 MXFP4 与算子性能优化
原标题:b11985
AI 摘要
llama.cpp 发布 b11985 版本,主要针对 Metal 后端做性能优化:MXFP4 矩阵-向量内核改用 fp16 位技巧解码 fp4 值并以对齐的 32 位字加载打包半字节,不再使用 threadgroup 内存;连续一元与二元算子改用最多 256 线程的完整 threadgroup 并做尾部边界检查;GLU 行拆分到多个 threadgroup 以改善单行解码。该版本同时提供 macOS、iOS、Linux、Android、Windows 多平台多后端预编译包。
正文节选
<details open> metal : faster MXFP4 mat-vec, full threadgroups for unary/binary/GLU (#31075) * metal : faster MXFP4 mat-vec kernel Decode the fp4 values with the fp16 bit trick instead of a threadgroup lookup table, and load the packed nibbles as aligned 32-bit words. The kernel no longer uses threadgroup memory. * metal : launch contiguous unary and binary ops with full threadgroups The contiguous unary path and the row-broadcast binary path used one thread per threadgroup. Use up to 256 t