An Efficient Storage and Decomposition Device and Method for Sparse Matrices Aimed at Super Nodes

By generating an elimination tree and merging supernodes, optimizing the sparse matrix storage format, and directly calling the dense BLAS/LAPACK function, the memory efficiency and computing performance problems in sparse matrix decomposition are solved, and efficient decomposition of symmetric sparse matrix is achieved.

CN120011700BActive Publication Date: 2025-07-25PONGFENG BEIJING TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510487851.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-25
Estimated Expiration
2045-04-18

AI Technical Summary

Technical Problem

In the prior art, the storage format and decomposition algorithm of sparse matrix are insufficient in memory efficiency and computing performance, especially the lack of support for hypernode structures, and the inability to effectively call the dense BLAS library, and dynamic storage adjustments lead to memory waste and unclear data transmission paths.

Method used

By generating an elimination tree and merging continuous nodes with the same L structure to form supernodes, only effective dense blocks and adjacency lists are stored, L matrix space is preallocated, dense BLAS/LAPACK functions are directly called, storage format is optimized, and data dependencies are clarified.

Benefits of technology

It realizes the efficiency of sparse matrix decomposition, low memory usage and algorithm universality, significantly improves computing performance, avoids memory waste and redundant indexes in traditional formats, and supports efficient decomposition of symmetric sparse matrix.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011700B_ABST
    Figure CN120011700B_ABST
Patent Text Reader

Abstract

The present invention discloses an efficient storage and decomposition device and method for sparse matrices targeting supernodes, which relates to the technical field of data storage and processing. The device includes: a matrix preprocessing module for receiving an original matrix and performing matrix rearrangement on it to generate an elimination tree; a supernode construction module for determining the L matrix based on the elimination tree; a storage format definition module for defining the storage format of the symmetric sparse matrix of supernodes; a data loading module for loading the non-zero elements in the original matrix into the L matrix of the corresponding supernode; and a matrix decomposition module for traversing the L matrix in dense format and performing matrix decomposition on it. By forming supernodes, only the effective dense blocks and adjacency lists are stored. Through pre-allocating the space of the L matrix, direct calling of dense functions is supported, and discrete sparse operations are transformed into efficient dense matrix operations, ultimately achieving the efficient decomposition of symmetric sparse matrices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage and processing, and particularly to an efficient storage and decomposition device and method for sparse matrices for supernodes. Background Art

[0002] Currently, in the field of direct solution of sparse matrices, there are significant technical limitations in the storage formats and decomposition algorithms for symmetric sparse matrices in the prior art. Although formats such as COO, CSR, CSC, ELL, and BSR are widely used in specific scenarios, there are generally problems of low memory efficiency, insufficient computing performance, and lack of support for supernode structures. For example, the COO format redundantly stores row / column indices, resulting in high memory occupancy; although CSR and CSC support sparse BLAS libraries, their computing efficiency is significantly lower than that of dense BLAS libraries, and key operations cannot be directly implemented by calling efficient functions; the ELL and BSR formats cause memory waste due to fixed block sizes or padding values, and it is particularly difficult to adapt to irregular sparse structures; while hybrid formats (such as HYB) attempt to combine the advantages of different formats, but the implementation is complex and the computing overhead increases. In addition, the prior art has not been optimized for the dense block structure of supernodes, and it is impossible to efficiently manage data dependencies by preallocating storage space or explicitly recording adjacency lists, resulting in frequent switching between sparse and dense algorithms during the decomposition process, increasing the computing overhead. Existing patents such as CN119337040A and CN119311221A have proposed improved sparse matrix storage schemes, but their cores still focus on general sparse patterns, and have not been designed for the structured storage and decomposition algorithms of supernodes, cannot directly call dense BLAS libraries to improve computing efficiency, and have not solved problems such as memory waste caused by dynamic storage adjustment or unclear data transfer paths. Summary of the Invention

[0003] In view of this, the present invention proposes an efficient storage and decomposition device and method for sparse matrices for supernodes, achieving the efficiency and compactness of decomposing symmetric sparse matrices for supernodes. The present invention provides the following technical solutions:

[0004] An efficient storage and decomposition device for sparse matrices for supernodes, the device comprising:

