Graph neural network-oriented block-based graph data partitioning method and system
By adopting a block-based graph data division method in the distributed training of graph neural networks, and using heuristic functions to optimize node partitions, the problem of unbalanced computing nodes is solved, and training efficiency and parallel efficiency are improved.
Patent Information
- Application Number
- CN202510560015.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2045-04-30
AI Technical Summary
When processing large-scale graph data, the existing graph data division algorithm fails to fully consider the need for computing node load balancing in distributed training, resulting in low training efficiency and unbalanced computing node load.
A block-based graph data division method for graph neural network is adopted. By constructing neighboring blocks of each training set node and optimizing node partitions using heuristic functions, we ensure the balanced distribution of training set nodes in each partition.
This method can effectively reduce the number of cross-partition edges, reduce communication overhead in distributed training, improve training efficiency, and improve the parallel efficiency of distributed training by balancing the computing node load.
Smart Images

Figure CN120086024A_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 address these issues, researchers have proposed various techniques, including sampling, caching, and distributed training. Among them, distributed training improves the training efficiency through data parallelism by partitioning the graph data across multiple computing nodes, becoming 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 the large-scale graph data across 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. 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. These algorithms reduce the preprocessing time through streaming processing, but their 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 computational amounts of computing nodes. The nodes with less computational amount will finish the calculation 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: A block-based graph data partitioning method for graph neural networks, comprising the following steps: S1, determining the number of partitions of the graph data according to the number of computing nodes; S2, obtaining the neighbor nodes of each training set node in the graph data and constructing a neighborhood block; 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 current 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. According to the partition assignment scheme of all nodes, divide the graph data into multiple subgraphs and construct corresponding partitions to obtain the nodes within the partitions and their edge and feature information; S5. Deploy each partition to different computing nodes for training the graph neural network.
[0006] 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.
[0007] 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 current training set node as the neighbor nodes of the current training set node, and combining the current training set node and its neighbor nodes to obtain the neighborhood block of the current training set node.
[0008] 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.
[0009] Optionally, the functional expression of the heuristic function is: , 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 node capacity of the partition, is the number of nodes already assigned to the partition, and are weight coefficients, is the exponential coefficient.
[0010] Optionally, 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 heuristic function value 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.
[0011] Optionally, 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 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; S4.3. According to the mapping relationship, save the feature vectors of nodes and edges to the corresponding partitions; S4.4. Store the constructed partitions for the computing nodes to load and use during training.
[0012] 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.
[0013] 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.
[0014] 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.
[0015] 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
[0016] Figure 1 It is a schematic diagram of the basic process of the method according to the embodiment of the present invention.
[0017] Figure 2 It is a schematic diagram of the detailed flowchart of the method according to the embodiment of the present invention.
[0018] 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 dividing the two partitions; (c) is the subgraph after adding redundant nodes.
[0019] 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.
[0020] 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.
[0021] Figure 6The box plot of the number of rounds for training three graph neural network models, namely GCN, GAT, and GraphSAGE, after partitioning the ogbn-arxiv dataset using the method of the embodiment of the present invention and the existing FENNEL, LDG, and RH methods. 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.
[0022] Figure 7 The box plot of the number of rounds for training three graph neural network models, namely GCN, GAT, and GraphSAGE, after partitioning the Reddit dataset using the method of the embodiment of the present invention and the existing FENNEL, LDG, and RH methods. 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.
[0023] Figure 8 The data transmission volume in the distributed system shown when training three graph neural network models, namely GCN, GAT, and GraphSAGE, after partitioning the CoraFull dataset using the method of the embodiment of the present invention and the existing FENNEL, LDG, and RH methods Figure 4 where (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.
[0024] Figure 9 The data transmission volume in the distributed system shown when training three graph neural network models, namely GCN, GAT, and GraphSAGE, after partitioning the ogbn-arxiv dataset using the method of the embodiment of the present invention and the existing FENNEL, LDG, and RH methods Figure 4 where (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.
[0025] Figure 10 The data transmission volume in the distributed system shown when training three graph neural network models, namely GCN, GAT, and GraphSAGE, after partitioning the Reddit dataset using the method of the embodiment of the present invention and the existing FENNEL, LDG, and RH methods Figure 4 where (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
[0026] In order to enable those skilled in the art to better understand the technical solution of the present invention, the technical solution of the present invention will be further described in detail below with reference to the accompanying drawings in the embodiments of the present invention.
[0027] As Figure 1 shown, the block-based graph data partitioning method for graph neural networks in this embodiment 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 of each training set node in the graph data and construct a neighborhood block; 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 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, and finally determine the partition assignment scheme for all nodes; 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; S5. Deploy each partition to different computing nodes for training graph neural networks.
[0028] 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.
[0029] 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.
[0030] 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 partitions, and the number of cross-partition edges is related to the data communication between the computing nodes corresponding to the partitions. 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 as ; 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, where 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: .
[0031] As an alternative implementation, the functional expression of the heuristic function in this embodiment is: , where, is the heuristic function, is the number of cross-partition edges of the partition after the node joins the partition, is the node scale of the partition after the node joins 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 heuristic function, it is possible to select a partition that minimizes the number of cross-partition edges and evenly distributes the training set nodes among the partitions.
[0032] As Figure 2 shown, step S3 in this embodiment 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 evenly distributing the training set nodes among the partitions after the current node joins the current partition; jump to step S3.2. See Figure 2, calculating the objective function for realizing 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, the node scale, and the 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 by combining the number of cross - partition edges, the node scale, and the remaining node capacity of the partition after the current node is added to the current partition.
[0033] When dividing the graph data into multiple sub - graphs and constructing corresponding partitions in step S4 of this embodiment, constructing partitions includes dividing the graph data into multiple sub - graphs according to the node allocation scheme, adding redundant nodes to the sub - graphs 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 corresponding partitions in this embodiment includes: S4.1, adding redundant nodes to each sub - graph, and the adding range is the neighbor nodes within 1 - hop of the training set nodes included in the sub - graph; Figure 3 is a schematic diagram of neighbor nodes within n - hop and added redundant nodes in this embodiment, Figure 3 in which (a) 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 3 ; the sub - graphs obtained by dividing the two partitions are sub - Figure 1 and sub - Figure 2 , as shown in (b) of Figure 3 . Respectively for sub - Figure 1 and sub - Figure 2 , add neighbor nodes within 1 - hop of the training set nodes included, and the result is shown in (c) of Figure 3 ; S4.2, establishing the mapping relationship between the original node indexes and the partition node indexes to ensure the continuity of the partition node indexes for the graph neural network to obtain graph data during the training process; S4.3, saving the feature vectors of the nodes and edges to the corresponding partitions according to the mapping relationship; S4.4, storing the constructed partitions for the computing nodes to load and use during the training process.
[0034] 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 the CPU usage rate and memory usage rate, and 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.
[0035] To verify the block-based graph data partitioning method for graph neural networks 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 datasets, 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. In the CoraFull and ogbn-arxiv datasets, the nodes of the graph data are academic papers, and the edges are citation relationships between academic papers; in the Reddit dataset, the nodes of the graph data are users or posts, and the edges are interaction (commenting, liking, etc.) relationships between users or posts. These graph data are used as inputs for graph neural networks and can be used for node classification, similar node recommendation / clustering of nodes, etc. Using 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) and data transfer volume in the distributed system for each epoch 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 the three graph neural network models, GCN, GAT, and GraphSAGE, after partitioning the CoraFull dataset using FENNEL, LDG, RH, and the partitioning method of this embodiment in this embodiment. Figure 6 is the box plot of the epoch time for training the three graph neural network models, GCN, GAT, and GraphSAGE, after partitioning the ogbn-arxiv dataset using FENNEL, LDG, RH, and the partitioning method of this embodiment in this embodiment. Figure 7 is the box plot of the epoch time for training the three graph neural network models, GCN, GAT, and GraphSAGE, after partitioning the Reddit dataset using FENNEL, LDG, RH, and the partitioning method of this embodiment in this embodiment. Figure 8 is the data transfer volume in the distributed system shown when training the three graph neural network models, GCN, GAT, and GraphSAGE, after partitioning the CoraFull dataset using FENNEL, LDG, RH, and the partitioning method of this embodiment in this embodiment Figure 4 in this embodiment. Figure 9 is the data transfer volume in the distributed system shown when training the three graph neural network models, GCN, GAT, and GraphSAGE, after partitioning the ogbn-arxiv dataset using FENNEL, LDG, RH, and the partitioning method of this embodiment in this embodiment Figure 4 in this embodiment. Figure 10After the Reddit dataset is partitioned by FENNEL, LDG, RH, and the partitioning method of this embodiment in this embodiment, it is used for training three graph neural network models, namely GCN, GAT, and GraphSAGE Figure 4 The data transmission volume in the distributed system shown. From Figures 5 to 10 It can be seen that compared with the existing FENNEL, LDG, and 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 round time and data transmission volume during training on the CoraFull, ogbn-arxiv, and Reddit datasets are better than the existing FENNEL, LDG, and RH methods. It can be seen that the block-based graph data partitioning method for graph neural networks in this embodiment reduces the number of cross-partition edges by constructing the nodes to be processed and their neighbor nodes into blocks and uses a heuristic method to keep the training set nodes evenly distributed in each partition, thereby reducing the degree of imbalance in the computing node load during the distributed training of the graph neural network model. The block-based graph data partitioning method for graph neural networks in this embodiment optimizes the partitioning strategy of graph data to ensure the even 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 computing nodes, and thus improve the distributed training efficiency of graph neural network models.
[0036] In addition, this embodiment also provides a block-based graph data partitioning system for graph neural networks, 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 graph neural networks.
[0037] In addition, this embodiment 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 graph neural networks through a processor.
[0038] In addition, this embodiment 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 graph neural networks through a processor.
[0039] Those skilled in the art should understand that the technical solutions 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 memory, CD-ROM, optical memory, etc.) containing computer-usable program code. 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, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented 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 implementing the functions specified in the process 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 that can direct a computer or other programmable data processing device 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 implements the functions specified in the process 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 a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Therefore, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the process Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0040] 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 in this technical field, several improvements and refinements made without departing from the principle of the present invention should also be regarded as within the protection scope of the present invention.
Claims
1. A block-based graph data partitioning method for graph neural networks, characterized in that: The steps include: S1, determine the number of partitions of graph data according to the number of computing nodes; S2, obtain the neighbor nodes for each training set node in the graph data and build a neighborhood block; S3, process the neighborhood blocks corresponding to each training set node one by one, traverse all partitions during the processing of each training set node, calculate the objective function for achieving balanced distribution of training set nodes in each partition after all training set nodes in the neighborhood blocks of the training set node are added to the partition, select the optimal partition according to the objective function, and finally determine the partition allocation scheme for all nodes; S4, according to the partition allocation scheme of all nodes, the graph data is divided into multiple subgraphs and corresponding partitions are constructed to obtain the nodes and their edges and feature information in the partitions; S5, deploy each partition to different computing nodes for training the graph neural network.
2. The block-based graph data partitioning method for graph neural network according to claim 1, characterized in that: 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 network according to claim 1, characterized in that: When obtaining neighbor nodes for each training set node in the graph data and constructing a neighborhood block in step S2, it includes searching for training set nodes within a specified n-hop range of the training set node as neighbor nodes of the training set node for each training set node in the graph data, and combining the training set node and its neighbor nodes to obtain a neighborhood block of the training set node.
4. The block-based graph data partitioning method for graph neural network according to claim 1, characterized in that: The objective function used in step S3 to achieve balanced distribution of training set nodes in each partition is a heuristic function about the number of cross-partition edges, node scale and the remaining node capacity of the partition, and the 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.
5. The block-based graph data partitioning method for graph neural network according to claim 4 is characterized in that: The function expression of the heuristic function is: , in, is the heuristic function, The number of cross-partition edges after adding the node to the partition, The node size of the partition after the node is added to the partition, is the remaining node capacity of the partition, is the partition node capacity, The number of nodes that have been allocated for the partition, and is the weight coefficient, is the exponential coefficient.
6. The block-based graph data partitioning method for graph neural network according to claim 4 or 5, characterized in that: Step S3 includes: S3.1, determine whether all nodes have been divided. If all nodes have been divided, 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 balanced distribution of training set nodes in each partition after the current node is added to the current partition; jump to step S3.
2.
7. The block-based graph data partitioning method for graph neural network according to claim 2, characterized in that: When the graph data is divided into a plurality of subgraphs and corresponding partitions are constructed in step S4, the construction of the corresponding partitions includes: S4.1, add redundant nodes to each subgraph, and the adding range is the neighboring nodes within the 1-hop range of the training set nodes contained in the subgraph; S4.2, establishing a mapping relationship between the original node index and the partition node index to ensure the continuity of the partition node index, so as to be used for the graph neural network to obtain graph data during the training process; S4.3, according to the mapping relationship, save the feature vectors of the nodes and edges into corresponding partitions; S4.4, stores the constructed partitions for the computing nodes to load and use during the training process.
8. A block-based graph data partitioning system for a graph neural network, 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 as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program or instruction stored therein, characterized in that: The computer program or instructions are programmed or configured to execute the block-based graph data partitioning method for graph neural networks as described in any one of claims 1 to 7 through a processor.
10. A computer program product comprising a computer program or instructions, characterized in that The computer program or instructions are programmed or configured to execute the block-based graph data partitioning method for graph neural networks as described in any one of claims 1 to 7 through a processor.
Citation Information
Patent Citations
Balanced division method for large-scale graph data
CN115587219A
Region type determination method, training method and device based on graph data
CN119167107A
Graph neural network partitioning method based on heterogeneous GPU load balancing
CN119311414A
Methods and devices for node distribution
US20120317275A1
Scheduling computation graphs using neural networks
US20200293838A1
Cited By
Graph division method and system for graph neural network reasoning in heterogeneous edge scene
CN120371541A
Graph partitioning method and system for graph neural network reasoning in heterogeneous edge scenarios
CN120371541B
Graph division method and system oriented to heterogeneous environment graph neural network and based on degree classification
CN120597932A
AVX-based large-scale GNN distributed training optimization method
CN120762760A