You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This directory contains a PyTorch implementation of [Temporal Graph Networks](https://arxiv.org/abs/2006.10637) to train on IPU.
4
-
This implementation is based on [`examples/tgn.py`](https://github.com/rusty1s/pytorch_geometric/blob/master/examples/tgn.py) from PyTorch-Geometric.
3
+
Temporal graph networks for link prediction in dynamic graphs, based on [`examples/tgn.py`](https://github.com/rusty1s/pytorch_geometric/blob/master/examples/tgn.py) from PyTorch-Geometric, optimised for Graphcore's IPU.
| Pytorch | GNNs | TGN | JODIE | Link prediction | ✅ | ❌ |[Temporal Graph Networks for Deep Learning on Dynamic Graphs](https://arxiv.org/abs/2006.10637v3)|
11
12
12
-
Now install the dependencies of the TGN model:
13
+
14
+
## Instructions summary
15
+
16
+
1. Install and enable the Poplar SDK (see Poplar SDK setup)
17
+
18
+
2. Install the system and Python requirements (see Environment setup)
19
+
20
+
21
+
## Poplar SDK setup
22
+
To check if your Poplar SDK has already been enabled, run:
23
+
```bash
24
+
echo$POPLAR_SDK_ENABLED
25
+
```
26
+
27
+
If no path is provided, then follow these steps:
28
+
1. Navigate to your Poplar SDK root directory
29
+
30
+
2. Enable the Poplar SDK with:
31
+
```bash
32
+
cd poplar-<OS version>-<SDK version>-<hash>
33
+
. enable.sh
34
+
```
35
+
36
+
3. Additionally, enable PopArt with:
37
+
```bash
38
+
cd popart-<OS version>-<SDK version>-<hash>
39
+
. enable.sh
40
+
```
41
+
42
+
More detailed instructions on setting up your environment are available in the [poplar quick start guide](https://docs.graphcore.ai/projects/graphcloud-poplar-quick-start/en/latest/).
43
+
44
+
45
+
## Environment setup
46
+
To prepare your environment, follow these steps:
47
+
48
+
1. Create and activate a Python3 virtual environment:
13
49
```bash
14
-
pip install -r requirements.txt
50
+
python3 -m venv <venv name>
51
+
source<venv path>/bin/activate
15
52
```
16
53
17
-
### Train the model
18
-
To train the model run
54
+
2. Navigate to the Poplar SDK root directory
55
+
56
+
3. Install the PopTorch (Pytorch) wheel:
57
+
```bash
58
+
cd<poplar sdk root dir>
59
+
pip3 install poptorch...x86_64.whl
60
+
```
61
+
62
+
4. Navigate to this example's root directory
63
+
64
+
5. Install the Python requirements:
19
65
```bash
20
-
python train.py
66
+
pip3 install -r requirements.txt
21
67
```
22
68
23
-
The following flags can be used to adjust the behaviour of `train.py`
24
69
25
-
--data: directory to load/save the data (default: data/JODIE) <br>
26
-
-t, --target: device to run on (choices: {ipu, cpu}, default: ipu) <br>
27
-
-d, --dtype: floating point format (default: float32) <br>
28
-
-e, --epochs: number of epochs to train for (default: 50) <br>
29
-
--lr: learning rate (default: 0.0001) <br>
30
-
--dropout: dropout rate in the attention module (default: 0.1) <br>
To run a tested and optimised configuration and to reproduce the performance shown on our [performance results page](https://www.graphcore.ai/performance-results), use the `examples_utils` module (installed automatically as part of the environment setup) to run one or more benchmarks. The benchmarks are provided in the `benchmarks.yml` file in this example's root directory.
35
73
36
74
For example:
@@ -51,4 +89,4 @@ For more information on using the examples-utils benchmarking module, please ref
51
89
### License
52
90
This application is licensed under the MIT license, see the LICENSE file at the top-level of this repository.
53
91
54
-
This directory includes derived work from the PyTorch Geometric repository, https://github.com/pyg-team/pytorch_geometric by Matthias Fey and Jiaxuan You, published under the MIT license
92
+
This directory includes derived work from the PyTorch Geometric repository, https://github.com/pyg-team/pytorch_geometric by Matthias Fey and Jiaxuan You, published under the MIT license
Copy file name to clipboardExpand all lines: vision/vit/pytorch/README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,10 @@
1
1
# ViT (Vision Transformer)
2
2
Vision Transformer for image recognition, optimised for Graphcore's IPU. Based on the models provided by the [`transformers`](https://github.com/huggingface/transformers) library and from [jeonsworld](https://github.com/jeonsworld/ViT-pytorch)
0 commit comments