Graph data processing method and device
By integrating the sparse matrix of graph data with equal value division and matrix multiplication algorithm, the problems of low computational efficiency and unbalanced load of graph neural networks when processing graph data are solved, and efficient natural language processing and image recognition tasks are realized.
Patent Information
- Application Number
- CN202411215740.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-02
AI Technical Summary
When processing graph data, existing graph neural networks are difficult to effectively handle natural language processing and image recognition tasks due to the different local structures of nodes and unbalanced data distribution.
By obtaining the sparse matrix of characterizing the graph data, performing equal value division and matrix multiplication algorithm fusion, optimizing the distribution of row vectors and non-zero elements, realizing parallel processing and data reuse, and improving data processing efficiency.
It effectively alleviates the load imbalance problem in graph data processing, improves data processing efficiency and data reuse rate, reduces processing time, and improves the execution efficiency of natural language processing and image recognition tasks.
Smart Images

Figure CN118736368B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and more specifically to a graph data processing method and device. Background Art
[0002] Deep neural networks have attracted widespread attention due to their powerful modeling capabilities and have been successfully applied in natural language processing, image recognition and other fields. Most deep neural networks can only process structured Euclidean spatial data, such as images, text and speech, while many scenarios in real life, such as traffic networks, social networks, citation networks, etc., are in the form of graph data.
[0003] In related technologies, graph neural networks (GNNs) are used to process graph data. Since the local structures of each node in the graph data are different, the data distribution is unbalanced, and general-purpose processors use fine-grained instructions as carriers, GNNs suffer from low computing efficiency and unbalanced load on general-purpose processors in actual processing. Summary of the invention
[0004] In view of the above problems, the present invention provides a graph data processing method and device.
[0005] According to a first aspect of the present invention, a graph data processing method is provided, comprising: obtaining a sparse matrix representing graph data, the sparse matrix comprising a plurality of row vectors and a plurality of column vectors, both the row vectors and the column vectors representing vertices of the graph data, and the sparse matrix being used to perform natural language processing tasks or image recognition tasks; performing equal value partitioning on the row vectors of the sparse matrix to obtain a plurality of sparse slices, each sparse slice comprising the same number of non-zero elements, the sparse matrix comprising non-zero elements, and the non-zero elements representing edge relationships between different vertices of the graph data; performing data fusion on each non-zero element in each sparse slice with a preset dense matrix based on a matrix multiplication algorithm to obtain structural features corresponding to the graph data, wherein the plurality of non-zero elements are data fused with the preset dense matrix in parallel, and the structural features corresponding to the graph data are used to perform natural language processing tasks or image recognition tasks.
[0006] According to an embodiment of the present invention, the non-zero elements of a sparse matrix have initial sharding information, and the non-zero elements with the same initial sharding information are assigned to the same initial sparse sharding, wherein the row vectors of the sparse matrix are equally divided to obtain a plurality of sparse shards, including: based on the edge relationship represented by the non-zero elements, the positions of the row vectors of the sparse matrix are updated to obtain an updated sparse matrix; and the updated sparse matrix is equally divided to facilitate updating the initial sharding information of the non-zero elements to obtain a plurality of sparse shards.
[0007] According to an embodiment of the present invention, based on the edge relationship represented by the non-zero elements, the position of the row vector of the sparse matrix is updated to obtain an updated sparse matrix, including: based on a preset optimization goal, the initial sharding information and row vector identifier of each non-zero element are processed based on a greedy algorithm to optimize the row vector information and obtain an optimized row vector identifier that matches the preset optimization goal, wherein the preset optimization goal represents that the non-zero elements corresponding to the same initial sharding information are clustered in the same column; according to the optimized row vector identifier, the position of the row vector of the sparse matrix is updated to obtain an updated sparse matrix.
[0008] According to an embodiment of the present invention, an updated sparse matrix is equally divided to obtain a plurality of sparse slices, including: performing format conversion on the updated sparse matrix to remove zero elements in the sparse matrix to obtain compressed data; based on a preset equal value condition, storing non-zero elements in the compressed data into an initial sparse slice to obtain a plurality of sparse slices, wherein the number of non-zero elements corresponding to each sparse slice is equal.
[0009] According to an embodiment of the present invention, each non-zero element in each sparse slice is fused with a preset dense matrix based on a matrix multiplication algorithm to obtain structural features corresponding to the graph data, including: multiplying each non-zero element corresponding to each sparse slice with a preset dense matrix to obtain multiple first fusion results; fusing the multiple first fusion results to obtain multiple second fusion results; and determining the structural features corresponding to the graph data based on the multiple second fusion results.
[0010] According to an embodiment of the present invention, each non-zero element corresponding to each sparse slice is multiplied with a preset dense matrix to obtain multiple first fusion results, including: determining the position information of each non-zero element, the position information includes column information and row information; for any non-zero element, determining the target row information of the preset dense matrix according to the column information; multiplying the non-zero elements in the sparse slice with the preset dense row vector corresponding to the target row information in the preset dense matrix to obtain the first fusion result corresponding to each non-zero element.
[0011] According to an embodiment of the present invention, multiple first fusion results are fused to obtain multiple second fusion results, including: determining the row information corresponding to each first fusion result; merging multiple first fusion results with consistent row information to obtain multiple second fusion results.
[0012] According to an embodiment of the present invention, the above method further includes: storing a sparse matrix representing the graph data and structural features corresponding to the sparse matrix.
[0013] The second aspect of the present invention provides a graph data processing device, including: a data selection module, used to perform equal value division on the row vectors of a sparse matrix to obtain multiple sparse slices, each sparse slice includes the same number of non-zero elements, the sparse matrix includes non-zero elements, and the non-zero elements represent the edge relationship between different vertices of the graph data; an execution engine, used to multiply each non-zero element corresponding to each sparse slice with a preset dense matrix respectively to obtain multiple first fusion results; an accumulation module, used to fuse the multiple first fusion results to obtain multiple second fusion results, and determine the structural features corresponding to the sparse matrix according to the multiple second fusion results; a local control module, used to issue scheduling instructions to the data processing device; a local buffer module, used to obtain and store the sparse matrix representing the graph data and the structural features corresponding to the sparse matrix, the sparse matrix includes multiple row vectors, and the row vectors represent the vertices of the graph data.
[0014] The third aspect of the present invention provides a graph data processing system, comprising: the above-mentioned graph data processing device, used to process the sparse matrix representing the graph data to obtain structural features corresponding to the graph data; a central control device, used to issue scheduling instructions to the data processing device; a buffer device, used to store the sparse matrix representing the graph data and the structural features corresponding to the sparse matrix; a data transmission device, used to perform data interaction operations.
[0015] A fourth aspect of the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0016] The fifth aspect of the present invention further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the computer program or instructions are executed by a processor.
[0017] The sixth aspect of the present invention also provides a computer program product, including a computer program or instructions, which implement the steps of the above method when executed by a processor.
[0018] According to an embodiment of the present invention, a sparse matrix including a plurality of row vectors representing graph data is obtained; the row vectors of the sparse matrix are equally divided to obtain a plurality of sparse slices, each sparse slice comprising the same number of non-zero elements; each non-zero element in each sparse slice is fused with a preset dense matrix in parallel based on a matrix multiplication algorithm to obtain structural features corresponding to the graph data. Due to the adoption of the technical means of equally dividing the row vectors of the sparse matrix, the load imbalance problem of highly sparse and unevenly distributed graph data is avoided, and the load in the data movement process is alleviated while improving the data processing efficiency and data reuse rate; in addition, due to the adoption of the technical means of merging each non-zero element in each sparse slice with a preset dense matrix in parallel based on a matrix multiplication algorithm, the load imbalance caused by fusion operations such as inner product or outer product and the problem of long data processing time are avoided, and the sparsity of non-zero elements is eliminated for parallel processing and improved data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above contents and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0020] Figure 1 An application scenario diagram of a graph data processing method, apparatus, device, medium, and program product according to an embodiment of the present invention is shown;
[0021] Figure 2 A flowchart of a graph data processing method according to an embodiment of the present invention is shown;
[0022] Figure 3 A schematic diagram showing equal value division according to an embodiment of the present invention is shown;
[0023] Figure 4 A schematic diagram of graph data according to an embodiment of the present invention is shown;
[0024] Figure 5 A schematic diagram showing data reuse before and after updating the row vector position of a sparse matrix according to an embodiment of the present invention is shown;
[0025] Figure 6 A schematic diagram of inner product-based data fusion in the related art is shown;
[0026] Figure 7 A schematic diagram of data fusion based on outer product of the related art is shown;
[0027] Figure 8 A schematic diagram of data fusion according to an embodiment of the present invention is shown;
[0028] Fig. 9It shows a structural block diagram of a graph data processing device according to an embodiment of the present invention;
[0029] Fig.10 It shows a structural block diagram of a graph data processing system according to an embodiment of the present invention;
[0030] Fig.11 shows a performance histogram according to an embodiment of the present invention;
[0031] Fig.12 shows an energy efficiency histogram according to an embodiment of the present invention;
[0032] Fig.13 A block diagram of an electronic device suitable for implementing a graph data processing method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0033] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.
[0034] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0035] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0036] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0037] An embodiment of the present invention provides a graph data processing method, which obtains a sparse matrix representing the graph data, the sparse matrix includes multiple row vectors, and the row vectors represent the vertices of the graph data; the row vectors of the sparse matrix are equally divided to obtain multiple sparse slices, each sparse slice includes the same number of non-zero elements, the sparse matrix includes non-zero elements, and the non-zero elements represent the edge relationship between different vertices of the graph data; based on a matrix multiplication algorithm, each non-zero element in each sparse slice is respectively fused with a preset dense matrix to obtain structural features corresponding to the graph data, wherein multiple non-zero elements are fused with the preset dense matrix in parallel.
[0038] Figure 1 An application scenario diagram of a graph data processing method, apparatus, device, medium, and program product according to an embodiment of the present invention is shown.
[0039] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0040] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0041] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0042] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0043] It should be noted that the graph data processing method provided in the embodiment of the present invention can generally be executed by the server 105. Accordingly, the graph data processing device provided in the embodiment of the present invention can generally be set in the server 105. The graph data processing method provided in the embodiment of the present invention can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the graph data processing device provided in the embodiment of the present invention can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0044] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0045] The following will be based on Figure 1 The scene described by Figure 2~Figure 8 The graph data processing method of an embodiment of the invention is described in detail.
[0046] Figure 2 A flowchart of a graph data processing method according to an embodiment of the present invention is shown.
[0047] like Figure 2 As shown, the graph data processing method of this embodiment includes operations S210 to S230.
[0048] In operation S210, a sparse matrix representing graph data is obtained, the sparse matrix includes a plurality of row vectors and a plurality of column vectors, both the row vectors and the column vectors represent vertices of the graph data, and the sparse matrix is used to perform natural language processing tasks or image recognition tasks.
[0049] According to an embodiment of the present invention, graph data may be data in a non-Euclidean space, including multiple vertices, and is applicable to scenarios such as transportation networks, social networks, and citation networks.
[0050] According to an embodiment of the present invention, a sparse matrix may be a matrix composed of multiple row vectors and multiple column vectors, wherein the i-th row of the sparse matrix may be represented as the i-th vertex, and correspondingly, the j-th column of the sparse matrix may be represented as the j-th vertex.
[0051] According to an embodiment of the present invention, sparse matrices can be used to perform natural language processing tasks or image recognition tasks. For example, graph neural networks (GNN) have a wide range of applications in the field of natural language processing (NLP). Specifically, graph neural networks can extract features from graph data, obtain text information for analysis, and complete natural language processing tasks.
[0052] According to an embodiment of the present invention, in addition to the above-mentioned natural language processing tasks or image recognition tasks, graph data can also be applied to other non-Euclidean space data processing tasks, such as transportation networks, social networks, citation networks and other application scenarios.
[0053] In operation S220, the row vectors of the sparse matrix are equally divided to obtain a plurality of sparse slices, each sparse slice includes the same number of non-zero elements, and the sparse matrix includes non-zero elements, and the non-zero elements represent edge relationships between different vertices of the graph data.
[0054] According to an embodiment of the present invention, non-zero elements represent edge relationships between different vertices of graph data. For example, a non-zero element ij located in the i-th row and the j-th column can be represented as an edge relationship between the i-th vertex and the j-th vertex.
[0055] According to an embodiment of the present invention, a zero element in a sparse matrix may be represented as a no-edge relationship between two vertices corresponding to the zero element.
[0056] According to an embodiment of the present invention, the sparse slice may be a storage slice for storing non-zero elements obtained by performing equal value partitioning on the row vectors of the sparse matrix.
[0057] According to an embodiment of the present invention, due to the differentiated element distribution of sparse matrices, in related 2D partitioning technologies, the use of a grid partitioning method to divide irregular graph data will result in low execution efficiency when the sparse matrix blocks are mapped to the hardware engine. Therefore, the use of equal-value partitioning to process the row vectors of the sparse matrix can effectively reduce unnecessary pause bubbles during data processing.
[0058] In operation S230, each non-zero element in each sparse slice is fused with a preset dense matrix based on a matrix multiplication algorithm to obtain a structural feature corresponding to the graph data, wherein multiple non-zero elements are fused with the preset dense matrix in parallel.
[0059] According to an embodiment of the present invention, the matrix multiplication algorithm may be a Gustavson algorithm, which is suitable for matrix multiplication operations of sparse matrices.
[0060] According to an embodiment of the present invention, the preset dense matrix may be a matrix used for data fusion with non-zero elements, which can reduce the amount of computation and storage requirements while maintaining the accuracy and efficiency of data processing to obtain high-quality structural features corresponding to the graph data.
[0061] According to an embodiment of the present invention, the sparse matrix corresponding to the graph data is processed, and the obtained structural features corresponding to the graph data can be directly applied to natural language processing tasks or image recognition tasks, as well as other non-Euclidean space data processing tasks related to the graph data, thereby avoiding the problems of different sizes of various graph data and disordered nodes, and achieving the ability to adapt to multiple operations, improving data processing efficiency and data reuse rate, and thereby improving the execution efficiency of natural language processing tasks or image recognition tasks.
[0062] According to an embodiment of the present invention, a sparse matrix including a plurality of row vectors representing graph data is obtained; the row vectors of the sparse matrix are equally divided to obtain a plurality of sparse slices, each sparse slice comprising the same number of non-zero elements; each non-zero element in each sparse slice is fused with a preset dense matrix in parallel based on a matrix multiplication algorithm to obtain structural features corresponding to the graph data. Due to the adoption of the technical means of equally dividing the row vectors of the sparse matrix, the load imbalance problem of highly sparse and unevenly distributed graph data is avoided, and the load in the data movement process is alleviated while improving the data processing efficiency and data reuse rate; in addition, due to the adoption of the technical means of merging each non-zero element in each sparse slice with a preset dense matrix in parallel based on a matrix multiplication algorithm, the load imbalance caused by fusion operations such as inner product or outer product and the problem of long data processing time are avoided, and the sparsity of non-zero elements is eliminated for parallel processing and improved data processing efficiency.
[0063] According to an embodiment of the present invention, the non-zero elements of a sparse matrix have initial sharding information, and the non-zero elements with the same initial sharding information are assigned to the same initial sparse sharding, wherein the row vectors of the sparse matrix are equally divided to obtain a plurality of sparse shards, including: based on the edge relationship represented by the non-zero elements, the positions of the row vectors of the sparse matrix are updated to obtain an updated sparse matrix; and the updated sparse matrix is equally divided to facilitate updating the initial sharding information of the non-zero elements to obtain a plurality of sparse shards.
[0064] According to an embodiment of the present invention, the initial sharding information may be identification information of each non-zero element in the sparse matrix, and non-zero elements with the same identification are classified as the same initial sparse sharding.
[0065] According to an embodiment of the present invention, the preset dense matrix can be indexed multiple times, and the position of the row vector of the sparse matrix is updated so that multiple non-zero elements correspond to the same index, thereby obtaining an updated sparse matrix to reduce global data transmission between the preset dense matrix and realize data reuse.
[0066] According to an embodiment of the present invention, the updated sparse matrix is equally divided, and each non-zero element is stored in a new sparse slice based on the updated initial slice information, so that each sparse slice contains an equal number of non-zero elements, thereby better alleviating the load imbalance problem in the data movement process, thereby improving the system data processing execution efficiency.
[0067] According to an embodiment of the present invention, based on the edge relationship represented by the non-zero elements, the position of the row vector of the sparse matrix is updated to obtain an updated sparse matrix, including: based on a preset optimization goal, the initial sharding information and the row vector identifier of each non-zero element are processed based on a greedy algorithm to optimize the row vector information and obtain an optimized row vector identifier that matches the preset optimization goal, wherein the preset optimization goal represents that the non-zero elements corresponding to the same initial sharding information are clustered in the same column; according to the optimized row vector identifier, the position of the row vector of the sparse matrix is updated to obtain an updated sparse matrix.
[0068] According to an embodiment of the present invention, the preset optimization goal may be to aggregate most non-zero elements in the sparse matrix in the same column so that they can index the same row of the preset dense matrix.
[0069] According to an embodiment of the present invention, the row vector identifier may be an identity identifier corresponding to each vertex.
[0070] According to an embodiment of the present invention, a greedy algorithm may be calculated based on the state of the current sparse matrix (ie, the initial sharding information and row vector identifier of each non-zero element) to obtain an adjustment decision that is close to a preset optimization target.
[0071] According to an embodiment of the present invention, based on the adjustment decision obtained by the greedy algorithm, an optimization decision for the row vector identifier is obtained. The position of the row vector of the sparse matrix is adjusted according to the optimized row vector identifier, so that the adjusted sparse matrix is close to the preset optimization target, thereby effectively improving the on-chip data reuse opportunity and reducing global data transmission.
[0072] According to an embodiment of the present invention, an updated sparse matrix is equally divided to obtain a plurality of sparse slices, including: performing format conversion on the updated sparse matrix to remove zero elements in the sparse matrix to obtain compressed data; based on a preset equal value condition, storing non-zero elements in the compressed data into an initial sparse slice to obtain a plurality of sparse slices, wherein the number of non-zero elements corresponding to each sparse slice is equal.
[0073] According to an embodiment of the present invention, the updated sparse matrix is format-converted to obtain a matrix in a compressed format (Compressed Sparse Row, CSR), so that the obtained compressed data includes only non-zero elements. Compared with conventional two-dimensional array storage, the CSR format can significantly reduce memory usage when representing large sparse matrices, and at the same time, avoid the inclusion of zero elements in the obtained sparse slices.
[0074] According to an embodiment of the present invention, the preset equal value condition may be to ensure that the number of non-zero elements in each sparse slice is equal while clustering the non-zero elements in the same sparse slice in the same column of the sparse matrix.
[0075] According to an embodiment of the present invention, all stored non-zero elements are extracted from the compressed data and stored in the initial sparse slice based on a preset equivalence condition, so as to update the initial sparse slice and obtain multiple sparse slices.
[0076] Figure 3 A schematic diagram of equal-value partitioning according to an embodiment of the present invention is shown.
[0077] According to an embodiment of the present invention, Figure 3 As shown, after converting the sparse matrix into CSR format, the non-zero elements are equally divided to obtain sparse tiles tile0 and sparse tiles tile1, where sparse tiles tile0 contains non-zero elements a 00 ,a 03 , a 11 and a 12 , sparse tile1 contains element a 14 , a 23 , a 31 and a 43 Subsequently, sparse tiles tile0 and tile1 will be processed in sequence to perform subsequent operations.
[0078] Figure 4 A schematic diagram of graph data according to an embodiment of the present invention is shown; Figure 5 A schematic diagram showing data reuse before and after the row vector position of a sparse matrix is updated according to an embodiment of the present invention.
[0079] According to an embodiment of the present invention, the structure of the graph data can be as follows: Figure 4 As shown, the sparse matrix form of the graph data can be expressed as Figure 5 510 in sparse matrix 510. In sparse matrix 510, for sparse tile 1, i.e., the non-zero element X in the blue part in sparse matrix 510, it can be seen that both vertex 1 and vertex 3 have an edge relationship with vertex 2; for sparse tile 2, i.e., the non-zero element X in the pink part in sparse matrix 510, it can be seen that both vertex 4 and vertex 5 have an edge relationship with vertex 1, and both vertex 3 and vertex 5 have an edge relationship with vertex 6. In sparse matrix 510, the two non-zero elements X in red circle 511 are both in the same sparse tile 1 and are in the same column (i.e., both vertex 1 and vertex 3 have an edge relationship with vertex 2), so the two non-zero elements X in red circle 511 can achieve data reuse. Correspondingly, it can be determined that in sparse tile 2, the non-zero element X corresponding to red circle 512 and the non-zero element X corresponding to red circle 513 can also achieve data reuse, i.e., sparse matrix 510 has 3 data reuse opportunities.
[0080] Based on the greedy algorithm, the position of the row vector of the sparse matrix 510 is adjusted. For example, the row vector whose original row vector is identified as 2 is optimized to obtain an optimized row vector identified as 4, that is, the position corresponding to the row vector whose original row vector is identified as 2 is updated to the position corresponding to the row vector identified as 4, until each position is updated. Then, the updated sparse matrix is subjected to the above-mentioned equal value partitioning process so that the corresponding non-zero elements X in each sparse tile are gathered in the same column of the sparse matrix. For example, the non-zero elements X whose original row vector is identified as 6 are all non-zero elements of sparse tile2. After equal value partitioning, the non-zero elements X whose original row vector is identified as 6 are non-zero elements of sparse tile1. After completing the equal value partitioning, the sparse matrix 520 is obtained.
[0081] In the sparse matrix 520, based on the non-zero elements X corresponding to red circles 521, 522, 523, 524 and 525, it can be determined that the sparse matrix 520 has 5 data reuse opportunities, among which the red circles 523 and 524 correspond to the same group of non-zero elements X, indicating two data reuses of the group of non-zero elements X. Compared with the sparse matrix 510 before optimization, the sparse matrix 520 has a high data reuse rate, which reduces the global transmission of data.
[0082] According to an embodiment of the present invention, each non-zero element in each sparse slice is fused with a preset dense matrix based on a matrix multiplication algorithm to obtain structural features corresponding to the graph data, including: multiplying each non-zero element corresponding to each sparse slice with a preset dense matrix to obtain multiple first fusion results; fusing the multiple first fusion results to obtain multiple second fusion results; and determining the structural features corresponding to the graph data based on the multiple second fusion results.
[0083] According to an embodiment of the present invention, multiple sparse slices are multiplied with a preset dense matrix in sequence, wherein, for each non-zero element of the same sparse slice, data fusion with the preset dense matrix can be achieved in parallel to obtain multiple first fusion results at the same time.
[0084] According to an embodiment of the present invention, multiple first fusion results are cumulatively fused to obtain multiple second fusion results, which reduces the number of accesses to the system memory, is beneficial to improving system performance and reducing data processing delays.
[0085] According to an embodiment of the present invention, the multiple second fusion results obtained above are collectively used as structural features corresponding to the graph data.
[0086] According to an embodiment of the present invention, each non-zero element corresponding to each sparse slice is multiplied with a preset dense matrix to obtain multiple first fusion results, including: determining the position information of each non-zero element, the position information includes column information and row information; for any non-zero element, determining the target row information of the preset dense matrix according to the column information; multiplying the non-zero elements in the sparse slice with the preset dense row vector corresponding to the target row information in the preset dense matrix to obtain the first fusion result corresponding to each non-zero element.
[0087] According to an embodiment of the present invention, the position information of a non-zero element may be the position of the non-zero element in the updated sparse matrix, wherein the column information and the row information are the column position and the row position of the non-zero element in the updated sparse matrix, respectively.
[0088] According to an embodiment of the present invention, target row information of a preset dense matrix is determined according to column information. For example, if a non-zero element is located in the jth column, the jth row of the preset dense matrix is used as target row information corresponding to the non-zero element.
[0089] According to an embodiment of the present invention, a non-zero element is multiplied with a preset dense row vector corresponding to the target row information in a preset dense matrix to obtain a fused row vector, and the fused row vector is used as the first fusion result corresponding to the non-zero element.
[0090] According to an embodiment of the present invention, multiple first fusion results are fused to obtain multiple second fusion results, including: determining the row information corresponding to each first fusion result; merging multiple first fusion results with consistent row information to obtain multiple second fusion results.
[0091] According to an embodiment of the present invention, the row information of the non-zero elements corresponding to the first fused data is used as the row information corresponding to the first fused result.
[0092] According to an embodiment of the present invention, first fused data with the same row information may be merged and multiple first fused data may be accumulated, which is beneficial to reducing the number of accesses to the system memory.
[0093] Figure 6 A schematic diagram of inner product-based data fusion in the related art is shown.
[0094] In the related art, the inner product method is used to merge the non-zero elements with the preset dense matrix, such as Figure 6 As shown, the sparse matrix includes multiple non-zero elements X, and the sparse matrix performs an index matching operation with the preset dense matrix. For example, the first row vector 610 of the sparse matrix is multiplied with the first column vector 620 of the preset dense matrix to obtain the dot product 630 of the two vectors. Based on the above operation, each row vector of the sparse matrix is processed to achieve data fusion with the dense matrix. In this process, multiple index-based media access control (MAC) operations need to be performed to achieve parallel computing, and then the unbalanced distribution of the non-zero elements X leads to a load imbalance problem between multiple processing engines.
[0095] Figure 7 A schematic diagram of outer product-based data fusion in the related art is shown.
[0096] The outer product method is also used in related technologies, for example, Figure 7 As shown, the first column vector 710 in the sparse matrix is tensor-producted with the first row vector 720 of the preset dense matrix to obtain multiple output matrices 730. Based on the above operation, each column vector of the sparse matrix is processed. Although the load imbalance problem is partially solved, a large number of output matrices are generated, and the output reusability is poor. It takes a long time to merge these output matrices and the efficiency is low.
[0097] Figure 8 A schematic diagram of data fusion according to an embodiment of the present invention is shown.
[0098] The matrix multiplication algorithm of the present invention is used as follows: Figure 8As shown, each non-zero element X in each sparse slice is multiplied with the preset dense matrix respectively, and then the multiplied results are merged. For example, for the row information that is all 1, the non-zero element 810 indicated by the yellow circle is data fused with the corresponding target row information 830 in the preset dense matrix, and the non-zero element 820 indicated by the red circle is data fused with the corresponding target row information 840 in the preset dense matrix. The two fused data obtained are merged to obtain the fusion result 850 shown in the output matrix. Based on the above operation, each non-zero element of the sparse matrix is processed. The present invention can solve the load imbalance while not generating a large amount of additional overhead as shown in the outer product technology in the related art. In addition, for the same row of the preset dense matrix, parallel processing can be achieved to further improve data processing efficiency.
[0099] According to an embodiment of the present invention, the above method further includes: storing a sparse matrix representing the graph data and structural features corresponding to the sparse matrix.
[0100] According to an embodiment of the present invention, based on a ping-pong buffer technology, a sparse matrix representing graph data and structural features corresponding to the sparse matrix are stored so that data transmission delay can be masked by calculation time.
[0101] Fig. 9 A structural block diagram of a graph data processing device according to an embodiment of the present invention is shown.
[0102] A second aspect of the present invention provides a graph data processing device 900, such as Fig. 9 As shown, the device includes: a data selection module 910, which is used to equally divide the row vectors of the sparse matrix to obtain multiple sparse slices, each sparse slice includes the same number of non-zero elements, the sparse matrix includes non-zero elements, and the non-zero elements represent the edge relationship between different vertices of the graph data; an execution engine 920, which is used to multiply each non-zero element corresponding to each sparse slice with a preset dense matrix respectively to obtain multiple first fusion results; an accumulation module 930, which is used to fuse the multiple first fusion results to obtain multiple second fusion results, and determine the structural features corresponding to the sparse matrix according to the multiple second fusion results; a local control module 940, which is used to issue scheduling instructions to the data processing device; a local buffer module 950, which is used to obtain and store the sparse matrix representing the graph data and the structural features corresponding to the sparse matrix, the sparse matrix includes multiple row vectors, and the row vectors represent the vertices of the graph data.
[0103] According to an embodiment of the present invention, the data selection module 910 (data fetch module) performs equal value partitioning on the row vector of the sparse matrix to obtain multiple sparse slices, and transmits the sparse matrix to the local buffer module 950 to back up and store the sparse matrix. In addition, the data selection module 910 determines the index relationship with the target row information of the preset dense matrix according to the column information of the non-zero elements, and transmits the index relationship to the execution engine 920.
[0104] According to an embodiment of the present invention, the execution engine 920 (processing engine, PE) includes multiple, after receiving the sparse slices containing non-zero elements and the index relationship corresponding to the non-zero elements, the multiple execution engines 920 process the multiple non-zero elements in parallel, multiply them with the preset dense matrix, and obtain multiple first fusion results.
[0105] According to an embodiment of the present invention, the accumulation module 930 includes a plurality of merging units and corresponding internal buffers, wherein the merging unit is responsible for fusing a plurality of first fusion results to obtain a plurality of second fusion results. After the calculation of the non-zero elements of the same row of information is completed, the internal buffer determines the plurality of second fusion results as structural features corresponding to the sparse matrix, and transmits them to the local buffer module 950 to back up and store the structural features corresponding to the sparse matrix.
[0106] According to an embodiment of the present invention, a local control module 940 processes the scheduling execution within the graph data processing device and monitors and manages the graph data processing device 900 .
[0107] According to an embodiment of the present invention, the local buffer module 950 (local buffers) includes a sparse data buffer, a dense data buffer and an output result buffer, which are responsible for storing input and output data, wherein the sparse data buffer and the dense data buffer are used to store sparse matrices, and the output result buffer is used to store structural features corresponding to the sparse matrix. In addition, the local buffer module 950 also acts as an intermediary for data transmission between the graph data processing system and the graph data processing device 900.
[0108] Fig.10 A structural block diagram of a graph data processing system according to an embodiment of the present invention is shown.
[0109] A third aspect of the present invention provides a graph data processing system 1000, such as Fig.10As shown, the system includes: the above-mentioned graph data processing device 900, used to process the sparse matrix representing the graph data to obtain the structural features corresponding to the graph data; the central control device 1010, used to issue scheduling instructions to the data processing device; the buffer device 1020, used to store the sparse matrix representing the graph data and the structural features corresponding to the sparse matrix; the data transmission device 1030, used to perform data interaction operations.
[0110] According to an embodiment of the present invention, the graph data processing device 900 (processing unit, PU) includes multiple graph data processing devices 900, each of which executes independently without interacting with other graph data processing devices 900. In addition, multiple graph data processing devices 900 execute graph data processing tasks in parallel.
[0111] According to an embodiment of the present invention, the central control device 1010 (control module) is responsible for coordinating and controlling the scheduling execution of the entire graph data processing system, and starts various types of data transmission by specifying address information.
[0112] According to an embodiment of the present invention, the buffer device 1020 (buffers) includes a sparse block cache area, a dense block cache area and an output buffer area, wherein the sparse block cache area and the dense block cache area are used to store the sparse matrix transmitted by the graph data processing device 900, and the output buffer area is used to store the structural features corresponding to the sparse matrix transmitted by the graph data processing device 900.
[0113] According to an embodiment of the present invention, the data transfer module 1030 is responsible for data interaction between the on-chip buffer device 1020 and a large-capacity off-chip memory.
[0114] According to an embodiment of the present invention, the graph data processing system of the present invention is deployed on a target deployment platform. Specifically, it includes a field programmable gate array chip. The chip contains 2016 block random access memories (BRAMs), 9024 digital signal processors (DSPs), 1304k look-up tables (LUTs), 2607k flip-flops (FFs), and 960 ultra-random access memories (URAMs). The deployment platform uses HBM (High Bandwidth Memory) to store data, and its memory access bandwidth can reach 460 GB / s. The graph data processing system is deployed using a tool chain. Specifically, the graph data processing system is programmed using a high-level synthesis tool and deployed using an integrated development environment.
[0115] According to an embodiment of the present invention, the clock frequency selected in the test scenario is 200 MHz. The graph data processing system of the present invention adopts 16-bit fixed-point numbers as the default data type. The graph data processing system may include 4 graph data processing devices 900PU, each PU including 2 execution engines PE. A total of 8 PEs execute in parallel. The total power consumption is 43.7W, and the peak performance is 238.2 GOPs. It consumes 1642 BRAMs, 646 DSPs, 282k LUTs, 421k FFs, and 640 URAMs.
[0116] According to an embodiment of the present invention, Table 1 shows resource usage of a graph data processing system on a target deployment platform, wherein the first row represents resources used by the graph data processing system, and the second row represents all accessible resources.
[0117]
[0118] According to an embodiment of the present invention, Table 2 shows data of multiple graph datasets, among which the Cora dataset and the Citseer dataset have smaller data volumes than the Pubmed dataset and the Nell dataset, as specifically shown in Table 2.
[0119]
[0120] According to an embodiment of the present invention, three architectures are selected to be constructed during testing, including a basic architecture (SDMA-base architecture), an intermediate architecture (DMA-equal architecture) and a complete architecture (SDMA architecture). The SDMA-base architecture is a baseline architecture that uses the 2D partitioning method of the related technology. Specifically, the architecture only uses the Gustavson algorithm to perform data fusion of non-zero elements and a preset dense matrix. The DMA-equal architecture only sets up the equal-value partitioning of non-zero elements in the present invention and uses the Gustavson algorithm to perform data fusion of non-zero elements and a preset dense matrix. The SDMA architecture includes the entire graph data processing system of the present invention, specifically updating the position of the row vector of the sparse matrix, performing equal-value partitioning on the updated sparse matrix, and then performing data fusion of non-zero elements and a preset dense matrix based on the Gustavson algorithm.
[0121] Fig.11 shows a performance histogram according to an embodiment of the present invention; Fig.12 An energy efficiency histogram according to an embodiment of the present invention is shown.
[0122] According to an embodiment of the present invention, Fig.11 As shown in the figure, the Cora dataset, Citseer dataset, Pubmed dataset and Nell dataset were selected to test the performance of the basic architecture (SDMA-base architecture), the intermediate architecture (DMA-equal architecture) and the complete architecture (SDMA architecture). Compared with the SDMA-base architecture, the SDMA-equal architecture achieved an average acceleration ratio of 1.73x. As shown in the figure, in terms of energy efficiency, compared with the SDMA-base architecture, the SDMA-equal architecture also achieved an energy consumption benefit of 1.84x. On the more irregular Nell dataset, compared with the SDMA-base architecture, the SDMA-equal architecture achieved an acceleration ratio of 3.03x and 3.22x in performance and energy efficiency, respectively. Based on the equal value partitioning of non-zero elements and the use of the Gustavson algorithm for data fusion of non-zero elements and preset dense matrices, it can adapt to the sparse computing characteristics and achieve higher performance for large sparse matrices. Specifically, the equal-value partitioning method can ensure the balance among sparse shards, and the Gustavson algorithm can achieve a better trade-off between data reuse and on-chip memory requirements.
[0123] According to an embodiment of the present invention, Fig.12As shown in the figure, the Cora dataset, Citseer dataset, Pubmed dataset, and Nell dataset were selected to test the energy efficiency of the basic architecture (SDMA-base architecture), the intermediate architecture (DMA-equal architecture), and the complete architecture (SDMA architecture). Based on the SDMA-equal architecture, the SDMA architecture further integrates the vertex clustering optimization operation, that is, the position of the row vector of the sparse matrix is updated. Compared with the above two architectures, it can achieve 1.09x~2.80x data reuse improvement on the benchmark dataset. Compared with the SDMA-equal architecture, the SDMA architecture achieves an average performance gain of 1.20x and an energy efficiency gain of 1.20x.
[0124] Fig.13 A block diagram of an electronic device suitable for implementing a graph data processing method according to an embodiment of the present invention is schematically shown.
[0125] like Fig.13 As shown, the electronic device 1300 according to an embodiment of the present invention includes a processor 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage part 1308 to a random access memory (RAM) 1303. The processor 1301 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1301 may also include an onboard memory for caching purposes. The processor 1301 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0126] In RAM 1303, various programs and data required for the operation of electronic device 1300 are stored. Processor 1301, ROM 1302 and RAM 1303 are connected to each other via bus 1304. Processor 1301 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 1302 and / or RAM 1303. It should be noted that the program can also be stored in one or more memories other than ROM 1302 and RAM 1303. Processor 1301 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in the one or more memories.
[0127] According to an embodiment of the present invention, the electronic device 1300 may further include an input / output (I / O) interface 1305, which is also connected to the bus 1304. The electronic device 1300 may further include one or more of the following components connected to the I / O interface 1305: an input portion 1306 including a keyboard, a mouse, etc.; an output portion 1307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1308 including a hard disk, etc.; and a communication portion 1309 including a network interface card such as a LAN card, a modem, etc. The communication portion 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the I / O interface 1305 as needed. A removable medium 1311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1310 as needed, so that a computer program read therefrom is installed into the storage portion 1308 as needed.
[0128] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.
[0129] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 1302 and / or RAM 1303 described above and / or one or more memories other than ROM 1302 and RAM 1303.
[0130] The embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the graph data processing method provided by the embodiment of the present invention.
[0131] The computer program executes the above functions defined in the system / device of the embodiment of the present invention when it is executed by the processor 1301. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0132] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1309, and / or installed from the removable medium 1311. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0133] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1309, and / or installed from the removable medium 1311. When the computer program is executed by the processor 1301, the above functions defined in the system of the embodiment of the present invention are performed. According to the embodiment of the present invention, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0134] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0135] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0136] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present invention may be combined and / or combined in various ways, even if such combinations and / or combinations are not explicitly described in the present invention. In particular, the features described in the various embodiments and / or claims of the present invention may be combined and / or combined in various ways without departing from the spirit and teachings of the present invention. All of these combinations and / or combinations fall within the scope of the present invention.
[0137] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination. The scope of the present invention is defined by the attached claims and their equivalents. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A graph data processing method, characterized in that: The method comprises: Obtain a sparse matrix representing graph data, the sparse matrix comprising a plurality of row vectors and a plurality of column vectors, the row vectors and the column vectors both representing vertices of the graph data, and the sparse matrix being used to perform a natural language processing task or an image recognition task; Performing equal value partitioning on the row vectors of the sparse matrix to obtain a plurality of sparse slices, each of the sparse slices comprising the same number of non-zero elements, the sparse matrix comprising the non-zero elements, and the non-zero elements representing the edge relationship between different vertices of the graph data; Based on a matrix multiplication algorithm, each of the non-zero elements in each of the sparse slices is respectively fused with a preset dense matrix to obtain a structural feature corresponding to the graph data, wherein a plurality of the non-zero elements are fused with the preset dense matrix in parallel, and the structural feature corresponding to the graph data is used to perform the natural language processing task or the image recognition task; The non-zero elements of the sparse matrix have initial sharding information, and the non-zero elements having the same initial sharding information are allocated to the same initial sparse sharding. The step of equally dividing the row vectors of the sparse matrix to obtain a plurality of sparse slices includes: Based on the edge relationship represented by the non-zero elements, the position of the row vector of the sparse matrix is updated to obtain the updated sparse matrix; Performing equal value partitioning on the updated sparse matrix so as to update the initial slice information of the non-zero elements and obtain a plurality of the sparse slices; The updating of the position of the row vector of the sparse matrix based on the edge relationship represented by the non-zero elements to obtain the updated sparse matrix includes: Based on a preset optimization goal, the initial sharding information and the row vector identifier of each non-zero element are processed based on a greedy algorithm to optimize the row vector and obtain an optimized row vector identifier that matches the preset optimization goal, wherein the preset optimization goal represents that the non-zero elements corresponding to the same initial sharding information are clustered in the same column; According to the optimized row vector identifier, the position of the row vector of the sparse matrix is updated to obtain the updated sparse matrix.
2. The method according to claim 1, characterized in that The step of equally partitioning the updated sparse matrix to obtain a plurality of sparse slices comprises: Performing format conversion on the updated sparse matrix so as to remove zero elements in the sparse matrix and obtain compressed data; Based on a preset equal value condition, the non-zero elements in the compressed data are stored in the initial sparse slice to obtain a plurality of the sparse slices, wherein the number of the non-zero elements corresponding to each of the sparse slices is equal.
3. The method according to claim 1, characterized in that The method of fusing each of the non-zero elements in each of the sparse slices with a preset dense matrix based on a matrix multiplication algorithm to obtain structural features corresponding to the graph data includes: Multiply each of the non-zero elements corresponding to each of the sparse slices by the preset dense matrix to obtain a plurality of first fusion results; Fusing the plurality of the first fusion results to obtain a plurality of second fusion results; According to the plurality of the second fusion results, a structural feature corresponding to the graph data is determined.
4. The method according to claim 3, characterized in that The step of multiplying each of the non-zero elements corresponding to each of the sparse slices by the preset dense matrix to obtain a plurality of first fusion results includes: Determine position information of each of the non-zero elements, wherein the position information includes column information and row information; For any of the non-zero elements, determining target row information of the preset dense matrix according to the column information; The non-zero elements in the sparse slice are multiplied by a preset dense row vector corresponding to the target row information in the preset dense matrix to obtain a first fusion result corresponding to each of the non-zero elements.
5. The method according to claim 4, characterized in that The fusing the plurality of the first fusion results to obtain a plurality of second fusion results includes: Determine the row information corresponding to each of the first fusion results; The multiple first fusion results with consistent row information are merged to obtain multiple second fusion results.
6. The method according to claim 1, characterized in that The method further comprises: A sparse matrix representing the graph data and structural features corresponding to the sparse matrix are stored.
7. A graph data processing device, characterized in that: The device comprises: A data selection module is used to perform equal value partitioning on the row vectors of the sparse matrix to obtain multiple sparse slices, each of the sparse slices includes the same number of non-zero elements, the sparse matrix includes the non-zero elements, and the non-zero elements represent the edge relationship between different vertices of the graph data; the non-zero elements of the sparse matrix have initial slice information, and the non-zero elements with the same initial slice information are allocated to the same initial sparse slice, The step of equally dividing the row vectors of the sparse matrix to obtain a plurality of sparse slices includes: Based on the edge relationship represented by the non-zero elements, the position of the row vector of the sparse matrix is updated to obtain the updated sparse matrix; Performing equal value partitioning on the updated sparse matrix so as to update the initial slice information of the non-zero elements and obtain a plurality of the sparse slices; The updating of the position of the row vector of the sparse matrix based on the edge relationship represented by the non-zero elements to obtain the updated sparse matrix includes: Based on a preset optimization goal, the initial sharding information and the row vector identifier of each non-zero element are processed based on a greedy algorithm to optimize the row vector and obtain an optimized row vector identifier that matches the preset optimization goal, wherein the preset optimization goal represents that the non-zero elements corresponding to the same initial sharding information are clustered in the same column; According to the optimized row vector identifier, the position of the row vector of the sparse matrix is updated to obtain the updated sparse matrix; An execution engine, configured to multiply each of the non-zero elements corresponding to each of the sparse slices by a preset dense matrix to obtain a plurality of first fusion results; an accumulation module, configured to fuse the plurality of the first fusion results to obtain a plurality of second fusion results, and determine a structural feature corresponding to the sparse matrix according to the plurality of the second fusion results; A local control module, used for issuing a scheduling instruction to the data processing device; A local buffer module is used to obtain and store a sparse matrix representing graph data and structural features corresponding to the sparse matrix, wherein the sparse matrix includes multiple row vectors, and the row vectors represent vertices of the graph data.
8. A graph data processing system, characterized in that: The system comprises: The graph data processing device according to claim 7, used to process a sparse matrix representing graph data to obtain structural features corresponding to the graph data; A central control device, used to issue a dispatch instruction to the data processing device; A buffer device, used for storing the sparse matrix representing the graph data and the structural features corresponding to the sparse matrix; Data transmission device, used for performing data interaction operations.