Giter Club home page Giter Club logo

ggml-learning-notes's Introduction

GGML

ggml is a tensor library for machine learning to enable large models and high performance on commodity hardware. It is used by llama.cpp and whisper.cpp

ggml是用c语言实现的一套张量操作库, 官网在这里。当前有以下优点

  • 纯c实现
  • 支持16bit浮点数
  • 支持整数量化 (比如4-bit, 5-bit, 8-bit)
  • 可以自动微分
  • 内置优化算法 (例如 ADAM, L-BFGS)
  • 苹果m系列芯片优化
  • x86平台 AVX / AVX2 指令集优化
  • 通过WebAssembly和 WASM SIMD技术可以跑在浏览器中
  • 没有第三方库依赖
  • 运行时不在新分配内存

现支持的后端有

  • CPU
  • CUDA
  • Metal
  • OpenCL
  • Vulkan
  • SYCL
  • Kompute

深度学习的推理框架有很多,现在主流的推理框架包括:TensorRTONNXRuntimeOpenVINOncnnMNN 等。在知乎上也有关于深度学习推理框架的讨论如何选择深度学习推理框架

框架 算子数 平台
onnxruntime 164个算子 多平台
ncnn 约197个算子 多平台,主打移动端
mnn 支持 178 个Tensorflow Op、52个 Caffe Op、163个 Torchscipts Op、158 个 ONNX Op 多平台
TensorRT 大部分onnx算子,可直接加载onnx格式 N卡
OpenVINO 180个算子,可直接加载onnx格式 intel的cpu
ggml 73个算子 多平台

国内也有着好几个非常优秀的推理框架,例如腾讯的ncnn起步早且社区活跃,支持平台广泛,主打移动端部署,还有阿里的mnn,都非常优秀。

本着调研与学习的目的,这里选择了最简单的ggml作为入门学习框架, ggml也是作为了whisper.cpp和llama.cpp的后端推理框架。 目前为止,当前该库仍在开发中,几个月不见又增加很多新的工作,废弃了一些接口。 并且ggml的官方文档还是一个TODO状态, 本项目的出新在于学习当前一些主流的推理框架,为后续深度学习模型落地做准备。

ggml学习笔记(一)项目编译.md

ggml学习笔记(二)ggml.h源码解读.md

ggml学习笔记(三)gguf文件格式.md

ggml-learning-notes's People

Contributors

lovemefan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

sumagic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.