AISpot

llama.cpp b11800 新增 QSA mask 融合運算元,並將 k-pool mask 推廣為通用實現

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

llama.cpp b11800 為 QSA 新增融合運算元,並將原本只服務 qwen4exp 與 glm5-next 池化選擇的 k-pool mask 推廣為通用 ggml_top_k_mask,DSA 模型與 DeepSeek V4 CSA 也改用該運算元。它保留 top-k 選中與額外保留的 mask 單元、其餘置為 -inf,可按 head 逐行選擇,後端不支援時回退原路徑。

原標題:b11800
閱讀原文

評分50 / 45(平均 47,門檻 60)
狀態未入選

原文

llama: create new fused op for QSA mask ( #30640 ) llama: create new fused op for QSA scoring enroll glm5.3-next too tests : initialize the remaining tensors in test_kpool_mask The harness sentinels were left uninitialized, so leftover memory could read as NaN and fail the NaN check. ggml: generalize the k-pool mask op into ggml_top_k_mask The k-pool mask op only covered the pooled QSA selection of qwen4exp and glm5-next, while the DSA models and the DeepSeek V4 CSA build the same top-k mask by hand with fill, set_rows and add. ggml_top_k_mask(mask, top_k, score, blocks, extra) keeps the mask cells of the live picks and the extra cells, and sets the rest to -inf. Every row tensor is 4D in the layout of top_k, and the mask is broadcast to those rows, so a selection can also be made per head. score, blocks and extra are optional: without score every pick is live, without blocks a pick is a cell, and extra holds the cells a row keeps without a pick. llm_graph_context::build_fused_top_k_mask views the row tensors in the layout of kq_mask and registers the fused node. The k-pool models, the DSA attention of build_attn and the DeepSeek V4 CSA mask use it when the probe enables the op, and keep their current path on backends without it. Co-authored-by: Pascal [email protected] Website: https://llama.app Attestations: https://github.com/ggml-org/llama.cpp/attestations/58392496 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 評分37

llama.cpp 發布 b11352 版本,最佳化 Qwen4 掩碼構造

llama.cpp 發布 b11352 建置版本,主要變更為最佳化 Qwen4 的掩碼構造(#29824),並將相同改動應用到 GLM5-next。該版本覆蓋 macOS、iOS、Linux、Android、Windows 與 openEuler 平台,提供 CPU、Vulkan、CUDA 12/13、ROCm 10.0、OpenVINO、SYCL 等多種後端建置,其中 macOS Apple Silicon 的 KleidiAI 建置被標記為 DISABLED。

llama.cpp releasesAI 評分48

llama.cpp 修復 k-pool 模型圖重分配導致的解碼中止

llama.cpp 發布 b11412,修復 k-pool 模型(qwen4exp、glm5-next)解碼時意外重新預留計算圖並中止的問題。原因是兩模型按 cache_safe、n_tokens 等 reserve 無法預知的狀態分支,解碼圖與預留圖節點數不一致(如 7564 對 7762),解碼時被迫按當前狀態重預留、丟掉最壞情況尺寸,在 GGML_SCHED_DEBUG_REALLOC=1 下直接 abort。

llama.cpp releasesAI 評分40

llama.cpp b11600 修復 T5 無快取注意力的 KQ 偏置填充

llama.cpp 發布建置 b11600,主要修復無快取注意力中 KQ 偏置未填充的問題:T5 會額外加入形狀為 [n_tokens, n_tokens] 的相對位置偏置,當 n_tokens 不能整除填充後的寬度時,與 KQ 相加會失敗,現在按 K、V 的做法用零把偏置填充到 mask 的 KV 維度。