Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ChatGLM2-6B_fastllm
Commits
cd5186c5
Commit
cd5186c5
authored
Oct 11, 2023
by
zhouxiang
Browse files
提交格式更新
parent
0277e031
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
8 deletions
+51
-8
README.md
README.md
+46
-5
doc/GLM.png
doc/GLM.png
+0
-0
doc/transformers.jpg
doc/transformers.jpg
+0
-0
model.properties
model.properties
+5
-3
No files found.
README.md
View file @
cd5186c5
# ChatGLM2-6B_CPP
## 模型介绍
## 论文
`GLM: General Language Model Pretraining with Autoregressive Blank Infilling`
-
[
https://arxiv.org/abs/2103.10360
](
https://arxiv.org/abs/2103.10360
)
## 模型结构
ChatGLM
**2**
-6B 是开源中英双语对话模型
[
ChatGLM-6B
](
https://github.com/THUDM/ChatGLM-6B
)
的第二代版本,在保留了初代模型对话流畅、部署门槛较低等众多优秀特性的基础之上,ChatGLM
**2**
-6B 引入了更好的模型效果,更长的上下文等新特性
本项目主要针对ChatGLM2-6B在DCU平台的推理性能优化,达到DCU平台较快的对话效果。
<div
align=
"center"
>
<img
src=
"doc/transformers.jpg"
width=
"300"
height=
"400"
>
</div>
以下是ChatGLM2-6B的主要网络参数配置:
| 模型名称 | 隐含层维度 | 层数 | 头数 | 词表大小 | 位置编码 | 最大长 |
| ----------- | ---------- | ---- | ---- | -------- | -------- | ------ |
| ChatGLM2-6B | 4,096 | 28 | 32 | 65024 | RoPE | 32768 |
##
模型推
理
##
算法原
理
### 下载镜像
ChatGLM2-6B基于GLM架构开发。GLM是一种基于Transformer的语言模型,以自回归空白填充为训练目标, 同时具备自回归和自编码能力。
<div
align=
"center"
>
<img
src=
"doc/GLM.png"
width=
"550"
height=
"200"
>
</div>
本项目主要针对ChatGLM2-6B推理性能优化,达到DCU平台较快的对话效果
## 环境配置
### 环境准备
在光源可拉取推理的docker镜像,拉取方式如下:
...
...
@@ -22,7 +51,7 @@ docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:glm-ft-v1.0
```
# <container_name> 自定义容器名
# <project_path> 当前工程所在路径
docker run -it --name=<container_name> -v <project_path>:/work --device=/dev/kfd --device=/dev/dri --security-opt seccomp=unconfined --cap-add=SYS_PTRACE --shm-size=16G --group-add 39 image.sourcefind.cn:5000/dcu/admin/base/custom:glm-ft-v1.0 /bin/bash
docker run -it --name=<container_name> -v <project_path>:/work
-w /work
--device=/dev/kfd --device=/dev/dri --security-opt seccomp=unconfined --cap-add=SYS_PTRACE --shm-size=16G --group-add 39 image.sourcefind.cn:5000/dcu/admin/base/custom:glm-ft-v1.0 /bin/bash
```
### 安装方法
...
...
@@ -33,6 +62,8 @@ cd package
python setup install
```
## 推理
### ChatGLM2原版模型转换
```
...
...
@@ -70,6 +101,16 @@ chmod +x benchmark
./benchmark -p ../chatglm2-6b-fp16.bin -f ../benchmark/prompts/hello.txt -b 512 -l 18
```
## 应用场景
### 算法类别
`自然语言处理`
### 热点应用行业
`nlp,智能聊天助手,科研`
## 源码仓库及问题反馈
https://developer.hpccube.com/codes/modelzoo/chatglm2-6b_cpp
...
...
doc/GLM.png
0 → 100644
View file @
cd5186c5
261 KB
doc/transformers.jpg
0 → 100644
View file @
cd5186c5
32.7 KB
model.properties
View file @
cd5186c5
# 模型唯一标识
modelCode
=
357
# 模型名称
modelName
=
c
hat
glm2-6b
modelName
=
C
hat
GLM2-6B_CPP
# 模型描述
modelDescription
=
chatglm2-6b开源中英双语对话模型的第二代版本,在保留了初代模型对话流畅、部署门槛较低等众多优秀特性的基础之上,具有更强大的新特性
# 应用场景
appScenario
=
聊天
appScenario
=
推理,NLP,智能聊天助手,金融,教育
# 框架类型
frameType
=
cpp
frameType
=
CPP
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment