[论文解读] Global finite element matrix construction based on a CPU-GPU implementation
本文提出一种CPU-GPU异构计算方法,以加速三维非结构化网格的全局有限元矩阵构建。通过将并行数值积分任务卸载至GPU,并由CPU负责串行矩阵组装,该方法在仅使用2GB GPU内存的情况下,实现了相较于纯CPU计算高达126倍的加速,并可构建包含最多2700万个矩阵元素的大型矩阵。
The finite element method (FEM) has several computational steps to numerically solve a particular problem, to which many efforts have been directed to accelerate the solution stage of the linear system of equations. However, the finite element matrix construction, which is also time-consuming for unstructured meshes, has been less investigated. The generation of the global finite element matrix is performed in two steps, computing the local matrices by numerical integration and assembling them into a global system, which has traditionally been done in serial computing. This work presents a fast technique to construct the global finite element matrix that arises by solving the Poisson's equation in a three-dimensional domain. The proposed methodology consists in computing the numerical integration, due to its intrinsic parallel opportunities, in the graphics processing unit (GPU) and computing the matrix assembly, due to its intrinsic serial operations, in the central processing unit (CPU). In the numerical integration, only the lower triangular part of each local stiffness matrix is computed thanks to its symmetry, which saves GPU memory and computing time. As a result of symmetry, the global sparse matrix also contains non-zero elements only in its lower triangular part, which reduces the assembly operations and memory usage. This methodology allows generating the global sparse matrix from any unstructured finite element mesh size on GPUs with little memory capacity, only limited by the CPU memory.
研究动机与目标
- 解决全局有限元矩阵构建中的性能瓶颈问题,尽管在求解所得线性系统方面已有诸多进展,但该瓶颈问题仍缺乏充分研究。
- 通过有效结合CPU与GPU工作负载,克服GPU内存限制,以处理大规模三维非结构化网格。
- 开发一种可扩展且内存高效的异构计算方法,在GPU资源有限的条件下构建大型稀疏全局矩阵。
- 通过利用CPU内存实现可扩展性,使配备低内存GPU的标准个人计算机也能实现高性能FEM矩阵生成。
提出的方法
- 将有限元矩阵构建分解为两个阶段:通过数值积分进行局部矩阵计算,以及全局矩阵组装。
- 在GPU上实现数值积分——高度并行——仅计算每个单元刚度矩阵的下三角部分,以节省内存和时间。
- 由CPU负责矩阵组装,因其本质为串行且内存密集型操作,从而避免GPU内存瓶颈。
- 利用矩阵对称性:由于局部和全局刚度矩阵均为对称矩阵,仅存储和组装其下三角部分,从而减少内存占用和计算量。
- 使用异步内核启动技术,使GPU计算(数值积分)与CPU计算(组装)重叠,提升整体吞吐量。
- 根据可用GPU内存将大网格划分为若干组,通过依赖CPU内存支持,实现超出GPU内存容量的矩阵构建。
实验结果
研究问题
- RQ1CPU-GPU异构架构能否显著加速大规模三维非结构化网格的全局有限元矩阵构建?
- RQ2在基于GPU的有限元矩阵生成中,如何利用矩阵对称性以减少内存使用和计算成本?
- RQ3当GPU内存受限时,该方法在多大程度上可实现可扩展性?CPU内存在此扩展过程中扮演何种角色?
- RQ4将数值积分卸载至GPU,同时保持串行组装在CPU上,可实现多大的性能提升?
- RQ5该方法是否可推广至泊松方程以外的其他PDE以及有限元法中的其他矩阵类型(如质量矩阵)?
主要发现
- 所提方法在数值积分阶段相较串行CPU实现最大126倍、平均121倍的加速,表明GPU利用率极高。
- 数值积分例程占总矩阵生成时间的62–82%,而组装例程仅占17–38%,表明数值积分是主要性能瓶颈。
- 稀疏矩阵组装函数(sparse_create)效率极高,即使在2700万个元素的情况下也耗时不足20秒,仅为数值积分阶段的五分之一。
- 该方法成功使用仅2GB GPU内存构建了包含2727万个节点和2700万个3D单元的全局稀疏矩阵,其规模仅受CPU内存容量限制。
- GPU内核的异步执行实现了数值积分与矩阵组装的重叠,提升了资源利用率并减少了空闲时间。
- 该方法具有通用性:可应用于静态问题的刚度矩阵构建、动态问题的质量矩阵构建,以及其他使用FEM的PDE。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。