README.md 2.85 KB
Newer Older
zzg_666's avatar
zzg_666 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# EuroLLM
## 论文
暂无

## 模型简介
EuroLLM采用标准的稠密Transformer架构,其核心配置包含:分组查询注意力机制、基于RMSNorm的层前归一化、SwiGLU激活函数,以及每层均使用的旋转位置编码。以下是该模型的关键超参数概要:

| 技术参数 | 数值 |
| :------: | :------: |
| 最大序列长度 | 32768 |
| Transformer层数 | 56 |
| 嵌入维度 | 6144 |
| 前馈网络隐藏层维度 |  16384 |
| 注意力头数 | 48 |
## 环境依赖

| 软件 | 版本 |
| :------: | :------: |
| DTK | 25.04.2 |
| python | 3.10.12 |
| transformers | >=4.57.1 |
| vllm |  0.9.2+das.opt1.dtk25042 |
| torch | 2.5.1+das.opt1.dtk25042 |
| triton | 3.1+das.opt1.3c5d12d.dtk25041 |
| flash_attn | 2.6.1+das.opt1.dtk2504 |
| flash_mla | 1.0.0+das.opt1.dtk25042 |

推荐使用镜像:image.sourcefind.cn:5000/dcu/admin/base/vllm:0.9.2-ubuntu22.04-dtk25.04.2-py3.10
- 挂载地址`-v`根据实际模型情况修改

```bash
docker run -it --shm-size 60g --network=host --name EuroLLM --privileged --device=/dev/kfd --device=/dev/dri --device=/dev/mkfd --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -u root -v /opt/hyhal/:/opt/hyhal/:ro -v /path/your_code_path/:/path/your_code_path/  image.sourcefind.cn:5000/dcu/admin/base/vllm:0.9.2-ubuntu22.04-dtk25.04.2-py3.10 bash
```
更多镜像可前往[光源](https://sourcefind.cn/#/service-list)下载使用。

关于本项目DCU显卡所需的特殊深度学习库可从[光合](https://developer.sourcefind.cn/tool/)开发者社区下载安装。

## 数据集
暂无

## 训练
暂无

## 推理

### vllm
#### 单机推理
zzg_666's avatar
修改  
zzg_666 committed
48

zzg_666's avatar
zzg_666 committed
49
50
```bash
## serve启动
zzg_666's avatar
修改  
zzg_666 committed
51
可参考vllm_serve.sh脚本
zzg_666's avatar
zzg_666 committed
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
vllm serve  utter-project/EuroLLM-22B-Instruct-2512  --trust-remote-code --dtype bfloat16 --max-seq-len-to-capture 32768 -tp 1 --max-model-len 32768 
## client访问
可参考vllm_cilent.sh
curl -X POST "http://localhost:8000/v1/chat/completions"      -H "Content-Type: application/json"     --data '{
                "model": "utter-project/EuroLLM-22B-Instruct-2512",
                "messages": [
                        {
                                "role": "user",
                                "content": "请介绍下自己"
                        }
                ]
        }'

```

## 效果展示
<div align=center>
    <img src="./doc/result.png"/>
</div>

### 精度
DCU与GPU精度一致,推理框架:vllm。

## 预训练权重
| 模型名称  | 权重大小  | DCU型号  | 最低卡数需求 |下载地址|
|:-----:|:----------:|:----------:|:---------------------:|:----------:|
| EuroLLM-22B-Instruct-2512 | 22B | K100AI | 1 | [下载地址](https://huggingface.co/utter-project/EuroLLM-22B-Instruct-2512) |

## 源码仓库及问题反馈
- https://developer.sourcefind.cn/codes/modelzoo/eurollm_vllm

## 参考资料
- https://huggingface.co/utter-project/EuroLLM-22B-Instruct-2512