Skip to main content

Introduction

DeepSeek-V4.1-Flash is a multimodal Mixture-of-Experts (MoE) model developed by DeepSeek, with 552B backbone parameters and support for context lengths of up to one million tokens. It uses a Causal Encoder-Decoder architecture and activates 8B parameters per token during prefill and 16B during decode. This guide uses language-model-only mode, so image inputs are not enabled. For more model details, see the DeepSeek-V4.1-Flash technical report. This guide covers DeepSeek-V4.1-Flash deployment on A3 Series and 950PR/DT Series (A5) NPUs with SGLang. Prefill and decode run in one service; Prefill-Decode (PD) disaggregation is not configured.

Configuration summary

The following table summarizes the A3 and A5 script settings. For parameter details, see the Ascend Parameter Reference and Feature Compatibility.

Prerequisites

Environment

Prepare an A3 Series host with 16 NPUs per node or a 950PR/DT Series (A5) host with 8 NPUs per node. Install a compatible Ascend driver, CANN, TorchNPU, ATB, and custom operators, then run the setup and launch commands inside the prepared Ascend environment. Use an SGLang checkout that supports DeepSeek-V4.1-Flash and the dsv4 NPU attention backend. Keep the same SGLang revision and model checkpoint available at the same paths on every node.

Model weights

Select the checkpoint for your hardware: DeepSeek-V4.1-Flash-1017-W8A8 for A3, or the DeepSeek-V4.1-Flash-1017 checkpoint for A5 (950PR/DT Series). Set MODEL_PATH to the directory containing the selected checkpoint. Replace the placeholder path in the script with the checkpoint directory available in your environment. For multi-node deployments, make the checkpoint accessible at the same path on every node.

Installation

Ensure sufficient disk space before pulling images. The Docker image requires at least 30GB of free space.
The dependencies required for the NPU runtime environment are integrated into platform-specific Docker images. Pull the image for your hardware and create a container using the corresponding command below. For host setup and further container options, see the SGLang Installation with NPU Support guide.
  • If the model weights are stored on the host, mount their directory into the container, for example: -v /path/to/models:/models.
  • Set NAME to your preferred container name before running the commands.

Online service deployment

ParameterSingle-node deploymentMulti-node deployment
MODEL_PATHDownload the checkpoint for your hardware from Model weights, then set MODEL_PATH to its directory as accessible from inside the container. For multi-node deployments, make this path accessible inside every node’s container.Same as the single-node deployment.
NODE_IPSList the node’s communication IP, for example NODE_IPS=(“192.168.25.209”).List all node communication IPs in the same order on every node, for example NODE_IPS=(“192.168.25.209” “192.168.25.212”). Do not include port numbers.
NODE_RANKSet NODE_RANK=0.Set the rank separately on each node according to its position in NODE_IPS. For the example above, use NODE_RANK=0 on 192.168.25.209 and NODE_RANK=1 on 192.168.25.212.
HCCL_IFThe single-node example uses HCCL_IF=“lo”. To inspect available interfaces, run ip -br addr. To check the route to a peer, run ip route get <peer-node-ip>; use the interface shown after dev as HCCL_IF.Set HCCL_IF separately on each node to its local interface for HCCL communication. For example, configure the interface on 192.168.25.209 on that node, and the interface on 192.168.25.212 on the other node. Interface names may be the same or different, depending on the cluster configuration.
GLOO_SOCKET_IFNAMEThe script defaults to lo. For multi-node deployments, set this to an available interface for GLOO communication, for example export GLOO_SOCKET_IFNAME=“<interface>”.Set this separately on each node to that node’s local interface for GLOO communication. Run ip route get <peer-node-ip> and use the interface shown after dev; set it with export GLOO_SOCKET_IFNAME=“<interface>”. The interface can differ between nodes.
This script supports both single-node and multi-node deployments. Configure NODE_IPS, NODE_RANK, HCCL_IF, and GLOO_SOCKET_IFNAME as described above. Replace the SGLang source and model checkpoint paths with paths available in your environment.
command

Functional verification

Once the server prints The server is fired up and ready to roll! in the terminal, it is ready to accept requests. For more testing examples (health checks, Generate, Chat Completions, and port usage), see Testing the Service. Send a chat completion request to the service endpoint on port 30000:
Expected result: an HTTP 200 response containing a generated answer. For a multi-node deployment, send the request to the service endpoint reachable from the client, typically on the rank-0 node (MASTER_ADDR). The service output is displayed in the terminal on each node.

Accuracy evaluation

A quick GSM8K accuracy check with sgl-eval:
If the shell reports sgl-eval: command not found, install it with pip install sgl-eval==0.1.3 and run the command again. If you do not want to change the server’s Python environment, install it in an isolated venv instead; Replace /path/to/model-checkpoint with the checkpoint path used by the server. For multi-node deployment, use the service address reachable from the client.

Accuracy Tests

DeepSeek-V4.1 accuracy scores on Ascend A3 Series and 950PR/DT Series (A5):
BenchmarkAscend A3 SeriesAscend A5 (950PR/DT Series)
GPQA-Diamond91.991.4
AIME2696.7100
The A5 results were obtained with DSPark and decode graph enabled. The A3 scores are reported for A3, but the corresponding launch settings were not provided; they do not establish that the A3 tutorial or Cookbook launch recipe was smoke-tested.

Performance

A quick serving benchmark with random input and output lengths:
The sglang backend benchmarks the /generate endpoint. To benchmark the OpenAI-compatible chat endpoint, use --backend sglang-oai-chat. For multi-node deployment, use the service address reachable from the benchmark client. This tutorial does not provide DeepSeek-V4.1-Flash A3 or A5 performance results. For performance data and benchmark commands, see Performance Testing on Ascend NPU.

Performance tuning

Use the Ascend optimization and parameter tuning guide to understand the launch parameters and tune them for your workload.

FAQ

For common Ascend environment, installation, and runtime issues, see the Ascend NPU FAQ.