[0005] A matrix preprocessing module, configured to receive an original matrix and perform matrix rearrangement on it to generate an elimination tree;

[0006] A supernode construction module, configured to construct supernodes based on the elimination tree and determine the L matrix of each supernode;

[0007] A storage format definition module, configured to define a symmetric sparse matrix storage format for supernodes;

[0008] A data loading module, which is used to load the non-zero elements in the original matrix into the L matrix of the corresponding supernode, so as to store the L matrix in a dense format;

[0009] A matrix factorization module, which is used to traverse the L matrix in dense format and perform matrix factorization on it.

[0010] Optionally, the matrix preprocessing module specifically includes:

[0011] A rearrangement unit, which is used to rearrange the original matrix by using the approximate minimum degree method or the nested dissection method, so as to make the dense part of the original matrix close to the diagonal;

[0012] A node determination unit, which is used to determine the first eliminated child node of each node as its parent node during the decomposition process;

[0013] An elimination tree generation unit, which is used to traverse the parent-child relationship of all nodes and generate an elimination tree starting from the root node, where the child nodes of each node form its subtree.

[0014] Optionally, the supernode construction module specifically includes:

[0015] A structure analysis unit, which is used to analyze the row and column distributions of non-zero elements in its subtree based on the parent-child relationship of the elimination tree, so as to determine the non-zero element structure of the node in the L matrix;

[0016] A supernode merging unit, which is used to merge these nodes into one supernode if the L structures of adjacent nodes are exactly the same;

[0017] A parameter definition unit, which is used to define the starting node number parameter and the length parameter of the supernode;

[0018] An adjacency list generation unit, which is used to generate an adjacency list according to the indexes of all non-zero rows below the supernode in the elimination tree and record the length of the adjacency list;

[0019] A storage allocation unit, which is used to allocate storage space for each supernode according to the length parameter of the supernode and the length of the adjacency list to form the L matrix.

[0020] Optionally, the data loading module specifically includes:

[0021] A supernode attribution determination unit, which is used to traverse each column of the original matrix to determine the supernode to which the non-zero element belongs;

[0022] A non-zero element positioning unit, which is used to determine the element positioning of the non-zero element in the corresponding supernode to obtain the local coordinates of the non-zero element;

[0023] A data writing unit for writing the non - zero element value into the corresponding position of the L matrix of the super - node according to the local coordinates.

[0024] Optionally, the matrix decomposition module specifically includes:

[0025] A traversal control unit for processing each super - node from the root node, from top - left to bottom - right according to the parent - child relationship of the elimination tree;

[0026] A decomposition function call unit for calling the decomposition function POTRF or SYTRF to decompose the diagonal block of the current super - node into a lower triangular matrix L1;

[0027] A matrix update unit for calling the triangular matrix solving function DTRSM to update the off - diagonal block based on the lower triangular matrix L1 to obtain the L2 matrix;

[0028] A contribution matrix calculation unit for calculating the contribution matrix by calling the matrix multiplication function SYRK based on the L2 matrix;

[0029] A data transfer unit for determining the transfer path and transfer target of the contribution matrix, and copying each column of the contribution matrix to the specified row of the L matrix of the transfer target super - node according to the index of the adjacency list.

[0030] The present invention further discloses a method for efficient storage and decomposition of a sparse matrix for super - nodes, which is applied to the above - mentioned device for efficient storage and decomposition of a sparse matrix for super - nodes. The method includes:

[0031] The matrix pre - processing module receives the original matrix and performs matrix re - ordering on it to generate an elimination tree;

[0032] The super - node construction module constructs super - nodes based on the elimination tree and obtains the L matrix of each super - node;

[0033] The storage format definition module defines the storage format of the symmetric sparse matrix of the super - node;

[0034] The data loading module loads the non - zero elements in the original matrix into the L matrix of the corresponding super - node to store the L matrix in a dense format;

[0035] The matrix decomposition module performs traversal on the L matrix in dense format and performs matrix decomposition on it.

[0036] Optionally, the method further includes: a super - node attribution determination unit traverses each column of the original matrix to determine the super - node to which the non - zero element belongs; a non - zero element localization unit determines the element localization of the non - zero element in the corresponding super - node to obtain the local coordinates of the non - zero element; a data writing unit writes the non - zero element value into the corresponding position of the L matrix of the super - node according to the local coordinates.

[0037] The present invention further discloses a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the functions of the above-mentioned device are implemented.

[0038] The present invention further discloses an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the functions of the above-mentioned device are implemented.

[0039] The present invention further discloses a computer program product, including a computer program, and when the computer program is executed by a processor, the functions of the above-mentioned device are implemented.

[0040] According to the technical solution of the present invention, an elimination tree is generated through structural analysis, and consecutive nodes with the same L structure are merged to form supernodes. Only valid dense blocks and adjacency lists are stored. By preallocating the space of the L matrix and explicitly recording the adjacency list, direct calls to dense BLAS / LAPACK functions such as POTRF / SYTRF, TRSM, and SYRK are supported, converting the original discrete sparse operations into efficient dense matrix operations, solving the problem that the CSR / CSC format depends on an inefficient sparse BLAS library, and significantly improving the computing performance compared with traditional methods. Further, the consecutive storage of supernodes and the contribution matrix transfer path driven by the adjacency list ensure clear data dependency relationships and no need for dynamic adjustment of storage, ultimately achieving the high efficiency, low memory occupancy, and algorithm generality of symmetric sparse matrix decomposition. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] For purposes of illustration and not limitation, the present invention will now be described in conjunction with the embodiments and drawings of the present invention, wherein:

[0042] Figure 1 is a schematic structural diagram of an apparatus for efficient storage and decomposition of a sparse matrix for supernodes in an embodiment of the present invention;

[0043] Figure 2 is a schematic flowchart of a method for efficient storage and decomposition of a sparse matrix for supernodes in an embodiment of the present invention;

[0044] Figure 3 is a schematic structural diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0045] To enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts shall fall within the scope of protection of this application.

[0046] It should be noted that, without conflict, the embodiments of this application and the features in the embodiments can be combined with each other. The embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0047] Refer to Figure 1 , this embodiment discloses an efficient storage and decomposition device for sparse matrices for supernodes. The device includes a matrix preprocessing module 21, a supernode construction module 22, a storage format definition module 23, a data loading module 24, and a matrix decomposition module 25, which will be described separately below.

[0048] The matrix preprocessing module 21 is used to receive the original matrix and perform matrix rearrangement on it to generate an elimination tree. The matrix preprocessing module 21 specifically includes a rearrangement unit, a node determination unit, and an elimination tree generation unit.

[0049] Specifically, the input original matrix is a symmetric sparse matrix and is input in the compressed sparse column (CSC) format. The matrix is preprocessed to record the starting position of the non-zero elements in each column and store the global positions of all non-zero elements, including the row numbers. The original matrix is rearranged by the rearrangement unit in the matrix preprocessing module to reduce fill-in, so that the dense part of the matrix is close to the diagonal. Specifically, the approximate minimum degree method or the nested dissection method is used to rearrange the original matrix. Among them, the approximate minimum degree method (AMD): is applicable to matrices without obvious local structure but with small-scale dense blocks. The nested dissection method: is applicable to matrices with strong locality (such as grid structures). Based on the rearranged matrix, the node determination unit is called to determine the first eliminated child node of each node as its parent node during the decomposition process; then, the elimination tree generation unit traverses the parent-child relationships of all nodes to generate an elimination tree starting from the root node, where the child nodes of each node form its subtree. By rearranging the matrix, fill-in can be effectively reduced, memory waste of ELL / BSR can be avoided, and the elimination tree-driven decomposition order can ensure clear data dependencies to support the subsequent construction of supernodes.

[0050] The supernode construction module 22 is used to construct supernodes based on the elimination tree and determine the L matrix of each supernode. The supernode construction module includes a structure analysis unit, a supernode merging unit, a parameter definition unit, and an adjacency list generation unit.

[0051] The structure analysis unit is used to traverse all non-zero elements of the subtree for each node in the rearranged matrix based on the parent-child relationship of the elimination tree, and record the global row and column distributions thereof. The row range is the minimum row number and the maximum row number of the non-zero elements in the subtree, and the column range is the column number of the node to the column number of the last consecutive node in its subtree. And the total number of non-zero elements in the subtree is statistically calculated based on the recorded global row and column distributions. The supernode merging unit is used to compare the L structures of adjacent nodes. If the minimum row number and the maximum row number of the subtree are the same, and the total number of non-zero elements in the subtree is the same, then the adjacent nodes are merged into one supernode. The parameter definition unit is used to define the starting node number parameter and the length parameter of the supernode. Among them, the starting node number parameter start is the global column number of the first node of the supernode, and the length parameter len is the number of consecutive nodes included in the supernode. The adjacency list generation unit generates an adjacency list according to the indexes of all non-zero rows below the supernode in the elimination tree and records the length of the adjacency list; and the storage allocation unit allocates storage space for each supernode according to the length parameter of the supernode and the length of the adjacency list to form an L matrix.

[0052] Furthermore, for the original matrix, when performing effective data storage, if it is a symmetric positive definite matrix, only the lower triangular part of the L matrix is stored, and the diagonal elements are defaulted to 1. If it is a symmetric non-positive definite matrix, the lower triangular and diagonal parts of the L matrix are stored, and the diagonal elements store the values of the diagonal matrix D.

[0053] The storage format definition module 23 is used to define the storage format of the symmetric sparse matrix of the supernode.

[0054] Specifically, the storage format definition module 23 includes a structure description definition unit, which is used to define the data structure description of the supernode through the C language, including:

[0055] int start; / / The starting node number of the supernode; Exemplarily, if the supernode covers columns 3 - 5, then start = 3.

[0056] int len; / / The length of the supernode; that is, the number of nodes included in the supernode.

[0057] int adjlen; / / The length of the adjacency list of the supernode; that is, the total number of adjacent non-zero rows below the supernode. Exemplarily, when the adjacency list includes rows [5, 7, 9], adjlen = 3.

[0058] int adjlist; / / The adjacency list of the supernode; that is, an integer array of the adjacency list, storing the global indices of the non-zero rows below.

[0059] float / double L; / / The starting address of the L array of the supernode.

[0060] Based on the data structure description of the supernode defined above, this embodiment further defines the storage strategy for the diagonal blocks and off-diagonal blocks of the L matrix. Among them, the matrix position of the diagonal block is the first len×len sub-matrix. For a symmetric positive definite matrix, only the lower triangular part is stored, and the diagonal elements are defaulted to 1 (no explicit storage is required). For the non-diagonal block, its position is the subsequent adjlen×len sub-matrix, and its storage rule is to store the original values of the non-zero adjacent rows below the supernode. To ensure that the storage format of the L matrix is compatible with the BLAS / LAPACK functions, the L matrix is stored in row-major order in this embodiment.

[0061] The data loading module 24 specifically includes a supernode attribution determination unit, a non-zero element localization unit, and a data writing unit.

[0062] The supernode attribution determination unit is used to load the non-zero elements in the original matrix into the L matrix of the corresponding supernode to store the L matrix in a dense format. The supernode attribution determination unit is used to traverse each column of the original matrix and all supernodes simultaneously to determine whether the non-zero elements in the current column belong to a certain supernode. If so, the non-zero elements are corresponded to the supernode. The non-zero element localization unit determines the element localization of the non-zero elements in the corresponding supernode to obtain the local coordinates of the non-zero elements. If the global row number of the non-zero element is within the column range of the supernode, the non-zero element is stored in the diagonal block area, that is, the above-mentioned len×len area. If the global row number of the non-zero element is in the adjacency list of the supernode, the element is stored in the non-diagonal block area, that is, the subsequent adjlen×len part of the L matrix. For the non-zero elements whose storage position is within the diagonal block, the local row number is obtained by subtracting the starting node number of the supernode from the global row number of the element. Similarly, the local column number is obtained by subtracting the starting node number of the supernode from the global column number of the element. In this way, the element localization of the non-zero elements in the corresponding supernode is completed to obtain the local coordinates of the non-zero elements. Further, the data writing unit writes the non-zero element value to the corresponding position of the L matrix of the supernode according to the local coordinates to store the L matrix in a dense format.

[0063] The matrix factorization module 25 specifically includes a traversal control unit, a decomposition function call unit, a matrix update unit, a contribution matrix calculation unit, and a data transfer unit.

[0064] The matrix factorization module 25 is used to perform traversal on the dense-format L matrix and perform matrix factorization on it. Specifically, through the traversal control unit, according to the parent-child relationship of the elimination tree, starting from the root node, each supernode is processed from the upper left to the lower right. It should be understood that here it starts from the root node in the upper left corner of the matrix and gradually processes each supernode to the lower right, ensuring that the parent node of each supernode has been decomposed during the decomposition process.

[0065] For a symmetric positive definite matrix, the decomposition function POTRF is called by the decomposition function call unit to decompose the diagonal block of the current supernode into L1×L1 T , for a symmetric non-positive definite matrix, SYTRF is called to decompose the diagonal block of the current supernode into L1×D×L1 T . Based on the matrix after the above decomposition, the triangular matrix solution function DTRSM is called by the matrix update unit to update the off-diagonal block to obtain the L2 matrix, and its update formula is: . Further, through the contribution matrix calculation unit, based on the L2 matrix, the matrix multiplication function SYRK is called to calculate the contribution matrix, and the calculation formula of the contribution matrix is: . Further, through the data transfer unit, the transfer path and transfer target of the contribution matrix are determined, and each column of the contribution matrix is copied to the specified row of the L matrix of the transfer target supernode according to the index of the adjacency list. Specifically, according to the adjacency list adjlist, each column of CB is associated with the global row number in the adjacency list, and each adjacent row adjlist[i] belongs to the diagonal block or off-diagonal block of the L matrix of a certain parent node or ancestor supernode. Through the parent-child relationship of the elimination tree or the global row number of the adjacency list, the target supernode is located, and further the column of CB is copied to the corresponding row of the target supernode.

[0066] In summary, this embodiment proposes an efficient storage and decomposition device for sparse matrices of supernodes. Through the collaborative design of structural analysis, supernode partitioning, compact storage, and efficient computation, it solves the technical bottlenecks of traditional sparse matrix storage formats in terms of memory efficiency, computation acceleration, and supernode support. First, the matrix preprocessing module 21 performs matrix reordering on the original matrix to generate an elimination tree to optimize fill-in and clarify node dependencies. Subsequently, the supernode construction module 22 analyzes the non-zero element distribution of each node's subtree based on the elimination tree, merges consecutive nodes with the same L structure into supernodes, and records the start position, length, adjacency list, and storage space parameters of the supernodes. Then, the storage format definition module 23 defines the C language data structure of the supernodes and stores the L matrix in a dense format, where the diagonal of the symmetric positive definite matrix is defaulted to 1, and the values of the diagonal matrix D are explicitly stored for non-positive definite matrices. Then, the data loading module 24 loads the non-zero elements of the original matrix into the L matrix of the corresponding supernode through the conversion from global to local coordinates, only stores the valid dense blocks, and uses the adjacency list to locate data dependencies. Finally, the matrix decomposition module 25 performs a top-down traversal driven by the elimination tree, calls POTRF / SYTRF to decompose the diagonal block of each supernode into L1, updates the non-diagonal block to L2 through TRSM, generates the contribution matrix CB through SYRK, and accurately transfers the column blocks of CB to the specified rows of the target supernode according to the adjacency list to complete the iterative process of decomposition. Among them, the SDB format only stores the diagonal blocks and the dense regions of the non-diagonal blocks of the supernodes, avoids the fill-in waste of traditional formats, and explicitly records the data dependency paths through the adjacency list without redundant indexes. Through the pre-allocated dense L matrix space, directly call efficient BLAS / LAPACK functions such as POTRF, TRSM, SYRK, etc., convert the original discrete sparse operations into vectorized dense computations, improve the decomposition speed, and further reduce the memory access overhead through the optimization of cache locality by continuous storage of supernodes. Support the differential storage of symmetric positive definite and non-positive definite matrices, and ensure the path correctness of data transfer through the decomposition order driven by the elimination tree, avoid dynamic memory adjustment, and achieve stable solution of large-scale matrices. This solution deeply combines the structured storage of supernodes with dense BLAS, changes the dilemma of the separation of storage and computation in traditional sparse matrix decomposition, and realizes the unity of storage compactness and computation efficiency.

