GraphIt: a high-performance graph DSL

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

TL;DR

GraphIt is a new domain-specific language (DSL) that tackles the challenge of achieving high performance for graph computations. It separates algorithm logic from optimization strategies, allowing programmers to explore a vast space of optimizations and automatically discover efficient implementations that outperform existing frameworks.

What Problem Does This Paper Address?

Graph applications are ubiquitous, from social networks to machine learning. However, optimizing their performance is notoriously difficult. The performance bottlenecks depend heavily on the algorithm, the underlying hardware, and crucially, the graph's size and structure. Programmers must manually experiment with numerous optimization techniques (like data layout, parallelism, and cache usage) to find the best combination for a specific scenario. Existing graph frameworks and DSLs often lack the flexibility to explore this complex tradeoff space, leading to suboptimal performance. This paper introduces GraphIt to address this by providing a flexible and powerful way to express and optimize graph algorithms.

Methods

GraphIt's core innovation lies in its separation of concerns:

  • Algorithm Language: This language allows programmers to express graph algorithms in a high-level, intuitive way, focusing on the logic rather than low-level implementation details. It exposes opportunities for optimization without dictating them.
  • Scheduling Language: This separate language enables programmers to specify performance optimizations. It allows for composing a wide range of techniques, including edge traversal direction, data layout, parallelization, cache, NUMA, and kernel fusion.
  • Graph Iteration Space: A novel representation that models edge traversals as multi-dimensional vectors. This abstraction helps the compiler compose optimizations, reason about their validity through dependence analysis, and generate efficient code.
  • Autotuner: GraphIt integrates with an autotuning framework (OpenTuner) to automatically search for high-performance schedules, making optimization accessible even to non-experts.

Datasets

The paper evaluates GraphIt on several real-world graph datasets:

  • Social Network Graphs: LiveJournal (LJ), Twitter (TW), Friendster (FT)
  • Road Network Graph: USAroad (RD)
  • Recommendation Datasets: Netflix rating dataset and its synthesized expansion (Netflix2x)

These datasets vary in size and structure, including graphs with small diameters and power-law degree distributions, as well as road networks with large diameters and uniform degrees.

Key Insights and Ideas

  • The Tradeoff Space is Key: The paper emphasizes that graph optimization is fundamentally about navigating a complex tradeoff space between locality, work-efficiency, and parallelism. GraphIt's design directly addresses this by providing mechanisms to explore these tradeoffs.
  • Separation is Power: Decoupling algorithm logic from optimization strategies is crucial. This allows for greater flexibility and enables automatic discovery of optimal configurations that a human might miss.
  • Abstraction for Composability: The "graph iteration space" is a powerful abstraction that allows for the systematic composition and validation of diverse optimizations, which is a significant challenge in existing systems.
  • DSL for Productivity: GraphIt dramatically reduces the lines of code required for graph algorithms compared to existing frameworks, boosting programmer productivity without sacrificing performance.

Key Results

  • Performance Gains: GraphIt outperforms the next fastest of six state-of-the-art shared-memory frameworks on 24 out of 32 experiments, with speedups of up to 4.8x. It is never more than 43% slower than the fastest framework.
  • Code Reduction: GraphIt reduces the lines of code by up to an order of magnitude compared to the next fastest framework.
  • Scalability: The paper demonstrates GraphIt's scalability with different parallelization schemes, showing significant speedups as the number of cores increases.
  • Autotuning Effectiveness: The autotuner found schedules within 5% of hand-tuned ones in under 5000 seconds, and even outperformed hand-tuned schedules by up to 10% for some benchmarks.

Limitations and Future Work

  • GPU and Distributed Systems: The current work focuses on shared-memory systems. Future work includes extending the compiler to support more optimizations and hardware platforms, specifically GPUs and distributed-memory systems.
  • Autotuning Search Space: While effective, the autotuner's search space is limited to a single edgeset apply operation. Expanding this could yield further improvements.
  • NUMA Optimization Nuances: The paper notes that NUMA optimizations can sometimes slow down convergence if not carefully managed, suggesting a need for more nuanced control.
  • Specific Optimizations: GraphIt does not yet support all optimizations, such as vector-sparse edge lists for low-degree vertices, which can be beneficial for certain graphs.

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 graph DSL}},
  booktitle = {Proc. ACM Program. Lang},
  year = {2018},
  url = {https://openreview.net/forum?id=zxGMXfWWEP},
}
Figure