Power law distribution-oriented GPU (Graphics Processing Unit) graph calculation acceleration method and device

By dynamically adjusting the push-pull operation and blocking work pool strategies, the problems of load balancing and low computing efficiency in the power law distribution graph are solved, and more efficient GPU graph calculation is achieved.

CN119168840AActive Publication Date: 2024-12-20NORTHEASTERN UNIV CHINA
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411339123.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2024-12-20
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

The prior art fails to effectively deal with the power law distribution when processing graph data, resulting in insufficient load balancing and coarse-grained push-pull operation, resulting in low computational efficiency, especially when super vertices exist.

Method used

Using the GPU graph calculation method for power law distribution, dynamically adjust the push and pull operations by counting the number of active vertices, large vertices and small vertices, combining the chunked work pool strategy to achieve load balancing, and refine it in the push and pull mode. Granularity to reduce write conflicts.

Benefits of technology

It improves the utilization rate of GPU and graph computing efficiency, ensures efficient calculations on the power law distribution graph, and reduces the impact of write conflicts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119168840A_ABST
    Figure CN119168840A_ABST
Patent Text Reader

Abstract

The invention provides a power-law-distribution-oriented GPU graph calculation acceleration method and device, and belongs to the technical field of graph calculation.The method comprises the steps that according to the number of active vertexes, the number of large vertexes and the number of small vertexes in graph data, it is determined that push operation or pull operation is used for the corresponding vertexes, updating information in the corresponding mailbox and active vertexes of the next round and the number of the active vertexes according to the push operation or the pull operation of the corresponding vertexes; updating the corresponding vertexes by adopting the updated information in the mailbox to obtain updated graph data; under the condition that the number of the active vertexes in the next round is zero, outputting the updated graph data as the result of the algorithm; aiming at the push-pull problem on the super vertex in the power law distribution diagram, the fine-grained push-pull strategy is provided, the low-efficiency pull operation on the super vertex is avoided, and the execution efficiency is improved; in addition, a k-work pool strategy is adopted to balance the load, and the load can be better distributed in the face of a power law distribution phenomenon of a real graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of graph computing technology, and specifically relates to a GPU graph computing acceleration method and device for power-law distribution. Background Art

[0002] Common graph algorithms in graph databases include: BFS (Breadth-First Search), SSSP (Single Source Shortest Path), WCC (Weakly Connected Components), CD (Community Detection), etc. These are important algorithms that are frequently used in social network analysis. These algorithms usually use the BSP model (Bulk Synchronous Parallel) as a framework for calculation, that is, iterative calculation is performed in "rounds". After each round, synchronization is performed to exchange data and prepare for the next round of calculation. In each round of calculation, the calculation on each vertex or each edge is lightweight, but the number of vertices or edges is very large. This is consistent with the large-scale lightweight parallel computing mode of GPU (Graphic Processing Unit). GPUs have tens of thousands of cores, but the computing power of each core is relatively weak, which forms this large-scale lightweight parallel computing mode. A large number of studies have shown that GPU acceleration for graph computing is effective and effective.

[0003] In the prior art, in each round of calculation, if there are few active vertices in the current round, the "push" mode is used; otherwise, the "pull" mode is used. In the push mode, each vertex is calculated based on its own information and the information on the outgoing edge (if any), and the result is pushed to its neighboring vertices. Pushing is an atomic operation to ensure the correctness of the result when the target vertex is pushed repeatedly. In the pull mode, each vertex pulls the information on its incoming neighbors and its incoming edges (if any), saves them in a temporary array, and obtains the new information of the vertex through reduction. Reduction usually uses parallel reduction to further improve efficiency. At the beginning of each round, it is determined whether to push or pull based on the number of active vertices in the current round. Generally, a threshold k is obtained based on experience or experiments, and it is agreed that the pull mode is used when the proportion of active vertices is greater than the threshold, otherwise the push mode is used.

[0004] Most of the graph data abstracted from real social networks satisfy the power-law distribution, that is, there are a small number of super vertices with huge degrees, which causes a serious skew in the distribution of graph data. Existing technical solutions do not consider processing this type of graph, which is common. The defects caused by this are divided into two parts for discussion.

[0005] Defect 1: The existing solution does not consider the load balancing problem, but uses a random partitioning method to allocate computing tasks. This method does not guarantee load balancing, and cannot guarantee efficient computing in the face of power-law distribution. As a parallel algorithm on the GPU, load balancing is a very important factor, and a better load balancing strategy can better cope with power-law distribution.

[0006] Defect 2: Coarse-grained push and pull. Existing methods all use coarse-grained push and pull. In each iteration, either all active vertices are pushed or all vertices are pulled. This method does not consider the problems of large vertex push and pull. Large vertex pull operations require frequent reductions and consume a lot of resources, so large vertices are more suitable for push operations. In the power law distribution graph, this defect caused by super large vertices is particularly obvious. Summary of the invention

