Part III: Distributed Machine Learning
Chapter 13: Distributed Graph Machine Learning

Distributed Graph Machine Learning

When the data arrives as a graph rather than a table, the examples are no longer independent rows that a scheduler can scatter at will: every vertex depends on its neighbors, and any cut you make to spread the graph across machines severs edges the computation needs. This chapter builds the machinery that learns over graphs too large for one machine, graph partitioning that minimizes the damage of cutting, the vertex-centric Pregel model that turns iteration into message passing, distributed graph analytics, and the distributed graph neural networks whose neighbor sampling and full-graph-versus-mini-batch tradeoffs decide whether training a billion-edge model is feasible at all.

Conceptual illustration for Chapter 13: Distributed Graph Machine Learning

"They split the graph eight ways and handed me a vertex on the seam. Half its neighbors live on a machine I can only reach by message. Every step I compute, I first wait for the mail."

A Boundary Vertex on the Wrong Side of the Cut
Big Picture

The previous chapters could shard data into independent pieces because their examples were independent; a graph refuses that, because partitioning it cuts edges the computation must traverse, and this chapter develops the partitioning, the vertex-centric iteration, and the sampling that make learning over a graph too large for one machine tractable. Graph-structured data is everywhere that relationships matter: social networks, web link graphs, knowledge graphs, recommendation bipartite graphs, molecular structures, and transaction networks. The distinguishing fact is connectivity. In Chapter 12 a worker could hold a shard of rows and compute on it almost alone, synchronizing only a gradient or a histogram; here a vertex's update depends on its neighbors, and once the graph is spread across machines, many of those neighbors live elsewhere, so computation becomes communication. The chapter builds the answer in layers. It opens with why graphs are hard to distribute, the power-law degree distributions and irregular access patterns that defeat naive sharding. Then it develops graph partitioning, the edge-cut and vertex-cut formulations and the multilevel METIS scheme that minimize the cross-machine edges a partition pays for. On top of a partitioned graph it builds the Pregel vertex-centric model, the think-like-a-vertex gather-apply-scatter iteration that turns PageRank and connected components into bounded supersteps of local computation and message passing, and it spends that model on distributed graph analytics. The second half turns to learning: distributed graph neural networks, where each layer is a round of neighbor aggregation that, on a partitioned graph, becomes a round of cross-machine communication; distributed neighbor sampling, the trick that bounds the explosive neighborhood expansion of deep message passing; and the full-graph-versus-mini-batch decision that separates Cluster-GCN and GraphSAINT-style training from full-neighborhood schemes. It closes on the frameworks, DistDGL and PyTorch Geometric and the systems that package all of this. The collective communication of Chapter 4 and the data-parallel gradient of Chapter 10 return throughout, now carrying messages along edges and aggregating across a graph whose pieces will not come cleanly apart.

Chapter Overview

This is the fourth chapter of Part III, and it confronts the data structure that breaks the clean shard-and-reduce of everything before it. Chapter 12 scaled the classical canon by cutting the data into independent shards and summing a small summary statistic across them. That move works because rows are independent. A graph is the opposite: an edge is a dependency, and any partition that spreads the graph across machines necessarily cuts some edges, turning a neighbor lookup into a network round trip. The whole chapter is organized around that single difficulty, and around the techniques that contain it.

The eight sections fall into three groups. The first group establishes the substrate: Section 13.1 explains exactly why graphs resist distribution, from skewed degree distributions to irregular memory access, and Section 13.2 develops graph partitioning, the edge-cut and vertex-cut objectives and the multilevel METIS algorithm that minimize the cross-machine edges a layout pays for. The second group builds computation on a partitioned graph: Section 13.3 introduces the Pregel vertex-centric model, the gather-apply-scatter superstep that frames graph computation as local work plus message passing, and Section 13.4 spends that model on distributed graph analytics such as PageRank and connected components. The third group turns to learning over graphs: Section 13.5 distributes graph neural networks, where each layer of neighbor aggregation becomes a round of cross-partition communication; Section 13.6 develops distributed neighbor sampling, the technique that tames the exponential neighborhood blow-up of deep message passing; Section 13.7 weighs mini-batch against full-graph distributed training and the Cluster-GCN and GraphSAINT approaches that make mini-batching work on graphs; and Section 13.8 surveys the frameworks, DistDGL and PyTorch Geometric among them, that package partitioning, sampling, and distributed message passing into production systems.

