Quickstart
flwr new @flwrlabs/sprind-gcnReadme
SPRIN-D: Node Property Prediction
This Flower App allows you to federate the training of Graph Convolutional Neural GCN network on the ogbn-arxiv dataset for node classification using PyTorch-Geometric. Each ClientApp runnig from a SuperNode will using a subset of the features describing each node in the graph, effectively implementing a Vertical Federated Learning (VFL) setup. Aggregated metrics obtained during training and evaluation are logged to your Weight & Biases account if you configure it to do so.
The contents of this Flower App are as follows:
sprind-gcn ├── node_prop_pred │ ├── __init__.py │ ├── client_app.py # Defines your ClientApp │ ├── server_app.py # Defines your ServerApp │ └── task.py # Defines your model, training and data loading ├── pyproject.toml # Project metadata like dependencies and configs └── README.md
Running the App
NOTE
This section assumes you have already deployed a Flower Federation with at least two SuperNodes. Please refer to the provided instructions on how to connect SuperNodes to a running SuperLink.
Before running the app, you need to configure it to point to the SuperLink. This is an easy process and only requires you to edit one line in the pyproject.toml in this directory. Concretely, the address field found at the bottom of the file.
[tool.flwr.federations.sprind-federation] address = "SUPERLINK-CONTROL-ADDRESS" # <--- Replace with the provided SuperLink IP:PORT
To run the app with default settings simply execute this command from the directory where this README.md lives:
# If you know your Weight & Biases token flwr run . --run-config="wandb-token='<YOUR-WANDB-TOKEN'" --stream # If you don't have one flwr run . --stream
Expected Output
On the terminal where you execute flwr run from you'll see an output similiar to the one below. Note this output was obtained when running with Weight and Biases (hence the first few log lines with wandb prefix) and in a federation of 2 SuperNodes. By default, each round the ServerApp samples all of the connected SuperNodes for a round of training. Then, all the SuperNodes for a round of federated evaluation. By default the app runs for three rounds using a GCN model.
Loading project configuration... Success 🎊 Successfully started run 18298261176343576928 INFO : Starting logstream for run_id `18298261176343576928` INFO : Start `flwr-serverapp` process wandb: Currently logged in as: YOUR-USERNAME to https://api.wandb.ai. Use `wandb login --relogin` to force relogin wandb: setting up run ypy66jn9 wandb: Tracking run with wandb version 0.23.0 wandb: Run data is saved locally in <YOUR-LOCAL-FS>/wandb/run-20251126_153041-ypy66jn9 wandb: Run `wandb offline` to turn off syncing. wandb: Syncing run 18298261176343576928-ServerApp wandb: ⭐️ View project at https://wandb.ai/YOUR-USERNAME/sprind-gnn wandb: 🚀 View run at https://wandb.ai/YOUR-USERNAME/sprind-gnn/runs/ypy66jn9 INFO : INFO : --- ServerApp Round 1 --- INFO : Requesting embeddings from 2 nodes... INFO : Received 2/2 results INFO : Computing loss and backpropagating... INFO : Train loss: 5.350 INFO : Sending gradients to 2 nodes... INFO : Received 2/2 results INFO : Requesting embeddings from 2 nodes... INFO : Received 2/2 results INFO : Train Acc: 0.028 | Valid Acc: 0.042 | Test Acc: 0.063 INFO : INFO : --- ServerApp Round 2 --- INFO : Requesting embeddings from 2 nodes... INFO : Received 2/2 results INFO : Computing loss and backpropagating... INFO : Train loss: 5.178 INFO : Sending gradients to 2 nodes... INFO : Received 2/2 results INFO : Requesting embeddings from 2 nodes... INFO : Received 2/2 results INFO : Train Acc: 0.075 | Valid Acc: 0.137 | Test Acc: 0.182 INFO : INFO : --- ServerApp Round 3 --- INFO : Requesting embeddings from 2 nodes... INFO : Received 2/2 results INFO : Computing loss and backpropagating... INFO : Train loss: 5.061 INFO : Sending gradients to 2 nodes... INFO : Received 2/2 results INFO : Requesting embeddings from 2 nodes... INFO : Received 2/2 results INFO : Train Acc: 0.077 | Valid Acc: 0.150 | Test Acc: 0.203 INFO :
Override Run Config
You can also override the settings for your ClientApp and ServerApp defined in the [tool.flwr.app.config] section of the pyproject.toml. This can be done by extending the list of arguments passed via the --run-config argument to flwr run. For example:
# Run for 5 rounds flwr run . --run-config="wandb-token='<YOUR-WANDB-TOKEN' num-server-rounds=5" --stream # Run for 5 rounds using a larger hidden dimension in the GCN flwr run . --run-config="wandb-token='<YOUR-WANDB-TOKEN' num-server-rounds=5 hidden-dim=128" --stream