Preprocessing method and device of graph neural network, equipment, medium and product

By optimizing node information determination and parallel execution of operations in graph neural networks, the method addresses inefficiencies in current preprocessing methods, enhancing GPU utilization and network performance.

CN119106704APending Publication Date: 2024-12-10BEIJING WODONG TIANJUN INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411216460.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Current preprocessing methods for graph neural networks affect the accuracy and stability of the network and reduce the utilization rate of GPUs, leading to inefficient computing performance due to frequent communication between processing units.

Method used

A preprocessing method that determines node information for each processing unit based on subgraphs, balances remote and local operations, and configures feature and sampling operators to execute these operations in parallel, optimizing the number of operations per thread to improve efficiency without affecting network stability or accuracy.

Benefits of technology

The method enhances preprocessing efficiency by reducing thread consumption time and maximizing GPU utilization through balanced operation adjustment and parallel execution, improving the overall performance of graph neural networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106704A_ABST
    Figure CN119106704A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a preprocessing method and device applied to a graph neural network, equipment, a medium and a product, and the method comprises the steps: determining the node information of a sampling node corresponding to each processing unit in a graphics processor according to at least one sub-graph associated with the graph neural network; for each processing unit, according to the network structure of the graph neural network and the corresponding sub-graph structure, determining a target remote node and a target local node executed by each thread by taking the quantity of remote operations and local operations processed by each thread associated with the processing unit to meet a preset condition as an optimization target; and configuring a feature acquisition operator and a sampling operator for each thread, acquiring features corresponding to the target remote node and the target local node based on the feature acquisition operator, and sampling the target remote node and the target local node based on the sampling operator. According to the technical scheme, the preprocessing efficiency of the graph neural network is improved while the performance of the graph neural network model is not affected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of information processing technology, and in particular to a preprocessing method, device, equipment, medium and product applied to a graph neural network. Background Art

[0002] In recent years, graph neural networks have attracted more and more attention in many fields such as social networks, knowledge graphs, recommendation systems and bioinformatics. In various fields, graph neural networks are usually used to learn graph structure data. The graph structure data required for graph neural network calculations can be stored in multiple processing units of the GPU (Graphics Processing Unit, GPU) on a machine. When processing the graph data in a processing unit, it is necessary to obtain the information stored in other processing units, such as the neighbor information and feature information of the node. This process of obtaining graph data can be called the preprocessing process of the graph neural network.

[0003] Currently, the preprocessing method of graph neural networks is usually to pre-fetch graph data from other processing units into local storage space in small batches, or to communicate with other processing units in real time.

[0004] When implementing the technical solution based on the above method, the inventor found the following problems:

[0005] The method of pre-fetching graph data actually transforms the computing process of the graph neural network, which will affect the accuracy and stability of the graph neural network; while the method of instant communication and frequent communication between GPU processing units will affect the computing performance of the GPU, reduce the utilization rate of the GPU, cause waste of computing resources, and have the problem of low preprocessing efficiency. Summary of the invention

[0006] The present invention provides a preprocessing method, device, equipment, medium and product applied to a graph neural network, so as to improve the preprocessing efficiency of the graph neural network without affecting the stability and accuracy of the graph neural network model.

[0007] In a first aspect, an embodiment of the present invention provides a preprocessing method applied to a graph neural network, the method comprising:

[0008] Determine node information of a sampling node corresponding to each processing unit in a graphics processor according to at least one subgraph associated with the graph neural network; wherein the sampling node corresponds to a node in the subgraph;

[0009] For each processing unit, based on the network structure of the graph neural network and the subgraph structure corresponding to the processing unit, the number of remote operations and local operations processed by at least one thread associated with the processing unit meets the preset conditions as the optimization goal, and the target remote node and target local node executed by at least one thread are determined; wherein the target local node is a sampling node in the subgraph, and the target remote node is a sampling node in other subgraphs that is directly associated with the sampling node in the processing unit;

[0010] A feature acquisition operator and a sampling operator are configured for at least one thread to acquire features corresponding to a target remote node and a target local node based on the feature acquisition operator, and to perform sampling processing on the target remote node and the target local node based on the sampling operator.

[0011] Furthermore, the method also includes:

[0012] According to a computational graph of the graph neural network, the computational graph is divided into at least one subgraph, wherein the subgraph includes at least one sampling node;

[0013] For at least one subgraph, a processing unit is allocated to the subgraph to store node information of at least one sampling node in the subgraph based on the processing unit.

[0014] Furthermore, the method also includes:

[0015] For each sampling node in the processing unit, determine the local node to be adjusted and the remote node to be adjusted associated with the current sampling node according to the network structure of the graph neural network and the subgraph structure corresponding to the processing unit; wherein the sampling node located in the processing unit and connected to the current sampling node is taken as the local node to be adjusted, and the sampling node not located in the processing unit and connected to the current sampling node is taken as the remote node to be adjusted;

[0016] A thread is assigned to each sampling node, and the number of remote operations and local operations executed by each thread in the processing unit satisfies the preset function as the optimization goal. The local node to be adjusted and the remote node to be adjusted corresponding to each thread are adjusted to obtain the target remote node and target local node corresponding to each thread.

[0017] Furthermore, the method also includes: a preset function that the number of remote operations is the same as the number of local operations, or a ratio of the number of remote operations to the number of local operations is less than or equal to a preset value.

[0018] Furthermore, the method further includes: the communication between the processing units is determined by:

[0019] For at least one processing unit, when the device access type of the device to which the current processing unit belongs is the first type, obtaining interfaces of other processing units associated with the current processing unit, so as to access the node information stored in the target storage location in the other processing units based on the interfaces;

[0020] For at least one processing unit, when the device access type of the device to which the current processing unit belongs is the second type, the memory handles of other processing units associated with the current processing unit are obtained, and an access pointer corresponding to the memory handle is generated to obtain the node information stored in the other processing units based on the access pointer.

[0021] Furthermore, the method also includes:

[0022] After configuring a feature acquisition operator and a sampling operator for at least one thread, the method further includes:

[0023] An asynchronous operation logic is configured for the remote operation corresponding to the target remote node of each thread, so as to execute the remote operation corresponding to the target remote node and the local operation corresponding to the target local node in parallel.

[0024] Furthermore, the method also includes:

[0025] The sampling operator and the feature acquisition operator that execute the target remote node in the thread are merged, so that when the sampling operator samples the target remote node, the node information of the target remote node is acquired based on the feature acquisition operator.

[0026] In a second aspect, an embodiment of the present invention further provides a preprocessing device applied to a graph neural network, the device comprising:

[0027] A node information determination module, configured to determine node information of a sampling node corresponding to each processing unit in a graphics processor according to at least one subgraph associated with the graph neural network; wherein the sampling node corresponds to a node in the subgraph;

[0028] A target node determination module is used to determine, for each processing unit, a target remote node and a target local node executed by at least one thread based on the network structure of the graph neural network and the subgraph structure corresponding to the processing unit, with the number of remote operations and local operations processed by at least one thread associated with the processing unit satisfying a preset condition as an optimization target; wherein the target local node is a sampling node in the subgraph, and the target remote node is a sampling node in other subgraphs that is directly associated with the sampling node in the processing unit;

[0029] The node execution module is used to configure a feature acquisition operator and a sampling operator for at least one thread to acquire features corresponding to a target remote node and a target local node based on the feature acquisition operator, and to perform sampling processing on the target remote node and the target local node based on the sampling operator.

[0030] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0031] one or more processors;

[0032] a storage device for storing one or more programs,

[0033] When one or more programs are executed by one or more processors, the one or more processors implement a preprocessing method applied to a graph neural network as described in any of the embodiments of the present invention.

[0034] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute a preprocessing method applied to a graph neural network as described in any of the embodiments of the present invention.

[0035] The technical solution of an embodiment of the present invention determines the node information of the sampling node corresponding to each processing unit in the graphics processor according to at least one subgraph associated with the graph neural network, wherein the sampling node corresponds to the node in the subgraph, and then, for each processing unit, based on the network structure of the graph neural network and the subgraph structure corresponding to the processing unit, the number of remote operations and local operations processed by at least one thread associated with the processing unit meets the preset conditions as the optimization goal, and determines the target remote node and target local node executed by at least one thread, wherein the target local node is the sampling node in the subgraph, and the target remote node is the sampling node in other subgraphs directly associated with the sampling node in the processing unit. Thus, a feature acquisition operator and a sampling operator are configured for each thread to obtain the features corresponding to the target remote node and the target local node based on the feature acquisition operator, and to sample and process the target remote node and the target local node based on the sampling operator. The technical solution provided in this embodiment, firstly, does not affect the stability and accuracy of the graph neural network because the graph neural network is not modified; secondly, by performing fine-grained balanced adjustment on the operations that need to be performed by the processing unit, the consumption time of the threads corresponding to each sampling node in the same processing unit is reduced, thereby improving the preprocessing efficiency of the graph neural network; further, since each thread of each processing unit can execute the calculation process of the local node and the communication process of the remote node in parallel, the communication capability and computing capability of the graphics processor are utilized to the greatest extent, thereby further improving the preprocessing efficiency of the graph neural network. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required to describe the embodiments. Obviously, the drawings introduced are only drawings of a part of the embodiments to be described in the present invention, rather than all the drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0037] Figure 1 A schematic diagram of a flow chart of a preprocessing method applied to a graph neural network provided by an embodiment of the present invention;

[0038] Figure 2 A schematic diagram of graph structure data for training a graph neural network according to an embodiment of the present invention;

[0039] Figure 3 This is an example diagram of a process for determining a target node executed by each thread of a processing unit according to an embodiment of the present invention;

[0040] Figure 4 This is an example diagram of processing each node by a feature acquisition operator and a sampling operator involved in an embodiment of the present invention;

[0041] Figure 5 A schematic flow chart of another preprocessing method applied to a graph neural network provided by an embodiment of the present invention;

[0042] Figure 6 A schematic diagram of thread execution operations after configuring asynchronous execution logic for target remote nodes of each thread according to an embodiment of the present invention;

[0043] Figure 7 A schematic diagram of operations performed by each thread in a processing unit after merging a sampling operator and a feature acquisition operator involved in an embodiment of the present invention;

[0044] Figure 8 A schematic diagram of the structure of a preprocessing device applied to a graph neural network provided by an embodiment of the present invention;

[0045] Fig. 9 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0046] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0047] Before introducing the technical solution, an exemplary description of the application scenario can be given. For example, before processing graph structure data based on a graph neural network, if it is necessary to obtain graph data from different GPU processing units, the technical solution provided by the embodiment of the present disclosure can be adopted.

[0048] Specifically, graph neural network training on large-scale graph structure data (millions / billions of nodes and edges) usually relies on a multi-GPU framework to improve performance. The multi-GPU framework can be: the graph structure data required for graph neural network calculations is stored in multiple GPU processing units on a machine, so that the GPU's memory capacity and strong bandwidth communication capabilities can be utilized. When the graph neural network is trained under the multi-GPU framework, information such as node neighbors, node features, and edge features will be stored on different GPU processing units. The training process of the graph neural network generally includes the following operations: graph sampling-graph feature acquisition-graph processing, that is, when a processing unit obtains the neighbor nodes, features, and other data required for subsequent training (i.e., graph sampling and graph feature acquisition steps), it will independently perform graph processing calculations. Among them, the two steps of graph sampling and graph feature acquisition can be called the preprocessing process of the graph neural network.

[0049] The preprocessing process under the multi-GPU framework will involve communication between multiple processing units. For example, during actual training, each processing unit will need the node information of other processing units. During this process, GPUs will communicate with each other. Intensive communication between GPUs will slow down the training speed, reduce the utilization rate of GPUs, and cause waste of computing resources. The present invention aims to improve the preprocessing efficiency of graph neural networks under the multi-GPU framework.

[0050] Figure 1 A flow chart of a preprocessing method applied to a graph neural network provided in an embodiment of the present invention. This embodiment is applicable to the situation where graph data is obtained from different GPU processing units before the graph neural network performs graph structure data processing. The method can be executed by a data processing device applied to the graph neural network. The device can be implemented in the form of software and / or hardware. The hardware can be an electronic device, and the electronic device can be a mobile terminal, a PC or a server, etc.

[0051] like Figure 1 As shown, the method includes:

[0052] S110. Determine node information of a sampling node corresponding to each processing unit in a graphics processor according to at least one subgraph associated with the graph neural network.

[0053] Among them, the graph neural network can be a neural network model for processing graph structure data. The graph structure consists of nodes and edges. The nodes represent the elements in the graph, and the edges represent the relationship between the nodes. Each node can be called a sampling node. A subgraph can be a part of a graph structure. A graphics processing unit (GPU) is a microprocessor that performs image and graphics related operations on devices such as workstations, computers, and smart phones. The GPU includes multiple streaming processing areas, each of which contains hundreds of cores. Each core is equivalent to a simplified version of the CPU, with integer and floating-point operations, as well as queuing and result collection functions. These streaming processing areas and their cores together constitute the processing unit of the GPU, which is responsible for performing various graphics processing tasks.

[0054] The sampling node corresponds to a node in the subgraph. The node information is the relevant information corresponding to the sampling node. Specifically, the node information includes the neighbor nodes of the sampling node (i.e., the nodes with connected edges to the sampling node), the node features of the sampling node, and the edge features of the two sampling nodes in a connected state.

[0055] Specifically, in the scenario of graph neural network training based on graph structure data, the graph structure data can be divided into multiple subgraphs, and the node information of the sampling nodes corresponding to each subgraph is stored in multiple different processing units of the graphics processor. Since the subgraph corresponding to each processing unit is predetermined, it is easy to obtain the node information of the sampling nodes corresponding to each processing unit.

[0056] For an exemplary diagram of graph structure data used to train a graph neural network, see Figure 2 ,like Figure 2 As shown, the graph structure data includes 6 nodes and 7 connecting edges, which can be divided into 2 subgraphs, namely: a first subgraph including node 0 (circle filled with grid), node 1 and node 2, and a second subgraph including node 3 (circle filled with left slash), node 4 and node 5, and the node information of each sampling node in the first subgraph is stored in the first processing unit of the GPU, and the node information of each sampling node in the second subgraph is stored in the second processing unit of the GPU. Based on this, when it is necessary to train the graph neural network based on the graph structure data, it is easy to determine the node information of the sampling node corresponding to each processing unit in the graphics processor according to the pre-set mapping relationship between the subgraph and the processing unit.

[0057] S120. For each processing unit, based on the network structure of the graph neural network and the subgraph structure corresponding to the processing unit, the target remote node and the target local node executed by at least one thread are determined, with the number of remote operations and local operations processed by at least one thread associated with the processing unit satisfying preset conditions as the optimization goal.

[0058] The subgraph structure is the connection relationship corresponding to each node in the subgraph. A thread is the smallest unit for computing scheduling. In this embodiment, a corresponding number of threads can be configured according to the number of sampling nodes stored in the processing unit, and each thread is used to determine other nodes associated with the corresponding sampling node and obtain feature data of each sampling node.

[0059] In this embodiment, taking any processing unit as the current processing unit as an example, if the process of data acquisition and / or data operation is performed within the local scope of the current processing unit, it can be called local operation. If data acquisition and / or data operation are required from other processing units, it can be called remote operation.

[0060] The preset condition is a pre-set rule, for example, the preset condition is that the difference between the number of remote operations and local operations processed by each thread is less than a preset threshold. In this embodiment, the purpose of setting the preset condition is to make the number of remote operations and local operations processed by each thread associated with the processing unit as balanced as possible.

[0061] The target local node is a sampling node in the subgraph, and the target remote node is a sampling node in other subgraphs that is directly associated with the sampling node in the processing unit. Based on the above exemplary embodiment, the first processing unit corresponds to the first subgraph, and the second processing unit corresponds to the second subgraph. For the first processing unit, nodes 0, 1, and 2 are local nodes; and nodes 3, 4, and 5 are remote nodes.

[0062] Specifically, the specific implementation method of determining the target remote node and the target local node corresponding to each processing unit is the same, and an example is given here where any one of the processing units is the current processing unit. For the current processing unit, it is easy to determine which local nodes the current processing unit includes based on the subgraph structure stored therein. Furthermore, the remote nodes that have a connection relationship with the local node can be determined based on the network structure of the graph neural network. Further, a thread can be configured for each local node. Generally speaking, the neighboring nodes that have a connection relationship with the current local node include three situations, the first situation is: the neighboring nodes are all local nodes, the second situation is that the neighboring nodes are all remote nodes, and the third situation is that the neighboring nodes include local nodes and remote nodes. For the first situation, the current thread only needs to perform local operations; for the second situation, the current thread only needs to perform remote operations; for the third situation, the current thread needs to perform both local operations and remote operations. In this embodiment, for each thread of the current processing unit, the optimization goal that the number of remote operations and local operations processed by each thread meets the preset conditions can be achieved by adjusting the local operations and / or remote operations. Specifically, if the local operations of a thread far exceed the local operations of other threads, the local operations can be migrated to other threads; if the remote operations of a thread far exceed the remote operations of other threads, the remote operations can be migrated to other threads. After the above adjustment method is processed, the local node of the local operation that each thread needs to execute is the target local node, and the remote node of the remote operation that needs to be executed is the target remote node.

