跳到主内容
@wquguru
精选88MarkTechPost(RSS)产品发布/更新多源精选 ×7

DeepSeek开源推理引擎DeepInfer,支撑V4.1-Flash服务

DeepSeek Open-Sources DeepInfer, the Inference Framework Behind DeepSeek-V4.1-Flash

原文
发到 X
推荐理由

罕见的一手工程实践披露,完整展示了前沿实验室的生产级推理栈架构与性能取舍,对做部署优化的同学极具参考价值。

DeepSeek has open-sourced DeepInfer, the inference framework that runs its production services. The DeepSeek DeepInfer inference framework is the engine behind DeepSeek-V4.1-Flash. It ships under the Apache 2.0 license. DeepSeek also released deepseek-recipe, its MIT-licensed token encoding and decoding layer. For developers, this is a rare look at a frontier lab’s real serving stack.

DeepSeek 已开源 DeepInfer,这是运行其生产服务的推理框架。DeepSeek DeepInfer 推理框架是 DeepSeek-V4.1-Flash 背后的引擎。它采用 Apache 2.0 许可证发布。DeepSeek 还发布了 deepseek-recipe,这是一个采用 MIT 许可证的 token 编码和解码层。对于开发者而言,这是一次难得窥探前沿实验室真实服务栈的机会。

TL;DR

TL;DR(太长不看)

  • Size / scope: 1 supported model (DeepSeek-V4.1-Flash), 1M-token context window per the model card.
  • Runs on: NVIDIA SM100 (Blackwell) GPUs and Huawei Ascend 950 NPUs. Benchmarks used 4 GPUs for prefill and 64 for decode.
  • Performance: Production-grade throughput; DeepSeek says 1 cluster serves 155 trillion tokens per day.
  • Best: Above 25,000 output tokens/s/GPU at 256 requests per rank (EP64, 131,072 context).
  • Worst: Offline inference only. KV cache system, P/D disaggregation and load balancing are not included.
  • 规模/范围:支持 1 个模型(DeepSeek-V4.1-Flash),根据模型卡片,上下文窗口为 1M token。
  • 运行环境:NVIDIA SM100 (Blackwell) GPU 和华为 Ascend 950 NPU。基准测试使用 4 张 GPU 进行预填充(prefill),64 张 GPU 进行解码(decode)。
  • 性能:达到生产级吞吐量;DeepSeek 表示一个集群每天可处理 155 万亿个 token。
  • 最佳表现:在每等级(rank)256 个请求(EP64,131,072 上下文)下,单 GPU 输出超过 25,000 个 token/s。
  • 最差表现:仅支持离线推理。不包含 KV cache 系统、P/D 分离和负载均衡。

What is DeepInfer?

什么是 DeepInfer?

DeepInfer is a high-performance inference engine from DeepSeek for its own models. According to it’s GitHub README, it powers DeepSeek’s large-scale production services. This release covers offline inference with the core features needed at scale. It was originally built primarily on vLLM, with ideas from SGLang and TensorRT-LLM.

DeepIner 是 DeepSeek 为其自有模型开发的高性能推理引擎。根据其 GitHub README 描述,它为 DeepSeek 的大规模生产服务提供动力。此次发布涵盖了大规模应用所需的核心功能的离线推理。它最初主要基于 vLLM 构建,并吸收了 SGLang 和 TensorRT-LLM 的理念。

The deployment Q&A gives production context. A single cluster serves 155 trillion tokens per day. DeepSeek reports overall revenue of US$38 per GPU-hour at valley pricing.

部署问答提供了生产环境的背景信息。单个集群每天可处理 155 万亿个 token。DeepSeek 报告在谷电价格下,每 GPU 小时的总收入为 38 美元。

How does DeepInfer work?

DeepInfer 是如何工作的?

The engine stacks DeepSeek’s kernels: FlashMLA, DeepGEMM, DeepEP, TileKernels, DeepSelect and custom TileLang kernels. On top sit 5 system-level ideas.

该引擎堆叠了 DeepSeek 的内核:FlashMLA、DeepGEMM、DeepEP、TileKernels、DeepSelect 以及自定义 TileLang 内核。在其之上还有 5 项系统级创新。

Parallelism: Attention DP plus Wide-EP

并行策略:Attention DP 加上 Wide-EP

Attention uses data parallelism. The MoE layers use expert parallelism with an expert-parallel load balancer (EPLB). Decode runs EP64 to EP128 inside a supernode. Prefill uses the smallest EP that memory allows, typically EP2 to EP8.

