"tests/entrypoints/pooling/embed/test_online.py" did not exist on "dd793d1de59b5efad25f4794b68cb935824c7a11"
README.md 5.53 KB
Newer Older
zhuwenwen's avatar
zhuwenwen committed
1
2
# <div align="center"><strong>vLLM</strong></div>
## 简介
zhuwenwen's avatar
zhuwenwen committed
3
vLLM是一个快速且易于使用的LLM推理和服务库,使用PageAttention高效管理kv内存,Continuous batching传入请求,支持很多Hugging Face模型,如LLaMA & LLaMA-2、Qwen、Chatglm2 & Chatglm3等。
Woosuk Kwon's avatar
Woosuk Kwon committed
4

zhuwenwen's avatar
zhuwenwen committed
5
## 暂不支持的官方功能
zhuwenwen's avatar
zhuwenwen committed
6
- **量化推理**:目前不支持marlin的权重量化、kv-cache fp8推理方案
zhuwenwen's avatar
zhuwenwen committed
7
- **模块支持**:目前不支持Sliding window attention
zhuwenwen's avatar
zhuwenwen committed
8
9
10


## 支持模型结构列表
11
| 结构 | 模型 | FP16/BF16 | AWQ | GPTQ |
gaoqiong's avatar
gaoqiong committed
12
| :------: | :------: | :------: | :------: |:------: |
zhuwenwen's avatar
zhuwenwen committed
13
14
| LlamaForCausalLM      | Llama 3.2, Llama 3.1,Llama 3,Llama 2,Llama,Yi,Codellama,DeepSeek-R1-Distill-Llama     | Yes | Yes | Yes |  
| Llama4ForConditionalGeneration      | Llama 4                                                      | No/Yes | -  | - |
15
| QWenLMHeadModel       | QWen,Qwen-VL                                                | Yes | Yes | Yes |
zhuwenwen's avatar
zhuwenwen committed
16
| Qwen2ForCausalLM      | QWen2,QWen1.5,CodeQwen1.5,DeepSeek-R1-Distill-Qwen,gte_Qwen2-1.5B-instruct          | Yes | Yes | Yes |
zhuwenwen's avatar
zhuwenwen committed
17
18
| Qwen3ForCausalLM      | QWen3                                                       | Yes | - | - |
| Qwen3MoeForCausalLM   | QWen3MoE                                                    | Yes | - | - |
19
| ChatGLMModel          | glm-4v-9b,chatglm3,chatglm2                                 | Yes | No  | Yes |
zhuwenwen's avatar
zhuwenwen committed
20
| Glm4ForCausalLM       | GLM-4-0414                                                  | No/Yes | -  | - |
zhuwenwen's avatar
zhuwenwen committed
21
| DeepseekForCausalLM   | Deepseek                                                    | Yes | No  | -   |
22
| DeepseekV2ForCausalLM | DeepSeek-V2                                                 | Yes | No  | -   |
zhuwenwen's avatar
zhuwenwen committed
23
| DeepseekV3ForCausalLM | DeepSeek-V3                                                 | Yes | Yes | -   |
24
| BaiChuanForCausalLM   | Baichuan2,Baichuan                                          | Yes | Yes | -   |
zhuwenwen's avatar
zhuwenwen committed
25
| BloomForCausalLM      | BLOOM                                                       | Yes | No  | Yes |
26
27
| InternLMForCausalLM   | InternLM                                                    | Yes | No  | -   |
| InternLM2ForCausalLM  | InternLM2                                                   | Yes | No  | -   |
zhuwenwen's avatar
zhuwenwen committed
28
| FalconForCausalLM     | falcon                                                      | Yes | No  | Yes |
zhuwenwen's avatar
zhuwenwen committed
29
| TeleChat2ForCausalLM  | TeleChat2                                                   | Yes | No  | -   |
30
31
32
33
34
35
36
37
| MiniCPMForCausalLM    | MiniCPM                                                     | Yes | No  | -   |
| MiniCPM3ForCausalLM   | MiniCPM3                                                    | Yes | No  | -   |
| MixtralForCausalLM    | Mixtral-8x7B,Mixtral-8x7B-Instruct                          | Yes | No  | -   |
| Qwen2MoeForCausalLM                 | Qwen2-57B-A14B,Qwen2-57B-A14B-Instruct        | Yes | No  | -   |
| LlavaForConditionalGeneration       | LLaMA,LLaMA-2,LLaMA-3                         | Yes | No  | -   |
| Qwen2VLForConditionalGeneration     | Qwen2-VL                                      | Yes | No  | Yes |
| MiniCPMV                            | MiniCPM-V                                     | Yes | No  | -   |
| Phi3VForCausalLM                    | Phi-3.5-vision                                | Yes | No  | -   |
zhuwenwen's avatar
zhuwenwen committed
38
39
40
| BertModel                           | bge-large-zh-v1.5                             | Yes | No  | -   |
| XLMRobertaModel                     | bge-m3                                        | Yes | No  | -   |
| XLMRobertaForSequenceClassification | bge-reranker-v2-m3                            | Yes | No  | -   |
zhuwenwen's avatar
zhuwenwen committed
41
42