[0063] Based on the above exemplary embodiment, see the example diagram of the process of determining the target node executed by each thread of the processing unit. Figure 3 , the second processing unit can be used as the current processing unit. According to the network structure of the graph neural network and the second subgraph structure corresponding to the second processing unit, it can be determined that the local nodes of the second processing unit include: node 3, node 4 and node 5, among which the neighbor nodes of node 3 include: local node 4 and remote node 0 (because node 4 is stored in the second processing unit, node 4 is a local node, and node 0 is stored in the first processing unit, so node 0 is a remote node); the neighbor nodes of node 4 include: local node 3 and local node 5; the neighbor nodes of node 5 include: local node 4, remote node 2 and remote node 1. For further information, see Figure 3(A) Thread 1 can be configured for node 3, thread 2 can be configured for node 4, and thread 3 can be configured for node 5. In this case, thread 1 needs to perform a local operation corresponding to local node 4 and a remote operation corresponding to remote node 0; thread 2 needs to perform a local operation corresponding to local node 3 and a local operation corresponding to local node 5; thread 3 needs to perform a local operation corresponding to local node 4, a remote operation corresponding to remote node 2, and a remote operation corresponding to remote node 1. The local operations and / or remote operations of each thread can be adjusted with the optimization goal of making the number of remote operations and local operations that need to be processed by thread 1, thread 2, and thread 3 as equal as possible. For example, the remote operation corresponding to remote node 1 that thread 3 needs to execute can be adjusted to be executed by thread 2. Based on this, the operations that each thread needs to execute after the adjustment can be seen in Figure 3 (B), that is, the target local node executed by thread 1 is local node 4, and the target remote node is remote node 0; the target local nodes executed by thread 2 are local node 3 and local node 5, and the target remote node is remote node 1; the target local node executed by thread 3 is local node 4, and the target remote node is remote node 2.

[0064] S130. Configure a feature acquisition operator and a sampling operator for at least one thread to acquire features corresponding to a target remote node and a target local node based on the feature acquisition operator, and perform sampling processing on the target remote node and the target local node based on the sampling operator.

[0065] Among them, the feature acquisition operator is a computing unit for acquiring node features. The sampling operator is a computing unit for sampling nodes. In this embodiment, the feature acquisition operator and the sampling operator are computing units belonging to the graph neural network.

[0066] Specifically, a feature acquisition operator and a sampling operator are configured for each thread of each processing unit, and any thread is taken as the current thread. For the current thread, the sampling operator can be used to sample the target remote node and / or the target local node corresponding to the current thread, and the feature acquisition operator can be used to perform feature acquisition processing on the target remote node and / or the target local node of the current thread to obtain feature information corresponding to each target remote node and / or the target local node. It should be noted that there is no temporal order relationship between the sampling process and the feature acquisition process.

[0067] Based on the above examples, see the example diagram of processing each node through the feature acquisition operator and the sampling operator. Figure 4 ,like Figure 4As shown, sampling operators and feature acquisition operators can be configured for thread 1, thread 2, and thread 3, respectively. Thus, the sampling operator configured for thread 1 can perform sampling processing on the local node 4 and remote node 0 corresponding to thread 1, and the feature acquisition operator configured for thread 1 can perform feature acquisition processing on the local node 4 and remote node 0 corresponding to thread 1 (in Figure 4 In the figure, the rectangular bars filled with grids represent sampling processing of local nodes, the rectangular bars filled with left slashes represent sampling processing of remote nodes, the rectangular bars filled with vertical lines represent feature acquisition processing of remote nodes, and the rectangular bars filled with horizontal lines represent feature acquisition processing of remote nodes); the sampling operator configured for thread 2 can perform sampling processing on local node 3, local node 5 and remote node 1 corresponding to thread 2, and the feature acquisition operator configured for thread 2 can perform feature acquisition processing on local node 3, local node 5 and remote node 1 corresponding to thread 2; the sampling operator configured for thread 3 can perform sampling processing on local node 4 and remote node 2 corresponding to thread 3, and the feature acquisition operator configured for thread 3 can perform feature acquisition processing on local node 4 and remote node 2 corresponding to thread 3.

[0068] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of the present invention are in compliance with the relevant provisions of national laws and regulations. For example, network requests are intercepted and processed with the authorization of the user.

[0069] The technical solution of an embodiment of the present invention determines the node information of the sampling node corresponding to each processing unit in the graphics processor according to at least one subgraph associated with the graph neural network, wherein the sampling node corresponds to the node in the subgraph, and then, for each processing unit, based on the network structure of the graph neural network and the subgraph structure corresponding to the processing unit, the number of remote operations and local operations processed by at least one thread associated with the processing unit meets the preset conditions as the optimization goal, and determines the target remote node and target local node executed by at least one thread, wherein the target local node is the sampling node in the subgraph, and the target remote node is the sampling node in other subgraphs directly associated with the sampling node in the processing unit. Thus, a feature acquisition operator and a sampling operator are configured for each thread to obtain the features corresponding to the target remote node and the target local node based on the feature acquisition operator, and to sample and process the target remote node and the target local node based on the sampling operator. The technical solution provided in this embodiment, firstly, does not affect the stability and accuracy of the graph neural network because the graph neural network is not modified; secondly, by performing fine-grained balanced adjustment on the operations that need to be performed by the processing unit, the consumption time of the threads corresponding to each sampling node in the same processing unit is reduced, thereby improving the preprocessing efficiency of the graph neural network; further, since each thread of each processing unit can execute the calculation process of the local node and the communication process of the remote node in parallel, the communication capability and computing capability of the graphics processor are utilized to the greatest extent, thereby further improving the preprocessing efficiency of the graph neural network.

[0070] Figure 5 A schematic diagram of another preprocessing method applied to a graph neural network provided by an embodiment of the present invention, based on the aforementioned embodiment, the steps of S110 and S120 are described in detail; in addition, after configuring a feature acquisition operator and a sampling operator for at least one thread, an asynchronous operation logic can be configured for the remote operation corresponding to the target remote node of each thread to execute the remote operation corresponding to the target remote node and the local operation corresponding to the target local node in parallel; and the sampling operator and the feature acquisition operator in the thread that execute the target remote node are merged, so that when the sampling operator samples the target remote node, the node information of the target remote node is obtained based on the feature acquisition operator. The specific implementation method can refer to the technical solution of this embodiment. Among them, the technical terms that are the same as or corresponding to the above embodiments are not repeated here.

[0071] like Figure 5 As shown, the method specifically comprises the following steps:

[0072] S210. According to the computation graph of the graph neural network, divide the computation graph into at least one sub-graph.

[0073] The subgraph includes at least one sampling node. The computation graph is the graph structure data required for graph neural network operations.

[0074] In this embodiment, if the volume of the computation graph is not large, the computation graph is a subgraph. However, if the volume of the computation graph is large, the computation graph can be divided into multiple subgraphs for the convenience of calculation and storage.

[0075] S220 . For at least one subgraph, allocate a processing unit to the subgraph to store node information of at least one sampling node in the subgraph based on the processing unit.

[0076] In this embodiment, a corresponding processing unit can be assigned to each subgraph, and the node information of the sampling nodes corresponding to each subgraph can be stored in multiple different processing units of the graphics processor, so that the memory capacity and strong bandwidth communication capability of the GPU can be efficiently utilized.

[0077] On the basis of the above-mentioned exemplary embodiment, the communication between different processing units is determined in the following manner: for at least one processing unit, when the device access type of the device to which the current processing unit belongs is of the first type, the interfaces of other processing units associated with the current processing unit are obtained to access the node information stored in the target storage location in the other processing units based on the interfaces; for at least one processing unit, when the device access type of the device to which the current processing unit belongs is of the second type, the memory handles of other processing units associated with the current processing unit are obtained, and an access pointer corresponding to the memory handle is generated to obtain the node information stored in the other processing units based on the access pointer.

[0078] Among them, the device access type is used to characterize the way in which the stored data in the device is accessed. The device access type includes a first type and a second type. The first type can be a non-volatile memory shared memory model (NVSHMEM), which allows a shared memory model to be implemented on a non-volatile memory. This model allows multiple processes or threads to simultaneously access and operate data stored in a non-volatile memory, thereby achieving efficient parallel computing and data sharing. The second type can be a peer-to-peer model (P2P). This communication protocol is mainly used for the connection between a central processing unit (CPU) and a graphics processing unit (GPU), and can also be used for interconnection between multiple graphics processors. The memory handle is used to identify the allocated memory blocks so that these memory blocks can be read or released.

[0079] In this embodiment, the device access type of the device to which the current processing unit belongs is different, and accordingly, the communication mode between the processing units is different. Specifically, if the device access type of the device to which the current processing unit belongs is the first type, that is, NVSHMEM, the interface of other processing units that establish a communication relationship with the current processing unit can be obtained, and according to the address information contained in the interface, the node information stored in the target storage location in the other processing units can be accessed. For example, the interface provided by NVSHMEM and the corresponding meaning of the interface are shown in Table 1, and the data on other GPU processing units can be viewed through these interfaces.

[0080] Table 1 Example of interfaces provided by NVSHMEM and their corresponding meanings

[0081]

[0082]

[0083] If the device access type of the device to which the current processing unit belongs is the second type, that is, the P2P model, the interfaces provided by the P2P model and the corresponding meanings of the interfaces are shown in Table 2. Through these interfaces, the data on other processing units can be viewed. For example, through the interface "cudaDeviceCanAccessPeer", it can be checked whether P2P is supported between devices, and then, "cudaIpcGetMemHandle" is used to generate the memory handle of this device. Further, NCCL communication is used to transfer the handle. Finally, "cudaIpcOpenMemHandle" is used to generate an access pointer that can be directly accessed to obtain the node information stored in other processing units based on the access pointer.

[0084] Table 2 Example of interfaces provided by the P2P model and their corresponding meanings

[0085]

[0086] In this embodiment, the processing units can communicate with each other through the first type or the first type of communication method, which improves the applicability of data communication between the processing units.

[0087] S230. For each sampling node in the processing unit, determine the local node to be adjusted and the remote node to be adjusted associated with the current sampling node based on the network structure of the graph neural network and the subgraph structure corresponding to the processing unit.

[0088] Among them, the local node to be adjusted is a local node that needs further adjustment, and the sampling node located in the processing unit and connected to the current sampling node is used as the local node to be adjusted; the remote node to be adjusted is a remote node that needs further adjustment, and the sampling node not located in the processing unit and connected to the current sampling node is used as the remote node to be adjusted.

[0089] In this embodiment, for the local node in the current processing unit, other local nodes connected to the current local node can be determined according to the subgraph structure of the current processing unit, and these local nodes are the local nodes to be adjusted. According to the network structure of the graph neural network and the subgraph structure corresponding to the processing unit, it can be determined which remote nodes are needed to process the current local node, and these remote nodes are the remote nodes to be adjusted.

[0090] S240, assigning a thread to each sampling node, and taking the number of remote operations and local operations executed by each thread in the processing unit satisfying a preset function as an optimization goal, adjusting the local node to be adjusted and the remote node to be adjusted corresponding to each thread to obtain the target remote node and the target local node corresponding to each thread.

[0091] In this embodiment, the preset function is that the number of remote operations and local operations is the same, or the ratio of the number of remote operations to the number of local operations is less than or equal to a preset value. The first preset function can be understood as: the number of remote operations of each thread corresponding to the current processing unit is the same, and the number of local operations of each thread corresponding to the current processing unit is the same, for example, the number of local operations of thread 1, thread 2 and thread 3 is M, and the number of remote operations of thread 1, thread 2 and thread 3 is N. The second preset function can be understood as: the ratio of remote operations to local operations of each processing unit is less than or equal to a preset value (i.e., a fixed value that is expected to be set), for example, the ratio of remote operations to local operations of thread 1 is less than or equal to S, the ratio of remote operations to local operations of thread 2 is less than or equal to S, and the ratio of remote operations to local operations of thread 3 is less than or equal to S. The preset function can balance the operation workload of each thread.

[0092] In this embodiment, a thread is assigned to each sampling node of the current processing unit. At this time, the local node to be adjusted and the remote node to be adjusted corresponding to each thread are determined by default. However, at this time, there is an imbalance problem in the remote operations and / or local operations performed by each thread. For example, the operation workload of some threads is large, while the operation workload of some threads is small. This makes the threads with large workloads idle for a long time during the execution process, resulting in low overall processing efficiency of the current processing unit. Therefore, the local node to be adjusted and the remote node to be adjusted of each thread can be adjusted with the number of remote operations and local operations executed by each thread in the processing unit satisfying the preset function as the optimization goal. After the adjustment, the local node that each thread needs to execute is the target local node, and the remote node that needs to be executed is the target remote node, thereby balancing the workload of each thread of the current processing unit and improving the processing efficiency of the current processing unit.

