"docker/Dockerfile.gb200" did not exist on "906dbc34f16442a7fcf06c7e4669ab32952b475d"
README.md 2.11 KB
Newer Older
yangzhong's avatar
yangzhong 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
# <div align="center"><strong>PyTorch Scatter</strong></div>
## 简介
PyTorch Scatter由一个小型扩展库组成,该扩展库包含用于PyTorch的高度优化的稀疏更新(分散和分段)操作,这些操作在主包中丢失。分散和分段运算可以粗略地描述为基于给定“群索引”张量的归约运算。分段运算需要对“组索引”张量进行排序,而分散运算则不受这些要求的约束。PyTorch Scatter官方github地址:[https://github.com/rusty1s/pytorch_scatter](https://github.com/rusty1s/pytorch_scatter)

## 安装

### 使用pip方式安装
pytorch-scatter whl包下载目录:[http://10.6.10.68:8000/customized/torch-scatter/dtk2310](http://10.6.10.68:8000/customized/torch-scatter/dtk2310),目前只提供有python3.8版本的whl包。
```shell
pip install torch_scatter* (下载的torch_scatter的whl包)
```
### 使用源码编译方式安装

#### 编译环境准备
- 安装相关依赖
```shell
pip install -r requirements.txt 
```
- 在首页 | 光合开发者社区下载 dtk23.10 解压至 /opt/ 路径下,并建立软链接
```shell
cd /opt && ln -s dtk-23.10 dtk
source /opt/dtk/env.sh
```
- 安装pytorch,pytorch whl包下载目录:[http://10.6.10.68:8000/debug/pytorch/dtk23.10/hipify/](http://10.6.10.68:8000/debug/pytorch/dtk23.10/hipify/),根据python、dtk版本,下载对应pytorch的whl包。安装命令如下:
```shell
pip install torch* (下载的torch的whl包)
```
#### 源码编译安装
```shell
git clone -b 2.0.9-release http://developer.hpccube.com/codes/aicomponent/torch-scatter.git
cd torch-scatter
python pymap_script.py /path/to/torch-scatter
python setup.py bdist_wheel
pip install dist/*.whl
yangzhong's avatar
yangzhong committed
35
```
yangzhong's avatar
yangzhong committed
36
37
38
## 单测
```shell
cd torch-scatter
yangzhong's avatar
yangzhong committed
39
40
python setup.py test
```
yangzhong's avatar
yangzhong committed
41
42
## Known Issue
完成安装进行单测时,会报错ImportError: Could not find module '_version_cpu' ~,在根目录/下查找一下,然后把库文件目录添加一下软链接即可。
yangzhong's avatar
yangzhong committed
43
44

```
yangzhong's avatar
yangzhong committed
45
46
47
find / -name "_version_cpu.so"
cd /torch-scatter/torch_scatter
ln -s /usr/local/lib/python3.8/site-packages/torch-scatter/* .
yangzhong's avatar
yangzhong committed
48
49
```

yangzhong's avatar
yangzhong committed
50
## 参考资料
quyuanhao123's avatar
quyuanhao123 committed
51

yangzhong's avatar
yangzhong committed
52
https://github.com/rusty1s/pytorch_scatter