NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Accelerating Regular Path Queries over Graph Database with Processing-in-Memory

Ruoyan Ma, Shengan Zheng, Guifeng Wang, Jin Pu, Yifan Hua, Wentao Wang, Linpeng Huang

Abstract

Graph databases are increasingly vital for complex data analysis, yet they frequently encounter the "memory wall" during Regular Path Queries (RPQs). Moctopus is a novel system that leverages Processing-in-Memory (PIM) to address this bottleneck. By implementing a labor-division strategy between the host CPU and PIM modules, and utilizing a greedy-adaptive partitioning approach, Moctopus achieves up to a 10.67x speedup in query processing and significantly higher throughput in graph updates compared to state-of-the-art traditional graph databases.

Introduction

Modern applications in social network analysis and fraud detection rely heavily on Regular Path Queries (RPQs) to find paths matching specific patterns. However, traditional CPU-centric architectures suffer from the "memory wall" due to the "pointer chasing" nature of graph traversals. These random memory accesses often bypass CPU caches, leading to significant latency as the processor waits for slow DRAM.

Emerging Processing-in-Memory (PIM) technologies, such as UPMEM, offer a solution by placing processors directly within memory modules. However, PIM systems face their own challenges, including load imbalance caused by power-law graph distributions and high inter-PIM communication (IPC) overhead. Moctopus is designed to mitigate these hurdles through architectural and algorithmic innovations.

System Design and Methods

Moctopus introduces three primary innovations to optimize graph processing on PIM-enabled hardware:

  1. Labor-Division Approach: Moctopus distinguishes between high-degree "hub" nodes and low-degree nodes. High-degree nodes are managed by the powerful host CPU to leverage its cache locality for dense data. Conversely, low-degree nodes are distributed across hundreds of PIM modules to exploit massive parallelism.
  2. Greedy-Adaptive Partitioning: To minimize costly IPC, Moctopus employs a "radical greedy" heuristic, assigning new nodes to the same PIM module as their first neighbor. The system then adaptively migrates misplaced nodes during execution to refine locality.
  3. Heterogeneous Graph Storage: Complex space management and edge retrieval for host-resident nodes are offloaded to PIM modules, streamlining graph updates.
The Moctopus system architecture, showing the interaction between the Host Query Processor and distributed PIM modules.

Performance Evaluation

The system was evaluated using 15 real-world graphs from the SNAP dataset, covering road networks, social networks, and web graphs.

Query and Update Efficiency

Moctopus demonstrated superior performance over RedisGraph, a leading in-memory graph database. Key results include:

  • Query Speedup: Up to 10.67x improvement for k-hop path queries.
  • Update Throughput: An average of 30.01x higher throughput for insertions and 52.59x for deletions.
  • Communication Reduction: The adaptive partitioning strategy reduced IPC costs by 89.56% on average compared to standard hash-based partitioning.
Latency comparison for k-hop queries across different graph traces, demonstrating Moctopus's performance advantages.

Discussion and Limitations

The success of Moctopus highlights the importance of CPU-PIM symbiosis rather than total replacement. By treating the CPU as a specialist for heavy nodes and PIM for wide parallel tasks, the system effectively manages the power-law nature of real-world graphs.

However, limitations remain. In highly connected social networks, the explosion of matched paths as length ($k$) increases can lead to bottlenecks when gathering results from PIM modules. Additionally, while the current implementation targets UPMEM, future work is needed to adapt these strategies for other PIM architectures like HBM-PIM or CXL-based memory.

Conclusion

Moctopus successfully bridges the gap between traditional graph processing and emerging PIM hardware. By intelligently partitioning data and balancing workloads between the host and memory, it provides a scalable and efficient framework for high-performance graph analytics.

Summary updated

BibTeX
@inproceedings{ma2024accelerating,
  author = {Ruoyan Ma and Shengan Zheng and Guifeng Wang and Jin Pu and Yifan Hua and Wentao Wang and Linpeng Huang},
  title = {{Accelerating Regular Path Queries over Graph Database with Processing-in-Memory}},
  booktitle = {DAC},
  year = {2024},
  doi = {10.1145/3649329.3656235},
}
Figure