MCPcopy Create free account
hub / github.com/OpenPPL/ppl.nn

github.com/OpenPPL/ppl.nn @v0.10.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.10.0 ↗ · + Follow
8,307 symbols 18,837 edges 2,373 files 246 documented · 3% updated 19mo ago★ 1,36715 open issues

Browse by type

Functions 6,859 Types & classes 1,448
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

PPLNN

website License qq zhihu

Overview

PPLNN, which is short for "PPLNN is a Primitive Library for Neural Network", is a high-performance deep-learning inference engine for efficient AI inferencing. It can run various ONNX models and has better support for OpenMMLab.

alt arch

Important Notice

  • PMX has changed to OPMX at 25/04/2024.
  • ChatGLM1 will not be supported in OPMX.
  • All LLM must be converted(or just rename pmx_params.json to opmx_params.json) and exported again.
  • You can find the old code at llm_v1

Known Issues

  • NCCL issue on some Device: Currently reported that L40S and H800 may encounter illegal memory access on NCCL AllReduce. We suggest trying to turn NCCL protocol Simple off by setting environment NCCL_PROTO=^Simple to fix this issue.

LLM Features

  • New LLM Engine(Overview)
  • Flash Attention
  • Split-k Attention(Similar with Flash Decoding)
  • Group-query Attention
  • Dynamic Batching(Also called Continous Batching or In-flight Batching)
  • Tensor Parallelism
  • Graph Optimization
  • INT8 groupwise KV Cache(Numerical accuracy is very close to FP16🚀)
  • INT8 per token per channel Quantization(W8A8)

LLM Model Zoo

Hello, world!

  • Installing prerequisites:

    • On Debian or Ubuntu:

    bash apt-get install build-essential cmake git python3 python3-dev

    • On RedHat or CentOS:

    bash yum install gcc gcc-c++ cmake3 make git python3 python3-devel

  • Cloning source code:

git clone https://github.com/openppl-public/ppl.nn.git
  • Building from source:
cd ppl.nn
./build.sh -DPPLNN_USE_X86_64=ON -DPPLNN_ENABLE_PYTHON_API=ON
  • Running python demo:
PYTHONPATH=./pplnn-build/install/lib python3 ./tools/pplnn.py --use-x86 --onnx-model tests/testdata/conv.onnx

Refer to Documents for more details.

Documents

Contact Us

Questions, reports, and suggestions are welcome through GitHub Issues!

WeChat Official Account QQ Group
OpenPPL 627853444
OpenPPL QQGroup

Contributions

This project uses Contributor Covenant as code of conduct. Any contributions would be highly appreciated.

Acknowledgements

License

This project is distributed under the Apache License, Version 2.0.

Core symbols most depended-on inside this repo

Shape

Method 5,471
Class 1,403
Function 1,388
Enum 45

Languages

C++100%
Python1%

Modules by API surface

src/ppl/nn/models/onnx/generated/onnx.pb.h482 symbols
src/ppl/nn/models/pmx/generated/onnx_op_generated.h442 symbols
src/ppl/nn/models/onnx/generated/onnx.pb.cc432 symbols
src/ppl/nn/engines/llm_cuda/pmx/generated/llm_cuda_op_params_generated.h258 symbols
src/ppl/nn/engines/arm/pmx/generated/arm_op_params_generated.h175 symbols
src/ppl/nn/models/pmx/generated/pmx_generated.h151 symbols
src/ppl/nn/engines/cuda/pmx/generated/cuda_op_params_generated.h116 symbols
src/ppl/nn/models/pmx/generated/pmx_op_generated.h55 symbols
src/ppl/nn/engines/cuda/pmx/generated/cuda_engine_generated.h52 symbols
tests/engines/tmp_engine.h44 symbols
src/ppl/nn/models/pmx/generated/op_param_generated.h44 symbols
src/ppl/nn/engines/llm_cuda/pmx/generated/llm_cuda_engine_generated.h35 symbols

For agents

$ claude mcp add ppl.nn \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page