Commit a8b5318a authored by zhuwenwen's avatar zhuwenwen
Browse files

update readme std

parent 8a64423d
<!--
* @Author: zhuww
* @email: zhuww@sugon.com
* @Date: 2023-09-06 18:04:07
* @LastEditTime: 2023-09-08 09:00:01
-->
# LLama_FT # LLama_FT
## 论文 ## 论文
...@@ -9,6 +15,8 @@ LLAMA网络基于 Transformer 架构。提出了各种改进,并用于不同 ...@@ -9,6 +15,8 @@ LLAMA网络基于 Transformer 架构。提出了各种改进,并用于不同
SwiGLU 激活函数 [PaLM]。使用 SwiGLU 激活函数替换 ReLU 非线性以提高性能。使用 2 /3 4d 的维度而不是 PaLM 中的 4d。 SwiGLU 激活函数 [PaLM]。使用 SwiGLU 激活函数替换 ReLU 非线性以提高性能。使用 2 /3 4d 的维度而不是 PaLM 中的 4d。
旋转嵌入。移除了绝对位置嵌入,而是添加了旋转位置嵌入 (RoPE),在网络的每一层。 旋转嵌入。移除了绝对位置嵌入,而是添加了旋转位置嵌入 (RoPE),在网络的每一层。
![img](./docs/images/llama.png)
## 模型介绍 ## 模型介绍
LLama是一个基础语言模型的集合,参数范围从7B到65B。在数万亿的tokens上训练出的模型,并表明可以专门使用公开可用的数据集来训练最先进的模型,而不依赖于专有的和不可访问的数据集。 LLama是一个基础语言模型的集合,参数范围从7B到65B。在数万亿的tokens上训练出的模型,并表明可以专门使用公开可用的数据集来训练最先进的模型,而不依赖于专有的和不可访问的数据集。
...@@ -19,7 +27,7 @@ LLama是一个基础语言模型的集合,参数范围从7B到65B。在数万亿 ...@@ -19,7 +27,7 @@ LLama是一个基础语言模型的集合,参数范围从7B到65B。在数万亿
docker pull docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:fastertransformer-dtk23.04-latest docker pull docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:fastertransformer-dtk23.04-latest
# <Image ID>用上面拉取docker镜像的ID替换 # <Image ID>用上面拉取docker镜像的ID替换
# <Host Path>主机端路径 # <Host Path>主机端路径
# <Container Path>容器路径 # <Container Path>容器映射路径
docker run -it --name llama --shm-size=32G --device=/dev/kfd --device=/dev/dri/ --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --ulimit memlock=-1:-1 --ipc=host --network host --group-add video -v <Host Path>:<Container Path> <Image ID> /bin/bash docker run -it --name llama --shm-size=32G --device=/dev/kfd --device=/dev/dri/ --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --ulimit memlock=-1:-1 --ipc=host --network host --group-add video -v <Host Path>:<Container Path> <Image ID> /bin/bash
``` ```
...@@ -32,7 +40,32 @@ docker run -it --name llama --shm-size=32G --device=/dev/kfd --device=/dev/dri/ ...@@ -32,7 +40,32 @@ docker run -it --name llama --shm-size=32G --device=/dev/kfd --device=/dev/dri/
`source /opt/dtk-23.04/env.sh` `source /opt/dtk-23.04/env.sh`
## 数据集 ## 数据集
训练数据集:CCNet [67%], C4 [15%], GitHub [4.5%], Wikipedia [4.5%], Books [4.5%], ArXiv [2.5%], Stack Exchange[2%],Wikipedia和Books包括以下语言的数据:bg, ca, cs, da, de, en, es, fr, hr, hu, it, nl, pl, pt, ro, ru, sl, sr, sv, uk。评估数据集:BoolQ, PIQA, SIQA, HellaSwag, WinoGrande, ARC, OpenBookQA, NaturalQuestions, TriviaQA, RACE, MMLU, BIG-bench hard, GSM8k, RealToxicityPrompts, WinoGender, CrowS-Pairs。 训练数据集如下:
```
CCNet[67%]
C4[15%]
GitHub[4.5%]
Wikipedia[4.5%]
bg
ca
cs
...
Books[4.5%]
da
de
en
...
ArXiv[2.5%]
Stack Exchange[2%]
```
评估数据集如下:
```
BoolQ
PIQA
SIQA
...
```
## 推理 ## 推理
### 编译 ### 编译
...@@ -142,6 +175,9 @@ python ../examples/cpp/llama/llama_tokenizer.py ...@@ -142,6 +175,9 @@ python ../examples/cpp/llama/llama_tokenizer.py
其中,`tokenizer`为原模型路径 其中,`tokenizer`为原模型路径
``` ```
结果如下:
306 4658 278 6593 310 2834 338 304 5735 372 304 278 2989 342 29889 306 4658 393 591 526 599 1244 363 263 2769 322 393 591 526 599 1244 304 1371 1269 916 29889 306 4658 393 591 526 599 1244 304 5110 322 6548 322 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244 304 1371 1269 916 5110 322 6548 29889 306 4658 393 591 526 599 1244
## 精度 ## 精度
测试数据:"I believe the meaning of life is" (token id: 306, 4658, 278, 6593, 310, 2834, 338),使用的加速卡:1张 DCU-Z100L-32G 测试数据:"I believe the meaning of life is" (token id: 306, 4658, 278, 6593, 310, 2834, 338),使用的加速卡:1张 DCU-Z100L-32G
准确性数据: 准确性数据:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment