README.md 3.28 KB
Newer Older
zhuwenwen's avatar
zhuwenwen committed
1
2
3
# <div align="center"><strong>opencompass</strong></div>
## 简介
OpenCompass主要由三个核心模块构成:CompassKit、CompassHub和CompassRank。CompassRank不仅囊括了开源基准测试项目,还包含了私有基准测试。CompassHub推出了一个基准测试资源导航平台,可以在多样化的基准测试库中进行搜索与利用。CompassKit 是一系列专为大型语言模型和大型视觉-语言模型打造的强大评估工具合集,它所提供的全面评测工具集能够有效地对这些复杂模型的功能性能进行精准测量和科学评估。
Tong Gao's avatar
Tong Gao committed
4

Tong Gao's avatar
Tong Gao committed
5

zhuwenwen's avatar
zhuwenwen committed
6
7
8
9
10
## 安装
opencompass支持
+ Python 3.8.
+ Python 3.9.
+ Python 3.10.
Tong Gao's avatar
Tong Gao committed
11

zhuwenwen's avatar
zhuwenwen committed
12
### 使用源码编译方式安装
Tong Gao's avatar
Tong Gao committed
13

zhuwenwen's avatar
zhuwenwen committed
14
15
#### 编译环境准备
提供2种环境准备方式:
Tong Gao's avatar
Tong Gao committed
16

zhuwenwen's avatar
zhuwenwen committed
17
1. 基于光源pytorch2.1.0基础镜像环境:镜像下载地址:[https://sourcefind.cn/#/image/dcu/pytorch](https://sourcefind.cn/#/image/dcu/pytorch),根据pytorch2.1.0、python、dtk及系统下载对应的镜像版本。
Songyang Zhang's avatar
Songyang Zhang committed
18

zhuwenwen's avatar
zhuwenwen committed
19
20
21
22
2. 基于现有python环境:安装pytorch2.1.0,pytorch whl包下载目录:[https://cancon.hpccube.com:65024/4/main/pytorch/DAS1.0](https://cancon.hpccube.com:65024/4/main/pytorch/DAS1.0),根据python、dtk版本,下载对应pytorch2.1.0的whl包。安装命令如下:
```shell
pip install torch* (下载的torch的whl包)
pip install setuptools wheel
23
24
```

zhuwenwen's avatar
zhuwenwen committed
25
26
27
28
#### 源码编译安装
```shell
git clone -b 0.2.5.rc1 http://developer.hpccube.com/codes/OpenDAS/opencompass.git 
```
29

zhuwenwen's avatar
zhuwenwen committed
30
- 提供2种源码编译方式(进入opencompass目录):
31
```
zhuwenwen's avatar
zhuwenwen committed
32
33
34
基础依赖安装:
pip install -r requirements.txt
pip install sentence_transformers==2.2.2 --no-deps
35

zhuwenwen's avatar
zhuwenwen committed
36
37
38
39
1. 编译whl包并安装
python setup.py bdist_wheel 
cd dist
pip install opencompass*
40

zhuwenwen's avatar
zhuwenwen committed
41
2. 源码编译安装
zhuwenwen's avatar
zhuwenwen committed
42
pip install -e .
Leymore's avatar
Leymore committed
43
44
45
```


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


zhuwenwen's avatar
zhuwenwen committed
50
51
52
53
54
## 使用
### 数据集准备
```
wget https://github.com/open-compass/opencompass/releases/download/0.2.2.rc1/OpenCompassData-core-20240207.zip
unzip OpenCompassData-core-20240207.zip (解压后为data目录)
Leymore's avatar
Leymore committed
55
56
```

zhuwenwen's avatar
zhuwenwen committed
57
58
59
### 使用说明
列出所有配置:
```shell
Leymore's avatar
Leymore committed
60
61
62
python tools/list_configs.py
```

zhuwenwen's avatar
zhuwenwen committed
63
64
65
列出和llama模型以及mmlu数据集有关的配置:
```shell
python tools/list_configs.py llama mmlu
Leymore's avatar
Leymore committed
66
67
```

zhuwenwen's avatar
zhuwenwen committed
68
根据需要的框架进行安装,然后运行:
zhuwenwen's avatar
zhuwenwen committed
69

zhuwenwen's avatar
zhuwenwen committed
70
71
72
73
74
1、使用vllm推理验证
```shell
python run.py configs/eval_llama2_vllm.py
```
其它模型使用参考`configs/eval_xxx_vllm.py`
Tong Gao's avatar
Tong Gao committed
75

zhuwenwen's avatar
zhuwenwen committed
76
77
78
79
2、使用lmdeploy推理验证
```shell
python run.py configs/eval_llama2_lmdelpoy.py
```
Tong Gao's avatar
Tong Gao committed
80

zhuwenwen's avatar
zhuwenwen committed
81
82
83
84
3、使用tgi推理验证
```shell
python run.py configs/eval_llama2_tgi.py
```
Leymore's avatar
Leymore committed
85

zhuwenwen's avatar
zhuwenwen committed
86
87
88
89
90
参数说明:
(1)数据集配置参数
`work_dir`为保存路径,`from .datasets.ARC_c.ARC_c_gen_1e0de5 import ARC_c_datasets`为使用的数据集,可以在`configs/datasets`路径下查找并配置,vllm目前不支持ppl-based评测。
(2)模型配置参数
`abbr`为生成数据集指标得分的列名,`path`为模型路径。
Tong Gao's avatar
Tong Gao committed
91

zhuwenwen's avatar
zhuwenwen committed
92
93
## 验证
- python -c "import opencompass; print(opencompass.\_\_version__)",版本号与官方版本同步,查询该软件的版本号,例如0.2.4;
Songyang Zhang's avatar
Songyang Zhang committed
94

zhuwenwen's avatar
zhuwenwen committed
95
96
## Known Issue
-
Songyang Zhang's avatar
Songyang Zhang committed
97

zhuwenwen's avatar
zhuwenwen committed
98
99
100
## 参考资料
- [README_ORIGIN](README_ORIGIN.md)
- [https://github.com/open-compass/opencompass](https://github.com/open-compass/opencompass.git)