Data processing method and device, equipment, medium and product
By determining the target processing unit based on the node identification and storage mapping relationship in the graph neural network and performing distributed data sampling processing, the problem of low efficiency of large-scale graph data processing in the prior art is solved, and efficient parallel processing is achieved.
Patent Information
- Application Number
- CN202411196324.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-06
AI Technical Summary
In the prior art, graph data processing methods based on video memory or memory have problems such as scale limitations and low data processing efficiency for large-scale graph data processing, especially when data exchange and movement between CPU and GPU are frequently performed.
By determining the target processing unit based on the node identification and storage mapping relationship of the node to be sampled, and performing parallel data sampling processing based on distributed storage data, data exchange between the CPU and the GPU is reduced and data processing efficiency is improved.
It realizes efficient processing of large-scale graph data, improves data processing efficiency, and ensures consistency between the order of requested nodes and the order of final processing results.
Smart Images

Figure CN119089006A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular, to a data processing method, device, equipment, medium and product applied to graph neural networks. 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 structured data. In the process of learning data, graph structured data needs to be processed, for example, processing operations include storage, sampling, roaming, and feature extraction.
[0003] Currently, there are three ways to process graph data:
[0004] The first method is a data processing method based on memory. This method stores graph data in memory, moves small batches of graph data to video memory during model training, and trains these small batches of graph data based on GPU (Graphics Processing Unit, GPU). The second method is a data processing method based on video memory. This method stores graph data in video memory and trains these graph data on GPU. The third method is a data processing method based on hybrid memory. This method stores graph data in multiple storage devices such as video memory, main memory, and disk, and stores small batches of graph data required for forward and backward network calculations of the current network in the GPU.
[0005] When implementing the technical solution based on the above method, the inventor found the following problems:
[0006] The first and second methods use video memory to store graph data, which has limitations on the size of the graph and cannot support the processing of large-scale graph data. The third method is to perform data sampling on the CPU (Central Processing Unit) and perform calculations on the GPU, which requires frequent data exchange and movement between the CPU and GPU, and has the problem of low data processing efficiency. Summary of the invention
[0007] The present invention provides a data processing method, device, equipment, medium and product applied to a graph neural network to achieve the technical effect of improving the efficiency of graph data processing.
[0008] In a first aspect, an embodiment of the present invention provides a data processing method applied to a graph neural network, the method comprising:
[0009] According to the node identifier and storage mapping relationship of the node to be sampled, at least one target processing unit storing the node to be sampled and the node interaction information are determined; the target processing unit is a unit in a graphics processor, the graphics processor is located in the same target device or in different target devices, the storage mapping relationship includes a correspondence between the node identifier, the unit to be run and the identifier of the processing device to which the unit to be run belongs, and the target processing unit is a processing unit in the unit to be run;
[0010] For the at least one target processing unit, according to the node interaction information, the node information corresponding to the current target processing unit is sent to the interaction processing unit associated with the current target processing unit, and data sampling processing is performed based on the distributed storage data in each of the target processing units to obtain the data processing result corresponding to each target processing unit; wherein the interaction processing unit is a processing unit in the at least one target processing unit;
[0011] For the at least one target processing unit, feeding back the data processing result corresponding to the current target processing unit to the interaction processing unit according to the node interaction information;
[0012] Based on the sorting of the received data processing results and the obtained data processing results by each target processing unit, the target processing results corresponding to the node to be sampled are obtained.
[0013] Further, the storage mapping relationship is determined in the following manner:
[0014] Determine at least one subgraph corresponding to the graph neural network; wherein the subgraph includes at least one sampling node;
[0015] Determine the processing device corresponding to each subgraph and the unit to be run in the processing device, and determine the storage mapping relationship based on the processing device identifier of the processing device, the unit to be run, the node identifier in the subgraph and the node interaction information of at least one subgraph.
[0016] Further, determining the distributed storage data in the unit to be run includes:
[0017] For each subgraph, determining an associated subgraph associated with the current subgraph according to node interaction information between the current subgraph and other subgraphs;
[0018] For at least one sampling node in the current subgraph, determining an associated node associated with the current sampling node according to a node sampling order of the at least one sampling node, the current subgraph, and the associated subgraph, wherein the associated node includes a local node and / or a remote node;
[0019] The distributed storage data of the current subgraph is determined according to the associated nodes associated with each sampling node and the connection edge information between the associated nodes and the sampling nodes.
[0020] Further, the determining of the distributed storage data of the current subgraph according to the associated nodes associated with each sampling node and the connection edge information between the associated nodes and the sampling nodes includes:
[0021] For each sampling node, determining a first row of sub-data and a second row of sub-data in the distributed storage data according to the node identifier of the current sampling node, the association identifier of the associated node, and the number of nodes of the associated node, wherein the first row of sub-data is used to store the number of nodes in the second row of sub-data from which the associated node of the current sampling node is read, and the second row of sub-data is used to store the association identifier of the associated node associated with the current sampling node;
[0022] Determine the weight corresponding to the association identifier in the third row of sub-data according to the edge connection information between the association identifier of each association node in the second row of sub-data and the corresponding sampling node;
[0023] Distributed storage data corresponding to the current subgraph is determined according to the first row of sub-data, the second row of sub-data, and the third row of sub-data.
[0024] Furthermore, after obtaining the distributed storage data, the method further includes:
[0025] For the distributed storage data of each sub-graph, the distributed storage data corresponding to the current sub-graph is stored in the waiting-to-run unit corresponding to the current sub-graph, and the address handle corresponding to the distributed storage data is obtained, so that each target processing unit samples and processes the data in the interactive processing unit and / or the target processing unit based on the address handle.
[0026] Further, according to the node interaction information, the node information corresponding to the current target processing unit is sent to the interaction processing unit associated with the current target processing unit, and data sampling processing is performed based on the distributed storage data in each of the target processing units to obtain the data processing result corresponding to each target processing unit, including:
[0027] Determining an interactive processing unit associated with the current target processing unit according to the node interaction information;
[0028] The node information of the current target processing unit is sent to the interactive processing unit, so that the current target processing unit samples and processes the distributed storage data based on the address handle in the node information, and the interactive processing unit obtains the processing result of the current target processing unit based on the acquired address handle, and samples and processes the corresponding distributed storage data based on the address handle in the interactive processing unit to obtain the data processing result corresponding to the current target processing unit.
[0029] Furthermore, the step of sorting the received data processing results and the obtained data processing results based on each target processing unit to obtain the target processing result corresponding to the node to be sampled includes:
[0030] According to the node execution order of the sampling nodes corresponding to each target processing unit, the data processing results acquired by each target processing unit are sorted and processed to obtain the target processing results corresponding to the nodes to be sampled.
[0031] In a second aspect, an embodiment of the present invention further provides a data processing device applied to a graph neural network, the device comprising:
[0032] An information determination module is used to determine at least one target processing unit storing the node to be sampled and node interaction information according to the node identifier and storage mapping relationship of the node to be sampled; the target processing unit is a unit in a graphics processor, and the graphics processor is located in the same target device or different target devices. The storage mapping relationship includes a correspondence between the node identifier, the unit to be run, and the identifier of the processing device to which the unit to be run belongs, and the target processing unit is a processing unit in the unit to be run;
[0033] A data processing result determination module is used for sending the node information corresponding to the current target processing unit to the interactive processing unit associated with the current target processing unit according to the node interaction information, and performing data sampling processing based on the distributed storage data in each of the target processing units to obtain the data processing result corresponding to each target processing unit; wherein the interactive processing unit is a processing unit in the at least one target processing unit;
[0034] A result feedback module, configured to feed back the data processing result corresponding to the current target processing unit to the interactive processing unit according to the node interaction information, for the at least one target processing unit;
[0035] The target processing result determination module is used to sort the received data processing results and the obtained data processing results based on each target processing unit to obtain the target processing result corresponding to the node to be sampled.
[0036] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0037] one or more processors;
[0038] a storage device for storing one or more programs,
[0039] When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method applied to the graph neural network as described in any of the embodiments of the present invention.
[0040] 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 data processing method applied to a graph neural network as described in any of the embodiments of the present invention.
[0041] In a fifth aspect, an embodiment of the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, is used to execute a data processing method applied to a graph neural network as described in any one of the embodiments of the present invention.
[0042] The technical solution of the embodiment of the present invention determines at least one target processing unit storing the node to be sampled and the node interaction information according to the node identification and storage mapping relationship of the node to be sampled; then, according to the node interaction information, the node information of the current target processing unit is sent to other interaction processing units associated with the current target processing unit, and data sampling processing is performed based on the distributed storage data in each target processing unit to obtain the data processing result corresponding to each target processing unit; wherein the interaction processing unit is a processing unit in at least one target processing unit; for at least one target processing unit, the data processing result corresponding to the current target processing unit is fed back to the interaction processing unit according to the node interaction information Interprocessing unit; based on the sorting of the received data processing results and the obtained data processing results by each target processing unit, the target processing results corresponding to the node to be sampled are obtained, which solves the problem of low data processing efficiency in the prior art of graph data processing based on video memory or internal memory, and realizes the determination of at least one target processing unit and node interaction information storing the node to be sampled based on the node identification and storage mapping relationship of the node to be sampled, and then, the node information of the current target processing unit is sent to other interactive processing units associated with the current target processing unit through the node interaction information, so that each target processing unit can perform data sampling processing in parallel, thereby improving data processing efficiency. Furthermore, by sorting the obtained data processing results by each target processing unit, the target processing results corresponding to the node to be sampled are obtained, ensuring that the order of the requesting nodes is consistent with the order of the final processing results, facilitating subsequent data processing and improving processing speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] 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.
[0044] Figure 1 A schematic diagram of a data processing method applied to a graph neural network provided by an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of a data processing method between multiple CPUs of devices provided in an embodiment of the present invention;
[0046] Figure 3 A schematic diagram for representing a full image provided by an embodiment of the present invention;
[0047] Figure 4A schematic diagram of a data processing method between multiple CPUs in a device provided by an embodiment of the present invention;
[0048] Figure 5 A flow chart of a data processing method applied to a graph neural network provided by an embodiment of the present invention;
[0049] Figure 6 A schematic diagram for representing distributed storage data provided by an embodiment of the present invention;
[0050] Figure 7 A flow chart of a method for storing distributed storage data provided by an embodiment of the present invention;
[0051] Figure 8 A schematic diagram of the structure of a graph deep learning framework provided by an embodiment of the present invention;
[0052] Fig. 9 A schematic diagram of the structure of a data processing device applied to a graph neural network provided by an embodiment of the present invention;
[0053] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] 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.
[0055] Before introducing the technical solution, an exemplary description of the application scenario can be given. For example, when data processing is performed based on a graph neural network, if the processing of graph data is involved, the technical solution provided by the embodiment of the present disclosure can be adopted.
[0056] Figure 1 A flow chart of a data processing method applied to a graph neural network provided in an embodiment of the present invention. This embodiment is applicable to the situation of processing graph data. The method can be executed by a data processing device applied to a 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.
[0057] like Figure 1 As shown, the method includes:
[0058] S110 . Determine at least one target processing unit storing the node to be sampled and node interaction information according to the node identifier and storage mapping relationship of the node to be sampled.
[0059] The target processing unit is a unit in a graphics processor. A graphics processor may be a processor for processing graphics data, and a target processing unit is a computing unit in a GPU for processing graphics data. The graphics processor is located in the same target device or in different target devices. The target device may be understood as a computer device. That is, different graphics processors may be deployed on the same target device, and this mode is called single-machine multi-card; different graphics processors may also be deployed in different target devices, and this mode is called multi-machine multi-card. The node to be sampled may refer to a node to be sampled, and the node may be a node in graph structure data. For example, the node may be used to represent information such as a user, an item, a store, or a book. The node identifier may be used to represent the uniqueness of the node. The storage mapping relationship includes a correspondence between a node identifier, a unit to be run, and an identifier of a processing device to which the unit to be run belongs. The identifier of a processing device may be used to represent the uniqueness of a processing device, and the processing device is a computer device. The target processing unit is a processing unit in a unit to be run. For example, GPU0, GPU1, and GPU2 are units to be run, and GPU0 and GPU1 are target processing units. The node interaction information may include association information between nodes. For example, the node interaction information includes but is not limited to neighbor node information of different nodes, node feature information, weights of edges between nodes, and edge types.
[0060] In this embodiment, the nodes to be sampled may also be pre-set, or in the process of processing graph structure data based on the graph neural network in the graphics processor, when its processing unit needs to sample one or some nodes in the graph structure data, the nodes to be sampled are used as the nodes to be sampled. Furthermore, according to the node identifier of the node to be sampled, the unit to be run that has a mapping relationship with the node identifier can be searched from the pre-configured storage mapping relationship. If found, the found unit to be run can be used as the target processing unit. At this time, the target processing unit is the unit that stores the node to be sampled. And the node interaction information corresponding to the node identifier is obtained, so that the target processing unit performs data sampling according to the node interaction information.
[0061] For example, see Figure 2 For the input nodes to be sampled, the nodes can be classified in advance according to the storage location (i.e., processing unit), and a storage mapping relationship table for storing the corresponding relationship between the node ID (i.e., node identification) and the GPU card ID (i.e., the identification of the unit to be run) is configured. Assuming that the processing unit in GPU card 0 needs to sample node 1, the GPU card ID corresponding to node 1 can be found according to the storage mapping relationship table, and the processing unit in the GPU card corresponding to the GPU card ID is the target processing unit.
[0062] In this embodiment, the storage mapping relationship can also be determined in advance. The storage mapping relationship can be determined by: determining at least one subgraph corresponding to the graph neural network; determining the processing device corresponding to each subgraph and the unit to be run in the processing device, and determining the storage mapping relationship based on the processing device identifier of the processing device, the unit to be run, the node identifier in the subgraph, and the node interaction information of at least one subgraph.
[0063] The Graph Neural Network (GNN) may be a neural network model for processing graph structure data. A subgraph may be a part of a graph structure, and the subgraph includes at least one sampling node.
[0064] In this embodiment, the graph structure data used when processing the graph neural network can be obtained, and then, the graph structure data can be divided using an algorithm for dividing subgraphs to obtain at least one subgraph. For example, the algorithm for dividing subgraphs can be a hash algorithm based on node ID, a subgraph algorithm based on METIS, or the like. Furthermore, a corresponding processing device and a unit to be run in the processing device are assigned to each subgraph. A correspondence is established between the processing device identifier of the processing device corresponding to the subgraph, the unit to be run, and the node identifier in the subgraph. Accordingly, the corresponding relationship corresponding to each subgraph is obtained. Furthermore, the corresponding relationship corresponding to each subgraph and the node interaction information of the subgraph can be stored in the storage mapping relationship as a storage mapping relationship for easy call. For example, see Figure 3 , Figure 3 It can be represented as a full graph with seven nodes in total. The full graph is split into two sub-graphs: Figure 1 Kazuko Figure 2 . With the child Figure 1 The corresponding unit to be run can be the processing unit in CPU0, and Figure 2 The corresponding unit to be run may be a processing unit in CPU1.
[0065] The advantage of this setting is that by determining the processing devices and units to be run corresponding to different subgraphs, it is not only convenient to store the subgraphs in the corresponding units to be run, but also to allocate different subgraphs to different units for storage, so that different processing units can perform data processing in parallel. At the same time, when sampling nodes, it is also possible to know which processing device and which unit to be run to search for node data based on the corresponding relationship between the subgraphs, processing devices and units to be run.
[0066] S120. For at least one target processing unit, based on the node interaction information, the node information corresponding to the current target processing unit is sent to the interaction processing unit associated with the current target processing unit, and data sampling processing is performed based on the distributed storage data in each target processing unit to obtain the data processing result corresponding to each target processing unit.
[0067] Among them, the interactive processing unit can be understood as a processing unit that has information interaction with other processing units. The interactive processing unit is a processing unit in at least one target processing unit. The node information may include the memory address information of the storage node, or the pointer information used to reference the node memory address, etc. The node interaction information includes the communication interface. The distributed storage data may include relevant information of the node, for example, the relevant information includes the node's neighbor node information, feature node information, and edge type and edge weight information between neighbor nodes.
[0068] It should be noted that the target processing unit storing the nodes to be sampled and the processing unit that wants to collect the nodes to be sampled may be the same processing unit or different processing units. If they are the same processing unit, it is only necessary to perform data sampling in the current processing unit. If they are different processing units, it is necessary to notify the target processing unit to sample and then receive the sampling results of the target processing unit. At this time, data transmission between processing units is required. It should also be noted that the method of data sampling for each target processing unit is the same. Any of the target processing units can be used as the current target processing unit, and data sampling based on the current target processing unit is used as an example for introduction.
[0069] In this embodiment, the current target processing unit may need to sample other nodes in the process of sampling based on the node to be sampled, and the other nodes may be located on other processing units. At this time, these other processing units can be used as interactive processing units associated with the current target processing unit. The node information corresponding to the current target processing unit can be sent to the interactive processing unit associated with the current target processing unit through the communication interface in the node interaction information. In this way, each target processing unit can perform sampling processing on the distributed storage data stored locally in parallel based on the received node information, and each obtains the data processing results after sampling. For example, processing unit A sends the node information to processing unit B of storage node A and processing unit C of storage node C through the communication interface. Then, each processing unit will calculate according to the distributed storage data on its own unit to obtain the final result, which is the data processing result.
[0070] For example, see Figure 4 , Figure 4It can be represented as a diagram of data processing between multiple CPUs in a device. When two CPUs are in the same target device, they can use P2P (Peer-to-Peer) communication to access data. P2P communication means allowing a GPU to directly read and write the memory of another GPU. Figure 2 , Figure 2 It can be represented as a diagram of data processing between multiple CPUs in a device. When two CPUs are in different target devices, they cannot access data using P2P communication. In this case, NCCL (NVIDIA Collective Communications Library, which refers to the communication library that provides collective communication between multiple GPUs) can be used for communication. NCCL communication means that on the same target device, different GPUs can access the same physical memory through the shared memory mechanism provided by the operating system.
[0071] In this embodiment, based on the node interaction information, the node information of the current target processing unit is sent to other interaction processing units associated with the current target processing unit, and data sampling and processing are performed based on the distributed storage data in each target processing unit to obtain the data processing result corresponding to each target processing unit, including: determining the interaction processing unit associated with the current target processing unit based on the node interaction information; sending the node information of the current target processing unit to the interaction processing unit so that the current target processing unit samples and processes the distributed storage data based on the address handle in the node information, and obtaining the processing result of the current target processing unit based on the acquired address handle by the interaction processing unit, and sampling and processing the corresponding distributed storage data based on the address handle in the interaction processing unit to obtain the data processing result corresponding to the current processing unit.
[0072] The address handle may be used to indicate a storage location of data. For example, the address handle may be a pointer used to point to the storage location.
[0073] In this embodiment, the current target processing unit may need to sample other nodes during the process of sampling the sampling node. The other nodes may be in its own processing unit or not in its own processing unit. If they are not in its own processing unit, it is necessary to obtain the sampling results of other nodes from other processing units. Based on this, the processing unit with which the current target processing unit has node interaction can be determined as the interactive processing unit through the node interaction information. Further, the node information of the sampling node requested by the current target processing unit is sent to the interactive processing unit, so that the interactive processing unit can use the acquired address handle to sample the distributed storage data stored in itself, and obtain the processing results and feed them back to the current target processing unit. If it is in its own processing unit, the current target processing unit can use the address handle in the node information to sample the distributed storage data processed by itself to obtain the data processing results.
[0074] Exemplarily, in the process of obtaining sampling node 2, processing unit A needs to use sampling node 3 and node 4, node 3 is located in processing unit B, and node 4 is located in processing unit A. Processing unit A notifies processing unit B of node 3, and processing unit B receives the notification and samples node 3 from the local distributed storage data according to the address handle of node 3 to obtain sampling result 1. Processing unit A obtains sampling result 1 through the address handle of node 3. Processing unit A samples node 4 from the local distributed storage data through the address handle of node 4 to obtain sampling result 2. At this time, sampling result 1 and sampling result 2 are both data processing results corresponding to processing unit A.
[0075] S130. For at least one target processing unit, feed back the data processing result corresponding to the current target processing unit to the interactive processing unit according to the node interaction information.
[0076] For each target processing unit, the corresponding data processing result can be fed back to the node requester. Any of the target processing units can be taken as the current target processing unit, and the data processing result corresponding to the current target processing unit can be fed back to the node requester as an example for explanation.
[0077] Specifically, the final data processing result sampled by the current target processing unit can be fed back to the party notifying it to collect node data through the communication interface in the node interaction information. This party is the interactive processing unit. This interactive processing unit can be the processing unit corresponding to the node to be sampled. For example, processing unit A notifies processing unit B to collect the data processing result of node 2. After processing unit B collects the data processing result of node 2 as the target processing unit, processing unit B feeds back the data processing result of node 2 to processing unit A. Processing unit A is the interactive processing unit.
[0078] For example, see Figure 2 ,After sampling in the processing unit inside the device, the ,data processing results after sampling can be fed back to the sampling requester, ,to achieve result exchange among multiple processing units of different ,devices.
[0079] S140 , sorting the received data processing results and the obtained data processing results based on each target processing unit to obtain a target processing result corresponding to the node to be sampled.
[0080] In this embodiment, after receiving the data processing results fed back by each target processing unit and the data processing results obtained according to the storage data of this unit, all the data processing results can be sorted according to the relevant information of each target processing unit, and the sorted results can be used as the target processing results corresponding to the nodes to be sampled. For example, the relevant information can be the order of notifying each target processing unit to request sampling nodes, the arrangement order between sampling nodes, the order of target processing units executing acquisition nodes, or the time order of obtaining data processing results, etc.
[0081] In this embodiment, based on the received data processing results and the obtained data processing results sorted by each target processing unit, the target processing results corresponding to the node to be sampled are obtained, including: according to the node execution order of the sampling node corresponding to each target processing unit, the data processing results obtained by each target processing unit are sorted to obtain the target processing results corresponding to the node to be sampled.
[0082] Continue to see Figure 2 After each target processing unit feeds back the acquired data processing results to the processing unit requesting to collect the nodes to be sampled, the requesting processing unit can reorder the data processing results fed back by each target processing unit and the data processing results sampled by itself according to the node execution order of the sampling nodes collected by each target processing unit, and can use the reordered results as the target processing results corresponding to the nodes to be sampled. The advantage of reordering is that the order of the processing results can correspond to the order of the requesting nodes one by one, ensuring the correctness of data processing.
[0083] The technical solution provided by the embodiment of the present invention determines at least one target processing unit storing the node to be sampled and the node interaction information according to the node identification and storage mapping relationship of the node to be sampled; then, according to the node interaction information, the node information of the current target processing unit is sent to other interaction processing units associated with the current target processing unit, and data sampling processing is performed based on the distributed storage data in each target processing unit to obtain the data processing result corresponding to each target processing unit; wherein the interaction processing unit is a processing unit in at least one target processing unit; for at least one target processing unit, the data processing result corresponding to the current target processing unit is fed back to Interactive processing unit; based on the sorting of the received data processing results and the obtained data processing results by each target processing unit, the target processing results corresponding to the node to be sampled are obtained, which solves the problem of low data processing efficiency in the prior art of graph data processing based on video memory or internal memory, and realizes the determination of at least one target processing unit and node interaction information storing the node to be sampled based on the node identification and storage mapping relationship of the node to be sampled, and then, the node information of the current target processing unit is sent to other interactive processing units associated with the current target processing unit through the node interaction information, so that each target processing unit can perform data sampling processing in parallel, thereby improving data processing efficiency. Furthermore, by sorting the obtained data processing results by each target processing unit, the target processing results corresponding to the node to be sampled are obtained, ensuring that the order of the requesting nodes is consistent with the order of the final processing results, facilitating subsequent data processing and improving processing speed.
[0084] Figure 5 A flow chart of a data processing method applied to a graph neural network provided in an embodiment of the present invention. Based on the aforementioned embodiment, after determining the processing device corresponding to at least one subgraph corresponding to the graph neural network, the distributed storage data in the unit to be run can also be determined, so that each target processing unit can sample and process the distributed storage data in the interactive processing unit and / or the target processing unit based on the address handle. The specific implementation method can be found in the detailed description of this embodiment, wherein the technical terms that are the same as or corresponding to the above-mentioned embodiments are no longer repeated in this embodiment.
[0085] like Figure 5 As shown, the method includes:
[0086] S210 . For each subgraph, determine an associated subgraph associated with the current subgraph according to node interaction information between the current subgraph and other subgraphs.
[0087] It should be noted that the method for determining the distributed storage data of each subgraph is the same, and any subgraph can be taken as the current subgraph to determine the distributed storage data of the current subgraph as an example for introduction.
[0088] In this embodiment, it is possible to determine whether the neighbor nodes of the nodes in the current subgraph are in other subgraphs based on the node interaction information between the current subgraph and other subgraphs. If so, the other subgraphs where the neighbor nodes are located can be used as associated subgraphs associated with the current subgraph.
[0089] For example, see Figure 3 ,son Figure 1 The neighbor node 5 of node 2 in the child Figure 2 On the Figure 2 As a child Figure 1 Correspondingly, node 5’s neighbor node 2 is in the subgraph Figure 1 Go up, son Figure 1 As a child Figure 2 The associated subgraph of .
[0090] S220 . For at least one sampling node in the current subgraph, determine an associated node associated with the current sampling node according to a node sampling order of the at least one sampling node, the current subgraph, and an associated subgraph.
[0091] The associated nodes include local nodes and / or remote nodes. The associated nodes may refer to neighbor nodes. The local nodes may refer to neighbor nodes located on the same subgraph as the node. The remote nodes may refer to neighbor nodes located on different subgraphs as the node.
[0092] In this embodiment, the local node associated with the current sampling node can be determined from the current subgraph according to the node sampling order of each sampling node in the current subgraph, and the remote node associated with the current sampling node can be determined from the associated subgraph associated with the current subgraph. Figure 3 ,son Figure 1 The neighbor nodes of node 2 in the example are 0, 1, and 5. Nodes 0 and 1 are located in the child Figure 1 Therefore, nodes 0 and 1 are local nodes associated with node 2; node 5 is located in the child Figure 2 Therefore, node 5 is a remote node associated with node 2.
[0093] S230 : Determine the distributed storage data of the current subgraph according to the associated nodes associated with each sampling node and the connection edge information between the associated nodes and the sampling nodes.
[0094] The connection edge information may include edge weight and edge type.
[0095] In this embodiment, a compressed sparse matrix can be constructed through the associated nodes associated with each sampling node in the current subgraph and the connection edge information between the associated nodes and the sampling nodes to obtain the distributed storage data of the current subgraph. Exemplarily, the CSR (Compressed Sparse Row) format can be used to store the relevant information of the associated nodes of the sampling nodes in the current subgraph to obtain the distributed storage data for storing the current subgraph, so that the data storage structure of the current subgraph is compact and the occupied space is reduced. At the same time, the structure can be easier to parallelize programming, so that the written program can support high performance on parallel processors and improve processing efficiency.
[0096] In this embodiment, the distributed storage data of the current subgraph is determined according to the associated nodes associated with each sampling node, and the connection edge information between the associated nodes and the sampling nodes, including: for each sampling node, according to the node identifier of the current sampling node, the associated identifier of the associated node, and the node number of the associated node, the first row of sub-data and the second row of sub-data in the distributed storage data are determined; according to the edge connection information between the associated identifier of each associated node in the second row of sub-data and the corresponding sampling node, the weight corresponding to the associated identifier in the third row of sub-data is determined; according to the first row of sub-data, the second row of sub-data, and the third row of sub-data, the distributed storage data corresponding to the current subgraph is determined.
[0097] The first row of sub-data is used to store the number of times the associated node of the current sampling node is read from the second row of sub-data. The second row of sub-data is used to store the associated identifier of the associated node associated with the current sampling node. The third row of sub-data is used to store the edge connection information between the current sampling node and the associated node associated with it.
[0098] In this embodiment, the node number of the associated nodes associated with the sampling node can be sorted in the first row of sub-data in accordance with the node sampling order of each sampling node of the current sub-graph, and the first row of sub-data in the distributed storage data of the current sub-graph can be determined, so that the node number in the first row of sub-data can be used as an index to determine the position of the associated nodes of the sampling node from which to start reading in the second row of sub-data. The associated identifiers of the associated nodes associated with the sampling node can be sorted in the second row of sub-data in accordance with the node sampling order of each sampling node, and the second row of sub-data in the distributed storage data can be determined, so that the associated identifiers of the associated nodes can be accurately read from the second row of sub-data through the element values in the first row of sub-data. The edge weight or edge type in the edge connection information between each associated node and its associated sampling node can be used as the weight corresponding to the associated identifier of the associated node; or the edge weight and edge type in the edge connection information can be feature compressed to obtain feature information that can be used to characterize the edge weight and edge type, and the feature information is used as the weight corresponding to the associated identifier. According to the arrangement order of the association identifier of each associated node in the second row of sub-data, the weights corresponding to the association identifiers are sequentially sorted in the third row of sub-data to determine the third row of sub-data, that is, the element values in the third row of sub-data are one-to-one corresponding to the edge weights between the association identifiers in the second row of sub-data and the sampling nodes associated therewith. Further, the first row of sub-data, the second row of sub-data, and the third row of sub-data can be integrated to obtain distributed storage data corresponding to the current subgraph.
[0099] For example, see Figure 6 , for the child Figure 1 For example, the first row of sub-data can start from 0, and the number of nodes associated with each sampling node is: 2, 4, 8, 9, and the first row of sub-data can be: [0, 2, 4, 8, 9]. The associated nodes of node 0 are 2 and 6, and 2 and 6 are placed in the second row of sub-data; the associated nodes of node 1 are 2 and 5, and 2 and 5 are placed in the second row of sub-data; the associated nodes of node 2 are 1, 3, 0 and 5, and 1, 3, 0 and 5 are placed in the second row of sub-data; the associated node of node 3 is 2, and 2 is finally placed in the second row of sub-data; the obtained second row of sub-data is: [2, 6, 2, 5, 1, 3, 0, 5, 2]. The edge weights between node 0 and nodes 2 and 6 in the second row of sub-data are 2 and 5, respectively. Put 2 and 5 into the third row of sub-data, and the edge weights between node 1 and nodes 2 and 5 in the second row of sub-data are 1 and 4, respectively. Put 1 and 4 into the third row of sub-data, and in this way, after putting the edge weights between node 2, node 3 and the associated nodes into the third row of sub-data, we can get the third row of sub-data: [2, 5, 1, 4, 1, 1, 2, 1, 1]. Similarly, determine the sub-data. Figure 2Distributed storage data method and determination sub Figure 1 The distributed storage method of data is similar and will not be elaborated here.
[0100] It should be noted that after determining the distributed storage data of the current subgraph, the distributed storage data of the current subgraph can be stored in the to-be-run unit corresponding to the current subgraph, so that the node data in the current subgraph can be collected from the distributed storage data in the unit.
[0101] In this embodiment, after obtaining the distributed storage data, the distributed storage data corresponding to the current subgraph can be stored in the waiting-to-run unit corresponding to the current subgraph for the distributed storage data of each subgraph, and the address handle corresponding to the current distributed storage data can be obtained, so that each target processing unit can sample and process the data in other interactive processing units and / or target processing units based on the address handle.
[0102] Specifically, the distributed storage data corresponding to the current subgraph can be read, and the read distributed storage data can be loaded and stored in the unit to be run corresponding to the current subgraph. After the distributed storage data is stored, the unit to be run can call the interface function to obtain the address handle corresponding to the distributed storage data, where the interface function can be cudaIpcGetMemHandle. In this way, when each target processing unit performs node sampling, the address handle can be used to sample and process the distributed storage data in the interactive processing unit and / or the target processing unit. The advantage of this setting is that by storing the distributed storage data of different subgraphs in different units to be run, it can ensure that the storage data in each unit is not repeated, while enabling each unit to use the address handle to obtain the distributed storage data in other units, ensuring that each unit can run in parallel, realizing distributed data processing, and improving data processing efficiency.
[0103] For example, see Figure 6 , you can Figure 1 The distributed storage data is stored on CPU0. Figure 2 The distributed storage data is stored on CPU1, and the whole map (including sub Figure 1 Kazuko Figure 2 ) There are 7 nodes in total. The two CPUs store the neighbor information of 4 and 3 nodes respectively. Each card stores the CSR data of the subgraph. Figure 7 ,The method of storing distributed storage data can be as follows: reading a file containing the distributed storage data of each subgraph, and evenly distributing the content of the file to multiple GPU cards according to the units to be run to which the subgraphs belong.
[0104] Specifically, the data size of the file can be obtained, and the data in the file can be evenly divided according to the cards. Each card stores a part of the continuous content in the file. Each card uses the cudaMalloc interface function (a function for allocating video memory space) to allocate video memory space according to the calculated data volume, and starts reading the data in the file according to the offset address of the file. After the data in the file is loaded, the interface cudaIpcGetMemHandle (a function for obtaining the inter-process memory handle of the existing device memory allocation) is used inside each card to obtain the address handle of the distributed storage data in the card, and the communication interface ncclSend / ncclRecv (an interface function for sending data to the peer) is used to pass it to the address handle of other cards themselves and receive the address handle. Then, the usable pointer is obtained through the interface cudaIpcOpenMemHandle (used to open the memory handle exported by another device and return a pointer that can be used in this process). Finally, the data of other cards on the same target device can be directly obtained through the pointer. For multiple target devices, each target device reads part of the continuous content in the file, which can ensure that the content read by each device is not repeated and all the contents of the file are read completely.
[0105] The technical solution provided by the embodiment of the present invention can use the above-mentioned method to determine the distributed storage data in the unit to be run, so as to store the distributed storage data of different subgraphs in different units to be run. While realizing distributed storage, when each target processing unit samples and processes the distributed storage data in the interactive processing unit and / or the target processing unit based on the address handle of the distributed storage data, distributed data processing of multiple processing units between multiple devices is realized, thereby improving data processing efficiency.
[0106] As an optional embodiment of the above embodiment, in order to make those skilled in the art further understand the technical solution of the embodiment of the present invention, a specific application scenario example is given. For details, please refer to the following specific content.
[0107] The data processing method provided in the embodiment of the present invention can be implemented based on a multi-GPU distributed graph deep learning framework that supports ultra-large-scale graphs, see Figure 8 , Figure 8 It can be represented as a structural diagram of a graph deep learning framework, which includes the GPU-based hardware bottom layer, programming module, distributed storage module, distributed operator module based on graph neural network, actual model and application module of graph neural network, and deep learning framework.
[0108] Specifically, the communication capability of NVLINK (a high-speed, multi-GPU communication basic module) / NVSwitch (an application-specific integrated circuit) can be used as the underlying support of the graph deep learning framework. The upper layer of the bottom layer is a programming module based on CUDA (Compute Unified Device Architecture). Next, the upper layer of the programming module is the distributed storage module of the framework, which stores the graph data in the video memory. The graph data that needs to be stored here includes graph structure, features, types and weights, etc., where the graph structure includes the neighbor information of the node, the features are all related features of the node and the edge, the type is the type of each edge, and the weight is the weight of each edge. The upper layer of the distributed storage module is a distributed operator module based on the graph neural network. The distributed operator module implements some operations unique to the graph neural network based on the stored graph data. The operation operators mainly include sampling, random walk, feature collection and other operators. At the same time, the graph deep learning framework integrates third-party deep learning frameworks, such as Tensorflow / Pytorch. The top layer of the graph deep learning framework is the actual model and application module of the graph neural network.
[0109] The following is a detailed introduction to the distributed storage module and distributed operator module in the graph deep learning framework.
[0110] The distributed storage module is used to store four parts of graph data, namely graph structure, features, edge types and edge weights. For example, the nodes in the full graph can be evenly distributed on each GPU card (i.e., the units to be run in the image processor), and each card stores the neighbor information, feature information, and edge types and edge weights of these nodes. In other words, each GPU card stores the relevant information of the neighbor nodes of the nodes in the subgraph of the full graph. Figure 6 As shown in the figure, neighbor information is stored in CSR format. The first line in CSR format is the index for finding neighbor nodes (i.e. associated nodes), and the second line is the ID of the specific neighbor node (i.e. associated identifier). The edge type and edge weight between nodes are also stored in CSR format, with the type and weight information as the third line of CSR. The three lines of features can be compressed into one-dimensional data, and the distributed storage data is stored continuously in memory.
[0111] The implementation methods of sampling, random walk, and feature collection operators in the distributed operator module are:
[0112] For sampling operators, the graph deep learning framework provided in this embodiment can implement node sampling of isomorphic graphs and node sampling of heterogeneous graphs. Node sampling of isomorphic graphs includes weighted sampling and unweighted sampling; node sampling of heterogeneous graphs includes weighted sampling, unweighted sampling and sampling with restrictions. Among them, weighted sampling refers to affecting the sampling probability according to the weight of the edge. For example, the higher the weight of the edge, the higher the probability of sampling the node on the edge. Unweighted sampling means that the weight of each edge is the same and the probability of being sampled is the same. Restricted sampling refers to affecting the sampling probability according to the type of edge. This sampling method needs to take into account different meta-paths, such as sampling only neighbor nodes of specified edge types. For example, for graphs of three node types: users, items, and stores, sampling can be performed according to the meta-path of "user-store" to obtain a sequence of stores that users like, or sampling can be performed according to the meta-path of "user-item" to obtain a sequence of items that users like. In this embodiment, the Fisher-Yates shuffle algorithm can be used to implement sampling without weights. Weighted sampling is implemented using the reservoir algorithm. Node sampling in heterogeneous graphs is achieved using the updated reservoir algorithm.
[0113] The random walk operator is the result of sequential execution of multiple sampling operators, and the starting point of each sampling is the result of the previous sampling.
[0114] The feature collection operator implements untrained features and trainable features respectively. The untrained features are obtained through the matrix shape (m,n) to get the starting address k*n corresponding to the kth feature. The trainable features need to implement backward operations. The deep learning framework of the graph is updated synchronously by multiple GPUs. In the backward operation, the array records the incoming gradients and feature indexes involved in the entire backward process. At the end of a model backward, the features are updated once according to the array as a whole. The update steps and Figure 4 , Figure 5 Similarly, devices also need to communicate through NCCL to update gradients.
[0115] The technical solution provided in this embodiment compresses the graph structure data and stores the compressed graph data in a distributed manner on multiple machines and multiple cards, so that it is not limited by the storage capacity of a single card or a single machine. At the same time, data access between multiple cards on a single machine is realized based on CUDA P2P technology, and calculation between multiple machines and multiple cards is realized based on NCCL communication, supporting parallel processing of large-scale homogeneous and heterogeneous graphs on multiple machines and multiple cards. At the same time, this solution does not require data exchange and movement between the CPU and GPU, improves data efficiency, and shortens processing time.
[0116] Fig. 9A schematic diagram of the structure of a data processing device applied to a graph neural network provided in an embodiment of the present invention, the device includes: an information determination module 310, a data processing result determination module 320, a result feedback module 330 and a target processing result determination module 340.
[0117] Among them, the information determination module 310 is used to determine at least one target processing unit storing the node to be sampled and the node interaction information according to the node identification and storage mapping relationship of the node to be sampled; the target processing unit is a unit in a graphics processor, and the graphics processor is located in the same target device or different target devices. The storage mapping relationship includes the correspondence between the node identification, the unit to be run, and the identification of the processing device to which the unit to be run belongs, and the target processing unit is a processing unit in the unit to be run; the data processing result determination module 320 is used to send the node information corresponding to the current target processing unit to the node corresponding to the current target processing unit according to the node interaction information for the at least one target processing unit. The interactive processing unit associated with the previous target processing unit performs data sampling processing based on the distributed storage data in each of the target processing units to obtain the data processing result corresponding to each target processing unit; wherein the interactive processing unit is a processing unit in the at least one target processing unit; a result feedback module 330 is used to feed back the data processing result corresponding to the current target processing unit to the interactive processing unit according to the node interaction information for the at least one target processing unit; a target processing result determination module 340 is used to sort the received data processing results and the obtained data processing results based on each target processing unit to obtain the target processing result corresponding to the node to be sampled.
[0118] The technical solution of the embodiment of the present invention determines at least one target processing unit storing the node to be sampled and the node interaction information according to the node identification and storage mapping relationship of the node to be sampled; then, according to the node interaction information, the node information of the current target processing unit is sent to other interaction processing units associated with the current target processing unit, and data sampling processing is performed based on the distributed storage data in each target processing unit to obtain the data processing result corresponding to each target processing unit; wherein the interaction processing unit is a processing unit in at least one target processing unit; for at least one target processing unit, the data processing result corresponding to the current target processing unit is fed back to the interaction processing unit according to the node interaction information Interprocessing unit; based on the sorting of the received data processing results and the obtained data processing results by each target processing unit, the target processing results corresponding to the node to be sampled are obtained, which solves the problem of low data processing efficiency in the prior art of graph data processing based on video memory or internal memory, and realizes the determination of at least one target processing unit and node interaction information storing the node to be sampled based on the node identification and storage mapping relationship of the node to be sampled, and then, the node information of the current target processing unit is sent to other interactive processing units associated with the current target processing unit through the node interaction information, so that each target processing unit can perform data sampling processing in parallel, thereby improving data processing efficiency. Furthermore, by sorting the obtained data processing results by each target processing unit, the target processing results corresponding to the node to be sampled are obtained, ensuring that the order of the requesting nodes is consistent with the order of the final processing results, facilitating subsequent data processing and improving processing speed.
[0119] On the basis of the above technical solution, the device also includes: a storage mapping relationship determination module; wherein the storage mapping relationship determination module includes: a subgraph determination unit, used to determine at least one subgraph corresponding to the graph neural network; wherein the subgraph includes at least one sampling node; a storage mapping relationship determination unit, used to determine the processing device corresponding to each subgraph and the unit to be run in the processing device, and determine the storage mapping relationship based on the processing device identifier of the processing device, the unit to be run, the node identifier in the subgraph and the node interaction information of at least one subgraph.
[0120] On the basis of the above technical solution, the device further includes: a distributed storage data determination module, which is used to determine the distributed storage data in the unit to be run. Wherein, the distributed storage data determination module includes: an associated subgraph determination unit, which is used to determine, for each subgraph, the associated subgraph associated with the current subgraph according to the node interaction information between the current subgraph and other subgraphs; an associated node determination unit, which is used to determine, for at least one sampling node in the current subgraph, the associated node associated with the current sampling node according to the node sampling order of the at least one sampling node, the current subgraph and the associated subgraph, wherein the associated node includes a local node and / or a remote node; a storage data determination unit, which is used to determine the distributed storage data of the current subgraph according to the associated nodes associated with each sampling node and the connection edge information between the associated nodes and the sampling nodes.
[0121] On the basis of the above technical solution, the storage data determination unit includes: a row sub-data determination unit, which is used to determine, for each sampling node, the first row of sub-data and the second row of sub-data in the distributed storage data according to the node identifier of the current sampling node, the association identifier of the associated node and the node number of the associated node, wherein the first row of sub-data is used to store the number of nodes in the second row of sub-data from which the associated node of the current sampling node is read, and the second row of sub-data is used to store the association identifier of the associated node associated with the current sampling node; a weight determination unit, which is used to determine the weight corresponding to the association identifier in the third row of sub-data according to the edge connection information between the association identifier of each associated node in the second row of sub-data and the corresponding sampling node; and a compression unit, which is used to determine the distributed storage data corresponding to the current subgraph according to the first row of sub-data, the second row of sub-data and the third row of sub-data.
[0122] On the basis of the above technical solution, the device also includes: a storage unit, which is used to store the distributed storage data corresponding to the current subgraph in the waiting-to-run unit corresponding to the current subgraph for the distributed storage data of each subgraph, and obtain the address handle corresponding to the distributed storage data, so that each target processing unit samples and processes the data in the interactive processing unit and / or the target processing unit based on the address handle.
[0123] On the basis of the above technical solution, the data processing result determination module 320 includes: an interaction processing unit determination unit, which is used to determine the interaction processing unit associated with the current target processing unit based on the node interaction information; a data processing result determination unit, which is used to send the node information of the current target processing unit to the interaction processing unit, so that the current target processing unit samples and processes the distributed storage data based on the address handle in the node information, and obtains the processing result of the current target processing unit based on the acquired address handle by the interaction processing unit, and samples and processes the corresponding distributed storage data based on the address handle in the interaction processing unit to obtain the data processing result corresponding to the current target processing unit.
[0124] On the basis of the above technical solution, the target processing result determination module 340 is used to sort the data processing results acquired by each target processing unit according to the node execution order of the sampling node corresponding to each target processing unit, and obtain the target processing result corresponding to the node to be sampled.
[0125] The data processing device applied to the graph neural network provided by the embodiment of the present invention can execute the data processing 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.
[0126] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned 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.
[0127] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Fig.10 A block diagram of an exemplary electronic device 40 suitable for implementing exemplary embodiments of the present invention is shown. Fig.10 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.
[0128] like Fig.10 As 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).
[0129] 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.
[0130] 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.
[0131] 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.10 not shown, usually called a "hard drive"). Although Fig.10 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.
[0132] 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.
[0133] The electronic device 40 may also communicate with one or more external electronic 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 communicate with any device that enables the electronic device 40 to communicate with one or more other computing devices (e.g., network cards, modems, 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.10 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.
[0134] The processing unit 401 executes various functional applications and data processing by running the programs stored in the system memory 402, such as implementing the data processing method applied to the graph neural network provided in an embodiment of the present invention.
[0135] An embodiment of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to execute a data processing method applied to a graph neural network.
[0136] The method comprises: determining at least one target processing unit storing the node to be sampled and node interaction information according to the node identifier and storage mapping relationship of the node to be sampled; the target processing unit is a unit in a graphics processor, the graphics processor is located in the same target device or different target devices, the storage mapping relationship comprises a correspondence between the node identifier, the unit to be run and the identifier of the processing device to which the unit to be run belongs, and the target processing unit is a processing unit in the unit to be run; for the at least one target processing unit, sending the node information corresponding to the current target processing unit to the interaction processing unit associated with the current target processing unit according to the node interaction information, and performing data sampling processing based on the distributed storage data in each of the target processing units to obtain the data processing result corresponding to each target processing unit; wherein the interaction processing unit is a processing unit in the at least one target processing unit; for the at least one target processing unit, feeding back the data processing result corresponding to the current target processing unit to the interaction processing unit according to the node interaction information; and obtaining the target processing result corresponding to the node to be sampled by sorting the received data processing results and the obtained data processing results based on each target processing unit.
[0137] 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.
[0138] 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.
[0139] 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.
[0140] 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 a user's computer, partially on a user's computer, as an independent software package, partially on a 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).
[0141] 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 described 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 data processing method applied to graph neural networks, It is characterized in that include: Determine at least one target processing unit storing the node to be sampled and node interaction information according to the node identifier and storage mapping relationship of the node to be sampled; The target processing unit is a unit in a graphics processor, the graphics processor is located in the same target device or in different target devices, the storage mapping relationship includes a correspondence between a node identifier, a unit to be run, and an identifier of a processing device to which the unit to be run belongs, and the target processing unit is a processing unit in the unit to be run; For the at least one target processing unit, according to the node interaction information, the node information corresponding to the current target processing unit is sent to the interaction processing unit associated with the current target processing unit, and data sampling processing is performed based on the distributed storage data in each of the target processing units to obtain the data processing result corresponding to each target processing unit; wherein the interaction processing unit is a processing unit in the at least one target processing unit; For the at least one target processing unit, feeding back the data processing result corresponding to the current target processing unit to the interaction processing unit according to the node interaction information; Based on the sorting of the received data processing results and the obtained data processing results by each target processing unit, the target processing results corresponding to the node to be sampled are obtained.
2. The method according to claim 1, It is characterized in that The storage mapping relationship is determined in the following manner: Determine at least one subgraph corresponding to the graph neural network; wherein the subgraph includes at least one sampling node; Determine the processing device corresponding to each subgraph and the unit to be run in the processing device, and determine the storage mapping relationship based on the processing device identifier of the processing device, the unit to be run, the node identifier in the subgraph and the node interaction information of at least one subgraph.
3. The method according to claim 1 or 2, It is characterized in that Determining the distributed storage data in the unit to be run includes: For each subgraph, determining an associated subgraph associated with the current subgraph according to node interaction information between the current subgraph and other subgraphs; For at least one sampling node in the current subgraph, determining an associated node associated with the current sampling node according to a node sampling order of the at least one sampling node, the current subgraph, and the associated subgraph, wherein the associated node includes a local node and / or a remote node; The distributed storage data of the current subgraph is determined according to the associated nodes associated with each sampling node and the connection edge information between the associated nodes and the sampling nodes.
4. The method according to claim 3, It is characterized in that The step of determining the distributed storage data of the current subgraph according to the associated nodes associated with each sampling node and the connection edge information between the associated nodes and the sampling nodes includes: For each sampling node, determining a first row of sub-data and a second row of sub-data in the distributed storage data according to the node identifier of the current sampling node, the association identifier of the associated node, and the number of nodes of the associated node, wherein the first row of sub-data is used to store the number of nodes in the second row of sub-data from which the associated node of the current sampling node is read, and the second row of sub-data is used to store the association identifier of the associated node associated with the current sampling node; Determine the weight corresponding to the association identifier in the third row of sub-data according to the edge connection information between the association identifier of each association node in the second row of sub-data and the corresponding sampling node; Distributed storage data corresponding to the current subgraph is determined according to the first row of sub-data, the second row of sub-data, and the third row of sub-data.
5. The method according to claim 4, It is characterized in that After obtaining the distributed storage data, the method further includes: For the distributed storage data of each sub-graph, the distributed storage data corresponding to the current sub-graph is stored in the waiting-to-run unit corresponding to the current sub-graph, and the address handle corresponding to the distributed storage data is obtained, so that each target processing unit samples and processes the data in the interactive processing unit and / or the target processing unit based on the address handle.
6. The method according to claim 1, It is characterized in that The node information corresponding to the current target processing unit is sent to the interaction processing unit associated with the current target processing unit according to the node interaction information, and data sampling processing is performed based on the distributed storage data in each of the target processing units to obtain the data processing result corresponding to each target processing unit, including: Determining an interactive processing unit associated with the current target processing unit according to the node interaction information; The node information of the current target processing unit is sent to the interactive processing unit, so that the current target processing unit samples and processes the distributed storage data based on the address handle in the node information, and the interactive processing unit obtains the processing result of the current target processing unit based on the acquired address handle, and samples and processes the corresponding distributed storage data based on the address handle in the interactive processing unit to obtain the data processing result corresponding to the current target processing unit.
7. The method according to claim 1, It is characterized in that The step of sorting the received data processing results and the obtained data processing results based on each target processing unit to obtain the target processing result corresponding to the node to be sampled includes: According to the node execution order of the sampling nodes corresponding to each target processing unit, the data processing results acquired by each target processing unit are sorted and processed to obtain the target processing results corresponding to the nodes to be sampled.
8. A data processing device applied to graph neural network, It is characterized in that include: An information determination module, used to determine at least one target processing unit storing the node to be sampled and node interaction information according to the node identification and storage mapping relationship of the node to be sampled; The target processing unit is a unit in a graphics processor, the graphics processor is located in the same target device or in different target devices, the storage mapping relationship includes a correspondence between a node identifier, a unit to be run, and an identifier of a processing device to which the unit to be run belongs, and the target processing unit is a processing unit in the unit to be run; A data processing result determination module is used for sending the node information corresponding to the current target processing unit to the interactive processing unit associated with the current target processing unit according to the node interaction information, and performing data sampling processing based on the distributed storage data in each of the target processing units to obtain the data processing result corresponding to each target processing unit; wherein the interactive processing unit is a processing unit in the at least one target processing unit; A result feedback module, configured to feed back the data processing result corresponding to the current target processing unit to the interactive processing unit according to the node interaction information, for the at least one target processing unit; The target processing result determination module is used to sort the received data processing results and the obtained data processing results based on each target processing unit to obtain the target processing result corresponding to the node to be sampled.
9. An electronic device, It is 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 data processing method applied to a graph neural network as described in any one of claims 1 to 7.
10. A storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the data processing method applied to a graph neural network as described in any one of claims 1 to 7.
11. A computer program product, comprising a computer program, which, when executed by a processor, is used to execute the data processing method applied to a graph neural network as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Image processing method and device and electronic equipment
CN114882247A
Graph feature caching method
CN116385256A
Programmable access engine architecture for graph neural network and graph application
US20230128180A1
Graph neural network generation method, apparatus and system, medium and electronic device
WO2023101598A2
