Skip to content

Commit 30278aa

Browse files
Update PyG notebooks and gradient links
1 parent b72c8d1 commit 30278aa

File tree

13 files changed

+73
-36
lines changed

13 files changed

+73
-36
lines changed

gnn/cluster_gcn/pytorch_geometric/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
# Cluster GCN on IPU: Node classification task on a large graph using sampling
1+
# Node Classification on IPU using Cluster-GCN - Training with PyTorch Geometric
22

33
In this notebook cluster graph convolutional networks are used for node classification, using cluster sampling. This model has been optimised for Graphcore's IPU.
44

5+
Run our Cluster GCN training on Paperspace.
6+
<br>
7+
[![Gradient](../../../gradient-badge.svg)](https://ipu.dev/PmAtSw)
8+
59
| Framework | Domain | Model | Datasets | Tasks | Training | Inference | Reference |
610
|-----------|--------|-------|----------|-------|----------|-----------|-----------|
711
| PyTorch | GNNs | CGCN | Reddit | Node Classification | <div style="text-align: center;">✅ <br>Min. 4 IPUs (POD4) required | <p style="text-align: center;">❌ | [Cluster-GCN: An Efficient Algorithm for Training Deep and Large Graph Convolutional Networks](https://arxiv.org/pdf/1905.07953.pdf) |

gnn/cluster_gcn/pytorch_geometric/node_classification_with_cluster_gcn.ipynb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@
1515
"id": "361b1074",
1616
"metadata": {},
1717
"source": [
18-
"Cluster GCN on IPU: Node classification task on a large graph using sampling\n",
18+
"Node Classification on IPU using Cluster-GCN - Training with PyTorch Geometric\n",
1919
"==================\n",
2020
"\n",
2121
"This notebook demonstrates training a Cluster GCN model presented in [Cluster-GCN: An Efficient Algorithm for Training Deep and Large Graph Convolutional Networks](https://arxiv.org/pdf/1905.07953.pdf) with PyTorch Geometric on the Graphcore IPU. We will use the Reddit dataset from [Inductive Representation Learning on Large Graphs](https://arxiv.org/abs/1706.02216) and train the model to predict the community a post belongs to.\n",
2222
"\n",
23+
"| Domain | Tasks | Model | Datasets | Workflow | Number of IPUs | Execution time |\n",
24+
"|---------|-------|-------|----------|----------|--------------------|----------------|\n",
25+
"| GNNs | Node Classification | CGCN | Reddit | Training, evaluation | recommended: 4 | 20mn |\n",
26+
"\n",
2327
"This notebook assumes some familiarity with PopTorch as well as PyTorch Geometric (PyG). For additional resources please consult:\n",
2428
"\n",
2529
"* [PopTorch Documentation](https://docs.graphcore.ai/projects/poptorch-user-guide/en/latest/index.html),\n",
@@ -726,7 +730,7 @@
726730
],
727731
"metadata": {
728732
"kernelspec": {
729-
"display_name": "3.2.0+1262_poptorch",
733+
"display_name": "3.2.0+1277_poptorch",
730734
"language": "python",
731735
"name": "python3"
732736
},
@@ -740,7 +744,7 @@
740744
"name": "python",
741745
"nbconvert_exporter": "python",
742746
"pygments_lexer": "ipython3",
743-
"version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]"
747+
"version": "3.8.10 (default, Mar 13 2023, 10:26:41) \n[GCC 9.4.0]"
744748
},
745749
"traceability": {
746750
"sdk_version": "3.2.0-EA.1+1249",
@@ -750,7 +754,7 @@
750754
},
751755
"vscode": {
752756
"interpreter": {
753-
"hash": "4b7133ac454a965c7b25bf17fb22ff5a4b1e3a6d812b3e17a861b05f76606f09"
757+
"hash": "14ed74787bcb3a85d33b99e2a461605961fba8ba6d9ddfcf06c9973f1378dba0"
754758
}
755759
}
756760
},

gnn/message_passing/pytorch_geometric/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
# Molecular property prediction with GIN
1+
# Molecular property prediction on IPU using GIN - Training with PyTorch Geometric
22

33
In this notebook a Graph Isomorphism Network (GIN) is used to perform graph classification for molecular property prediction. The model has been optimised for Graphcore's IPU.
44

5+
Run our GIN training on Paperspace.
6+
<br>
7+
[![Gradient](../../../gradient-badge.svg)](https://ipu.dev/1vOXXi)
8+
59
| Framework | Domain | Model | Datasets | Tasks | Training | Inference | Reference |
610
|-----------|--------|-------|----------|-------|----------|-----------|-----------|
711
| PyTorch | GNNs | GIN | NCI1 | Graph Classification | <div style="text-align: center;">✅ <br>Min. 4 IPUs (POD4) required | <p style="text-align: center;">❌ | [Graph Isomorphism Network](https://arxiv.org/pdf/1810.00826.pdf) |

gnn/message_passing/pytorch_geometric/molecular_property_prediction_with_gin.ipynb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515
"id": "d5193627",
1616
"metadata": {},
1717
"source": [
18-
"## Graph Classification with Graph Isomorphism Networks\n",
18+
"## Molecular property prediction on IPU using GIN - Training with PyTorch Geometric\n",
1919
"\n",
2020
"In this tutorial we show an example of how to perform the task of graph classification using the [Graph Isomorphism Network](https://arxiv.org/pdf/1810.00826.pdf) architecture on the Graphcore IPU. This tutorial builds on the [Graph Classification](https://colab.research.google.com/drive/1I8a0DfQ3fI7Njc62__mVXUlcAleUclnb?usp=sharing#scrollTo=1tBMhOrq4JKw) introduction notebook provided by PyTorch Geometric with modifications required in order to use Poptorch. \n",
2121
"\n",
22+
"| Domain | Tasks | Model | Datasets | Workflow | Number of IPUs | Execution time |\n",
23+
"|---------|-------|-------|----------|----------|--------------------|----------------|\n",
24+
"| GNNs | Graph Classification | GIN | NCI1 | Training, evaluation | recommended: 4 | 20mn |\n",
25+
"\n",
2226
"This notebook assumes some familiarity with PopTorch as well as PyTorch Geometric (PyG). For additional resources please consult:\n",
2327
"\n",
2428
"* [PopTorch Documentation](https://docs.graphcore.ai/projects/poptorch-user-guide/en/latest/index.html)\n",
@@ -767,7 +771,7 @@
767771
],
768772
"metadata": {
769773
"kernelspec": {
770-
"display_name": "3.2.0+1262_poptorch",
774+
"display_name": "3.2.0+1277_poptorch",
771775
"language": "python",
772776
"name": "python3"
773777
},
@@ -781,7 +785,7 @@
781785
"name": "python",
782786
"nbconvert_exporter": "python",
783787
"pygments_lexer": "ipython3",
784-
"version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]"
788+
"version": "3.8.10 (default, Mar 13 2023, 10:26:41) \n[GCC 9.4.0]"
785789
},
786790
"traceability": {
787791
"sdk_version": "3.2.0-EA.1+1249",
@@ -791,7 +795,7 @@
791795
},
792796
"vscode": {
793797
"interpreter": {
794-
"hash": "4b7133ac454a965c7b25bf17fb22ff5a4b1e3a6d812b3e17a861b05f76606f09"
798+
"hash": "14ed74787bcb3a85d33b99e2a461605961fba8ba6d9ddfcf06c9973f1378dba0"
795799
}
796800
}
797801
},

gnn/nbfnet/pytorch_geometric/NBFNet_training.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,18 @@
1414
"id": "73b4dca6-3257-4709-aac0-9ae6441216aa",
1515
"metadata": {},
1616
"source": [
17-
"# Training Neural Bellman-Ford networks (NBFnet) for inductive knowledge graph link prediction on IPUs\n",
17+
"# Training Neural Bellman-Ford networks (NBFnet) for inductive knowledge graph link prediction on IPUs \n",
1818
"\n",
1919
"<a href=\"https://arxiv.org/abs/2106.06935\" target=\"_blank\">Neural Bellman-Ford networks (NBFNet)</a> is a model that generalises path-based reasoning models for predicting links in homogeneous and heterogeneous graphs. \n",
2020
"\n",
2121
"In this notebook we use NBFNet for link prediction in the FB15k-237 knowledge graph with 14541 entities, 237 relation types and 272115 triples. However in practice we explicitly insert reverse edges, which brings us to a total of 474 relation types and 544230 triples.\n",
2222
"\n",
2323
"Unlike many other knowledge graph completion models, NBFNet can be *inductive*, in other words it can generalise to entities that do not appear in the training data. To demonstrate this inductive behaviour we train the model on a small subset of the graph (4707 entities, 54406 triples) and perform inference on the complete FB15k-237 graph.\n",
2424
"\n",
25+
"| Domain | Tasks | Model | Datasets | Workflow | Number of IPUs | Execution time |\n",
26+
"|---------|-------|-------|----------|----------|--------------------|----------------|\n",
27+
"| GNNs | Link Prediction | NBFNet | FB15k-237 | Training, evaluation | recommended: 16 (min: 4) | 20mn |\n",
28+
"\n",
2529
"This notebook assumes some familiarity with PopTorch as well as PyTorch Geometric (PyG). For additional resources please consult:\n",
2630
"* [PopTorch Documentation](https://docs.graphcore.ai/projects/poptorch-user-guide/en/latest/index.html),\n",
2731
"* [PopTorch Examples and Tutorials](https://docs.graphcore.ai/en/latest/examples.html#pytorch),\n",
@@ -617,7 +621,7 @@
617621
"name": "python",
618622
"nbconvert_exporter": "python",
619623
"pygments_lexer": "ipython3",
620-
"version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]"
624+
"version": "3.8.10 (default, Mar 13 2023, 10:26:41) \n[GCC 9.4.0]"
621625
},
622626
"pycharm": {
623627
"stem_cell": {

gnn/nbfnet/pytorch_geometric/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# NBFNet: Neural Bellman-Ford Networks
1+
# Training Neural Bellman-Ford networks (NBFnet) for inductive knowledge graph link prediction on IPUs
22

33
This directory contains a PyTorch Geometric implementation of [NBFNet](https://arxiv.org/abs/2106.06935) used for link
44
prediction in homogeneous and heterogeneous graphs. The model has been optimised for Graphcore's IPU.
55

66
Run inductive training on the FB15k-237 knowledge graph on Paperspace.
77
<br>
8-
[![Gradient](../../../gradient-badge.svg)](TODO)
8+
[![Gradient](../../../gradient-badge.svg)](https://ipu.dev/EzpMQD)
99

1010
| Framework | Domain | Model | Datasets | Tasks | Training | Inference | Reference |
1111
|-----------|--------|-------|----------|-------|----------|-----------|-----------|

gnn/schnet/pytorch_geometric/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
# Molecular property prediction with SchNet
1+
# Molecular property prediction on IPU using SchNet - Training with PyTorch Geometric
22

33
In this notebook an SchNet GNN is used to perform graph classification for molecular property prediction. The model has been optimised for Graphcore's IPU.
44

5+
Run our SchNet training on Paperspace.
6+
<br>
7+
[![Gradient](../../../gradient-badge.svg)](https://ipu.dev/zUl8uW)
8+
59
| Framework | Domain | Model | Datasets | Tasks | Training | Inference | Reference |
610
|-----------|--------|-------|----------|-------|----------|-----------|-----------|
711
| PyTorch | GNNs | SchNet | QM9 | Graph Classification | <div style="text-align: center;">✅ <br>Min. 4 IPUs (POD4) required | <p style="text-align: center;">❌ | [SchNet graph neural network](https://arxiv.org/abs/1712.06113) |

gnn/schnet/pytorch_geometric/molecular_property_prediction_with_schnet.ipynb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@
1414
"id": "3e1fbc52",
1515
"metadata": {},
1616
"source": [
17-
"Prediction of Molecular Properties using SchNet on Graphcore IPUs\n",
17+
"Molecular property prediction on IPU using SchNet - Training with PyTorch Geometric\n",
1818
"=================================================================\n",
1919
"\n",
2020
"This notebook demonstrates training a [SchNet graph neural network](https://arxiv.org/abs/1712.06113) with PyTorch Geometric on the Graphcore IPU. We will use the QM9 dataset from the [MoleculeNet: A Benchmark for Molecular\n",
2121
" Machine Learning](https://arxiv.org/abs/1703.00564) paper and train the SchNet model to predict the HOMO-LUMO energy gap.\n",
2222
"\n",
23+
"| Domain | Tasks | Model | Datasets | Workflow | Number of IPUs | Execution time |\n",
24+
"|---------|-------|-------|----------|----------|--------------------|----------------|\n",
25+
"| GNNs | Graph Classification | SchNet | QM9 | Training, evaluation | recommended: 16 (min: 4) | 20mn |\n",
26+
"\n",
2327
"This notebook assumes some familiarity with PopTorch as well as PyTorch Geometric (PyG). For additional resources please consult:\n",
2428
"\n",
2529
"* [PopTorch Documentation](https://docs.graphcore.ai/projects/poptorch-user-guide/en/latest/index.html)\n",
@@ -943,7 +947,7 @@
943947
],
944948
"metadata": {
945949
"kernelspec": {
946-
"display_name": "3.2.0+1262_poptorch",
950+
"display_name": "3.2.0+1277_poptorch",
947951
"language": "python",
948952
"name": "python3"
949953
},
@@ -957,7 +961,7 @@
957961
"name": "python",
958962
"nbconvert_exporter": "python",
959963
"pygments_lexer": "ipython3",
960-
"version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]"
964+
"version": "3.8.10 (default, Mar 13 2023, 10:26:41) \n[GCC 9.4.0]"
961965
},
962966
"traceability": {
963967
"sdk_version": "3.2.0-EA.1+1249",
@@ -967,7 +971,7 @@
967971
},
968972
"vscode": {
969973
"interpreter": {
970-
"hash": "4b7133ac454a965c7b25bf17fb22ff5a4b1e3a6d812b3e17a861b05f76606f09"
974+
"hash": "14ed74787bcb3a85d33b99e2a461605961fba8ba6d9ddfcf06c9973f1378dba0"
971975
}
972976
}
973977
},

gnn/tgn/pytorch/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Temporal Graph Networks
1+
# Training dynamic graphs on IPU using Temporal Graph Networks (TGN)
22

33
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.
44

55
Run our TGN on paperspace.
66
<br>
7-
[![Gradient](../../../gradient-badge.svg)](https://ipu.dev/3CG1WqL)
7+
[![Gradient](../../../gradient-badge.svg)](https://ipu.dev/jffnhe)
88

99
| Framework | Domain | Model | Datasets | Tasks | Training | Inference | Reference |
1010
|-----------|--------|-------|----------|-------|----------|-----------|-----------|

gnn/tgn/pytorch/Train_TGN.ipynb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,24 @@
99
]
1010
},
1111
{
12+
"attachments": {},
1213
"cell_type": "markdown",
1314
"id": "c820e409-be83-40ba-b93e-83f7d82d1227",
1415
"metadata": {
1516
"tags": []
1617
},
1718
"source": [
18-
"# Temporal Graph Networks training\n",
19+
"# Training dynamic graphs on IPU using Temporal Graph Networks (TGN)\n",
20+
"\n",
1921
"This notebook demonstrates how to train [Temporal Graph Networks](https://arxiv.org/abs/2006.10637)\n",
2022
"(TGNs) on the IPU. See our [blog post](https://www.graphcore.ai/posts/accelerating-and-scaling-temporal-graph-networks-on-the-graphcore-ipu) for details on\n",
2123
"performance and scaling.\n",
2224
"TGN can be used to predict connections in a dynamically evolving graph. This application looks at graphs that gain edges over time. A typical use case is a social network where users form new connections over time, or a recommendation system where new edges represent an interaction of a user with a product or content.\n",
2325
"\n",
26+
"| Domain | Tasks | Model | Datasets | Workflow | Number of IPUs | Execution time |\n",
27+
"|---------|-------|-------|----------|----------|--------------------|----------------|\n",
28+
"| GNNs | Link Prediction | TGN | JODIE | Training, evaluation | recommended: 4 | 20mn |\n",
29+
"\n",
2430
"![dynamic_graph.png](static/dynamic_graph.png)\n",
2531
"\n",
2632
"In this notebook we apply TGN to the [JODIE Wikipedia dataset](https://snap.stanford.edu/jodie/), a dynamic graph of 1,000 Wikipedia articles and 8,227 Wikipedia users. 157,474 time-stamped edges describe the interactions of users with articles."

0 commit comments

Comments
 (0)