llama.cpp 修復 Gemma 4 重複存放 token_embd 表,純 CPU 載入省下 216 MiB
llama.cpp 發布 b12008,修復 Gemma 3n 與 Gemma 4 中 token_embd 表被重複存放的問題:改為先建立 token_embd,再建立與它繫結的輸出層。此前當輸入與輸出共用同一種緩衝型別,也就是純 CPU、-ngl 0 執行時,同一張表會被存兩份。實測 gemma-4-E2B-it Q4_K_M 在關閉 mmap 的情況下,CPU 模型緩衝從 3163.73 MiB 降至 2947.73 MiB,省約 216 MiB。
原標題:b12008
閱讀原文
| 評分 | 42 / 42(平均 42,門檻 60) |
| 狀態 | 未入選 |
|---|
原文
gemma3n, gemma4 : create token_embd before the tied output ( #31394 )
The duplicated output looks up token_embd in its buffer context, so
token_embd must exist first. With the old order a load where input and
output share a buffer type (CPU-only, -ngl 0) held the table twice:
gemma-4-E2B-it Q4_K_M, no mmap, CPU model buffer 3163.73 -> 2947.73 MiB.
Website:
https://llama.app
Attestations:
https://github.com/ggml-org/llama.cpp/attestations/61785118
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 評分41
llama.cpp 發布 b11537,重點是修復 Gemma 4 的 embedding 相關問題、改進輸入 embedding 的建置邏輯。該版本在 graph 中重排了 embeddings 使用的 get_rows,修好 raw embeddings 路徑,在 Gemma 4 的 embedding 路徑中避免 ple cast,併為 LoRA 留下 TODO。
llama.cpp releasesAI 評分36
llama.cpp 發布 b11772 建置,修復 mtmd 中 Gemma 4 的 FFN 啟用(#30882)。該版本同步提供 macOS/iOS、Linux、Android、Windows 和 openEuler 的預編譯包,覆蓋 Apple Silicon、CUDA 12/13、ROCm 10.0、Vulkan、SYCL、OpenVINO 等平台與後端,其中部分條目標註為 DISABLED。
llama.cpp releasesAI 評分45
llama.cpp 建置 b11559 為 Gemma-4 啟用 E4B 的 GPU 解碼,並把該支援擴充套件到 E2B,OpenCL 後端不再只覆蓋部分型號。該版本還允許 Gemma-4 使用 DK512,最佳化 DK64 GQA8 與 DK128 GQA4 解碼,並改進 flash attention。
llama.cpp releasesAI 評分45
llama.cpp b11436 修復 ggml-openvino 後端的 CI 測試失敗與多項 GPU 迴歸。上游 #29622 給輸入 embedding 圖加入混合 token/embd 分支,後端改為只從計算節點建置 OV 模型,並把同型別連續 DUP 按 CONT 翻譯以避免圖被拆分,修復了 CPU 與 GPU 上首個單 token decode 失敗;
llama.cpp releasesAI 評分41
llama.cpp 建置 b11755 修復了 Metal 後端缺少每 token 9 專家 MoE 核心變體的問題(#30610、#30699),涉及 Apple Silicon 上的 MoE 推理路徑。該版本照例發布全平台預編譯包,覆蓋 macOS/iOS、Linux(CUDA 12/13、ROCm 10.0、Vulkan、SYCL、OpenVINO)、Android、Windows 及 openEuler 昇騰等後端。