System Settings section to ensure the clusters are operating at optimal performance. Feel free to leave an issue here at sglang if you encounter any issues or have any problems.
Component Version Mapping For SGLang
Each CANN version requires its own matched set of component versions — do not mix versions across sets.- A3 Series
- 950PR/DT Series
| Component | Version | Obtain Method |
|---|---|---|
| HDK | 25.5.2 | HDK driver download |
| CANN | 9.1.0 | Obtain Images |
| TorchNPU | 2.10.0.post6 | TorchNPU releases |
| MemFabric | 1.2.1 | memfabric_hybrid-1.2.1 (x86_64 host: use the manylinux_2_27_x86_64.manylinux_2_28_x86_64 wheel from the same directory) |
| memcache | 1.2.1 | memcache_hybrid-1.2.1 (x86_64 host: use the manylinux_2_27_x86_64.manylinux_2_28_x86_64 wheel from the same directory) |
| Triton | 3.2.2 | triton_ascend-3.2.2 (x86_64 host: replace aarch64 with x86_64) |
| SGLang NPU Kernel | 2026.9.0.post9 | sgl-kernel-npu releases |
| MemFabric-zbal | 1.1.3 | pip install memfabric-zbal==1.1.3 |
Obtain CANN Image
You can obtain the dependency of a specified version of CANN through an image.- A3 Series
- 950PR/DT Series
Command
Preparing the Running Environment
Pick one of the two methods below based on your situation:| Method | Recommended scenarios |
|---|---|
| Using Docker Image | New to SGLang on NPU, or deploying a serving environment |
| Installing from source with prerequisites | Developing or debugging SGLang, or pinning/customizing component versions |
Method 1: Installing from source with prerequisites
The steps in this method install the component set from the version mapping table.Python Version
The CANN 9.1.0 set requirespython==3.12. If you don’t want to break
system pre-installed python, try installing with conda.
Command
Command
vi ~/miniconda3/.condarc.
Then remove the failed environment and recreate it:
Command
CANN
Prior to starting work with SGLang on Ascend, you need to install CANN Toolkit, Kernels operator package and NNAL version 9.1.0, check the installation guideMemFabric-Hybrid
If you want to use PD disaggregation mode, you need to install MemFabric-Hybrid. MemFabric-Hybrid is a drop-in replacement of Mooncake Transfer Engine that enables KV cache transfer on Ascend NPU clusters.Command
MemFabric-zbal
MemFabric-zbal is a Zero Buffer Acceleration Library of high-performance operators for LLM inference and training on Ascend, accelerating computation by eliminating intermediate memory buffers; it is required only on aarch64 clusters and is installed in addition to MemFabric-Hybrid.Command
PyTorch and PyTorch Framework Adapter on Ascend
Command
torch and install torch_npu, check installation guide
After the installation, verify that PyTorch can compute on the NPUs — it should print True, then a small tensor
computed on the device:
Command
tensor([1., 4., 9., 16.], device='npu:0') — the squares of 1, 2, 3, 4, computed on the
device. You may also see some compatibility warnings caused by device differences; they are safe to ignore.
Triton on Ascend
We provide our own implementation of Triton for Ascend.Command
SGLang Kernels NPU
We provide SGL kernels for Ascend NPU, check installation guide.Gemma-family models (including Qwen3.5) call
sgl_kernel_npu.norm.gemma_rmsnorm,
whose implementation is chosen when the wheel is built: the native torch_npu
operator for A2/A3 series, and ACLNN RMSNorm for 950PR/DT series, which does not
register that operator. 950PR/DT series must install the 950 release
package (950 appears in the asset name), or build from source with
bash build.sh -a kernels Ascend950PR_9599, the target that package is built
with. On 950PR/DT, an a2 or a3 package fails on the first Gemma forward,
and so does a package from a release that predates this module; check with
python -c "import sgl_kernel_npu.norm.gemma_rmsnorm".DeepEP-compatible Library
We provide a DeepEP-compatible Library as a drop-in replacement of deepseek-ai’s DeepEP library, check the installation guide. It is optional and needed only when serving MoE models with expert parallelism through--moe-a2a-backend deepep; plain TP deployments can skip it.
Additional dependencies
Command
Installing SGLang from source
Command
Method 2: Using Docker Image
Obtain Image
You can download the SGLang image or build an image based on Dockerfile to obtain the Ascend NPU image.- Download SGLang image
- A3 Series
- 950PR/DT Series
Command
- Build an image based on Dockerfile
Command
Create Docker Container
Notice:--privileged and --network=host are required by RDMA, which is typically needed by Ascend NPU clusters.
Model weights: set HF_TOKEN to download automatically, or replace the model ID in --model-path with a local
weights path — see How do I provide model weights? in the FAQ.
- A3 Series
- 950PR/DT Series
Command
System Settings
CPU performance power scheme
The default power scheme on Ascend hardware isondemand which could affect performance, changing it to performance is recommended.
Command
Disable NUMA balancing
The kernel’s background NUMA page migration adds memory-bandwidth overhead and latency jitter to SGLang’s large resident working set (weights and KV cache); disabling it keeps serving latency stable.Command
Prevent swapping out system memory
Command
Running SGLang Service
Running Service For Large Language Models
Pick a deployment mode based on your workload:| Mode | Characteristics | Recommended scenarios |
|---|---|---|
| PD mixed | Prefill and decode in one server: single process, no router, requests go straight to the server; heavy prefill batches share hardware with decode and can raise inter-token latency | Getting started, small to medium scale, no strict inter-token-latency requirement |
| PD disaggregation | Dedicated prefill and decode pools behind a router, KV cache transferred over the network (requires MemFabric-Hybrid); each phase scales and tunes independently, at the cost of more components and nodes | Large scale, long prompts, high concurrency, where stable inter-token latency matters |
PD Mixed Scene
Model weights: setHF_TOKEN to download automatically, or replace the model ID in --model-path with a local
weights path — see How do I provide model weights? in the FAQ.
- A3 Series
- 950PR/DT Series
Command
meta-llama/Llama-3.1-8B-Instruct. To run another model, change the --model-path value and
make sure it is listed in Supported Models.
PD Disaggregation Scene
PD disaggregation requires the prefill server, the decode server, and the router to communicate with one another. Make sure the hosts can reach one another over the network and that thePREFILL_IP:FREE_PORT store address is
accessible from every node. The example below runs all three on a single machine, each using its own port and NPU
(via --base-gpu-id); the same steps apply to a multi-node cluster, provided the hosts can reach one another.
- Launch Prefill Server
HF_TOKEN to download automatically, or replace the model ID in --model-path with a local
weights path — see How do I provide model weights? in the FAQ.
- A3 Series
- 950PR/DT Series
Command
- Launch Decode Server
HF_TOKEN to download automatically, or replace the model ID in --model-path with a local
weights path — see How do I provide model weights? in the FAQ.
- A3 Series
- 950PR/DT Series
Command
- Launch Router
sglang-router package. It is pre-installed in the Docker image; if you installed
SGLang from source and do not have it yet, run pip install sglang-router first.
Command
The
8995 in command script is the disaggregation bootstrap port. It must match the
--disaggregation-bootstrap-port value set on the prefill server in step 1.Running Service For Multimodal Language Models
PD Mixed Scene
Model weights: setHF_TOKEN to download automatically, or replace the model ID in --model-path with a local
weights path — see How do I provide model weights? in the FAQ.
- A3 Series
- 950PR/DT Series
Command
Qwen/Qwen3-VL-30B-A3B-Instruct. For other multimodal models, see the multimodal section of
Supported Models.
Testing the Service
Once the server printsThe server is fired up and ready to roll! in the logs, it is ready to accept requests.
Which port to send requests to
The port you use depends on your deployment mode:Health Check
Command
Generate (Native Endpoint)
Command
Chat Completions (OpenAI-Compatible)
Command
Command
Multimodal Chat Completions
The image URL in the example below references an external resource (
raw.githubusercontent.com). Make sure the server has internet access so the image can be downloaded at inference time. Alternatively, you can use a locally accessible URL or base64-encoded image data.Command
FAQ
How do I provide model weights?
The launch commands in this guide pass a Hugging Face model ID (e.g.,meta-llama/Llama-3.1-8B-Instruct) to
--model-path. Pick one way to provide the weights:
- Automatic download: export
HF_TOKEN(required for gated models such as Llama) and let SGLang download the weights from Hugging Face on first launch; they are cached under~/.cache/huggingfaceand reused afterwards. - Pre-downloaded weights: download the weights to the machine yourself, then replace the model ID in the commands
with the local weights path, e.g.,
--model-path /path/to/Llama-3.1-8B-Instruct.
drun alias mounts ~/.cache/ from the host, so weights already in the host’s Hugging
Face cache are visible inside the container.
