[KongchangAI]
· 3 min read· 1,559 words

DeepSeek Open-Sources DeepInfer: What Is an Inference Framework Actually For?

DeepSeek Open-Sources DeepInfer: What Is an Inference Framework Actually For?

DeepSeek open-sources DeepInfer, an inference framework optimizing scheduling and computation to accelerate model inference.

DeepSeek has open-sourced its inference framework DeepInfer under the Apache 2.0 license. The framework deploys models onto computing devices and schedules computation, improving inference efficiency through batching, overlapping scheduling with computation, FlashMLA/DeepGEMM specialized kernel optimization, and multi-chip collaboration. Its DSPark feature uses a draft model to guess and the main model to verify in a speculative approach to accelerate step-by-step generation, though verification does not guarantee factual correctness. The public version supports DeepSeek V4.1 Flash offline inference and constrained output formats, with hardware support for NVIDIA SM100 architecture GPUs and Huawei Ascend 950, but the full supporting systems for online services are not entirely open-sourced. For ordinary users, improved inference efficiency may enhance response speed and concurrency experience, but actual results depend on the model, devices, and request volume.

DeepSeek has open-sourced its inference framework DeepInfer, with the code now available on GitHub under the Apache 2.0 license. For most users who only interact with DeepSeek through a chat interface, this name may be unfamiliar—it doesn't generate answers and never appears in the chat box. Yet the speed at which each question gets answered, and the stability of the service under high concurrency, are directly tied to the work of inference frameworks like this one.

What DeepInfer Is: The Scheduling Layer Between Models and Hardware

The DeepSeekAd model is responsible for generating answers based on input, while DeepInfer is responsible for running the model on computing devices and arranging how those computations proceed. The process of using a trained model to process input and generate results is called inference, and DeepInfer is a framework built specifically for inference.

Why does running a model require a dedicated piece of software? When a user submits a request to summarize an article, the computing devices in the server need to first process the input, then progressively generate an answer based on the model parameters. Meanwhile, there may be many other users asking math questions or writing reports—requests of varying lengths arriving at random times. If the device handled only one request at a time, everyone else would have to queue up. To let more people get answers simultaneously, the device must be used efficiently—and that is exactly the problem an inference framework solves.

This arrangement runs into a limitation

At the request-scheduling level, DeepInfer batches multiple requests together so the computing device can process them at once. When a user's answer is fully generated, that request is removed and a waiting request moves in. This arrangement runs into a hard limit: each request occupies device memory (such as GPU VRAM), so putting too many requests in at once may run out of space, while putting in too few leaves the device underutilized. How many requests to schedule and when to admit them affects both waiting time and the number of requests the device can handle. In addition, DeepInfer supports overlapping some scheduling work with computation on the device—while the chip is computing, the system can prepare subsequent tasks, reducing time the device spends waiting on scheduling.

The difference between inference and training: The article mentions the term "inference," which refers to using a trained model to process new input and generate results, as opposed to "training" (adjusting model parameters using large amounts of data). Inference typically focuses more on latency (how quickly a single request gets answered) and throughput (how many requests can be processed per unit time), while training focuses more on total computation and convergence. As an inference framework, DeepInfer's design goal is precisely to optimize these two metrics, not to change the model's own capabilities.

VRAM and batching: The article mentions "device memory (such as GPU VRAM)." VRAM is dedicated high-speed memory on the GPU used to store model parameters, intermediate computation results, and request data. Each concurrent request needs to retain its own context in VRAM (such as generated text and attention caches), so VRAM capacity directly limits the number of requests that can be processed simultaneously. Batching is the practice of merging multiple requests into one batch for joint computation to improve GPU utilization, but the larger the batch, the more VRAM each request consumes, requiring a trade-off between throughput and latency.

Computation Optimization and Multi-Chip Collaboration

Once requests enter the device, the real computation begins. An article must go through a large number of operations to produce a summary, and DeepInfer calls programs optimized for specific computations, such as FlashMLA and DeepGEMM, to help the device complete these steps more efficiently. Running the model may also require multiple chips working together, in which case DeepInfer distributes part of the work across different chips for parallel computation, and both the data exchange method and communication speed between chips affect the final result. Exactly how much faster it gets depends on the devices and configuration used.

