Skip to main content
QUICK REVIEW

[论文解读] Applying Type Oriented Programming to the PGAS Memory Model

Nicholas Edward Brown|arXiv (Cornell University)|Sep 26, 2020
Parallel Computing and Optimization Techniques被引用 3
一句话总结

本文提出面向类型的编程,通过在类型中直接编码并行语义(如数据分布、通信模式和内存布局),增强PGAS内存模型,从而实现高层级、可组合且可调优的并行代码。通过Mesham语言,作者证明了类型驱动的编译可实现与FFTW3相当的FFT性能,同时仅通过类型注解即可使非专家程序员轻松调整代码以实现可扩展性和高性能。

ABSTRACT

The Partitioned Global Address Space memory model has been popularised by a number of languages and applications. However this abstraction can often result in the programmer having to rely on some in built choices and with this implicit parallelism, with little assistance by the programmer, the scalability and performance of the code heavily depends on the compiler and choice of application. We propose an approach, type oriented programming, where all aspects of parallelism are encoded via types and the type system. The type information associated by the programmer will determine, for instance, how an array is allocated, partitioned and distributed. With this rich, high level of information the compiler can generate an efficient target executable. If the programmer wishes to omit detailed type information then the compiler will rely on well documented and safe default behaviour which can be tuned at a later date with the addition of types. The type oriented parallel programming language Mesham, which follows the PGAS memory model, is presented. We illustrate how, if so wished, with the use of types one can tune all parameters and options associated with this PGAS model in a clean and consistent manner without rewriting large portions of code. An FFT case study is presented and considered both in terms of programmability and performance - the latter we demonstrate by a comparison with an existing FFT solver.

研究动机与目标

  • 解决基于PGAS的并行编程中程序员简洁性与性能控制之间的矛盾。
  • 使非专家HPC用户能够在不重写代码的情况下表达并调整底层并行决策。
  • 通过在类型中编码并行语义,降低在不同架构间移植和优化并行代码的复杂性。
  • 证明丰富的类型信息可引导编译器在最小程序员投入下生成高效且可扩展的代码。
  • 通过二维FFT案例研究评估该方法,与FFTW3等成熟框架在可编程性与性能方面进行对比。

提出的方法

  • 引入一种新型类型系统,其中数据类型编码并行语义,如数据分布、内存布局和通信模式。
  • 设计Mesham语言,通过用户自定义类型嵌入PGAS语义,并为向后兼容性提供默认行为。
  • 在变量声明处使用类型注解,指导编译器生成针对特定架构优化的并行代码。
  • 实现一个运行时抽象层,将高层类型映射到底层通信(如MPI)和执行模型(如多线程)。
  • 支持动态类型转换和函数参数传递,同时保持完整的类型追踪,以在函数调用中保留数据分布语义。
  • 应用该类型系统调整数据分解策略(如块分布与循环分布),而无需修改算法逻辑。

实验结果

研究问题

  • RQ1在高级语言中,类型注解能否有效编码并控制PGAS中的底层并行决策?
  • RQ2面向类型的编程在多大程度上可提升代码在异构架构间的可维护性与可移植性?
  • RQ3与手写优化的成熟库(如FFTW3)相比,基于类型驱动的PGAS实现性能如何?
  • RQ4非专家程序员是否可通过基于类型的调优实现高性能,而无需深入掌握HPC知识?
  • RQ5基于类型的代码调优对数据并行内核中的通信开销与可扩展性有何影响?

主要发现

  • Mesham在二维FFT基准测试中实现了与FFTW3相当的性能,证明了类型驱动的通信优化可匹配甚至超越手写调优方案。
  • 仅通过修改类型即可调整数据分解策略,无需重构算法逻辑,显著降低了调优工作量。
  • 编译器仅依赖类型信息即成功生成了高效且可扩展的代码,无需显式并行指令。
  • 运行时系统保持了完整的类型与状态追踪,避免了函数调用期间不必要的数据重分布。
  • 在超过最优进程数后,Mesham的性能出现下降,表明强可扩展性方面仍需进一步调优。
  • 该方法通过可插拔的运行时抽象层实现对异构系统的无缝移植,且无需修改源代码。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。