[0093] S250: Configure asynchronous operation logic for the remote operation corresponding to the target remote node of each thread, so as to execute the remote operation corresponding to the target remote node and the local operation corresponding to the target local node in parallel.

[0094] In this embodiment, asynchronous operation logic is configured for the remote operation in each thread of the current processing unit. Thus, for any thread, the remote operation corresponding to the target remote node and the local operation corresponding to the target local node can be executed in parallel. Since the local operation takes a short time and the remote operation takes a long time, the remote operation can basically hide the local operation, further shortening the overall execution time of the current processing unit and improving processing efficiency.

[0095] For an exemplary diagram of the thread execution operation after configuring the asynchronous execution logic for the target remote node of each thread, see Figure 6 ,like Figure 6 As shown, for thread 1 of the current processing unit, the remote operation corresponding to the target remote node 0 and the local operation corresponding to the target local node 4 are executed in parallel, the total operation duration of thread 1 is T1, and the time consumption of the local operation corresponding to the target local node 4 is hidden. Similarly, the total operation durations of thread 2 and thread 3 are both T1.

[0096] S260. Configure a feature acquisition operator and a sampling operator for at least one thread to acquire features corresponding to a target remote node and a target local node based on the feature acquisition operator.

[0097] S270. Merge the sampling operator and the feature acquisition operator that execute the target remote node in the thread, so that when the sampling operator samples the target remote node, the node information of the target remote node is acquired based on the feature acquisition operator.

[0098] In this embodiment, the sampling operator and the feature acquisition operator of the target remote node in the thread can be merged. This is because the feature acquisition operation performed by the feature acquisition operator is to find the features of the sampled neighbor nodes, so the sampling operator and the feature acquisition operator can be merged. Thus, when the sampling operator samples the target remote node, the node information of the target remote node can be obtained based on the feature acquisition operator, that is, when the thread performs the remote operation, after sampling the neighbor node, it will access the specific features of the neighbor node. The reason for this design is as follows: in actual calculation, the sampling operator generally implements at least two kernel functions. The first kernel function will first calculate the size of the sampling result. For example, if the number of neighbors of some nodes is not enough or there is no node, the specified number of neighbors cannot be sampled. The result is calculated by the first kernel function and the space is allocated. Then the second kernel function will actually perform sampling and put the result in the allocated space. Both kernel functions will perform remote operations. Similarly, for the feature acquisition operator, at least two kernel functions will be implemented. The feature length is calculated by a pre-kernel function, and the space is further allocated. After merging the two sampling operators and the feature acquisition operator, at least four kernel functions can be merged into two kernel functions, reducing the two allocations to one allocation. The merger of the two operators can reduce the amount of communication between GPUs, reduce the number of kernel functions, and further shorten the overall execution time.

[0099] Based on the above exemplary embodiment, after the sampling operator and the feature acquisition operator are combined, the schematic diagram of the execution operation of each thread in the processing unit can be seen in Figure 7 , Figure 7 The gray-filled rectangular bar corresponding to thread 1 represents sampling the target local node 4 from the current processing unit and obtaining the feature data corresponding to the target local node 4; the black-filled rectangular bar corresponding to thread 1 represents the overall operator after the sampling operator and the feature acquisition operator are merged. When the sampling operator samples the target remote node, the overall process of obtaining the node information of the target remote node based on the feature acquisition operator.

[0100] The technical solution of the embodiment of the present invention divides the computational graph into at least one subgraph based on the computational graph of the graph neural network, thereby assigning a corresponding processing unit to each subgraph, and storing the node information of the sampling nodes corresponding to each subgraph in multiple different processing units of the graphics processor, which can efficiently utilize the memory capacity and powerful bandwidth communication capability of the GPU; further, for each sampling node in the processing unit, based on the network structure of the graph neural network and the subgraph structure corresponding to the processing unit, determine the local node to be adjusted and the remote node to be adjusted associated with the current sampling node; then, assign a thread to each sampling node, and take the number of remote operations and local operations executed by each thread in the processing unit to satisfy the preset function as the optimization goal, adjust the local node to be adjusted and the remote node to be adjusted corresponding to each thread, and obtain the target remote node corresponding to each thread. The process node and the target local node are connected, thereby balancing the workload of each thread of the current processing unit and improving the processing efficiency of the current processing unit; subsequently, the asynchronous operation logic can be configured for the remote operation corresponding to the target remote node for each thread, so as to execute the remote operation corresponding to the target remote node and the local operation corresponding to the target local node in parallel. The remote operation can basically hide the local operation, further shortening the overall execution time of the current processing unit and improving the processing efficiency; in addition, the sampling operator and the feature acquisition operator that execute the target remote node in the thread can be merged, so that when the sampling operator samples the target remote node, the node information of the target remote node is obtained based on the feature acquisition operator. The merger of the two operators can reduce the amount of communication between GPUs, reduce the number of kernel functions, shorten the overall execution time, and further improve the preprocessing efficiency of the graph neural network.

[0101] Figure 8 A structural schematic diagram of a preprocessing device applied to a graph neural network provided in an embodiment of the present invention, the device includes: a node information determination module 310, a target node determination module 320 and a node execution module 330.

[0102] The node information determination module 310 is used to determine the node information of the sampling node corresponding to each processing unit in the graphics processor according to at least one subgraph associated with the graph neural network; wherein the sampling node corresponds to the node in the subgraph;

[0103] The target node determination module 320 is used to determine, for each processing unit, the target remote node and the target local node executed by at least one thread based on the network structure of the graph neural network and the subgraph structure corresponding to the processing unit, with the number of remote operations and local operations processed by at least one thread associated with the processing unit satisfying a preset condition as the optimization target; wherein the target local node is a sampling node in the subgraph, and the target remote node is a sampling node in other subgraphs directly associated with the sampling node in the processing unit;

[0104] The node execution module 330 is used to configure a feature acquisition operator and a sampling operator for at least one thread to acquire features corresponding to the target remote node and the target local node based on the feature acquisition operator, and to perform sampling processing on the target remote node and the target local node based on the sampling operator.

