AISpot

llama.cpp 為 Hexagon NPU 向量化 softplus 啟用

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

llama.cpp 把 Hexagon 後端的 softplus 啟用從標量迴圈改為 HVX 向量實現,Snapdragon NPU 上的推理可因此加速。softplus_f32 與 tile_softplus_f32 統一呼叫新的 hvx_softplus_f32_aa(),複用後端已有的 hvx_vec_exp_f32 與 hvx_vec_log_f32,不引入新的數值近似。

原標題:b11703
閱讀原文

評分20 / 42(平均 31,門檻 60)
狀態未入選

原文

hexagon: vectorize softplus with HVX ( #30435 ) softplus_f32 and tile_softplus_f32 ran a scalar logf(1.0f + expf(x)) loop. Replace both with a shared hvx_softplus_f32_aa() helper built from the backend's existing hvx_vec_exp_f32 / hvx_vec_log_f32 primitives, so no new numerical approximation is introduced. hvx_vec_exp_f32 clamps its input to (-88, 88) before exponentiating, so a naive log(1 + exp(x)) composition would saturate to ~88.72 for large x instead of returning x. The Q6_V_vmux_QVV select keeps the scalar reference's x > 20 guard (ggml_compute_softplus_f32 in ggml-impl.h), which is what makes the vector path match the CPU result. Assisted-by: Claude Website: https://llama.app Attestations: https://github.com/ggml-org/llama.cpp/attestations/56858411 macOS/iOS: macOS Apple Silicon (arm64) macOS Apple Silicon (arm64, KleidiAI enabled) DISABLED macOS Intel (x64) iOS XCFramework Linux: Ubuntu x64 (CPU) Ubuntu arm64 (CPU) Ubuntu s390x (CPU) Ubuntu x64 (Vulkan) Ubuntu arm64 (Vulkan) Ubuntu x64 (CUDA 12) - CUDA 12.8 libraries Ubuntu x64 (CUDA 13) - CUDA 13.4 libraries Ubuntu arm64 (CUDA 13) - CUDA 13.4 libraries Ubuntu x64 (ROCm 10.0) Ubuntu x64 (OpenVINO) Ubuntu x64 (SYCL FP32) Ubuntu x64 (SYCL FP16) Linux arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU) - setup guide Android: Android arm64 (CPU) Android arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU) - setup guide Windows: Windows x64 (CPU) Windows arm64 (CPU) Windows arm64 (OpenCL Adreno) Windows x64 (CUDA 12) - CUDA 12.4 DLLs Windows x64 (CUDA 13) - CUDA 13.4 DLLs Windows arm64 (CUDA 13) - CUDA 13.4 DLLs Windows x64 (Vulkan) Windows arm64 (Vulkan) Windows x64 (OpenVINO) Windows x64 (SYCL) Windows x64 (ROCm 10.0) openEuler: DISABLED openEuler x86 (310p) openEuler x86 (910b, ACL Graph) openEuler aarch64 (310p) openEuler aarch64 (910b, ACL Graph) UI: UI

相關報導

llama.cpp releasesAI 評分45

llama.cpp Hexagon 後端為二進位制運算元擴充套件標量 DMA 廣播支援

llama.cpp 發布 b11580 建置,Hexagon 後端為二進位制運算元擴充套件了標量 DMA 廣播支援,並刪除全部非 DMA 路徑,同時新增對非連續 stride 的處理。REPEAT 與 COMPLEX 核心這次也改用 DMA,hex-add-id 為 src2 索引加法補上 DMA;hex-geglu-erf 新增僅 F32 的門控,該運算元不支援 F16。

llama.cpp releasesAI 評分45

llama.cpp b11573:Vulkan 後端用打包 FMA 替代點積運算元做 f16 累加

llama.cpp 發布 b11573 建置,Vulkan 後端改用打包 FMA 做 f16 累加,不再使用獨立的點積運算元。新的 dot_product 實現每次 f16 FMA 打包兩行,並更名為 dot_product_v2。該版本照例提供各平台預編譯包,覆蓋 CUDA 12/13、ROCm 10.0、SYCL、OpenVINO、Vulkan,以及 Snapdragon 的 CPU、Adreno GPU 與 Hexagon NPU;

llama.cpp releasesAI 評分43

llama.cpp 為 Hexagon NPU 增加 q2_k 與 q3_k 量化支援

llama.cpp 合併 PR #29717,為 Hexagon 後端新增 q2_k 和 q3_k 兩種量化型別支援,並統一了 src1_row_size 的分配方式。該改動由高通工程師 Max Krasnyansky 參與提交,面向在驍龍 Hexagon NPU 上執行本地推理的使用者,相關建置覆蓋 Linux arm64 與 Android arm64 的 Snapdragon CPU、Adreno GPU、Hexagon NPU 組合。