AISpot

llama.cpp b12000 新增 OCP FP8 E4M3 支援與 CPU 快速核心

llama.cpp releases版本更新地端推論開源

llama.cpp 合併 b12000,為 OCP FP8 E4M3 打通模型轉換、gguf-py 讀寫與 CPU 推理路徑。轉換側修復了逐行 FP8 被誤判為 NVFP4、FP8 QKV 縮放需隨權重一同 reshape、Qwen3-Next 融合 qkvz 等問題,並支援僅含 FP8 的 compressed-tensor checkpoint。CPU 新增 F8_E4M3 快速核心(暫不含 RISC-V),Metal 後端暫時把 FP8 列入黑名單;

FP8 E4M3 首次在 llama.cpp 貫通轉換、gguf-py 與 CPU 推理三層並配專用快速核心,對處理 FP8/NVFP4 量化權重的本地推理使用者最直接。

原標題:b12000: Quant: OCP FP8 E4M3 support (#27512)
閱讀原文

評分70 / 71(平均 70,門檻 60)
狀態精選

全文翻譯

- WIP OCP FP8 E4M3 支援 - 修復 Python 型別檢查器 - 轉換時也為 FP8 實體化 input_scales - 修復 https://huggingface.co/RedHatAI/Qwen3.8-27B-NVFP4 的轉換 - 逐行 FP8 錯誤地落入 NVFP4 轉換,因為 NVFP4 僅檢查 - 維度。還要檢查 FP8 的 dtype - 需要以與權重重塑相同的方式重塑 FP8 QKV 投影縮放 - 權重被重塑 - 允許剩餘 FP8 張量在轉換期間被反量化 - 允許僅 FP8 壓縮張量檢查點的張量策略 - 修復並測試 gguf-py 對 FP8_E4M3 的行為 - 暫時禁止 FP8 的 QKV 融合 - 修復 Qwen3-Next 的融合 qkvz 與 FP8 的轉換 - 避免為 --fuse-gate-up-exps 融合 FP8,因為我們可能有不同的 ws - 在轉換期間不融合 FP8 時發出警告 - 更多 FP8 轉換修復 - 在 CPU 中新增對 FP8 的跨步複製的支援 - 從 FP8 CPU cpy/dup 路徑中移除不需要的暫存緩衝區 - 新增解釋性註釋和 TODO - 為 FP8 新增專用編碼器和解碼器測試 - 在 metal 中將 ggml_op_get_rows 加入白名單而非黑名單 - 修復失敗的 CI 所需,且白名單應該比將 FP8 加入黑名單更具 - 前瞻性 - https://github.com/ggml-org/llama.cpp/actions/runs/38433916498/job/115422880633?pr=27512 - 修復更多轉換錯誤 - 轉換期間延遲權重實體化 - 在 metal 後端將 fp8 加入黑名單而非白名單 - 調整縮排 - 修復 lint + 執行測試 - 為 F8_E4M3 新增快速 CPU 核心 - 轉換修復 - 修復剩餘缺口 - 啟用帶共享縮放的繫結權重 - 使強制 F32 規則在轉換期間適用於 FP8 - 修復 Python 型別檢查 - https://github.com/ggml-org/llama.cpp/actions/runs/39765670052/job/119780379595?pr=27512 - 修復 kaleidai 單元測試失敗 - https://github.com/ggml-org/llama.cpp/actions/runs/39765670125/job/119780383150 - 放寬預檢查的數值精度約束 - 將快速 FP8 CPU 留在 RISC-V 上以供後續處理 - 我們已經將 arm 排除在快速路徑之外 - 允許輸出縮放張量位於任意 gguf 分片中 - 將 test_conversion_fp8.py 測試執行移至 behavior-check.yaml - 應用程式碼審查中的批次建議 - 共同作者:Sigbjørn Skjæret [email protected] - 將混合壓縮張量邏輯移入 dequant_fp8 + 為其新增單元測試 - 在 Windows 上也為 behavior-check 安裝所有依賴 - 修復 https://github.com/ggml-org/llama.cpp/actions/runs/40535852590/job/122300758223?pr=27512 - 在 Windows 中清理前取消對映惰性張量 應修復 https://github.com/ggml-org/llama.cpp/actions/runs/40539797824/job/122314782459?pr=27512 LF 行結束符 https://github.com/ggml-org/llama.cpp/actions/runs/40539798168/job/122314791118?pr=27512 將 FP8 測試從 llama-arch 提取到其自己的 test-fixture 參見 #27512(評論) 更新 gguf/gguf/scripts/gguf_convert_endian.py Co-authored-by: Sigbjørn Skjæret [email protected] Co-authored-by: Sigbjørn Skjæret [email protected]

由 AI 翻譯,以原文為準。

原文
WIP OCP FP8 E4M3 support Fix python type-checker Materialize input_scales also for FP8 when converting Fix conversion of https://huggingface.co/RedHatAI/Qwen3.8-27B-NVFP4 Per row FP8 wrongly fell to NVFP4 conversion, as NVFP4 checked on dims alone. Also check on dtype for FP8 Need to reshape FP8 QKV projections scales in the same way that weights are reshaped Allow remaining FP8 tensors to be dequantized during conversion Allow tensor-strategy for FP8-only compressed-tensor ckpts Fix and test gguf-py behavior for FP8_E4M3 Disallow QKV-fusion for FP8 temporarily Fix conversion of fused qkvz & FP8 for Qwen3-Next Avoid fusing FP8 for --fuse-gate-up-exps as we may have different ws Emit warnings when not fusing FP8 during conversion More FP8 conversion fixes Add supported for strided copies to/from FP8 in CPU remove unneeded scratch buffer from FP8 cpu cpy/dup path add explanatory comments and TODOs Add dedicated encoder and decoder tests for FP8 Whitelist ggml_op_get_rows in metal instead of blacklisting required to fix failing CI, and white-listing should be more future-proof than adding FP8 to the black-list https://github.com/ggml-org/llama.cpp/actions/runs/38433916498/job/115422880633?pr=27512 Fix more conversion bugs Defer weight materialization during conversion Blacklist fp8 in metal backend instead of white-list Adjust indents Fix lint + execute tests Add fast CPU kernel for F8_E4M3 Conversion fixes Fix remaining gaps Enable tied weights with shared scales Make mandatory-F32 rules apply to FP8 during conversion Fix python type checks https://github.com/ggml-org/llama.cpp/actions/runs/39765670052/job/119780379595?pr=27512 Fix kaleidai unit-test failures https://github.com/ggml-org/llama.cpp/actions/runs/39765670125/job/119780383150 Relax numeric precision constraints for pre-check Leave fast-FP8 CPU on RISC-V for follow-up We already exclude arm from the fast-path Allow output scale tensors to be located in any gguf shard Move test_conversion_fp8.py test execution to behavior-check.yaml Apply batched suggestions from code review Co-authored-by: Sigbjørn Skjæret [email protected] Move mixed compressed-tensor logic into dequant_fp8 + add unit-tests for it Install all requirements also on Windows for behavior-check Fixes https://github.com/ggml-org/llama.cpp/actions/runs/40535852590/job/122300758223?pr=27512 Unmap lazy tensors before clean-up in Windows Should fix https://github.com/ggml-org/llama.cpp/actions/runs/40539797824/job/122314782459?pr=27512 LF line endings https://github.com/ggml-org/llama.cpp/actions/runs/40539798168/job/122314791118?pr=27512 Extract FP8 tests from llama-arch to its own test-fixture See #27512 (comment) Update gguf-py/gguf/scripts/gguf_convert_endian.py Co-authored-by: Sigbjørn Skjæret [email protected] Co-authored-by: Sigbjørn Skjæret [email protected]

相關報導

llama.cpp releasesAI 評分42

llama.cpp 回退 x86 上 FP16→FP32 的 F16C 最佳化,修復量化核心效能回退

llama.cpp 在 ggml-cpu 中撤銷 x86 上 FP16→FP32 的 F16C 內建轉換,恢復使用查詢表,只保留 FP32→FP16 走 F16C。此前 #30270 把兩種標量轉換都改為 F16C,但 Clang 20.1.8 會把該 intrinsic 編譯成 vpinsrw 合併進量化點積的活躍累加暫存器,導致迴圈序列化:估計每輪 19 週期對 4 週期,實測 Q8_0/Q4_0 的 MUL_MAT_ID 核心慢 45–65%。

llama.cpp releasesAI 評分53

llama.cpp 最佳化 Metal 後端:MXFP4 矩陣向量與 GLU 提速

llama.cpp 發布 b11985,Metal 後端三項改動提速:MXFP4 矩陣向量核心改用 fp16 位技巧解碼 fp4 值、以對齊的 32 位字載入打包 nibble,不再佔用 threadgroup 記憶體;連續 unary/binary 與行廣播 binary 路徑改為每 threadgroup 最多 256 執行緒並對尾部做邊界檢查;GLU 的每行拆分到多個 threadgroup,單行 decode 不再只用一個 threadgroup。

llama.cpp releasesAI 評分41

llama.cpp b11799 為 SYCL 後端加入 q8 快速反量化

llama.cpp 發布 b11799 建置,新增 SYCL 後端的 q8 快速反量化(#30775),可提升 Intel GPU 上量化模型的推理效率。該版本同時提供 macOS、Linux、Windows、Android 的多平台預編譯包,涵蓋 CUDA 12、CUDA 13、ROCm 10.0、Vulkan、OpenVINO 與 Snapdragon 的 CPU、Adreno GPU、Hexagon NPU 版本;SYCL 建置則分為 FP32 與 FP16 兩版。