Paddle Graph Learning
Project description
Paddle Graph Learning (PGL)
Paddle Graph Learning (PGL) is an efficient and flexible graph learning framework based on PaddlePaddle.
We provide python interfaces for storing/reading/querying graph structured data and two fundamental computational interfaces, which are walk based paradigm and message-passing based paradigm as shown in the above framework of PGL, for building cutting-edge graph learning algorithms. Combined with the PaddlePaddle deep learning framework, we are able to support both graph representation learning models and graph neural networks, and thus our framework has a wide range of graph-based applications.
Highlight: Efficient and Flexible Message Passing Paradigm
One of the most important benefits of graph neural networks compared to other models is the ability to use node-to-node connectivity information, but coding the communication between nodes is very cumbersome. At PGL we adopt Message Passing Paradigm similar to DGL to help to build a customize graph neural network easily. Users only need to write send
and recv
functions to easily implement a simple GCN. As shown in the following figure, for the first step the send function is defined on the edges of the graph, and the user can customize the send function $\phi^e$ to send the message from the source to the target node. For the second step, the recv function $\phi^v$ is responsible for aggregating $\oplus$ messages together from different sources.
As shown in the left of the following figure, to adapt general user-defined message aggregate functions, DGL uses the degree bucketing method to combine nodes with the same degree into a batch and then apply an aggregate function $\oplus$ on each batch serially. For our PGL UDF aggregate function, we organize the message as a LodTensor in PaddlePaddle taking the message as variable length sequences. And we utilize the features of LodTensor in Paddle to obtain fast parallel aggregation.
Users only need to call the sequence_ops
functions provided by Paddle to easily implement efficient message aggregation. For examples, using sequence_pool
to sum the neighbor message.
import paddle.fluid as fluid
def recv(msg):
return fluid.layers.sequence_pool(msg, "sum")
Although DGL does some kernel fusion optimization for general sum, max and other aggregate functions with scatter-gather. For complex user-defined functions with degree bucketing algorithm, the serial execution for each degree bucket cannot take full advantage of the performance improvement provided by GPU. However, operations on the PGL LodTensor-based message is performed in parallel, which can fully utilize GPU parallel optimization. Even without scatter-gather optimization, PGL still has excellent performance. Of course, we still provide build-in scatter-optimized message aggregation functions.
Performance
We test all the GNN algorithms with Tesla V100-SXM2-16G running for 200 epochs to get average speeds. And we report the accuracy on test dataset without early stoppping.
Dataset | Model | PGL Accuracy | PGL speed (epoch time) | DGL speed (epoch time) |
---|---|---|---|---|
Cora | GCN | 81.75% | 0.0047s | 0.0045s |
Cora | GAT | 83.5% | 0.0119s | 0.0141s |
Pubmed | GCN | 79.2% | 0.0049s | 0.0051s |
Pubmed | GAT | 77% | 0.0193s | 0.0144s |
Citeseer | GCN | 70.2% | 0.0045 | 0.0046s |
Citeseer | GAT | 68.8% | 0.0124s | 0.0139s |
System requirements
PGL requires:
- paddle >= 1.5
- networkx
PGL supports both Python 2 & 3
Installation
pip install pgl
The Team
PGL is developed and maintained by NLP and Paddle Teams at Baidu
License
PGL uses Apache License 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pgl-0.1.0b0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e90df0b787a77f007688a8b317c73f5bc900f54e01556f0b5091f18c2d258530 |
|
MD5 | 037e7c8f7e9c11940d590a62a2123335 |
|
BLAKE2b-256 | 4aae65727807a84ea20456e5fc3c82c166f1de73573ea1ba583d767992fbe124 |
Hashes for pgl-0.1.0b0-cp37-cp37m-macosx_10_9_x86_64.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4b9c26cc56c431aafabd4bbb32cfcbcd57398987e72ebabca78d9a46883162e |
|
MD5 | 64dd6b8791312b94026fc79820da9be4 |
|
BLAKE2b-256 | 82698e9f9c60518009a36ca1462f6395a1262ac2c57aab07d462418f849c15eb |
Hashes for pgl-0.1.0b0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d2d69f6b8f50c16d5cf2df9582bbb25dc6706a7f45a79778adbeb052fb39d6e |
|
MD5 | a732307bf3ca3d1f2310ebd573db39f4 |
|
BLAKE2b-256 | ee24ea2bfe53745f1cb0a327cc1d49067beb0f1ac4509ceee424be2ae58313b3 |
Hashes for pgl-0.1.0b0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3011750b2a57c60a4e2ff65a908a93ad02abe3e267e6aecc410764a01a971b2 |
|
MD5 | 641bf37815b521ce175fe3d7be2a8d33 |
|
BLAKE2b-256 | 80389fcfc89942bef0a94057e8d76e0ba008836f6062a430c836340e9e98fa92 |
Hashes for pgl-0.1.0b0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | baeccdd615b00d74e89290d3b7b5f5ac1fee8dd44d7e4fd18a468a3e37d8bae4 |
|
MD5 | 841e76663f30527c59b85c8dabfba3e3 |
|
BLAKE2b-256 | 48052c35a9767f38e0e0743686ba412bbff06d5a480b01f5c1feba84ef84b748 |
Hashes for pgl-0.1.0b0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f67d3b84feb14a27375cc3b7cfdcf2b472175b5dad3887d4dc6ca6723e98a5a |
|
MD5 | 839ba31729a7cb9ff520fb48ea77efa5 |
|
BLAKE2b-256 | 5fe0c7f9153da50f426ef3f04beb03ad51c40882d378924e62ca7f66ac1dd791 |
Hashes for pgl-0.1.0b0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13cfa63af8fe6c7f105b233a7f90dce656eee39d6f53679006fd6054a752dbdb |
|
MD5 | 44f8c047b139db0c510e19205276fe68 |
|
BLAKE2b-256 | 7f7fecb5f0ed3b2900c6c6843240e36ed7fb947228c5b0cf293f846c72288770 |
Hashes for pgl-0.1.0b0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89885ebd24e67ab55fdc69f8148d6e30bac1e952b9325a285ad180798d296cb6 |
|
MD5 | 53d8c82afeaa0433eb063cb45d8a2255 |
|
BLAKE2b-256 | b077d4455d2198751a9c0179ee2db8182a6f34418cf0148ef65d76624633875d |
Hashes for pgl-0.1.0b0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 292532d4debd6385455a7eea61656419b7dc1bf19ce948c7d857fdfed5cb8990 |
|
MD5 | 0c451ac4a2b1dda1177a882f8a796ff3 |
|
BLAKE2b-256 | a7bff7fdcf7faf94c2cd2a0512242befe1094dcb655585c47dc12d450976ec64 |