AISpot

llama.cpp 修復 ggml 檢視越界檢查,改按 stride 實際位元組

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

llama.cpp 發布 b12102,修復 ggml 檢視的越界檢查:此前用同形狀連續張量的大小校驗,導致行重疊但未越界的檢視被誤判、stride 過寬而越界的檢視反而通過;現在檢視函式把 stride 傳給張量建構函式,按實際到達的位元組數檢查。另新增斷言要求帶 stride 的檢視從 dim 0 連續元素開始,delta_net 的卷積視窗改為一次建立全部行,不再在檢查後擴寬。

原標題:b12102
閱讀原文

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

原文

ggml: bound views by the bytes their strides reach ( #31584 ) ggml: bound views by the bytes their strides reach A view was checked against its source with the size of a contiguous tensor of the same shape, computed before its strides were set. Views whose rows overlap failed that check although they stay inside their source, and views with wider strides passed it while reaching past the end. The view functions now pass their strides to the tensor constructor, which checks the bytes they actually reach, like ggml_nbytes. The conv windows of delta_net are created with all their rows at once instead of being widened after the check. ggml: assert that a strided view starts from contiguous elements The view functions set nb[0] to the type size, so the source must have contiguous elements along dim 0 for the view to read them. Website: https://llama.app Attestations: https://github.com/ggml-org/llama.cpp/attestations/63502997 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 26.04 s390x (CPU) Ubuntu 26.04 s390x (zDNN) 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 評分46

llama.cpp 修復 ggml CLAMP 非連續檢視定址錯誤

ggml 修復了 CLAMP 運算元在非連續檢視上的定址錯誤,涉及 CPU 與 CUDA 後端。CUDA 此前按 ggml_nelements 做平坦處理、忽略檢視 stride,CPU 則把第 j 行按 j*nb01 定址、忽略 nb02/nb03;現在兩者都改為遵循 dims 1..3 的 stride,且 CUDA 的 supports_op 要求行連續,與 Metal 一致。

llama.cpp releasesAI 評分43

llama.cpp:ggml SCALE 支援非連續檢視

llama.cpp 新建置 b11923 放寬了 ggml SCALE 運算元的輸入要求:此前 src0 必須一維連續,現在只需 dim-0 連續、允許任意行步長,與 Metal 後端一元運算元的行為一致。CPU(f32、bf16 按位元組步長定址行)、CUDA(步長感知核心,用 fastdiv 做行分解)與 Metal(新增 bf16 scale)均已適配,SYCL 仍限定連續輸入。test_scale 增加了 view 變體測試,已在 CPU、Metal、CUDA 上驗證;

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

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

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