arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2210.15740cs.PL
收藏

Halide语言的形式语义

Formal Semantics for the Halide Language

Alex Reinking, Gilbert Louis Bernstein, Jonathan Ragan-Kelley

摘要:

我们提出了第一个形式化和元理论的语言健全的用户可扩展的语言,广泛使用的数组处理语言Halide。在高性能计算中,用户可重用语言通过将程序应该计算什么的规范与如何计算它的调度分开,在抽象和控制之间取得了平衡。在这个过程中,它们提出了一个新颖的语言可靠性声明:程序的结果应该总是相同的,不管它是如何调度的。这种可靠性的保证是棘手的,以提供存在的计划,引入冗余的重新计算和计算未初始化的数据,而不是简单的重新排序语句。此外,Halide通过编译时边界推理引擎确保内存安全,该引擎确定生成的代码中每个缓冲区和循环的安全大小,提出了一个新的挑战:形式化和分析依赖于不可靠的程序合成算法的结果的语言规范。我们的形式化揭示了缺陷,并导致实际的卤化物系统的改进,我们相信它提供了一个基础,新的语言和工具,适用于程序员控制的调度到其他领域的设计。

英文摘要:

We present the first formalization and metatheory of language soundness for a user-schedulable language, the widely used array processing language Halide. User-schedulable languages strike a balance between abstraction and control in high-performance computing by separating the specification of what a program should compute from a schedule for how to compute it. In the process, they make a novel language soundness claim: the result of a program should always be the same, regardless of how it is scheduled. This soundness guarantee is tricky to provide in the presence of schedules that introduce redundant recomputation and computation on uninitialized data, rather than simply reordering statements. In addition, Halide ensures memory safety through a compile-time bounds inference engine that determines safe sizes for every buffer and loop in the generated code, presenting a novel challenge: formalizing and analyzing a language specification that depends on the results of unreliable program synthesis algorithms. Our formalization has revealed flaws and led to improvements in the practical Halide system, and we believe it provides a foundation for the design of new languages and tools that apply programmer-controlled scheduling to other domains.

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

↑