BenchDirect:一种面向评测的有向语言模型
BenchDirect: A Directed Language Model for Compiler Benchmarks
摘要:
硬件软件复杂性的指数级增长使得编译器工程师不可能手动找到正确的优化策略。预测模型已经被证明可以用很少的人力找到接近最优的算法,但它们受到严重缺乏不同基准的限制,训练。研究人员已经使用生成式人工智能将基准合成到现有的数据集中。然而,合成程序都很短,过于简单,缺乏多样性的特点。我们开发了BenchPress,这是第一个可以在源代码特征表示中定向的ML编译器基准生成器。BenchPress通过填充程序左右上下文的代码来合成可执行函数。BenchPress使用主动学习将具有未知特征的新基准引入Grewe等人的数据集。CPU vs GPU启发式,将其获得的性能提高了50%。BenchPress的目标功能是其他合成器无法达到的。在3个功能空间中,我们在针对Rodinia基准测试的功能方面优于来自GitHub、CLgen、CLSmith和SRCIROR mutator的人类编写的代码。BenchPress通过束搜索在与特性无关的语言模型上引导生成。我们改进了这与BenchDirect,它利用了一个直接的LM,通过共同观察源代码上下文和编译器功能的目标,填充程序。BenchDirect在针对Rodinia基准测试的功能方面实现了高达36%的准确性,与BenchPress相比,它提供精确匹配的可能性高出1.8倍,执行时间缩短了72%。我们的两个模型都产生了难以与人类编写的代码区分开来的代码。我们进行了图灵测试,结果显示我们的模型的合成基准测试被标记为“人类编写的”,就像GitHub上的人类编写的代码一样。
英文摘要:
The exponential increase of hardware-software complexity has made it impossible for compiler engineers to find the right optimization heuristics manually. Predictive models have been shown to find near optimal heuristics with little human effort but they are limited by a severe lack of diverse benchmarks to train on. Generative AI has been used by researchers to synthesize benchmarks into existing datasets. However, the synthetic programs are short, exceedingly simple and lacking diversity in their features. We develop BenchPress, the first ML compiler benchmark generator that can be directed within source code feature representations. BenchPress synthesizes executable functions by infilling code that conditions on the program's left and right context. BenchPress uses active learning to introduce new benchmarks with unseen features into the dataset of Grewe's et al. CPU vs GPU heuristic, improving its acquired performance by 50%. BenchPress targets features that has been impossible for other synthesizers to reach. In 3 feature spaces, we outperform human-written code from GitHub, CLgen, CLSmith and the SRCIROR mutator in targeting the features of Rodinia benchmarks. BenchPress steers generation with beam search over a feature-agnostic language model. We improve this with BenchDirect which utilizes a directed LM that infills programs by jointly observing source code context and the compiler features that are targeted. BenchDirect achieves up to 36% better accuracy in targeting the features of Rodinia benchmarks, it is 1.8x more likely to give an exact match and it speeds up execution time by up to 72% compared to BenchPress. Both our models produce code that is difficult to distinguish from human-written code. We conduct a Turing test which shows our models' synthetic benchmarks are labelled as 'human-written' as often as human-written code from GitHub.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。