Snowflake: A Lightweight Portable Stencil DSL

Snowflake: A Lightweight Portable Stencil DSL
复制标题

Snowflake:轻量级便携式模板 DSL

DOI:
--
复制
发表时间:
2017
期刊:
IEEE International Symposium on Parallel & Distributed Processing, Workshops and Phd Forum
影响因子:
--
通讯作者:
A. Fox
A. Fox
中科院分区:
--
文献类型:
--
作者:
Nathan Zhang;Michael B. Driscoll;Chick Markley;Samuel Williams;P. Basu;A. Fox

文献摘要

被引文献

相似文献

通用生产编译器无法很好地优化模板计算,并且多核、众核和基于加速器的系统的使用增加使得优化问题变得更具挑战性。在本文中,我们介绍了 Snowflake,这是一种用于模板的领域特定语言 (DSL),它使用“微编译器”方法,即小型、集中、特定于领域的代码生成器。该方法与图像处理模板中使用的方法类似,但 Snowflake 可以处理科学计算中出现的更复杂的模板,包括复杂的边界条件、高阶运算符(更大的模板)​​、更高的维度、可变系数、非单位步长迭代空间以及多个输入或输出网格。 Snowflake 嵌入到 Python 语言中,使其能够与 SciPy 和 iPython 等流行的科学工具进行互操作;它还利用内置 Python 库作为即时编译器的一部分进行强大的依赖性分析。我们通过复杂的科学基准 HPGMG 展示了 Snowflake 语言和微编译器方法的强大功能,该基准测试了 Snowflake 中模板支持的通用性。通过生成与 OpenMP 相当的 OpenMP,以及在手动优化 HPGMG 2 倍之内的 OpenCL,Snowflake 证明了微编译器可以支持不同的处理器架构,并且在保留高级 Python 实现的同时具有性能竞争力。
Stencil computations are not well optimized by general-purpose production compilers and the increased use of multicore, manycore, and accelerator-based systems makes the optimization problem even more challenging. In this paper we present Snowflake, a Domain Specific Language (DSL) for stencils that uses a "micro-compiler" approach, i.e., small, focused, domain-specific code generators. The approach is similar to that used in image processing stencils, but Snowflake handles the much more complex stencils that arise in scientific computing, including complex boundary conditions, higher-order operators (larger stencils), higher dimensions, variable coefficients, non-unit-stride iteration spaces, and multiple input or output meshes. Snowflake is embedded in the Python language, allowing it to interoperate with popular scientific tools like SciPy and iPython; it also takes advantage of built-in Python libraries for powerful dependence analysis as part of a just-in-time compiler. We demonstrate the power of the Snowflake language and the micro-compiler approach with a complex scientific benchmark, HPGMG, that exercises the generality of stencil support in Snowflake. By generating OpenMP comparable to, and OpenCL within a factor of 2x of hand-optimized HPGMG, Snowflake demonstrates that a micro-compiler can support diverse processor architectures and is performance-competitive whilst preserving a high-level Python implementation.