Abstract
Graph Neural Networks (GNNs) are emerging machine learning models designed to analyze graph-structured data. However, GNN execution involves a mix of compute-intensive and memory-intensive kernels. The latter often dominates total execution time, creating a significant bottleneck due to data movement between memory and processors. Processing-In-Memory (PIM) systems offer a solution by placing simple processors near or inside memory arrays. This paper introduces PyGim, an efficient ML framework that accelerates GNNs on real-world PIM systems. By employing intelligent parallelization techniques and a hybrid execution model, PyGim outperforms state-of-the-art CPU implementations on Intel Xeon by an average of 3.04× and achieves significantly higher resource utilization than traditional GPU systems.
The Data Movement Bottleneck in GNNs
Graph Neural Networks are essential for analyzing complex relationships in social networks, molecular structures, and recommendation systems. Despite their utility, running them on traditional "processor-centric" architectures (CPUs and GPUs) is notoriously inefficient. GNN execution typically consists of two distinct phases:
- Aggregation: Gathering feature vectors from neighboring nodes. This is a memory-intensive operation (Sparse Matrix-Matrix Multiplication) that spends the majority of its time moving data between RAM and the processor.
- Combination: Processing gathered features through neural network layers. This is compute-intensive and aligns well with standard high-performance processors.
On modern GPUs, the aggregation phase can consume up to 91% of total execution time while utilizing less than 2% of the hardware's theoretical compute power. This "utilization gap" occurs because the processor sits idle while waiting for sparse data to arrive from memory.
PyGim: Cooperative Acceleration (CoA)
To address this bottleneck, PyGim introduces a Cooperative Acceleration (CoA) model. Rather than attempting to run the entire GNN on PIM hardware—which often has limited compute capabilities—PyGim splits the workload based on the algorithmic nature of the kernels. The compute-heavy "Combination" phase remains on the Host CPU or GPU, while the memory-heavy "Aggregation" phase is offloaded to PIM cores located directly within the memory modules.
Parallelism Fusion (PaF)
The core technical innovation of PyGim is Parallelism Fusion (PaF), a multi-level strategy designed to maximize the efficiency of real-world PIM hardware:
- Across PIM Clusters: The framework partitions the graph and feature matrices into 2D tiles to minimize expensive data transfers between the host and memory.
- Within PIM Clusters: It dynamically balances workloads across cores using vertex-level or edge-level strategies, depending on the graph's density and irregularity.
- Within PIM Cores: It utilizes multi-threading (tasklets) with optimized, lock-free synchronization to maximize the utilization of each PIM core's internal pipeline.
To ensure ease of use, PyGim includes a Lightweight Tuner that automatically selects the best parallelization configuration based on the input graph's characteristics and provides a Python API that integrates seamlessly with PyTorch.
Key Results and Insights
The researchers evaluated PyGim on a real UPMEM PIM system featuring 1,992 cores using diverse datasets, including the Sparse Matrix Suite and large-scale graphs like ogbn-proteins and Reddit.
- Performance Gains: PyGim outperformed the state-of-the-art PyTorch implementation on an Intel Xeon CPU by an average of 3.04× (reaching up to 3.44×). It also beat previous academic PIM-based GNN simulators by 4.38×, as those models often ignored the real-world overhead of host-to-device data transfers.
- Resource Utilization: PyGim achieved 11.6× higher resource utilization than optimized CUDA implementations for sparse operations. While PIM cores have lower raw clock speeds, they are far more effective because they eliminate the latency of the memory bus.
- Energy Efficiency: By reducing massive data movement, PyGim improved energy efficiency by 1.55× over PyTorch on the Host and 2.86× over prior PIM schemes.
Limitations and Future Work
While PyGim represents a significant leap forward, current hardware limitations exist. The UPMEM hardware lacks native 32-bit floating-point (fp32) support, requiring software emulation that slows down non-quantized models. Additionally, in the current implementation, the Host sits idle while PIM cores are active. Future iterations of PyGim aim to overlap these execution phases and explore PIM architectures that allow direct inter-core communication, further reducing the reliance on the Host bus.
PyGim will be open-sourced to enable the widespread adoption of PIM systems for graph-based machine learning workloads.
Summary updated