Graph embeddings, which represent nodes and edges as continuous vectors, are the backbone of modern recommendation systems and link prediction tasks. However, as graphs scale to billions of edges, the resulting embedding tables—often hundreds of gigabytes—far exceed the memory capacity of even the most powerful GPUs. This forces a reliance on expensive distributed clusters. Marius is a new system designed to break this barrier, enabling the training of massive graph embeddings on a single workstation by optimizing data flow across the entire memory hierarchy (Disk-CPU-GPU).
The Data Movement Bottleneck
The primary challenge in scaling graph embeddings is not computation, but data movement. In systems like Amazon’s DGL-KE or PyTorch BigGraph (PBG), the GPU often sits idle while waiting for node vectors to be swapped from the CPU or disk. This inefficiency results in low hardware utilization and slow training times.
As shown in the utilization profiles of existing systems, the GPU is frequently underutilized, often staying below 50%. Marius addresses this by shifting the focus from "faster math" to "smarter movement," aiming to keep the GPU saturated with work.
Methods: Full-Stack Optimization
Marius achieves its performance through several key innovations:
1. Pipelined Architecture
Marius employs a five-stage pipeline: Load, Transfer, Compute, Transfer, and Update. By overlapping these stages, the system can fetch the next batch of data from disk while the GPU is still processing the current one. This ensures that computation and IO happen in parallel rather than sequentially.
2. Buffer-aware Edge Traversal Algorithm (BETA)
The core of Marius is BETA. Unlike standard methods that traverse edges randomly or use general locality-aware orderings, BETA explicitly considers the size of the available memory buffer. It partitions the graph into "buckets" based on source and destination node IDs.
By ordering the processing of these buckets, BETA minimizes the number of times node partitions must be swapped between disk and RAM. This approach reaches near-theoretical lower bounds for disk I/O, significantly reducing the overhead of out-of-core training.
3. Hybrid Memory and Bounded Staleness
Marius maintains small, frequently updated "relation" embeddings on the GPU, while the massive "node" embedding table resides on the CPU or disk. To maintain high throughput, Marius allows for asynchronous updates to node embeddings. By "bounding" this staleness, the system ensures model accuracy is preserved even as it maximizes pipeline efficiency.
Key Results and Impact
The authors evaluated Marius on massive benchmarks, including the Twitter follower network (1.46B edges) and Freebase86m (338M edges). The results demonstrate a significant leap in efficiency:
- Speed: Marius is up to 10x faster than DGL-KE and 1.5x faster than PBG on the Twitter dataset.
- Utilization: While competing systems often see <30% GPU utilization, Marius achieves approximately 70% utilization.
- Scale: The system successfully trained a model with 550 GB of parameters on a machine with only 16 GB of GPU memory and 64 GB of CPU RAM.
- Cost: By enabling single-machine training for billion-scale graphs, Marius reduces cloud training costs by 2.9x to 7.5x compared to distributed setups.
Conclusion
Marius demonstrates that with careful optimization of the memory hierarchy and buffer-aware scheduling, massive graph models can be trained without the complexity of distributed systems. Future work includes extending BETA to multi-GPU configurations and further optimizing the host CPU's role in the data pipeline.
Paper Citation: Jason Mohoney, et al. "Marius: Learning Massive Graph Embeddings on a Single Machine." arXiv:2101.08358v2 [cs.LG]. Open sourced at marius-project.org.
Summary updated