计算机科学 ›› 2026, Vol. 53 ›› Issue (6): 117-127.doi: 10.11896/jsjkx.251000118

• 高性能计算 • 上一篇    下一篇

带状矩阵LU分解在GPU上的实现和优化

孙小雪1,2, 贾海鹏2, 张云泉2, 喻越1,2, 秦品乐1   

  1. 1 中北大学计算机科学与技术学院 太原 030051
    2 中国科学院计算技术研究所 北京 100190
  • 收稿日期:2025-10-27 修回日期:2025-12-11 出版日期:2026-06-15 发布日期:2026-06-09
  • 通讯作者: 贾海鹏(jiahaipeng@ict.ac.cn)
  • 作者简介:(xiaoxue_799@163.com)
  • 基金资助:
    国家重点研发计划(2023YFB3001701);国家自然科学基金(61972376,62372432,62072431)

GPU-based Implementation and Optimization of Banded Matrix LU Factorization

SUN Xiaoxue1,2, JIA Haipeng2, ZHANG Yunquan2, YU Yue1,2, QIN Pinle1   

  1. 1 School of Computer Science and Technology,North University of China,Taiyuan 030051,China
    2 Institute of Computing Technology,Chinese Academy of Sciences,Beijing 100190,China
  • Received:2025-10-27 Revised:2025-12-11 Published:2026-06-15 Online:2026-06-09
  • About author:SUN Xiaoxue,born in 2000,postgra-duate,is a member of CCF(No.Q9485G).Her main research interests include parallel computing and high performance computing.
    JIA Haipeng,born in 1983,Ph.D,senior engineer,is a member of CCF(No.31889M).His main research interests include parallel computing and heterogeneous computing.
  • Supported by:
    National Key Research and Development Program of China(2023YFB3001701) and National Natural Science Foundation of China(61972376,62372432,62072431).

摘要: 带状矩阵是一类广泛应用于科学计算与工程模拟中的稀疏矩阵,其LU分解作为一种经典的直接求解方法,在求解大规模线性方程组、仿真计算以及工程优化等问题中具有重要意义。针对传统算法在并行度和内存访问效率等方面的局限性,提出一种带状矩阵LU分解在国产DCU上的高效实现和优化方法,主要包括:一种结合Right-looking结构与块划分策略的优化方法,能够显著提升计算局部性和执行效率;一种高性能Panel分解算法,能够显著减少kernel启动次数和全局内存访问开销。在不同矩阵规模和带宽设置下的实验评估结果表明,所提出的GPU实现在保持数值稳定性的前提下,在运行时间和资源利用率方面均优于传统的LAPACK和MKL实现。研究表明,该方法具有良好的可扩展性与工程实用价值,为带状矩阵在异构并行计算平台上的高效实现提供了理论依据和实践参考。

关键词: 带状矩阵, LU分解, 并行计算, 融合内核, 性能优化

Abstract: Band matrices are a class of sparse matrices characterized by non-zero elements concentrated around the main diagonal,and they are widely used in scientific computing and engineering simulations.LU factorization of such matrices plays a vital role in solving large-scale linear systems,particularly in simulation workloads,physical modeling,and engineering optimization problems.However,traditional LU factorization algorithms often suffer from limited parallelism and inefficient memory access patterns,which restrict their performance on modern hardware platforms.To address these challenges,this paper proposes a high-efficiency implementation and optimization strategy for band matrix LU decomposition on domestic domain-specific computing units(DCUs).The proposed method introduces two key techniques:one is a right-looking structure combined with a block partitioning strategy to improve computational locality and parallel execution efficiency;and the other is a high-performance panel factorization algorithm that reduces kernel launch frequency and global memory access overhead.Experimental results across different matrix sizes and bandwidths demonstrate that the proposed GPU-based implementation consistently outperforms CPU-based LAPACK and Intel MKL solutions in terms of runtime and resource utilization,while preserving numerical stability.Empirical results show that this approach exhibits strong scalability and practical engineering value,providing theoretical foundations and practical gui-dance for the efficient implementation of banded-matrix methods on heterogeneous parallel computing platforms.

Key words: Banded matrices, LU factorization, Parallel computing, Fusion kernel, Performance optimization

中图分类号: 

  • TP301.6
