昇腾NPU上DeepSeek-V3.2的PD分离部署配置
该资料给出DeepSeek-V3.2在昇腾A3系列NPU上的低延迟与高吞吐基准结果,并说明PD分离模式下prefill节点的启动参数、环境变量与系统调优项,强调需使用指定镜像版本。
本页面主要介绍Ascend DeepSeek-V3.2在Ascend NPU上的最佳配置和基准结果. 关于环境设置,模型重量下载,特性配置,以及部署指令等,参见: [DeepSeek-V3.2 模式教程](<https://docs.sglang.io/docs/hardware-platforms/ascend-npus/model-deployment/tutorials/deepseek_v3_2>). 在A3系列上,每张卡片都有2死亡,所以 `--tp-size` 是牌数的两倍;见 [调试 NPU 参考](<https://docs.sglang.io/docs/hardware-platforms/ascend-npus/reference/glossary#hardware>) 详细情况。 本页面上的最佳配置用图像验证 `quay.io/ascend/sglang:v0.5.18-cann9.0.0-a3`。准确使用此版本;本页面不覆盖后期版本,可能会引入断开的更改。 ### 低纬度 | 型号 | 硬件 | 纸牌 | 部署模式 | 数据集 | TPOT | 量化 | 配置 | | --- | --- | --- | --- | --- | --- | --- | --- | | DeepSeek-V3.2 | A3系列产品 | 32 | PD 分类 | 128k+1k | 26分钟 | W8A8 INT8 | [优化配置](<https://docs.sglang.io/docs/hardware-platforms/ascend-npus/model-deployment/best-practices/deepseek_v3_2#deepseek-v3-2-w8a8-1p1d-32p-in128k-out1k-26ms>) | | DeepSeek-V3.2 | A3系列产品 | 32 | PD 分类 | 128k+1k | 26分钟 | W8A8 INT8 | [优化配置](<https://docs.sglang.io/docs/hardware-platforms/ascend-npus/model-deployment/best-practices/deepseek_v3_2#deepseek-v3-2-w8a8-1p1d-32p-in128k-out1k-bs8>) | ### 高吞吐量 | 型号 | 硬件 | 纸牌 | 部署模式 | 数据集 | TPOT | 量化 | 配置 | | --- | --- | --- | --- | --- | --- | --- | --- | | DeepSeek-V3.2 | A3系列产品 | 32 | PD 分类 | 128k+1k | 107亿 | W8A8 INT8 | [优化配置](<https://docs.sglang.io/docs/hardware-platforms/ascend-npus/model-deployment/best-practices/deepseek_v3_2#deepseek-v3-2-w8a8-1p1d-32p-in128k-out1k-bs16>) | ## 优化配置 ### DeepSeek-V3.2 W8A8 1P1D 32P IN128K OUT1K 26ms (英语). **型号**: DeepSeek-V3.2 **硬件**: A3系列产品. **纸牌**: 32 **部署模式**: PD 分类 **量化**: W8A8 INT8 **数据集**: 128k+1k **TPOT**: 26分钟 #### 示范部署 命令 ``` # ============================================================ # Before running, update the following variables: # P_IP: prefill node IP address # D_IP: decode node IP address # ASCEND_MF_STORE_URL: prefill node IP with port # MODEL_PATH: path to the model weights directory # HCCL_SOCKET_IFNAME: network interface name for HCCL # GLOO_SOCKET_IFNAME: network interface name for Gloo # ============================================================ echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor sysctl -w vm.swappiness=0 sysctl -w kernel.numa_balancing=0 sysctl -w kernel.sched_migration_cost_ns=50000 unset https_proxy unset http_proxy unset HTTPS_PROXY unset HTTP_PROXY unset ASCEND_LAUNCH_BLOCKING source /usr/local/Ascend/ascend-toolkit/set_env.sh source /usr/local/Ascend/nnal/atb/set_env.sh export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True export SGLANG_SET_CPU_AFFINITY=1 export STREAMS_PER_DEVICE=32 P_IP=('<your prefill ip1>' '<your prefill ip2>') D_IP=('<your decode ip1>' '<your decode ip2>') export ASCEND_MF_STORE_URL="tcp://<your prefill ip1>:24670" MODEL_PATH=/path/to/model-weights LOCAL_HOST1=`hostname -I|awk -F " " '{print$1}'` LOCAL_HOST2=`hostname -I|awk -F " " '{print$2}'` echo "${LOCAL_HOST1}" echo "${LOCAL_HOST2}" # prefill for i in "${!P_IP[@]}"; do if [[ "$LOCAL_HOST1" == "${P_IP[$i]}" || "$LOCAL_HOST2" == "${P_IP[$i]}" ]]; then echo "${P_IP[$i]}" export DEEPEP_HCCL_BUFFSIZE=1200 export DEEP_NORMAL_MODE_USE_INT8_QUANT=1 export GLOO_SOCKET_IFNAME=<network-interface> export HCCL_SOCKET_IFNAME=<network-interface> export TASK_QUEUE_ENABLE=2 python3 -m sglang.launch_server \ --model-path ${MODEL_PATH} \ --disaggregation-mode prefill \ --host ${P_IP[$i]} \ --port 8000 \ --dist-init-addr ${P_IP[0]}:5000 \ --disaggregation-bootstrap-port 8998 \ --node-rank $i \ --nnodes 2 \ --tp 32 \ --watchdog-timeout 9000 \ --mem-fraction-static 0.73 \ --disable-radix-cache \ --chunked-prefill-size -1 \ --max-prefill-tokens 68000 \ --max-running-requests 1 \ --moe-a2a-backend deepep \ --deepep-mode normal \ --quantization modelslim \ --disaggregation-transfer-backend ascend \ --disable-decode-cuda-graph --disable-prefill-cuda-graph \ --moe-dense-tp-size 1 \ --enable-prefill-cp \ --cp-strategy zigzag \ --attn-cp-size 32 \ --speculative-algorithm NEXTN \ --speculative-num-steps 1 \ --speculative-eagle-topk 1 \ --speculative-num-draft-tokens 2 \ --reasoning-parser deepseek-v3 \ --tool-call-parser deepseekv32 \ --trust-remote-code \ --attention-backend ascend \ --device npu break fi done # decode for i in "${!D_IP[@]}"; do if [[ "$LOCAL_HOST1" == "${D_IP[$i]}" || "$LOCAL_HOST2" == "${D_IP[$i]}" ]]; then echo "${D_IP[$i]}" export DEEPEP_HCCL_BUFFSIZE=400 export GLOO_SOCKET_IFNAME=<network-interface> export HCCL_SOCKET_IFNAME=<network-interface> export SGLANG_DEEPEP_NUM_MAX_DISPATCH_TOKENS_PER_RANK=8 export SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1 export SGLANG_SCHEDULER_SKIP_ALL_GATHER=1 export TASK_QUEUE_ENABLE=0 python3 -m sglang.launch_server \ --model-path ${MODEL_PATH} \ --disaggregation-mode decode \ --host ${D_IP[$i]} \ --port 8001 \ --dist-init-addr ${D_IP[0]}:5000 \ --node-rank $i \ --nnodes 2 \ --tp 32 \ --enable-dp-attention --dp-size 8 \ --ep 32 \ --moe-dense-tp-size 1 \ --enable-dp-lm-head \ --watchdog-timeout 9000 \ --mem-fraction-static 0.79 \ --disable-radix-cache \ --chunked-prefill-size -1 \ --max-prefill-tokens 68000 \ --max-running-requests 32 \ --cuda-graph-max-bs-decode 4 \ --moe-a2a-backend deepep \ --deepep-mode low_latency \ --quantization modelslim \ --speculative-algorithm NEXTN \ --speculative-num-steps 3 \ --speculative-eagle-topk 1 \ --speculative-num-draft-tokens 4 \ --disaggregation-transfer-backend ascend \ --reasoning-parser deepseek-v3 \ --tool-call-parser deepseekv32 \ --trust-remote-code \ --attention-backend ascend \ --device npu break fi done ``` 命令 ``` # ============================================================ # Before running, replace the following placeholders: # <your prefill ip>: prefill node IP address # <your decode ip1>: first decode node IP address (decode may have distributed nodes) # /path/to/model-weights: the MODEL_PATH the workers were launched with # ============================================================ sgl-router \ --model-id /path/to/model-weights \ --no-tokenizer \ --worker-urls http://<your prefill ip>:8000 http://<your decode ip1>:8001 \ --host 127.0.0.1 \ --port 6688 \ --request-timeout-secs 1800 \ --stale-request-timeout-secs 1800 ``` #### 基准 我们测试它基于 `RANDOM` 数据集。 命令 ``` python -m sglang.benchmark.serving \ --dataset-name random \ --backend sglang \ --host 127.0.0.1 \ --port 6688 \ --max-concurrency 8 \ --num-prompts 8 \ --random-input-len 131072 \ --random-output-len 1024 \ --random-range-ratio 1 \ --seed 1 ``` ### DeepSeek-V3.2 W8A8 1P1D 32P IN128K OUT1K BS16 **型号**: DeepSeek-V3.2 **硬件**: A3系列产品. **纸牌**: 32 **部署模式**: PD 分类 **量化**: W8A8 INT8 **数据集**: 128k+1k **TPOT**: 107米口径 #### 示范部署 命令 ``` # ============================================================ # Before running, update the following variables: # P_IP: prefill node IP address # D_IP: decode node IP address # ASCEND_MF_STORE_URL: prefill node IP with port # MODEL_PATH: path to the model weights directory # HCCL_SOCKET_IFNAME: network interface name for HCCL # GLOO_SOCKET_IFNAME: network interface name for Gloo # ============================================================ echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor sysctl -w vm.swappiness=0 sysctl -w kernel.numa_balancing=0 sysctl -w kernel.sched_migration_cost_ns=50000 unset https_proxy unset http_proxy unset HTTPS_PROXY unset HTTP_PROXY unset ASCEND_LAUNCH_BLOCKING source /usr/local/Ascend/ascend-toolkit/set_env.sh source /usr/local/Ascend/nnal/atb/set_env.sh export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True export SGLANG_SET_CPU_AFFINITY=1 export STREAMS_PER_DEVICE=32 P_IP=('<your prefill ip1>' '<your prefill ip2>') D_IP=('<your decode ip1>' '<your decode ip2>') export ASCEND_MF_STORE_URL="tcp://<your prefill ip1>:24670" MODEL_PATH=/path/to/model-weights LOCAL_HOST1=`hostname -I|awk -F " " '{print$1}'` LOCAL_HOST2=`hostname -I|awk -F " " '{print$2}'` echo "${LOCAL_HOST1}" echo "${LOCAL_HOST2}" # prefill for i in "${!P_IP[@]}"; do if [[ "$LOCAL_HOST1" == "${P_IP[$i]}" || "$LOCAL_HOST2" == "${P_IP[$i]}" ]]; then echo "${P_IP[$i]}" export DEEPEP_HCCL_BUFFSIZE=1200 export DEEP_NORMAL_MODE_USE_INT8_QUANT=1 export GLOO_SOCKET_IFNAME=<network-interface> export HCCL_SOCKET_IFNAME=<network-interface> export TASK_QUEUE_ENABLE=2 python3 -m sglang.launch_server \ --model-path ${MODEL_PATH} \ --disaggregation-mode prefill \ --host ${P_IP[$i]} \ --port 8000 \ --dist-init-addr ${P_IP[0]}:5000 \ --disaggregation-bootstrap-port 8998 \ --node-rank $i \ --nnodes 2 \ --tp 32 \ --watchdog-timeout 9000 \ --mem-fraction-static 0.73 \ --disable-radix-cache \ --chunked-prefill-size -1 \ --max-prefill-tokens 68000 \ --max-running-requests 1 \ --moe-a2a-backend deepep \ --deepep-mode normal \ --quantization modelslim \ --disaggregation-transfer-backend ascend \ --disable-decode-cuda-graph --disable-prefill-cuda-graph \ --moe-dense-tp-size 1 \ --enable-prefill-cp \ --cp-strategy zigzag \ --attn-cp-size 32 \ --speculative-algorithm NEXTN \ --speculative-num-steps 1 \ --speculative-eagle-topk 1 \ --speculative-num-draft-tokens 2 \ --reasoning-parser deepseek-v3 \ --tool-call-parser deepseekv32 \ --trust-remote-code \ --attention-backend ascend \ --device npu break fi done # decode for i in "${!D_IP[@]}"; do if [[ "$LOCAL_HOST1" == "${D_IP[$i]}" || "$LOCAL_HOST2" == "${D_IP[$i]}" ]]; then echo "${D_IP[$i]}" export DEEPEP_HCCL_BUFFSIZE=400 export GLOO_SOCKET_IFNAME=<network-interface> export HCCL_SOCKET_IFNAME=<network-interface> export SGLANG_DEEPEP_NUM_MAX_DISPATCH_TOKENS_PER_RANK=8 export SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1 export SGLANG_SCHEDULER_SKIP_ALL_GATHER=1 export TASK_QUEUE_ENABLE=0 python3 -m sglang.launch_server \ --model-path ${MODEL_PATH} \ --disaggregation-mode decode \ --host ${D_IP[$i]} \ --port 8001 \ --dist-init-addr ${D_IP[0]}:5000 \ --node-rank $i \ --nnodes 2 \ --tp 32 \ --enable-dp-attention --dp-size 8 \ --ep 32 \ --moe-dense-tp-size 1 \ --enable-dp-lm-head \ --watchdog-timeout 9000 \ --mem-fraction-static 0.79 \ --disable-radix-cache \ --chunked-prefill-size -1 \ --max-prefill-tokens 68000 \ --max-running-requests 32 \ --cuda-graph-max-bs-decode 4 \ --moe-a2a-backend deepep \ --deepep-mode low_latency \ --quantization modelslim \ --speculative-algorithm NEXTN \ --speculative-num-steps 3 \ --speculative-eagle-topk 1 \ --speculative-num-draft-tokens 4 \ --disaggregation-transfer-backend ascend \ --reasoning-parser deepseek-v3 \ --tool-call-parser deepseekv32 \ --trust-remote-code \ --attention-backend ascend \ --device npu break fi done ``` 命令 ``` # ============================================================ # Before running, replace the following placeholders: # <your prefill ip>: prefill node IP address # <your decode ip1>: first decode node IP address (decode may have distributed nodes) # /path/to/model-weights: the MODEL_PATH the workers were launched with # ============================================================ sgl-router \ --model-id /path/to/model-weights \ --no-tokenizer \ --worker-urls http://<your prefill ip>:8000 http://<your decode ip1>:8001 \ --host 127.0.0.1 \ --port 6688 \ --request-timeout-secs 1800 \ --stale-request-timeout-secs 1800 ``` #### 基准 我们测试它基于 `RANDOM` 数据集。 命令 ``` python -m sglang.benchmark.serving \ --dataset-name random \ --backend sglang \ --host 127.0.0.1 \ --port 6688 \ --max-concurrency 16 \ --num-prompts 16 \ --random-input-len 131072 \ --random-output-len 1024 \ --random-range-ratio 1 ``` ### DeepSeek-V3.2 W8A8 1P1D 32P IN128K OUT1K BS8 **型号**: DeepSeek-V3.2 **硬件**: A3系列产品. **纸牌**: 32 **部署模式**: PD 分类 **量化**: W8A8 INT8 **数据集**: 128k+1k **TPOT**: 26分钟 #### 示范部署 命令 ``` # ============================================================ # Before running, update the following variables: # P_IP: prefill node IP address # D_IP: decode node IP address # ASCEND_MF_STORE_URL: prefill node IP with port # MODEL_PATH: path to the model weights directory # HCCL_SOCKET_IFNAME: network interface name for HCCL # GLOO_SOCKET_IFNAME: network interface name for Gloo # ============================================================ echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor sysctl -w vm.swappiness=0 sysctl -w kernel.numa_balancing=0 sysctl -w kernel.sched_migration_cost_ns=50000 unset https_proxy unset http_proxy unset HTTPS_PROXY unset HTTP_PROXY unset ASCEND_LAUNCH_BLOCKING source /usr/local/Ascend/ascend-toolkit/set_env.sh source /usr/local/Ascend/nnal/atb/set_env.sh export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True export SGLANG_SET_CPU_AFFINITY=1 export STREAMS_PER_DEVICE=32 P_IP=('<your prefill ip1>' '<your prefill ip2>') D_IP=('<your decode ip1>' '<your decode ip2>') export ASCEND_MF_STORE_URL="tcp://<your prefill ip1>:24670" MODEL_PATH=/path/to/model-weights LOCAL_HOST1=`hostname -I|awk -F " " '{print$1}'` LOCAL_HOST2=`hostname -I|awk -F " " '{print$2}'` echo "${LOCAL_HOST1}" echo "${LOCAL_HOST2}" # prefill for i in "${!P_IP[@]}"; do if [[ "$LOCAL_HOST1" == "${P_IP[$i]}" || "$LOCAL_HOST2" == "${P_IP[$i]}" ]]; then echo "${P_IP[$i]}" export DEEPEP_HCCL_BUFFSIZE=1200 export DEEP_NORMAL_MODE_USE_INT8_QUANT=1 export GLOO_SOCKET_IFNAME=<network-interface> export HCCL_SOCKET_IFNAME=<network-interface> export TASK_QUEUE_ENABLE=2 python3 -m sglang.launch_server \ --model-path ${MODEL_PATH} \ --disaggregation-mode prefill \ --host ${P_IP[$i]} \ --port 8000 \ --dist-init-addr ${P_IP[0]}:5000 \ --disaggregation-bootstrap-port 8998 \ --node-rank $i \ --nnodes 2 \ --tp 32 \ --watchdog-timeout 9000 \ --mem-fraction-static 0.73 \ --disable-radix-cache \ --chunked-prefill-size -1 \ --max-prefill-tokens 68000 \ --max-running-requests 1 \ --moe-a2a-backend deepep \ --deepep-mode normal \ --quantization modelslim \ --disaggregation-transfer-backend ascend \ --disable-decode-cuda-graph --disable-prefill-cuda-graph \ --moe-dense-tp-size 1 \ --enable-prefill-cp \ --cp-strategy zigzag \ --attn-cp-size 32 \ --speculative-algorithm NEXTN \ --speculative-num-steps 1 \ --speculative-eagle-topk 1 \ --speculative-num-draft-tokens 2 \ --reasoning-parser deepseek-v3 \ --tool-call-parser deepseekv32 \ --trust-remote-code \ --attention-backend ascend \ --device npu break fi done # decode for i in "${!D_IP[@]}"; do if [[ "$LOCAL_HOST1" == "${D_IP[$i]}" || "$LOCAL_HOST2" == "${D_IP[$i]}" ]]; then echo "${D_IP[$i]}" export DEEPEP_HCCL_BUFFSIZE=400 export GLOO_SOCKET_IFNAME=<network-interface> export HCCL_SOCKET_IFNAME=<network-interface> export SGLANG_DEEPEP_NUM_MAX_DISPATCH_TOKENS_PER_RANK=8 export SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1 export SGLANG_SCHEDULER_SKIP_ALL_GATHER=1 export TASK_QUEUE_ENABLE=0 python3 -m sglang.launch_server \ --model-path ${MODEL_PATH} \ --disaggregation-mode decode \ --host ${D_IP[$i]} \ --port 8001 \ --dist-init-addr ${D_IP[0]}:5000 \ --node-rank $i \ --nnodes 2 \ --tp 32 \ --enable-dp-attention --dp-size 8 \ --ep 32 \ --moe-dense-tp-size 1 \ --enable-dp-lm-head \ --watchdog-timeout 9000 \ --mem-fraction-static 0.79 \ --disable-radix-cache \ --chunked-prefill-size -1 \ --max-prefill-tokens 68000 \ --max-running-requests 32 \ --cuda-graph-max-bs-decode 4 \ --moe-a2a-backend deepep \ --deepep-mode low_latency \ --quantization modelslim \ --speculative-algorithm NEXTN \ --speculative-num-steps 3 \ --speculative-eagle-topk 1 \ --speculative-num-draft-tokens 4 \ --disaggregation-transfer-backend ascend \ --reasoning-parser deepseek-v3 \ --tool-call-parser deepseekv32 \ --trust-remote-code \ --attention-backend ascend \ --device npu break fi done ``` 命令 ``` # ============================================================ # Before running, replace the following placeholders: # <your prefill ip>: prefill node IP address # <your decode ip1>: first decode node IP address (decode may have distributed nodes) # /path/to/model-weights: the MODEL_PATH the workers were launched with # ============================================================ sgl-router \ --model-id /path/to/model-weights \ --no-tokenizer \ --worker-urls http://<your prefill ip>:8000 http://<your decode ip1>:8001 \ --host 127.0.0.1 \ --port 6688 \ --request-timeout-secs 1800 \ --stale-request-timeout-secs 1800 ``` #### 基准 我们测试它基于 `RANDOM` 数据集。 命令 ``` python -m sglang.benchmark.serving \ --dataset-name random \ --backend sglang \ --host 127.0.0.1 \ --port 6688 \ --max-concurrency 8 \ --num-prompts 8 \ --random-input-len 131072 \ --random-output-len 1024 \ --random-range-ratio 1 ``` 这页有用吗?
查看原始来源