AISpot

llama.cpp 修復 ggml conv_1d 批次輸入轉置錯誤

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

llama.cpp 修復了 ggml conv_1d 在批次輸入下輸出通道與批次維度錯位的問題。conv_1d 背後的 GEMM 把 batch 折進行,結果在記憶體中是 [OL, N, OC],reshape 卻宣告為 [OL, OC, N],形狀正確但內容被轉置,因此不報錯、通道與批次交錯;N==1 時兩種讀法等價,倉庫裡三個 vocoder 都沒觸發。

原標題:b11630
閱讀原文

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

原文

ggml: fix conv_1d result layout for batched input ( #28738 ) ggml: fix conv_1d result layout for batched input The GEMM behind conv_1d folds the batch into its rows, so the product sits in memory as [OL, N, OC] while the reshape claims [OL, OC, N]. The shape is right and the contents are transposed, so nothing fires: no assert, no abort, the graph just runs and the channels come out interleaved with the batches. With N == 1 the two readings describe the same buffer, which is why the three vocoders in the tree never hit it, they all squeeze to 2d right after the call. Reshape to the real layout and permute OC and N back. The N == 1 path keeps its direct reshape, so the current callers build the same graph and pay for no extra copy. tests/test-conv-1d.cpp compares one batched convolution against N single batch convolutions built from the same weight and the same input slices. Five of the seven geometries fail before this change and all seven pass after. N == 1 and OC == 1 pass either way, since swapping two dimensions when one of them is 1 changes nothing. The batched path matters to downstream audio projects where several synthesis lanes share a single graph. Nothing in mtmd batches a vocoder today, each one streams one flow and carries its left context between calls, but the op is correct now if one of them grows a lane dimension. ggml: build the same conv_1d graph for every batch size Address review from ggerganov: drop the N == 1 branch of ggml_conv_1d. The GEMM result is always reshaped to [OC, N, OL] and permuted back, as ggml_conv_2d does, so every batch size builds the same graph. For N == 1 this adds a cont on an already ordered tensor. Website: https://llama.app Attestations: https://github.com/ggml-org/llama.cpp/attestations/56061987 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 b11436 修復 OpenVINO 後端多項 GPU 迴歸

llama.cpp b11436 修復 ggml-openvino 後端的 CI 測試失敗與多項 GPU 迴歸。上游 #29622 給輸入 embedding 圖加入混合 token/embd 分支,後端改為只從計算節點建置 OV 模型,並把同型別連續 DUP 按 CONT 翻譯以避免圖被拆分,修復了 CPU 與 GPU 上首個單 token decode 失敗;

llama.cpp releasesAI 評分46

llama.cpp 修復 ggml_acc 負偏移導致的越界寫

llama.cpp 建置 b11529 修復了 ggml 中 ggml_acc 的越界寫漏洞:ggml_acc_impl 將 size_t 偏移量收窄為 int32_t 時未做檢查,超大偏移會截斷成負數,再被符號擴充套件為巨大 size_t 導致邊界斷言失效,可在 dst 緩衝區下方越界寫入。修復方式是在收窄前檢查偏移量,與 ggml_set_impl 中已有檢查保持一致。該版本同時提供 macOS、Linux、Windows、Android 等多平台預編譯包。

llama.cpp releasesAI 評分45

llama.cpp 修復 ggml-cpu 多執行緒 SET_ROWS 越界寫

llama.cpp 修復了 ggml-cpu 後端 SET_ROWS 運算元的多執行緒越界寫入問題:該運算元按 n_tasks=1 規劃,但每個執行緒都會執行並各自佔用 F16→F32 轉換緩衝區的一行,當計算圖中還有別的多執行緒運算元時,編號大於 0 的執行緒就會寫到工作緩衝區之外;修復方式是把 set_rows 併入 n_task=n_threads 的執行緒組。

llama.cpp releasesAI 評分45

llama.cpp 建置 b11448:ggml-cuda 分塊處理大塊 BF16/FP16 轉 F32

llama.cpp 發布建置 b11448,ggml-cuda 後端把大塊 BF16/FP16 到 F32 的轉換改為分塊執行(#29442),並修正分塊 cuBLAS 矩陣乘法未遵循目標 stride 的問題,提交由 Johannes Gäßler 參與。改動僅涉及 CUDA 後端,影響用 NVIDIA GPU 做本地推理的場景;該建置同時覆蓋 macOS Apple Silicon 與 Linux、Windows 的 CUDA 12/13 等平台。