[0067] Reference Figure 2 , this embodiment further discloses a method for efficient storage and decomposition of sparse matrices of supernodes, which is applied to the above-mentioned efficient storage and decomposition device of sparse matrices of supernodes. The method includes:

[0068] S100: Receive the original matrix and perform matrix rearrangement on it to generate an elimination tree, including: performing rearrangement on the original matrix using the approximate minimum degree method or the nested dissection method to bring the dense part of the original matrix closer to the diagonal; determining the first eliminated child node of each node during the decomposition process as its parent node; traversing the parent-child relationships of all nodes to generate an elimination tree starting from the root node, where the child nodes of each node form its subtree;

[0069] S200: Construct supernodes based on the elimination tree and obtain the L matrix of each supernode, including: analyzing the row and column distributions of non-zero elements in its subtree based on the parent-child relationship of the elimination tree to determine the non-zero element structure of the node in the L matrix; if the L structures of adjacent nodes are exactly the same, merging these nodes into one supernode; defining the starting node number parameter and length parameter of the supernode; generating an adjacency list based on the indices of all non-zero rows below the supernode in the elimination tree and recording the length of the adjacency list; allocating storage space for each supernode according to the length parameter of the supernode and the length of the adjacency list to form the L matrix;

[0070] S300: Define the storage format of the symmetric sparse matrix of the supernode, including: defining the data structure description of the supernode through C language, including: int start; / / Starting node number of the supernode; int len; / / Length of the supernode; int adjlen; / / Length of the adjacency list of the supernode; int adjlist; / / Adjacency list of the supernode; float / double L; / / Starting address of the L array of the supernode;

[0071] S400: Load the non-zero elements in the original matrix into the L matrix of the corresponding supernode to store the L matrix in a dense format, including: traversing each column of the original matrix to determine the supernode to which the non-zero element belongs; determining the element location of the non-zero element in the corresponding supernode to obtain the local coordinates of the non-zero element; writing the non-zero element value to the corresponding position in the L matrix of the supernode according to the local coordinates;

[0072] S500: Perform traversal on the L matrix in dense format and perform matrix decomposition on it, including:

[0073] According to the parent-child relationship of the elimination tree, starting from the root node, process each supernode from the upper left to the lower right; call the decomposition function POTRF or SYTRF to decompose the diagonal block of the current supernode into a lower triangular matrix L1; based on the lower triangular matrix L1, call the triangular matrix solution function DTRSM to update the off-diagonal block to obtain the L2 matrix; based on the L2 matrix, call the matrix multiplication function SYRK to calculate the contribution matrix; determine the transfer path and transfer target of the contribution matrix, and copy each column of the contribution matrix to the specified row of the L matrix of the transfer target supernode according to the index of the adjacency list.

[0074] Figure 3 Schematic diagram of the physical structure of the electronic device provided by the embodiment of the present invention, as Figure 3 shown, the electronic device 50 includes: a processor 501 (processor), a memory 502 (memory), and a bus 503;

[0075] Among them, the processor 501 and the memory 502 communicate with each other through the bus 503; the processor 501 is used to call program instructions in the memory 502 to execute the methods provided by the above method embodiments.

[0076] This embodiment provides a non-transitory computer-readable storage medium, and the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the methods provided by the above method embodiments.

[0077] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above method embodiments; and the foregoing storage medium includes: various storage media such as ROM, RAM, magnetic disk, or optical disk that can store program codes.

[0078] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative labor.

[0079] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiments.

