3D-DP: A Practical DRL-Based Data Prefetcher with a Dynamic Prefetch Degree and Direction
摘要
Data prefetching is an essential technique that bridges the memory wall by speculatively loading data to hide memory access latency. Although Reinforcement Learning (RL)-based prefetchers such as Pythia show significant potential, they remain limited by state representations, high hardware overhead, and the inability to dynamically coordinate the prefetch degree and direction. To address these limitations, we propose 3D-DP, a novel prefetcher based on Deep Reinforcement Learning (DRL). 3D-DP replaces large Q-tables with a lightweight fully connected neural network. This approach allows for the direct processing of high-dimensional state features, alleviating the state aliasing issues introduced by hash-based indexing. It also addresses slow-start issues thanks to the network’s ability to generalize across parameters. 3D-DP also introduces an adaptive control mechanism that dynamically determines the optimal prefetch degree for each memory page based on its access history and current system load. This is complemented by a low-overhead algorithm for predicting prefetch direction, enabling fine-grained coordination of both the amount and direction of prefetched data. For practical hardware implementation, we also propose 3D-DP-TQ, a quantized version of 3D-DP that leverages ternary quantization to compress the storage overhead to just 4.92 KB. Our evaluations using the SPEC CPU 2006 and 2017 benchmarks show that 3D-DP outperforms state-of-the-art prefetchers, achieving performance improvements of 10.2%, 7.6%, and 5.2% over Pythia, MLOP, and Berti, respectively. Notably, 3D-DP-TQ retains 95.5% of 3D-DP’s performance and incurs a substantially lower hardware cost, demonstrating an effective trade-off between performance and efficiency.