vllm-ascend-server

在昇腾NPU服务器上部署 vLLM 推理服务,具备自动模型发现与优化配置能力。支持在裸机、容器或 Docker 镜像中进行本地和远程部署,处理模型发现、量化自动检测、张量并行配置、图模式/即时模式选择及服务健康验证。适用于启动或部署 vLLM 服务器、启动 LLM 推理服务、配置多卡张量并行、启用推测解码或量化、运行离线批量推理,以及检查或测试服务状态。

仓库最近推送
GitHub Stars
187
Forks
67
Issues / PRs
15

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "vllm-ascend-server":https://skillpi.com/zh/skills/deepskill-635376d25e088f5c400f1ea8266d9998fb4292e3b33074d2a16200686405dbf1。安装前核对上游来源和版本:https://github.com/ascend-ai-coding/awesome-ascend-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

在昇腾NPU服务器上部署 vLLM 推理服务,具备自动模型发现与优化配置能力。支持在裸机、容器或 Docker 镜像中进行本地和远程部署,处理模型发现、量化自动检测、张量并行配置、图模式/即时模式选择及服务健康验证。适用于启动或部署 vLLM 服务器、启动 LLM 推理服务、配置多卡张量并行、启用推测解码或量化、运行离线批量推理,以及检查或测试服务状态。

0 下载

介绍来源: third_party · ascend-ai-coding · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: vllm-ascend-server
description: "Deploy vLLM inference services on Ascend NPU servers with automatic model detection and optimized configuration. Supports local and remote deployment across bare metal, containers, and Docker images. Handles model discovery, quantization auto-detection, tensor parallelism configuration, graph/eager mode selection, and service health verification. Use when users need to: (1) Start or deploy vLLM server on NPU, (2) Launch LLM inference service, (3) Configure multi-card tensor parallel deployment, (4) Enable speculative decoding (Eagle) or quantization, (5) Run vllm offline batch inference, (6) Check or test vLLM service status."

vLLM-Ascend Server Launcher

Overview

This skill deploys vLLM inference services on Ascend NPU servers with automatic model detection, quantization handling, and performance optimization.

Key Features:

  • Automatic model discovery and detection
  • Quantization auto-detection (quant_model_description.json)
  • Graph mode / Eager mode guidance
  • Container deployment support
  • Multi-card tensor parallelism

Workflow Summary

Phase 0: Platform (Local/Remote, Bare metal/Container)
    ↓
Phase 1: Environment Check (NPU, vLLM, Memory)
    ↓
Phase 2: Model Discovery (Find models, detect quantization)
    ↓
Phase 3: Gather Requirements (Port, TP size, mode selection)
    ↓
Phase 4: Generate Config (Env vars, vLLM command)
    ↓
Phase 5: Execute (Deploy and start service)
    ↓
Phase 6: Verify (Health check, test inference)

Detailed workflow: workflow-guide.md

Phase 0: Platform Confirmation

Location

1. Local - Deploy on this machine
2. Remote - Deploy via SSH (→ remote-server-guide skill)

Platform

1. Bare metal (裸机) - Virtual environment on host
2. Existing container (已有容器) - Connect to running container
3. Docker image (镜像) - Create with npu-docker-launcher

Docker image defaults:

  • Model mount: -v <model-path>:/model
  • Network: host (default) or bridge with port mapping
  • Port: 8000 (ask about mapping if bridge mode)

Phase 1: Environment Checks

# NPU check
npu-smi info

# vLLM check
pip show vllm vllm-ascend

# Memory check
npu-smi info | grep -A 5 "Memory-Usage"

Phase 1.5: NPU Availability Check

Before deployment, verify selected NPU cards are not occupied:

# Check NPU usage status
npu-smi info

# Check for running processes on specific cards
fuser -v /dev/davinci0 2>/dev/null && echo "Card 0 in use" || echo "Card 0 available"
fuser -v /dev/davinci1 2>/dev/null && echo "Card 1 in use" || echo "Card 1 available"

