GPU预测器:语言模型作为内核运行时优化的选择性替代
GPU Forecasters: Language Models as Selective Surrogates for Kernel Runtime Optimization
AI总结:
研究利用语言模型作为GPU内核性能的选择性替代,通过强化学习提高预测准确性和校准度,在有限GPU评估预算下加速内核搜索。
摘要:
GPU内核是现代深度学习的主力,优化它们(通过进化搜索或编码代理)通常需要在目标硬件上重复测量。虽然这些测量提供了内核搜索所需的地面真实信号,但成本高昂,因为每次评估内核都需要编译并在GPU上重复执行。随着LLM推理的改进降低了编写新内核的成本,并且LLM驱动的搜索扩展到大的搜索预算,设备上的评估成为瓶颈。为了解决这个问题,我们研究LLM如何通过预测所提议内核的性能,作为选择性GPU替代用于内核评估。一个有用的替代应该是准确的,并且应该是选择性的,知道何时可能出错,并推迟到GPU。为了评估替代,我们测量其预测是否准确、校准良好,并且在有限的GPU测量预算下对恢复快速内核实际有用。接下来,我们研究强化学习是否能提高预测准确性和置信度校准。我们的实验表明,LLM可以准确预测相对内核性能,并且通过强化学习可以提高其实用性。在内核搜索中使用替代,使得搜索在相同的GPU评估预算下可以考虑多倍的候选,从而比同等预算的基线找到更快的内核。这些结果表明,LLM可以在内核优化中发挥更广泛的作用,作为GPU的虚拟模型,而不仅仅是搜索的内核生成器。
英文摘要:
GPU kernels are the workhorse of modern deep learning, and optimizing them (via evolutionary search or coding agents) usually requires repeated measurement on target hardware. While these measurements provide the ground-truth signal necessary for kernel search, they are costly, because each evaluation of a kernel requires compilation and repeated execution on a GPU. As improvements in LLM inference reduce the cost of writing novel kernels and LLM-driven searches scale to large search budgets, on-device evaluation becomes a bottleneck. To address this, we study how LLMs can serve as selective GPU surrogates for kernel evaluation, by forecasting the performance of proposed kernels. A useful surrogate should be accurate, and it should be selective, by knowing when it could be wrong, and deferring to the GPU. To evaluate surrogates, we measure whether their forecasts are accurate, calibrated, and practically useful for recovering fast kernels under limited GPU-measurement budgets. Next, we study whether reinforcement learning can improve forecast accuracy and confidence calibration. Our experiments demonstrate that LLMs can accurately forecast relative kernel performance, that their utility can be improved through reinforcement learning. Used inside a kernel search, the surrogate lets the search consider several times as many candidates under the same GPU evaluation budget, and that leads to finding faster kernels than an equal-budget baseline. These results suggest that LLMs can play a broader role in kernel optimization, by acting as virtual models of a GPU rather than solely as kernel generators for search.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。