[1]OWENS J D,LUEBKE D,GOVINDARAJU N,et al.A Survey of General-Purpose Computation on Graphics Hardware[J].Computer Graphics Forum,2007,26(1):80-113.
[2]MANAVSKI S A.CUDA Compatible GPU as an EfficientHardware Accelerator for AES Cryptography[C]//InternationalConference on Signal Processing and Communications.IEEE,2007:65-68.
[3]BLANCHARD P,HIGHAM N J.Mixed precision block fused multiply-add:error analysis and application to GPU tensor cores[J].SIAM Journal on Scientific Computing,2020,42(3):C124-C141.
[4]HUSBANDS P,YELICK K.Multi-Threading and One-SidedCommunication in Parallel LU Factorization[C]//Proceedings of the 2007 ACM/IEEE Conference on Supercomputing.ACM,2007:1-10.
[5]TOMOV S,NATH R,LTAIEF H,et al.Dense Linear Algebra Solvers for Multicore with GPU Accelerators[C]//Proceedings of the 2010 IEEE International Symposium on Parallel & Dis-tributed Processing,Workshops and PhD Forum(I-PDPSW).IEEE,2010:1-8.
[6]AGULLO E,AUGONNET C,DONGARRA J,et al.A Hybridi-zation Methodology for High-Performance Linear Algebra Software for GPUs[M]// GPU Computing Gems Jade Edition.Waltham:Morgan Kaufmann,2012:473-484.
[7]DONGARRA J,HAIDAR A,KURZAK J,et al.Model-DrivenOne-Sided Factorizations on Multicore Accelerated Systems[J].Supercomputing Frontiers and Innovations,2014,1(1):85-115.
[8]BADER M,BODE A,GERNDT M,et al.Locality Optimization on a NUMA Architecture for Hybrid LU Factorization[C]//Advances in Parallel Computing,25.IOS Press,2014:153-162.
[9]HAIDAR A,DONG T X,LUSZCZEK P,et al.Batched MatrixComputations on Hardware Accelerators Based on GPUs[J].The International Journal of High Performance Computing Applications,2015,29(2):193-208.
[10]DONG T X,HAIDAR A,LUSZCZEK P,et al.LU Factorization of Small Matrices:Accelerating Batched DGETRF on the GPU[C]//HPCC& CSS& ICESS.IEEE,2015:157-160.
[11]KWASNIEWSKI G,KABIC M,BEN-NUN T,et al.On the Pa-rallel I/O Optimality of Linear Algebra Kernels:Near-Optimal Matrix Factorizations[C]//Proceedings of the International Conference for High Performance Computing,Networking,Stora-ge and Analysis(SC'21).IEEE Computer Society,2021:1-14.
[12]AZZAM H,AHMAD A,MAWUSSI Z,et al.A Guide for Achieving High Performance with Very Small Matrices on GPU:A Case Study of Batched LU and Cholesky Factorizations[J].IEEE Transactions on Parallel and Distributed Systems,2018,29(5):973-984.
[13]CHOW E,PATEL A.Fine-Grained Parallel Incomplete LU Factorization[J].SIAM Journal on Scientific Computing,2015,37(2):C169-C193.
[14]SERRE F,PUSCHEL M.Generalizing Block LU Factorization:A Lower-Upper Block Triangular Decomposition with Minimal Off-Diagonal Ranks[J].Linear Algebra and its Applications,2016,509:114-142.
[15]LAWSON C,HANSON R J.Basic Linear Algebra Subprograms for Fortran Usage[J].ACM Transactions on Mathematical Software,1979,5(3):308-323.
[16]DONGARRA J J,DU CROZ J.An Extended Set of FortranBasic Linear Algebra Subprogram-s[J].ACM Transactions on Mathematical Software,1988,14(1):1-17.
[17]ASHCRAFT C,GRIMES R G,LEWIS J G.Accurate Symmetric Indefinite Linear Equation Solvers[J].SIAM Journal on Matrix Analysis and Applications,1998,20(2):513-561.
[18]GRIMES R G,LEWIS J G,SIMON H D.A Shifted Block Lanczos Algorithm for Solving Sparse Symmetric Generalized Eigenproblems[J].SIAM Journal on Matrix Analysis and Applications,1994,15(1):228-272.
[19]DU CROZ J,MAYES P,RADICATI G.Factorizations of Band Matrices Using Level 3 BLAS[C]//CONPAR 90/VAPP IV:Proceedings of the Joint International Conference on Vector and Parallel Processing.Berlin:Springer-Verlag,1990:223-231.
[20]KWASNIEWSKI G,KABIC M,BEN G N,et al.On the Parallel I/O Optimality of Linear Algebra Kernels[C]//Proceedings of the International Conference for High Performance Computing,Networking,Storage and Analysis(SC'21).IEEE,2021:1-14.
[21]ABDELFATTAH A,TOMOV S,LUSZCZEK P,et al.GPU-based LU Factorization and Solve on Batches of Matrices with BandStructure [C]//Workshops of the International Conference for High Performance Computing,Networking,Storage and Analysis(SCW 2023).IEEE Computer Society,2023:1672-1679.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!