Read in order, the eight sections take you from "this graph does not fit on one machine and you cannot just cut it in half" to "train a graph neural network on a billion edges across a cluster." The thread to watch is that distribution over graphs always trades partition quality against communication: a better cut means fewer cross-machine messages, sampling means fewer neighbors to fetch, and mini-batching means smaller working sets, and every framework in the last section is a different point on that tradeoff. The partitioned, message-passing structure built here returns wherever later parts touch graph-shaped data, from recommendation graphs to multi-agent communication topologies.

Prerequisites

This chapter assumes the distributed-systems and optimization background of the earlier chapters. From Chapter 2: Distributed Systems Concepts for AI you carry the basic vocabulary of partitioning, message passing, synchronization barriers, and the consistency-and-coordination reasoning that the bulk-synchronous supersteps of the Pregel model in Section 13.3 depend on. From Chapter 10: Distributed Optimization you carry the data-parallel gradient and distributed SGD, because training a distributed graph neural network in Sections 13.5 through 13.7 is distributed SGD whose forward pass happens to fetch features across the graph rather than reading independent rows. From Chapter 12: Distributed Classical Machine Learning you carry the habit of asking, for any algorithm, what summary statistic travels between machines and which collective carries it; graph learning answers that question with messages along edges. The chapter assumes comfortable Python, a single-machine understanding of PageRank and of a graph neural network layer such as GCN or GraphSAGE, and the collective-communication primitives, all-reduce, all-gather, and broadcast, introduced earlier in Part I. The linear-algebra background refreshed in Appendix A: Mathematical Background covers the sparse matrix view of graph propagation.

Learning Objectives

Remember the Chapter as One Sentence

If you keep one thing from this chapter, keep this: a graph cannot be sharded into independent pieces because its edges are dependencies, so distributed graph machine learning is the craft of cutting the graph to minimize the edges that cross machines, then carrying the unavoidable cross-machine work as messages, and bounding it with sampling and mini-batching. Read forward, the sections build that craft in layers: first why graphs resist distribution and how partitioning limits the damage of a cut, then the vertex-centric model that turns iteration into local computation plus message passing and the analytics it powers, then the distributed graph neural networks whose neighbor aggregation is cross-machine communication and the sampling and mini-batching that make deep message passing tractable, and finally the frameworks that package it all. Read as a question, the chapter asks of any graph computation you want to scale: how do you split a structure whose pieces refuse to come apart, and how much must travel between the pieces once you do. The roadmap below walks the eight sections that answer it.

Chapter Roadmap

Read the eight sections in order and you will hold a toolkit for learning over graphs too large for one machine: Section 13.1 and Section 13.2 establish why graphs resist distribution and how partitioning limits the cost of a cut, Section 13.3 and Section 13.4 build the vertex-centric model and the analytics it powers, and Sections 13.5 through 13.7 develop distributed graph neural networks, neighbor sampling, and the mini-batch-versus-full-graph decision before Section 13.8 surveys the frameworks. The thread to watch is the collective communication of Chapter 4 reappearing as messages along edges, and the data-parallel gradient of Chapter 10 reappearing as distributed graph-neural-network training whose forward pass crosses the partition boundary.

What's Next?

This chapter learned over data whose pieces refuse to come apart, partitioning a graph to minimize the edges that cross machines, carrying the rest as messages, and bounding deep message passing with sampling and mini-batching. Chapter 14: Federated and Decentralized Learning takes the distribution problem in a different direction, from data that is one graph spread across a cluster you control to data that is scattered across many devices you do not control and cannot move. Federated learning trains a shared model while the training data stays on phones, hospitals, and edge devices, raising new problems the chapters here did not face: non-identically-distributed shards, unreliable and intermittent participants, communication budgets measured in rounds rather than messages, and privacy constraints that forbid centralizing the data at all. Read it next, and watch the assumption that you own and can co-locate your data, quietly held through all of Part III so far, finally fall away.

Bibliography & Further Reading

Graph Partitioning

Karypis, G., Kumar, V. "A Fast and High Quality Multilevel Scheme for Partitioning Irregular Graphs (METIS)." SIAM Journal on Scientific Computing, 20(1), 1998. epubs.siam.org

