arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2312.13170cs.PLcs.DCcs.PF
收藏

基于MLIR的SYCL编译器构建经验

Experiences Building an MLIR-based SYCL Compiler

Ettore Tiotto, Víctor Pérez, Whitney Tsang, Lukas Sommer, Julian Oppermann, Victor Lomüller, Mehdi Goli, James Brodman

AI总结:

本文介绍基于MLIR框架构建SYCL编译器的实践经验,通过方言机制建模主机与设备代码,实现强大优化与分析,相比LLVM实现最高提速4.3倍,并探讨了未来挑战。

摘要:

与其他编程模型类似,针对SYCL(基于C++的异构计算开放编程模型)的编译器,若能访问更高级别的中间表示将受益匪浅。过早地降级到低级中间表示所导致的高级结构和语义的丢失,以及无法同时推理主机代码和设备代码,这些都给SYCL编译器带来了重大挑战。MLIR编译器框架通过其方言机制,能够对特定领域的、高级别的中间表示进行建模,并提供必要的设施来应对这些挑战。因此,本工作描述了基于MLIR的SYCL编译器的设计与实现中的实践经验。通过在MLIR方言框架中对主机代码和设备代码中的SYCL编程模型关键元素进行建模,所提出的方法能够实现强大的设备代码优化以及跨主机和设备代码的分析。与两个基于LLVM的SYCL实现相比,在一组SYCL基准测试应用上,该方法实现了高达4.3倍的加速。最后,本工作还讨论了设计与实现过程中遇到的挑战,以及未来如何解决这些挑战。

英文摘要:

Similar to other programming models, compilers for SYCL, the open programming model for heterogeneous computing based on C++, would benefit from access to higher-level intermediate representations. The loss of high-level structure and semantics caused by premature lowering to low-level intermediate representations and the inability to reason about host and device code simultaneously present major challenges for SYCL compilers. The MLIR compiler framework, through its dialect mechanism, allows to model domain-specific, high-level intermediate representations and provides the necessary facilities to address these challenges. This work therefore describes practical experience with the design and implementation of an MLIR-based SYCL compiler. By modeling key elements of the SYCL programming model in host and device code in the MLIR dialect framework, the presented approach enables the implementation of powerful device code optimizations as well as analyses across host and device code. Compared to two LLVM-based SYCL implementations, this yields speedups of up to 4.3x on a collection of SYCL benchmark applications. Finally, this work also discusses challenges encountered in the design and implementation and how these could be addressed in the future.

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

↑