⚡ BitNet: 微软 1-bit LLM 推理框架
LLM
1-bit
微软
推理优化
摘要: 官方推理框架,支持 1-bit (BitNet b1.58) 模型在 CPU 和 GPU 上高效运行,实现突破性的性能提升
🚀 核心性能优势
6.17x
x86 CPU 加速
82.2%
能耗降低
100B
单 CPU 可运行
📊 性能数据
| 平台 | 加速比 | 能耗降低 |
|---|---|---|
| ARM CPU | 1.37x - 5.07x | 55.4% - 70.0% |
| x86 CPU | 2.37x - 6.17x | 71.9% - 82.2% |
💡 突破性成就
- 100B 模型运行: 可以在单个 CPU 上运行 100B 参数模型
- 人类阅读速度: 达到 5-7 tokens/秒
- 本地设备可能: 让大模型在普通设备上运行成为现实
- 最新优化: 并行内核实现额外 1.15x-2.1x 加速
🤖 支持的模型
| 模型 | 参数量 | 平台 |
|---|---|---|
| BitNet-b1.58-2B-4T | 2.4B | x86, ARM |
| bitnet_b1.58-3B | 3.3B | x86, ARM |
| Llama3-8B-1.58-100B-tokens | 8.0B | x86, ARM |
| Falcon3 Family | 1B-10B | x86, ARM |
🔧 使用方法
# 安装依赖
pip install -r requirements.txt
# 下载模型
huggingface-cli download microsoft/BitNet-b1.58-2B-4T-gguf --local-dir models/BitNet-b1.58-2B-4T
# 量化模型
python setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s
# 运行推理
python run_inference.py -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf -p "You are a helpful assistant" -cnv
🔬 技术背景
- 基于: llama.cpp 框架
- 源自: 微软研究院 T-MAC 项目
- 论文: The Era of 1-bit LLMs、 Fast and Lossless BitNet b1.58 Inference on CPUs