AISpot

llama.cpp b11574 最佳化 Hexagon NPU 複製與拼接運算元

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

llama.cpp 發布 b11574 建置,重點最佳化 Hexagon NPU 後端的 CPY/CONCAT 與 gather-rows 運算元:按 DMA 描述符分塊搬執行、加入雙緩衝與迴圈展開,緩解短行場景受 DMA 延遲拖累的問題,並支援 3/4 維維度摺疊。該版本還把 mdev 下 vtcm_acquire 的同步狀態全部改為原子操作,修復多裝置配置中的隨機卡死,並新增只建置/安裝 Hexagon 後端的選項。

原標題:b11574
閱讀原文

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

原文

hexagon: optimize CPY/CONCAT — round 3, short-rows edition ( #30341 ) hexagon: move the converting CPY in blocks of rows per DMA descriptor so short rows are not DMA-latency bound hex-cpy: cleanup cpy cursor handling hex-cpy-concat: introduce threaded dma/hvx gather-row helper Co-authored-by: Ruslan Karymov [email protected] hex-cpy: remove leftover rejections for extended buffers hex-cpy: relax the gate for fast-path hex-cpy: remove scalar divs and vtcm access and use explicit gather_sync hex-cpy: add proper support for mdev work splitting to fastpath hex-cpy: optimize dense gather-row tasks hex-cpy: unroll gather-rows loops hex-cpy: add fastpath for f16 hex-cpy-concat: support for colapsing 3/4D dims hex-cpy: double-buffer support hex-cpy: factor out gather-rows into more of an op by itself hex-cpy-concat: dedup kernel-params hex-cpy-concat: step-down nr to fit instead of hard fail hex-gather: replace div with a mask hex-gather-rows: cleanup dma pipeline and remove the stalls hex-gather: specialize compute funcs hex-gather: reduce scalar reg.spills and func calls hex-gather: do not recompute rows-per-thread on the npu hex-build: add support for building/installing just hexagon hex-cpy-concat: remove redundant barrier in concat and move cpy barrier under fence hex-gather: annotations for dma-out hex-mdev: make all key vtcm_acquire sync state atomic (fixes random hangs in mdev setups) Co-authored-by: Yiwei Shao [email protected] Co-authored-by: Ruslan Karymov [email protected] Website: https://llama.app Attestations: https://github.com/ggml-org/llama.cpp/attestations/55095068 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 IM2COL DMA 環形佇列溢位

llama.cpp 建置 b11516 修復了 Hexagon NPU 上 IM2COL patch-embed 的 DMA 環形佇列溢位問題:當 IC*KH 超過 255 時,每執行緒 256 項的 DMA 環寫滿後新描述符被靜默丟棄,導致 VTCM 暫存緩衝的剩餘行未寫入,陳舊資料(常為 NaN/inf)汙染輸出。修復方式是在環滿時淘汰最舊描述符並呼叫 dma_queue_flush() 等待,與同檔案 blocked kernel 的做法一致。

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 評分48

llama.cpp b11560 為 Hexagon NPU 新增 IM2COL_3D 支援

llama.cpp 建置 b11560 為 Hexagon NPU 後端新增 IM2COL_3D 支援,並把 hex-im2col 核心重寫為規範的 DMA 雙緩衝流水線,去掉除法運算與低效的 fp16 轉換,同時將 kernel_params 與 VTCM 佈局預計算移到 host 側、支援非連續檢視。該系列提交由 OpenCode 輔助完成,共同作者為高通的 Max Krasnyansky。

llama.cpp releasesAI 評分43

llama.cpp 更新 Hexagon 後端,預設動態緩衝升至 512MB

llama.cpp b11490 把 Hexagon 後端的預設動態緩衝從 128MB 提升到 512MB,原因是 128MB 在大 MoE 模型上會導致效能退化。hex-bufs 新增 alloc_buffer_n 支援,並可將大張量拆分到獨立緩衝區;環境變數 GGML_HEXAGON_MBUF 改為接受 dyn、static、total 三個值。hex-run 還新增 --no-embd-offload 選項,用於簡化需要該設定的裝置上的命令列。

llama.cpp releases● 精選AI 評分68

llama.cpp Hexagon 的 flash_attn 改為按 KV 頭切分

llama.cpp 的 Hexagon 後端在 row-split 多核模式下把 flash_attn 從按 Q token 切分改為按 KV head 切分,讓每個核心只讀自己負責的那部分 KV cache,不再重複讀取全部 KV cache。該行為由 GGML_HEXAGON_FA_HEAD_SPLIT 控制,預設開啟;當 n_kv_heads 不能被核心數整除時回退到原 token-block 切分(如 4 核上只有 2 個 KV head 的 Gemma-4)。