한국어는 runchr 제공 번역입니다. 원문 README는 English tool page.
PowerInfer
PowerInfer는 활성화 지역성(activation locality)을 활용해 단일 소비자용 GPU에서 대형 모델을 빠르게 서빙하는 CPU/GPU 하이브리드 LLM 추론 엔진입니다.
- Runs
- LLM inference and serving
- Hardware
- Consumer-grade NVIDIA GPUs (CUDA), AMD (ROCm), CPU-GPU hybrid, Windows and Linux
- API
- OpenAI-compatible server
프로젝트 README (번역)
GitHub ↗Written by the project's own authors, not by runchr. Snapshot taken 2026-10-30.
PowerInfer: 소비자용 GPU로 구현하는 빠른 대규모 언어 모델 서빙
TL;DR
PowerInfer는 디바이스의 활성화 지역성(activation locality)을 활용하는 CPU/GPU LLM 추론 엔진입니다.
프로젝트 칸반
최신 소식 🔥
[2026/1/5] 세계 최초의 포켓 사이즈 슈퍼컴퓨터인 Tiiny AI Pocket Lab 을 출시했습니다. 이 제품은 GPT-OSS-120B (int4)를 로컬에서 20 tokens/s 로 실행합니다. CES 2026에서 소개되었습니다.
[2025/7/27] SmallThinker-21BA3B-Instruct 와 SmallThinker-4BA0.6B-Instruct 를 출시했습니다. 또한 효율적인 온디바이스 추론을 위한 대응 프레임워크도 함께 공개했습니다.
[2024/6/11] 스마트폰을 위해 특별히 설계된 고도로 최적화된 추론 프레임워크인 PowerInfer-2 를 소개하게 되어 기쁩니다. TurboSparse-Mixtral-47B와 함께 초당 11.68 토큰이라는 인상적인 속도를 달성하며, 이는 다른 최신 프레임워크보다 최대 22배 빠릅니다.
[2024/6/11] 빠른 추론을 위한 TurboSparse 모델인 Turbo Sparse 를 소개하게 되어 기쁩니다. 단 $0.1M으로 원본 Mistral 및 Mixtral 모델을 거의 90% 희소성으로 희소화하면서도 뛰어난 성능을 유지했습니다! Mixtral급 모델의 경우, TurboSparse-Mixtral은 단 4B 파라미터만 활성화합니다!
[2024/5/20] 대회 모집: CCF-TCArch Customized Computing Challenge 2024 . CCF TCARCH CCC는 중국컴퓨터학회(CCF)의 컴퓨터구조기술위원회(TCARCH)가 주최하는 전국 대회입니다. 올해 대회는 오픈소스 ROCm/HIP를 사용하여 PowerInfer 추론 엔진을 최적화하는 것을 목표로 합니다. 대회에 대한 자세한 정보는 여기 에서 확인할 수 있습니다.
[2024/5/17] 이제 ROCm을 통한 AMD 디바이스 지원을 제공합니다.
[2024/3/28] PowerInfer로 최고 수준의 성능과 비할 데 없는 속도를 모두 달성한 Bamboo LLM 을 소개하게 되어 기쁩니다! Bamboo-7B Base / DPO 로 경험해 보세요.
[2024/3/14] 약 90% 희소성을 가진 ReLU 모델인 ProSparse Llama 2 ( 7B / 13B )를 지원하며, 원본 Llama 2의 성능과 일치합니다 (THUNLP & ModelBest에 감사드립니다)!
[2024/1/11] Windows에서의 GPU 추론을 지원합니다!
[2023/12/24] Falcon(ReLU)-40B-FP16에 대한 온라인 gradio 데모를 공개했습니다!
[2023/12/19] PowerInfer를 공식 출시했습니다!
데모 🔥
powerinfer-live-demo.mp4
단일 RTX 4090(24G)에서 Falcon(ReLU)-40B-FP16을 실행하는 PowerInfer 대 llama.cpp, 11배 속도 향상!
PowerInfer와 llama.cpp 모두 동일한 하드웨어에서 실행되었으며 RTX 4090의 VRAM을 완전히 활용했습니다.
참고
라이브 데모 온라인⚡️
RTX 4090에서 Falcon(ReLU)-40B-FP16을 호스팅하는 Gradio 서버를 사용해 보세요!
실험적이며 보증이 제공되지 않습니다 🚧
초록
우리는 단일 소비자용 GPU를 탑재한 개인용 컴퓨터(PC)에서 구동되는 고속 대규모 언어 모델(LLM) 추론 엔진인 PowerInfer를 소개합니다. PowerInfer 설계의 핵심은 뉴런 활성화의 멱법칙 분포로 특징지어지는 LLM 추론에 내재된 높은 지역성을 활용하는 것입니다.
이 분포는 핫 뉴런(hot neuron)이라 불리는 소수의 뉴런 부분집합이 입력 전반에 걸쳐 일관되게 활성화되는 반면, 다수를 차지하는 콜드 뉴런(cold neuron)은 특정 입력에 따라 달라진다는 것을 보여줍니다.
PowerInfer는 이러한 통찰을 활용하여 GPU-CPU 하이브리드 추론 엔진을 설계합니다:
핫 활성화 뉴런은 빠른 접근을 위해 GPU에 미리 로드되고, 콜드 활성화 뉴런은 CPU에서 계산되어 GPU 메모리 수요와 CPU-GPU 데이터 전송을 크게 줄입니다.
PowerInfer는 또한 적응형 예측기와 뉴런 인식 희소 연산자를 통합하여 뉴런 활성화와 계산 희소성의 효율성을 최적화합니다.
평가 결과, PowerInfer는 단일 NVIDIA RTX 4090 GPU에서 다양한 LLM(OPT-175B 포함)에 걸쳐 평균 13.20 tokens/s, 최대 29.08 tokens/s의 토큰 생성 속도를 달성하며, 이는 최상위 서버급 A100 GPU가 달성한 것보다 단 18% 낮은 수준입니다.
이는 모델 정확도를 유지하면서 llama.cpp를 최대 11.69배 능가합니다.
기능
PowerInfer는 LLM을 로컬에 배포하기 위한 고속이며 사용하기 쉬운 추론 엔진입니다.
PowerInfer는 다음과 같은 점에서 빠릅니다:
지역성 중심 설계 : 희소 활성화와 '핫'/'콜드' 뉴런 개념을 활용하여 효율적인 LLM 추론을 구현하며, 더 낮은 리소스 요구로 높은 속도를 보장합니다.
CPU/GPU 하이브리드 활용 : CPU와 GPU의 메모리/연산 능력을 원활하게 통합하여 균형 잡힌 워크로드와 더 빠른 처리를 실현합니다.
PowerInfer는 다음과 같은 점에서 유연하고 사용하기 쉽습니다:
간편한 통합 : 인기 있는 ReLU 희소 모델 과 호환됩니다.
간편한 로컬 배포 : 소비자용 하드웨어에서의 로컬 배포를 위해 설계되고 깊이 최적화되어, 단일 GPU에서 저지연 LLM 추론 및 서빙을 가능하게 합니다.
하위 호환성 : llama.cpp와는 다르지만, server 및 batched generation과 같은 대부분의 examples/ 를 llama.cpp와 동일한 방식으로 활용할 수 있습니다. PowerInfer는 호환성을 위해 llama.cpp의 모델 가중치로도 추론을 지원하지만, 성능 향상은 없습니다.
다음 모델들을 지금 PowerInfer와 함께 사용할 수 있습니다:
Falcon-40B
Llama2 계열
ProSparse Llama2 계열
Bamboo-7B
다음 플랫폼에서 PowerInfer를 테스트했습니다:
AVX2 명령어를 지원하는 x86-64 CPU, NVIDIA GPU 유무와 관계없이, Linux 환경.
AVX2 명령어를 지원하는 x86-64 CPU, NVIDIA GPU 유무와 관계없이, Windows 환경.
macOS의 Apple M 칩 (CPU 전용). (Mac에 대해서는 최적화하지 않으므로 현재 성능 향상은 크지 않습니다.)
곧 제공될 새로운 기능:
macOS에서의 희소 추론을 위한 Metal 백엔드
현재 개발 중점 사항은 프로젝트 칸반 을 참고해 주세요.
시작하기
설치
모델 가중치
추론
설정 및 설치
사전 요구 사항
PowerInfer는 다음 종속성이 필요합니다:
CMake (3.17+)
Python (3.8+) 및 pip (19.3+), 모델 가중치 변환 및 자동 FFN 오프로딩용
코드 받기
git clone https://github.com/Tiiny-AI/PowerInfer
cd PowerInfer
pip install -r requirements.txt # install Python helpers' dependencies
빌드
PowerInfer를 빌드하려면 두 가지 옵션이 있습니다. 이 명령들은 프로젝트의 루트 디렉터리에서 실행해야 합니다.
CMake (3.17+) 사용:
NVIDIA GPU가 있는 경우:
cmake -S . -B build -DLLAMA_CUBLAS=ON
cmake --build build --config Release
AMD GPU가 있는 경우:
# Replace '1100' to your card architecture name, you can get it by rocminfo
CC=/opt/rocm/llvm/bin/clang CXX=/opt/rocm/llvm/bin/clang++ cmake -S . -B build -DLLAMA_HIPBLAS=ON -DAMDGPU_TARGETS=gfx1100
cmake --build build --config Release
CPU만 있는 경우:
cmake -S . -B build
cmake --build build --config Release
모델 가중치
PowerInfer 모델은 GGUF 형식을 기반으로 하는 PowerInfer GGUF라는 특수 형식으로 저장되며, LLM 가중치와 예측기 가중치를 모두 포함합니다.
Hugging Face를 통해 PowerInfer GGUF 다운로드
아래 각 Hugging Face 저장소에서 *.powerinfer.gguf 가중치와 '핫' 뉴런 오프로딩을 위한 프로파일링된 모델 활성화 통계를 얻을 수 있습니다.
기본 모델
PowerInfer GGUF
LLaMA(ReLU)-2-7B
PowerInfer/ReluLLaMA-7B-PowerInfer-GGUF
LLaMA(ReLU)-2-13B
PowerInfer/ReluLLaMA-13B-PowerInfer-GGUF
Falcon(ReLU)-40B
PowerInfer/ReluFalcon-40B-PowerInfer-GGUF
LLaMA(ReLU)-2-70B
PowerInfer/ReluLLaMA-70B-PowerInfer-GGUF
ProSparse-LLaMA-2-7B
PowerInfer/ProSparse-LLaMA-2-7B-GGUF
ProSparse-LLaMA-2-13B
PowerInfer/ProSparse-LLaMA-2-13B-GGUF
Bamboo-base-7B 🌟
PowerInfer/Bamboo-base-v0.1-gguf
Bamboo-DPO-7B 🌟
PowerInfer/Bamboo-DPO-v0.1-gguf
전체 모델 저장소를 다운로드하려면 huggingface-cli 사용을 권장합니다. 예를 들어, 다음 명령은 PowerInfer/ReluLLaMA-7B-PowerInfer-GGUF를 ./ReluLLaMA-7B 디렉터리에 다운로드합니다.
huggingface-cli download --resume-download --local-dir ReluLLaMA-7B --local-dir-use-symlinks False PowerInfer/ReluLLaMA-7B-PowerInfer-GGUF
이렇게 하면 PowerInfer는 기능이 완전한 모델 오프로딩을 위해 다음 디렉터리 구조를 자동으로 활용할 수 있습니다:
.
├── *.powerinfer.gguf (Unquantized PowerInfer model)
├── *.q4.powerinfer.gguf (INT4 quantized PowerInfer model, if available)
├── activation (Profiled activation statistics for fine-grained FFN offloading)
│ ├── activation_x.pt (Profiled activation statistics for layer x)
│ └── ...
├── *.[q4].powerinfer.gguf.generated.gpuidx (Generated GPU index at runtime for corresponding model)
원본 모델 가중치 + 예측기 가중치에서 변환
Hugging Face는 단일 모델 가중치를 50GiB로 제한합니다. 40B 이상의 비양자화 모델의 경우, Hugging Face에서 얻은 원본 모델 가중치와 예측기 가중치로부터 PowerInfer GGUF를 변환할 수 있습니다.
기본 모델
원본 모델
예측기
LLaMA(ReLU)-2-7B
SparseLLM/ReluLLaMA-7B
PowerInfer/ReluLLaMA-7B-Predictor
LLaMA(ReLU)-2-13B
SparseLLM/ReluLLaMA-13B
PowerInfer/ReluLLaMA-13B-Predictor
Falcon(ReLU)-40B
SparseLLM/ReluFalcon-40B
PowerInfer/ReluFalcon-40B-Predictor
LLaMA(ReLU)-2-70B
SparseLLM/ReluLLaMA-70B
PowerInfer/ReluLLaMA-70B-Predictor
ProSparse-LLaMA-2-7B
SparseLLM/ProSparse-LLaMA-2-7B
PowerInfer/ProSparse-LLaMA-2-7B-Predictor
ProSparse-LLaMA-2-13B
SparseLLM/ProSparse-LLaMA-2-13B
PowerInfer/ProSparse-LLaMA-2-13B-Predictor
Bamboo-base-7B 🌟
PowerInfer/Bamboo-base-v0.1
PowerInfer/Bamboo-base-v0.1-predictor
Bamboo-DPO-7B 🌟
PowerInfer/Bamboo-DPO-v0.1
PowerInfer/Bamboo-DPO-v0.1-predictor
다음 명령을 사용하여 원본 모델 가중치와 예측기 가중치를 PowerInfer GGUF로 변환할 수 있습니다:
# make sure that you have done `pip install -r requirements.txt`
python convert.py --outfile /PATH/TO/POWERINFER/GGUF/REPO/MODELNAME.powerinfer.gguf /PATH/TO/ORIGINAL/MODEL /PATH/TO/PREDICTOR
# python convert.py --outfile ./ReluLLaMA-70B-PowerInfer-GGUF/llama-70b-relu.powerinfer.gguf ./SparseLLM/ReluLLaMA-70B ./PowerInfer/ReluLLaMA-70B-Predictor
같은 이유로, 변환 후에도 PowerInfer GGUF 저장소와 동일한 디렉터리 구조를 유지할 것을 권장합니다.
원본 모델을 dense GGUF 모델로 변환(llama.cpp와 호환)
python convert-dense.py --outfile /PATH/TO/DENSE/GGUF/REPO/MODELNAME.gguf /PATH/TO/ORIGINAL/MODEL
# python convert-dense.py --outfile ./Bamboo-DPO-v0.1-gguf/bamboo-7b-dpo-v0.1.gguf --outtype f16 ./Bamboo-DPO-v0.1
생성된 dense GGUF 모델은 활성화 함수(ReluLLaMA 및 Prosparse 모델의 경우) 또는 모델 아키텍처(Bamboo 모델의 경우)를 변경했기 때문에 llama.cpp에서 제대로 작동하지 않을 수 있습니다. convert-dense.py로 생성된 dense GGUF 모델은 PowerInfer의 dense 추론 모드에서 사용할 수 있지만, llama.cpp에서는 제대로 작동하지 않을 수 있습니다.
추론
사용 가능한 모든 VRAM을 활용한 CPU 전용 및 CPU-GPU 하이브리드 추론의 경우, 다음 지침을 사용하여 PowerInfer를 실행할 수 있습니다:
./build/bin/main -m /PATH/TO/MODEL -n $output_token_count -t $thread_num -p $prompt
# e.g.: ./build/bin/main -m ./ReluFalcon-40B-PowerInfer-GGUF/falcon-40b-relu.q4.powerinfer.gguf -n 128 -t 8 -p "Once upon a time"
# For Windows: .\build\bin\Release\main.exe -m .\ReluFalcon-40B-PowerInfer-GGUF\falcon-40b-relu.q4.powerinfer.gguf -n 128 -t 8 -p "Once upon a time"
GPU의 VRAM 사용량을 제한하려는 경우:
./build/bin/main -m /PATH/TO/MODEL -n $output_token_count -t $thread_num -p $prompt --vram-budget $vram_gb
# e.g.: ./build/bin/main -m ./ReluLLaMA-7B-PowerInfer-GGUF/llama-7b-relu.powerinfer.gguf -n 128 -t 8 -p "Once upon a time" --vram-budget 8
# For Windows: .\build\bin\Release\main.exe -m .\ReluLLaMA-7B-PowerInfer-GGUF\llama-7b-relu.powerinfer.gguf -n 128 -t 8 -p "Once upon a time" --vram-budget 8
CPU-GPU 하이브리드 추론에서 PowerInfer는 모든 dense 활성화 블록을 자동으로 GPU로 오프로딩한 다음, FFN을 분할하여 가능하면 GPU로 오프로딩합니다.
Dense 추론 모드 (제한적 지원)
PowerInfer 모델 계열의 dense 변형으로 추론하기 위해 PowerInfer를 실행하려는 경우, llama.cpp와 유사하게 사용할 수 있습니다:
./build/bin/main -m /PATH/TO/DENSE/MODEL -n $output_token_count -t $thread_num -p $prompt -ngl $num_gpu_layers
# e.g.: ./build/bin/main -m ./Bamboo-base-v0.1-gguf/bamboo-7b-v0.1.gguf -n 128 -t 8 -p "Once upon a time" -ngl 12
server 및 batched_generation 과 같은 다른 examples/ 의 경우도 마찬가지입니다. dense 추론 모드는 "co…
No comments yet.
to comment.