DeepSeek 开源生产推理框架 DeepInfer,服务 V4.1 Flash
介绍 DeepInfer 包含高性能 kernel、分布式推理与推测解码,用于大规模服务 V4.1 Flash,并解释推理引擎为何决定吞吐与每 token 成本。
DeepSeek has open-sourced DeepInfer, its in-house inference framework used to serve DeepSeek-V4.1-Flash at scale. The release gives developers access to parts of the production infrastructure behind DeepSeek’s inference stack, including optimized kernels, distributed inference, and speculative decoding. Why is this worth paying attention to? Running a large model efficiently is about more than its parameter count or benchmark scores. The inference engine determines how efficiently hardware is used, how quickly responses arrive, how many requests can be handled simultaneously, and how much each generated token costs. DeepInfer focuses on that layer. What’s inside DeepInfer? 1. High-performance kernels and an optimized inference engine Kernels are the low-level operations that execute model computations on hardware. Optimizing them can reduce unnecessary computation, improve memory access patterns, and make better use of available GPU resources. Across large workloads, even relatively small efficiency improvements can translate into meaningful savings. 2. Distributed inference Large models and high request volumes often require computation to be spread across multiple devices. Distributed inference coordinates that work across the available hardware. The challenge is minimizing communication overhead while keeping the devices busy. Effective coordination can improve throughput and make large-scale deployments more economical. 3. Speculative decoding Speculative decoding accelerates generation by using a draft process to propose tokens that the main model then verifies. When the main model accepts multiple proposed tokens, it can generate output more efficiently than producing every token through a separate sequential step. The actual speedup depends on draft quality, acceptance rates, hardware, and implementation overhead. 4. SWA Bounded Replay DeepSeek also lists SWA Bounded Replay among DeepInfer’s capabilities. This is a more specialized component of the inference stack, so its exact implementation and performance benefits should be assessed from the released code and accompanying documentation rather than inferred from the name alone. 5. Structured outputs Structured-output support helps applications obtain responses in predictable formats, such as JSON, rather than relying entirely on free-form text. This is particularly useful for APIs, tool-using agents, and software that needs to parse model responses reliably. DeepSeek says inference code for future models and ongoing optimizations will also be published through the project. DeepSeek is also open-sourcing deepseek-recipe Alongside DeepInfer, DeepSeek is releasing deepseek-recipe, its production token encoding and decoding component. Tokenization converts text into the token representations a model processes. Decoding converts generated tokens back into readable output. Consistency here is important. Differences between tokenization or decoding implementations can affect API compatibility, special-token handling, and how applications interpret model responses. DeepSeek says deepseek-recipe follows the processing logic behind its official API, helping community deployments reproduce the expected behavior more closely. For developers building alternative serving infrastructure, this could reduce the work required to maintain compatibility with DeepSeek’s API behavior. Why open-sourcing the inference stack matters Open model weights are only one part of the local and self-hosted AI ecosystem. Developers also need efficient inference engines, optimized kernels, reliable token processing, and the infrastructure required to serve multiple users. When these components remain proprietary, developers have fewer opportunities to inspect how the system works, adapt it to different hardware, or contribute improvements. Opening the inference stack creates more room for experimentation and independent optimization.
这条是引用着另一条写的:x.com/oluwaphilemon1/status/2112382397656261049