Language models are now prevalent in software engineering with many developers using them to automate tasks and accelerate their development. While language models have been tremendous at accomplishing complex software engineering tasks, there are still many areas where they fail to deliver desirable results, for instance code performance related tasks. Tasks like optimization depend on many complex data from the environment, hardware, etc. that are not directly represented in source code. Recent efforts have seen large improvements in general code modeling tasks using chain-of-thought style reasoning, but these models still fail to comprehend how the environment interacts with code performance. In this paper we propose a methodology to train language models that can interact with performance tools during their reasoning process. We then demonstrate how this methodology can be used to train a state-of-the-art GPU kernel optimization model.
翻译:语言模型现已广泛应用于软件工程领域,众多开发者借助其实现任务自动化并加速开发进程。尽管语言模型在完成复杂软件工程任务方面已取得显著成就,但在某些领域仍难以提供理想结果,例如代码性能相关任务。优化类任务依赖于环境、硬件等多重复杂数据,这些信息并未直接体现在源代码中。近期研究通过思维链式推理在通用代码建模任务上取得重大进展,但现有模型仍难以理解环境因素与代码性能间的交互机制。本文提出一种训练语言模型的方法论,使其能够在推理过程中与性能工具进行交互。我们进一步演示了如何运用该方法论训练当前最先进的GPU内核优化模型。