GraphIt - A High-Performance DSL for Graph Analytics

Yunming Zhang, Mengjiao Yang, Riyadh Baghdadi, Shoaib Kamil, Julian Shun, Saman P. Amarasinghe

Abstract

The performance bottlenecks of graph applications depend not only on the algorithm and the underlying hardware, but also on the size and structure of the input graph. Programmers must try different combinations of a large set of techniques to develop the best implementation for a specific algorithm and type of graph. Existing graph frameworks lack flexibility, supporting only a limited set of optimizations. This paper introduces GraphIt, a new DSL for graph computations that generates fast implementations for algorithms with different performance characteristics running on graphs with different sizes and structures. GraphIt separates what is computed (algorithm) from how it is computed (schedule). Programmers specify the algorithm using an algorithm language, and performance optimizations are specified using a scheduling language. The compiler uses a new scheduling representation, the graph iteration space, to model, compose, and ensure the validity of the large number of optimizations. GraphIt outperforms the next fastest of six state-of-the-art shared-memory frameworks on 24 out of 32 experiments by up to 4.8x, and is never more than 43% slower than the fastest framework on the other experiments. GraphIt also reduces the lines of code by up to an order of magnitude compared to the next fastest framework.

Introduction

High-performance graph processing is notoriously difficult because "one size does not fit all." An optimization that works wonders for a social network graph (which has a "power-law" distribution with a few highly connected hubs) might tank performance on a road network graph (which is sparse and uniform). Currently, programmers face a choice between high-level frameworks with limited, hard-coded optimizations or low-level, hand-optimized C++ code for every specific combination of algorithm, hardware, and graph structure. This rigidity prevents developers from exploring the vast tradeoff space between locality, parallelism, and work-efficiency.

Methods: Decoupling Algorithm from Schedule

The core innovation of GraphIt is the separation of concerns between the algorithm and the performance schedule. This allows developers to navigate the "Tradeoff Triangle"—the balance between locality (cache hits), work-efficiency (instruction count), and parallelism (utilizing all cores).

1. Algorithm and Scheduling Languages

GraphIt provides a high-level functional Algorithm Language where users define logic using operators like from, apply, and filter. This hides low-level details like synchronization and vertex tracking. Performance optimizations are then specified using a separate Scheduling Language. Commands include:

  • Direction: Choosing between "push" (source updates neighbors) or "pull" (destination reads from neighbors) traversals.
  • Data Layout: Switching between Array-of-Structs (AoS) and Struct-of-Arrays (SoA).
  • Parallelization: Selecting vertex-parallel, edge-parallel, or bitvector-based frontiers.
  • Locality: Applying NUMA-aware partitioning and cache-friendly segmented subgraphs.

2. Graph Iteration Space and Autotuning

The compiler utilizes a novel 4D mathematical representation called the Graph Iteration Space. This allows the compiler to model, compose, and ensure the validity of optimizations, such as automatically inserting atomic operations if a schedule creates a race condition. Because the search space of possible schedules is massive (up to $10^5$ combinations), GraphIt includes an autotuner to automatically find the fastest schedule for a given graph.

Evaluation

The authors evaluated GraphIt using seven algorithms (including PageRank, BFS, and SSSP) across five diverse real-world graphs: social networks (LiveJournal, Twitter, Friendster), web graphs (WebGraph), and road networks (USAroad).

Performance Results

GraphIt outperformed the next fastest state-of-the-art framework (including Ligra, Galois, and Gemini) on 24 out of 32 experiments. It achieved up to a 4.8x speedup over the next fastest framework and was never more than 43% slower than the absolute fastest specialized implementation.

Heatmaps showing the slowdown of various frameworks relative to the fastest implementation (1.00) across different algorithms and datasets. GraphIt (far right) consistently achieves the best performance, indicated by the high density of green cells.

While GraphIt dominated most benchmarks, it was occasionally outperformed on road networks by the Grazelle framework, which utilized a specific "vector-sparse" edge list optimization that GraphIt lacked at the time of publication.

Productivity

GraphIt significantly reduces development effort, cutting lines of code (LOC) by up to an order of magnitude. For example, a high-performance PageRank implementation in GraphIt requires approximately 30 lines, compared to hundreds of lines of complex C++ in other frameworks.

Conclusion

GraphIt demonstrates that a DSL approach can achieve state-of-the-art performance while greatly simplifying the development of graph analytics. By separating algorithm from schedule and using a formal iteration space model, it enables the composition of complex optimizations that were previously inaccessible in high-level frameworks. Future work includes extending GraphIt to support GPUs, distributed clusters, and more complex program structure optimizations like cross-iteration kernel fusion.

Summary updated

BibTeX
@inproceedings{zhang2018graphit,
  author = {Yunming Zhang and Mengjiao Yang and Riyadh Baghdadi and Shoaib Kamil and Julian Shun and Saman P. Amarasinghe},
  title = {{GraphIt - A High-Performance DSL for Graph Analytics}},
  booktitle = {Proc. ACM Program. Lang},
  year = {2018},
  url = {https://openreview.net/forum?id=zxGMXfWWEP},
}
Figure