zhuwenwen's avatar
zhuwenwen committed
43
44
45
46
47
## 安装
vLLM支持
+ Python 3.9.
+ Python 3.10.
+ Python 3.11.
zhuwenwen's avatar
zhuwenwen committed
48
+ Python 3.12.
Woosuk Kwon's avatar
Woosuk Kwon committed
49

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

zhuwenwen's avatar
zhuwenwen committed
52
#### 编译环境准备
zhuwenwen's avatar
zhuwenwen committed
53
提供2种环境准备方式:
Woosuk Kwon's avatar
Woosuk Kwon committed
54

zhuwenwen's avatar
zhuwenwen committed
55
1. 基于光源pytorch2.4.1基础镜像环境:根据pytorch2.4.1、python、dtk及系统下载对应的镜像版本。
56

zhuwenwen's avatar
zhuwenwen committed
57
2. 基于现有python环境:安装pytorch2.4.1,pytorch whl包下载目录:[https://cancon.hpccube.com:65024/4/main/pytorch](https://cancon.hpccube.com:65024/4/main/pytorch),根据python、dtk版本,下载对应pytorch2.4.1的whl包。安装命令如下:
zhuwenwen's avatar
zhuwenwen committed
58
59
60
61
```shell
pip install torch* (下载的torch的whl包)
pip install setuptools wheel
```
Zhuohan Li's avatar
Zhuohan Li committed
62

zhuwenwen's avatar
zhuwenwen committed
63
64
#### 源码编译安装
```shell
zhuwenwen's avatar
zhuwenwen committed
65
git clone http://developer.hpccube.com/codes/OpenDAS/vllm.git # 根据需要的分支进行切换
Zhuohan Li's avatar
Zhuohan Li committed
66
```
zhuwenwen's avatar
zhuwenwen committed
67
安装依赖:
zhuwenwen's avatar
zhuwenwen committed
68
```shell
zhuwenwen's avatar
zhuwenwen committed
69
pip install -r requirements/rocm.txt
zhuwenwen's avatar
zhuwenwen committed
70
```
zhuwenwen's avatar
zhuwenwen committed
71
- 提供2种源码编译方式(进入vllm目录):
zhuwenwen's avatar
zhuwenwen committed
72
73
```
1. 编译whl包并安装
zhuwenwen's avatar
zhuwenwen committed
74
python setup.py bdist_wheel 
zhuwenwen's avatar
zhuwenwen committed
75
76
cd dist
pip install vllm*
Zhuohan Li's avatar
Zhuohan Li committed
77

zhuwenwen's avatar
zhuwenwen committed
78
2. 源码编译安装
zhuwenwen's avatar
zhuwenwen committed
79
python3 setup.py install (若调试,可使用python3 setup.py develop)
zhuwenwen's avatar
zhuwenwen committed
80
```
zhuwenwen's avatar
zhuwenwen committed
81
若需要添加git号,设置环境变量: export ADD_GIT_VERSION=1
Zhuohan Li's avatar
Zhuohan Li committed
82

zhuwenwen's avatar
zhuwenwen committed
83
#### 运行基础环境准备
zhuwenwen's avatar
zhuwenwen committed
84
1、使用上面基于光源pytorch2.4.1基础镜像环境
zhuwenwen's avatar
zhuwenwen committed
85

zhuwenwen's avatar
zhuwenwen committed
86
2、根据pytorch2.4.1、python、dtk及系统下载对应的依赖包:
zhuwenwen's avatar
zhuwenwen committed
87
88
- triton:[https://cancon.hpccube.com:65024/4/main/triton](https://cancon.hpccube.com:65024/4/main/triton/)
- flash_attn: [https://cancon.hpccube.com:65024/4/main/flash_attn](https://cancon.hpccube.com:65024/4/main/flash_attn)
gaoqiong's avatar
gaoqiong committed
89
- lmslim: [https://cancon.hpccube.com:65024/4/main/lmslim](https://cancon.hpccube.com:65024/4/main/lmslim)
zhuwenwen's avatar
zhuwenwen committed
90

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

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

zhuwenwen's avatar
zhuwenwen committed
97
98
## Known Issue
-
Woosuk Kwon's avatar
Woosuk Kwon committed
99

zhuwenwen's avatar
zhuwenwen committed
100
101
102
## 参考资料
- [README_ORIGIN](README_ORIGIN.md)
- [https://github.com/vllm-project/vllm](https://github.com/vllm-project/vllm)