Commit 89b31f29 authored by zhougaofeng's avatar zhougaofeng
Browse files

Update README.md

parent 6418bd69
Pipeline #1294 canceled with stages
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
## 算法原理 ## 算法原理
Yi-1.5-6B 是一个 decoder-only 的 transformer 模型,使用 SwiGLU激活函数、GQA、RoPE等 Yi-1.5是Yi的升级版本。它在Yi的基础上,使用一个高质量的500B token语料库进行持续的预训练,并在300万个多样化的微调样本上进行微调。与Yi相比,Yi-1.5在编程、数学、推理和遵循指令的能力方面表现更强,同时仍然保持了在语言理解、常识推理和阅读理解方面的卓越能力。
<div align=center>
<img src="./doc/model_accuracy.png"/>
</div>
## 环境配置 ## 环境配置
...@@ -19,11 +21,10 @@ Yi-1.5-6B 是一个 decoder-only 的 transformer 模型,使用 SwiGLU激活函 ...@@ -19,11 +21,10 @@ Yi-1.5-6B 是一个 decoder-only 的 transformer 模型,使用 SwiGLU激活函
``` ```
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-centos7.6-dtk24.04-py310 docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-centos7.6-dtk24.04-py310
docker run -it --shm-size=1024G -v /parastor/home/Yi-1.5-pytorch:/home/Yi-1.5-pytorch -v /opt/hyhal:/opt/hyhal --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name Yi-1.5 <your IMAGE ID> bash # <your IMAGE ID>为以上拉取的docker的镜像ID替换,本镜像为:c85ed27005f2 docker run -it --shm-size=1024G -v <Host Path>:<Container Path> -v /opt/hyhal:/opt/hyhal --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name Yi-1.5 <your IMAGE ID> bash # <your IMAGE ID>为以上拉取的docker的镜像ID替换,本镜像为:c85ed27005f2
cd /home/Yi-1.5-pytorch cd /home/Yi-1.5-pytorch
pip install -e .[torch,metrics] pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
# deepspeed、bitsandbytes可从whl.zip文件里获取安装: # bitsandbytes可从whl.zip文件里获取安装:
pip install deepspeed-0.12.3+das1.0+gita724046.abi0.dtk2404.torch2.1.0-cp310-cp310-manylinux2014_x86_64.whl
pip install bitsandbytes-0.42.0-py3-none-any.whl pip install bitsandbytes-0.42.0-py3-none-any.whl
``` ```
...@@ -34,10 +35,9 @@ pip install bitsandbytes-0.42.0-py3-none-any.whl ...@@ -34,10 +35,9 @@ pip install bitsandbytes-0.42.0-py3-none-any.whl
``` ```
docker build -t Yi-1.5-df:latest . docker build -t Yi-1.5-df:latest .
docker run -it --shm-size=1024G -v /parastor/home/Yi-1.5-pytorch:/home/Yi-1.5-pytorch -v /opt/hyhal:/opt/hyhal --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name Yi-1.5 Yi-1.5-df bash docker run -it --shm-size=1024G -v <Host Path>:<Container Path> -v /opt/hyhal:/opt/hyhal --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name Yi-1.5 Yi-1.5-df bash
pip install -r requirement.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
# deepspeed、bitsandbytes可从whl.zip文件里获取安装: # bitsandbytes可从whl.zip文件里获取安装:
pip install deepspeed-0.12.3+das1.0+gita724046.abi0.dtk2404.torch2.1.0-cp310-cp310-manylinux2014_x86_64.whl
pip install bitsandbytes-0.42.0-py3-none-any.whl pip install bitsandbytes-0.42.0-py3-none-any.whl
``` ```
...@@ -49,7 +49,7 @@ pip install bitsandbytes-0.42.0-py3-none-any.whl ...@@ -49,7 +49,7 @@ pip install bitsandbytes-0.42.0-py3-none-any.whl
关于本项目 DCU 显卡所需的特殊深度学习库可从[光合](https://developer.hpccube.com/tool/)开发者社区下载安装。 关于本项目 DCU 显卡所需的特殊深度学习库可从[光合](https://developer.hpccube.com/tool/)开发者社区下载安装。
``` ```
DTK驱动:dtk23.04 DTK驱动:dtk24.04
python:python3.10 python:python3.10
torch: 2.1.0 torch: 2.1.0
torchvision: 0.16.0 torchvision: 0.16.0
...@@ -78,13 +78,13 @@ pip install -r requirements.txt ...@@ -78,13 +78,13 @@ pip install -r requirements.txt
## 训练 ## 训练
一般情况下,ModelZoo 上的项目提供单机训练的启动方法即可,单机单卡、单机多卡至少提供其一训练方法。 根据实际路径修改模型路径和数据集路径
### 单机单卡 ### 单机单卡
``` ```
cd fintune cd fintune
sh single_dcu_finetune_lora.sh sh single_node.sh
``` ```
### 单机多卡 ### 单机多卡
...@@ -96,8 +96,8 @@ sh multi_node.sh ...@@ -96,8 +96,8 @@ sh multi_node.sh
## 推理 ## 推理
``` ```
cd examples/inference cd inference
sh single_node.sh sh 6B_single_dcu.sh
``` ```
## result ## result
...@@ -105,7 +105,7 @@ sh single_node.sh ...@@ -105,7 +105,7 @@ sh single_node.sh
使用的加速卡:2张 DCU-K100-64G 使用的加速卡:2张 DCU-K100-64G
<div align=center> <div align=center>
<img src="./doc/training_loss.png"/> <img src="./result/inf_result.png"/>
</div> </div>
### 精度 ### 精度
...@@ -117,7 +117,12 @@ sh single_node.sh ...@@ -117,7 +117,12 @@ sh single_node.sh
| DCU-K100 | 0.7647 | | DCU-K100 | 0.7647 |
| GPU-A800 | 0.7651 | | GPU-A800 | 0.7651 |
## 应用场景 ### 预训练权重
预训练权重下载中心: [huggingface](https://huggingface.co/01-ai/Yi-1.5-6B-Chat)
模型目录结构如下:
<div align=center>
<img src="./doc/model.png"/>
</div>
### 算法类别 ### 算法类别
...@@ -127,10 +132,9 @@ sh single_node.sh ...@@ -127,10 +132,9 @@ sh single_node.sh
`科研,教育,政府,金融` `科研,教育,政府,金融`
## 源码仓库及问题反馈 ## 源码仓库及问题反馈
- https://github.com/01-ai/Yi-1.5 - https://developer.hpccube.com/codes/modelzoo/yi_1.5_6b_pytorch
## 参考资料 ## 参考资料
......
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