DeepSeek is heavily open-sourced! The secret to earning a million a year with a single card.

CN
PANews
Follow
1 hour ago
dnXzd51Quv8owfe3Z2EDl7_iTKzpOYyYVsUjWgIBCIA.webp

Author: Datawhale

A domestic card can earn about 118 yuan per hour. If this level is maintained for 24 hours every day, it amounts to approximately 1.03 million yuan per year.

Just now, DeepSeek unveiled a batch of production-level code for their inference framework DeepInfer running on Huawei Ascend, along with the online operation data of V4.1 Flash. The aforementioned 118 yuan is the hourly income per card calculated based on the online traffic and off-peak API price at that time.

On the Huawei Ascend 950DT-PC16 UBL128, the average input length per request is close to 100,000 Tokens, with the median first Token latency being 277 milliseconds and single-stream output speed being approximately 138 Tokens per second.

Image

By comparing the open-source documentation from October with this update log, the entire process becomes clear. At the end of September, DeepSeek initially open-sourced the attention operators and communication libraries on Ascend. By October, DeepInfer was already capable of conducting offline inference on Ascend 950. Now, developers can follow this batch of new code to see how DeepSeek reduces computational overhead and shortens waiting times as online requests continuously come in.

1. How to achieve 277 milliseconds for the first word with a request of nearly 100,000 Tokens

First, let’s see how a request runs. For example, if you ask DeepSeek a long document and then follow up with another question, the second round of requests includes both the new question and the previous document along with conversation history. The model first processes the input and then generates answers in segments. These two phases are called Prefill and Decode.

Image

Prefill · Pre-computed prefixes can be reused

If the previous document remains unchanged and the input prefix matches, the earlier computational results are still in the KV cache, allowing the model to continue processing the newly added content. The online traffic disclosed by DeepSeek has an average input cache hit rate of 97.2%. The nearly 100,000 Tokens describe how long the request is, while the hit rate determines how much can be reused.

In the same table, DeepSeek recorded the input processing throughput twice. Each card processes approximately 26,000 Tokens per second, based on the uncached part. Including cached input, each card handles approximately 930,000 Tokens per second. When you see this figure next time, first check which inputs were included in the throughput statistics.

Decode · After the first word appears, generation continues

The 277 milliseconds measure the time users wait for the first Token, while the approximately 138 Tokens per second measure how fast single-stream outputs are. For those writing long reports, the latter number affects how quickly the entire answer can be reviewed. The server also separately calculates the throughput for handling multiple concurrent requests on each card. Single-stream speed and per-card throughput address two different questions.

2. What specific changes were made to DeepInfer this time

As online requests increase, delays can arise from computations within the card, data transfer between cards, and gaps when one batch of requests is finished while the next is not yet connected. Turning to the update log for DeepInfer, there are specific changes in these areas.

Combine several computations in attention together

The update includes the fusion attention implementation for Ascend 950DT. Attention computations require the model to determine which positions in the input relate to the current content. If multiple computation steps activate separately, intermediate results need to be read and written between steps. The fusion operator integrates several of these steps into a single operator execution, helping to reduce such overhead.

Relocate busy expert modules

V4.1 Flash is an MoE model, meaning that a portion of the model's computations is delegated to different expert modules. Different inputs call on different experts. If one expert receives too many tasks, the card hosting it may slow down the entire batch of requests. DeepInfer can adjust the distribution of experts on the card and optimized data transfer during redistribution using UDMA.

The previous batch is still finishing up while the next batch has already started

There is an easy-to-understand modification in the warehouse. The post-processing of Prefill can overlap with model computations. If the next batch is only started after all finishing work for the previous batch, the card may wait for a while. By overlapping these tasks, the next batch can start earlier.

Image

Get the code and run an offline inference

If you want to see what this open-source release offers, you can start with the README and offline examples in the GitHub repository. The path for Ascend runs on Ascend 950 on ARM64 hosts, and the software environment listed includes Linux, GCC 13 or above, Python 3.12, and CANN 9.3.

Step 1 · Obtain the DeepInfer source code

Step 2 · Switch to the Ascend backend and run the official example

After setting up the Python environment as per the README, you can use the following lines to build and start the offline example. The default example loads DeepSeek-V4.1-Flash-1017.

If you want to connect to real-time traffic, the official documentation lists a few tasks you need to implement. You need a KV cache system to allow subsequent requests to reuse previously computed prefixes. You also need to deploy visual encoding, Prefill, and Decode, and distribute requests among the corresponding replicas. The repository provides offline examples and implementations on the engine side, and deploying question-and-answer can help you understand how DeepSeek performs these tasks online.

DeepSeek also disclosed that based on off-peak prices and the conditions at that time, Ascend generated approximately 118 yuan per hour per card. That is revenue estimated based on a specific load, excluding costs for equipment, electricity, and operations. When conducting your own stress tests, it’s advisable to first run a set of repeated prefixes and entirely new long inputs, recording both the first Token latency and the sustained output speed. The difference between these two sets of results will directly influence how many cards you allocate for the same volume of requests.

免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到[email protected],本平台相关工作人员将会进行核查。

Share To
APP

X

Telegram

Facebook

Reddit

CopyLink