[0105] Based on the above device, optionally, the node information determination module 310 includes:

[0106] A subgraph determination unit, configured to divide the computation graph into at least one subgraph according to the computation graph of the graph neural network, wherein the subgraph includes at least one sampling node;

[0107] The node information determining unit is used to allocate a processing unit to at least one subgraph to store node information of at least one sampling node in the subgraph based on the processing unit.

[0108] Based on the above device, optionally, the input source associated information includes at least one parent table, a child table associated with the parent table, upstream information of the parent table and the child table, fields in the parent table and the child table, application fields, and at least one of data processing rules.

[0109] Based on the above device, optionally, the target node determination module 320 includes:

[0110] A node determination unit to be adjusted is used to determine, for each sampling node in the processing unit, a local node to be adjusted and a remote node to be adjusted associated with the current sampling node according to the network structure of the graph neural network and the subgraph structure corresponding to the processing unit; wherein the sampling node located in the processing unit and connected to the current sampling node is taken as the local node to be adjusted, and the sampling node not located in the processing unit and connected to the current sampling node is taken as the remote node to be adjusted;

[0111] The target node determination unit is used to allocate a thread to each sampling node, and takes the number of remote operations and local operations executed by each thread in the processing unit satisfying a preset function as the optimization goal, adjusts the local node to be adjusted and the remote node to be adjusted corresponding to each thread, and obtains the target remote node and target local node corresponding to each thread.

[0112] Based on the above device, optionally, the preset function is that the number of remote operations is the same as the number of local operations, or the ratio of the number of remote operations to the number of local operations is less than or equal to a preset value.

[0113] Based on the above-mentioned device, optionally, the communication between the processing units is determined in the following manner: for at least one processing unit, when the device access type of the device to which the current processing unit belongs is of the first type, the interfaces of other processing units associated with the current processing unit are obtained to access the node information stored in the target storage location in the other processing units based on the interface; for at least one processing unit, when the device access type of the device to which the current processing unit belongs is of the second type, the memory handles of other processing units associated with the current processing unit are obtained, and an access pointer corresponding to the memory handle is generated to obtain the node information stored in the other processing units based on the access pointer.

[0114] Based on the above-mentioned device, optionally, the preprocessing device also includes: an asynchronous logic configuration module, which is specifically used to configure asynchronous operation logic for the remote operation corresponding to the target remote node for each thread, so as to execute the remote operation corresponding to the target remote node and the local operation corresponding to the target local node in parallel.

[0115] Based on the above-mentioned device, optionally, the preprocessing device also includes: an operator merging module, which is specifically used to merge the sampling operator and the feature acquisition operator in the thread that execute the target remote node, so that when the sampling operator samples the target remote node, the node information of the target remote node is obtained based on the feature acquisition operator.

[0116] The technical solution of an embodiment of the present invention determines the node information of the sampling node corresponding to each processing unit in the graphics processor according to at least one subgraph associated with the graph neural network, wherein the sampling node corresponds to the node in the subgraph, and then, for each processing unit, based on the network structure of the graph neural network and the subgraph structure corresponding to the processing unit, the number of remote operations and local operations processed by at least one thread associated with the processing unit meets the preset conditions as the optimization goal, and determines the target remote node and target local node executed by at least one thread, wherein the target local node is the sampling node in the subgraph, and the target remote node is the sampling node in other subgraphs directly associated with the sampling node in the processing unit. Thus, a feature acquisition operator and a sampling operator are configured for each thread to obtain the features corresponding to the target remote node and the target local node based on the feature acquisition operator, and to sample and process the target remote node and the target local node based on the sampling operator. The technical solution provided in this embodiment, firstly, does not affect the stability and accuracy of the graph neural network because the graph neural network is not modified; secondly, by performing fine-grained balanced adjustment on the operations that need to be performed by the processing unit, the consumption time of the threads corresponding to each sampling node in the same processing unit is reduced, thereby improving the preprocessing efficiency of the graph neural network; further, since each thread of each processing unit can execute the calculation process of the local node and the communication process of the remote node in parallel, the communication capability and computing capability of the graphics processor are utilized to the greatest extent, thereby further improving the preprocessing efficiency of the graph neural network.

[0117] The preprocessing device applied to the graph neural network provided by the embodiment of the present invention can execute the preprocessing method applied to the graph neural network provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0118] It is worth noting that the various units and modules included in the above system are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.

[0119] Fig. 9 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Fig. 9 A block diagram of an exemplary electronic device 40 suitable for implementing exemplary embodiments of the present invention is shown. Fig. 9 The electronic device 40 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0120] like Fig. 9As shown, the electronic device 40 is in the form of a general computing device. The components of the electronic device 40 may include but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 connecting different system components (including the system memory 402 and the processing unit 401).

[0121] Bus 403 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.

[0122] The electronic device 40 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 40, including volatile and non-volatile media, removable and non-removable media.

[0123] System memory 402 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 404 and / or cache memory 405. Electronic device 40 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 406 may be used to read and write non-removable, non-volatile magnetic media ( Fig. 9 not shown, usually called a "hard drive"). Although Fig. 9 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 403 via one or more data medium interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.

[0124] A program / utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 407 generally perform the functions and / or methods of the embodiments described herein.

[0125] The electronic device 40 may also communicate with one or more external devices 409 (e.g., keyboards, pointing devices, displays 410, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 40, and / or may communicate with any device that enables the electronic device 40 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 411. Furthermore, the electronic device 40 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 412. As shown, the network adapter 412 communicates with other modules of the electronic device 40 via the bus 403. It should be understood that although Fig. 9 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 40, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0126] The processing unit 401 executes various functional applications and page processing by running the programs stored in the system memory 402, such as implementing the preprocessing method applied to the graph neural network provided in the embodiment of the present invention.

[0127] An embodiment of the present invention further provides a storage medium containing computer executable instructions, which, when executed by a computer processor, is used to execute a preprocessing method applied to a graph neural network, the method comprising:

[0128] Determine node information of a sampling node corresponding to each processing unit in a graphics processor according to at least one subgraph associated with the graph neural network; wherein the sampling node corresponds to a node in the subgraph;

