ggml-cuda: hip: 添加缺失的 AMD GCN MMQ 配置 by thelittlefireman · Pull Request #27841 · ggml-org/llama.cpp - RDNA2(MI50, MI60) 的预填充性能改进
摘要
此拉取请求为 ggml-cuda 的 HIP 添加缺失的 AMD GCN MMQ 配置,增强了 llama.cpp 推理库中 RDNA2 GPU(如 MI50 和 MI60)的预填充性能。
查看缓存全文
缓存时间: 2026/09/12 10:42
ggml-org/llama.cpp
来源:https://github.com/ggml-org/llama.cpp
llama.cpp
使用 C/C++ 实现的 llama 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) / ops (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 进行 VLM 会话
针对 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 | 所有 |
| CANN | 华为昇腾 NPU |
| CUDA | NVIDIA GPU |
| HIP | AMD GPU |
| Hexagon | Snapdragon |
| IBM zDNN | IBM Z & LinuxONE |
| MUSA | Moore Threads GPU |
| Metal | Apple 芯片 |
| OpenCL | Adreno GPU |
| OpenVINO [进行中] | Intel CPU、GPU 和 NPU |
| RPC (https://github.com/ggml-org/llama.cpp/tree/master/tools/rpc) | 所有 |
| SYCL | Intel GPU |
| VirtGPU | VirtGPU APIR |
| Vulkan | GPU |
| WebGPU | 所有 |
| ZenDNN | AMD CPU |
文档
工具
开发
- 如何构建
- 在 Docker 上运行
- 在 Android 上构建
- 多 GPU 使用
- 性能故障排除
- GGML 技巧与窍门 (https://github.com/ggml-org/llama.cpp/wiki/GGML-Tips-&-Tricks)
- XCFramework
- 补全
- 模型
- 发布流程
贡献
- 贡献者可以提交 PR
- 根据贡献情况,协作者将被邀请加入
- 维护者可以向
llama.cpp仓库的分支推送代码并将 PR 合并到master分支 - 任何在管理问题、PR 和项目方面的帮助都将受到高度赞赏!
- 请阅读 CONTRIBUTING.md 了解更多信息
致谢
- yhirose/cpp-httplib (https://github.com/yhirose/cpp-httplib)
- 单文件 HTTP 服务器,被
llama-server使用 - MIT 许可证
- 单文件 HTTP 服务器,被
- 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++ 的单文件进程启动解决方案
- 公共领域
相似文章
GLM 和我创建了一个针对 AMD GFX906(Mi50、Mi60、Radeon VII、GCN HIP)优化的 llama.cpp 分支 - 机器学习、大语言模型和 AI
已创建一个 llama.cpp 的分支,并针对 AMD GFX906 GPU 进行了优化,提升了 Mi50、Mi60、Radeon VII 和 GCN HIP 上的性能,适用于机器学习和大语言模型应用。
CUDA/HIP:Flash Attention 调优(gfx1201)由 pwilkin · 拉取请求 #28102 · ggml-org/llama.cpp
此拉取请求为 llama.cpp 项目中的 CUDA/HIP 引入了 Flash Attention 调优优化,针对 gfx1201 硬件以提升推理性能。
CUDA:将共享专家融合进 MMVQ —— am17an · Pull Request #29184 · ggml-org/llama.cpp
am17an 提交的 llama.cpp 拉取请求(#29184)将共享专家(shared experts)融合进 MMVQ(矩阵矩阵向量量化)CUDA 核心中,优化了 GPU 上混合专家(mixture-of-experts)模型的推理性能。
ggml-cpu:pl752 提交的 x86 与通用 CPU q1_0 点积优化(后续)· Pull Request #21636 · ggml-org/llama.cpp
该 PR 为 ggml-cpu 加入针对 x86 及通用 CPU 优化的 q1_0 点积内核,提升量化 LLM 推理速度。
ggml-webgpu: 提升k-quants的预填充速度并重构Q4/Q5/Q8及k-quants的矩阵乘法 by yomaytk · Pull Request #24225 · ggml-org/llama.cpp
提升了k-quants的预填充速度,并重构了llama.cpp WebGPU后端中Q4/Q5/Q8及k-quants的矩阵乘法。