[0007] In view of the deficiencies in the prior art, the present application proposes a GPU graph computing acceleration method and device for power-law distribution.

[0008] In the first aspect, the present application proposes a GPU graph computing acceleration method for power-law distribution, including:

[0009] Step S1: Acquire graph data, where the graph data conforms to a power-law distribution and includes: a plurality of vertices and a plurality of edges of the graph;

[0010] Step S2: using a GPU to store the graph data, and initializing the stored graph data according to a graph algorithm;

[0011] Step S3: Count the number of active vertices, large vertices, and small vertices in the initialized graph data, and save the active vertices in the work pool, wherein the vertices whose out-degree or in-degree is greater than the number of threads in the work group are regarded as large vertices, the vertices whose out-degree and in-degree are not greater than the number of threads in the work group are regarded as small vertices, and the vertices participating in the current round of calculation are regarded as active vertices;

[0012] Step S4: setting a corresponding mailbox for each vertex, wherein the mailbox is used to store the temporary result of the current round of calculation of the corresponding vertex;

[0013] Step S5: Determine the push operation or pull operation of the corresponding vertex according to the number of active vertices, the number of large vertices, and the number of small vertices, and save the push operation or pull operation of the corresponding vertex in the working pool;

[0014] Step S6: updating the information in the corresponding mailbox, the next round of active vertices, and the number of round active vertices according to the push operation or pull operation of the corresponding vertex;

[0015] Step S7: Use the information in the updated mailbox to update the corresponding vertex to obtain updated graph data;

[0016] Step S8: When the number of active vertices in the next round is zero, the updated graph data is output as the accelerated result. When the number of active vertices in the next round is not zero, return to step S3, re-count the large vertices and small vertices in the updated graph data, and perform the next round of calculation.

[0017] The method of using a GPU to store the graph data includes: storing structural information of the graph data in the GPU in a row-compressed form, wherein the structural information consists of a CSRO structure and a CSRI structure, wherein the CSRO structure stores outgoing edges and outgoing neighbors of all vertices, and the CSRI structure stores incoming edges and incoming neighbors of all vertices, and the CSRO structure is read in a push operation, and the CSRI structure is read in a pull operation.

[0018] The stored graph data is initialized according to the graph algorithm, including: judging whether to use a push operation or a pull operation in the first round of calculation according to different types of graph algorithms, initializing active vertices in the first round, initializing the values ​​in the mailbox, and initializing the values ​​on each vertex.

[0019] The determining whether to use a push operation or a pull operation in the first round of calculation according to different types of graph algorithms includes: when the graph algorithm is a BFS algorithm or a SSSP algorithm, a push operation is used for the starting vertex; when the graph algorithm is a WCC algorithm or a CDLP algorithm, a pull operation is used for the active vertices in the first round of calculation.

[0020] The step of determining the push operation or pull operation of the corresponding vertex according to the number of active vertices, the number of large vertices, and the number of small vertices includes:

[0021] Step S5.1: Calculate the proportion of large vertices according to the number of large vertices and the number of small vertices;

[0022] Step S5.2: When the number of active vertices is greater than a preset percentage of the total number of vertices, a pull operation is performed on all currently active vertices, and the process goes to step S6;

[0023] Step S5.3: When the number of active vertices is less than or equal to a preset percentage of the total number of vertices, a push operation is performed on all currently active vertices, and the process goes to step S5.4;

[0024] Step S5.4: When the proportion of large vertices is greater than a first preset percentage, a push operation is performed on the large vertices and a pull operation is performed on the small vertices, and the process goes to step S6;

[0025] Step S5.5: When the proportion of large vertices is less than or equal to the first preset percentage, a push operation is performed on all vertices, and the process goes to step S6.

[0026] The GPU graph computing acceleration method for power-law distribution also includes: using a block work pool strategy to achieve load balancing, specifically:

[0027] Step S100: Use the greedy strategy to divide the work pool into k parts, and number each work pool, and take Where m is the total number of edges that need to be processed in the current round of calculation;

[0028] Step S101: Each thread warp obtains its own starting work pool number w;

[0029] Step S102: Take a task from the (w+i)%kth work pool, where the task includes: a push operation or a pull operation of a vertex, and set the initial value of i to 0;

[0030] Step S103: If a task is obtained, a push operation or a pull operation is performed on the vertex corresponding to the task, and the process goes to step S102; if a task is not obtained, let i=i+1, and if i=k, the process goes to step S104; if i≠k, the process goes to step S102;

[0031] Step S104: end the task flow of this round of work pool processing, return to step S3, wait for the next round to save the active vertices in the work pool, and then go to step S100 to re-perform the next work pool processing task.

