README.md 1.07 KB
Newer Older
1
# DLIB
lishen's avatar
lishen committed
2

3
## 环境配置
lishen's avatar
lishen committed
4

5
6
使用DCU编译之前,需要准备编译环境。参考
[environment prepare](environment_prepare.md)
lishen's avatar
lishen committed
7

8
## 使用源码安装
lishen's avatar
lishen committed
9

10
### 编译环境准备(以dtk-23.04版本为例)
lishen's avatar
lishen committed
11

12
- 拉取代码
lishen's avatar
lishen committed
13

14
15
16
17
18
19
20
21
22
23
24
25
26
27
  ```
  git clone -b develop 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
  ```
lishen's avatar
lishen committed
28

29
30
31
32
33
34
35
### 编译安装

#### 编译 Python API

- 使用python安装

```shell
lishen's avatar
lishen committed
36
37
38
39
cd pytorch_binding
python setup.py install
```

40
41
42
43
44
- 使用python编译whl包

```shell
cd pytorch_binding
python setup.py bdist_wheel
lishen's avatar
lishen committed
45
```
46
47
48
49
50
51
52
53

### 测试

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

```shell
cd pytorch_binding/tests
python3 test_gpu.py
lishen's avatar
lishen committed
54
55
```

56
- 验证warpctc的loss的GPU加速效果
lishen's avatar
lishen committed
57

58
59
60
```shell
cd pytorch_binding/tests
python3 test_gpu_speed.py
lishen's avatar
lishen committed
61
```
lishen's avatar
lishen committed
62
63
64

## 参考
- [README_ORIGIN](README_ORIGIN.md)
65
66
67