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

并行函数代码的策略保持编译

Strategy Preserving Compilation for Parallel Functional Code

Robert Atkey, Michel Steuwer, Sam Lindley, Christophe Dubach

摘要:

图形处理单元(GPU)和其他并行设备是广泛可用的,并且具有加速广泛类别的算法的潜力。但是,需要专业的编程技能才能实现最佳性能。这些设备通过命令式编程接口暴露低级硬件细节,其中程序员显式地编码设备特定的优化策略。这不可避免地导致非性能可移植程序在其他设备上提供次优性能。函数式编程模型最近在系统社区中复兴,因为它们为解决性能可移植性挑战提供了可能的解决方案。最近的工作已经表明,如何自动选择高性能的并行化策略的广泛的硬件架构编码的功能表示。然而,这种功能表示到硬件接口所期望的命令式程序的转换通常是临时执行的,没有正确性保证,也没有保证保留预期的并行化策略。在本文中,我们提出了一个形式化的战略保持翻译从高层次的功能代码低层次的数据竞争免费并行命令式代码。这种翻译是制定和证明正确的语言,我们称之为数据并行理想化的Algol(DPIA),方言雷诺兹的理想化的Algol。GPU和多核CPU上的性能结果表明,形式化的翻译过程生成的低级代码的性能与ad hoc方法生成的代码相当。

英文摘要:

Graphics Processing Units (GPUs) and other parallel devices are widely available and have the potential for accelerating a wide class of algorithms. However, expert programming skills are required to achieving maximum performance. hese devices expose low-level hardware details through imperative programming interfaces where programmers explicity encode device-specific optimisation strategies. This inevitably results in non-performance-portable programs delivering suboptimal performance on other devices. Functional programming models have recently seen a renaissance in the systems community as they offer possible solutions for tackling the performance portability challenge. Recent work has shown how to automatically choose high-performance parallelisation strategies for a wide range of hardware architectures encoded in a functional representation. However, the translation of such functional representations to the imperative program expected by the hardware interface is typically performed ad hoc with no correctness guarantees and no guarantees to preserve the intended parallelisation strategy. In this paper, we present a formalised strategy-preserving translation from high-level functional code to low-level data race free parallel imperative code. This translation is formulated and proved correct within a language we call Data Parallel Idealised Algol (DPIA), a dialect of Reynolds' Idealised Algol. Performance results on GPUs and a multicore CPU show that the formalised translation process generates low-level code with performance on a par with code generated from ad hoc approaches.

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

↑