用卷积神经网络建立全局历史模型改进分支预测
Improving Branch Prediction By Modeling Global History with Convolutional Neural Networks
摘要:
CPU分支预测已经碰壁--现有技术在99%的静态分支上达到了近乎完美的准确性,但仍然存在的错误预测隐藏了主要的性能提升。在一份配套报告中,我们发现预测错误的主要来源是一些系统性难以预测的分支(H2 P),例如SPECint 2017中每个SimPoint阶段只有10条静态指令。这些错误预测所造成的机会损失对CPU来说是很重要的:英特尔SkyLake上的每周期执行次数(IPC)为14.0%,当流水线扩展到四倍时,IPC为37.4%,与处理技术的收益相当。然而,高达80%的这种上升是最知名的分支预测器无法达到的,即使提供了指数级更多的资源。需要新的方法,而机器学习(ML)提供了一系列强大的预测器。越来越多的工作表明,ML模型可以在微架构中部署,以在运行时优化硬件,并且是通过培训客户应用程序来定制硅后CPU的一种方式。我们使用卷积神经网络(CNN)开发了这种用于分支预测的场景,以提高H2 Ps的准确性。逐步地,我们(1)将CNN映射到现有分支预测器使用的全局历史数据;(2)展示CNN如何在SPEC 2017中改进H2 P预测;(3)使2位CNN推理适应当前分支预测单元的约束;以及(4)建立CNN辅助预测器可在不同输入上跨应用执行重用,使我们能够分摊离线训练并部署ML模式匹配来改善IPC。
英文摘要:
CPU branch prediction has hit a wall--existing techniques achieve near-perfect accuracy on 99% of static branches, and yet the mispredictions that remain hide major performance gains. In a companion report, we show that a primary source of mispredictions is a handful of systematically hard-to-predict branches (H2Ps), e.g. just 10 static instructions per SimPoint phase in SPECint 2017. The lost opportunity posed by these mispredictions is significant to the CPU: 14.0% in instructions-per-cycle (IPC) on Intel SkyLake and 37.4% IPC when the pipeline is scaled four-fold, on par with gains from process technology. However, up to 80% of this upside is unreachable by the best known branch predictors, even when afforded exponentially more resources. New approaches are needed, and machine learning (ML) provides a palette of powerful predictors. A growing body of work has shown that ML models are deployable within the microarchitecture to optimize hardware at runtime, and are one way to customize CPUs post-silicon by training to customer applications. We develop this scenario for branch prediction using convolutional neural networks (CNNs) to boost accuracy for H2Ps. Step-by-step, we (1) map CNNs to the global history data used by existing branch predictors; (2) show how CNNs improve H2P prediction in SPEC 2017; (3) adapt 2-bit CNN inference to the constraints of current branch prediction units; and (4) establish that CNN helper predictors are reusable across application executions on different inputs, enabling us to amortize offline training and deploy ML pattern matching to improve IPC.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。