论文标题

替换缓存的模仿学习方法

An Imitation Learning Approach for Cache Replacement

论文作者

Liu, Evan Zheran, Hashemi, Milad, Swersky, Kevin, Ranganathan, Parthasarathy, Ahn, Junwhan

论文摘要

程序执行速度严重取决于增加缓存命中,因为缓存命中率比失误快的数量级。为了增加缓存命中,我们专注于缓存替换的问题:选择哪个缓存线驱逐插入新线路。这是具有挑战性的,因为它需要计划远远领先,目前尚无已知的实际解决方案。结果,当前的替换策略通常诉诸于针对特定的常见访问模式设计的启发式方法,这些访问模式失败了,并且在更加多样化和复杂的访问模式上失败。相比之下,我们提出了一种模仿学习方法,通过利用Belady's自动学习缓存访问模式,这是一种甲骨文策略,该策略在未来的缓存访问中计算最佳驱逐决策。尽管直接应用Belady的未来是未知的,但我们仅根据过去的访问来培训一项政策,该政策可以准确地近似Belady的访问方式,甚至以各种而复杂的访问模式,并将这种方法称为鹦鹉。当对13个最有内存的规格应用程序进行评估时,鹦鹉将缓存率的率提高20%,而现在的现状与当前的状态相比。此外,在大规模的Web搜索基准中,鹦鹉比常规LRU政策将高速缓存率提高了61%。我们发布了一个健身房环境,以促进该领域的研究,因为数据很丰富,进一步的进步可能会产生重大的现实影响。

Program execution speed critically depends on increasing cache hits, as cache hits are orders of magnitude faster than misses. To increase cache hits, we focus on the problem of cache replacement: choosing which cache line to evict upon inserting a new line. This is challenging because it requires planning far ahead and currently there is no known practical solution. As a result, current replacement policies typically resort to heuristics designed for specific common access patterns, which fail on more diverse and complex access patterns. In contrast, we propose an imitation learning approach to automatically learn cache access patterns by leveraging Belady's, an oracle policy that computes the optimal eviction decision given the future cache accesses. While directly applying Belady's is infeasible since the future is unknown, we train a policy conditioned only on past accesses that accurately approximates Belady's even on diverse and complex access patterns, and call this approach Parrot. When evaluated on 13 of the most memory-intensive SPEC applications, Parrot increases cache miss rates by 20% over the current state of the art. In addition, on a large-scale web search benchmark, Parrot increases cache hit rates by 61% over a conventional LRU policy. We release a Gym environment to facilitate research in this area, as data is plentiful, and further advancements can have significant real-world impact.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源