Skip to content

Commit

Permalink
modify hip readme (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
401qingkong committed Dec 6, 2022
1 parent a68738b commit 51d9135
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions 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 \
Expand Down

0 comments on commit 51d9135

Please sign in to comment.