The multilevel coarsen-partition-refine scheme behind METIS, the standard tool for the balanced edge-cut partitioning that Section 13.2 builds on to minimize cross-machine edges.

📄 Paper

Vertex-Centric Graph Processing Systems

Malewicz, G., Austern, M. H., Bik, A. J. C., Dehnert, J. C., Horn, I., Leiser, N., Czajkowski, G. "Pregel: A System for Large-Scale Graph Processing." SIGMOD, 2010. dl.acm.org

The paper that introduced the think-like-a-vertex bulk-synchronous superstep model, the foundation of the vertex-centric computation developed in Section 13.3.

📄 Paper

Gonzalez, J. E., Low, Y., Gu, H., Bickson, D., Guestrin, C. "PowerGraph: Distributed Graph-Parallel Computation on Natural Graphs." OSDI, 2012. usenix.org

The system that introduced vertex-cut partitioning and the gather-apply-scatter abstraction to handle power-law graphs, central to the partitioning and computation models of Sections 13.2 and 13.3.

📄 Paper

Gonzalez, J. E., Xin, R. S., Dave, A., Crankshaw, D., Franklin, M. J., Stoica, I. "GraphX: Graph Processing in a Distributed Dataflow Framework." OSDI, 2014. usenix.org

The system that embeds graph-parallel computation in a general dataflow engine (Spark), showing how vertex-centric analytics of Section 13.4 run on the data-processing stack of Part II.

📄 Paper

Graph Neural Networks

Kipf, T. N., Welling, M. "Semi-Supervised Classification with Graph Convolutional Networks (GCN)." arXiv:1609.02907, 2016. arxiv.org/abs/1609.02907

The graph convolutional network that frames neighbor aggregation as a sparse propagation, the canonical layer whose distribution is the subject of Section 13.5.

📄 Paper

Hamilton, W. L., Ying, R., Leskovec, J. "GraphSAGE: Inductive Representation Learning on Large Graphs." arXiv:1706.02216, 2017. arxiv.org/abs/1706.02216

The inductive model that introduced fixed-size neighbor sampling for scalable message passing, the basis for the distributed neighbor sampling of Section 13.6.

📄 Paper

Scalable GNN Training

Chiang, W.-L., Liu, X., Si, S., Li, Y., Bengio, S., Hsieh, C.-J. "Cluster-GCN: An Efficient Algorithm for Training Deep and Large Graph Convolutional Networks." arXiv:1905.07953, 2019. arxiv.org/abs/1905.07953

The mini-batch scheme that builds batches from graph-clustered subgraphs to bound neighborhood expansion, one of the two approaches weighed in Section 13.7.

📄 Paper

Zeng, H., Zhou, H., Srivastava, A., Kannan, R., Prasanna, V. "GraphSAINT: Graph Sampling Based Inductive Learning Method." arXiv:1907.04931, 2019. arxiv.org/abs/1907.04931

The subgraph-sampling training method that samples a subgraph per minibatch and corrects the resulting bias, the second mini-batch approach contrasted with full-graph training in Section 13.7.

📄 Paper

Frameworks and Benchmarks

Zheng, D., Ma, C., Wang, M., Zhou, J., Su, Q., Song, X., Gan, Q., Zhang, Z., Karypis, G. "DistDGL: Distributed Graph Neural Network Training for Billion-Scale Graphs." arXiv:2010.05337, 2020. arxiv.org/abs/2010.05337

The distributed training system that partitions the graph, co-locates features, and runs distributed neighbor sampling at billion-edge scale, the centerpiece framework of Section 13.8.

📄 Paper

Fey, M., Lenssen, J. E. "Fast Graph Representation Learning with PyTorch Geometric." arXiv:1903.02428, 2019. arxiv.org/abs/1903.02428

The widely used graph-learning library whose message-passing abstraction and samplers package the distributed building blocks surveyed in Section 13.8.

📄 Paper

Hu, W., Fey, M., Zitnik, M., Dong, Y., Ren, H., Liu, B., Catasta, M., Leskovec, J. "Open Graph Benchmark: Datasets for Machine Learning on Graphs (OGB)." arXiv:2005.00687, 2020. arxiv.org/abs/2005.00687

The benchmark suite of large-scale graph datasets that standardized evaluation of scalable graph learning, the proving ground for the distributed methods of this chapter.

📄 Paper