[0032] In the second aspect, the present application proposes a GPU graph computing acceleration device for power-law distribution, including: a data acquisition module, a storage and initialization module, a quantity statistics module, a mailbox setting module, an operation determination module, a data update module, a vertex update module and a result output module;

[0033] The data acquisition module is connected to the storage and initialization module, the storage and initialization module is connected to the quantity statistics module, the quantity statistics module is connected to the mailbox setting module, the mailbox setting module is connected to the operation determination module, the operation determination module is connected to the data update module, the data update module is connected to the vertex update module, the vertex update module is connected to the result output module, and the result output module is connected to the quantity statistics module;

[0034] A data acquisition module, used to acquire graph data, where the graph data conforms to a power-law distribution and includes a plurality of vertices and a plurality of edges;

[0035] A storage and initialization module, used to store the graph data using a GPU and initialize the stored graph data according to a graph algorithm;

[0036] The number counting module is used to count the number of active vertices, large vertices and small vertices in the initialized graph data, and save the active vertices in the working pool. Among them, the vertices whose out-degree or in-degree is greater than the number of threads in the working group are regarded as large vertices, the vertices whose out-degree and in-degree are not greater than the number of threads in the working group are regarded as small vertices, and the vertices participating in the current round of calculation are regarded as active vertices;

[0037] A mailbox setting module, used to set a corresponding mailbox for each vertex, wherein the mailbox is used to store the temporary result of the current round of calculation of the corresponding vertex;

[0038] An operation determination module, used for determining a push operation or a pull operation of a corresponding vertex according to the number of active vertices, the number of large vertices, and the number of small vertices, and saving the push operation or the pull operation of the corresponding vertex in a work pool;

[0039] A data update module, used to update the information in the corresponding mailbox, the next round of active vertices, and the number of round active vertices according to the push operation or pull operation of the corresponding vertex;

[0040] A vertex update module, used to update corresponding vertices using the information in the updated mailbox to obtain updated graph data;

[0041] The result output module is used to output the updated graph data as the accelerated result when the number of active vertices in the next round is zero. When the number of active vertices in the next round is not zero, it returns to the quantity statistics module, re-counts the large vertices and small vertices in the updated graph data, and performs the next round of calculation.

[0042] In a third aspect, the present application proposes an electronic device comprising: one or more processors, and a memory, wherein the memory is used to store instructions and data, and when the instructions are executed by the one or more processors, the one or more processors execute the GPU graph computing acceleration method for power-law distribution.

[0043] In a fourth aspect, the present application proposes a computer-readable storage medium storing data and executable instructions, which, when executed, enable a processor to execute the GPU graph computing acceleration method for power-law distribution.

[0044] In a fifth aspect, the present application proposes a computer program product, including a computer program or instructions, which, when executed by a processor, implements the GPU graph computing acceleration method for power-law distribution.

[0045] Beneficial effects:

[0046] This application proposes a GPU graph computing acceleration method and device for power-law distribution, which uses a k-work pool strategy to balance the load. When faced with the power-law distribution phenomenon of real graphs, it can better distribute the load to achieve higher performance. In addition, based on the existing push-pull hybrid mode, a further fine-grained push-pull strategy is added to overcome the difficulties caused by large vertices in the power-law graph and further reduce the negative impact of write conflicts. In general, the above two innovations improve the utilization of the GPU and the execution efficiency of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 Flowchart of the GPU graph computing acceleration method for power-law distribution according to an embodiment of the present application;

[0048] Figure 2 A schematic diagram of a GPU graph computing acceleration method for power-law distribution according to an embodiment of the present application;

[0049] Figure 3 Schematic diagram of the k-working pool mechanism of the embodiment of the present application;

[0050] Figure 4 Principle block diagram of a GPU graph computing acceleration device for power-law distribution according to an embodiment of the present application. DETAILED DESCRIPTION

[0051] The specific implementation of the present application is further described in detail below in conjunction with the drawings and examples.

[0052] This application improves on two defects in the background technology to ensure load balancing, refine the push-pull granularity, improve graph computing efficiency, and can cope well with real graphs with power-law distribution. In response to the power-law distribution phenomenon that is prevalent in real graph data, two innovations are proposed to make up for the shortcomings of existing solutions in the face of this scenario. On the basis of the existing push-pull hybrid processing mode, an innovative load balancing strategy is added to achieve a more reasonable task division and better performance. In response to the push-pull problem on super vertices in power-law distributed graphs, an innovative fine-grained push-pull hybrid algorithm based on vertex degree is proposed to avoid inefficient pull operations on super vertices, reduce the probability of write conflicts, and improve the efficiency of algorithm execution.

[0053] Embodiment 1:

[0054] This embodiment proposes a GPU graph computing acceleration method for power-law distribution, such as Figure 1 , Figure 2 As shown, including:

[0055] Step S1: Acquire graph data, where the graph data conforms to a power-law distribution and includes: a plurality of vertices and a plurality of edges of the graph;

[0056] Step S2: using a GPU to store the graph data, and initializing the stored graph data according to a graph algorithm;

[0057] In this embodiment, after reading the graph data from the file system, the structural information of the graph is stored in the GPU side in the form of CSR (Compressed Sparse Row). This application is aimed at the situation where the entire graph can be stored in the GPU video memory. For particularly large graphs, it is not within the scope of consideration of the present invention. In particular, since the algorithm is a mixture of push and pull modes, it is necessary to store two CSR structures, CSRO (Compressed Sparse Row Out, sparse matrix row compression output structure) and CSRI (Compressed Sparse Row In sparse matrix row compression input structure). Among them, CSRO stores the outgoing edges and outgoing neighbors of all vertices, and CSRI stores the incoming edges and incoming neighbors of all vertices. CSRO is read in a push operation, and CSRI is read in a pull operation.

[0058] In addition, different algorithms require different additional information. For example, BFS only requires information on each vertex and stores it in integers, while SSSP requires information on vertices and edges, and the data type of the vertex information is determined based on actual needs, generally floating point numbers. Therefore, the GPU side must not only store the CSR representing the graph structure, but also other data required by the algorithm.

[0059] In the initialization phase, it is necessary to determine whether to use push or pull operations in the first round based on the characteristics of the algorithm. BFS and SSSP algorithms start their exploration from a starting point, so there is only one active vertex in the first round, and the push mode is used; WCC and CDLP (Community Detection using Label Propagation) algorithms require all vertices to participate at the beginning, so the pull mode is used.

[0060] Step S3: Count the number of active vertices, large vertices, and small vertices in the initialized graph data, and save the active vertices in the work pool, wherein the vertices whose out-degree or in-degree is greater than the number of threads in the work group are regarded as large vertices, the vertices whose out-degree and in-degree are not greater than the number of threads in the work group are regarded as small vertices, and the vertices participating in the current round of calculation are regarded as active vertices;

[0061] In this embodiment, a work group is defined as: when performing parallel computing on the GPU, threads are organized into larger groups (which can be understood as a basic unit of scheduling) for efficient computing and memory access. The work group corresponds to concepts such as thread blocks in CUDA, work groups in OpenCL, and tiles in C++AMP. Developers can customize the number of threads in a work group based on hardware conditions and algorithm requirements. Common values ​​are 256 or 512, which are powers of 2. It can be understood that no matter in which framework, as long as it is a basic scheduling unit, no matter what the specific name is, it is within the scope of protection of this application.

[0062] In this embodiment, it can be understood that if the out-degree or in-degree of a vertex is greater than the number of threads in the workgroup, such a vertex can be called a large vertex, and correspondingly, if the out-degree and in-degree of a vertex are not greater than the number of threads in the workgroup, such a vertex can be called a small vertex, and those vertices participating in the current round of calculation can be called active vertices.

[0063] Step S4: setting a corresponding mailbox for each vertex, wherein the mailbox is used to store the temporary result of the current round of calculation of the corresponding vertex;

[0064] Step S5: Determine the push operation or pull operation of the corresponding vertex according to the number of active vertices, the number of large vertices, and the number of small vertices, and save the push operation or pull operation of the corresponding vertex in the working pool;

[0065] Step S6: updating the information in the corresponding mailbox, the next round of active vertices, and the number of the next round of active vertices according to the push operation or pull operation of the corresponding vertex;

[0066] Step S7: Use the information in the updated mailbox to update the corresponding vertex to obtain updated graph data;

[0067] Step S8: When the number of active vertices in the next round is zero, the updated graph data is output as the accelerated result. When the number of active vertices in the next round is not zero, return to step S3, re-count the large vertices and small vertices in the updated graph data, and perform the next round of calculation.

[0068] The push operation or pull operation of the corresponding vertex is determined according to the number of active vertices, the number of large vertices, and the number of small vertices, such as Figure 2 As shown, including:

[0069] Step S5.1: Calculate the proportion of large vertices according to the number of large vertices and the number of small vertices;

[0070] Step S5.2: When the number of active vertices is greater than 50% of the total number of vertices, a pull operation is performed on all currently active vertices, and the process goes to step S6;

[0071] Step S5.3: When the number of active vertices is less than or equal to 50% of the total number of vertices, a push operation is performed on all currently active vertices, and the process goes to step S5.4;

[0072] Step S5.4: When the proportion of large vertices is greater than 20%, a push operation is applied to the large vertices and a pull operation is applied to the small vertices, and then the process goes to step S6;

