From 51d9135d49a0f965cc04603f6f2aa9a74584b718 Mon Sep 17 00:00:00 2001 From: 401qingkong <1453805040@qq.com> Date: Tue, 6 Dec 2022 18:35:36 +0800 Subject: [PATCH] modify hip readme (#436) --- README_HIP.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/README_HIP.md b/README_HIP.md index 6d4dd2a8..65035652 100644 --- a/README_HIP.md +++ b/README_HIP.md @@ -1,30 +1,32 @@ -## Lightseq for HIP Quick Start -Now lighteq hip only support training. +## Lightseq HIP Quick Start +LightSeq supports CUDA backend and HIP backend. Now LightSeq HIP only support training. ### Build -1. 设置环境变量 +1. ENV Setting ```shell export C_INCLUDE_PATH=${ROCM_PATH}/rocblas/include:${ROCM_PATH}/rocrand/include/:${ROCM_PATH}/hiprand/include:${ROCM_PATH}/hip/include/hip:$ROCM_PATH/hip/include/hip/hsa_detail:$ROCM_PATH/hipcub/include/hipcub:$C_INCLUDE_PATH export CPLUS_INCLUDE_PATH=$C_INCLUDE_PATH export LD_LIBRART_PATH=${ROCM_PATH}/rocblas/lib/:${ROCM_PATH}/rocrand/lib:$LD_LIBRART_PATH export LIBRARY_PATH=${ROCM_PATH}/rocblas/lib/:$LIBRARY_PATH ``` -2. 编译lightseq +2. Compile ``` verbose=1 ENABLE_FP32=1 ENABLE_DEBUG=1 CXX=hipcc CC=hipcc python3 setup.py install bdist_wheel ``` -编译后在dist下生成whl文件,可以方便的迁移到其他平台环境使用。 -### Fast training from Fairseq +After compiling, whl file is generated under dist, which can be conveniently migrated to other platforms. + +### Fast training From Fairseq with LightSeq HIP You can experience lightning fast training by running following commands, Firstly install these requirements. ```shell -pip install lightseq fairseq sacremoses +pip install fairseq sacremoses ``` -python层同cuda环境运行方式完全一致,更多示例可以参考[README.md](README.md). +Users need no modification with python training. It works exactly the same as CUDA environment under the HIP backend. See [README.md](README.md) for more examples. + +You can set HIP_VISIBLE_DEVICES to specify which gpu card for training. Example of training transformer with LightSeq HIP is as follows: -如需指定加速卡运行,可使用HIP_VISIBLE_DEVICES指定。使用lightseq训练transformer示例: ``` export HIP_VISIBLE_DEVICES=0 lightseq-train /public/DL_DATA/wmt14_en_de_joined_dict \