Graph partitioning method and system for graph neural network reasoning in heterogeneous edge scenarios
By evaluating the device reasoning capabilities in heterogeneous edge environments and adopting hierarchical seed progression and streaming greedy allocation strategies, the load imbalance problem in graph neural network reasoning is solved, and the reasoning efficiency and resource utilization are improved.
Patent Information
- Application Number
- CN202510865703.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-06-26
AI Technical Summary
In heterogeneous edge environments, graph neural network reasoning tasks suffer from load imbalance and low reasoning efficiency due to device heterogeneity and defects in traditional graph partitioning methods. Existing evaluation methods are difficult to accurately evaluate device computing power and ignore the reasoning characteristics of graph neural networks.
Through benchmark testing, we evaluate the graph neural network reasoning capability of edge devices, adopt the descending order arrangement of graph data vertices and the hierarchical seed progressive allocation strategy, combined with the streaming greedy allocation strategy, to optimize the graph partitioning process to achieve load balancing.
It effectively improves the efficiency of graph neural network reasoning in heterogeneous edge environments, and achieves load balancing and resource utilization by accurately evaluating device computing power and optimizing message transmission.
Smart Images

Figure CN120371541B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of edge deployment technology of graph neural networks, and specifically to a graph partitioning method and system for graph neural network reasoning in heterogeneous edge scenarios. Background Art
[0002] Graph Neural Networks (GNNs) deployed at the edge have become the mainstream paradigm for on-device graph reasoning tasks, demonstrating remarkable performance in applications such as point cloud processing, autonomous driving, and privacy-sensitive information processing. This is due to GNNs' superior ability to represent graph-structured data, the continuous improvement of edge hardware performance, and the rapid development of open-source GNN computing libraries such as PyG and DGL. However, due to the limited computing resources and memory capacity of edge devices, many GNN inference tasks still cannot meet the requirements of real-time inference. Therefore, accelerating edge GNN inference through distributed technologies has become a research hotspot.
[0003] As the current mainstream graph neural network processing libraries, PyG and DGL are widely used in distributed edge graph neural network inference scenarios. In these two libraries, METIS, as the only default graph partitioning algorithm, is responsible for dividing the input graph into multiple subgraphs. PyG or DGL then distributes each subgraph to different devices for graph neural network inference. However, both PyG and DGL adopt a balanced partitioning strategy by default, and do not fully consider the device heterogeneity, an inherent characteristic of the edge environment. This heterogeneity stems from multiple factors such as hardware generation differences, application requirements, cost-oriented design limitations, and dynamic deployment conditions. This results in an unbalanced graph neural network inference load on each device in a heterogeneous edge environment, seriously affecting the overall inference efficiency.
[0004] Currently, graph partitioning for GNN inference in heterogeneous edge environments faces two core challenges. First, evaluating the computing power of edge devices executing GNN inference is difficult. This is because the hardware heterogeneity of edge devices (such as processors and memory) makes it difficult to determine standardized evaluation metrics. Existing evaluation methods mostly rely on single metrics (such as FLOPs), which cannot comprehensively evaluate the complex mathematical computations of GNNs. Furthermore, the randomness of GNN cross-device sampling and the dynamic nature of communication networks in distributed environments lead to unpredictable latency, further complicating accurate evaluation. Second, identifying and leveraging the inference characteristics of GNNs to guide the design of graph partitioning algorithms remains a challenge. Existing graph partitioning algorithms fail to consider specific operations of GNN inference (such as neighbor sampling and message passing) during distributed GNN execution. As a result, subgraphs partitioned by traditional graph partitioning algorithms cannot achieve optimal message passing during inference. Summary of the Invention
[0005] Technical problem to be solved by the present invention: In response to the above-mentioned problems of the prior art, a graph partitioning method and system for graph neural network reasoning in heterogeneous edge scenarios are provided. The present invention aims to solve the problems of load imbalance and low reasoning efficiency in edge graph neural network reasoning scenarios caused by device heterogeneity and defects of traditional graph partitioning methods.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0007] A graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios includes the following steps:
[0008] S101, evaluates the graph neural network reasoning capabilities of edge devices in a distributed environment through benchmark testing;
[0009] S102, divide the input graph data into graphs according to the graph neural network reasoning capability ratio of edge devices in a distributed environment. The partitions corresponding to the edge devices include: arranging the vertices in the graph data in descending order according to the degree of the vertices and filtering the first-order seeds and second-order seeds; randomly assigning partitions to the first-order seeds and their second-order neighbor blocks; building a deep expansion tree for the second-order neighbor blocks of the second-order seeds and assigning partitions by block based on the proportion of the graph neural network reasoning capabilities of the edge devices in a distributed environment; and assigning partitions to the remaining unassigned vertices using a streaming greedy allocation strategy.
[0010] Optionally, step S101 includes:
[0011] S201, constructing a benchmark test data set, wherein the benchmark test data set includes different topological structures and different types A graph dataset, wherein the different topological structures refer to the number of vertices, the number of edges, the average degree of vertices, and some or all of the characteristic dimensions of the vertices being the same;
[0012] S202: For each graph dataset, the edge-cut graph partitioning method METIS is used to divide the graph dataset into non-overlapping partitions, where is the total number of edge devices in the distributed environment;
[0013] S203, perform graph neural network reasoning on the benchmark dataset through a distributed environment, and calculate any edge device according to the following formula Reasoning on arbitrary graph datasets The ability to partition :
[0014] ,
[0015] in, For the dataset Partition to edge devices The number of vertices in non-overlapping partitions of , For edge devices Inference dataset The time of the partition;
[0016] S204, calculate any edge device according to the following formula In any graph dataset The proportion of graph neural network reasoning capabilities on :
[0017] ;
[0018] S205: Build a graph neural network reasoning capability matrix based on the graph neural network reasoning capability ratio, and calculate the value of any edge device according to the following formula: The proportion of graph neural network reasoning capabilities in a distributed environment :
[0019] ,
[0020] in, is the number of graph datasets in the benchmark dataset.
[0021] Optionally, different types of In this graph dataset, the graph data types involved include knowledge graphs, citation networks, e-commerce networks, open source community networks, social networks, financial transaction networks, and parts or internal parts of academic cooperation networks.
[0022] Optionally, in step S102, arranging the vertices in the graph data in descending order of their degrees and screening the first-order seeds and the second-order seeds includes:
[0023] S301, sorting the vertices in the graph data in descending order of their degrees;
[0024] S302, selecting a preset ratio from the vertex set arranged in descending order The vertices of ;
[0025] S303, from the seed vertex set Before selection The vertices with the highest degree are taken as first-order seeds, and the remaining vertices as second-order seeds, where is the total number of edge devices in the distributed environment, is the seed vertex set The number of seed vertices in .
[0026] Optionally, when randomly allocating partitions to the first-order seeds and their second-order neighbor blocks in step S102, the following steps are included: for the first-order seeds, they are preferentially allocated to the partition with the largest capacity according to the size of the degree; for the second-order neighbor blocks of the first-order seeds, the proportion of the graph neural network reasoning capability of the edge device in the distributed environment is used as the probability of allocating the second-order neighbor blocks to the edge device, so that the second-order neighbor blocks of each first-order seed are randomly allocated to the distributed environment according to the probability. The partition corresponding to each edge device.
[0027] Optionally, in step S102, when constructing a deep expansion tree for the second-order neighbor block of the second-order seed and allocating partitions by block according to the graph neural network reasoning capability ratio of the edge device in a distributed environment, each allocated second-order seed in the second-order neighbor block of the first-order seed is included. , collect the second-level seeds The set of vertices in the second-order neighbor block that have not been assigned , if the set If the size of is 0, then exit the processing of the second-order neighbor block of the second-order seed and enter the partitioning phase using the streaming greedy allocation strategy for the remaining unassigned vertices; otherwise, according to the following formula, Assign partitions:
[0028] ,
[0029] in, Indicates the allocated partition, is the mth partition, is the number of vertices that the mth partition can accommodate, is the number of vertices in the mth partition, is the number of vertices that the j-th partition can accommodate, is the jth partition, is the number of vertices in the jth partition, and the calculation function expression for the number of vertices that any partition can accommodate is:
[0030] ,
[0031] in, is the number of vertices that the mth partition can accommodate, is the number of vertices in the graph dataset, For edge devices The proportion of graph neural network reasoning capabilities in a distributed environment, with the mth partition being the edge device The corresponding partition.
[0032] Optionally, when the remaining unassigned vertices are assigned partitions using the streaming greedy assignment strategy in step S102, any vertex The streaming greedy allocation strategy to allocate partitions includes:
[0033] S401, collect the included vertices Partitioned set of assigned first-order neighbors ,in, is the jth partition;
[0034] S402, if the partition set If not empty, jump to step S403; otherwise, jump to step S405;
[0035] S403, for partition set , calculate the number of neighbors for each partition according to the following formula:
[0036] ,
[0037] in, is the number of neighbors of the jth partition, Vertex Allocated first-order neighbor blocks, is the vertex;
[0038] S404, determine the vertex Is it true that the capacity of all partitions where the first-order neighbors are allocated is saturated? If so, jump to step S405. Otherwise, calculate the vertex according to the following formula: Assign partitions:
[0039] ,
[0040] in, Indicates the allocated partition, is the jth partition, is the number of vertices in the jth partition, is the number of vertices that the jth partition can accommodate;
[0041] S405, according to the following formula for the vertex Assign partitions:
[0042] ;
[0043] And the calculation function expression of the number of vertices that any partition can accommodate is:
[0044] ,
[0045] in, is the number of vertices that the mth partition can accommodate, is the number of vertices in the graph dataset, For edge devices The proportion of graph neural network reasoning capabilities in a distributed environment, with the mth partition being the edge device The corresponding partition.
[0046] In addition, the present invention also provides a graph partitioning system for graph neural network reasoning in heterogeneous edge scenarios, including an interconnected microprocessor and a memory, and the microprocessor is programmed or configured to execute the graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios.
[0047] In addition, the present invention also provides a computer-readable storage medium, which stores a computer program or instruction, and the computer program or instruction is programmed or configured to execute the graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios through a processor.
[0048] In addition, the present invention also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute the graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios through a processor.
[0049] Compared with the existing technology, the present invention can mainly achieve the following beneficial effects: In order to solve the problems of load imbalance and low reasoning efficiency in edge graph neural network reasoning scenarios caused by device heterogeneity and defects in traditional graph partitioning methods, as well as the three core defects of the existing METIS-based balanced graph partitioning strategy in edge environments - ignoring the impact of the message passing mechanism of graph neural networks on reasoning efficiency, high memory overhead is not suitable for resource-constrained devices, and lacks heterogeneous graph neural network reasoning capability perception capabilities, the present invention proposes a new framework for heterogeneous edge graph neural network reasoning in heterogeneous edge scenarios. By evaluating the computing power of heterogeneous devices and executing graph partitioning that combines computing power perception with message passing optimization, the efficiency of graph neural network reasoning in heterogeneous edge environments is effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 Schematic diagram of the basic process of the method of the embodiment of the present invention.
[0051] Figure 2 Schematic diagram of the process of dividing map data in an embodiment of the present invention.
[0052] Figure 3 Schematic diagram of the module structure in an embodiment of the present invention.
[0053] Figure 4 Schematic diagram of the flow chart of the proportion of neural network reasoning capabilities in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The present invention aims to achieve four core goals: (1) support graph partitioning in heterogeneous environments to achieve load balancing; (2) optimize the time and memory cost of the partitioning process, as the process itself must be executed on resource-constrained edge devices; (3) be able to integrate with mainstream graph neural network processing libraries (such as PyG); and (4) adapt to diverse data sets, edge devices, and application scenarios. 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 in conjunction with the accompanying drawings of the embodiments of the present invention.
[0055] like Figure 1 As shown, the graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios in this embodiment includes the following steps:
[0056] S101, evaluates the graph neural network reasoning capabilities of edge devices in a distributed environment through benchmark testing;
[0057] S102, divide the input graph data into graphs according to the graph neural network reasoning capability ratio of edge devices in a distributed environment. The partition corresponding to each edge device.
[0058] like Figure 2 As shown, step S102 in this embodiment includes: step 1, arranging the vertices in the graph data in descending order according to the degree of the vertices and screening the first-order seeds and second-order seeds; step 2, randomly assigning partitions to the first-order seeds and their second-order neighbor blocks; step 3, constructing a deep expansion tree for the second-order neighbor blocks of the second-order seeds and assigning partitions by block based on the proportion of graph neural network reasoning capabilities of edge devices in a distributed environment; step 4, assigning partitions to the remaining unassigned vertices using a streaming greedy allocation strategy.
[0059] Graph data can be graph data in fields such as knowledge graphs, citation networks, e-commerce networks, open source community networks, social networks, financial transaction networks, and academic collaboration networks. In these fields, the meanings of nodes and edges are defined based on specific application scenarios and data characteristics. Together, they constitute the basic structure of graph data, which is used to describe complex entity relationships and interaction patterns. For example: (1) In the graph data of knowledge graphs, nodes usually represent entities, such as names of people, places, organizations, concepts, events, etc. Edges represent relationships between nodes, such as "belong to", "located in", "participate in", and "cause", etc. (2) In the graph data of citation networks, nodes represent documents, such as papers, books, research reports, etc. Each academic document can be a node. Edges represent citation relationships between documents. If document A cites document B, then there is an edge from A to B in the graph. This edge reflects the inheritance of knowledge and the context of academic research. (3) In the graph data of e-commerce networks, nodes can be products, users, merchants, stores, etc. For example, a product (such as a mobile phone), a user (consumer), and a merchant (brand) can all be nodes. Edges represent the interaction between nodes. For example, there can be edges such as "buy", "browse", and "collect" between users and products; there can be edges with "sale" relationships between merchants and products; and there can be edges with "entry" relationships between merchants and stores. (4) In the graph data of open source community networks, nodes can be developers, code repositories, projects, programming languages, etc. For example, a developer, an open source project, and a programming language can all be nodes. Edges represent the associations between nodes. For example, there can be edges with "contribution" relationships between developers and projects; there can be edges with "use" relationships between projects and programming languages; and there can be edges with "cooperation" relationships between developers. (5) In the graph data of social networks, nodes represent users (individuals or organizations). Edges represent social relationships between users. For example, if user A follows user B, then there is an edge from A to B in the graph. (6) In the graph data of financial transaction networks, nodes can be financial institutions (such as banks, securities companies), customers (individuals or companies), trading accounts, financial products, etc. For example, a bank, a stock account, and a financial product can all be nodes. Edges represent transaction or capital flow relationships. For example, if customer A transfers money from bank B to customer C, then there is an edge in the graph from A's account to C's account. The weight of the edge can be the transaction amount. (7) In the graph data of the academic collaboration network, nodes represent researchers, research institutions, laboratories, etc. For example, a university professor, a research team, and a research institute can all be nodes. Edges represent collaborative relationships. For example, if two professors jointly publish a paper, there will be an edge in the graph connecting the two nodes; if a research team collaborates with another research institution on a project, there will also be an edge representing this collaborative relationship.
[0060] like Figure 3As shown, as an optional implementation, the method of this embodiment is composed of a heterogeneous computing power evaluation module HETER and a graph partitioning algorithm module GSD (Graph Seed Division), wherein the heterogeneous computing power evaluation module HETER is used to execute step S101, and the graph partitioning algorithm module GSD is used to execute step S102. On this basis, in order to facilitate distinction, the method of this embodiment is named HETER-GSD.
[0061] In this embodiment, the heterogeneous computing power evaluation module HETER builds a benchmark test suite covering 8 topological feature graph datasets, which provides quantitative guidance for graph partitioning algorithms by accurately measuring the computing power of heterogeneous devices in GNN reasoning tasks. The graph partitioning algorithm module GSD is designed based on the message passing characteristics of GNN reasoning and adopts a hierarchical seed progressive allocation strategy. While balancing the cross-partition communication caused by neighbor sampling operations and optimizing message passing efficiency, it effectively reduces peak memory consumption and partitioning time overhead. Figure 4 As shown, step S101 in this embodiment includes:
[0062] S201, constructing a benchmark test data set, wherein the benchmark test data set includes different topological structures and different types A graph dataset, wherein the different topological structures refer to the number of vertices, the number of edges, the average degree of vertices, and some or all of the characteristic dimensions of the vertices being the same;
[0063] S202: For each graph dataset, the edge-cut graph partitioning method METIS is used to divide the graph dataset into non-overlapping partitions, where is the total number of edge devices in the distributed environment; the heterogeneous computing power evaluation module HETER adopts the widely used edge cut graph partitioning method METIS to evenly divide it into 𝑀 non-overlapping partitions, whose vertex cardinality is The edge-cut graph partitioning method METIS was chosen because it is a widely used graph partitioning method worldwide. Its minimization of edge cutting characteristics and relatively balanced load partitioning characteristics lay a solid foundation for subsequent computing power evaluation.
[0064] S203, perform graph neural network reasoning on the benchmark dataset through a distributed environment, and calculate any edge device according to the following formula Reasoning on arbitrary graph datasets The ability to partition :
[0065] ,
[0066] in, For the dataset Partition to edge devices The number of vertices in non-overlapping partitions of , For edge devices Inference dataset This step aims to establish a unified metric through standardized GNN inference tasks to quantify the computational efficiency of heterogeneous devices in GNN inference, thereby achieving an accurate evaluation of the GNN inference performance differences, where edge devices Inference dataset The partitioning time includes: vertex sampling time, n-hop neighbor feature aggregation time and feature update time;
[0067] S204, calculate any edge device according to the following formula In any graph dataset The proportion of graph neural network reasoning capabilities on :
[0068] ;
[0069] S205, construct a graph neural network reasoning ability matrix based on the graph neural network reasoning ability ratio, for example Figure 4 The graph neural network reasoning capability matrix constructed by 4 edge devices for 8 graph datasets, where the first column R 11 ~R 41 The graph neural network reasoning capabilities of the four edge devices for graph dataset 1, where the second column R 12 ~R 42 The graph neural network reasoning capabilities of the four edge devices for graph dataset 2, and so on. The eighth column R 18 ~R 48 The graph neural network reasoning capability of the four edge devices for the graph dataset 8 is calculated according to the following formula for any edge device The proportion of graph neural network reasoning capabilities in a distributed environment :
[0070] ,
[0071] in, is the number of graph datasets in the benchmark dataset. All edge devices The proportion of graph neural network reasoning capabilities in a distributed environment This collection constitutes the computing power share derived by the heterogeneous computing power evaluation module HETER. This method overcomes the limitations of traditional single-metric evaluation systems by evaluating the performance of graph neural network inference across multiple datasets and tasks. It accurately reflects the actual computing power of devices in graph neural network inference scenarios and provides a reliable quantitative basis for resource scheduling of heterogeneous devices.
[0072] In step S201 of this embodiment, different types of In the graph datasets, the graph data types involved include parts or internal parts of knowledge graphs, citation networks, e-commerce networks, open source community networks, social networks, financial transaction networks, and academic collaboration networks. Specifically, the benchmark suite constructed by the heterogeneous computing power evaluation module HETER in this embodiment covers 8 graph datasets with different topological structures: knowledge graph (WikiCS), citation network (ogbn-arxiv), e-commerce network (Amazon), open source community network (GitHub), social network (Flickr and FaceBookPage), financial transaction network (ElliptiBitcoinDataset), and academic collaboration network (Coauthor). These graphs cover a wide range of vertex numbers, edge densities, and feature dimensions, and can comprehensively characterize the performance of GNN reasoning under heterogeneous workloads. In addition, in response to the phenomenon of low memory capacity of edge devices, HETER ensures the availability of the framework by selecting graph datasets with small memory usage during distributed reasoning, as shown in Table 1.
[0073] Table 1: Graph dataset information in the benchmark dataset
[0074]
[0075] In Table 1, the memory usage is the memory usage when running in a distributed environment consisting of 5 heterogeneous edge devices.
[0076] As can be seen, the heterogeneous computing power evaluation module HETER in this embodiment has built a lightweight benchmark suite covering eight topological graph datasets, including knowledge graphs, social networks, and financial transaction networks. This breaks through the limitations of traditional evaluations based on a single metric (such as FLOPs) and enables accurate evaluation of the distributed GNN reasoning capabilities of edge devices. Based on benchmark testing and dynamic weighted quantization methods, the heterogeneous computing power evaluation module HETER comprehensively considers the latency characteristics of the entire GNN reasoning process and adopts a cross-dataset averaged device comprehensive computing power ratio calculation model to eliminate single dataset bias, ensure the universality and robustness of the evaluation results, and provide an accurate heterogeneous device capability profile for subsequent graph partitioning.
[0077] In this embodiment, the graph partitioning algorithm module GSD also includes The number of vertices that a partition can accommodate is initialized based on the proportion of graph neural network reasoning capabilities in a distributed environment. This step aims to set the upper threshold limit to prevent device overload. Given the current lack of widely recognized GNN task size quantification standards, and the fact that the number of partition vertices is directly related to computing requirements, convenient for statistical analysis, and widely recognized by the industry, this embodiment uses the number of vertices as an indicator for device capacity calculation. The calculation function expression for the number of vertices that any partition can accommodate is:
[0078] ,
[0079] in, is the number of vertices that the mth partition can accommodate, is the number of vertices in the graph dataset, For edge devices The proportion of graph neural network reasoning capabilities in a distributed environment, with the mth partition being the edge device Corresponding partitions can be obtained in a distributed environment The capacity of edge devices .
[0080] See also Figure 2 In step 1, in step S102 of this embodiment, the vertices in the graph data are arranged in descending order according to the degree of the vertices and the first-order seeds and second-order seeds are screened. The high-degree vertices are preferentially selected as seeds for the following two reasons: First, in the power-law graph, high-degree vertices and their neighbors will form a large star-shaped structure. If these star-shaped structures are gathered in the same subgraph, it will cause communication imbalance in the distributed environment. Therefore, eliminating the neighbor blocks formed by high-degree vertices and their neighbors can become an effective way to eliminate communication imbalance in the distributed environment. Second, according to the message passing mechanism of GNN, in the local neighborhood of the vertex The overhead generated is minimal ( is the vertex Central Therefore, retaining the neighborhood blocks of high-degree vertices during partitioning can effectively reduce cross-partition communication. In this embodiment, step S102 arranges the vertices in the graph data in descending order of degree and selects the first-order seeds and second-order seeds, including:
[0081] S301, sorting the vertices in the graph data in descending order of their degrees;
[0082] S302, selecting a preset ratio from the vertex set arranged in descending order The vertices (which can be selected according to actual needs) constitute the seed vertex set ;
[0083] S303, from the seed vertex set Before selection The vertices with the highest degree are taken as first-order seeds, and the remaining vertices as second-order seeds, where is the total number of edge devices in the distributed environment, is the seed vertex set The number of seed vertices in .
[0084] In step S102 of this embodiment, when randomly allocating partitions to the first-order seeds and their second-order neighbor blocks, the first-order seeds are allocated to the partition with the largest capacity according to their degree; the second-order neighbor blocks of the first-order seeds are allocated to the partition with the largest capacity according to their degree. , the proportion of the graph neural network reasoning ability of the edge device in the distributed environment is used as the probability of assigning the second-order neighbor block to the edge device, so that the second-order neighbor block of each first-order seed is randomly assigned to the distributed environment according to the probability For example, in a distributed environment consisting of three edge devices, the proportion of the graph neural network reasoning capabilities of the three edge devices in the distributed environment is calculated to be , then in this step the first-order seed Neighbor Block Press The first device randomly distributes 50% of the vertices of the neighbor block, the second device distributes 30% of the vertices of the neighbor block, and the third device distributes 20% of the vertices of the neighbor block.
[0085] In step S102 of this embodiment, a deep expansion tree is constructed for the second-order neighbor blocks of the second-order seeds and partitions are allocated by blocks according to the graph neural network reasoning capability ratio of edge devices in a distributed environment. The above steps allocate the second-order seeds and their second-order neighbor blocks, and gradually build a deep expansion tree by combining the GNN message passing mechanism to maintain the integrity of message passing within the partition. Specifically: for the seeds that have been allocated as neighbors of the first-order seeds, , collect its The set of vertices in the neighboring blocks that have not yet been assigned , constructed with The purpose of establishing a 2-layer deep tree is to use the message passing mechanism between neighbors of GNN to separate seeds and their Placing neighbors in the same partition can maximize the integrity of message delivery, reduce the communication overhead caused by cross-partition sampling, and improve the efficiency of graph partitioning. Overall allocation to Specifically, the above steps include allocating the allocated second-order seed to each of the second-order neighbor blocks of the first-order seed. , collect the second-level seeds The set of vertices in the second-order neighbor block that have not been assigned , if the set If the size of is 0, then exit the processing of the second-order neighbor block of the second-order seed and enter the partitioning phase using the streaming greedy allocation strategy for the remaining unassigned vertices; otherwise, according to the following formula, Assign partitions:
[0086] ,
[0087] in, Indicates the allocated partition, is the mth partition, is the number of vertices that the mth partition can accommodate, is the number of vertices in the mth partition, is the number of vertices that the j-th partition can accommodate, is the jth partition, is the number of vertices in the jth partition. Representative Vertex of The number of unassigned vertices in the neighbor block is less than or equal to the device The remaining capacity of , so the overall meaning of this formula is: if the vertex of The number of unassigned vertices in the neighbor block is less than or equal to the device The remaining capacity of Assign to device as a whole Otherwise, the collection The whole is allocated to the device with the largest remaining capacity among all devices. In addition, the above steps include the collection An early exit mechanism of size 0 is used when a seed block is detected. When the number of unassigned vertices in the graph decreases to 0, the second-order seed allocation is terminated and the process goes to step 4 (the partitioning phase is performed by using the streaming greedy allocation strategy for the remaining unassigned vertices). The reason for setting up the early exit mechanism is that based on the power law characteristics of the graph structure, the seeds and their Usually covers most of the vertices, and the remaining vertices are mostly low-degree edge vertices with sparse connections, weak community attributes, and discrete spatial distribution. Calculate for these vertices Continuing with the block-wise partitioning in step 3 is cost-ineffective due to the computational overhead and limited benefits.
[0088] The vertices that are not assigned after the above steps are the remaining vertices. In this embodiment, the remaining vertices are assigned with a flow greedy allocation strategy under capacity constraints to ensure that the local computing benefits are maximized under the premise of load balancing. In step S102 of this embodiment, when the remaining unassigned vertices are assigned partitions using the flow greedy allocation strategy, any vertex The streaming greedy allocation strategy to allocate partitions includes:
[0089] S401, collect the included vertices Partitioned set of assigned first-order neighbors ,in, is the jth partition;
[0090] S402, if the partition set If not empty, jump to step S403; otherwise, jump to step S405;
[0091] S403, for partition set , calculate the number of neighbors for each partition according to the following formula:
[0092] ,
[0093] in, is the number of neighbors of the jth partition, Vertex Allocated first-order neighbor blocks, is a vertex, and the formula represents the vertex First-order neighbors of Assigned to partition The number of vertices;
[0094] S404, determine the vertex Is it true that the capacity of all partitions where the first-order neighbors are allocated is saturated? If so, jump to step S405. Otherwise, calculate the vertex according to the following formula: Assign partitions:
[0095] ,
[0096] in, Indicates the allocated partition, is the jth partition, is the number of vertices in the jth partition, is the number of vertices that the jth partition can accommodate. This formula represents the number of vertices allocated in the partition. Smaller than the partition capacity Under the premise of is assigned to the partition with the most first-order neighbors;
[0097] S405, according to the following formula for the vertex Assign partitions:
[0098] ,
[0099] Indicates the target partition The device with the largest remaining capacity among all devices;
[0100] And the calculation function expression of the number of vertices that any partition can accommodate is:
[0101] ,
[0102] in, is the number of vertices that the mth partition can accommodate, is the number of vertices in the graph dataset, For edge devices The proportion of graph neural network reasoning capabilities in a distributed environment, with the mth partition being the edge device The corresponding partition.
[0103] It can be seen that the graph partitioning algorithm module GSD in this embodiment proposes a hierarchical seed progressive partitioning mechanism, which performs different allocation methods by selecting first-order / second-order seeds. Neighbor blocks effectively eliminate the power law of the graph. For the GNN message passing mechanism, the second-order seed is used as the root to build Neighbor blocks maximize intra-partition neighborhood integrity to reduce cross-partition communication. An early exit mechanism is designed to dynamically terminate high-cost partitioning phases by monitoring the number of unassigned seed blocks in real time. Finally, a capacity-constrained streaming greedy allocation is implemented for the remaining low-degree vertices to ensure maximum local computational benefit while maintaining load balancing. The graph partitioning algorithm module GSD in this embodiment supports receiving parameters for the computing power share of heterogeneous devices, enabling unbalanced partitioning under heterogeneous computing power.
[0104] The advantages of the method in this embodiment (HETER-GSD) are as follows: (1) The default processing method for distributed graph neural network tasks in the current mainstream graph neural network processing library is METIS balanced partitioning, which will cause serious load imbalance on edge devices and reduce inference efficiency. The method in this embodiment (HETER-GSD) is an acceleration framework designed for heterogeneous edge graph neural network inference. The advantages are: the method in this embodiment (HETER-GSD) supports the unbalanced partitioning of graph neural network inference tasks under computing power evaluation, effectively promotes load balancing between heterogeneous devices, and improves the utilization rate of computing power resources and inference efficiency; the method in this embodiment (HETER-GSD) is a lightweight edge graph neural network inference acceleration framework that can be integrated into the mainstream graph neural network processing library PyG, suitable for running in edge environments and easy to call. (2) Existing computing power evaluation methods mostly focus on the evaluation of a single computing power (such as floating-point computing power, etc.), while graph neural network inference involves complex mathematical calculations and cannot be measured by a single indicator; and existing evaluation methods are difficult to accurately evaluate the sampling randomness of graph neural networks and the dynamic communication overhead introduced in distributed computing. Therefore, the advantages of the heterogeneous computing power evaluation module HETER are as follows: This module is a computing power evaluation method designed for graph neural network reasoning in heterogeneous edge environments. By constructing a lightweight benchmark test suite consisting of 8 graph datasets with different topological structures, it evaluates the graph neural network reasoning capabilities of heterogeneous devices from the entire process of distributed graph neural network reasoning, effectively making up for the shortcomings of traditional computing power evaluation methods. (3) Traditional graph partitioning methods use the cutting edge rate as the core indicator without considering the message passing characteristics in graph neural network reasoning. In addition, traditional graph partitioning methods tend to retain a large star-shaped structure formed by high-degree vertices and their neighbors in a certain subgraph, resulting in unbalanced sampling between different devices. The graph partitioning algorithm module GSD is a graph partitioning algorithm for graph neural network propagation optimization. Its advantages are: the graph partitioning algorithm module GSD eliminates the sampling imbalance caused by large trait structures through a multi-layer seed progressive allocation strategy, maximizes the integrity of neighbor blocks in the subgraph, and uses the message passing mechanism of the graph neural network to reduce the communication overhead generated by cross-partition sampling; the block partitioning and streaming greedy partitioning adopted in the graph partitioning algorithm module GSD effectively reduce the memory usage during the partitioning process, improve the partitioning efficiency, and is suitable for running on edge devices; the graph partitioning algorithm module GSD supports simple calls integrated on PyG, supports receiving heterogeneous computing power parameters, and realizes unbalanced partitioning based on computing power strength.
[0105] In addition, this embodiment also provides a graph partitioning system for graph neural network reasoning in heterogeneous edge scenarios, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios. This embodiment also provides a computer-readable storage medium, which stores a computer program or instruction, and the computer program or instruction is programmed or configured to execute the graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios through a processor. This embodiment also provides a computer program product, including a computer program or instruction, which is programmed or configured to execute the graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios through a processor.
[0106] Those skilled in the art should understand that the technical solution provided by the present invention may be in the form of a method, a system, or a computer program product. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions described in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including the instruction device, which implements the function specified in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 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 produce a computer-implemented process, thereby providing instructions for implementing the process in the process. Figure 1 a process or multiple processes and / or boxes Figure 1A step that specifies a function in one or more boxes.
[0107] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiment. All technical solutions based on the concept of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios, characterized by: The steps include: S101, evaluates the graph neural network reasoning capabilities of edge devices in a distributed environment through benchmark testing; S102, divide the input graph data into graphs according to the graph neural network reasoning capability ratio of edge devices in a distributed environment. The partitions corresponding to each edge device include: sorting the vertices in the graph data in descending order by vertex degree and filtering the first-order seeds and second-order seeds; randomly assigning partitions to the first-order seeds and their second-order neighbor blocks; building a deep expansion tree for the second-order neighbor blocks of the second-order seeds and assigning partitions by block based on the proportion of graph neural network reasoning capabilities of edge devices in a distributed environment; and assigning partitions to the remaining unassigned vertices using a streaming greedy allocation strategy. In step S102, when the remaining unassigned vertices are assigned partitions using the streaming greedy allocation strategy, any vertex The streaming greedy allocation strategy to allocate partitions includes: S401, collect the included vertices Partitioned set of assigned first-order neighbors ,in, is the jth partition; S402, if the partition set If not empty, jump to step S403; otherwise, jump to step S405; S403, for partition set , calculate the number of neighbors for each partition according to the following formula: , in, is the number of neighbors of the jth partition, Vertex Allocated first-order neighbor blocks, is the vertex; S404, determine the vertex Is it true that the capacity of all partitions where the first-order neighbors are allocated is saturated? If so, jump to step S405. Otherwise, calculate the vertex according to the following formula: Assign partitions: , in, Indicates the allocated partition, is the jth partition, is the number of vertices in the jth partition, is the number of vertices that the jth partition can accommodate; S405, according to the following formula for the vertex Assign partitions: ; And the calculation function expression of the number of vertices that any partition can accommodate is: , in, is the number of vertices that the mth partition can accommodate, is the number of vertices in the graph dataset, For edge devices The proportion of graph neural network reasoning capabilities in a distributed environment, with the mth partition being the edge device The corresponding partition.
2. The graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios according to claim 1 is characterized in that: Step S101 includes: S201, constructing a benchmark test data set, wherein the benchmark test data set includes different topological structures and different types A graph dataset, wherein the different topological structures refer to the number of vertices, the number of edges, the average degree of vertices, and some or all of the characteristic dimensions of the vertices being the same; S202: For each graph dataset, the edge-cut graph partitioning method METIS is used to divide the graph dataset into non-overlapping partitions, where is the total number of edge devices in the distributed environment; S203, perform graph neural network reasoning on the benchmark dataset through a distributed environment, and calculate any edge device according to the following formula Reasoning on arbitrary graph datasets The ability to partition : , in, For the dataset Partition to edge devices The number of vertices in non-overlapping partitions of , For edge devices Inference dataset The time of the partition; S204, calculate any edge device according to the following formula In any graph dataset The proportion of graph neural network reasoning capabilities on : ; S205: Build a graph neural network reasoning capability matrix based on the graph neural network reasoning capability ratio, and calculate the value of any edge device according to the following formula: The proportion of graph neural network reasoning capabilities in a distributed environment : , in, is the number of graph datasets in the benchmark dataset.
3. The graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios according to claim 2 is characterized in that: Different types of In this graph dataset, the graph data types involved include knowledge graphs, citation networks, e-commerce networks, open source community networks, social networks, financial transaction networks, and parts or internal parts of academic cooperation networks.
4. The graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios according to claim 1 is characterized in that: In step S102, arranging the vertices in the graph data in descending order of their degrees and screening the first-order seeds and the second-order seeds includes: S301, sorting the vertices in the graph data in descending order of their degrees; S302, selecting a preset ratio from the vertex set arranged in descending order The vertices of ; S303, from the seed vertex set Before selection The vertices with the highest degree are taken as first-order seeds, and the remaining vertices as second-order seeds, where is the total number of edge devices in the distributed environment, is the seed vertex set The number of seed vertices in .
5. The graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios according to claim 1 is characterized in that: In step S102, when randomly allocating partitions for the first-order seeds and their second-order neighbor blocks, the following steps are performed: first-order seeds are allocated to the partition with the largest capacity according to the size of the degree; for the second-order neighbor blocks of the first-order seeds, the proportion of the graph neural network reasoning capability of the edge device in the distributed environment is used as the probability of allocating the second-order neighbor blocks to the edge device, thereby randomly allocating the second-order neighbor blocks of each first-order seed to the distributed environment according to the probability. The partition corresponding to each edge device.
6. The graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios according to claim 1 is characterized in that: In step S102, a depth expansion tree is constructed for the second-order neighbor block of the second-order seed and partitioned by block according to the graph neural network reasoning capability ratio of the edge device in a distributed environment, including each allocated second-order seed in the second-order neighbor block of the first-order seed. , collect the second-level seeds The set of vertices in the second-order neighbor block that have not been assigned , if the set If the size is 0, then exit the processing of the second-order neighbor blocks of the second-order seed and enter the partition allocation phase using the streaming greedy allocation strategy for the remaining unassigned vertices; Otherwise, the set is Assign partitions: , in, Indicates the allocated partition, is the mth partition, is the number of vertices that the mth partition can accommodate, is the number of vertices in the mth partition, is the number of vertices that the j-th partition can accommodate, is the jth partition, is the number of vertices in the jth partition, and the calculation function expression for the number of vertices that any partition can accommodate is: , in, is the number of vertices that the mth partition can accommodate, is the number of vertices in the graph dataset, For edge devices The proportion of graph neural network reasoning capabilities in a distributed environment, with the mth partition being the edge device The corresponding partition.
7. A graph partitioning system for graph neural network reasoning in heterogeneous edge scenarios, comprising an interconnected microprocessor and memory, characterized in that: The microprocessor is programmed or configured to execute the graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios as described in any one of claims 1 to 6.
8. A computer-readable storage medium having a computer program or instruction stored therein, characterized in that: The computer program or instruction is programmed or configured to execute the graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios described in any one of claims 1 to 6 through a processor.
9. 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 graph partitioning method for graph neural network reasoning in heterogeneous edge scenarios described in any one of claims 1 to 6 through a processor.
Citation Information
Patent Citations
Graph-based model division edge-end collaborative reasoning method and system
CN117707795A
Graph neural network-oriented block-based graph data partitioning method and system
CN120086024A