[0073] Step S5.5: When the proportion of large vertices is less than or equal to 20%, a push operation is performed on all vertices, and the process goes to step S6.

[0074] In this embodiment, a fine-grained push-pull mode is proposed on the basis of the existing coarse-grained push-pull calculation mode. At the beginning of the push mode, the proportion of large vertices is counted. If the proportion is small, each active vertex performs a push operation. For an active vertex, it is assigned to a thread bundle, and a maximum of 32 outgoing neighboring vertices are taken in each cycle. The 32 threads in the thread bundle are responsible for these 32 neighboring vertices respectively. After the calculation is completed, it is determined whether to update according to the vertex information obtained in the previous round of iteration. If an update is required, an update mark is marked, and the mailbox information of the target vertex is updated through atomic operations; otherwise, the operation ends. If the proportion is large, the "large vertex" with a large degree is selected to perform a push operation, and the "small vertex" is pulled. The pull operation of the small vertex does not involve write conflict problems, does not require the use of atomic operations, and has few neighbors, so the pull operation is more efficient. Compared with the existing unified push-pull, the push-pull proposed in the present invention is subdivided into each vertex, classified by degree, to achieve finer-grained push-pull scheduling, and further improve efficiency.

[0075] In pull mode, all vertices participate in this round of calculation, but large vertices still perform push operations. If pull operations are performed on large vertices, the intermediate results will be large and the cost of reduction will be high, so large vertices still retain the simple push operation mode.

[0076] After each round of calculation, the information in the mailbox is directly copied to the vertex information, and the active vertex array and number of the next round are obtained based on the recorded update mark. Finally, the number of active vertices is transmitted to the host to determine the execution strategy for the next round.

[0077] The GPU graph computing acceleration method for power-law distribution is as follows: Figure 3 As shown, it also includes: adopting the strategy of block work pool to achieve load balancing, specifically:

[0078] Step S100: Use the greedy strategy to divide the work pool into k parts, and number each work pool, and take Where m is the total number of edges that need to be processed in the current round of calculation;

[0079] Step S101: Each thread warp obtains its own starting work pool number w;

[0080] Step S102: Take a task from the (w+i)%kth work pool, where the task includes: a push operation or a pull operation of a vertex, and set the initial value of i to 0;

[0081] Step S103: If a task is obtained, a push operation or a pull operation is performed on the vertex corresponding to the task, and the process goes to step S102; if a task is not obtained, let i=i+1, and if i=k, the process goes to step S104; if i≠k, the process goes to step S102;

[0082] Step S104: end the task flow of this round of work pool processing, return to step S3, wait for the next round to save the active vertices in the work pool, and then go to step S100 to re-perform the next work pool processing task.

[0083] In this embodiment, the existing scheme does not consider the load balancing factor. The present invention adopts the k-work pool method to perform load balancing and deal with the imbalance caused by power-law distribution. When using a traditional single work pool, each task execution unit must obtain the task number through atomic operations, which leads to the accumulation of very heavy atomic operations on the variable performing the atomic operation, seriously affecting the efficiency of the algorithm. Because tasks are allocated according to the coarse granularity of vertices, but the number of neighbors of each vertex is different, the actual amount of calculation on each vertex is different. For example, thread warp No. 1 processes vertices with 512 neighbors, and thread warp No. 2 can process 2 vertices with 256 neighbors in the same time. Therefore, when assigning tasks, they are not assigned according to the number of vertices, but according to the actual workload. The work pool is a mode of dynamically adjusting the workload to avoid skewed task allocation. In order to alleviate this phenomenon, this scheme divides the work pool into k parts, uses k variables to share the performance pressure brought by atomic operations, and at the same time gives play to the advantages of the work pool to achieve load balancing. In general, take Where m is the total number of edges that need to be processed in this round of iteration. For rounding operations, when dividing the work pool, try to make the number of edges in each work pool close to In this embodiment, a synchronous calculation model is adopted, that is, the next round of calculation is started only after all active vertices in the working pool are calculated.

[0084] The present invention adopts a greedy strategy to divide the working pool. Although the division result obtained by the greedy strategy is not optimal, the greedy strategy is simple to implement, efficient, and the result obtained is sufficient to meet the requirements. The working pool must be divided in advance before each round of calculation, which requires that the division of the working pool should not take too long, which is the main reason for adopting the greedy strategy. For the first few rounds or the last few rounds of the algorithm, generally, very few vertices need to be processed, and k=1 is taken at this time.

[0085] The present invention uses thread bundles as units, takes tasks from k work pools, and performs calculations in thread bundles. The present invention sets a "mailbox" for each vertex. Regardless of the push-pull mode, the new results generated in this round are updated to the mailbox, and after the calculation is completed, the content in the mailbox is updated to the vertex information at one time. The purpose of this is to merge scattered and random reads and writes into an overall read and write, which is more in line with the GPU's memory access mode.

