We use cookies to improve your experience with our site.

在Godson-T上对Stencil计算的优化

Landing Stencil Code on Godson-T

  • 摘要: 1.本文的创新点
           本文探讨了在众核平台Godson-T上对Stencil这类计算的优化经验,优化过程利用了Godson-T特殊的硬件特征 – 可全局访问的片上显式存储SPM以及细粒度同步(full-empty位)。
           在已有stencil并行技术(time tiling及其变种)基础上,我们在Godson-T上探索并手工实现了一个优化序列。实验证明这一优化序列大大改善了Stencil计算在Godson-T平台上的性能和可扩展性,证明了Godson-T新硬件特征的有效性,并为我们将来的众核编译器开发提供了指导。
    2.实现方法
           我们以split-tiling作为基础,在Godson-T上探索众核平台下有哪些优化需要考虑才能获得理想的性能。简单的split tiling在我们的平台上只能获得2GFLOPS的性能(只有峰值性能的1.8%左右),我们对性能进行分析,实施了三个主要的优化:1)针对单线程的传统编译优化,主要包括re-association、循环展开、公共子表达式消除、MADD优化、寄存器分配、指令调度、软流水等);2)利用可全局访问的SPM来消除Barrier点片上和片下存储之间的流量,我们显式的将数据从内存取入SPM,然后完全在片上SPM中进行计算,最后再存回内存;3)利用细粒度同步来彻底消除barrier。我们对1-D Jacobi的同步模式进行分析,确定了其单生产者多消费者的同步模型,并利用Godson-T的单生产者单消费者模型进行实现。
           在实验部分,对我们实施的三个主要优化进行了评估,证明这些优化都对最终的程序性能有很大的贡献,而且自身都具有良好的可扩展性,能够随着核数的增加获得良好的加速比。实施了这三个优化之后,我们的性能从最初的2GFLOPS提高到了82GFLOPS。我们的实验结果为将来众核编译器提供了三个指导:1)针对单线程的编译优化仍然是需要考虑的关键因素之一;2)可全局编址的SPM和细粒度同步对性能有重要贡献,未来的Godson-T编译器应该对这两个新的硬件特征进行着重考虑;3)对于1-D Jacobi来说,空间和时间维度的tilesize选择可以静态确定。 
    3.结论及未来待解决的问题
           我们在Godson-T上手工实现了对stencil程序的优化,表明了在Godson-T上,充分利用可全局访问SPM和细粒度同步对于stencil计算的重要意义。实验结果验证了这一方法在Godson-T平台上的性能和可扩展性,并为将来众核编译器的研究和开发提供了指导。
           对于一维Jacobi来说,面积体积比很小,这样对远程边界数据的存取操作开销并不会影响最终的性能。但是对与二维来说,随着面积体积比的增加,远程边界数据的存储对性能的影响会越来越大。对于序号为(x,0)的处理器核来说,需要访问处理器(x-1,7)的大量数据,从而导致这些核成为片上的瓶颈。我们下一步将考虑对高维的Jacobi如何解决这一问题。
    4.实用价值或应用前景
           本文的工作对于如何充分发挥众核平台的计算能力进行了探讨,为stencil类计算的优化提供了参考,并且为将来众核编译器的开发提供了一定的指导意义。

     

    Abstract: The advent of multi-core/many-core chip technology offers both an extraordinary opportunity and a profound challenge. In particular, computer architects and system software designers are faced with a unique opportunity to introducing new architecture features as well as adequate compiler technology --- together they may have profound impact. This paper presents a case study (using the 1-D Jacobi computation) of compiler-amendable performance optimization techniques on a many-core architecture Godson-T. Godson-T architecture has several unique features that are chosen for this study: 1) chip-level global addressable memory in particular the scratchpad memories (SPM) local to the processing cores; 2) fine-grain memory based synchronization (e.g., full-empty bit for fine-grain synchronization). Leveraging state-of-the-art performance optimization methods for 1-D stencil parallelization (e.g., timed tiling and variants), we developed and implement a number of many-core-based optimization for Godson-T. Our experimental study shows good performance in both execution time speedup and scalability, validate the value of globally accessed SPM and fine-grain synchronization mechanism (full-empty bits) under the Godson-T, and provides some useful guidelines for future compiler technology of many-core chip architectures.

     

/

返回文章
返回