README.md 1.71 KB
Newer Older
zhuwenwen's avatar
zhuwenwen committed
1
# <div align="center"><strong>vLLM</strong></div>
zhuwenwen's avatar
zhuwenwen committed
2

zhuwenwen's avatar
zhuwenwen committed
3
4
5
## 安装
vLLM支持
+ Python 3.10.
Woosuk Kwon's avatar
Woosuk Kwon committed
6

zhuwenwen's avatar
zhuwenwen committed
7
### 使用源码编译方式安装
Woosuk Kwon's avatar
Woosuk Kwon committed
8

zhuwenwen's avatar
zhuwenwen committed
9
#### 编译环境准备
10

zhuwenwen's avatar
zhuwenwen committed
11
基于光源vllm0.9.2基础镜像环境:
zhuwenwen's avatar
zhuwenwen committed
12
```shell
zhuwenwen's avatar
zhuwenwen committed
13
docker pull image.sourcefind.cn:5000/dcu/admin/base/vllm:0.9.2-ubuntu22.04-dtk25.04.1-rc5-rocblas104381-0915-das1.6-py3.10-20250916-rc2 
zhuwenwen's avatar
zhuwenwen committed
14
```
Zhuohan Li's avatar
Zhuohan Li committed
15

zhuwenwen's avatar
zhuwenwen committed
16
17
18
19
20
21
22
23
24
25
镜像除编译环境外,已包含运行vllm需要的如下HCU依赖:
* DTK驱动:dtk25.04.1
* Pytorch: 2.5.1
* triton: 3.0.0
* lmslim: 0.3.1
* flash_attn: 2.6.1
* flash_mla: 1.0.0
* lightop: 0.5.0


zhuwenwen's avatar
zhuwenwen committed
26
#### 源码编译安装
zhuwenwen's avatar
zhuwenwen committed
27
1. 下载源码并进入目录
zhuwenwen's avatar
zhuwenwen committed
28
```shell
zhuwenwen's avatar
zhuwenwen committed
29
30
git clone -b v0.9.2 https://github.com/vllm-project/vllm.git
cd vllm
Zhuohan Li's avatar
Zhuohan Li committed
31
```
zhuwenwen's avatar
zhuwenwen committed
32
33
34

2. patch生成与执行(若单独打patch执行可忽略):
- 生成
zhuwenwen's avatar
zhuwenwen committed
35
```shell
zhuwenwen's avatar
zhuwenwen committed
36
diff -Naur v0.9.2 patch-0.9.2+das.opt1.rc2.dtk2504 > patch_vllm.patch
zhuwenwen's avatar
zhuwenwen committed
37
```
zhuwenwen's avatar
zhuwenwen committed
38
39
40
41

- 执行
```shell
patch -p1 < patch_vllm.patch
zhuwenwen's avatar
zhuwenwen committed
42
```
Zhuohan Li's avatar
Zhuohan Li committed
43

zhuwenwen's avatar
zhuwenwen committed
44
45
46
47
48
49
3. 获取manylinux so并添加

- 需要将该包安装目录下的_C.abi3.so和_moe_C.abi3.so拷贝至/opt/dtk/并添加软链接至vllm
```shell
cp /usr/local/lib/python3.10/dist-packages/vllm/*.so /opt/dtk/
ln -s /opt/dtk/*.so vllm/
zhuwenwen's avatar
zhuwenwen committed
50
```
Zhuohan Li's avatar
Zhuohan Li committed
51

zhuwenwen's avatar
zhuwenwen committed
52
53
54
55
4. 安装依赖:
```shell
pip install -r requirements/rocm.txt
```
zhuwenwen's avatar
zhuwenwen committed
56

zhuwenwen's avatar
zhuwenwen committed
57
58
59
60
61
62
63
64
65
66
67
5. 编译及安装
- 编译whl包并安装
```shell
python setup.py bdist_wheel 
cd dist
pip install vllm*
```
- 源码编译安装
```shell
pip install . --no-build-isolation
```
zhuwenwen's avatar
zhuwenwen committed
68

zhuwenwen's avatar
zhuwenwen committed
69
#### 注意事项
zhuwenwen's avatar
zhuwenwen committed
70
+ 若使用 pip install 下载安装过慢,可添加源:-i https://pypi.tuna.tsinghua.edu.cn/simple/
71

zhuwenwen's avatar
zhuwenwen committed
72
## 验证
zhuwenwen's avatar
zhuwenwen committed
73
- python -c "import vllm; print(vllm.\_\_version__)",版本号与官方版本同步,查询该软件的版本号,例如0.9.2;
Woosuk Kwon's avatar
Woosuk Kwon committed
74

zhuwenwen's avatar
zhuwenwen committed
75
76
## Known Issue
-
Woosuk Kwon's avatar
Woosuk Kwon committed
77

zhuwenwen's avatar
zhuwenwen committed
78
79
## 参考资料
- [https://github.com/vllm-project/vllm](https://github.com/vllm-project/vllm)