README.md 1.72 KB
Newer Older
1
# APEX
Christian Sarofeen's avatar
Christian Sarofeen committed
2

3
## 介绍
Michael Carilli's avatar
Michael Carilli committed
4

5
[Introduction](README_ORIGIN.md)
Michael Carilli's avatar
Michael Carilli committed
6

7
## 安装
8

9
### System Requirements
Michael Carilli's avatar
Michael Carilli committed
10

11
- Linux.
Michael Carilli's avatar
Michael Carilli committed
12

13
- Python 3.7, 3.8, 3.9
Michael Carilli's avatar
Michael Carilli committed
14

15
- (**推荐**) Upgrade pip
Michael Carilli's avatar
Michael Carilli committed
16

17
18
19
  ```
  python3 -m pip install --upgrade pip #--user
  ```
Michael Carilli's avatar
Michael Carilli committed
20

21
22
23
24
25
### 使用pip安装(以dtk-23.04版本为例)
可以在光合[光合开发者社区](https://developer.hpccube.com/tool/#sdk) AI 生态包中获取最新的 apex Release 版本(需对应 DCU Toolkit 版本与 python 版本)
```bash 
python3 -m pip install apex-0.1+git2d8b360.abi0.dtk2304-cp37-cp37m-linux_x86_64.whl
```
ptrblck's avatar
ptrblck committed
26

27
### 使用源码安装
ptrblck's avatar
ptrblck committed
28

29
#### 编译环境准备(以dtk-23.04版本为例)
ptrblck's avatar
ptrblck committed
30

31
- 拉取 apex 代码
ptrblck's avatar
ptrblck committed
32

33
34
35
  ```
  git clone -b dtk-23.04 http://developer.hpccube.com/codes/aicomponent/apex.git
  ```
ptrblck's avatar
ptrblck committed
36

37
-[开发者社区](https://developer.hpccube.com/tool/#sdk) DCU Toolkit 中下载 DTK-23.04 解压至 /opt/ 路径下,并建立软链接
ptrblck's avatar
ptrblck committed
38

39
40
41
  ```
  cd /opt && ln -s dtk-23.04 dtk
  ```
ptrblck's avatar
ptrblck committed
42

43
44
45
46
- 在光合[光合开发者社区](https://developer.hpccube.com/tool/#sdk) AI 生态包中获取对应的 pytorch Release 版本(需对应 DCU Toolkit 版本与 python 版本)
  ```bash
  python3 -m pip install torch-1.13.1a0+git4c8a1fe.abi0.dtk2304-cp37-cp37m-linux_x86_64.whl
  ```
Christian Sarofeen's avatar
Christian Sarofeen committed
47

48
- 导入环境变量以及安装必要依赖库
Michael Carilli's avatar
Michael Carilli committed
49

50
51
  ```bash
  source /opt/dtk/env.sh
Michael Carilli's avatar
Michael Carilli committed
52

53
  export PYTORCH_ROCM_ARCH="gfx906;gfx926"
mcarilli's avatar
mcarilli committed
54

55
56
57
58
  MAX_JOBS=16
  pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
  pip3 install wheel -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
  ```
Christian Sarofeen's avatar
Christian Sarofeen committed
59
60


61
#### 编译安装
lcskrishna's avatar
lcskrishna committed
62

63
64
65
66
67
68
- 执行编译命令
  ```shell
  cd apex
  CXX=hipcc CC=hipcc python3 setup.py --cpp_ext --cuda_ext  bdist_wheel
  pip install dist/apex*
  ```
lcskrishna's avatar
lcskrishna committed
69