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
ChatGLM-6B_fastllm
Commits
0f811087
Commit
0f811087
authored
Oct 11, 2023
by
zhouxiang
Browse files
更新规范格式
parent
02386765
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
7 deletions
+57
-7
README.md
README.md
+52
-5
model.properties
model.properties
+5
-2
No files found.
README.md
View file @
0f811087
# ChatGLM6B_CPP
# ChatGLM6B_CPP
## 模型介绍
## 论文
ChatGLM-6B 是一个开源的、支持中英双语的对话语言模型,基于
[
General Language Model (GLM)
](
https://github.com/THUDM/GLM
)
架构,具有 62 亿参数。
ChatGLM-6B 使用了和 ChatGPT 相似的技术,针对中文问答和对话进行了优化。经过约 1T 标识符的中英双语训练,辅以监督微调、反馈自助、人类反馈强化学习等技术的加持,62 亿参数的 ChatGLM-6B 已经能生成相当符合人类偏好的回答,更多信息请参考我们的
[
博客
](
https://chatglm.cn/blog
)
。
`GLM: General Language Model Pretraining with Autoregressive Blank Infilling`
-
[
https://arxiv.org/abs/2103.10360
](
https://arxiv.org/abs/2103.10360
)
## 模型结构
ChatGLM-6B 是清华大学开源的开源的、支持中英双语的对话语言模型,基于
[
General Language Model (GLM)
](
https://github.com/THUDM/GLM
)
架构,具有 62 亿参数。ChatGLM-6B 使用了和 ChatGPT 相似的技术,针对中文问答和对话进行了优化。经过约 1T 标识符的中英双语训练,辅以监督微调、反馈自助、人类反馈强化学习等技术的加持,62 亿参数的 ChatGLM-6B 已经能生成相当符合人类偏好的回答。ChatGLM-6B采用Transformer模型结构:
<div
align=
"center"
>
<img
src=
"doc/transformers.jpg"
width=
"300"
height=
"400"
>
</div>
以下是ChatGLM-6B的主要网络参数配置:
| 模型名称 | 隐含层维度 | 层数 | 头数 | 词表大小 | 位置编码 | 最大长 |
| ---------- | ---------- | ---- | ---- | -------- | -------- | ------ |
| ChatGLM-6B | 4,096 | 28 | 32 | 130528 | RoPE | 2048 |
## 算法原理
ChatGLM-6B基于GLM架构开发。GLM是一种基于Transformer的语言模型,以自回归空白填充为训练目标, 同时具备自回归和自编码能力。
<div
align=
"center"
>
<img
src=
"doc/GLM.png"
width=
"550"
height=
"200"
>
</div>
本项目主要针对ChatGLM-6B推理性能优化,达到DCU平台较快的对话效果
本项目主要针对ChatGLM-6B推理性能优化,达到DCU平台较快的对话效果
##
模型推理
##
环境配置
###
下载镜像
###
环境准备
在光源可拉取推理的docker镜像,拉取方式如下:
在光源可拉取推理的docker镜像,拉取方式如下:
...
@@ -17,6 +42,16 @@ ChatGLM-6B 使用了和 ChatGPT 相似的技术,针对中文问答和对话进
...
@@ -17,6 +42,16 @@ ChatGLM-6B 使用了和 ChatGPT 相似的技术,针对中文问答和对话进
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:chatglm-6b-dcu-infer-1.0
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:chatglm-6b-dcu-infer-1.0
```
```
### 容器启动
模型推理容器启动命令参考如下,用户根据需要修改:
```
# <container_name> 自定义容器名
# <project_path> 当前工程所在路径
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:chatglm-6b-dcu-infer-1.0 /bin/bash
```
### 编译方法
### 编译方法
```
```
...
@@ -34,6 +69,8 @@ make -j4
...
@@ -34,6 +69,8 @@ make -j4
3.
benchmark: 性能测试程序
3.
benchmark: 性能测试程序
## 推理
### ChatGLM原版模型转换
### ChatGLM原版模型转换
```
```
...
@@ -70,6 +107,16 @@ cd build
...
@@ -70,6 +107,16 @@ cd build
./benchmark -p ~/chatglm-6b-fp16.bin -f ../benchmark/prompts/hello.txt -b 512 -l 18
./benchmark -p ~/chatglm-6b-fp16.bin -f ../benchmark/prompts/hello.txt -b 512 -l 18
```
```
## 应用场景
### 算法类别
`自然语言处理`
### 热点应用行业
`nlp,智能聊天助手,科研`
## 源码仓库及问题反馈
## 源码仓库及问题反馈
https://developer.hpccube.com/codes/modelzoo/chatglm6b_cpp
https://developer.hpccube.com/codes/modelzoo/chatglm6b_cpp
...
...
model.properties
View file @
0f811087
# 模型唯一标识
modelCode
=
268
# 模型名称
# 模型名称
modelName
=
ChatGLM6B_CPP
modelName
=
ChatGLM6B_CPP
# 模型描述
# 模型描述
modelDescription
=
ChatGLM-6B是一个开源的、支持中英双语的对话语言模型,基于 General Language Model (GLM) 架构,具有 62 亿参数
modelDescription
=
ChatGLM-6B是一个开源的、支持中英双语的对话语言模型,基于 General Language Model (GLM) 架构,具有 62 亿参数
# 应用场景
# 应用场景
appScenario
=
聊天
appScenario
=
推理,NLP,智能聊天助手,金融,教育
# 框架类型
# 框架类型
frameType
=
C/C++,CUDA
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