Files
enginex-ascend-910-vllm/README.md
2025-10-21 10:17:39 +08:00

82 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# enginex-ascend-910-vllm
运行于【昇腾-910】系列算力卡的【文本生成】引擎基于 vLLM 引擎进行架构特别适配优化,支持 Qwen、DeepSeek、Llama 等最新开源模型
## 镜像
Latest RC Version: git.modelhub.org.cn:9443/enginex-ascend/vllm-ascend:v0.11.0rc0
## 总览
vLLM 昇腾插件 (`vllm-ascend`) 是一个由社区维护的让vLLM在Ascend NPU无缝运行的后端插件。
此插件是 vLLM 社区中支持昇腾后端的推荐方式。它遵循[[RFC]: Hardware pluggable](https://github.com/vllm-project/vllm/issues/11162)所述原则通过解耦的方式提供了vLLM对Ascend NPU的支持。
使用 vLLM 昇腾插件可以让类Transformer、混合专家(MOE)、嵌入、多模态等流行的大语言模型在 Ascend NPU 上无缝运行。
## 准备
- 硬件Atlas 800I A2 Inference系列、Atlas A2 Training系列、Atlas 800I A3 Inference系列、Atlas A3 Training系列、Atlas 300I Duo实验性支持
- 操作系统Linux
- 软件:
* Python >= 3.9, < 3.12
* CANN >= 8.2.rc1 (Ascend HDK 版本参考[这里](https://www.hiascend.com/document/detail/zh/canncommercial/82RC1/releasenote/releasenote_0000.html))
* PyTorch >= 2.7.1, torch-npu >= 2.7.1.dev20250724
* vLLM (与vllm-ascend版本一致)
## QuickStart
1、从 modelscope上下载支持的模型例如 Qwen/Qwen3-8B
```python
modelscope download --model Qwen/Qwen3-8B README.md --local_dir ./model
```
2、使用Dockerfile生成镜像
从仓库的【软件包】栏目下载基础镜像 git.modelhub.org.cn:9443/enginex-ascend/cann:8.2.rc1-910b-ubuntu22.04-py3.11
使用 Dockerfile 生成 镜像
```python
docker build -f Dockerfile -t ascend-vllm:dev .
```
3、启动docker
```python
docker run -it --rm \
-p 10086:80 \
--name test-ascend-my-1 \
-v `pwd`:/host \
-e ASCEND_VISIBLE_DEVICES=1 \
--device /dev/davinci1:/dev/davinci0 \
--device /dev/davinci_manager \
--device /dev/devmm_svm \
--device /dev/hisi_hdc \
-v ./model:/model \
-v /usr/local/dcmi:/usr/local/dcmi \
-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 \
--privileged \
ascend-vllm:dev \
vllm serve /model --served-model-name qwen3-8b --max-model-len 4096
```
4、测试服务
```python
curl -X POST http://localhost:10086/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-8b",
"messages": [{"role": "user", "content": "你好"}],
"stream": true
}'
```
## 开始使用
推荐您使用以下版本快速开始使用:
| Version | Release type | Doc |
|------------|--------------|--------------------------------------|
|v0.11.0rc0| 最新RC版本 |请查看[快速开始](https://vllm-ascend.readthedocs.io/en/latest/quick_start.html)和[安装指南](https://vllm-ascend.readthedocs.io/en/latest/installation.html)了解更多|
|v0.9.1| 最新正式/稳定版本 |[快速开始](https://vllm-ascend.readthedocs.io/en/v0.9.1-dev/quick_start.html) and [安装指南](https://vllm-ascend.readthedocs.io/en/v0.9.1-dev/installation.html)了解更多|