Optimized kernels
A kernel is a device-level compute routine. DeepInfer combines specialized kernel libraries with its execution runtime; examine the linked README for the current library set and platform support.
DeepSeek · Open-source inference framework
DeepInfer is an inference framework: software that executes model weights. Start with supported hardware, understand the released engine, then follow the documented Linux build and offline examples.
Independent documentation guide. We have not installed DeepInfer or reproduced its GPU benchmarks. This page does not host inference, execute commands or download model weights.
Sources checked:
The current README lists the following platforms and model family. Support for older DeepSeek models, other accelerators, native Windows or macOS is not established by that list.
| Requirement | NVIDIA path | Ascend path |
|---|---|---|
| Supported model family | DeepSeek-V4.1-Flash | DeepSeek-V4.1-Flash |
| Accelerator | NVIDIA SM100 | Huawei Ascend 950 |
| Operating system | Linux | Linux |
| Python environment | Python 3.12 | Python 3.12 |
| Compiler | GCC ≥ 13.0 | GCC ≥ 13.0 |
| Platform toolkit | CUDA 13 | CANN 9.2 |
Device support and memory capacity are different checks. Confirm device count, memory, interconnects and checkpoint requirements for your configuration. Consumer GPUs and a Python installation alone do not satisfy these prerequisites.
This simplified flow describes an offline run. It does not represent a complete production HTTP service or a full cluster topology.
Prompts and generation parameters
Organize batches and execution work
Prefill context, then decode tokens
Select tokens under configured rules
Generated sequences and diagnostics
A kernel is a device-level compute routine. DeepInfer combines specialized kernel libraries with its execution runtime; examine the linked README for the current library set and platform support.
DP means data parallelism; CP means context parallelism. MoE is mixture of experts, EP distributes experts, and EPLB balances expert work. These describe engine parallelism, not a ready-made service load balancer.
Draft tokens can be proposed and verified together. DSpark schedules verification using confidence. SWA means sliding-window attention; bounded replay reduces repeated prefill work by retaining a suitable suffix. Advanced settings depend on model configuration.
Asynchronous scheduling overlaps CPU scheduling and device execution. Structured output constrains generation to formats such as JSON schema, regex or EBNF grammar. Batch-invariant execution and deterministic sampling have separate configuration requirements.
The README currently marks batch-invariant inference and deterministic sampling as NVIDIA-only. Deterministic sampling additionally requires the documented settings and a fixed sequence seed. This tutorial does not enable advanced optimization flags by default.
Read the release scope separately from the deployment Q&A’s description of DeepSeek’s production system. Not every production component described there is shipped as part of the repository.
| Area | Released engine capability | For a complete online service |
|---|---|---|
| Execution | Offline generation, model execution, scheduling and sampling. | Request ingress, service lifecycle and operational integration; do not treat the offline example as an HTTP server. |
| Cache | Engine-level KV use and bounded replay capabilities. | The complete KV cache system listed as outside this release, including the infrastructure-coupled management layer. |
| Parallelism and balancing | MoE expert parallelism and expert-parallel load balancing (EPLB). | Load balancing across data-parallel replicas for prefill and decode. |
| Stage separation | Much of the required engine functionality is implemented. | Deployment and orchestration of disaggregated vision encoding, prefill and decode. |
DeepSeek Recipe is a separate protocol conversion and token encoding/decoding library. Its existence should not be read as a bundled, production-ready API server in the offline DeepInfer release.
Use a machine that meets the prerequisites above. Commands below are documentation examples only. Choose one accelerator platform and use a separate, empty Python environment for that build.
git clone https://github.com/deepseek-ai/DeepInfer.git cd DeepInfer python3.12 -m venv .venv source .venv/bin/activate
Remain in the DeepInfer repository root with the virtual environment active. Review the current build script before execution, record your source revision and model revision, and reserve sufficient disk and memory for dependencies and weights.
The main path assumes SM100 hardware and CUDA 13 are already prepared. Keep DEEPINFER_ACCELERATOR exported in the same environment when running DeepInfer. The build installs dependencies and compiles vendored components.
export DEEPINFER_ACCELERATOR=nvidia ./build.sh
For Ascend 950 with CANN 9.2, use ascend in a separate matching environment instead of running the NVIDIA build. Do not combine the two toolchains or expect the CUDA-specific steps to apply.
export DEEPINFER_ACCELERATOR=ascend ./build.sh
Default checkpoint: deepseek-ai/DeepSeek-V4.1-Flash-1017. A first run can download weights into the Hugging Face cache. This is a large-model run, not a lightweight CPU smoke test.
The example explicitly selects eight NVIDIA devices and uses --ep 8. It assumes those devices are present and have sufficient resources. It is not a universal single-card command. Ascend users should follow the platform-specific official examples and configure their device visibility accordingly.
export DEEPINFER_ACCELERATOR=nvidia export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python examples/offline_inference.py --ep 8
export DEEPINFER_HF_MODEL_DIR=/path/to/DeepSeek-V4.1-Flash-1017 python examples/offline_inference.py --ep 8
Run the local-checkpoint alternative in the same configured NVIDIA shell. Replace /path/to/DeepSeek-V4.1-Flash-1017 with a real compatible Hugging Face checkpoint directory containing config.json and weight files. The environment variable changes the default model path; it does not override an explicitly supplied --model_name.
The official README’s prefill chart uses 4 SM100 GPUs and its decode chart uses 64, each within one scale-up domain. These configurations describe the published charts, not a universal minimum or a benchmark we ran.
| Metric | Unit / scope | How to interpret it |
|---|---|---|
| Prefill throughput | tokens/s/GPU | Rate of processing input tokens. Read alongside input length, cache coverage and batch size; it is not complete request latency. |
| Decode avg_SPS | steps/s | Steady-state decoding steps per second. A step is not necessarily one accepted output token when speculative decoding is enabled. |
| Decode throughput accounting | Full-acceptance convention | The example reports throughput using a full draft-acceptance convention. Compare draft length and true acceptance rate before treating it as delivered output tokens/s. |
| Per-user speed and latency | Per request / workload | High aggregate throughput does not guarantee fast replies for each request. Compare the same hardware, concurrency, context and measurement boundaries. |
Record the source revision, hardware, device count, parallelism, batch settings, cached prefix, draft length and acceptance assumptions when reproducing a curve. Profiling perturbs execution; do not derive steady-state performance from profiler trace timings. No universal speedup or API price follows from these charts.
DSpark, confidence-based verification, SWA bounded replay and reproducible sampling each have model and platform conditions. Start with the documented example, then inspect the README and example configuration before changing optimization flags or interpreting a result difference.
Verify current support and commands before execution. The repository can change after the date below. Our linked model article provides background, not additional hardware compatibility guarantees.