[0086] In social network analysis (SNA), the application of algorithms helps researchers extract useful information from complex social network structures. Common algorithms such as BFS (Breadth First Search), SSSP (Single Source Shortest Path), PageRank, WCC (Weakly Connected Components), and Community Detection play an important role in the analysis of node relationships and network structures in social networks.

[0087] First, BFS (Breadth First Search) is a basic algorithm for graph traversal, used to find the distance between nodes in a social network or determine whether there is a path between two points. In a social network, BFS can quickly find the friends or contact groups of a specific user, helping to analyze the path of propagation behavior or information diffusion in the network.

[0088] The SSSP (Single Source Shortest Path) algorithm is used to calculate the shortest path from one node to all other nodes in the network. This is critical in analyzing scenarios such as influence propagation and user recommendations. Through SSSP, researchers can find out how a key node in a social network can quickly influence other nodes, or how to spread information most effectively.

[0089] The WCC (weakly connected components) algorithm is used to find all weakly connected subgraphs in a graph, that is, to find connected components in the base graph of a directed graph. Social networks are often composed of multiple small groups, and WCC can effectively identify these groups and reveal the relationships between different groups.

[0090] Finally, the community detection algorithm is used to identify groups of nodes that are closely related to each other in the network. Communities usually reflect user interests, friend circles or cooperative relationships in the network. Through community detection, different interest groups or potential cooperation opportunities in social networks can be identified, and it can also be used in marketing, recommendation systems, etc. Community detection can be implemented through a graph iteration algorithm, namely label propagation, so the iterative calculation framework proposed by the present invention can also accelerate community detection.

[0091] In summary, social network analysis relies on algorithms such as BFS, SSSP, WCC and community detection, which help us better understand the complex interactions and importance of nodes in the network by revealing the relationship between nodes, group structure and information propagation mode. The application of these algorithms has become an important tool for understanding social network behavior patterns and network evolution. Technically speaking, these algorithms can be implemented through the synchronous iterative calculation model of the graph, and the framework proposed by the present invention can well support the rapid operation of the above calculations.

[0092] Embodiment 2:

[0093] This embodiment proposes a GPU graph computing acceleration device for power-law distribution, such as Figure 4 As shown, it includes: a data acquisition module, a storage and initialization module, a quantity statistics module, a mailbox setting module, an operation determination module, a data update module, a vertex update module and a result output module;

[0094] The data acquisition module is connected to the storage and initialization module, the storage and initialization module is connected to the quantity statistics module, the quantity statistics module is connected to the mailbox setting module, the mailbox setting module is connected to the operation determination module, the operation determination module is connected to the data update module, the data update module is connected to the vertex update module, the vertex update module is connected to the result output module, and the result output module is connected to the quantity statistics module;

[0095] A data acquisition module, used to acquire graph data, where the graph data conforms to a power-law distribution and includes a plurality of vertices and a plurality of edges;

[0096] A storage and initialization module, used to store the graph data using a GPU and initialize the stored graph data according to a graph algorithm;

[0097] The number counting module is used to count the number of active vertices, large vertices and small vertices in the initialized graph data, and save the active vertices in the working pool. Among them, the vertices whose out-degree or in-degree is greater than the number of threads in the working group are regarded as large vertices, the vertices whose out-degree and in-degree are not greater than the number of threads in the working group are regarded as small vertices, and the vertices participating in the current round of calculation are regarded as active vertices;

[0098] A mailbox setting module, used to set a corresponding mailbox for each vertex, wherein the mailbox is used to store the temporary result of the current round of calculation of the corresponding vertex;

[0099] An operation determination module, used for determining a push operation or a pull operation of a corresponding vertex according to the number of active vertices, the number of large vertices, and the number of small vertices, and saving the push operation or the pull operation of the corresponding vertex in a work pool;

[0100] A data update module, used to update the information in the corresponding mailbox, the next round of active vertices, and the number of round active vertices according to the push operation or pull operation of the corresponding vertex;

[0101] A vertex update module, used to update corresponding vertices using the information in the updated mailbox to obtain updated graph data;

[0102] The result output module is used to output the updated graph data as the accelerated result when the number of active vertices in the next round is zero. When the number of active vertices in the next round is not zero, it returns to the quantity statistics module, re-counts the large vertices and small vertices in the updated graph data, and performs the next round of calculation.

[0103] Embodiment 3:

[0104] This embodiment proposes an electronic device, including: one or more processors, and a memory, wherein the memory is used to store instructions and data, and when the instructions are executed by the one or more processors, the one or more processors execute the acceleration method based on GPU graph computing.