[0080] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. An efficient storage and decomposition device for sparse matrices targeting super nodes, characterized in that The device includes: A matrix preprocessing module, configured to receive an original matrix and perform matrix rearrangement on it to generate an elimination tree; A supernode construction module, configured to construct supernodes based on the elimination tree and determine the L matrix of each supernode; specifically, the supernode construction module includes: a structure analysis unit, configured to analyze the row and column distributions of non-zero elements in its subtree based on the parent-child relationship of the elimination tree to determine the non-zero element structure of the node in the L matrix; a supernode merging unit, configured to merge adjacent nodes into one supernode if their L structures are exactly the same; a parameter definition unit, configured to define the starting node number parameter and length parameter of the supernode; an adjacency list generation unit, configured to generate an adjacency list according to the indexes of all non-zero rows below the supernode in the elimination tree and record the length of the adjacency list; a storage allocation unit, configured to allocate storage space for each supernode according to the length parameter of the supernode and the length of the adjacency list to form the L matrix; A storage format definition module, configured to define the symmetric sparse matrix storage format of the supernode; A data loading module, configured to load the non-zero elements in the original matrix into the L matrix of the corresponding supernode to store the L matrix in a dense format; A matrix decomposition module, configured to traverse the L matrix in dense format and perform matrix decomposition on it; specifically, the matrix decomposition module includes: a traversal control unit, configured to process each supernode from the root node, from top left to bottom right according to the parent-child relationship of the elimination tree; a decomposition function call unit, configured to call the decomposition function POTRF or SYTRF to decompose the diagonal block of the current supernode into a lower triangular matrix L1; a matrix update unit, configured to call the triangular matrix solution function DTRSM to update the non-diagonal block based on the lower triangular matrix L1 to obtain the L2 matrix; a contribution matrix calculation unit, configured to call the matrix multiplication function SYRK to calculate the contribution matrix based on the L2 matrix; a data transfer unit, configured to determine the transfer path and transfer target of the contribution matrix and copy each column of the contribution matrix to the specified row of the L matrix of the target supernode according to the indexes of the adjacency list.

2. The efficient storage and decomposition device for sparse matrices for super nodes according to claim 1, characterized in that, Specifically, the matrix preprocessing module includes: A rearrangement unit, configured to rearrange the original matrix using the approximate minimum degree method or the nested dissection method to make the dense part of the original matrix close to the diagonal; A node determination unit, configured to determine the first eliminated child node of each node during the decomposition process as its parent node; An elimination tree generation unit, configured to traverse the parent-child relationships of all nodes to generate an elimination tree starting from the root node, where the child nodes of each node form its subtree.

3. The efficient sparse matrix storage and decomposition device for super nodes according to claim 1, characterized in that Specifically, the data loading module includes: A supernode attribution determination unit, configured to traverse each column of the original matrix to determine the supernode to which the non-zero element belongs; A non-zero element positioning unit, configured to determine the element position of the non-zero element in the corresponding supernode to obtain the local coordinates of the non-zero element; A data writing unit, configured to write the non-zero element to the corresponding position of the L matrix of the supernode according to the local coordinates.

4. A method for efficient storage and decomposition of sparse matrices for supernodes, applied to the device described in any one of claims 1-3, characterized in that, The method includes: The matrix preprocessing module receives the original matrix and performs matrix rearrangement on it to generate an elimination tree; The supernode construction module constructs supernodes based on the elimination tree and obtains the L matrix of each supernode; The storage format definition module defines the symmetric sparse matrix storage format of the supernodes; The data loading module loads the non-zero elements in the original matrix into the L matrix of the corresponding supernode to store the L matrix in a dense format; The matrix decomposition module traverses the L matrix in dense format and performs matrix decomposition on it.

5. The method for efficient storage and decomposition of sparse matrices for supernodes according to claim 4, characterized in that, It further includes: The supernode attribution unit determination unit traverses each column of the original matrix to determine the supernode to which the non-zero element belongs; The non-zero element positioning unit determines the element position of the non-zero element in the corresponding supernode to obtain the local coordinates of the non-zero element; The data writing unit writes the non-zero element to the corresponding position of the L matrix of the supernode according to the local coordinates.

6. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, it implements the functions of the device according to any one of claims 1-3 above.

7. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the functions of the device according to any one of claims 1-3 above.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the functions of the device according to any one of claims 1-3 above.

Citation Information

Patent Citations

  • Data storage and reading method and device, equipment and medium

    CN119311221A

  • Computing device, method, equipment, chip and system

    CN119337040A

  • Matrix solving method, computer equipment, storage medium and program product

    CN118152716A

  • Sparse matrix distributed solution method, computer equipment and storage medium

    CN119808513A