Kimi-K2.6¶
1 简介¶
Kimi K2.6 是一个开源的原生多模态智能体模型,通过在 Kimi-K2-Base 基础上持续预训练约15万亿混合视觉和文本token构建而成。它无缝集成了视觉和语言理解能力,具备高级智能体能力、即时和思考模式,以及对话和智能体范式。
本文档将展示该模型的主要验证步骤,包括支持的特性、特性配置、环境准备、单节点和多节点部署、精度及性能评估。
本文档基于 vLLM-Ascend v0.20.0rc1 进行验证和编写。当前模型(Kimi-K2.6)在该版本中首次获得支持。
2 支持的特性¶
请参考支持的特性获取模型支持的特性矩阵。
请参考特性指南获取特性的配置信息。
3 前提条件¶
3.1 模型权重¶
Kimi-K2.6-w4a8(w4a8量化版本):需要1个 Atlas 800 A3(64G × 16)节点或2个 Atlas 800 A2(64G × 8)节点。下载模型权重。kimi-k2.6-eagle3(用于加速Kimi-K2.6推理的Eagle3 MTP草稿模型):下载模型权重Kimi-K2.5-DFlash(一种投机解码框架,利用轻量级块扩散模型进行并行草稿生成):下载模型权重
建议将模型权重下载到多节点共享目录,例如 /root/.cache/。
3.2 验证多节点通信(可选)¶
如果要部署多节点环境,需要按照验证多节点通信环境验证多节点通信。
4 安装¶
4.1 Docker镜像安装¶
根据机器类型选择镜像并在节点上启动docker镜像,请参考使用docker。
在每个节点上启动docker镜像。
export IMAGE=quay.io/ascend/vllm-ascend:v0.22.1rc1-a3
docker run --rm \
--name vllm-ascend \
--shm-size=1g \
--net=host \
--privileged=true \
--device /dev/davinci0 \
--device /dev/davinci1 \
--device /dev/davinci2 \
--device /dev/davinci3 \
--device /dev/davinci4 \
--device /dev/davinci5 \
--device /dev/davinci6 \
--device /dev/davinci7 \
--device /dev/davinci8 \
--device /dev/davinci9 \
--device /dev/davinci10 \
--device /dev/davinci11 \
--device /dev/davinci12 \
--device /dev/davinci13 \
--device /dev/davinci14 \
--device /dev/davinci15 \
--device /dev/davinci_manager \
--device /dev/devmm_svm \
--device /dev/hisi_hdc \
-v /usr/local/dcmi:/usr/local/dcmi \
-v /usr/local/Ascend/driver/tools/hccn_tool:/usr/local/Ascend/driver/tools/hccn_tool \
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
-v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \
-v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \
-v /etc/ascend_install.info:/etc/ascend_install.info \
-v /root/.cache:/root/.cache \
-it $IMAGE bash
Start the docker image on your each node.
export IMAGE=quay.io/ascend/vllm-ascend:v0.22.1rc1
docker run --rm \
--name vllm-ascend \
--shm-size=1g \
--net=host \
--privileged=true \
--device /dev/davinci0 \
--device /dev/davinci1 \
--device /dev/davinci2 \
--device /dev/davinci3 \
--device /dev/davinci4 \
--device /dev/davinci5 \
--device /dev/davinci6 \
--device /dev/davinci7 \
--device /dev/davinci_manager \
--device /dev/devmm_svm \
--device /dev/hisi_hdc \
-v /usr/local/dcmi:/usr/local/dcmi \
-v /usr/local/Ascend/driver/tools/hccn_tool:/usr/local/Ascend/driver/tools/hccn_tool \
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
-v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \
-v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \
-v /etc/ascend_install.info:/etc/ascend_install.info \
-v /root/.cache:/root/.cache \
-it $IMAGE bash
After a successful docker run, you can verify the running container service by executing the docker ps command.
4.2 Source Code Installation¶
If you don't want to use the docker image as above, you can also build all from source:
- Install
vllm-ascendfrom source, refer to installation.
If you want to deploy multi-node environment, you need to set up environment on each node.
To use the tool_calls feature, please ensure that your transformers version is 4.57.6 or lower. If vllm-ascend has been upgraded to v0.21 or later, this requirement no longer applies.
5 Online Service Deployment¶
5.1 Single-Node Online Deployment¶
Single-node deployment completes both Prefill and Decode within the same node. The quantized model Kimi-K2.6-w4a8 可以部署在1个 Atlas 800 A3(64G × 16)上。
虽然单节点设置支持所有输入/输出场景,但建议考虑部署多节点以获得最佳性能。
启动命令:
#!/bin/sh
export HCCL_OP_EXPANSION_MODE="AIV"
export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True
export OMP_PROC_BIND=false
export OMP_NUM_THREADS=1
export TASK_QUEUE_ENABLE=1
export VLLM_ASCEND_ENABLE_MLAPO=1
# [Optional] jemalloc
# jemalloc is for better performance, if `libjemalloc.so` is installed on your machine, you can turn it on.
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2:$LD_PRELOAD
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
export HCCL_BUFFSIZE=800
export VLLM_ASCEND_ENABLE_FLASHCOMM1=1
export VLLM_ASCEND_BALANCE_SCHEDULING=1
vllm serve Eco-Tech/Kimi-K2.6-W4A8 \
--quantization ascend \
--served-model-name kimi_k26 \
--allowed-local-media-path / \
--trust-remote-code \
--tensor-parallel-size 4 \
--data-parallel-size 4 \
--no-enable-prefix-caching \
--enable-expert-parallel \
--port 8088 \
--max-num-seqs 4 \
--max-model-len 32768 \
--max-num-batched-tokens 16384 \
--gpu-memory-utilization 0.9 \
--seed 42 \
--compilation-config '{"cudagraph_mode":"FULL_DECODE_ONLY"}' \
--mm-processor-cache-gb 0 \
--mm-encoder-tp-mode data \
--speculative-config '{"method": "dflash","model": "z-lab/Kimi-K2.5-DFlash", "num_speculative_tokens": 15}'
关键参数说明:
- 设置环境变量
VLLM_ASCEND_BALANCE_SCHEDULING=1启用平衡调度。这有助于在v1调度器中增加输出吞吐量并降低TPOT。但在某些场景下TTFT可能会下降。此外,在PD分离的场景下不建议启用此特性。 --max-model-len指定最大上下文长度,即单个请求的输入和输出token之和。对于输入长度3.5K、输出长度1.5K的性能测试,16384的值就足够了,但对于精度测试,请至少设置为35000。--no-enable-prefix-caching表示禁用前缀缓存。要启用它,请移除该选项。--mm-encoder-tp-mode指示如何使用张量并行(TP)优化多模态编码器推理。如果要测试多模态输入,建议使用data。- 如果使用w4a8权重,更多内存将分配给kvcache,可以尝试增加系统吞吐量以获得更大的吞吐。
Common Issues Tip: If you encounter issues, please refer to the Public FAQ for troubleshooting.
服务验证:
curl http://<node_ip>:8088/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "kimi_k26",
"messages": [{
"role": "user",
"content": [
{
"type": "text",
"text": "The future of AI is"
}]
}],
"max_tokens": 1024,
"temperature": 1.0,
"top_p": 0.95
}'
预期结果:
服务返回HTTP 200 OK,JSON响应中包含 choices 字段。示例输出(内容已截断):
{
"id": "chatcmpl-9df13fd5e539af93",
"object": "chat.completion",
"created": 1780971952,
"model": "kimi_k26",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The future of AI is not a destination we are passively approaching, but a design problem we are actively solving right now...",
"reasoning": "The user is asking for my thoughts on \"The future of AI is\"...",
"refusal": null,
"annotations": null,
"audio": null,
"function_call": null
},
"logprobs": null,
"finish_reason": "length",
"stop_reason": null,
"token_ids": null
}
],
"usage": {
"prompt_tokens": 13,
"total_tokens": 1037,
"completion_tokens": 1024,
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": null,
"accepted_prediction_tokens": null,
"rejected_prediction_tokens": null
}
}
}
5.2 多节点PD分离部署¶
建议使用Mooncake进行部署:Mooncake。
在标准单节点部署模式下,Prefill(提示处理)和Decode(token生成)任务运行在同一组NPU上。这可能导致两个问题:
- Prefill抢占中断Decode:Prefill是计算密集型任务,一次性处理整个输入上下文,而Decode逐个生成token。当新用户请求到达时,其Prefill阶段可能抢占并中断正在进行的Decode任务,导致抖动和更高的每输出token时间(TPOT)延迟。
- 资源分配不灵活:Prefill和Decode具有根本不同的计算特性——Prefill是计算密集型和内存带宽密集型的,而Decode是内存带宽受限的。在相同硬件上运行它们会迫使做出折中,无法最优满足任何一方。
PD(Prefill-Decode)分离通过在专用节点组上运行Prefill和Decode来解决这些问题,每个节点组独立配置:
-
**Prefill节点**专注于高吞吐提示处理,针对计算和通信进行优化(例如,启用FlashComm进行Allreduce加速)。
-
**Decode节点**专注于低延迟token生成,针对内存带宽进行优化(例如,启用MLAPO融合算子)。
此架构推荐用于具有并发多用户工作负载的生产部署,其中需要稳定的延迟和高吞吐量。
以Atlas 800 A3(64G × 16)为例,建议部署2P1D(4个节点)而不是1P1D(2个节点),因为在1P1D情况下没有足够的NPU内存来服务高并发。
Kimi-K2.6-w4a8 2P1D:需要4个Atlas 800 A3(64G × 16)节点。
要运行vllm-ascend的Prefill-Decode Disaggregation服务,需要在每个节点上部署launch_online_dp.py脚本和run_dp_template.sh脚本,并在prefill主节点上部署proxy.sh脚本来转发请求。
-
launch_online_dp.pyto launch external dp vllm servers. launch_online_dp.py参数说明:
参数 类型 必填 默认值 描述 --dp-sizeint 是 - 数据并行大小(所有节点上的DP rank总数)。 --tp-sizeint 否 1 每个DP rank内的张量并行大小。 --dp-size-localint 否 (与 --dp-size相同)当前节点上的DP rank数量。如果未设置,默认为 --dp-size。--dp-rank-startint 否 0 此节点上数据并行rank的起始偏移量。 --dp-addressstr 是 - 数据并行主节点(节点0)的IP地址。 --dp-rpc-portstr 否 12345 数据并行主节点通信的RPC端口。 --vllm-start-portint 否 9000 此节点上每个vLLM引擎实例的起始端口。每个DP rank的引擎端口 = vllm_start_port+ 本地rank索引。 -
Prefill节点0的
run_dp_template.sh脚本# this obtained through ifconfig # nic_name is the network interface name corresponding to local_ip of the current node nic_name="xxx" local_ip="141.xx.xx.1" # The value of node0_ip must be consistent with the value of local_ip set in node0 (master node) node0_ip="xxxx" export HCCL_IF_IP=$local_ip export GLOO_SOCKET_IFNAME=$nic_name export TP_SOCKET_IFNAME=$nic_name export HCCL_SOCKET_IFNAME=$nic_name # [Optional] jemalloc # jemalloc is for better performance, if `libjemalloc.so` is installed on your machine, you can turn it on. export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2:$LD_PRELOAD echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor sysctl -w vm.swappiness=0 sysctl -w kernel.numa_balancing=0 sysctl kernel.sched_migration_cost_ns=50000 export VLLM_RPC_TIMEOUT=3600000 export VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS=30000 export HCCL_OP_EXPANSION_MODE="AIV" export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True export OMP_PROC_BIND=false export OMP_NUM_THREADS=1 export TASK_QUEUE_ENABLE=1 export ASCEND_BUFFER_POOL=4:8 export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/python/site-packages/mooncake:$LD_LIBRARY_PATH export HCCL_BUFFSIZE=800 export VLLM_ASCEND_ENABLE_FLASHCOMM1=1 export ASCEND_RT_VISIBLE_DEVICES=$1 vllm serve Eco-Tech/Kimi-K2.6-W4A8 \ --host 0.0.0.0 \ --port $2 \ --data-parallel-size $3 \ --data-parallel-rank $4 \ --data-parallel-address $5 \ --data-parallel-rpc-port $6 \ --tensor-parallel-size $7 \ --enable-expert-parallel \ --seed 1024 \ --quantization ascend \ --served-model-name kimi_k26 \ --trust-remote-code \ --max-num-seqs 4 \ --max-model-len 32768 \ --max-num-batched-tokens 16384 \ --no-enable-prefix-caching \ --gpu-memory-utilization 0.95 \ --enforce-eager \ --speculative-config '{"method": "eagle3", "model":"lightseekorg/kimi-k2.6-eagle3", "num_speculative_tokens": 3}' \ --mm-encoder-tp-mode data \ --kv-transfer-config \ '{"kv_connector": "MooncakeConnectorV1", "kv_role": "kv_producer", "kv_port": "30000", "engine_id": "0", "kv_connector_extra_config": { "prefill": { "dp_size": 4, "tp_size": 4 }, "decode": { "dp_size": 8, "tp_size": 4 } } }' -
Prefill Node 1
run_dp_template.shscript# this obtained through ifconfig # nic_name is the network interface name corresponding to local_ip of the current node nic_name="xxx" local_ip="141.xx.xx.2" # The value of node0_ip must be consistent with the value of local_ip set in node0 (master node) node0_ip="xxxx" export HCCL_IF_IP=$local_ip export GLOO_SOCKET_IFNAME=$nic_name export TP_SOCKET_IFNAME=$nic_name export HCCL_SOCKET_IFNAME=$nic_name # [Optional] jemalloc # jemalloc is for better performance, if `libjemalloc.so` is installed on your machine, you can turn it on. export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2:$LD_PRELOAD echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor sysctl -w vm.swappiness=0 sysctl -w kernel.numa_balancing=0 sysctl kernel.sched_migration_cost_ns=50000 export VLLM_RPC_TIMEOUT=3600000 export VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS=30000 export HCCL_OP_EXPANSION_MODE="AIV" export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True export OMP_PROC_BIND=false export OMP_NUM_THREADS=1 export TASK_QUEUE_ENABLE=1 export ASCEND_BUFFER_POOL=4:8 export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/python/site-packages/mooncake:$LD_LIBRARY_PATH export HCCL_BUFFSIZE=800 export VLLM_ASCEND_ENABLE_FLASHCOMM1=1 export ASCEND_RT_VISIBLE_DEVICES=$1 vllm serve Eco-Tech/Kimi-K2.6-W4A8 \ --host 0.0.0.0 \ --port $2 \ --data-parallel-size $3 \ --data-parallel-rank $4 \ --data-parallel-address $5 \ --data-parallel-rpc-port $6 \ --tensor-parallel-size $7 \ --enable-expert-parallel \ --seed 1024 \ --quantization ascend \ --served-model-name kimi_k26 \ --trust-remote-code \ --max-num-seqs 4 \ --max-model-len 32768 \ --max-num-batched-tokens 16384 \ --no-enable-prefix-caching \ --gpu-memory-utilization 0.95 \ --enforce-eager \ --speculative-config '{"method": "eagle3", "model":"lightseekorg/kimi-k2.6-eagle3", "num_speculative_tokens": 3}' \ --mm-encoder-tp-mode data \ --kv-transfer-config \ '{"kv_connector": "MooncakeConnectorV1", "kv_role": "kv_producer", "kv_port": "30100", "engine_id": "1", "kv_connector_extra_config": { "prefill": { "dp_size": 4, "tp_size": 4 }, "decode": { "dp_size": 8, "tp_size": 4 } } }' -
Decode Node 0
run_dp_template.shscript# this obtained through ifconfig # nic_name is the network interface name corresponding to local_ip of the current node nic_name="xxx" local_ip="141.xx.xx.3" # The value of node0_ip must be consistent with the value of local_ip set in node0 (master node) node0_ip="xxxx" export HCCL_IF_IP=$local_ip export GLOO_SOCKET_IFNAME=$nic_name export TP_SOCKET_IFNAME=$nic_name export HCCL_SOCKET_IFNAME=$nic_name # [Optional] jemalloc # jemalloc is for better performance, if `libjemalloc.so` is installed on your machine, you can turn it on. export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2:$LD_PRELOAD echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor sysctl -w vm.swappiness=0 sysctl -w kernel.numa_balancing=0 sysctl kernel.sched_migration_cost_ns=50000 export VLLM_RPC_TIMEOUT=3600000 export VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS=30000 export HCCL_OP_EXPANSION_MODE="AIV" export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True export OMP_PROC_BIND=false export OMP_NUM_THREADS=1 export TASK_QUEUE_ENABLE=1 export ASCEND_BUFFER_POOL=4:8 export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/python/site-packages/mooncake:$LD_LIBRARY_PATH export HCCL_BUFFSIZE=800 export VLLM_ASCEND_ENABLE_MLAPO=1 export ASCEND_RT_VISIBLE_DEVICES=$1 vllm serve Eco-Tech/Kimi-K2.6-W4A8 \ --host 0.0.0.0 \ --port $2 \ --data-parallel-size $3 \ --data-parallel-rank $4 \ --data-parallel-address $5 \ --data-parallel-rpc-port $6 \ --tensor-parallel-size $7 \ --enable-expert-parallel \ --seed 1024 \ --quantization ascend \ --served-model-name kimi_k26 \ --trust-remote-code \ --max-num-seqs 8 \ --max-model-len 32768 \ --max-num-batched-tokens 32 \ --no-enable-prefix-caching \ --gpu-memory-utilization 0.91 \ --compilation-config '{"cudagraph_mode": "FULL_DECODE_ONLY"}' \ --additional-config '{"recompute_scheduler_enable":true,"multistream_overlap_shared_expert": false}' \ --speculative-config '{"method": "eagle3", "model":"lightseekorg/kimi-k2.6-eagle3", "num_speculative_tokens": 3}' \ --kv-transfer-config \ '{"kv_connector": "MooncakeConnectorV1", "kv_role": "kv_consumer", "kv_port": "30200", "engine_id": "2", "kv_connector_extra_config": { "prefill": { "dp_size": 4, "tp_size": 4 }, "decode": { "dp_size": 8, "tp_size": 4 } } }' -
Decode Node 1
run_dp_template.shscript# this obtained through ifconfig # nic_name is the network interface name corresponding to local_ip of the current node nic_name="xxx" local_ip="141.xx.xx.4" # The value of node0_ip must be consistent with the value of local_ip set in node0 (master node) node0_ip="xxxx" export HCCL_IF_IP=$local_ip export GLOO_SOCKET_IFNAME=$nic_name export TP_SOCKET_IFNAME=$nic_name export HCCL_SOCKET_IFNAME=$nic_name # [Optional] jemalloc # jemalloc is for better performance, if `libjemalloc.so` is installed on your machine, you can turn it on. export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2:$LD_PRELOAD echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor sysctl -w vm.swappiness=0 sysctl -w kernel.numa_balancing=0 sysctl kernel.sched_migration_cost_ns=50000 export VLLM_RPC_TIMEOUT=3600000 export VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS=30000 export HCCL_OP_EXPANSION_MODE="AIV" export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True export OMP_PROC_BIND=false export OMP_NUM_THREADS=1 export TASK_QUEUE_ENABLE=1 export ASCEND_BUFFER_POOL=4:8 export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/python/site-packages/mooncake:$LD_LIBRARY_PATH export HCCL_BUFFSIZE=1100 export VLLM_ASCEND_ENABLE_MLAPO=1 export ASCEND_RT_VISIBLE_DEVICES=$1 vllm serve Eco-Tech/Kimi-K2.6-W4A8 \ --host 0.0.0.0 \ --port $2 \ --data-parallel-size $3 \ --data-parallel-rank $4 \ --data-parallel-address $5 \ --data-parallel-rpc-port $6 \ --tensor-parallel-size $7 \ --enable-expert-parallel \ --seed 1024 \ --quantization ascend \ --served-model-name kimi_k26 \ --trust-remote-code \ --max-num-seqs 8 \ --max-model-len 32768 \ --max-num-batched-tokens 4 \ --no-enable-prefix-caching \ --gpu-memory-utilization 0.91 \ --compilation-config '{"cudagraph_mode": "FULL_DECODE_ONLY"}' \ --additional-config '{"recompute_scheduler_enable":true,"multistream_overlap_shared_expert": false}' \ --speculative-config '{"method": "eagle3", "model":"lightseekorg/kimi-k2.6-eagle3", "num_speculative_tokens": 3}' \ --kv-transfer-config \ '{"kv_connector": "MooncakeConnectorV1", "kv_role": "kv_consumer", "kv_port": "30300", "engine_id": "3", "kv_connector_extra_config": { "prefill": { "dp_size": 4, "tp_size": 4 }, "decode": { "dp_size": 8, "tp_size": 4 } } }'Key Parameter Descriptions:
VLLM_ASCEND_ENABLE_FLASHCOMM1=1: enables the communication optimization function on the prefill nodes.VLLM_ASCEND_ENABLE_MLAPO=1: enables the fusion operator, which can significantly improve performance but consumes more NPU memory. In the Prefill-Decode (PD) separation scenario, enable MLAPO only on decode nodes.recompute_scheduler_enable: true: enables the recomputation scheduler. When the Key-Value Cache (KV Cache) of the decode node is insufficient, requests will be sent to the prefill node to recompute the KV Cache. In the PD separation scenario, enable this configuration only on decode nodes.multistream_overlap_shared_expert: true: When the Tensor Parallelism (TP) size is 1 orenable_shared_expert_dp: true, an additional stream is enabled to overlap the computation process of shared experts for improved efficiency.
-
Run server for each node:
# p0 python launch_online_dp.py --dp-size 4 --tp-size 4 --dp-size-local 4 --dp-rank-start 0 --dp-address 141.xx.xx.1 --dp-rpc-port 12321 --vllm-start-port 7100 # p1 python launch_online_dp.py --dp-size 4 --tp-size 4 --dp-size-local 4 --dp-rank-start 0 --dp-address 141.xx.xx.2 --dp-rpc-port 12321 --vllm-start-port 7100 # d0 python launch_online_dp.py --dp-size 8 --tp-size 4 --dp-size-local 8 --dp-rank-start 0 --dp-address 141.xx.xx.3 --dp-rpc-port 12321 --vllm-start-port 7100 # d1 python launch_online_dp.py --dp-size 8 --tp-size 4 --dp-size-local 8 --dp-rank-start 8 --dp-address 141.xx.xx.3 --dp-rpc-port 12321 --vllm-start-port 7100 -
Run the
proxy.shscript on the prefill master nodeRun a proxy server on the same node with the prefiller service instance. You can get the proxy program in the repository's examples: load_balance_proxy_server_example.py
python load_balance_proxy_server_example.py \ --port 1999 \ --host 141.xx.xx.1 \ --prefiller-hosts \ 141.xx.xx.1 \ 141.xx.xx.1 \ 141.xx.xx.1 \ 141.xx.xx.1 \ 141.xx.xx.2 \ 141.xx.xx.2 \ 141.xx.xx.2 \ 141.xx.xx.2 \ --prefiller-ports \ 7100 7101 7102 7103 7100 7101 7102 7103 \ --decoder-hosts \ 141.xx.xx.3 \ 141.xx.xx.3 \ 141.xx.xx.3 \ 141.xx.xx.3 \ 141.xx.xx.4 \ 141.xx.xx.4 \ 141.xx.xx.4 \ 141.xx.xx.4 \ --decoder-ports \ 7100 7101 7102 7103 \ 7100 7101 7102 7103 \
部署验证:
PD分离服务完全启动后,通过prefill主节点上的代理端口发送请求,验证Prefill和Decode节点是否协同正常工作:
curl http://141.xx.xx.1:1999/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "kimi_k26",
"messages": [{
"role": "user",
"content": [
{
"type": "text",
"text": "The future of AI is"
}]
}],
"max_tokens": 1024,
"temperature": 1.0,
"top_p": 0.95
}'
预期结果:
代理返回HTTP 200 OK。JSON响应包含choices字段及生成的文本,确认Prefill节点已成功处理提示,Decode节点已生成响应:
{
"id": "chatcmpl-xxxxxxxxxxxxx",
"object": "chat.completion",
"model": "kimi_k26",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The future of AI is not a destination we are passively approaching...",
"finish_reason": "length"
}
}
],
"usage": {
"prompt_tokens": 13,
"total_tokens": 1037,
"completion_tokens": 1024
}
}
Common Issues Tip: If you encounter issues with PD separation deployment, please refer to the Public FAQ for troubleshooting.
6 功能验证¶
服务器启动后,您可以使用输入提示查询模型:
curl http://<node0_ip>:<port>/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "kimi_k26",
"messages": [{
"role": "user",
"content": [
{
"type": "text",
"text": "The future of AI is"
}]
}],
"max_tokens": 1024,
"temperature": 1.0,
"top_p": 0.95
}'
预期结果:
服务返回HTTP 200 OK。JSON响应包含choices字段及生成的文本,以及使用统计信息:
{
"id": "chatcmpl-9df13fd5e539af93",
"object": "chat.completion",
"created": 1780971952,
"model": "kimi_k26",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The future of AI is not a destination we are passively approaching, but a design problem we are actively solving right now...",
"reasoning": "The user is asking for my thoughts on...",
"finish_reason": "length"
}
}
],
"usage": {
"prompt_tokens": 13,
"total_tokens": 1037,
"completion_tokens": 1024
}
}
7 精度评估¶
以下是一种精度评估方法。
使用AISBench¶
-
详情请参考使用AISBench。
-
执行后可获取结果。以下是
Kimi-K2.6-w4a8中vllm-ascend:v0.20.0rc1的结果,仅供参考。
| 数据集 | 版本 | 指标 | 模式 | vllm-api-general-chat | 备注 |
|---|---|---|---|---|---|
| AIME2026 | - | 精度 | gen | 90.00 | 1 Atlas 800 A3 (64G × 16) |
| GPQA | - | 精度 | gen | 89.90 | 1 Atlas 800 A3 (64G × 16) |
| MMMU | - | 精度 | gen | 82.67 | 1 Atlas 800 A3 (64G × 16) |
8 性能评估¶
使用AISBench¶
详情请参考使用AISBench进行性能评估。
使用vLLM Benchmark¶
以Kimi-K2.6-w4a8为例运行性能评估。
更多详情请参考vllm benchmark。
vllm bench有三个子命令:
latency:基准测试单批请求的延迟。serve:基准测试在线服务吞吐量。throughput:基准测试离线推理吞吐量。
以serve为例,运行代码如下:
vllm bench serve --model Eco-Tech/Kimi-K2.6-w4a8 --dataset-name random --random-input 1024 --num-prompts 200 --request-rate 1 --save-result --result-dir ./
大约几分钟后,您可以获取性能评估结果。
9 性能调优¶
9.1 推荐配置¶
注意:以下配置在特定测试环境中验证通过,仅供参考。最优配置取决于最大输入/输出长度、前缀缓存命中率、精度要求及部署机器配比等因素,建议参考第9.2节根据实际情况进行调优。
表1:场景概览¶
*Total NPUs表示所有节点使用的NPU总数。1节点=1台Atlas 800 A3服务器(64G×16 NPU)。
| 场景 | 部署模式 | *NPU总数 | 权重版本 | 关键考量 |
|---|---|---|---|---|
| High Throughput (16K input) |
单节点混合 | 16(A3) | kimi-k2.6-w4a8 | 使用dp2 tp8平衡内存容量与计算效率 |
| High Throughput (16K input) |
1P1D部署 | 32(A3) | kimi-k2.6-w4a8 | P节点和D节点均采用dp2 tp8;平衡延迟与吞吐 |
| High Throughput (16K input) |
2P1D deployment | 64(A3) | kimi-k2.6-w4a8 | 跨节点从dp4 tp4扩展到dp8 tp4 |
| 长上下文 (128K,无前缀缓存) |
单节点混合 | 16(A3) | kimi-k2.6-w4a8 | dp1 tp16最大化TP,适应极端上下文长度 |
| 长上下文 (128K,有前缀缓存) |
单节点混合 | 16(A3) | kimi-k2.6-w4a8 | dp2 tp8优化内存带宽并提升缓存利用率 |
| 多模态 (1080P) |
单节点混合 | 16(A3) | kimi-k2.6-w4a8 | dp1 tp16用于高分辨率视觉输入 |
| 多模态 (1080P) |
1P1D部署 | 32(A3) | kimi-k2.6-w4a8 | dp2 tp8或dp16 tp1,取决于内存与并发度 |
| 多模态 (1080P) |
2P1D deployment | 64(A3) | kimi-k2.6-w4a8 | dp8 tp2到dp32 tp1,最大化重多模态工作负载的吞吐 |
表2:详细节点配置¶
| 场景 | 配置 | NPU | TP | DP | 最大模型长度 | MTP推测数量 |
|---|---|---|---|---|---|---|
| 高吞吐/低延迟(16K) | 服务器/单机 | 16 | 8 | 2 | 17K | 15 |
| 高吞吐/低延迟(16K) | Server-P节点 | 16 | 8 | 2 | 17K | 3 |
| 高吞吐/低延迟(16K) | Server-D节点 | 16 | 8 | 2 | 17K | 3 |
| 长上下文(128K,无缓存) | 服务器/单机 | 16 | 16 | 1 | 130K | 15 |
| 长上下文(128K,有缓存) | 服务器/单机 | 16 | 8 | 2 | 130K | 15 |
| 多模态(1080P) | 服务器/单机 | 16 | 16 | 1 | 17K | 15 |
| 多模态(1080P) | Server-P节点 | 16 | 8 | 2 | 17K | 3 |
| 多模态(1080P) | Server-D节点 | 16 | 1 | 16 | 17K | 3 |
完整的启动命令及参数说明请参考第5章中的部署示例。
否tice:
max-model-len and max-num-seqs need to be set according to the actual usage scenario. For other settings, please refer to the Deployment chapter.
9.2 调优指南¶
调优方法请参考公共性能调优文档。
详细功能说明请参考功能指南。
10 常见问题¶
For common environment, installation, and general parameter issues, please refer to the Public FAQ; this chapter only covers 模式l-specific issues.
- 问:tools_call功能需要什么版本的transformers?
答:要使用tools_call功能,请确保transformers版本为4.57.6或更低。如果vllm-ascend已升级到v0.21或更高版本,则不再有此要求。