Introduction
Triangle counting (TC)—identifying all instances where three nodes are mutually connected—is a fundamental task in network analysis, critical for applications ranging from spam detection to biological motif discovery. However, TC is notoriously memory-bound. In traditional CPU and GPU architectures, the "memory wall" becomes a bottleneck as processors spend more time waiting for data from memory than performing calculations.
Processing-in-Memory (PIM) offers a potential solution by integrating small processors directly into memory chips. This research presents the first TC algorithm designed specifically for the UPMEM PIM system, addressing its unique hardware constraints: limited local memory (64MB per core), lack of direct inter-core communication, and load imbalances from high-degree nodes.
Methodology: Communication-Avoidance and Sampling
To thrive in a PIM environment, the researchers developed a multi-pronged algorithmic strategy focused on maximizing parallelism while minimizing data movement.
Vertex Coloring for Parallelism
The centerpiece of the approach is a vertex coloring technique. By assigning specific color triplets to different PIM cores, each core can process a subset of the graph independently. This strategy prioritizes "communication avoidance," opting for redundant local computation—which can be mathematically corrected later—over the high overhead of routing data through the host CPU.
Handling Scale and Imbalance
To manage graphs exceeding the 64MB MRAM limit, the system implements reservoir sampling, allowing for statistically accurate approximate counts. Furthermore, to tackle the "celebrity node" problem, the host CPU uses Misra-Gries summaries to identify heavy-hitter nodes. These nodes are then reordered to optimize the edge-iterator process, ensuring efficient load balancing across the PIM cores.
Key Results and Insights
The system was evaluated using a diverse set of real-world and synthetic graphs, including social networks (Orkut, LiveJournal) and specialized sparse graphs (V1r).
The Dynamic Graph Advantage
A major insight from the study is PIM’s superiority in dynamic graph scenarios. Traditional CPUs often require converting graphs into Compressed Sparse Row (CSR) formats for speed, a process that is prohibitively expensive for rapidly changing data. The PIM implementation operates directly on raw edge lists (COO format), making it significantly faster for streaming data.
Performance Benchmarks
- Throughput: The PIM implementation outperformed state-of-the-art CPU-based TC for dynamic graphs in COO format.
- Sampling Speedups: By utilizing uniform edge sampling (p=0.01), the authors achieved speedups of up to 80x with a relative error often below 1%.
- Niche Superiority: On the Human-Jung dataset, characterized by high triangle density and low node degrees, the PIM system surpassed both CPU and GPU implementations.
Conclusion and Future Work
While high-end GPUs remain the standard for static graphs where pre-optimization is possible, this research demonstrates that PIM is a powerful architecture for dynamic, memory-intensive graph analytics. Future work will focus on addressing the inter-core communication bottleneck and extending the system to support more complex graph pattern matching beyond simple triangles.
Summary updated