FlashMLA and DeepGEMM: FlashMLA is a computation kernel optimized for the attention mechanism (the core component of Transformer models), accelerating long-sequence processing by reducing VRAM reads and writes and leveraging hardware features. DeepGEMM is a high-performance implementation of matrix multiplication (the most important operation in models), typically leveraging dedicated units such as GPU Tensor Cores. These kernels require hand-tuning for specific hardware architectures, so inference frameworks often integrate multiple optimized kernels and automatically select them based on the device.

DSPark: The Speed-Up Idea of Guessing First, Then Verifying

After the model finishes processing the input, it must generate the summary step by step, because previously generated content affects what comes next.

Because the previously generated content

DeepInfer's DSPark feature specifically tries to speed up this step. Its approach is to first have a draft model guess a short segment of likely content, then have the model responsible for generating answers verify multiple positions at once. For example, if the article is about phone battery life, the draft model guesses that what follows might be "what factors affect phone battery life." If the beginning portion is acceptable after verification, the system keeps that part and continues generating from the position that didn't pass. If a single verification round can accept multiple content segments in a row, there is an opportunity to reduce the number of times the main model must compute step by step.

Using a whole sentence as an example here is just for ease of understanding—the actual unit processed is not necessarily exactly one word. Guessing first and then verifying itself costs computation; if many guesses are accepted, more time may be saved, but if they are frequently rejected, the benefit shrinks. DSPark also estimates the likelihood that candidate content will be accepted, helping determine how much content to verify in one round. It is important to emphasize that verification here only judges whether candidate content can be used for the subsequent generation—it does not guarantee that facts in the summary are correct. Whether the article has been summarized incorrectly still needs to be checked separately.

Speculative decoding: The "guess first, then verify" approach used by DSPark is known in the industry as speculative decoding. Its core is to use a smaller, faster draft model to generate multiple candidate tokens, then have the main model verify these candidates in parallel. If the draft model guesses accurately, the main model can accept multiple tokens in a single forward pass, thereby reducing the total number of step-by-step generations. This method does not change the final output distribution (under ideal conditions), but the benefit depends on the consistency between the draft model and the main model as well as the task type.

Output Format Constraints and Capabilities Available to Developers

After generating text

For developers integrating the model into their own applications, there is one more step after text generation: making it possible for the application to read the summary smoothly. DeepInfer supports constraining the output format, and under specific configurations also supports producing reproducible output for the same input and settings, which helps with development and inspection. However, correct formatting still does not mean the content is necessarily correct.

The currently public version of DeepInfer supports DeepSeek V4.1 Flash and provides offline inference capability. After preparing supported devices and models, developers can submit input in their own environment to have the model produce results. The hardware listed in the official repository includes GPUs based on NVIDIA's SM100 architecture and Huawei Ascend 950.

Not everything is included in this public release

Running the model in your own environment is only the first step. To turn it into an online service accessed by many people simultaneously, supporting work is also needed: storing and managing reusable caches, distributing user requests across different devices, and coordinating device groups that process input with those that generate answers when needed. The official documentation states that the supporting systems required for these complete services are not all included in this public release. Developers also have other options—for example, vLLM supports multiple models and provides online service interfaces; DeepSeek states in its official repository that DeepInfer was initially developed primarily based on vLLM, and also drew on SGLang and NVIDIA's TensorRT-LLM. Which framework to choose depends on the model to be run, the devices on hand, and the type of service you want to build.

What It Means for Ordinary Users

Although backend software never appears in the chat interface, its work affects several familiar feelings: how long after sending a question the answer starts coming back, how fast the answer is generated, and whether the service responds smoothly once many people are using it. If operational efficiency improves, then under otherwise similar conditions the same devices have an opportunity to handle more requests, or to complete the same work with fewer resources.

However, actual experience also depends on the model, the devices, and the request volume at the time. Open-sourcing DeepInfer itself cannot guarantee that everyone will immediately feel a speed-up, nor does it directly indicate that prices will necessarily drop. Its significance lies in opening up the layer of capability for running DeepSeek models and scheduling computing resources, allowing developers to deploy and validate inference capabilities on their own hardware, and providing a foundational component for the broader online service ecosystem going forward.

#DeepSeek#DeepInfer#inference framework#speculative decoding#FlashMLA#DeepGEMM#vLLM
Share:

Related articles