vLLM 서빙을 위한 Ascend NPU 추론 스택
README 링크에서 발견 · 2 days ago
vllm-ascend 플러그인을 통해 Huawei Ascend NPU에서 vLLM을 실행합니다.
What they did
그들은 vllm-ascend 플러그인을 사용해 Huawei Ascend 하드웨어에서 vLLM 추론을 설정했는데, 이 플러그인은 업스트림 vLLM을 Ascend NPU 디바이스 지원으로 확장한다. 작업은 공식 문서와 지원 매트릭스를 따라 호환되는 릴리스(예: v0.23.0 안정 버전 또는 v0.26.0rc1 릴리스 후보)를 선택하고, 일치하는 vLLM 버전과 함께 플러그인을 설치하고, Ascend 디바이스 백엔드가 감지되었는지 검증하는 순서로 진행되었다. 그런 다음 모델을 서빙하기 위해 OpenAI 호환 서버를 실행했고, 더 큰 배포를 위해 전용 EP 튜토리얼을 따라 멀티 디바이스 및 대규모 Expert Parallelism(EP)을 구성했다. 그들은 지원 매트릭스를 사용해 어떤 모델과 기능이 지원되는지 확인했고, DeepWiki/포럼 채널을 통해 격차를 해결했다.
How it went
Ascend 기반 vLLM 서빙 엔드포인트가 OpenAI 호환 API와 함께 동작하며, expert parallelism으로 확장할 수 있는 경로도 제공합니다. 릴리스 주기는 규칙적이며(대략 분기별 공식 버전과 RC), 문서는 릴리스별로 버전 관리되므로 설정을 재현할 수 있습니다. 지원되는 모델/하드웨어 조합에서는 완성도가 좋지만, 지원 매트릭스 밖의 결과는 검증되지 않습니다.
Worth knowing
Ascend NPU 하드웨어와 CANN/드라이버 스택이 필요하므로, 노트북이나 일반 GPU 박스에서는 시도할 수 없습니다. 플러그인과 vLLM 버전은 정확히 일치해야 하며, 버전 불일치는 흔한 실패 원인입니다. 모델 지원은 지원 매트릭스로 제한되며, 일부 기능은 업스트림 vLLM보다 뒤처집니다. README 발췌문은 대부분 릴리스 소식이므로, 설치 관련 세부 사항은 버전별 문서에서 확인해야 합니다.
Wiring
순서: (1) Ascend 하드웨어와 CANN/driver 사전 요구사항을 확인한다; (2) 뉴스 목록에서 릴리스를 선택하고 해당 버전의 문서를 읽는다; (3) 지원 매트릭스에서 모델 및 기능 커버리지를 확인한다; (4) 고정된 버전으로 vLLM을 설치한 다음, 일치하는 vllm-ascend 플러그인을 설치한다; (5) 디바이스 감지를 검증한다; (6) OpenAI 호환 서버를 실행한다; (7) 스케일아웃의 경우, 대규모 EP 튜토리얼을 따라 디바이스 전반에 걸쳐 tensor/expert parallel 크기를 설정한다. 구성은 실행 플래그와 환경 변수에 있으며, vLLM과 플러그인 간의 버전 고정이 핵심적인 결합 지점이다.
Try it yourself
I can't execute this setup for you — I don't have access to your repo, your Ascend NPU hardware, or the ability to run installs, check devices, or start servers. What I can do is give you the exact sequence to run yourself, with the decision points and gotchas called out so you can fill in the version-specific values from the pinned docs.
## 1. Pin down the release and read the versioned docs
- Find the pinned version in your repo (e.g. `requirements.txt`, `pyproject.toml`, `Dockerfile`, or a `VERSION` file). Note the exact `vllm` and `vllm-ascend` versions — they must match each other and the pinned release.
- Read the **versioned** docs for that release, not `main`:
- vLLM Ascend docs: `https://docs.vllm.ai/projects/ascend/en/<version>/` (or the `vllm-ascend` GitHub release notes for that tag).
- vLLM docs for the matching version: `https://docs.vllm.ai/en/v<version>/`.
- From those docs, extract: supported CANN version, supported PyTorch/torch-npu version, supported Python, and the exact install command (usually `pip install vllm==<x> vllm-ascend==<y>` plus a `--extra-index-url` for the Ascend wheel index).
## 2. Check the support matrix for your model
- In the vllm-ascend docs for your pinned version, find the **supported models** / **feature matrix** page.
- Confirm: (a) your model architecture is listed, (b) the quantization format (if any) is supported, (c) the parallelism you plan (TP/PP) is supported, (d) whether it needs `--enforce-eager` or specific `VLLM_ASCEND_*` env vars.
- If your model is **not** in the matrix, stop and note it — running it is unsupported and may silently produce wrong output.
## 3. Prerequisites (verify before installing)
- **CANN toolkit**: version must match what the pinned vllm-ascend release requires. Check with `cat /usr/local/Ascend/ascend-toolkit/latest/version.cfg` or `npu-smi info -t version`.
- **NPU driver/firmware**: check with `npu-smi info`. Driver version must be ≥ the minimum in the docs.
- **torch-npu**: must match the PyTorch version vllm-ascend expects.
- **OS/kernel**: some releases require specific glibc/kernel; check the docs' "environment" section.
- Source the CANN env: `source /usr/local/Ascend/ascend-toolkit/set_env.sh` (and `.../nnal/set_env.sh` if needed).
## 4. Install matching versions
```bash
pip install vllm==<pinned> vllm-ascend==<pinned>
# plus whatever extra index the versioned docs specify
```
Do **not** let pip resolve `vllm` independently — pin both explicitly so they stay in lockstep.
## 5. Verify NPU detection
```bash
npu-smi info # devices visible, driver OK
python -c "import torch, torch_npu; print(torch.npu.is_available(), torch.npu.device_count())"
python -c "import vllm_ascend; print(vllm_ascend.__version__)"
```
If `torch.npu.is_available()` is `False`, the problem is CANN/driver/env, not vLLM — fix that first.
## 6. Start the OpenAI-compatible server
```bash
vllm serve <your-model> \
--device npu \
--tensor-parallel-size <N> \
--port 8000
# add --enforce-eager or VLLM_ASCEND_* env vars if the docs require them for your model
```
## 7. Smoke test
```bash
curl http://localhost:8000/v1/completions \
-H "Content-Type: application/json" \
-d '{"model":"<your-model>","prompt":"Hello","max_tokens":16}'
```
## What to report back
- Exact `vllm`, `vllm-ascend`, `torch`, `torch-npu`, CANN, and driver versions.
- Whether your model/quantization/parallelism is inside the support matrix — and if not, exactly which axis is outside it.
- Any env vars or flags the versioned docs required.
If you paste the pinned versions from your repo and the output of `npu-smi info` and the `torch.npu` check, I can tell you which doc pages to read and flag likely mismatches — but the actual install and run has to happen on your machine.