README_HIP.md 965 Bytes
Newer Older
lishen's avatar
lishen committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# DLIB

## 环境配置

使用DCU编译之前,需要准备编译环境。参考
[environment prepare](environment_prepare.md)

## 使用源码安装

### 编译环境准备(以dtk-23.04版本为例)

- 拉取代码

  ```
  git clone -b dtk-23.04 http://developer.hpccube.com/codes/aicomponent/warpctc.git
  ```
-[开发者社区](https://developer.hpccube.com/tool/#sdk) DCU Toolkit 中下载 DTK-23.04 解压至 /opt/ 路径下,并建立软链接

  ```
  cd /opt && ln -s dtk-23.04 dtk
  ```

- 导入环境变量以及安装必要依赖库

  ```shell
  source /opt/dtk/env.sh
  ```

### 编译安装

#### 编译 Python API

- 使用python安装

```shell
python setup.py install
```

- 使用python编译whl包

```shell
python setup.py bdist_wheel
```

### 测试

- 验证warpctc的loss正确性(CPU和GPU的一致性)

```shell
python3 test_gpu.py
```

- 验证warpctc的loss的GPU加速效果

```shell
python3 test_gpu_speed.py
```