A Block-Based Graph Data Partitioning Method and System for Graph Neural Networks
By constructing neighborhood blocks for graph neural networks and calculating the balanced distribution objective function, the problem of unbalanced computing node load in distributed training of graph neural networks is solved, and efficient graph data division and training efficiency are achieved.
Patent Information
- Application Number
- CN202510560015.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-30
AI Technical Summary
In the existing distributed training of graph neural networks, the graph data division strategy fails to fully consider the load balancing of computing nodes, resulting in low training efficiency, unbalanced computing nodes, and serious waste of resources.
Using the block-based graph data division method, by building neighborhood blocks for each training set node, computing the balanced distribution objective function, selecting the optimal partition, and dividing the graph data into multiple subgraphs and deploying it on different computing nodes for training.
Reduce the number of cross-partition edges, ensure the balanced distribution of training set nodes in each partition, improve the training efficiency and load balancing of distributed graph neural networks, reduce the communication overhead between computing nodes, and improve the overall training efficiency.
Smart Images

Figure CN120086024B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a multi-computing node resource scheduling technology in the field of deep learning distributed training, and specifically relates to a block-based graph data partitioning method and system for graph neural networks. Background Art
[0002] With the wide application of graph data in fields such as social networks, recommendation systems, and bioinformatics, graph neural networks, as a deep learning model capable of effectively processing graph-structured data, have received extensive attention in both the academic and industrial communities. Graph neural networks learn node representations by aggregating information of nodes and their neighbors and can achieve good results in tasks such as node classification, graph classification, and link prediction. However, with the continuous growth of the scale of graph data, single-machine training of graph neural network models faces limitations in computing and storage resources. Traditional single-machine training and full-graph training strategies become infeasible when dealing with large-scale graph data because the entire graph structure needs to be traversed in each iteration, resulting in increased computational costs. In addition, the storage and transmission of large-scale graph data, as well as the intermediate states that need to be stored during the training process, pose higher requirements for storage resources.
[0003] To solve these problems, researchers have proposed various techniques, including sampling, caching, and distributed training, etc. Among them, distributed training improves the training efficiency through data parallelism by partitioning graph data onto multiple computing nodes, and has become an effective solution for processing large-scale graph data. However, the efficiency and quality of distributed training largely depend on the graph data partitioning strategy. The goal of the graph data partitioning strategy is to distribute large-scale graph data onto multiple computing nodes for processing, while minimizing the number of edges crossing nodes and maintaining the load balance of each computing node. Existing graph partitioning algorithms are mainly divided into two categories: offline partitioning and online partitioning. Offline partitioning algorithms usually perform a one-time partitioning of the entire graph data before training starts. Typical representatives include METIS and KAHIP, etc. Although these algorithms can provide high-quality partitioning results, they are less efficient when dealing with massive graph data and require a large amount of storage resources. Online partitioning algorithms, on the other hand, perform partitioning dynamically during the graph data loading process and are suitable for dynamic graphs or large-scale graph data. Typical representatives include LDG and FENNEL, etc. These algorithms reduce the preprocessing time through streaming processing, but the partitioning quality is often not as good as that of offline partitioning algorithms. In the distributed training of graph neural networks, the partitioning quality of graph data has a direct impact on the training efficiency and model performance. Existing graph partitioning algorithms fail to fully consider the demand for load balance of computing nodes in distributed training, resulting in low training efficiency and unbalanced load of computing nodes. Especially in supervised training, usually only some nodes are used during the training process. If these nodes are concentrated in some partitions and less distributed in other partitions, it will lead to different amounts of computation for computing nodes. The nodes with less computation will finish the computation in advance, thus causing resource waste and affecting the training efficiency. Summary of the Invention
[0004] The technical problem to be solved by the present invention: Aiming at the above problems of the prior art, the present invention provides a block-based graph data partitioning method and system for graph neural networks. The present invention aims to achieve efficient graph data partitioning, reduce the number of edges across partitions while ensuring the balanced distribution of training set nodes in each partition, and improve the training efficiency and load balance of distributed graph neural networks.
[0005] To solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0006] A block-based graph data partitioning method for graph neural networks, comprising the following steps:
[0007] S1, determining the number of partitions of the graph data according to the number of computing nodes;
[0008] S2, obtaining the neighbor nodes of each training set node in the graph data and constructing a neighborhood block;
[0009] S3. Process the neighborhood blocks corresponding to each training set node one by one. During the processing of each training set node, traverse all partitions, calculate the objective function for achieving the balanced distribution of training set nodes in each partition after all training set nodes in the neighborhood block of the training set node are added to the partition, and select the optimal partition according to the objective function. Finally, determine the partition allocation scheme for all nodes;
[0010] S4. According to the partition allocation scheme of all nodes, divide the graph data into multiple subgraphs and construct corresponding partitions to obtain the nodes, their edges, and feature information within the partitions;
[0011] S5. Deploy each partition to different computing nodes for training the graph neural network.
[0012] Optionally, when determining the number of partitions of the graph data according to the number of computing nodes in step S1, the number of partitions is less than or equal to the number of computing nodes.
[0013] Optionally, when obtaining the neighbor nodes of each training set node in the graph data and constructing the neighborhood block in step S2, it includes finding the training set nodes within the specified n-hop range from the training set node as the neighbor nodes of the training set node, and combining the training set node and its neighbor nodes to obtain the neighborhood block of the training set node.
[0014] Optionally, the objective function for achieving the balanced distribution of training set nodes in each partition in step S3 is a heuristic function regarding the number of cross-partition edges, node scale, and remaining node capacity of the partition, and this heuristic function is positively correlated with the number of cross-partition edges, negatively correlated with the node scale, and positively correlated with the remaining node capacity of the partition.
[0015] Optionally, the function expression of the heuristic function is:
[0016] ,
[0017] where, is the heuristic function, is the number of cross-partition edges of the partition after the node is added to the partition, is the node scale of the partition after the node is added to the partition, is the remaining node capacity of the partition, is the partition node capacity, is the number of nodes already allocated in the partition, and are weight coefficients, is the exponential coefficient.
[0018] Optionally, step S3 includes:
[0019] S3.1, Determine whether all nodes have been partitioned. If all nodes have been partitioned, jump to step S4; otherwise, traverse and select a training set node from the graph data as the current node, and jump to step S3.2;
[0020] S3.2, Determine whether all partitions have been traversed. If all partitions have been traversed, select the partition with the largest value of the heuristic function as the partition selected by the current node, and jump to step S3.1; otherwise, traverse and select a partition from the graph data as the current partition, and jump to step S3.3;
[0021] S3.3, Calculate the objective function for achieving the balanced distribution of training set nodes in each partition after the current node is added to the current partition; jump to step S3.2.
[0022] Optionally, when dividing the graph data into multiple subgraphs and constructing corresponding partitions in step S4, constructing the corresponding partitions includes:
[0023] S4.1, Add redundant nodes to each subgraph, and the addition range is the neighbor nodes within 1-hop of the training set nodes included in the subgraph;
[0024] S4.2, Establish a mapping relationship between the original node index and the partition node index to ensure the continuity of the partition node index for the graph neural network to obtain graph data during training;
[0025] S4.3, Save the feature vectors of the nodes and edges to the corresponding partitions according to the mapping relationship;
[0026] S4.4, Store the constructed partitions for the computing nodes to load and use during training.
[0027] In addition, the present invention also provides a block-based graph data partitioning system for a graph neural network, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the block-based graph data partitioning method for a graph neural network.
[0028] In addition, the present invention also provides a computer-readable storage medium, in which a computer program or instruction is stored, and the computer program or instruction is programmed or configured to execute the block-based graph data partitioning method for a graph neural network through a processor.
[0029] In addition, the present invention also provides a computer program product, including a computer program or instruction, and the computer program or instruction is programmed or configured to execute the block-based graph data partitioning method for a graph neural network through a processor.
[0030] Compared with the prior art, the present invention can mainly achieve the following beneficial effects: (1) Applicable to the partitioning scenario of large-scale graph data: The method proposed by the present invention can handle the partitioning problem of large-scale graph data, especially applicable to graph structures with a large number of nodes and complex edges. By reducing the number of cross-partition edges, the present invention can reduce the communication overhead in distributed training, thereby improving the overall training efficiency. (2) Dynamically adapt to changes in graph data: The present invention adopts a streaming partitioning method, which can perform real-time partitioning when graph data becomes gradually available or dynamically changes. This dynamic adaptability enables the present invention to cope with the dynamic updates of graph data and is applicable to real-time data processing scenarios such as social networks and recommendation systems. (3) Balance the load of computing nodes: The present invention optimizes the graph data partitioning strategy to ensure the balanced distribution of training set nodes in each partition. This balanced distribution can prevent some computing nodes from becoming performance bottlenecks due to overloading, and at the same time reduce the waiting time between computing nodes, thereby improving the parallel efficiency of distributed training. (4) Improve the efficiency of distributed training: The present invention improves the distributed training efficiency of the graph neural network model by balancing the cross-partition communication overhead and the load of computing nodes. In summary, the present invention can balance the cross-partition communication overhead and improve the distributed training efficiency of the graph neural network model through streaming partitioning and optimizing the graph data partitioning strategy, and is applicable to the processing scenario of large-scale graph data. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a schematic diagram of the basic process of the method according to the embodiment of the present invention.
[0032] Figure 2 It is a schematic diagram of the detailed flowchart of the method according to the embodiment of the present invention.
[0033] Figure 3 It is a schematic diagram of neighbor nodes within n-hop range and added redundant nodes in the embodiment of the present invention, where (a) is the topological structure of two partitions; (b) is the subgraph obtained by splitting the two partitions; (c) is the subgraph after adding redundant nodes.
[0034] Figure 4 It is a topological diagram of the distributed system for graph data partitioning and graph neural network model training in the embodiment of the present invention.
[0035] Figure 5 It is a box plot of the number of rounds for training three graph neural network models, namely GCN, GAT, and GraphSAGE, after partitioning the CoraFull dataset by the method of the embodiment of the present invention and the existing FENNEL, LDG, and RH methods, where (a) is the box plot of the number of rounds for GCN, (b) is the box plot of the number of rounds for GAT, and (c) is the box plot of the number of rounds for GraphSAGE.
[0036] Figure 6This is the box plot of the number of rounds for training three graph neural network models, namely GCN, GAT, and GraphSAGE, after the method of the embodiment of the present invention and the existing FENNEL, LDG, and RH methods divide the ogbn-arxiv dataset. Among them, (a) is the box plot of the number of rounds for GCN, (b) is the box plot of the number of rounds for GAT, and (c) is the box plot of the number of rounds for GraphSAGE.
[0037] Figure 7 This is the box plot of the number of rounds for training three graph neural network models, namely GCN, GAT, and GraphSAGE, after the method of the embodiment of the present invention and the existing FENNEL, LDG, and RH methods divide the Reddit dataset. Among them, (a) is the box plot of the number of rounds for GCN, (b) is the box plot of the number of rounds for GAT, and (c) is the box plot of the number of rounds for GraphSAGE.
[0038] Figure 8 This is the data transmission volume in the distributed system shown after the method of the embodiment of the present invention and the existing FENNEL, LDG, and RH methods divide the CoraFull dataset for training three graph neural network models, namely GCN, GAT, and GraphSAGE Figure 4 Among them, (a) is the data transmission volume of GCN, (b) is the data transmission volume of rounds for GAT, and (c) is the data transmission volume of GraphSAGE.
[0039] Figure 9 This is the data transmission volume in the distributed system shown after the method of the embodiment of the present invention and the existing FENNEL, LDG, and RH methods divide the ogbn-arxiv dataset for training three graph neural network models, namely GCN, GAT, and GraphSAGE Figure 4 Among them, (a) is the data transmission volume of GCN, (b) is the data transmission volume of GAT, and (c) is the data transmission volume of GraphSAGE.
[0040] Figure 10 This is the data transmission volume in the distributed system shown after the method of the embodiment of the present invention and the existing FENNEL, LDG, and RH methods divide the Reddit dataset for training three graph neural network models, namely GCN, GAT, and GraphSAGE Figure 4 Among them, (a) is the data transmission volume of GCN, (b) is the data transmission volume of GAT, and (c) is the data transmission volume of GraphSAGE. Detailed implementation manners
[0041] In order to enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions of the present invention will be further described in detail below with reference to the accompanying drawings in the embodiments of the present invention.
[0042] As Figure 1 shown, the block-based graph data partitioning method for graph neural networks in this embodiment includes the following steps:
[0043] S1. Determine the number of partitions of the graph data according to the number of computing nodes;
[0044] S2. Obtain the neighbor nodes of each training set node in the graph data and construct a neighborhood block;
[0045] S3. Process the neighborhood block corresponding to each training set node one by one. During the processing of each training set node, traverse all partitions, calculate the objective function for achieving the balanced distribution of training set nodes in each partition after adding all the training set nodes in the neighborhood block of the training set node to the partition, and select the optimal partition according to the objective function, and finally determine the partition assignment scheme for all nodes;
[0046] S4. According to the partition assignment scheme of all nodes, divide the graph data into multiple subgraphs and construct corresponding partitions to obtain the nodes, their edges and feature information within the partitions;
[0047] S5. Deploy each partition to different computing nodes for training graph neural networks.
[0048] When determining the number of partitions of the graph data according to the number of computing nodes in step S1 of this embodiment, the number of partitions is less than or equal to the number of computing nodes.
[0049] When obtaining the neighbor nodes of each training set node in the graph data and constructing a neighborhood block in step S2 of this embodiment, it includes finding the training set nodes within the specified n-hop range from the training set node as the neighbor nodes of the training set node, and combining the training set node and its neighbor nodes to obtain the neighborhood block of the training set node.
[0050] The objective function for achieving the balanced distribution of training set nodes in each partition can evaluate the impact of the number of cross - partition edges, node scale, and remaining node capacity of the partition after all training set nodes in the neighborhood block of the training set node are added to the partition. Among them, the number of cross - partition edges and the remaining node capacity of the partition are related to the load balance between the computing nodes corresponding to the partition, and the number of cross - partition edges is related to the data communication between the computing nodes corresponding to the partition. As an alternative implementation, the objective function for achieving the balanced distribution of training set nodes in each partition in step S3 of this embodiment is a heuristic function regarding the number of cross - partition edges, node scale, and remaining node capacity of the partition. And this heuristic function is positively correlated with the number of cross - partition edges, negatively correlated with the node scale, and positively correlated with the remaining node capacity of the partition. In this embodiment, the number of cross - partition edges, node scale, and remaining node capacity of the partition after all training set nodes in the neighborhood block of the training set node are added to the partition. The number of cross - partition edges is denoted as and is represented by the symbol ; the node scale is denoted as and is represented by the symbol ; the remaining node capacity of the partition is composed of the difference between the partition node capacity and the number of nodes already allocated in the partition. Among them, the partition node capacity is denoted as and is represented by the symbol ; the number of nodes already allocated in the partition is denoted as and is represented by the symbol , then the remaining node capacity of the partition is expressed as:
[0051] .
[0052] As an alternative implementation, the functional expression of the heuristic function in this embodiment is:
[0053] ,
[0054] where is the heuristic function, is the number of cross - partition edges of the partition after the node is added to the partition, is the node scale of the partition after the node is added to the partition, is the remaining node capacity of the partition, is the partition node capacity, is the number of nodes already allocated in the partition, and are weight coefficients (greater than 0), is the exponential coefficient (greater than 0). Through the above - mentioned heuristic function, it is possible to select the partition that minimizes the number of cross - partition edges and evenly distributes the training set nodes in each partition.
[0055] For example Figure 2As shown in the figure, step S3 in this embodiment includes:
[0056] S3.1, determine whether all nodes have been partitioned. If all nodes have been partitioned, jump to step S4; otherwise, traverse and select a training set node from the graph data as the current node, and jump to step S3.2;
[0057] S3.2, determine whether all partitions have been traversed. If all partitions have been traversed, select the partition with the largest value of the heuristic function as the partition selected by the current node, and jump to step S3.1; otherwise, traverse and select a partition from the graph data as the current partition, and jump to step S3.3;
[0058] S3.3, calculate the objective function for achieving the balanced distribution of training set nodes in each partition after the current node is added to the current partition; jump to step S3.2. See Figure 2 , calculating the objective function for achieving the balanced distribution of training set nodes in each partition after the current node is added to the current partition includes respectively calculating the number of cross-partition edges, node scale, and remaining node capacity of the partition after the current node is added to the current partition, and then calculating the value of the heuristic function in combination with the number of cross-partition edges, node scale, and remaining node capacity of the partition after the current node is added to the current partition.
[0059] When partitioning the graph data into multiple subgraphs and constructing corresponding partitions in step S4 of this embodiment, constructing partitions includes dividing the graph data into multiple subgraphs according to the node allocation scheme, adding redundant nodes to the subgraphs to construct partitions, mapping the node indexes in the partitions, and adding the feature vectors of the nodes and their related edges, and finally storing the partitions. Specifically see Figure 2 , constructing the corresponding partitions in this embodiment includes:
[0060] S4.1, add redundant nodes to each subgraph, and the addition range is the neighbor nodes within 1-hop of the training set nodes included in the subgraph; Figure 3 This is a schematic diagram of neighbor nodes within n-hop and added redundant nodes in this embodiment, Figure 3 In (a) of Figure 3 is the topological structure of two partitions; the edges of neighbor nodes within 1-hop of the two partitions are marked with scissors in Figure 1 and the subgraphs obtained by dividing the two partitions are sub- Figure 2 and sub- Figure 3 respectively, as shown in (b) of Figure 1 and sub- Figure 2 respectively. Add the neighbor nodes within 1-hop of the training set nodes included in sub- Figure 3 and sub-
[0061] S4.2. Establish the mapping relationship between the original node index and the partition node index to ensure the continuity of the partition node index for the graph neural network to obtain graph data during training;
[0062] S4.3. Save the feature vectors of nodes and edges into the corresponding partitions according to the mapping relationship;
[0063] S4.4. Store the constructed partitions for the computing nodes to load and use during training.
[0064] When deploying each partition to different computing nodes for graph neural network training in step S5 of this embodiment, it also includes detecting the CPU usage rate and memory usage rate of each computing node, sorting all computing nodes according to the ascending priority of CPU usage rate and memory usage rate, then selecting the top K computing nodes according to the number K of scores, and deploying each partition to different computing nodes among the selected K computing nodes for graph neural network training.
[0065] To verify the block-based graph data partitioning method for graph neural network in this embodiment, in this embodiment, the existing methods FENNEL, LDG, RH (RandomHash) and the partitioning method of this embodiment (this method) are used to partition the CoraFull, ogbn-arxiv and Reddit data sets, and the results are stored in Figure 3 the NFS server of the distributed system. The distributed system includes an NFS server and 4 computing nodes as NFS clients. Among the CoraFull and ogbn-arxiv data sets, the nodes of the graph data are academic papers, and the edges are citation relationships between academic papers; in the Reddit data set, the nodes of the graph data are users or posts, and the edges are interaction (comments, likes, etc.) relationships between users or posts. These graph data are used as the input of the graph neural network and can be used for node classification, similar node recommendation / clustering of nodes, etc. Use Figure 3 the distributed system to perform distributed training on three graph neural network models, GCN, GAT and GraphSAGE, and collect the training time (epoch time) of each epoch and the data transfer volume in the distributed system from the 2nd epoch to the 50th epoch. The results are as Figures 5 to 10 shown. Among them, Figure 5 is the box plot of the epoch time for training three graph neural network models, GCN, GAT and GraphSAGE, after partitioning the CoraFull data set by FENNEL, LDG, RH and the partitioning method of this embodiment in this embodiment. Figure 6The box plot of the number of rounds for training three graph neural network models, namely GCN, GAT, and GraphSAGE, after the ogbn-arxiv dataset is partitioned by FENNEL, LDG, RH, and the partitioning method of this embodiment in this embodiment. Figure 7 The box plot of the number of rounds for training three graph neural network models, namely GCN, GAT, and GraphSAGE, after the Reddit dataset is partitioned by FENNEL, LDG, RH, and the partitioning method of this embodiment in this embodiment. Figure 8 For the data transmission volume in the distributed system shown when the CoraFull dataset is partitioned by FENNEL, LDG, RH, and the partitioning method of this embodiment in this embodiment for training three graph neural network models, namely GCN, GAT, and GraphSAGE Figure 4 in this embodiment. Figure 9 For the data transmission volume in the distributed system shown when the ogbn-arxiv dataset is partitioned by FENNEL, LDG, RH, and the partitioning method of this embodiment in this embodiment for training three graph neural network models, namely GCN, GAT, and GraphSAGE Figure 4 in this embodiment. Figure 10 For the data transmission volume in the distributed system shown when the Reddit dataset is partitioned by FENNEL, LDG, RH, and the partitioning method of this embodiment in this embodiment for training three graph neural network models, namely GCN, GAT, and GraphSAGE Figure 4 in this embodiment. As can be seen from Figures 5 to 10 it, compared with the existing FENNEL, LDG, RH methods, when the partitioning method of this embodiment (this method) is applied to the three graph neural networks of GCN, GAT, and GraphSAGE, the number of rounds and data transmission volume during training on the CoraFull, ogbn-arxiv, and Reddit datasets are all better than the existing FENNEL, LDG, RH methods. It can be seen that the block-based graph data partitioning method for graph neural networks in this embodiment constructs blocks by combining the nodes to be processed and their neighbor nodes, reduces the number of cross-partition edges, and uses a heuristic method to maintain the balanced distribution of training set nodes in each partition, thereby reducing the imbalance degree of the computational node load in the distributed training of graph neural network models. The block-based graph data partitioning method for graph neural networks in this embodiment optimizes the partitioning strategy of graph data to ensure the balanced distribution of training set nodes in each partition and balance the overhead of cross-partition communication. The block-based graph data partitioning method for graph neural networks in this embodiment is applicable to the distributed training scenario of graph neural network models for large-scale graph data, can reduce the load imbalance between computational nodes, and thus improve the distributed training efficiency of graph neural network models.
[0066] In addition, this embodiment also provides a block-based graph data partitioning system for a graph neural network, including a microprocessor and a memory connected to each other, where the microprocessor is programmed or configured to execute the block-based graph data partitioning method for the graph neural network.
[0067] In addition, this embodiment also provides a computer-readable storage medium storing a computer program or instruction, which is programmed or configured to execute the block-based graph data partitioning method for the graph neural network through a processor.
[0068] In addition, this embodiment also provides a computer program product including a computer program or instruction, which is programmed or configured to execute the block-based graph data partitioning method for the graph neural network through a processor.
[0069] Those skilled in the art should understand that the technical solution provided by the present invention can be in the form of a method, a system, or a computer program product. Therefore, the present invention can be implemented in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can be in the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes. The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for realizing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks. These computer program instructions can also be stored in a computer-readable memory capable of guiding the computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means realizes the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks. These computer program instructions can also be loaded onto the computer or other programmable data processing devices, so that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable devices provide means for realizing the functions in the processFigure 1 One process or multiple processes and / or boxes Figure 1 Steps of the functions specified in one box or multiple boxes.
[0070] The above is only the preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions within the idea of the present invention belong to the protection scope of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A block-based graph data partitioning method for graph neural networks, characterized in that It includes the following steps: S1. Determine the number of partitions of the graph data according to the number of computing nodes; S2. Obtain the neighbor nodes for each training set node in the graph data and construct neighborhood blocks; S3. Process the neighborhood blocks corresponding to each training set node one by one. During the processing of each training set node, traverse all partitions, calculate the objective function for achieving the balanced distribution of training set nodes in each partition after all training set nodes in the neighborhood block of the training set node are added to the partition, and select the optimal partition according to the objective function. Finally, determine the partition assignment scheme for all nodes; S4. Divide the graph data into multiple subgraphs and construct corresponding partitions according to the partition assignment scheme of all nodes to obtain the nodes, their edges, and feature information within the partitions; S5. Deploy each partition to different computing nodes for graph neural network training; The objective function for achieving the balanced distribution of training set nodes in each partition in step S3 is a heuristic function regarding the number of cross-partition edges, node scale, and remaining node capacity of the partition. And this heuristic function is positively correlated with the number of cross-partition edges, negatively correlated with the node scale, and positively correlated with the remaining node capacity of the partition; Step S3 includes: S3.
1. Determine whether all nodes have been partitioned. If all nodes have been partitioned, jump to step S4; otherwise, traverse and select a training set node from the graph data as the current node, and jump to step S3.2; S3.
2. Determine whether all partitions have been traversed. If all partitions have been traversed, select the partition with the largest value of the heuristic function as the partition selected by the current node, and jump to step S3.1; otherwise, traverse and select a partition from the graph data as the current partition, and jump to step S3.3; S3.
3. Calculate the objective function for achieving the balanced distribution of training set nodes in each partition after the current node is added to the current partition; jump to step S3.
2.
2. The block-based graph data partitioning method for graph neural networks according to claim 1, wherein When determining the number of partitions of the graph data according to the number of computing nodes in step S1, the number of partitions is less than or equal to the number of computing nodes.
3. The block-based graph data partitioning method for graph neural networks according to claim 1, characterized in that, When obtaining the neighbor nodes for each training set node in the graph data and constructing neighborhood blocks in step S2, it includes finding the training set nodes within the specified n-hop range from the training set node as the neighbor nodes of the training set node, and combining the training set node and its neighbor nodes to obtain the neighborhood block of the training set node.
4. The block-based graph data partitioning method for graph neural networks according to claim 1, wherein The functional expression of the heuristic function is: , Among them, is a heuristic function, is the number of cross-partition edges of the partition after the node is added to the partition, is the node scale of the partition after the node is added to the partition, is the remaining node capacity of the partition, is the node capacity of the partition, is the number of nodes already allocated in the partition, and is a weight coefficient, is an exponential coefficient.
5. The block-based graph data partitioning method for graph neural networks according to claim 2, wherein When dividing the graph data into multiple subgraphs and constructing corresponding partitions in step S4, constructing the corresponding partitions includes: S4.
1. Add redundant nodes to each subgraph, and the addition range is the neighbor nodes within 1-hop of the training set nodes included in the subgraph; S4.
2. Establish the mapping relationship between the original node index and the partition node index to ensure the continuity of the partition node index for the graph neural network to obtain graph data during training; S4.
3. Save the feature vectors of the nodes and edges to the corresponding partitions according to the mapping relationship; S4.
4. Store the constructed partitions for the computing nodes to load and use during training.
6. A block-based graph data partitioning system for graph neural networks, comprising a microprocessor and a memory connected to each other, characterized in that, The microprocessor is programmed or configured to execute the block-based graph data partitioning method for graph neural networks according to any one of claims 1 to 5.
7. A computer-readable storage medium storing a computer program or instructions, characterized in that, The computer program or instruction is programmed or configured to execute the block-based graph data partitioning method for graph neural networks according to any one of claims 1 to 5 through a processor.
8. A computer program product, comprising a computer program or instructions, characterized in that, The computer program or instruction is programmed or configured to execute the block-based graph data partitioning method for graph neural networks according to any one of claims 1 to 5 through a processor.
Citation Information
Patent Citations
Balanced division method for large-scale graph data
CN115587219A
Method, apparatus and system for training graph neural network
WO2022057310A1