# Alternative: Check memory usage (high usage = occupied)
npu-smi info -t board | grep -E "NPU|Memory-Usage"

If selected cards are occupied:

## NPU Card Status

Card 0: ❌ In use (Memory: 28GB/32GB, PID: 12345)
Card 1: ✅ Available (Memory: 0GB/32GB)
Card 2: ✅ Available (Memory: 0GB/32GB)
Card 3: ❌ In use (Memory: 30GB/32GB, PID: 67890)

Selected cards [0,1] have conflicts:
- Card 0 is occupied by process 12345

Options:
1. Select different cards
2. Kill occupying process (with user confirmation)
3. Wait and retry

How to proceed? [1/2/3]

Kill process (with confirmation):

# Show what's using the card
ps aux | grep <PID>

# Confirm before killing
"Kill process <PID> (<process-name>)? [yes/no]"

# Kill if confirmed
kill -9 <PID>

Detailed NPU check: workflow-guide.md

Phase 2: Model Discovery

Search Paths

/home/weights, /home/weight, /home/data*, /data*

Recursive search for config.json to find models.

Quantization Detection

# Quantized model
[ -f "<model>/quant_model_description.json" ] → --quantization ascend

# Non-quantized model
[ ! -f "<model>/quant_model_description.json" ] → No param

Critical: Never add --quantization ascend for non-quantized models!

See quantization.md for details.

Phase 3: Configuration Selection

Key Parameters

Parameter Default Notes
Mode online online/offline
Port 8000 Default for vLLM
NPU cards 0 0,1 for TP2
TP size Auto Based on model

Graph Mode Decision

Scenario Mode Config
Production Graph --no-enforce-eager
Development Eager --enforce-eager
Debugging Eager --enforce-eager

See graph-mode.md for details.

TP Size by Model

Model Size TP Cards
≤14B 1 1
14B-70B 2-4 2-4
>70B 4-8 4-8

Phase 4: Generate Configuration

Environment Variables

Single card:

export TASK_QUEUE_ENABLE=1
export VLLM_ASCEND_ENABLE_DENSE_OPTIMIZE=1
export ASCEND_RT_VISIBLE_DEVICES=0

Multi-card:

export VLLM_USE_V1=1
export TASK_QUEUE_ENABLE=1
export ASCEND_RT_VISIBLE_DEVICES=0,1
export HCCL_BUFFSIZE=1024
export HCCL_CONNECT_TIMEOUT=600

vLLM Command Template

vllm serve /model/<model-name> \
  --host 0.0.0.0 \
  --port 8000 \
  --trust-remote-code \
  --max-num-seqs 256 \
  --max-model-len 32768 \
  --tensor-parallel-size <tp> \
  [QUANT_PARAM] \
  --gpu-memory-utilization 0.9 \
  --async-scheduling \
  --additional-config '{"enable_cpu_binding":true}' \
  --compilation-config '{"cudagraph_mode": "FULL_DECODE_ONLY"}'

QUANT_PARAM:

  • Quantized model: --quantization ascend
  • Non-quantized: (omit)

Phase 5: Execute

Display generated config, confirm with user, then execute.

Execution Methods by Platform

Persistent session (tmux): If you connected via tmux and are already inside the target environment (remote host / container / both), execute commands directly — same as bare metal.

Stateless (SSH key / sshpass / paramiko / fabric):

Platform Method
Bare metal Execute directly in shell
Existing container docker exec to run command
Remote SSH → run command
Remote container SSH → docker exec -d for background

Container Background Launch

For containers, start vLLM in background with logging:

# Inside container (bare metal / tmux already in container)
nohup vllm serve /model ... > /tmp/vllm.log 2>&1 &

# From host (stateless, background in container)
docker exec -d <container> bash -c 'cd /workspace && vllm serve /model ... 2>&1 | tee /tmp/vllm.log'

# Remote via SSH (stateless)
ssh user@host "docker exec -d <container> bash -c 'vllm serve /model ... 2>&1 | tee /tmp/vllm.log'"