[0105] The electronic device may be a mobile phone, a computer or a tablet computer, etc., including a memory and a processor, wherein the memory stores a computer program and data, and when the computer program is executed by the processor, the GPU graph computing acceleration method for power-law distribution as described in the embodiment is implemented. It is understood that the electronic device may also include an input / output (I / O) interface and a communication component.

[0106] The processor is used to execute all or part of the steps in the GPU graph computing acceleration method for power-law distribution as described in the above embodiment. The memory is used to store various types of data, which may include instructions of any application or method in the electronic device, as well as data related to the application.

[0107] The processor can be an application specific integrated circuit (ASIC), a digital signal processor (DSP), a programmable logic device (PLD), a field programmable gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components, and is used to execute the GPU graph computing acceleration method for power-law distribution described in the above embodiments.

[0108] Embodiment 4:

[0109] This embodiment provides a computer-readable storage medium storing data and executable instructions. When the instructions are executed and implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.

[0110] The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the GPU graph computing acceleration method for power-law distribution described in the various embodiments of the present application.

[0111] The aforementioned storage media include: flash memory, hard disk, multimedia card, card-type memory (for example, SD (Secure Digital Memory Card) or DX (Memory Data Register, MDR abbreviation, memory data register) memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, CD, server, APP (Application, abbreviation of application software) application store and other media that can store program verification codes, on which computer programs are stored. When the computer program is executed by the processor, the various steps of the above-mentioned GPU graph computing acceleration method for power-law distribution can be implemented.

[0112] Embodiment 5:

[0113] This embodiment proposes a computer program product, including a computer program or instructions, which, when executed by a processor, implements the GPU graph computing acceleration method for power-law distribution.

[0114] Based on such understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a computer program product.

[0115] The various embodiments in the present application are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0116] The protection scope of the present application is not limited to the above-mentioned embodiments. Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the scope and spirit of the present disclosure. If these changes and modifications fall within the scope of the claims of the present disclosure and their equivalents, the intention of the present disclosure also includes these changes and modifications.

Claims

1. A GPU graph computing acceleration method for power-law distribution, characterized in that: include: Step S1: Acquire graph data, where the graph data conforms to a power-law distribution and includes: a plurality of vertices and a plurality of edges of the graph; Step S2: using a GPU to store the graph data, and initializing the stored graph data according to a graph algorithm; Step S3: Count the number of active vertices, large vertices, and small vertices in the initialized graph data, and save the active vertices in the work pool, wherein the vertices whose out-degree or in-degree is greater than the number of threads in the work group are regarded as large vertices, the vertices whose out-degree and in-degree are not greater than the number of threads in the work group are regarded as small vertices, and the vertices participating in the current round of calculation are regarded as active vertices; Step S4: setting a corresponding mailbox for each vertex, wherein the mailbox is used to store the temporary result of the current round of calculation of the corresponding vertex; Step S5: Determine the push operation or pull operation of the corresponding vertex according to the number of active vertices, the number of large vertices, and the number of small vertices, and save the push operation or pull operation of the corresponding vertex in the working pool; Step S6: updating the information in the corresponding mailbox, the next round of active vertices, and the number of round active vertices according to the push operation or pull operation of the corresponding vertex; Step S7: Use the information in the updated mailbox to update the corresponding vertex to obtain updated graph data; Step S8: When the number of active vertices in the next round is zero, the updated graph data is output as the accelerated result. When the number of active vertices in the next round is not zero, return to step S3, re-count the large vertices and small vertices in the updated graph data, and perform the next round of calculation.

2. The GPU graph computing acceleration method for power-law distribution according to claim 1, characterized in that: The method of using a GPU to store the graph data includes: storing structural information of the graph data in the GPU in a row-compressed form, wherein the structural information consists of a CSRO structure and a CSRI structure, wherein the CSRO structure stores outgoing edges and outgoing neighbors of all vertices, and the CSRI structure stores incoming edges and incoming neighbors of all vertices, and the CSRO structure is read in a push operation, and the CSRI structure is read in a pull operation.

3. The GPU graph computing acceleration method for power-law distribution according to claim 1, characterized in that: The stored graph data is initialized according to the graph algorithm, including: judging whether to use a push operation or a pull operation in the first round of calculation according to different types of graph algorithms, initializing active vertices in the first round, initializing the values ​​in the mailbox, and initializing the values ​​on each vertex.

4. The GPU graph computing acceleration method for power-law distribution according to claim 3, characterized in that: The determining whether to use a push operation or a pull operation in the first round of calculation according to different types of graph algorithms includes: when the graph algorithm is a BFS algorithm or a SSSP algorithm, a push operation is used for the starting vertex; when the graph algorithm is a WCC algorithm or a CDLP algorithm, a pull operation is used for the active vertices in the first round of calculation.

