NVIDIA NIM 运行 SGLang 实测:默认 KV cache 调优带来 31% 吞吐提升
Great initial results Benjamin! https://t.co/Zfj8ti09L7
自己搭 SGLang 的可以看看这个测试:不换模型、不改代码,光把 KV cache 显存占比从 0.785 调到 0.92,8 并发吞吐就涨了 31%。NIM 容器的好处主要是默认参数调好了,想省事的可以试试。
Benjamin Marie 在单张 RTX PRO 6000 上对比测试了 NVIDIA NIM 2.1.5 与原生 SGLang 0.5.21,两者运行同一个 Gemma 4 31B NVFP4 模型构建。单请求速度相同(35 tok/s),但 NIM 的 8 并发吞吐从 118 提升到 154 tok/s,提升 31%。
差异来源是 KV cache 默认配置:NIM 把 mem-fraction-static 设为 0.92,给 KV cache 留出更多显存,使可用上下文从 123K 增到 160K tokens,原本被拒绝的 128K-token 长提示也能正常服务;SGLang 自带的启发式只取 0.785,浪费了约 17 GB 显存。
除此之外 NIM 的价值主要在工程便利性:单个容器自动选择 GPU 并行度,并提供健康检查端点方便 Kubernetes 部署。作者计划下一步在 8x B200 或 8x H200 等经过专门调优的硬件配置上继续测试。
Great initial results Benjamin! https://t.co/Zfj8ti09L7
Great initial results Benjamin! x.com/bnjmn_marie/st… Benjamin Marie @bnjmn_marie I'm testing SGLang through NIM. I want to see whether NVIDIA's container really gets good inference speed without tuning anything myself, since I don't know much SGLang. First test is promising: Gemma 4 31B NVFP4 on one RTX PRO 6000, NIM 2.1.5 vs. plain SGLang 0.5.21 (the same build NIM ships). - 1 request: same speed (35 tok/s) - KV cache: 123K → 160K tokens - 128K-token prompts: rejected → served - 8 concurrent requests: 118 → 154 tok/s (+31%) I was quite surprised by the speedup... but it's just thanks to a better default KV cache setting. NIM gives SGLang more GPU memory for the KV cache (mem-fraction-static 0.92). SGLang's own heuristic picks 0.785 and leaves ~17 GB of VRAM unused. Beyond that, NIM is mostly convenience: one container, it picks the parallelism for your GPUs, and it has health endpoints if you run it on Kubernetes. Next test with hardware configurations for which NIM is actually tuned: 8x B200 or 8x H200. 🔗 View Quoted Tweet📊 1 ⚡
本条情报归属 AITOP「技巧」核心栏目,重点聚焦北美前沿实验室与硅谷科技巨头。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:NVIDIA NIM、SGLang、Gemma、KV cache,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。
信源核验说明:本文原始线索采编自「NVIDIA AI」(@NVIDIAAI),经 AITOP 多维评分管线结构化提炼。