线性高阶间断Galerkin格式的向量化和最小内存占用
Vectorization and Minimization of Memory Footprint for Linear High-Order Discontinuous Galerkin Schemes
摘要:
我们提出了一系列的优化的性能关键的计算内核的高阶不连续Galerkin求解器的双曲PDE引擎ExaHyPE -连续解决瓶颈,由于SIMD操作,缓存层次结构和软件设计中的限制。从数值方案的通用标量实现开始,我们的第一个优化变体应用了最先进的优化技术,通过向量化循环,改进数据布局,并使用Loop-over-GEMM通过LIBXSMM库提供的高度优化的矩阵乘法函数执行张量收缩。我们表明,由于内存占用超过我们的L2缓存大小阻碍了矢量化收益的内存失速。因此,我们引入了一个新的内核,适用于和因式分解的方法,以减少内核的内存占用,并提高其缓存的局部性。随着L2缓存瓶颈的消除,我们能够利用额外的矢量化机会,通过引入混合阵列结构阵列数据布局,解决矩阵乘法内核和逐点函数之间的数据布局冲突,以实现PDE特定的条款。使用最后一个内核,在高多项式阶的基准模拟中评估,只有2%的浮点操作仍然使用标量指令执行,并且实现了22.5%的可用性能。
英文摘要:
We present a sequence of optimizations to the performance-critical compute kernels of the high-order discontinuous Galerkin solver of the hyperbolic PDE engine ExaHyPE -- successively tackling bottlenecks due to SIMD operations, cache hierarchies and restrictions in the software design. Starting from a generic scalar implementation of the numerical scheme, our first optimized variant applies state-of-the-art optimization techniques by vectorizing loops, improving the data layout and using Loop-over-GEMM to perform tensor contractions via highly optimized matrix multiplication functions provided by the LIBXSMM library. We show that memory stalls due to a memory footprint exceeding our L2 cache size hindered the vectorization gains. We therefore introduce a new kernel that applies a sum factorization approach to reduce the kernel's memory footprint and improve its cache locality. With the L2 cache bottleneck removed, we were able to exploit additional vectorization opportunities, by introducing a hybrid Array-of-Structure-of-Array data layout that solves the data layout conflict between matrix multiplications kernels and the point-wise functions to implement PDE-specific terms. With this last kernel, evaluated in a benchmark simulation at high polynomial order, only 2\% of the floating point operations are still performed using scalar instructions and 22.5\% of the available performance is achieved.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。