Attention 使用数据并行。MoE 层使用专家并行,并配有专家并行负载均衡器(EPLB)。解码阶段在超节点内运行 EP64 到 EP128。预填充阶段使用内存允许的最小 EP,通常为 EP2 到 EP8。

DSpark: confidence-scheduled speculative decoding

DSpark:基于置信度调度的推测解码

A draft model proposes 5 tokens per step. A Confidence Head predicts each draft token’s acceptance rate. The scheduler then verifies only the most valuable prefix. Per the Q&A, this cuts verified draft tokens by about 30% (5.00 to 3.2 to 4.4). Accepted length barely moves (3.29 vs 3.20).

草稿模型每步提议 5 个 token。置信度头(Confidence Head)预测每个草稿 token 的接受率。调度器随后仅验证最有价值的前缀。根据问答内容,这使得被验证的草稿 token 减少了约 30%(从 5.00 降至 3.2 至 4.4)。接受长度变化不大(3.29 对比 3.20)。

SWA bounded replay

SWA 有界回放

On a cache hit, DeepInfer recomputes only the last 128 tokens of sliding-window attention state. That makes recomputation cost constant, regardless of context length. In the decoder layers, DeepSeek says this nearly halves total prefill compute.

在缓存命中时,DeepInfer 仅重新计算滑动窗口注意力状态的最后 128 个 token。这使得重新计算的成本保持恒定,与上下文长度无关。DeepSeek 表示,在解码器层中,这几乎将总预填充计算量减半。

Asynchronous scheduling, determinism and structured output

异步调度、确定性与结构化输出

CPU batch scheduling overlaps with GPU execution, so the GPU never idles between steps. Batch-invariant inference and deterministic sampling are available on NVIDIA only. Structured outputs support regex, JSON schema and EBNF grammars.

CPU 批处理调度与 GPU 执行重叠,因此 GPU 在步骤之间不会空闲。仅在 NVIDIA 上提供批次不变推理和确定性采样。结构化输出支持正则表达式、JSON 模式和 EBNF 语法。

How fast is DeepInfer?

DeepInfer 有多快?

DeepSeek publishes Pareto curves for DeepSeek-V4.1-Flash at 131,072 context. Prefill ran on 4 SM100 GPUs; decode ran on 64. Figures below are read from those charts and are self-reported.

DeepSeek 发布了 DeepSeek-V4.1-Flash 在 131,072 上下文长度下的帕累托曲线。预填充(Prefill)在 4 个 SM100 GPU 上运行;解码(Decode)在 64 个 GPU 上运行。下图数据源自这些图表,为官方自报数据。

  • Decode (EP64DP64, nextn=3, 75% acceptance): Above 25,000 tokens/s/GPU at 256 requests per rank, near 100 tokens/s per user. At 8 requests, per-user speed passes 300 tokens/s.
  • Prefill (EP4DP4, 140-token bounded replay): About 60,000 non-cached tokens/s/GPU at 4,096 tokens per rank. Throughput nears 90,000 at 65,536 tokens, with roughly 730 ms per step.
  • Wide-EP payoff: An EP8 vs EP64 chart shows EP64 ahead at every batch size.
  • 解码(EP64DP64,nextn=3,接受率 75%):在每个等级(rank)256 个请求时,每 GPU 吞吐量超过 25,000 tokens/s,每位用户接近 100 tokens/s。当请求数降至 8 个时,每位用户的速度超过 300 tokens/s。
  • 预填充(EP4DP4,140-token 有界重放):在每个等级 4,096 tokens 时,每 GPU 非缓存 token 吞吐量约为 60,000 tokens/s。当 token 数达到 65,536 时,吞吐量接近 90,000,每个步骤耗时约 730 毫秒。
  • 宽专家并行(Wide-EP)的收益:EP8 与 EP64 的对比图显示,在所有批次大小下,EP64 均领先。

DSpark’s dynamic verification adds 4% to 7% throughput at about 60 sequences per rank. At 16 sequences per rank it is 1.5% slower than fixed 5-token verification.

DSpark 的动态验证使吞吐量在每个等级约 60 个序列的情况下提升 4% 至 7%。在每个等级 16 个序列时,其速度比固定的 5-token 验证慢 1.5%。

How does DeepInfer compare with vLLM, SGLang and TensorRT-LLM?

DeepInfer 与 vLLM、SGLang 和 TensorRT-LLM 相比如何?

