Files
2026-07-13 10:43:54 +00:00

1.6 KiB
Raw Permalink Blame History

Note

本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
English · 原始项目 · 上游 README
原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。

ggml

Manifesto

面向机器学习的张量库

请注意,本项目正在积极开发中。
部分开发工作目前在 llama.cppwhisper.cpp 仓库中进行

特性

  • 低层级跨平台实现
  • 整数量化支持
  • 广泛的硬件支持
  • 自动微分(Automatic differentiation
  • ADAM 和 L-BFGS 优化器
  • 无第三方依赖
  • 运行时零内存分配

构建

git clone https://github.com/ggml-org/ggml
cd ggml

# install python dependencies in a virtual environment
python3.10 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# build the examples
mkdir build && cd build
cmake ..
cmake --build . --config Release -j 8

GPT 推理(示例)

# run the GPT-2 small 117M model
../examples/gpt-2/download-ggml-model.sh 117M
./bin/gpt-2-backend -m models/gpt-2-117M/ggml-model.bin -p "This is an example"

更多信息请参阅 examples 文件夹中的相应示例程序。

资源