FedGCN: Convergence-Communication Tradeoffs in Federated Training of Graph Convolutional Networks (NeurIPS 2023)

January 18, 2025 ยท View on GitHub

Introduction

This repository contains the implementation of the FedGCN algorithm, that leverages federated learning to efficiently train Graph Convolutional Network (GCN) models for semi-supervised node classification. It achieves rapid convergence while minimizing communication overhead. The algorithm implements a framework, where clients exclusively interact with the central server during a single pre-training step.

Paper: FedGCN: Convergence-Communication Tradeoffs in Federated Training of Graph Convolutional Networks

Upgraded: FedGraph Library with Real Distributed Communication and Homomorphic Encryption

https://github.com/FedGraph/fedgraph

Google Colab Example for Quick Start

https://github.com/yh-yao/FedGCN/blob/master/FedGCN_Colab_Example.ipynb

Frequently Asked Questions

https://github.com/yh-yao/FedGCN/discussions/6

Quick Installation

git clone https://github.com/yh-yao/FedGCN.git

conda create --name fedgcn python=3.10
conda activate fedgcn

pip install torch_geometric
pip install ray
pip install ogb
pip install tensorboard

pip install torch_geometric

#for CPU version
pip install torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.1.0+cpu.html

#for GPU version with CUDA 11.8
pip install torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.1.0+cu118.html
# trouble shoot https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html

Alternate Installation

git clone https://github.com/yh-yao/FedGCN.git

pip install virtualenv
virtualenv <virtual-environment-name>

# On MacOS/Linux:
source <virtual-environment-name>/bin/activate
# On Windows:
venv\Scripts\activate

pip install -r requirements.txt

Local Simulation:

Once the code is in place along with all the required packages, the code can be run using the command below:

python src/fedgcn_run.py -d=<dataset_name> -f=fedgcn -nl=<num_layers> -nhop=<num_hops> -iid_b=<beta_IID> -r=<repeat_frequency> -n=<num_trainers>

For example: python src/fedgcn_run.py -d=cora -f=fedgcn -nl=2 -nhop=2 -iid_b=100 -r=3 -n=5

You can also specify other arguments as needed. Here is a detailed list of all the arguments available:

ArgumentOverviewData TypeDefault value
-ddataset_nameStringCora
-fFed_typeStringFed_gcn
-nlNum_layersInt2
-nhopNum_hopsInt2
-iid_bBeta_IIDFloat10000
-rRepeat_frequencyInt10
-cnum_global_roundsInt100
-inum_local_stepInt3
-lrLearning_rateFloat0.5
-gIf_gpu
-lLog_directorystring./runs
-nNum_trainersint5

Distributed Training:

  1. Start the cluster, see config.yaml for dependency configuration
    $ ray up config.yaml
    
  2. Submit enter-point script
    $ ray submit config.yaml fed_training.py 
    
  3. Stop nodes in cluster, optionally you can terminate them using AWS console or CLI.
    $ ray down config.yaml
    

Datasets

DatasetGraph Type#Nodes#Edges#Classes
CoraCitation Network2,70810,5567
CiteSeerCitation Network3,3279,1046
RedditSocial Network232,965114,615,89241
PubMedCitation Network - Life Sciences19,71788,6483
ogbn-productsProduct Recommendation2,449,02961,859,14047
ogbn-arxivCitation Network169,3431,166,24340

FedGCN Team

Yuhang Yao (CMU), Jiayu Chang (CMU), Shoba Arunasalam (CMU), Xinyi (Cynthia) Fan (CMU), Weizhao Jin (USC)