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
BLOOM_fastertransformer
Commits
53f20a9d
Commit
53f20a9d
authored
Nov 24, 2023
by
zhuwenwen
Browse files
update to dtk23.10
parent
c5334624
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
18 deletions
+9
-18
.gitmodules
.gitmodules
+1
-1
README.md
README.md
+8
-17
No files found.
.gitmodules
View file @
53f20a9d
[submodule "fastertransformer"]
[submodule "fastertransformer"]
path = fastertransformer
path = fastertransformer
url = http://developer.hpccube.com/codes/aicomponent/fastertransformer.git
url = http://developer.hpccube.com/codes/aicomponent/fastertransformer.git
branch = develop
branch = fastertransformer-dtk23.10
\ No newline at end of file
\ No newline at end of file
README.md
View file @
53f20a9d
...
@@ -23,26 +23,20 @@ BLOOM是一种自回归大型语言模型(LLM),经过训练,可使用工业
...
@@ -23,26 +23,20 @@ BLOOM是一种自回归大型语言模型(LLM),经过训练,可使用工业
## 环境配置
## 环境配置
提供
[
光源
](
https://www.sourcefind.cn/#/
service-details
)
拉取推理的docker镜像:
提供
[
光源
](
https://www.sourcefind.cn/#/
image/dcu/custom
)
拉取推理的docker镜像:
```
```
docker pull docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:fastertransformer-dtk23.0
4-latest
docker pull docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:fastertransformer-dtk23.
1
0
# <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
--privileged
--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
```
```
镜像版本依赖:
镜像版本依赖:
*
DTK驱动:dtk23.0
4
*
DTK驱动:dtk23.
1
0
*
Pytorch: 1.1
0
*
Pytorch: 1.1
3
*
python: python3.8
*
python: python3.8
激活镜像环境:
`source /opt/dtk-23.04/env.sh`
测试目录:
`/opt/FasterTransformer`
## 数据集
## 数据集
无
无
...
@@ -52,8 +46,8 @@ docker run -it --name llama --shm-size=32G --device=/dev/kfd --device=/dev/dri/
...
@@ -52,8 +46,8 @@ docker run -it --name llama --shm-size=32G --device=/dev/kfd --device=/dev/dri/
```
bash
```
bash
git clone http://developer.hpccube.com/codes/modelzoo/bloom_fastertransformer.git
git clone http://developer.hpccube.com/codes/modelzoo/bloom_fastertransformer.git
cd
bloom_fastertransformer
cd
bloom_fastertransformer
mkdir
build
mkdir
-p
astertransformer/
build
cd
build
cd
astertransformer/
build
git submodule init
&&
git submodule update
git submodule init
&&
git submodule update
cmake
-DCMAKE_BUILD_TYPE
=
Release
-DBUILD_MULTI_GPU
=
ON
-DCMAKE_CXX_COMPILER
=
nvcc ..
cmake
-DCMAKE_BUILD_TYPE
=
Release
-DBUILD_MULTI_GPU
=
ON
-DCMAKE_CXX_COMPILER
=
nvcc ..
export
C_INCLUDE_PATH
=
$PWD
/_deps/googletest-src/googletest/include
${
C_INCLUDE_PATH
:+:
${
C_INCLUDE_PATH
}}
export
C_INCLUDE_PATH
=
$PWD
/_deps/googletest-src/googletest/include
${
C_INCLUDE_PATH
:+:
${
C_INCLUDE_PATH
}}
...
@@ -63,7 +57,6 @@ make -j12
...
@@ -63,7 +57,6 @@ make -j12
运行前:
运行前:
export
LD_LIBRARY_PATH
=
$PWD
/src/fastertransformer/utils/gemm_test/CMakeFiles/gpt_gemm_func.dir:
$LD_LIBRARY_PATH
export
LD_LIBRARY_PATH
=
$PWD
/src/fastertransformer/utils/gemm_test/CMakeFiles/gpt_gemm_func.dir:
$LD_LIBRARY_PATH
```
```
注:若不重新编译,直接使用测试目录代码即可。
### 模型下载
### 模型下载
...
@@ -72,7 +65,6 @@ export LD_LIBRARY_PATH=$PWD/src/fastertransformer/utils/gemm_test/CMakeFiles/gpt
...
@@ -72,7 +65,6 @@ export LD_LIBRARY_PATH=$PWD/src/fastertransformer/utils/gemm_test/CMakeFiles/gpt
模型转换
模型转换
```
bash
```
bash
cd
/opt/FasterTransformer/build
python ../examples/pytorch/gpt/utils/huggingface_bloom_convert.py
\
python ../examples/pytorch/gpt/utils/huggingface_bloom_convert.py
\
--input-dir
=
/data/models/llama-7b-infer/
\
--input-dir
=
/data/models/llama-7b-infer/
\
--output-dir
=
/data/models/llama-7b-hf/
\
--output-dir
=
/data/models/llama-7b-hf/
\
...
@@ -127,8 +119,7 @@ build/
...
@@ -127,8 +119,7 @@ build/
```
```
执行一下命令可以解析out结果:
执行一下命令可以解析out结果:
```
bash
```
bash
python bloom_token_converter.py
# 使用镜像代码
python ../examples/cpp/multi_gpu_gpt/bloom_tokenizer.py
python ../examples/cpp/multi_gpu_gpt/bloom_tokenizer.py
# 若重新编译
其中,
`
tokenizer
`
为原模型路径
其中,
`
tokenizer
`
为原模型路径
```
```
测试数据:"Translate to English: Je t’aime." (token id: 153772, 427, 9522, 6395, 76721, 68258, 17),使用的加速卡:1张 DCU-Z100L-32G
测试数据:"Translate to English: Je t’aime." (token id: 153772, 427, 9522, 6395, 76721, 68258, 17),使用的加速卡:1张 DCU-Z100L-32G
...
...
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