Check Service Status

Inside container (bare metal / tmux already in container):

ps aux | grep vllm
tail -50 /tmp/vllm.log
tail -f /tmp/vllm.log

From host or remote (stateless, each command needs docker exec):

docker exec <container> ps aux | grep vllm
docker exec <container> tail -50 /tmp/vllm.log
docker exec <container> tail -f /tmp/vllm.log

Phase 6: Verify

# Health check
curl http://localhost:8000/health

# Test inference
curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model": "<name>", "messages": [{"role": "user", "content": "Hello"}]}'

Quick Examples

Quantized Model (Single Card)

export TASK_QUEUE_ENABLE=1
export VLLM_ASCEND_ENABLE_DENSE_OPTIMIZE=1
export ASCEND_RT_VISIBLE_DEVICES=0

vllm serve /model/Qwen3-8B-mxfp8 \
  --port 8000 \
  --trust-remote-code \
  --quantization ascend \
  --gpu-memory-utilization 0.9 \
  --async-scheduling

Non-Quantized Model

vllm serve /model/Qwen3-8B \
  --port 8000 \
  --trust-remote-code \
  --gpu-memory-utilization 0.9 \
  --async-scheduling
  # NO --quantization param!

Multi-Card TP2

export VLLM_USE_V1=1
export TASK_QUEUE_ENABLE=1
export ASCEND_RT_VISIBLE_DEVICES=0,1
export HCCL_BUFFSIZE=1024

vllm serve /model/Qwen3-30B-mxfp8 \
  --port 8000 \
  --tensor-parallel-size 2 \
  --quantization ascend \
  --gpu-memory-utilization 0.9

Docker (Bridge Network)

docker run -it -d \
  --name vllm-server \
  --network bridge \
  -p 8000:8000 \
  -v /home/weights/Qwen3-8B:/model \
  -e ASCEND_RT_VISIBLE_DEVICES=0 \
  vllm-ascend:latest

# Inside container
vllm serve /model --quantization ascend ...

Decision Rules

Quantization

Detection Action
quant_model_description.json exists Add --quantization ascend
File not found No quantization param

Graph Mode

Use Case Mode
Production Graph (AclGraph)
First deployment Eager → test → Graph
Errors in graph Fall back to Eager
Debugging Eager

Port

Network Port Config
host No mapping needed
bridge Ask user for host port

Error Handling

Error Solution
OOM Reduce max_num_seqs or max_model_len
Graph capture failed Use --enforce-eager
Quantization error Check if model is actually quantized
Port in use Change port or kill process
HCCL timeout Increase HCCL_CONNECT_TIMEOUT
Connection reset/timeout Network issue, retry SSH connection
Container exits immediately Check docker logs, verify mounts exist

Reference Files

Configuration Guides

Technical References

Related Skills

  • remote-server-guide - SSH connection to remote servers
  • npu-docker-launcher - Docker container creation

External Documentation

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值92/100

亮点

  • 针对昇腾NPU硬件的专业vLLM部署工具,解决特定AI芯片平台的LLM推理服务部署痛点
  • 支持多种部署模式(裸机/容器/Docker)和配置场景(单卡/多卡/量化/图模式)
  • 提供完整的端到端部署流程,从环境检测到服务验证全覆盖
触发精准85/100

亮点

  • 触发词覆盖全面,包含6种明确的使用场景
  • 支持本地和远程部署,容器和裸机环境
  • 参数配置说明清晰,边界定义明确
结构规范88/100

亮点

  • 采用Phase分阶段结构,流程清晰易懂
  • 包含详细的配置模板和快速示例
  • frontmatter完整,文档结构规范
执行可靠82/100

亮点

  • 提供完整的错误处理方案和故障排查指南
  • 包含NPU占用检测和进程管理功能
  • 支持服务健康检查和测试验证
证据可验 (前四项均值)87/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • docs.vllm.ai
  • localhost

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。