FeatureDeepInfervLLMSGLangTensorRT-LLM
MaintainerDeepSeekvLLM projectSGLang projectNVIDIA
LicenseApache 2.0Apache 2.0Apache 2.0Apache 2.0
Model coverage1 (DeepSeek-V4.1-Flash)200+ architecturesLLMs, VLMs, diffusionSupport matrix
HardwareNVIDIA SM100, Huawei Ascend 950NVIDIA, AMD, Intel, CPUs, plugins incl. Ascend, TPUNVIDIA, AMD, TPU, Intel, Apple, Ascend, Moore ThreadsNVIDIA GPUs
Expert parallelismYes, with EPLBYesYesWide-EP
Speculative decodingDSpark, confidence-scheduledn-gram, suffix, EAGLE, DFlashYes, via SpecForge draftsYes
P/D disaggregationNot in this releaseYes (prefill, decode, encode)Via llm-d, Dynamo and othersYes
Online servingOffline inference onlyOpenAI-compatible serverYesYes
特性DeepInfervLLMSGLangTensorRT-LLM
维护者DeepSeekvLLM 项目SGLang 项目NVIDIA
许可证Apache 2.0Apache 2.0Apache 2.0Apache 2.0
模型覆盖范围1 (DeepSeek-V4.1-Flash)200+ 种架构LLMs, VLMs, diffusion支持矩阵
硬件NVIDIA SM100, Huawei Ascend 950NVIDIA, AMD, Intel, CPUs, 插件包括 Ascend, TPUNVIDIA, AMD, TPU, Intel, Apple, Ascend, Moore ThreadsNVIDIA GPUs
专家并行是,支持 EPLB是是宽专家并行(Wide-EP)
投机解码DSpark, confidence-scheduledn-gram, suffix, EAGLE, DFlash是,通过 SpecForge 草稿是
P/D 分离本版本未包含是(prefill, decode, encode)通过 llm-d, Dynamo 等是
在线服务仅限离线推理OpenAI 兼容服务器是是

What are DeepInfer’s limitations?

DeepInfer 有哪些局限性?

A full service still needs a KV cache system and VE/Prefill/Decode disaggregation. It also needs load balancing across data-parallel replicas. DeepSeek team states that those components are tightly coupled to internal infrastructure.

完整的服务仍需 KV cache 系统和 VE/Prefill/Decode 分离。还需要跨数据并行副本的负载均衡。DeepSeek 团队表示,这些组件与其内部基础设施紧密耦合。

Hardware is narrow. Builds require Linux, GCC 13 or later, Python 3.12, and CUDA 13 or CANN 9.2. The smallest efficient production unit is 64 prefill GPUs plus 64 decode GPUs. The internal FlashMLA decoding kernel is 5% to 10% faster than the public one. End-to-end, DeepSeek puts the gap at 5% or less.

硬件要求严格。构建需要 Linux、GCC 13 或更高版本、Python 3.12,以及 CUDA 13 或 CANN 9.2。最小的有效生产单元为 64 个预填充 GPU 加 64 个解码 GPU。内部 FlashMLA 解码内核比公开版本快 5% 到 10%。端到端来看,DeepSeek 将差距控制在 5% 以内。

Key Takeaways

关键要点

  • DeepInfer is DeepSeek’s production engine, now Apache 2.0 on GitHub.
  • It supports only DeepSeek-V4.1-Flash, on NVIDIA SM100 and Ascend 950.
  • Decode tops 25,000 tokens/s/GPU on 64 GPUs (self-reported).
  • DSpark cuts verified draft tokens about 30% with near-equal acceptance.
  • Offline only: no KV cache store, P/D disaggregation or load balancer.
  • DeepInfer 是 DeepSeek 的生产引擎,现已在 GitHub 上以 Apache 2.0 协议开源。
  • 它仅支持 DeepSeek-V4.1-Flash,适用于 NVIDIA SM100 和 Ascend 950。
  • 在 64 个 GPU 上,解码速度达到每秒 25,000 个 token/GPU(自报数据)。
  • DSpark 通过近乎相同的接受率,将已验证的草稿 token 减少约 30%。
  • 仅限离线模式:不支持 KV 缓存存储、P/D 分离或负载均衡器。

Check out the GitHub repo, deployment Q&A, deepseek-recipe and the model card. All credit goes to the researcher of this project. Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.

请查看 GitHub 仓库、部署常见问题解答、deepseek-recipe 以及模型卡片。所有功劳归于本项目的研究人员。此外,欢迎在 Twitter 上关注我们,别忘了加入我们拥有超过 15 万成员的 ML SubReddit,并订阅我们的新闻通讯。等等!你在 Telegram 上吗?现在你也可以在 Telegram 上加入我们。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

关联讨论

同一事件的更多信源

相似阅读

关联信息,但可能不是同一事件