You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add TLDR and hw support
* enrich features section
* update model weights
* minor on README commands
* minor on features
* Update README.md
---------
Co-authored-by: Holden <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+38-32Lines changed: 38 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# PowerInfer: Fast Large Language Model Serving with a Consumer-grade GPU
2
-
---
2
+
3
+
## TL;DR
4
+
PowerInfer is a CPU/GPU LLM inference engine leveraging **activation locality** for your device.
3
5
4
6
## Demo 🔥
5
7
@@ -9,49 +11,50 @@ PowerInfer v.s. llama.cpp on a single RTX 4090(24G) running Falcon(ReLU)-40B-FP1
9
11
10
12
<sub>Both PowerInfer and llama.cpp were running on the same hardware and fully utilized VRAM on RTX 4090.</sub>
11
13
12
-
---
13
14
## Abstract
14
15
15
16
We introduce PowerInfer, a high-speed Large Language Model (LLM) inference engine on a personal computer (PC)
16
-
equipped with a single consumer-grade GPU. The key underlying the design of PowerInfer is exploiting the high locality
17
+
equipped with a single consumer-grade GPU. The key underlying the design of PowerInfer is exploiting the high **locality**
17
18
inherent in LLM inference, characterized by a power-law distribution in neuron activation.
19
+
18
20
This distribution indicates that a small subset of neurons, termed hot neurons, are consistently activated
19
21
across inputs, while the majority, cold neurons, vary based on specific inputs.
20
22
PowerInfer exploits such an insight to design a GPU-CPU hybrid inference engine:
21
23
hot-activated neurons are preloaded onto the GPU for fast access, while cold-activated neurons are computed
22
24
on the CPU, thus significantly reducing GPU memory demands and CPU-GPU data transfers.
23
25
PowerInfer further integrates adaptive predictors and neuron-aware sparse operators,
24
26
optimizing the efficiency of neuron activation and computational sparsity.
27
+
25
28
Evaluation shows that PowerInfer attains an average token generation rate of 13.20 tokens/s, with a peak of 29.08 tokens/s, across various LLMs (including OPT-175B) on a single NVIDIA RTX 4090 GPU,
26
29
only 18\% lower than that achieved by a top-tier server-grade A100 GPU.
27
30
This significantly outperforms llama.cpp by up to 11.69x while retaining model accuracy.
28
31
29
-
## Feature
30
-
PowerInfer is a high-speed and easy-to-use inference engine for deploying LLM locally. Interestingly, we observe that in ReLU LLM, every neuron is an expert! And a small subset of neurons consistently contributes to the output.
32
+
## Features
33
+
PowerInfer is a high-speed and easy-to-use inference engine for deploying LLMs locally.
34
+
31
35
PowerInfer is fast with:
32
36
33
-
- Exploiting the high locality in LLM inference
34
-
- Neuron-aware hybrid CPU/GPU sparse operator
35
-
- Neuron granularity offloading
37
+
-**Locality-centric design**: Utilizes sparse activation and 'hot'/'cold' neuron concept for efficient LLM inference, ensuring high speed with lower resource demands.
38
+
-**Hybrid CPU/GPU Utilization**: Seamlessly integrates memory/computation capabilities of CPU and GPU for balanced workload and faster processing.
36
39
37
40
PowerInfer is flexible and easy to use with:
38
41
39
-
- Integration with popular [ReLU-sparse models](https://huggingface.co/SparseLLM)
40
-
- Low-latency serving locally with one single consumer-grade GPU
42
+
-**Easy Integration**: Compatible with popular [ReLU-sparse models](https://huggingface.co/SparseLLM) as accurate as their dense counterparts.
43
+
-**Local Deployment Ease**: Designed and deeply optimized for local deployment on consumer-grade hardwares, enabling low-latency LLM inference and serving on a single GPU.
44
+
-**Backward Compatibility**: While distinct from llama.cpp, you can make use of most of `examples/` the same way as llama.cpp such as server and batched generation. PowerInfer also supports inference with llama.cpp's model weights for compatibility purpose, but there will be no performance gain.
41
45
42
-
PowerInfer supports the following models:
46
+
You can use these models with PowerInfer today:
43
47
44
-
- Falcon-40B model
45
-
-Llama family models
48
+
- Falcon-40B
49
+
-Llama2 family
46
50
47
-
Now PowerInfer supports the following architectures:
51
+
We have tested PowerInfer on the following platforms:
48
52
49
-
- Intel CPU with AVX2 instructions
50
-
- Nvidia GPU
53
+
- x86-64 CPU (with AVX2 instructions) on Linux
54
+
- x86-64 CPU and NVIDIA GPU on Linux
55
+
- Apple M Chips on macOS (As we do not optimize for Mac, the performance improvement is not significant now.)
51
56
52
57
53
-
54
-
55
58
## Getting Started
56
59
57
60
-[Installation](##setup--installation)
@@ -67,7 +70,7 @@ cd PowerInfer
67
70
### Build
68
71
In order to build PowerInfer you have two different options. These commands are supposed to be run from the root directory of the project.
PowerInfer models are stored in a special format called *PowerInfer GGUF* based on GGUF format, consisting of both LLM weights and predictor weights. You can download PowerInfer GGUF weights from Hugging Face or convert them from the original model weights and predictor weights.
93
+
94
+
| Base Model | PowerInfer GGUF Format | Original Model | Predictor |
As for now, it requires an offline-generated "GPU index" file to split FFNs on GPU. If you want to try it, please use the following instructions to generate the GPU index file:
0 commit comments