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
GPT2_pytorch
Commits
d9a6ee2d
Commit
d9a6ee2d
authored
Sep 08, 2023
by
hepj987
Browse files
修改readme
parent
17814e61
Pipeline
#549
canceled with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
7 deletions
+39
-7
README.md
README.md
+39
-7
gpt2.jpg
gpt2.jpg
+0
-0
image-gpt.png
image-gpt.png
+0
-0
No files found.
README.md
View file @
d9a6ee2d
# Generative Pre-Training2(GPT2)
### 模型介绍
## 论文
`Language Models are Unsupervised Multitask Learners`
-
https://d4mucfpksywv.cloudfront.net/better-language-models/language-models.pdf
## 模型介绍
```
GPT2模型:第二代生成式预训练模型(Generative Pre-Training2)。
```
### 模型结构
## 模型结构

```
GPT2使用
Transformer
的
Decoder
结构,并对 Transformer Decoder 进行了一些改动
,并通过Megatron和deepspeed可以使用DP、TP、PP的3D并行式的分布式方式训练
GPT2使用Transformer
的
Decoder结构,并对 Transformer Decoder 进行了一些改动
。主要在于将归一化层移到Block的输入位置;在最后一个自注意力块之后加了一层归一化;增大词汇量等。
```
### 数据集
## 算法原理

## 数据集
`oscar-1GB`
-
https://huggingface.co/bigscience/misc-test-data/resolve/main/stas/oscar-1GB.jsonl.xz
```
#下载数据集
...
...
@@ -36,9 +52,14 @@ xz -d oscar-1GB.jsonl.xz
sh creat-data.sh
```
## GPT2预训练
```
#处理后的数据集格式
├── my-gpt2_text_document.bin
├── my-gpt2_text_document.idx
└── oscar-1GB.jsonl
```
##
#
环境配置
## 环境配置
推荐使用docker方式运行,提供
[
光源
](
https://www.sourcefind.cn/
)
拉取的docker镜像:
...
...
@@ -52,6 +73,8 @@ docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.10.0-centos7.6-dtk
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
```
## GPT2预训练
### GPT2单节点训练
```
...
...
@@ -209,9 +232,17 @@ mpirun -np 1 run-inf.sh
--num-samples 生成样本个数
```
## 应用场景
### 算法类别
`文本生成`
## loss收敛情况
### 热点应用行业
## result
16B模型使用oscar数据集收敛情况如下:
...
...
@@ -228,3 +259,4 @@ https://developer.hpccube.com/codes/modelzoo/gpt2-pytorch/
## 参考
https://github.com/bigscience-workshop/Megatron-DeepSpeed
gpt2.jpg
0 → 100644
View file @
d9a6ee2d
32.7 KB
image-gpt.png
0 → 100644
View file @
d9a6ee2d
64.7 KB
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