为 MTP draft 启用 CUDA 图 · gaugarg-nv · PR #28549 · ggml-org/llama.cpp

Reddit r/LocalLLaMA 工具

摘要

此拉取请求在 llama.cpp 中为 MTP draft 启用 CUDA 图,以提升 GPU 上 LLM 推理的性能。

暂无内容
查看原文
查看缓存全文

缓存时间: 2026/09/16 19:36

ggml-org/llama.cpp

来源:https://github.com/ggml-org/llama.cpp

llama.cpp

C/C++ 语言实现的 LLM 推理引擎
许可证:MIT (https://opensource.org/licenses/MIT)
稳定版发布 (https://github.com/ggml-org/llama.cpp/releases?q=tag:v0)
每夜构建版 (https://github.com/ggml-org/llama.cpp/releases?q=b)
服务器版 (https://github.com/ggml-org/llama.cpp/actions/workflows/server.yml)
Docker 镜像 (https://github.com/ggml-org/llama.cpp/actions/workflows/docker.yml)
Winget 包 (https://github.com/ggml-org/llama.cpp/actions/workflows/winget.yml)
ggml 基础库 (https://github.com/ggml-org/ggml)
/ 算子文档 (https://github.com/ggml-org/llama.cpp/blob/master/docs/ops.md)
/ 维护者公开的 PR (https://github.com/ggml-org/llama.cpp/issues?q=is%3Apr%20is%3Aopen%20draft%3AFalse%20(author%3Argerganov%20OR%20author%3AKitaitiMakoto%20OR%20author%3Adanbev%20OR%20author%3Aaldehir%20OR%20author%3Amax-krasnyansky%20OR%20author%3ACISC%20OR%20author%3Aggerganov%20OR%20author%3Aam17an%20OR%20author%3Ajhen0409%20OR%20author%3Abartowski1182%20OR%20author%3Anikwen%20OR%20author%3Ahipudding%20OR%20author%3Aravi9%20OR%20author%3AServeurpersoCom%20OR%20author%3Apwilkin%20OR%20author%3Areeselevine%20OR%20author%3Angxson%20OR%20author%3Ajeffbolznv%20OR%20author%3Amarty1885%20OR%20author%3A0cc4m%20OR%20author%3ATitaniumtown%20OR%20author%3Aangt%20OR%20author%3AIMbackK%20OR%20author%3Aarthw%20OR%20author%3AJohannesGaessler%20OR%20author%3AORippler%20OR%20author%3Aruixiang63%20OR%20author%3Axctan%20OR%20author%3Aallozaur%20OR%20author%3Ayomaytk%20OR%20author%3Aaendk%20OR%20author%3Awine99%20OR%20author%3Agaugarg-nv%20OR%20author%3Ataronaeo%20OR%20author%3Aforforever73%20OR%20author%3Alhez%20OR%20author%3Anetrunnereve%20OR%20author%3Afairydreaming)%20sort%3Aupdated-desc)
/ 开发统计 (https://github.com/ggml-org/llama.cpp-dev)
/ lib llama API (https://github.com/ggml-org/llama.cpp/issues/9289)
/ llama-server REST API (https://github.com/ggml-org/llama.cpp/issues/9291)

快速入门

以下是将 llama.cpp 安装到您机器上的几种方法:

  • 访问 https://llama.app 并按照指示操作
  • 使用 Docker 运行 - 请参阅我们的 Docker 文档
  • 从发布页面 (https://github.com/ggml-org/llama.cpp/releases) 下载预编译二进制文件
  • 克隆此仓库从源码构建 - 请查阅我们的构建指南

安装完成后:

# 直接从 Hugging Face 下载并运行模型  
llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF  
# 启动兼容 OpenAI 的 API 服务器  
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF  

使用 llama cli 进行视觉语言模型交互
针对 llama serve 构建的内置 Web UI

描述

llama.cpp 的主要目标是在各种硬件上——本地及云端——以最少的设置和最先进的性能实现 LLM(以及 VLM)推理。

  • 纯 C/C++ 实现,无任何外部依赖
  • Apple 芯片作为一等公民支持 - 通过 ARM NEON、Accelerate 和 Metal 框架进行优化
  • 为 x86 架构提供 AVX、AVX2、AVX512 和 AMX 支持
  • 为 RISC-V 架构提供 RVV、ZVFH、ZFH、ZICBOP 和 ZIHINTPAUSE 支持
  • 支持 1.5 位、2 位、3 位、4 位、5 位、6 位和 8 位整数量化,以实现更快的推理和更少的内存使用
  • 为在 NVIDIA GPU 上运行 LLM 定制的 CUDA 内核(通过 HIP 支持 AMD GPU,通过 MUSA 支持 Moore Threads GPU)
  • 提供 Vulkan 和 SYCL 后端支持
  • CPU+GPU 混合推理,可部分加速超过总显存容量的模型

llama.cpp 项目构建在 ggml (https://github.com/ggml-org/ggml) 库之上。

支持的后端

后端目标设备
BLAS所有设备
BLIS所有设备
CANNAscend NPU
CUDANvidia GPU
HIPAMD GPU
HexagonSnapdragon
IBM zDNNIBM Z & LinuxONE
MUSAMoore Threads GPU
MetalApple Silicon
OpenCLAdreno GPU
OpenVINO [进行中]Intel CPU、GPU 和 NPU
RPC (https://github.com/ggml-org/llama.cpp/tree/master/tools/rpc)所有设备
SYCLIntel GPU
VirtGPUVirtGPU APIR
VulkanGPU
WebGPU所有设备
ZenDNNAMD CPU

文档

工具

开发

贡献

  • 贡献者可以提交 PR
  • 根据贡献情况,将邀请合作者加入
  • 维护者可以向 llama.cpp 仓库的分支推送代码并将 PR 合并到 master 分支
  • 任何帮助管理 issues、PRs 和项目的支持都非常感谢!
  • 请阅读 CONTRIBUTING.md 获取更多信息

致谢

  • yhirose/cpp-httplib (https://github.com/yhirose/cpp-httplib)
    • 单头文件 HTTP 服务器,llama-server 使用
    • MIT 许可证
  • nothings/stb (https://github.com/nothings/stb)
    • 单头文件图像格式解码器,多模态子系统使用
    • 公共领域
  • nlohmann/json (https://github.com/nlohmann/json)
    • 单头文件 JSON 库,各种工具/示例使用
    • MIT 许可证
  • mackron/miniaudio (https://github.com/mackron/miniaudio)
    • 单头文件音频格式解码器,多模态子系统使用
    • 公共领域
  • sheredom/subprocess.h (https://github.com/sheredom/subprocess.h)
    • 面向 C 和 C++ 的单头文件进程启动方案
    • 公共领域

相似文章

llama.cpp 自适应 MTP PR#27210

Reddit r/LocalLLaMA

一个用于自适应 MTP 的拉取请求 (PR#27210) 已提交到 llama.cpp,该实现是用于LLM推理的C/C++代码,设置简单且性能高效。