项目预览
项目数据
项目介绍
Star 增长趋势
本站每日记录该项目 GitHub 星标变化,观测越久曲线越完整
数据来源:GitHub API 逐日快照 · 收录于 2026-10-17 · 当前星标 ★ 567
使用教程
ℹ 本教程由 AI 依据该项目 README 整理,个别步骤可能需要按你的环境微调。
环境要求
- NVIDIA 显卡
- conda 环境
- 校准数据
安装与启动步骤
-
1递归克隆
面向推理加速的量化方法,子模块必带。
git clone --recursive https://github.com/FutureMLS-Lab/OSCAR.git -
2建环境
指定 Python 版本。
conda create -n oscar python=3.12 -y -
3装推理框架
用它的研究分支,别装官方版。
pip install -e sglang-research/python -
4采集统计量
先跑校准集拿到激活统计。
bash rotation/qwen3-8B/save_qkv_8b.sh -
5算旋转与阈值
再据此生成量化参数。
bash rotation/qwen3-8B/compute_rotation.sh
如何确认成功
量化后模型在同一批评测上精度损失小于阈值,推理吞吐比未量化时明显提升
注意事项
- 它针对键值缓存的量化,不是全模型量化。
- 校准集分布要与线上一致,否则掉点。
- 研究分支与官方版 API 不兼容。
- 精度损失要按业务容差判断。
核心亮点
- 把 KV Cache 压到 2-bit,长上下文显存占用显著下降
- 离线学习旋转矩阵,量化前先集中能量,缓解低比特掉点
- Python 实现,思路清晰,便于接入现有推理框架做验证
不足之处
- 需要离线校准/学习旋转矩阵,接入流程比即插即用量化复杂
- 2-bit 极端量化在不同模型和任务上的稳定性仍需更多验证
适用场景
- 长上下文大模型推理部署,显存吃紧时压缩 KV Cache
- 高并发在线服务,用低比特 KV 提升单卡吞吐
- 边缘或消费级显卡上跑长文本生成,降低显存门槛
替代项目
KIVI、KVQuant
同类项目推荐
worker-comfyui
开源
把 ComfyUI 变成按需付费的 API,秒级调用图像生成
ComfyUI as a serverless API on Runpod
agentglass
开源
一个屏幕管住所有 AI 编程代理,实时看成本、拦危险操作
Every AI coding agent on your machine, on one screen — live cost, tokens and tool c···
superserve
开源
给 AI Agent 一个安全隔离的执行沙箱
Sandbox infrastructure for AI Agents
agent-trace
开源
给 AI 智能体装上监控,看清每一步动作和花费
Local evidence and replay for coding agents: replay what happened, see what the trac···
apisix
开源
云原生 API 网关,动态热更新,轻松管理 AI 与大模型流量。
The Cloud-Native API Gateway and AI Gateway
OpenMemory
开源
AI 工具共用一份记忆,关掉重开照样记得你
Local persistent memory store for LLM applications including claude desktop, github ···
wirken
开源
给企业智能体装上安全闸门,身份、审计、隔离一步到位
The enterprise gateway for autonomous agents. Identity management, per-channel isola···
gpt2giga
开源
改个地址,现有 LLM 客户端直接接 GigaChat
FastAPI proxy for OpenAI, Anthropic and Gemini compatible clients backed by the Giga···
ai-gateway
开源
用 Rust 打造低延迟 AI 网关,统一接入多家模型,让 AI 应用更快更稳。
Built for demanding AI workflows, this gateway offers low-latency, provider-agnostic···
