Abstract
Graph analytics are fundamental to modern data processing but are notoriously limited by memory bandwidth and latency. Traditional hardware prefetchers often fail to capture the irregular, phase-dependent access patterns inherent in graph algorithms. This paper introduces MPGraph, a domain-specific machine learning (ML) prefetcher designed to address these challenges. By leveraging soft phase detection, multi-modal attention mechanisms, and chained spatio-temporal prefetching, MPGraph achieves significant performance gains over both rule-based and general-purpose ML prefetchers.
Introduction
Graph processing frameworks like PageRank and Breadth-First Search (BFS) are essential for analyzing complex networks, yet they suffer from severe memory bottlenecks. Unlike linear data structures, graphs exhibit highly irregular memory access patterns that frequently defeat standard spatial and temporal prefetchers. Furthermore, graph algorithms typically transition through distinct computational phases—such as "Scatter" and "Gather"—each with unique access characteristics.
Existing ML-based prefetchers often treat memory requests as a simple sequence prediction problem, ignoring the rich execution context provided by the underlying graph framework. MPGraph bridges this gap by incorporating domain-specific knowledge into its architecture, specifically targeting the temporal and spatial locality shifts that occur during graph execution.
The Challenges of Graph Prefetching
Graph analytics present three primary obstacles to effective prefetching:
- Irregular Access Patterns: Processing connected vertices often requires jumping across non-contiguous memory pages. Traditional spatial prefetchers, which rely on patterns within a single page, are largely ineffective here.
- Phase Transitions: Graph algorithms move through distinct stages. A prefetcher optimized for one phase may become a liability when the algorithm shifts to another, leading to cache pollution and wasted bandwidth.
- Parallel Execution Noise: In multi-core environments, the interleaving of memory requests from different threads introduces randomness, making it difficult for temporal models to identify recurring sequences.
MPGraph Architecture
To overcome these hurdles, MPGraph introduces three core innovations:
1. Soft Phase Detection
Rather than employing a static model, MPGraph utilizes dynamic phase detection to adapt to the algorithm's current state. The authors propose "Soft-KSWIN" (an unsupervised approach) and "Soft-DT" (a supervised approach) detectors. These mechanisms use a "soft" windowing scheme to filter out temporary noise and spikes, ensuring the prefetcher only switches models when a sustained change in the access pattern is detected.
2. Attention-based Multi-Modality Attention (AMMA)
Standard prefetchers typically only consider the sequence of memory addresses. MPGraph treats the Program Counter (PC)—the specific instruction triggering the memory access—as a separate "modality." By using an attention-based neural network to fuse address and PC information, AMMA provides the model with a clearer picture of the execution context. The authors observed that PCs form distinct clusters corresponding to different algorithmic phases, making them a powerful signal for prediction.
3. Chain Spatio-Temporal Prefetching (CSTP)
MPGraph employs a hierarchical prediction strategy. It first uses a temporal model to predict the next memory page likely to be accessed. It then "chains" this to a spatial model that predicts multiple deltas (offsets) within that future page. This approach allows the system to generate a sequence of high-confidence prefetch requests across page boundaries.
Implementation and Optimization
Deploying ML models in hardware requires extreme efficiency. The researchers applied Knowledge Distillation and Binary Encoding to compress the MPGraph models by up to 87x. To mitigate the latency of neural network inference, they utilized Distance Prefetching, which initiates the prediction process early enough to ensure the prefetched data arrives before it is needed by the CPU.
Evaluation
The performance of MPGraph was evaluated using the ChampSim microarchitectural simulator across three major graph frameworks: GPOP, X-Stream, and PowerGraph. The study utilized a mix of real-world datasets (e.g., Amazon, Google web graphs, Wikipedia) and synthetic R-MAT graphs.
Key Results
- Performance Gains: MPGraph improved instructions per cycle (IPC) by 12.52% to 21.23% across the tested frameworks.
- Competitive Advantage: MPGraph outperformed the best rule-based prefetcher (Best Offset) by 7.58–12.03%. It also surpassed state-of-the-art ML prefetchers like Voyager and TransFetch by approximately 3–4.5%.
- Accuracy: The AMMA model demonstrated a 6.8–16% higher F1-score for delta prediction compared to standard LSTM or vanilla attention models.
- Practicality: Even with a simulated 200-cycle inference latency and significant model compression, MPGraph maintained a 3.58% lead over traditional hardware prefetchers.
Conclusion and Future Work
MPGraph demonstrates that domain-specific knowledge is crucial for accelerating memory-intensive graph workloads. By recognizing algorithmic phases and utilizing multi-modal context, it provides a significant leap in prefetching accuracy and system performance.
Future research directions include moving from offline training to online adaptation, allowing the prefetcher to learn and update its models in real-time. Additionally, extending these phase-detection techniques to asynchronous graph processing frameworks remains a promising area for further exploration.
Summary updated