[论文解读] A GEMM-based direct solver for finite-difference Poisson problems in non-uniform grids
本文提出一种直接泊松求解器,用于三维非均匀网格,通过在两个方向上进行特征分解将算符对角化,并在第三个方向上直接求解,前向/后向变换在CPU/GPU上实现为GEMM以提升效率。
We present a direct Poisson solver for massively parallel simulations on three-dimensional Cartesian grids with non-uniform spacing. The method uses a tensor-based formulation in which the operator is diagonalized numerically along two directions through one-dimensional eigendecompositions, while the third direction is solved directly. The resulting dense transforms are evaluated efficiently as GEMMs (General Matrix--Matrix Multiplications), allowing many independent one-dimensional operations to be combined into matrix-matrix products that map well to modern CPU and GPU hardware. For uniform grids, the method reduces to the classical eigenfunction-expansion approach, and it naturally supports hybrid combinations of FFT-based and GEMM-based transforms depending on grid uniformity. After coupling the solver to an incompressible Navier-Stokes code, we assess its accuracy and performance against geometric multigrid and block cyclic reduction with FFT diagonalization. The results show that the proposed method is robust and consistently achieves the best time-to-solution. In strong scaling, the more compute-intensive GEMM-based variants attain higher parallel efficiency by better amortizing communication costs, while weak scaling highlights the expected trade-off between FFT-based and dense-transform formulations. Overall, the method enables efficient high-resolution stretched-mesh simulations on modern heterogeneous systems.
研究动机与目标
- 需要快速泊松求解器以在不可压性NSN(不可压缩流动的直接数值模拟)中强制不可压性。
- 在保持GPU友好核的前提下,将基于特征函数的直接求解器扩展到非均匀网格。
- Develop a GEMM-based implementation that integrates with existing CaNS infrastructure and supports hybrid synthesis (FFT for uniform directions, GEMM for non-uniform directions).
- Evaluate performance against state-of-the-art methods (geometric multigrid and block cyclic reduction with FFT).
- Demonstrate scalability (strong and weak) on CPUs and GPUs for high-resolution stretched meshes.
提出的方法
- 将非均匀网格上的一维泊松算子形式化为三对角系统,并通过对角缩放矩阵D对其对称化,得到对称代理T̃,满足T̃ = D^{1/2} T D^{-1/2}。
- 将对称代理T̃进行特征分解:T̃ = Q̃ Λ Q̃^T,并从Q = D^{-1/2} Q̃恢复,Q^{-1} = Q̃^T D^{1/2}。
- 通过Kronecker和的和扩展到三维:T = T_x ⊗ I ⊗ I + I ⊗ T_y ⊗ I + I ⊗ I ⊗ T_z;沿x和y对角化(T_x、T_y),沿z解一组独立的一维三对角问题。
- 在x和y方向进行前向本征基变换和后向逆变换,使用GEMM(对于非均匀方向)或FFT(对于均匀方向);在z方向采用直接三对角求解(TDMA)。
- 该方法保留与FFT基对角化相同的区域分解和通信模式,实现混合综合(均匀网格使用FFT,非均匀网格使用GEMM)。
- 泊松求解器与使用分数步RK3方案的Navier–Stokes求解器集成,隐式扩散可通过相同的泊松/亥姆霍兹框架求解。
实验结果
研究问题
- RQ1GEMM-based diagonalization along two directions provide competitive or superior time-to-solution for 3D Poisson problems on non-uniform grids compared to FFT-based and multigrid approaches?
- RQ2How does the hybrid FFT/GEMM approach perform on CPUs and GPUs in terms of strong and weak scaling for stretched meshes?
- RQ3What is the trade-off between flexibility (non-uniform grids) and asymptotic cost when using GEMM-based transforms as the problem size grows?
- RQ4How does the solver integrate with an incompressible Navier–Stokes workflow and what is the overhead of non-uniform-grid capability on modern hardware?
主要发现
- GEMM-based approach 在单核CPU上对比结果中提供了最佳的时间-解答量,尤其是在强梯度网格上。
- CPU与GPU的强/弱标度显示,计算密集型的GEMM变体比以FFT为主的变体更好地摊销转置和通信开销。
- 弱标尺度显示权衡:在增长的方向使用FFT可带来较温和的时间增长,而GEMM变换随着分辨率的提高成本较高。
- 在GPU上,完整的非均匀网格能力仅带来中等开销,且在多GPU条件下仍保持强标度。
- 总体而言,与均匀网格运行相比,该方法在高斯道流动的扩展网格中实现了显著的墙时 saving,并在异构硬件上表现稳健。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。