本文档记录 Qwen3-0.6B 在 vLLM-Ascend 0.18.0rc1 环境的快速部署与验证结果。
Qwen3-0.6B 是通义千问 Qwen3 系列中的 Dense 小模型(0.6B 参数),采用 Qwen3ForCausalLM 架构,支持 32K 上下文长度。该模型在昇腾 NPU 上单卡即可运行,无需张量并行。
相关获取地址:
quay.io/ascend/vllm-ascend:v0.18.0rc1参考文档:
| 组件 | 版本 |
|---|---|
vllm-ascend | 0.18.0rc1 |
vllm | 0.18.0+empty |
transformers | 4.57.6 |
torch-npu | 2.9.0.post1+gitee7ba04 |
Ascend910B4 单卡Qwen/Qwen3-0.6B(ModelScope 自动下载)8000PIECEWISE(ACL Graph)模型加载信息:
| 指标 | 数值 |
|---|---|
| 权重大小 | 1.14 GB |
| 可用 KV Cache | 23.82 GiB |
| KV Cache Token 数 | 222,976 tokens |
| 最大并发数(32K context) | 6.80x |
已验证通过的启动命令(单卡,无需 Tensor Parallel):
export VLLM_USE_MODELSCOPE=true
export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True
export OMP_PROC_BIND=false
export OMP_NUM_THREADS=1
export TASK_QUEUE_ENABLE=1
vllm serve Qwen/Qwen3-0.6B \
--host 0.0.0.0 \
--port 8000 \
--tensor-parallel-size 1 \
--max-model-len 32768 \
--trust-remote-code \
--gpu-memory-utilization 0.85 \
--served-model-name qwen3-0.6b关键参数说明:
| 参数 | 值 | 说明 |
|---|---|---|
--tensor-parallel-size | 1 | 0.6B 小模型单卡即可运行,无需 TP |
--max-model-len | 32768 | Qwen3 官方上下文长度 |
--gpu-memory-utilization | 0.85 | HBM 利用率 |
VLLM_USE_MODELSCOPE=true | — | 从 ModelScope 自动下载权重 |
--trust-remote-code | — | 加载 Qwen3 自定义模型架构 |
基础检查:
curl -sf http://127.0.0.1:8000/v1/models
curl -sf http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-0.6b",
"messages": [{"role": "user", "content": "用一句话说明 TCP 和 UDP 的核心区别。"}],
"temperature": 0,
"max_tokens": 128
}'
curl -sf http://127.0.0.1:8000/v1/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-0.6b",
"prompt": "The future of AI is",
"max_tokens": 50,
"temperature": 0
}'验证结果:
| 接口 | 状态 | 说明 |
|---|---|---|
/v1/models | 200 OK | 返回模型信息,max_model_len=32768 |
/v1/chat/completions | 200 OK | 正常返回中文思考链与生成内容 |
/v1/completions | 200 OK | 正常返回英文续写文本 |
单卡即可运行:Qwen3-0.6B 权重仅约 1.14 GB,910B4 单卡无需张量并行即可流畅运行。
首次启动编译时间较长:PIECEWISE 模式首次启动需进行 ACL Graph 编译(约 1–3 分钟),编译产物会缓存到 ~/.cache/vllm/torch_compile_cache/,后续启动直接加载。
Device ID 注意:若环境中 npu-smi 显示的 NPU 编号非连续(如仅显示 NPU 2),请勿设置 ASCEND_RT_VISIBLE_DEVICES=2。torch_npu 对单卡环境使用 0-based 索引,直接不设置该变量即可。
日志目录警告:若看到 can not create directory: /home/atomgit/ascend/log 警告,不影响服务正常运行;如需消除,可预先创建该目录或设置 ASCEND_LOG_PATH 到可写路径。
镜像版本与启动参数随 vLLM Ascend 发布更新,若与官方文档冲突,以官方为准。