README.md 1.63 KB
Newer Older
lisj's avatar
lisj committed
1
# DGL
2

lisj's avatar
lisj committed
3
4
5
6
7
## 安装
安装DGL,你需要
+ dtk 22.10
+ Python 3.9
其余版本需源码安装
8

lisj's avatar
lisj committed
9
10
### 使用pip安装
dgl whl包下载目录:[https://cancon.hpccube.com:65024/4/main/dgl/dtk22.10](https://cancon.hpccube.com:65024/4/main/dgl/dtk22.10)
11

lisj's avatar
lisj committed
12
13
14
```shell
pip install dgl* (下载的dgl的whl包)
```
15

lisj's avatar
lisj committed
16
17
18
19
20
### 使用源码安装
#### 编译环境准备
```shell
pip install setuptools=59.5.0 wheel
```
21

lisj's avatar
lisj committed
22
23
24
25
26
27
28
29
30
31
32
33
#### 编译安装
```shell
git clone -b 0.9.1-dgl https://developer.hpccube.com/codes/aicomponent/dgl
cd dgl
mkdir build && cd build
source $ROCM_PATH/env.sh
cmake -DUSE_HIP=ON -DCMAKE_BUILD_TYPE=Release ..
make -j16
cd ../python
python setup.py bdist_wheel 
pip install dist/dgl*
```
34
35


lisj's avatar
lisj committed
36
37
## 参考
- [README_ORIGIN](README_ORIGIN.md)
38

lisj's avatar
lisj committed
39
40
41
42
43
44
## 适配HIP移植修改
```shell
1. cmake相关
    修改CMakeLists.txt,增加USE_HIP编译控制
    新增cmake/modules/ROCM.cmake,参考cmake/modules/CUDA.cmake进行编译配置
    增加CUDART_VERSION相关宏参数
45

lisj's avatar
lisj committed
46
47
48
2. 源码修改
添加宏判断,设备上不支持iostream
    src/array/selector.h:34
49

lisj's avatar
lisj committed
50
51
hip结构体hipPointerAttribute_t适配
    src/runtime/cuda/cuda_device_api.cc:251
52

lisj's avatar
lisj committed
53
54
55
56
添加显式基类限定词
    src/runtime/cuda/cuda_hashtable.cu:60
    src/runtime/cuda/cuda_hashtable.cu:104
    src/runtime/cuda/cuda_hashtable.cu:110
57

lisj's avatar
lisj committed
58
59
60
添加对CUDART_VERSION相关的条件判断flag
    src/array/cuda/spmm_hetero.cu:59
    src/array/cuda/spmm_hetero.cu:133
61

lisj's avatar
lisj committed
62
63
注释CUB_VERSION相关的static_assert检查
    src/array/cuda/rowwise_sampling_prob.cu:20
64

lisj's avatar
lisj committed
65
66
注释CUDART_VERSION相关的static_assert检查
    src/array/cuda/atomic.cuh:83
67

lisj's avatar
lisj committed
68
69
增加__HIPCC__宏定义的检查
    include/dgl/array_iterator.h:9
70

lisj's avatar
lisj committed
71
```