[0129] For each processing unit, based on the network structure of the graph neural network and the subgraph structure corresponding to the processing unit, the number of remote operations and local operations processed by at least one thread associated with the processing unit meets the preset conditions as the optimization goal, and the target remote node and target local node executed by at least one thread are determined; wherein the target local node is a sampling node in the subgraph, and the target remote node is a sampling node in other subgraphs that is directly associated with the sampling node in the processing unit;

[0130] A feature acquisition operator and a sampling operator are configured for at least one thread to acquire features corresponding to a target remote node and a target local node based on the feature acquisition operator, and to perform sampling processing on the target remote node and the target local node based on the sampling operator.

[0131] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0132] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0133] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0134] Computer program code for performing the operation of embodiments of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0135] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A preprocessing method applied to graph neural network, characterized in that: include: Determine node information of a sampling node corresponding to each processing unit in a graphics processor according to at least one subgraph associated with the graph neural network; wherein the sampling node corresponds to a node in the subgraph; For each of the processing units, according to the network structure of the graph neural network and the subgraph structure corresponding to the processing unit, the number of remote operations and local operations processed by at least one thread associated with the processing unit meets a preset condition as an optimization goal, and the target remote node and the target local node executed by the at least one thread are determined; wherein the target local node is a sampling node in the subgraph, and the target remote node is a sampling node in other subgraphs that is directly associated with the sampling node in the processing unit; A feature acquisition operator and a sampling operator are configured for the at least one thread to acquire features corresponding to a target remote node and a target local node based on the feature acquisition operator, and to perform sampling processing on the target remote node and the target local node based on the sampling operator.

2. The method according to claim 1, characterized in that The step of determining the node information of the sampling node corresponding to each processing unit in the graphics processor according to at least one subgraph associated with the graph neural network includes: According to the computation graph of the graph neural network, the computation graph is divided into at least one subgraph, wherein the subgraph includes at least one sampling node; For the at least one subgraph, a processing unit is allocated to the subgraph to store node information of the at least one sampling node in the subgraph based on the processing unit.

3. The method according to claim 1, characterized in that: The method of determining a target remote node and a target local node executed by at least one thread based on the network structure of the graph neural network and the subgraph structure corresponding to the processing unit and taking the number of remote operations and local operations processed by at least one thread associated with the processing unit satisfying a preset condition as an optimization goal includes: For each sampling node in the processing unit, determine the local node to be adjusted and the remote node to be adjusted associated with the current sampling node according to the network structure of the graph neural network and the subgraph structure corresponding to the processing unit; wherein the sampling node located in the processing unit and connected to the current sampling node is taken as the local node to be adjusted, and the sampling node not located in the processing unit and connected to the current sampling node is taken as the remote node to be adjusted; A thread is allocated to each sampling node, and the number of remote operations and local operations executed by each thread in the processing unit satisfies a preset function as an optimization goal, and the local node to be adjusted and the remote node to be adjusted corresponding to each thread are adjusted to obtain the target remote node and the target local node corresponding to each thread.

4. The method according to claim 1 or 3, characterized in that: The preset function is that the number of the remote operations is the same as the number of the local operations, or that the ratio of the number of remote operations to the number of local operations is less than or equal to a preset value.

5. The method according to claim 1, characterized in that The communication between the processing units is determined in the following manner: For at least one processing unit, when the device access type of the device to which the current processing unit belongs is the first type, obtaining interfaces of other processing units associated with the current processing unit, so as to access the node information stored in the target storage location in the other processing units based on the interfaces; For at least one processing unit, when the device access type of the device to which the current processing unit belongs is the second type, the memory handles of other processing units associated with the current processing unit are obtained, and an access pointer corresponding to the memory handle is generated to obtain the node information stored in the other processing units based on the access pointer.

6. The method according to claim 1, characterized in that After configuring a feature acquisition operator and a sampling operator for the at least one thread, the method further includes: An asynchronous operation logic is configured for the remote operation corresponding to the target remote node of each thread, so as to execute the remote operation corresponding to the target remote node and the local operation corresponding to the target local node in parallel.

7. The method according to claim 1 or 6, characterized in that: The method further comprises: The sampling operator and the feature acquisition operator that execute the target remote node in the thread are merged, so that when the sampling operator samples the target remote node, the node information of the target remote node is acquired based on the feature acquisition operator.

8. A preprocessing device applied to a graph neural network, characterized in that: include: A node information determination module, configured to determine node information of a sampling node corresponding to each processing unit in a graphics processor according to at least one subgraph associated with the graph neural network; wherein the sampling node corresponds to a node in the subgraph; A target node determination module is used to determine, for each of the processing units, a target remote node and a target local node executed by at least one thread, based on the network structure of the graph neural network and the subgraph structure corresponding to the processing unit, with the number of remote operations and local operations processed by at least one thread associated with the processing unit satisfying a preset condition as an optimization goal; wherein the target local node is a sampling node in the subgraph, and the target remote node is a sampling node in other subgraphs that is directly associated with the sampling node in the processing unit; A node execution module is used to configure a feature acquisition operator and a sampling operator for the at least one thread, so as to acquire features corresponding to the target remote node and the target local node based on the feature acquisition operator, and to perform sampling processing on the target remote node and the target local node based on the sampling operator.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the preprocessing method applied to the graph neural network as described in any one of claims 1-7.

10. A storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the preprocessing method applied to a graph neural network as described in any one of claims 1 to 7.

11. A computer program product, characterized in that The computer program product comprises a computer program which, when executed by a processor, implements the preprocessing method applied to a graph neural network according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Neural network processing method and device, neural network information processing method and device and computer equipment

    CN115358379A

  • Big data set training for accelerating heterogeneous graph neural network and related products

    CN117610616A

  • Method and apparatus for GNN-acceleration for efficient parallel processing of massive datasets

    US20230418673A1

Cited By

  • Graph neural network training method and device, medium, product and graph processing cluster

    CN120409541A

  • Graph neural network training methods, devices, media, products, and graphics processing clusters

    CN120409541B