arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2601.09583cs.PL
收藏

MLIR-Forge:一种模块化的语言smith框架

MLIR-Forge: A Modular Framework for Language Smiths

ETH Zurich(苏黎世联邦理工学院)

Berke Ates, Philipp Schaad, Timo Schneider, Alexandru Calotoiu, Torsten Hoefler

AI总结:

MLIR-Forge是一种利用MLIR灵活性的模块化随机程序生成框架,通过分解生成过程为语言特定和可重用的构建块,简化了领域特定编译器IR的测试和bug检测。

摘要:

优化编译器对于各种科学领域中软件的高效正确执行至关重要。领域特定语言(DSL)通常在其编译器管道中使用更高级的中间表示(IR)进行领域特定优化。由于这些IR增加了复杂性,因此必须彻底测试它们。随机程序生成器已被证明是通过差分和模糊测试测试编译器的有效工具。然而,为编译器IR开发专门的程序生成器并不容易,需要大量资源。我们介绍了MLIR-Forge,一种新的随机程序生成器框架,利用MLIR的灵活性,旨在简化专门程序生成器的创建。MLIR-Forge通过将生成过程分成基本构建块和可重用的程序创建逻辑来实现这一点,这些构建块是语言特定的,而可重用的逻辑则从这些构建块中构建随机程序。这隐藏了复杂性,而且甚至语言特定的组件也可以使用一组通用工具定义。我们通过生成MLIR内置方言、WebAssembly和数据为中心的程序表示DaCe来展示MLIR-Forge的能力,这需要每个都总开发时间不到一周。使用生成的程序,我们进行了差分测试,并在运行直到新bug率停滞后发现了9个MLIR、15个WebAssembly和774个DaCe组的bug。

英文摘要:

Optimizing compilers are essential for the efficient and correct execution of software across various scientific fields. Domain-specific languages (DSL) typically use higher level intermediate representations (IR) in their compiler pipelines for domain-specific optimizations. As these IRs add to complexity, it is crucial to test them thoroughly. Random program generators have proven to be an effective tool to test compilers through differential and fuzz testing. However, developing specialized program generators for compiler IRs is not straightforward and demands considerable resources. We introduce MLIR-Forge, a novel random program generator framework that leverages the flexibility of MLIR, aiming to simplify the creation of specialized program generators. MLIR-Forge achieves this by splitting the generation process into fundamental building blocks that are language specific, and reusable program creation logic that constructs random programs from these building blocks. This hides complexity and furthermore, even the language specific components can be defined using a set of common tools. We demonstrate MLIR-Forge's capabilities by generating MLIR with built-in dialects, WebAssembly, and a data-centric program representation, DaCe -- requiring less than a week of development time in total for each of them. Using the generated programs we conduct differential testing and find 9 MLIR, 15 WebAssembly, and 774 DaCe groups of bugs with the corresponding program generators, after running them until the rate of new bugs stagnates.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