5. The GPU graph computing acceleration method for power-law distribution according to claim 1, characterized in that: The step of determining the push operation or pull operation of the corresponding vertex according to the number of active vertices, the number of large vertices, and the number of small vertices includes: Step S5.1: Calculate the proportion of large vertices according to the number of large vertices and the number of small vertices; Step S5.2: When the number of active vertices is greater than a preset percentage of the total number of vertices, a pull operation is performed on all currently active vertices, and the process goes to step S6; Step S5.3: When the number of active vertices is less than or equal to a preset percentage of the total number of vertices, a push operation is performed on all currently active vertices, and the process goes to step S5.4; Step S5.4: When the proportion of large vertices is greater than a first preset percentage, a push operation is performed on the large vertices and a pull operation is performed on the small vertices, and the process goes to step S6; Step S5.5: When the proportion of large vertices is less than or equal to the first preset percentage, a push operation is performed on all vertices, and the process goes to step S6.

6. The GPU graph computing acceleration method for power-law distribution according to claim 1, characterized in that: The GPU graph computing acceleration method for power-law distribution also includes: using a block work pool strategy to achieve load balancing, specifically: Step S100: Use the greedy strategy to divide the work pool into k parts, and number each work pool, and take Where m is the total number of edges that need to be processed in the current round of calculation; Step S101: Each thread warp obtains its own starting work pool number w; Step S102: Take a task from the (w+i)%kth work pool, where the task includes: a push operation or a pull operation of a vertex, and set the initial value of i to 0; Step S103: If a task is obtained, a push operation or a pull operation is performed on the vertex corresponding to the task, and the process goes to step S102; if a task is not obtained, let i=i+1, and if i=k, the process goes to step S104; if i≠k, the process goes to step S102; Step S104: end the task flow of this round of work pool processing, return to step S3, wait for the next round to save the active vertices in the work pool, and then go to step S100 to re-perform the next work pool processing task.

7. A GPU graph computing acceleration device for power-law distribution, characterized in that: include: Data acquisition module, storage and initialization module, quantity statistics module, mailbox setting module, operation determination module, data update module, vertex update module and result output module; The data acquisition module is connected to the storage and initialization module, the storage and initialization module is connected to the quantity statistics module, the quantity statistics module is connected to the mailbox setting module, the mailbox setting module is connected to the operation determination module, the operation determination module is connected to the data update module, the data update module is connected to the vertex update module, the vertex update module is connected to the result output module, and the result output module is connected to the quantity statistics module; A data acquisition module, used to acquire graph data, where the graph data conforms to a power-law distribution and includes a plurality of vertices and a plurality of edges; A storage and initialization module, used to store the graph data using a GPU and initialize the stored graph data according to a graph algorithm; The number counting module is used to count the number of active vertices, large vertices and small vertices in the initialized graph data, and save the active vertices in the working pool. Among them, the vertices whose out-degree or in-degree is greater than the number of threads in the working group are regarded as large vertices, the vertices whose out-degree and in-degree are not greater than the number of threads in the working group are regarded as small vertices, and the vertices participating in the current round of calculation are regarded as active vertices; A mailbox setting module, used to set a corresponding mailbox for each vertex, wherein the mailbox is used to store the temporary result of the current round of calculation of the corresponding vertex; An operation determination module, used for determining a push operation or a pull operation of a corresponding vertex according to the number of active vertices, the number of large vertices, and the number of small vertices, and saving the push operation or the pull operation of the corresponding vertex in a work pool; A data update module, used to update the information in the corresponding mailbox, the next round of active vertices, and the number of round active vertices according to the push operation or pull operation of the corresponding vertex; A vertex update module, used to update corresponding vertices using the information in the updated mailbox to obtain updated graph data; The result output module is used to output the updated graph data as the accelerated result when the number of active vertices in the next round is zero. When the number of active vertices in the next round is not zero, it returns to the quantity statistics module, re-counts the large vertices and small vertices in the updated graph data, and performs the next round of calculation.

8. An electronic device, characterized in that: include: One or more processors, and a memory, wherein the memory is used to store instructions and data, and when the instructions are executed by the one or more processors, the one or more processors execute the GPU graph computing acceleration method for power-law distribution as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: It stores data and executable instructions, and when the instructions are executed, the processor executes the GPU graph computing acceleration method for power-law distribution described in any one of claims 1 to 6.

10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the GPU graph computing acceleration method for power-law distribution described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Graph data processing acceleration method in heterogeneous computing environment

    CN110187968A

  • Dynamic power law diagram storage method based on LSM tree

    CN112817982A

  • Distributed graph calculation method, system and equipment

    CN115587222A

  • Optimization method for graph processing based on heterogeneous FPGA data streams

    US20210097221A1