Relationship diagram processing methods, computing devices and systems

By passing tensor calculation results between processing units instead of memory access, the problem of low cache hit rate in relational graph processing is solved, improving computational efficiency and reducing hardware costs.

CN118733243BActive Publication Date: 2025-12-02HUAWEI TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310362942.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-29
Publication Date
2025-12-02
Estimated Expiration
2043-03-29

AI Technical Summary

Technical Problem

In existing technologies, graph operations in relational graph processing suffer from low cache hit rates and a large number of random memory accesses due to the irregular storage locations of neighbor nodes in memory, resulting in low computational efficiency.

Method used

Graph operations are implemented by passing tensor computation results between processing units instead of memory access. Graph nodes are allocated by multiple processing units, and feature aggregation operations are performed by passing messages between processing units, thus avoiding random memory access.

Benefits of technology

It improves the efficiency of graph processing, reduces hardware costs, avoids the inefficiency caused by random memory access, and achieves efficient execution of graph operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733243B_ABST
    Figure CN118733243B_ABST
Patent Text Reader

Abstract

This application relates to the field of computer technology, specifically to a method, computing device, and system for processing relational graphs. The method includes: a processing unit executing a first-stage tensor computation task, which includes performing a first tensor operation on the feature data of graph nodes assigned to the processing unit; after completing the first-stage tensor computation task, the processing unit sends the first tensor computation result of the graph node obtained from the first-stage tensor computation task to the processing unit containing the graph node whose neighbor is that graph node, and begins executing a second-stage tensor computation task; when the first processing unit, which has the first graph node assigned, receives the first tensor computation result of the second graph node sent by the second processing unit, which has the second graph node assigned, the first processing unit interrupts the second-stage tensor computation task and performs a feature aggregation operation. This method can efficiently process relational graphs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a relational graph processing method, computing device, and system. Background Technology

[0002] A relational graph is a data structure consisting of connected graph nodes (vertices) and edges, used to represent information without a clear start or end point. The computational paradigm for relational graph processing exhibits hybrid characteristics. Based on the regularity of the computation, the computational paradigm for relational graph processing can be divided into tensor operations (combination operations) and graph operations (aggregation operations). Graph operations are aggregation operations on the features of two adjacent graph nodes in the computational results produced by tensor operations.

[0003] Currently, the computation results generated by tensor operations are stored in memory. During graph operations, the computation results are retrieved from memory and aggregated. Because the adjacency matrix used to represent the graph is a sparse matrix, the storage locations of the neighboring nodes of graph nodes in memory are irregular. This leads to a low cache hit rate for graph node features during graph operations, resulting in a large number of random memory accesses. Consequently, the computational efficiency of graph operations is low, leading to low efficiency in graph processing. Summary of the Invention

[0004] This application provides a relational graph processing method, computing device, and system, which have high relational graph processing efficiency.

[0005] Firstly, a relational graph processing method is provided. This method is applied to a computing device comprising multiple processing units, each of which is assigned graph nodes in a relational graph, and the graph nodes assigned to different processing units are different. The method includes: each processing unit performing a first-stage tensor computation task, the first-stage tensor computation task including performing a first tensor operation on the feature data of the graph nodes assigned to that processing unit to obtain a first tensor computation result for the graph nodes; after completing the first-stage tensor computation task, the processing unit sends the first tensor computation result of the graph nodes obtained by the processing unit in performing the first-stage tensor computation task to the location of a graph node whose neighbor is that graph node. The first processing unit, which is assigned a first graph node, receives the first tensor calculation result of the second graph node sent by the second processing unit, which is assigned a second graph node. The first processing unit then interrupts the second-stage tensor calculation task and performs feature aggregation operations on the first and second graph node's first tensor calculation results to obtain the first aggregation result of the first graph node. The second graph node is a neighbor node of the first graph node in the relational graph. When the feature aggregation operations on the first and second graph node's first tensor calculation results are completed, the first processing unit continues executing the second-stage tensor calculation task.

[0006] A graph node (designated as graph node B) whose neighbors are one or more graph nodes (let's call it graph node A) means that graph node B's neighbors include graph node A, that is, graph node A is one or more neighboring nodes of graph node B. Specifically, the first graph node is a graph node whose neighbor is a second graph node, meaning the second graph node is one or more neighboring nodes of the first graph node.

[0007] In this method, after the tensor computation task of the first stage of the processing unit is completed, the tensor computation results of the graph nodes generated by this stage can be sent to the processing unit containing the graph nodes whose neighbors are the given graph node. This allows the processing unit to obtain the tensor computation results of the graph node's neighbors without memory access, and then perform feature aggregation operations on the tensor computation results of the graph node and the tensor computation results of the graph nodes whose neighbors are the given graph node. In other words, this scheme implements graph operations in relational graph processing without memory access, avoiding the low processing efficiency caused by random memory access in relational graph processing. In other words, this scheme uses message passing of tensor computation results instead of random memory access to enable the processing unit to obtain the required tensor computation results, thus improving the processing efficiency of relational graphs.

[0008] Furthermore, in this method, the transfer of tensor computation results from the previous stage between processing units and the tensor computation task of the current stage can be performed simultaneously. When a processing unit is executing the tensor computation task of the current node, if it receives the tensor computation results from the previous stage of its graph node's neighboring nodes, it can interrupt the tensor computation task at any time and start executing graph operations (i.e., feature aggregation operations). After the graph operations are completed, the execution of the tensor computation task can be resumed. In this way, the same hardware module can complete both the tensor computation task and the graph operations, eliminating the need for two or more hardware modules and reducing hardware costs.

[0009] In one possible implementation, the processing unit includes a computation module, a buffer, and a communication module. The process of performing a first tensor operation on the feature data of the graph nodes allocated to the processing unit to obtain the first tensor computation result of the graph nodes includes: the computation module of the processing unit performs the first tensor operation on the feature data of the graph nodes allocated to the processing unit and outputs the obtained first tensor computation result of the graph nodes to the buffer of the processing unit; the process of sending the first tensor computation result of the graph nodes obtained by the processing unit in performing the tensor computation task of the first stage to the processing unit where the graph node with that graph node as a neighbor is located includes: the communication module of the processing unit sends the first tensor computation result of the graph nodes in the buffer of the processing unit to the processing unit where the graph node with that graph node as a neighbor is located; the process of performing a feature aggregation operation on the first tensor computation result of the first graph node and the first tensor computation result of the second graph node includes: the computation module of the first processing unit receives the first tensor computation result of the second graph node through the communication module of the first processing unit, and obtains the first tensor computation result of the first graph node from the buffer of the first processing unit, and performs a feature aggregation operation on the first tensor computation result of the first graph node and the first tensor computation result of the second graph node.

[0010] In this implementation, the tensor calculation results of the graph nodes calculated by the processing unit can be stored in the cache of the processing unit. After receiving the tensor calculation results of the graph nodes with the graph node as a neighbor, the processing unit can retrieve the tensor calculation results of the graph nodes from the cache. Thus, it can obtain the tensor calculation results of the graph nodes and the tensor calculation results of the graph nodes with the graph node as a neighbor without accessing memory, and can perform feature aggregation operations on the tensor calculation results of the graph nodes and the tensor calculation results of the graph nodes with the graph node as a neighbor.

[0011] In one possible implementation, before the processing unit executes the tensor computation task of the first stage, the method further includes: dividing the tensor operation to be executed by the processing unit into N stages of tensor computation tasks, wherein the N stages of tensor computation tasks are executed by the processing unit in sequence, the data size of the output result of each stage of tensor computation task is consistent with the space size of the buffer of the processing unit, and N is an integer greater than 1.

[0012] In this implementation, the tensor computation task can be divided into multiple stages for execution, thereby reducing the requirements for the computational and storage performance of the processing unit and saving hardware costs.

[0013] In one possible implementation, the tensor operations to be performed by the processing unit include: updating the features of the graph nodes assigned to the processing unit using a weight matrix with M columns; where M is an integer greater than 1; dividing the tensor operations to be performed by the processing unit into N stages of tensor computation tasks includes: dividing the weight matrix into N sub-matrices with L columns, wherein the N stages of tensor computation tasks correspond one-to-one with the N sub-matrices, and M×L=N; performing the first tensor operation on the feature data of the graph nodes assigned to the processing unit includes: updating the features of the graph nodes assigned to the processing unit using the sub-matrices corresponding to the first stage of tensor computation tasks to obtain the first tensor computation result of the graph nodes.

[0014] In one possible implementation, the second processing unit is further allocated a third graph node in the relational graph, which is a neighbor node of the first graph node in the relational graph. Sending the first tensor calculation result of the graph node obtained by the processing unit in performing the tensor calculation task of the first stage to the processing unit where the graph node with that graph node as a neighbor node is located includes: the second processing unit performs feature aggregation operation on the first tensor calculation result of the second graph node and the first tensor calculation result of the third graph node to obtain the pre-aggregated result of the second graph node and the third graph node; the second processing unit sends the pre-aggregated result to the first processing unit; performing feature aggregation operation on the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node includes: performing feature aggregation operation on the first tensor calculation result of the first graph node and the pre-aggregated result to obtain the first aggregated result of the first graph node.

[0015] In this implementation, if multiple graph nodes in a processing unit are neighbor nodes of graph nodes in other processing units, the tensor calculation results of these multiple graph nodes can be aggregated first, and then the aggregated results can be sent to other processing units, thereby saving communication resource overhead.

[0016] In one possible implementation, sending the first tensor calculation result of the graph node obtained by the processing unit in performing the tensor calculation task of the first stage to the processing unit where the graph node with the graph node as its neighbor is located includes: the second processing unit confirming that the first tensor calculation result of the second graph node is the only information sent by the second processing unit to the first processing unit at the first moment; at the first moment, the second processing unit sends the first tensor calculation result of the second graph node to the first processing unit.

[0017] This implementation method avoids information transmission conflicts caused by sending multiple messages to a processing unit through the same transmission path, thus improving the performance of information transmission between processing units.

[0018] In one possible implementation, each of the multiple processing units has P neighboring units, wherein each processing unit's neighboring units are the processing units among the multiple processing units, and there is a data path between each processing unit and its neighboring units, where P is an integer greater than 1; when the first processing unit is a neighboring unit of the second processing unit, the second processing unit sending the first tensor calculation result of the second graph node to the first processing unit includes: the second processing unit sending the first tensor calculation result of the second graph node to the first processing unit through the data path between the first and second processing units.

[0019] In one possible implementation, the computing device further includes a router; when the first processing unit is not a neighboring unit of the second processing unit, the second processing unit sending the first tensor calculation result of the second graph node to the first processing unit includes: the second processing unit receiving a forwarding unit instruction from the router; the second processing unit sending the first tensor calculation result of the second graph node to the processing unit indicated by the forwarding unit instruction, so as to send the first tensor calculation result of the second graph node to the first processing unit through the processing unit indicated by the forwarding unit instruction.

[0020] In this implementation, the router can instruct the processing unit to send information in order to avoid information transmission conflicts.

[0021] In one possible implementation, the forwarding unit indication is generated by the router based on the routing table, where a next-hop processing unit of a forwarding unit corresponds to at most a previous-hop processing unit of the forwarding unit.

[0022] In this implementation, multiple processing units can avoid sending information to the same processing unit through the same forwarding unit, thereby avoiding information transmission conflicts during information forwarding and improving the performance of information transmission between processing units.

[0023] In one possible implementation, the method further includes: the router calculating the shortest path from each source processing unit to each destination processing unit and the set of single-step paths corresponding to the shortest path, obtaining multiple shortest paths and the set of single-step paths corresponding to each shortest path in the multiple shortest paths, wherein the source processing unit and the destination processing unit are different processing units among the multiple processing units, and the source processing unit is the transmission starting point of the tensor calculation result, and the destination processing unit is the transmission ending point of the tensor calculation result; the router, according to the path length of the multiple shortest paths in ascending order, and according to the principle that a next-hop processing unit of a forwarding unit corresponds to at most a previous-hop processing unit of the forwarding unit, sequentially selects single-step paths to form the shortest paths from the multiple single-step path sets to obtain a routing table.

[0024] In this implementation, the shortest path between the source processing unit and the target processing unit can be obtained, thereby transmitting information from the source processing unit to the target processing unit through the shortest path and improving transmission efficiency.

[0025] The shorter the path length of the shortest path, the fewer processing units can be selected to form the shortest path. Therefore, by selecting processing units that form the shortest path with shorter path lengths and then selecting processing units that form the shortest path with longer path lengths, a routing table that can avoid information transmission conflicts can be obtained efficiently.

[0026] Secondly, a computing device is provided, comprising multiple processing units, wherein the multiple processing units are assigned graph nodes in a relational graph, and the graph nodes assigned to different processing units are different; the processing units are configured to execute a first-stage tensor computation task, the first-stage tensor computation task including performing a first tensor operation on the feature data of the graph nodes assigned to the processing units to obtain a first tensor computation result of the graph nodes; after the processing unit completes the execution of the first-stage tensor computation task, it sends the first tensor computation result of the graph nodes obtained by the processing unit in executing the first-stage tensor computation task to the processing unit where the graph node with that graph node as a neighbor node is located, and begins execution of a second stage. The tensor computation task is as follows: When the first processing unit, which is assigned a first graph node, receives the first tensor computation result of the second graph node sent by the second processing unit, which is assigned a second graph node, the first processing unit is used to interrupt the tensor computation task of the second stage and perform feature aggregation operation on the first tensor computation result of the first graph node and the first tensor computation result of the second graph node to obtain the first aggregation result of the first graph node; wherein, the second graph node is the neighbor node of the first graph node in the relation graph; when the feature aggregation operation on the first tensor computation result of the first graph node and the first tensor computation result of the second graph node ends, the first processing unit is used to continue to execute the tensor computation task of the second stage.

[0027] In one possible implementation, the processing unit includes a calculation module, a buffer, and a communication module. The calculation module of the processing unit performs a first tensor operation on the feature data of the graph nodes allocated to the processing unit and outputs the first tensor calculation result of the graph nodes to the buffer of the processing unit. The communication module of the processing unit sends the first tensor calculation result of the graph nodes in the buffer of the processing unit to the processing unit where the graph node with the graph node as its neighbor is located. The calculation module of the first processing unit receives the first tensor calculation result of the second graph node through the communication module of the first processing unit, obtains the first tensor calculation result of the first graph node from the buffer of the first processing unit, and performs feature aggregation operation on the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node.

[0028] In one possible implementation, the apparatus further includes a partitioning unit; the partitioning unit is used to divide the tensor operations to be performed by the processing unit into N stages of tensor computation tasks, wherein the N stages of tensor computation tasks are executed sequentially by the processing unit, and the data size of the output result of each stage of tensor computation task is consistent with the space size of the buffer of the processing unit, where N is an integer greater than 1.

[0029] In one possible implementation, the processing unit is used to update the feature data of the graph nodes assigned to the processing unit using a weight matrix with M columns; M is an integer greater than 1; the partitioning unit is used to divide the weight matrix into N sub-matrices with L columns, wherein the N stages of tensor computation tasks correspond one-to-one with the N sub-matrices, and M×L=N; the processing unit is used to update the feature data of the graph nodes assigned to the processing unit using the sub-matrices corresponding to the tensor computation tasks of the first stage, so as to obtain the first tensor computation result of the graph nodes.

[0030] In one possible implementation, the second processing unit is further allocated a third graph node in the relational graph, which is a neighbor node of the first graph node in the relational graph; the second processing unit is used to perform feature aggregation operations on the first tensor calculation results of the second graph node and the first tensor calculation results of the third graph node to obtain the pre-aggregation results of the second graph node and the third graph node; the second processing unit is used to send the pre-aggregation results to the first processing unit; the first processing unit is used to perform feature aggregation operations on the first tensor calculation results and the pre-aggregation results of the first graph node to obtain the first aggregation result of the first graph node.

[0031] In one possible implementation, the second processing unit is used to confirm that the first tensor calculation result of the second graph node is the only information sent by the second processing unit to the first processing unit at the first moment; at the first moment, the second processing unit is used to send the first tensor calculation result of the second graph node to the first processing unit.

[0032] In one possible implementation, each of the multiple processing units has P neighboring units, wherein each processing unit's neighboring units are the processing units among the multiple processing units, and there is a data path between each processing unit and its neighboring units, where P is an integer greater than 1; when the first processing unit is a neighboring unit of the second processing unit, the second processing unit is used to send the first tensor calculation result of the second graph node to the first processing unit through the data path between the first and second processing units.

[0033] In one possible implementation, the computing device further includes a router; when the first processing unit is not a neighboring unit of the second processing unit, the second processing unit is configured to receive a forwarding unit instruction from the router; the second processing unit is configured to send the first tensor calculation result of the second graph node to the processing unit indicated by the forwarding unit instruction, so as to send the first tensor calculation result of the second graph node to the first processing unit through the processing unit indicated by the forwarding unit instruction.

[0034] In one possible implementation, the forwarding unit indication is generated by the router based on the routing table, where a next-hop processing unit of a forwarding unit corresponds to at most a previous-hop processing unit of the forwarding unit.

[0035] In one possible implementation, the router is further configured to: calculate the shortest path from each source processing unit to each destination processing unit and the set of single-step paths corresponding to the shortest paths, thereby obtaining multiple shortest paths and the set of single-step paths corresponding to each of the multiple shortest paths, wherein the source processing unit and the destination processing unit are different processing units among the multiple processing units, and the source processing unit is the transmission starting point of the tensor calculation result, and the destination processing unit is the transmission ending point of the tensor calculation result; and select single-step paths to form the shortest paths sequentially from the multiple single-step path sets according to the path length of the multiple shortest paths in ascending order, and according to the principle that a next-hop processing unit of a forwarding unit corresponds to at most a previous-hop processing unit of the forwarding unit, in order to obtain a routing table.

[0036] Thirdly, a computing system is provided, comprising: a memory for storing feature data of graph nodes in a relational graph; and a computing device provided in the second aspect.

[0037] Fourthly, a computer-readable storage medium is provided, including computer program instructions that, when executed by a computing device, perform the method as provided in the first aspect.

[0038] Fifthly, a computer program product containing instructions is provided, which, when executed by a computing device, cause the computing device to perform the method provided in the first aspect.

[0039] The graph processing method, computing device, and system provided in this application enable the processing unit to obtain the tensor calculation results of the neighboring nodes of a graph node without memory access. This allows for feature aggregation operations on the tensor calculation results of the graph node and the tensor calculation results of the graph nodes whose neighbors are that node. In other words, this solution implements graph operations in graph processing without memory access, avoiding the low processing efficiency caused by random memory access in graph processing. Attached Figure Description

[0040] Figure 1A A diagram illustrating the time overhead of related operations in graph processing;

[0041] Figure 1B A schematic diagram illustrating the cache hit rate of related operations in a graph processing technique;

[0042] Figure 2 This is a schematic diagram illustrating the execution time sequence of related operations in a relational graph processing method.

[0043] Figure 3 This is a schematic diagram of the structure of a computing device provided in one embodiment of this application;

[0044] Figure 4 This is a schematic diagram of the structure of a computing device provided in one embodiment of this application;

[0045] Figure 5 This refers to the execution time sequence of related operations in a relational graph processing method provided in one embodiment of this application.

[0046] Figure 6 This is an execution flow of a relationship graph processing scheme provided in one embodiment of this application;

[0047] Figure 7A This is a schematic diagram of a graph node allocation strategy provided in an embodiment of this application;

[0048] Figure 7B This is a schematic diagram of a graph node allocation strategy provided in an embodiment of this application;

[0049] Figure 7C A schematic diagram illustrating a tensor computation task and a feature aggregation computation task provided in an embodiment of this application;

[0050] Figure 7D A schematic diagram illustrating a tensor computation task and a feature aggregation computation task provided in an embodiment of this application;

[0051] Figure 7E A schematic diagram illustrating a tensor computation task and a feature aggregation computation task provided in an embodiment of this application;

[0052] Figure 8 This application provides a schematic diagram of tensor computation task partitioning as an embodiment.

[0053] Figure 9 A network topology diagram between processing units is provided as an embodiment of this application;

[0054] Figure 10 A network topology diagram between processing units is provided as an embodiment of this application;

[0055] Figure 11 A schematic diagram of routing table calculation provided in an embodiment of this application;

[0056] Figure 12 A schematic diagram of routing table calculation provided in an embodiment of this application;

[0057] Figure 13 A schematic diagram of routing table calculation provided in an embodiment of this application;

[0058] Figure 14 A schematic diagram illustrating a relational graph processing scheme provided in an embodiment of this application;

[0059] Figure 15 A schematic diagram illustrating a relational graph processing scheme provided in an embodiment of this application;

[0060] Figure 16 This is a schematic diagram illustrating the time overhead of related operations for graph processing in the embodiments of this application;

[0061] Figure 17A This is a routing logic layout for an FPGA chip with a Cross-Bar topology.

[0062] Figure 17B This is a wiring logic layout for an FPGA chip with a 2-D Tours topology.

[0063] Figure 17C This is a wiring logic layout for an FPGA chip with a 4-D hypercube topology.

[0064] Figure 18 A flowchart illustrating a relationship diagram processing method provided in this application embodiment;

[0065] Figure 19 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application;

[0066] Figure 20 This is a schematic diagram of the structure of a computing system provided in an embodiment of this application. Detailed Implementation

[0067] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them.

[0068] In the description of this specification, terms such as "one embodiment" or "some embodiments" mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0069] Additionally, in the description of this specification, "multiple" means two or more.

[0070] Graph neural networks (GNNs) utilize machine learning techniques to learn the feature information of graph nodes and the relationship information between them on non-Euclidean graph structures. GNNs combine the irregularity of traditional graph computation with the regularity of neural network computation. Therefore, the computational paradigm of GNNs exhibits hybrid characteristics, and can be divided into two stages based on the regularity of computation: graph operations (aggregation) and tensor operations (combination).

[0071] Graph operations, also known as feature aggregation operations, refer to merging the feature data of a graph node's neighboring nodes into the feature data of that graph node. The feature data of a graph node can be simply referred to as the graph node's features. The merging of feature data from different graph nodes is called feature aggregation. For example, feature data fusion can be achieved by adding features. For instance, adding the feature data of a graph node to the feature data of its neighboring nodes yields the aggregated feature data of that graph node.

[0072] Tensor operations include tensor computation, which refers to multiplying the feature data of graph nodes by a weight matrix to obtain updated feature data.

[0073] Table 1 lists the meanings of the mathematical symbols related to GNN. The vertices in Table 1 are the graph nodes in the relational graph.

[0074] Table 1

[0075]

[0076]

[0077] Equation (1) illustrates the forward propagation process of the I-th layer of the GNN:

[0078]

[0079] in, It is the output feature vector of vertex u in layer l, and also the input feature vector of vertex u in layer (l+1). The aggregation function Aggregation(·) aggregates the features of the neighbors of the target vertex u, and the combination function Combination(·) transforms the features of vertex u using a neural network.

[0080] Current computing devices used for processing relational graphs, such as artificial intelligence (AI) accelerators, employ a multi-core, multi-threaded parallel computing model, which is suitable for tensor operations that compute memory access rules in GNNs. However, in graph operations, the low cache hit rate of graph nodes leads to a large number of random memory accesses, resulting in low overall efficiency of AI accelerators when performing GNN computations.

[0081] AI accelerators, also known as AI chips, are chips specifically designed for machine learning. Common AI accelerators include... Chips, graphics processing units (GPUs), tensor processing units (TPUs), etc.

[0082] Figure 1A This diagram illustrates the time required for combinatorial computation and aggregate memory access when the same GPU processes different relational graphs. Combinatorial computation refers to tensor computation within tensor operations, aggregate computation refers to aggregate computation within graph operations, aggregate memory access refers to memory access within graph operations, and aggregate memory access refers to aggregate computation within graph operations. CA, CT, PB, CS, FK, RD, YP, and AM represent different relational graphs.

[0083] Figure 1B The diagram illustrates the cache hit rates for tensor operations, preprocessing operations, and graph operations when the same GPU processes different relational graphs. Relational graphs A1, A2, and A3 are different relational graphs.

[0084] In one approach, to address the computational bottleneck caused by random memory access in graph operations, such as... Figure 2As shown, a tensor computation processor and a graph aggregation processor work together to perform relational graph processing tasks. The graph aggregation processor performs graph operations, and the tensor computation processor performs tensor operations. This scheme requires a dedicated graph aggregation processor, increasing hardware costs. Furthermore, the computationally faster tensor computation processor has to wait for the slower graph aggregation processor; therefore, this scheme offers limited improvement in relational graph processing efficiency. Figure 2 In the diagram, P(1), P(2), and P(3) represent tensor computation tasks at different stages, and P'(1) and P'(2) represent graph operation tasks at different stages.

[0085] To address the above issues, this application provides a graph processing solution that eliminates random memory accesses during graph operations, thereby improving graph processing efficiency and eliminating the need for a dedicated hardware module for aggregation operations, thus reducing hardware costs.

[0086] This relational graph processing scheme is a method for fusing tensor operations and graph operations in GNN computation. In this scheme, random memory access in graph operations is converted into message passing between processing units; that is, communication between processing units replaces their access to memory. For example, a centralized router outside multiple processing units can convert the connections in the relational graph into non-blocking message passing information between the processing units, allowing tensor computation operations and message passing between processing units to be performed synchronously during the relational graph processing.

[0087] Next, the relational graph processing scheme provided in the embodiments of this application will be described in detail.

[0088] First, a computing device 100 that can be used to implement the relational graph processing scheme provided in the embodiments of this application is introduced.

[0089] In some embodiments, the computing device 100 may be a dedicated accelerator system or a programmable hardware system for GNN inference, training, etc. The computing device may be implemented in hardware.

[0090] In some embodiments, the computing device 100 may be implemented as a chip.

[0091] In some embodiments, Figure 3 One possible structure of the computing device 100 is shown. For example... Figure 3As shown, the computing device 100 includes multiple processing units, such as processing unit 0, processing unit 1, processing unit 2, processing unit 3, processing unit 4, processing unit 5, processing unit 6, processing unit 7, processing unit 8, processing unit 9, processing unit 10, processing unit 11, processing unit 12, processing unit 13, processing unit 14, processing unit 15, etc.

[0092] In some embodiments, the computing device 100 may be implemented as a multi-core processor, and the processing unit on the computing device 100 may be a computing core in the multi-core processor. For example, see [link to documentation]. Figure 4 This multi-core processor can be an AI chip, and correspondingly, the processing unit can be an AI computing core.

[0093] In some embodiments, the processing unit may be a field-programmable gate array (FPGA).

[0094] In some embodiments, the processing unit may be an application-specific integrated circuit (ASIC).

[0095] In some embodiments, the system architecture of the computing device 100 adopts a distributed shared storage system (DSM) model with nonuniform memory access (NUMA) memory access characteristics. That is, the off-chip memory corresponding to each processing unit is distributed among the processing units. The processing unit independently accesses the off-chip memory corresponding to its own processing unit and indirectly accesses the off-chip memory corresponding to other processing units through the interconnection network between processing units. In the embodiments of this application, since the graph nodes in the relational graph are assigned to multiple processing units, the off-chip memory of each processing unit is used to store the graph nodes assigned to that processing unit. Therefore, the advantages of adopting the DSM architecture are: (1) it can effectively reduce the computational coupling of graph operations of graph nodes in each processing unit, can better realize data parallelism, improve the local utilization of data, and allow graph operations in each processing unit to be performed in an orderly manner; (2) the off-chip memory can provide higher bandwidth for each processing unit. In a symmetric multiprocessing (SMP) architecture, each processing unit can access global memory, increasing flexibility. However, during graph operations, the shared access medium leads to significant contention and latency when accessing shared memory. This contention and latency are particularly pronounced on graphs with many edges. This problem also exists in single-machine accelerators. For example, in memory (double data rate synchronous dynamic random access memory (DDR SDRAM) or high bandwidth memory (HBM), each stack is divided into multiple independent memory channels, but the memory controller is allowed to perform global addressing from any input port to any part of the memory via a crossbar switch. This process incurs significant overhead; the memory controller's access to the address space of other channels is limited to a maximum throughput of 50% of the full bandwidth, resulting in severe performance degradation for graph operations.

[0096] In some embodiments, off-chip memory is used to store feature data of graph nodes assigned to each processing unit, partial results of feature aggregation of the graph node, and weight matrix for updating the feature data.

[0097] In some embodiments, off-chip memory may be random access memory (DDR or HBM) or non-volatile memory (e.g., solid state disk (SSD) or hard disk disk (HHD)).

[0098] In some embodiments, such as Figure 3 As shown, each processing unit has a local buffer. This local buffer is used to temporarily store data for upcoming message passing (e.g., tensor calculation results from the processing unit), and to receive tensor calculation results from other processing units for feature aggregation within this unit. For example, the local buffer can be on-chip synchronous dynamic random access memory (SDRAM) or block random access memory (BRAM) on the processing unit.

[0099] In some embodiments, such as Figure 3 As shown, the computing device 100 also includes an edge data cache. The edge data cache is used to store feature data of edges in the relational graph. Exemplarily, the edge data cache can be random access memory (DDR or HBM) or non-volatile memory (e.g., SSDHHD).

[0100] Each of the multiple processing units has P neighboring units, where each processing unit's neighboring units are other processing units within the multiple processing units. Each processing unit and its neighboring units have a data path between them, and P is an integer greater than 1. These data paths between processing units constitute an interconnection network connecting the various processing units.

[0101] In some embodiments, the topology between the plurality of processing units is an orthogonal topology, for example, the topology between the plurality of processing units can be a butterfly topology, a cubic topology, or an Omega topology. Figure 3 The diagram shows a 4-dimensional hypercube topology.

[0102] like Figure 3 and Figure 4 As shown, each processing unit has a data path with its four neighboring processing units, meaning each processing unit has four neighboring units.

[0103] In some embodiments, such as Figure 3 As shown, each processing unit has off-chip memory that is exclusively used by that processing unit.

[0104] In some embodiments, such as Figure 3 As shown, the computing device 100 also includes a centralized router for communication between processing units.

[0105] Each processing unit's local buffer can be accessed independently by the router. When a processing unit has tensor computation results to send from its local buffer, the router can send a message passing instruction to that processing unit. The message passing instruction indicates the data channel used for data transmission at the current moment. In one example, the message passing instruction includes two formats of instruction messages. One format includes: the identifier of the processing unit where the target graph node resides (e.g., processing unit number), the storage address of the target graph node's feature data in the processing unit's local buffer, edge coefficients, the identifier of the processing unit where the source graph node resides, and the storage address of the source graph node's feature data in the processing unit's local buffer. Here, the source graph node and the target graph node are graph nodes in the relational graph, and the source graph node is a neighbor of the target graph node in the relational graph. The other format of the instruction message includes: the identifier of the single-step path receiving unit and the identifier of the single-step path sending unit. Here, a single-step path refers to a one-step route, that is, one processing unit sends, another processing unit receives, and no third processing unit is involved. A single-step path is the smallest unit of a transmission path. The single-step path receiving unit refers to the processing unit that receives data in a single-step path, while the single-step path sending unit refers to the processing unit that sends data in a single-step path.

[0106] In some embodiments, the local buffer of a processing unit may consist of an output data buffer, a neighbor data buffer, and an aggregate data buffer. That is, the local buffer can be divided into an output data buffer, a neighbor data buffer, and an aggregate data buffer. The output data buffer is used to store the tensor calculation results generated during tensor calculations performed by the processing unit. When the output data buffer is full, the processing unit can send the tensor calculation results to other processing units. The specific tensor calculation results sent to which processing units will be described below and will not be repeated here.

[0107] When the output data buffer is full, the neighbor data buffer is used by the processing unit to store tensor calculation results when executing the next stage of tensor calculation tasks. Specifically, when the output data buffer is full, the processing unit stores the generated tensor calculation results in the neighbor data buffer when executing the next stage of tensor calculation tasks. When the neighbor data buffer is full, and all the tensor calculation results in the output data buffer (i.e., the tensor calculation results generated by the tensor calculation task in the previous stage that produced the tensor calculation results stored in the neighbor data buffer) have been sent to other processing units and the feature aggregation operation executed by this processing unit has been completed, the output data buffer can be cleared. The cleared output data buffer can then be used by the processing unit to store tensor calculation results when executing the next stage of tensor calculation tasks.

[0108] For example, see Figure 5 When the processing unit executes the tensor calculation task in stage P(1), it stores the tensor calculation results generated by the tensor calculation task in stage P(1) into the output data buffer. When the output data buffer is full, the tensor calculation task in stage P(1) ends. If the neighbor data buffer has been cleared, the processing unit executes the tensor calculation task in stage P(2) and stores the tensor calculation results generated by the tensor calculation task in stage P(2) into the neighbor data buffer. If the neighbor data buffer is full, the tensor calculation task in stage P(2) ends. If the tensor calculation results in the output data buffer (i.e., the tensor calculation results generated by the tensor calculation task in stage P(1)) have all been sent to other processing units and the feature aggregation operation executed by this processing unit has been completed, the output data buffer can be cleared. When the output data buffer is cleared, the processing unit executes the tensor calculation task in stage P(3) and stores the tensor calculation results in stage P(3) into the output data buffer. And so on, the output data buffer and the neighbor data buffer are used alternately by the processing unit to store the tensor calculation results. In this context, stage P(2) is the next stage after stage P(1), and stage P(3) is the next stage after stage P(2).

[0109] When a processing unit sends tensor calculation results to other processing units, it can also receive tensor calculation results from other processing units and perform feature aggregation operations based on the tensor calculation results generated by the processing unit itself and those received from other processing units. Specifically, the processing unit performs tensor calculations on graph node C1 in the relational graph to obtain the tensor calculation result of graph node C1. The processing unit receives the tensor calculation result of graph node C2 in the relational graph from other processing units, where graph node C2 is a neighbor node of graph node C1 in the relational graph. The processing unit then performs feature aggregation operations on the tensor calculation results of graph node C1 and graph node C2 to obtain the feature aggregation result of graph node C1. The processing unit can store the feature aggregation result of graph node C1 in the aggregation data buffer. That is, the aggregation data buffer of the processing unit is used to store the feature aggregation results generated by the processing unit's feature aggregation operation.

[0110] More specifically, due to the limited computational and storage resources of the processing unit, the computational tasks allocated to the processing unit need to be processed in blocks. Graph operations, i.e., feature aggregation operations, depend on the results of tensor computation tasks. Therefore, the tensor computation tasks allocated to the processing unit are divided into multiple independent tensor computation subtasks according to the space of the output data buffer. Different tensor computation subtasks are executed at different stages; therefore, tensor computation subtasks are also called staged tensor computation tasks, and a tensor computation subtask is a tensor computation task at a certain stage. The size of the tensor computation result obtained by each staged tensor computation task is equal to or less than the size of the output data buffer. The buffer space refers to the storage capacity of the buffer, i.e., the amount of data the buffer can hold. The sizes of the output data buffer, neighbor data buffer, and aggregation data buffer are equal.

[0111] The processing unit begins executing the first stage of tensor computation, and writes the calculated tensor result to either the output data buffer or the neighbor data buffer. Within the computing device 100, each processing unit executes its own tensor computation task for its first graph node in parallel.

[0112] In some embodiments, while the processing unit begins executing the tensor computation task of the first stage, the router calculates routing information to obtain a routing table. The graph nodes of the graph can be assigned to multiple processing units based on the rows of the adjacency matrix of the graph. Each processing unit is assigned one or more rows of graph nodes, and the graph nodes assigned to different processing units are different. The router can determine which graph nodes each processing unit is assigned to by using methods such as row modulo operations, i.e., obtaining the processing unit to which each graph node belongs in the graph. The processing unit to which a graph node belongs refers to the processing unit to which the graph node was assigned. The router can calculate routing information based on the edge table. The edge table is used to indicate which graph nodes have connecting edges, i.e., which graph nodes are the neighbors of a graph node, and which graph node a graph node is a neighbor of. The feature aggregation operation refers to aggregating the features of the graph node's neighbors with the features of the current graph node. Therefore, the processing unit needs to send the tensor computation result of its calculated graph node to the processing unit to which the graph node that is a neighbor belongs. For example, if graph node C1 is a neighbor of graph node C2, then the processing unit containing graph node C1 will send the tensor computation result of graph node C1 to the processing unit containing graph node C2. Routing information indicates to which unit a processing unit needs to send the tensor computation result to. In other words, routing information includes converting the tensor computation results that satisfy the data dependencies of the graph aggregation operation (i.e., the already computed neighbor node features) into a message-passing format between processing units via routing computation, so that implicit communication can be performed in subsequent stages, thereby improving on-chip data access efficiency and data reuse rate.

[0113] After the processing unit completes the first stage of tensor computation, one of its output data buffer and neighbor data buffer is filled. That is, when performing tensor computation, the processing unit stores the tensor computation result in either the output data buffer or the neighbor data buffer, thus avoiding the need to write the result to off-chip memory and saving data write time.

[0114] After completing the first stage of tensor computation, each processing unit can send the tensor computation results of a graph node to the processing unit containing the graph node whose neighbor is that node. Each processing unit can send its own calculated tensor computation results to the corresponding processing unit. Thus, after the first stage of tensor computation is completed, the processing units enter the tensor computation result transmission and aggregation phase. This tensor computation result transmission and aggregation phase, also known as the aggregation-memory access phase, consists of the tensor computation result transmission process and the tensor computation result aggregation operation. During the tensor computation result transmission process, the processing unit sends or receives data without affecting the execution of the tensor computation task. Therefore, if... Figure 5 As shown, for each processing unit, tensor computation result transmission and tensor computation tasks can be executed in parallel. Specifically, the tensor computation result transmission, which runs parallel to the tensor computation task, transmits the tensor computation results from the previous stage of the tensor computation task. See details... Figure 5 The tensor computation result transmission process in stage P'(1) is parallel to the tensor computation task execution process in stage P(2), and the tensor computation result transmitted in P'(1) is the tensor computation result obtained by the tensor computation task in stage P(1). The tensor computation result transmission process in stage P'(2) is parallel to the tensor computation task execution in stage P(3), and the tensor computation result transmitted in P'(2) is the tensor computation result obtained by the tensor computation task in stage P(2).

[0115] See Figure 5 After the processing unit completes the tensor calculation task of the first stage (i.e. P(1)), it can continue to execute the tensor calculation task of the second stage (i.e. P(2)). When executing the tensor calculation task of the second stage, the tensor calculation result can be output to the other one of the output data buffer and the neighbor data buffer, i.e. the unfilled buffer in the output data buffer and the neighbor data buffer.

[0116] like Figure 5As shown, during the execution of the second-stage tensor computation task, after receiving the tensor computation results from the neighboring nodes of the graph node assigned to the processing unit, the processing unit can interrupt the tensor computation task and execute the feature aggregation operation of the graph node. This feature aggregation operation can also be called aggregation computation.

[0117] More specifically, during the execution of a tensor computation task in a stage (e.g., stage P(2)), the output data buffer or neighbor data buffer stores the tensor computation results generated in the previous stage (e.g., stage P(1)). At this time, the router determines that message passing is required. Therefore, the router sends a message passing instruction to each processing unit, instructing each processing unit to send the tensor computation results to other processing units. For example, graph node C1 is a neighbor node of graph node C2. The processing unit where graph node C1 is located is processing unit 1 (i.e., graph node C1 is assigned to processing unit 1), and the processing unit where graph node C2 is located is processing unit 2 (i.e., graph node C2 is assigned to processing unit 2). Then processing unit 1 sends the tensor computation results of graph node C1 to processing unit 2.

[0118] In some embodiments, the processing unit further includes a transmission register group, a channel register group, and a routing information receiver. The transmission register group includes P transmission registers, and the channel register group includes P channel registers. As described above, the processing unit has P neighboring units, and a data channel exists between the processing unit and each neighboring unit; thus, the processing unit has P data channels. The P transmission registers in the processing unit's transmission register group correspond one-to-one with the P data channels, and the P channel registers in the processing unit's channel register group correspond one-to-one with the P data channels.

[0119] The transmission register is used to store data to be sent or received through its corresponding transmission channel; the channel register is used to temporarily store messages sent to its corresponding data channel.

[0120] The routing information receiver is used to decode the message passing instructions sent by the router to the processing unit, so that the processing unit can execute the message passing instructions. For example, it can specify which input data channel the processing unit should latch data from and which channel the latched data should be written to for output. The data source indicated by the message passing instructions is the local buffer of the processing unit, specifically a buffer (output data buffer or neighbor data buffer) that stores the tensor calculation results generated by the recently completed tensor calculation task.

[0121] The message transmission instructions sent by the router to the processing unit are called instruction queues, which can include instruction messages in two formats.

[0122] First, the router sends a command message of the first format of the two formats to the processing unit. As described above, the first format command message includes: the identifier of the processing unit where the target graph node is located, the storage address of the target graph node's feature data in the processing unit's local buffer, edge coefficients, the identifier of the processing unit where the source graph node is located, and the storage address of the source graph node's feature data in the processing unit's local buffer. Here, the source graph node and the target graph node are graph nodes in the relational graph, and the source graph node is a neighbor of the target graph node in the relational graph.

[0123] Before sending tensor computation results to other processing units, the processing unit can perform feature pre-aggregation. For example, the nodes assigned to processing unit 1 include graph node C1 and graph node C3, both of which are neighbors of graph node C2. Processing unit 1 can first aggregate the tensor computation results of graph node C1 and graph node C3 to obtain a pre-aggregated result. Then, the pre-aggregated result is used as a message to be transmitted to processing unit 2, where graph node C2 is located. In this way, communication resources can be received, and data transmission efficiency can be improved.

[0124] The message to be sent is written into the transmission register of the processing unit, preparing to start sending the message. The message carries the tensor calculation result of the graph nodes. In each subsequent transmission cycle, the routing receiver in each AI computation core receives a message instruction of the second format from the router. This second format instruction message includes: the identifier of the single-step path receiving unit and the identifier of the single-step path sending unit. From this point, the processing unit determines, based on the single-step path receiving unit identifier, the message to be received from the channel register of the processing unit corresponding to that identifier. The processing unit can store the received message in its own transmission register. Then, based on the single-step path sending unit identifier, the message temporarily stored in the transmission register is written into the channel register of the processing unit corresponding to that single-step path sending unit identifier, ready for transmission in the next transmission cycle.

[0125] While performing the tensor computation task of the current stage (e.g., stage P(2)), the processing unit checks the message information of each message in the transmission register. The message information includes the identifier of the destination processing unit (i.e., the destination of the message information) and the storage address of the target graph node's feature data in the processing unit's local buffer. If the destination processing unit is the processing unit that currently receives the message, it indicates that the message has been delivered to its destination. The processing unit then retrieves the target graph node's feature data from the buffer (output data buffer or neighbor data buffer) containing the tensor computation task from the previous stage (e.g., stage P(1)). The message includes the storage address of the target graph node's feature data in the processing unit's local buffer. The processing unit can retrieve the target graph node's feature data from the buffer containing the tensor computation task from the previous stage, i.e., the tensor computation result obtained from the previous stage's tensor computation task, based on the storage address of the target graph node's feature data in the processing unit's local buffer. Furthermore, the processing unit extracts the tensor computation result of the source graph node from the message. As mentioned above, the target graph node is the neighbor node of the source graph node in the relational graph. Then, the tensor calculation results of the target graph nodes and the tensor calculation results of the source graph nodes are aggregated to obtain the aggregated result of the feature data of the target graph nodes.

[0126] For example, if the graph nodes allocated by the processing unit include neighboring nodes of the target graph node, the processing unit can first perform an aggregation operation on the tensor calculation results of the target graph node and the tensor calculation results of the neighboring nodes of the target graph node allocated by the processing unit to obtain a pre-aggregated result of the tensor calculation results of the target graph node. In the processing unit's buffer, the tensor calculation results of the target graph node are updated to the pre-aggregated result of the tensor calculation results of the target graph node; that is, the pre-aggregated result of the tensor calculation results of the target graph node is stored at the same storage address as the tensor calculation results of the target graph node. In this example, when it is necessary to perform an aggregation operation with the tensor calculation results of the source graph node in the message, the processing unit obtains the pre-aggregated result of the tensor calculation results of the target graph node from the buffer and performs an aggregation operation or aggregation calculation on the pre-aggregated result of the tensor calculation results of the target graph node and the tensor calculation results of the source graph node to obtain the aggregated result of the feature data of the target graph node.

[0127] If the tensor computation result of the target graph node and the tensor computation results of all its neighboring nodes have completed feature aggregation, then the aggregated result of the target graph node's feature data is written to the aggregation data buffer. If the tensor computation result of the target graph node has not yet completed feature aggregation with the tensor computation results of all its neighboring nodes, then the currently obtained aggregated result of the target graph node's feature data is stored at the storage address of the target graph node's tensor computation result. That is, the data stored at this address is updated from the target graph node's tensor computation result or its pre-aggregated result to the aggregated result of the target graph node's feature data, awaiting aggregation with the tensor computation results of other neighboring nodes. Here, "other neighboring nodes" refers to graph nodes that have not yet undergone feature data aggregation (i.e., tensor computation result aggregation) with the target graph node.

[0128] Among them, such as Figure 5 As shown, when the processing unit needs to perform an aggregation operation on a target graph node (e.g., an aggregation operation between the tensor computation result or pre-aggregation result of the target graph node and the tensor computation result of the source graph node), the processing unit interrupts the currently executing tensor computation task and begins executing the aggregation operation on the target graph node. After the aggregation operation on the target graph node is completed, the execution of the tensor computation task resumes. When the processing unit receives tensor computation results from other neighboring nodes of the target graph node and needs to perform an aggregation operation on the target graph node again, the processing unit again interrupts the currently executing tensor computation task and begins executing the aggregation operation on the target graph node. After the aggregation operation on the target graph node is completed, the execution of the tensor computation task resumes. In this way, whenever a message destined for the current processing unit is received, the aggregation operation on the graph node can be performed without storing the message information, thus eliminating the need for random access to memory or cache during the execution of the aggregation operation on the graph node.

[0129] The processing unit determines whether the aggregation operation of all graph nodes it has allocated is complete. Completed graph node aggregation means that the tensor computation result of the graph node and the tensor computation results of all its neighboring nodes have been aggregated. If the aggregation operation of all graph nodes allocated to the processing unit is complete, that is, the tensor computation result transmission and aggregation of the current stage of the processing unit (e.g., stage P'(1)) has ended, the aggregation result of the graph node can be output to off-chip memory. Then, the buffer (i.e., output data buffer or neighbor data buffer) storing the tensor computation result of the previous stage or the aggregation result corresponding to the tensor computation result of the previous stage can be cleared, so that the cleared buffer can be used by the tensor computation task of the next stage. The aggregation buffer can also be cleared, so that the cleared aggregation buffer can be used by the aggregation operation of graph nodes in the tensor computation result transmission and aggregation of the next stage.

[0130] If the aggregation operation of one or more graph nodes assigned to the processing unit is not completed, that is, the tensor computation result transmission and aggregation of the current stage have not been completed, then continue to wait for the message destination to the processing unit to execute the aggregation operation of the graph nodes whose aggregation operation is not completed.

[0131] If the aggregation operations for all graph nodes allocated to each processing unit have been completed (i.e., the tensor computation result transmission and aggregation of the current stage have not yet ended), and the tensor computation task of the current stage executed by each processing unit has also been completed, then the processing unit can execute the tensor computation task of the next stage, and begin the tensor computation result transmission and aggregation of the next stage. See also Figure 5 If the tensor computation result transmission and aggregation in stage P'(1) are completed, and the tensor computation task in stage P(2) is also completed, then the processing unit can start the tensor computation result transmission and aggregation in stage P'(2), and start executing the tensor computation task in stage P(3). The tensor computation result transmitted in stage P'(2) is the tensor computation result generated by the tensor computation task in stage P(2).

[0132] Through the above scheme, each processing unit implicitly accesses local buffers across all processing units via message passing to satisfy the data dependencies of local graph node feature aggregation calculations. The message passing process is synchronized with the tensor computation operations in the processing unit's memory. Therefore, when the routing efficiency of message passing is high enough, sufficient bandwidth can be provided for message passing between processing units, resulting in fast message passing speeds that can promptly satisfy the data dependencies of graph node feature aggregation calculations for each processing node. This eliminates the latency caused by random memory accesses while improving the execution efficiency of graph operations. In particular, when the time required for message passing for graph operations is less than the time required for the tensor computation task to execute, the message passing time for graph operations can be completely hidden by the tensor computation task.

[0133] Furthermore, when the topology between processing units in the computing device 100 is an orthogonal topology, such as Figure 4 As shown, each processing unit can transmit messages (send or receive messages) with the four processing units connected to it via a switch. In this embodiment, the message interaction between processing units follows these rules.

[0134] Reception rules: At any given time, a processing unit can only receive one message from each of the processing units it is interconnected with. Since one processing unit is interconnected with four other processing units, it can receive four messages from different processing units at the same time.

[0135] Sending rules: At any given time, a processing unit can only send one message to each of the processing units it is interconnected with. If a processing unit is interconnected with four processing units, then at the same time, a processing unit can send four messages to four different processing units.

[0136] When a storage processing unit fails to meet the aforementioned sending or receiving rules at a certain moment, a routing conflict is considered to exist. A necessary condition for a conflict to exist is that within a single processing unit, there are multiple messages destined for the same processing unit that it is preparing to send.

[0137] To avoid the aforementioned routing conflicts, routers can generate routing tables based on the following rules:

[0138] A forwarding unit (i.e., a processing unit used for message forwarding) can have at most one preceding processing unit. That is, two or more processing units cannot send messages to the same processing unit through a single processing unit.

[0139] In some embodiments, the router may calculate the routing table using the following scheme.

[0140] a) The order in which the tensor calculation results of the graph nodes in the processing units are sent is changed until, when message passing is started, each processing unit simultaneously sends a message to the processing unit it is interconnected with, thereby avoiding write conflicts to the channel register when message transmission begins. In other words, it is necessary to ensure that each processing unit sends only one message to a single destination processing unit at a single time.

[0141] (b) The shortest path and the set of single-step paths from each source processing unit to each destination processing unit in the orthogonal topology are calculated using an XOR operation. Here, the source processing unit refers to the processing unit that is the data sender, and the destination processing unit is the processing unit that is the data receiver. That is, the source processing unit is the starting point for the transmission of the message carrying the tensor calculation result, and the destination processing unit is the ending point for the transmission of the message carrying the tensor calculation result. The shortest path from a source processing unit to a destination processing unit is the shortest path among all paths that can reach the destination processing unit. The path length is positively correlated with the number of processing units the message passes through; that is, the more processing units the message flows through, the longer the path. The computing device 100 has multiple source processing units and multiple destination processing units, thus multiple shortest paths. The set of single-step paths from a source processing unit to a destination processing unit refers to the set of selectable single-step paths that constitute the shortest path from the source processing unit to the destination processing unit; that is, the single-step paths that constitute the shortest path can be selected from the set of single-step paths. All single-step paths in the single-step path set can be used as alternative single-step paths for actual message transmission.

[0142] c) Select the single-step paths that make up the shortest path from the path set corresponding to the shortest path in order of path length from low to high. After the selection for the current shortest path is completed, delete the single-step paths that have the above-mentioned routing conflicts with the single-step paths selected for the current shortest path from the path set corresponding to other shortest paths.

[0143] d) Determine whether the next hop of the single-step path selected for a certain shortest path is the destination processing unit. If it is, terminate the selection of the shortest path to obtain the final single-step path that makes up the shortest path, which is the path actually used for message transmission. If it is not the destination processing unit, return to step c) and select the single-step path that makes up the shortest path again.

[0144] Thus, a routing table is obtained to instruct the processing unit to send message (i.e., tensor calculation results) to other processing units. Based on this routing table, the router can send the message instruction in the second format described above to the processing unit when the processing unit is transmitting tensor calculation results, instructing the processing unit to send or forward the message.

[0145] The foregoing example illustrates a computing device 100 that can be used to implement the graph processing scheme provided in the embodiments of this application, as well as the implementation methods and functions of each component included in the computing device 100. Next, the execution flow of the graph processing scheme provided in the embodiments of this application will be described in conjunction with the computing device 100.

[0146] See Figure 6In step 601, graph nodes in the relational graph to be processed can be assigned to multiple processing units in the computing device 100. Each processing unit can be assigned to at least one processing unit, and different processing units are assigned different graph nodes; that is, a graph node in the relational graph is assigned to only one processing unit. In some embodiments, step 601 can be executed by a general-purpose processor (e.g., a central processing unit, CPU) of the computing device or computing system in which the computing device 100 is located.

[0147] In some embodiments, the graph nodes in the relationship graph can be distributed to multiple processing units according to the following node distribution strategy. That is, the graph nodes in the relationship graph are evenly distributed to multiple processing units. In one example, there can be three processing units: processing unit B1, processing unit B2, and processing unit B3. The relationship graph to be processed has 21 graph nodes: C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, and C20. See also... Figure 7A The 21 graph nodes can be evenly distributed among the three processing units, with each unit receiving 7 nodes out of the 21. Figure 7A In the diagram, processing unit B1, processing unit B2, and processing unit B3 are represented by diagonal lines, vertical lines, and horizontal lines, respectively. Accordingly, the graph nodes located in the areas filled with diagonal lines are assigned to processing unit B1, the graph nodes located in the areas filled with vertical lines are assigned to processing unit B2, and the graph nodes located in the areas filled with horizontal lines are assigned to processing unit B3.

[0148] In some embodiments, graph nodes in the relational graph can be assigned to multiple processing units according to a graph node allocation strategy based on the adjacency matrix of the relational graph. Specifically, if there are Q processing units, the adjacency matrix of the relational graph can be divided into Q parts by columns, and the Q parts can be assigned to the Q processing units, with each processing unit assigned one part. The graph nodes in the part assigned to a processing unit are the graph nodes assigned to that processing unit. In one example, there can be three processing units: processing unit B1, processing unit B2, and processing unit B3. Figure 7B As shown, the adjacency matrix of the relational graph is divided into three parts by column, and these three parts are assigned to three processing units, with each processing unit receiving one part. Specifically, in... Figure 7B In the diagram, processing unit B1, processing unit B2, and processing unit B3 are represented by diagonal lines, vertical lines, and horizontal lines, respectively. Accordingly, the graph nodes located in the areas filled with diagonal lines are assigned to processing unit B1, the graph nodes located in the areas filled with vertical lines are assigned to processing unit B2, and the graph nodes located in the areas filled with horizontal lines are assigned to processing unit B3.

[0149] For ease of description, the graph nodes allocated to the processing unit can be referred to as the graph nodes of the processing unit. The feature data of the graph nodes of the processing unit can be stored in the off-chip memory of the processing unit. The processing unit is used to perform tensor computation and feature aggregation on its graph nodes. That is, the processing unit executes the tensor computation task and feature aggregation task corresponding to its graph nodes. Feature aggregation refers to fusing the feature data of the adjacent nodes of a graph node into the features of that graph node.

[0150] Since the computational and storage resources of a single processing unit are limited, in step 601, the tensor computation task to be performed by each processing unit can be divided into multiple tensor quantum tasks. As mentioned above, for the same processing unit, multiple tensor quantum tasks are tensor tasks executed at different time stages. That is, each processing unit can divide the tensor computation task into multiple cycles for execution. Among them, the feature aggregation computation task (i.e., graph operation task) is also divided into corresponding stage tasks.

[0151] In some embodiments, it is assumed that there are three processing units, and the tensor computation task to be performed by each processing unit is divided into tasks executed in three time phases. Figure 7B Taking the graph node allocation result shown as an example, the tensor computation task and feature aggregation computation task in the first stage are as follows: Figure 7C As shown, processing unit B3 performs tensor calculations and aggregation calculations for the horizontal line region, processing unit B1 performs tensor calculations and aggregation calculations for the vertical line region, and processing unit B1 performs tensor calculations and aggregation calculations for the diagonal line region. Each processing unit stores the aggregation calculation results from the first stage in an aggregation buffer. The tensor calculation task and feature aggregation calculation task for the second stage are as follows: Figure 7DAs shown, the computation window of processing unit B3 slides downwards along the adjacency matrix, calculating the graph node feature aggregation of the next region using the features stored locally in the processing unit. After the calculation is complete, the aggregated result is sent to processing unit B2. Processing unit B2 reads its local aggregation data buffer and adds it to the graph node features sent by processing unit B3. While processing unit B3 is performing the above operation, the computation window of processing unit B2 slides downwards along the adjacency matrix, calculating the node aggregation of the next region using the features stored locally. After the calculation is complete, the aggregated partial sum is sent to processing unit B1. Processing unit B1 reads its local aggregation buffer and adds it to the node aggregation features sent by processing unit B2. Processing unit B1 performs similar operations. The third stage tensor computation task and feature aggregation computation task are as follows: Figure 7E As shown, similar to the second stage, each processing unit continues to slide its calculation window. Processing unit B3 sends the aggregated result to processing unit B1, processing unit B2 sends its calculation result to processing unit B3, and processing unit B1 sends its result to processing unit B2. At this point, all processing units have traversed the entire adjacency matrix, completing the graph aggregation operation. The aggregation buffer in each processing unit stores the aggregated node features.

[0152] As mentioned above, tensor computation specifically involves multiplying the feature data of graph nodes by a weight matrix. The tensor computation task can be divided into multiple time-phased tasks based on the columns of the weight matrix. Each time-phase task specifically involves multiplying the feature data of graph nodes by a column of the weight matrix corresponding to that time phase.

[0153] In one example, such as Figure 8 As shown, the weight matrix W used for tensor computation has N columns, where N is an integer greater than 1. The tensor computation task can be divided into tensor computation tasks executed in N time stages, namely, tensor computation tasks in stages P(1), P(2), ..., P(N). Each time stage corresponds to one column in the weight matrix W.

[0154] As mentioned above, the tensor computation results generated by each stage of the tensor computation task need to be transmitted and aggregated (i.e., feature aggregation of graph nodes). Therefore, each stage of the tensor computation task corresponds to a stage of tensor computation result transmission and aggregation task. The tensor result transmission and aggregation task includes transmitting the tensor computation results generated by the corresponding tensor computation task, and aggregating the tensor computation results generated by the corresponding tensor computation task.

[0155] In this process, during a tensor computation task, the calculated tensor result can be input into one of the output data buffer and the adjacent data buffer. The other of the output data buffer and the adjacent data buffer stores the tensor computation task from the previous stage, which can be used for data reuse, thus eliminating the need to write the tensor computation result to off-chip memory. The data reuse operation includes: performing feature aggregation calculations on graph nodes using the tensor computation results that meet the data requirements of the feature aggregation stage; after each tensor computation stage P(x) is completed, its corresponding P'(x) aggregation message passing and calculation are required. The condition for P'(x) to be completed is that all processing units have completed message passing for the entire graph or all processing units have traversed and calculated the complete tensor relationship graph. Here, P(x) is... Figure 8 For any one of P(1), P(2), ..., P(N) shown, correspondingly, P'(x) Figure 8 Any one of P'(1), P'(2), ..., P'(N) shown, and corresponding to P(x).

[0156] In a specific example, consider the adjacency matrix A, tensor X, and weight matrix W of the relational graph to be processed (i.e., the input relational graph). Here, the tensor is the feature matrix of the graph nodes. Assuming there are K processing units, the entire tensor computation task divides the tensor X into K tensor computation tasks (i.e., graph nodes are divided into K parts) and assigns them to each processing unit. The weight matrix W is shared among the processing units. Each processing unit's assigned tensor computation task is divided into N independent subtasks, meaning each subtask is executed over N time stages. Each subtask outputs M columns of Z (=XW), where M depends on the size of the processing unit's buffer (e.g., the output data buffer). The router reads the adjacency matrix A and decodes the source and destination index numbers into the source processing unit number and the destination processing unit number, respectively.

[0157] After completing the graph node allocation and tensor computation task division, step 602a can be executed. Each processing unit performs the tensor computation task in stage P(1). The tensor computation task in stage P(1) includes performing tensor operations on the feature data of the graph nodes allocated to the processing unit to obtain the tensor computation results of the graph nodes in stage P(1). Stage P(1) is the first stage.

[0158] While the processing unit executes step 602a, the router can execute step 602b, calculating routing information based on the adjacency matrix A. When the processing unit in the computing device 100 adopts an orthogonal topology, step 602b performs conflict-free route calculation based on the orthogonal topology. The routing information can be recorded in a routing table. The specific implementation process of step 602b will be described below and will not be repeated here.

[0159] The processing unit can be configured to output the tensor calculation results of stage P(1) to the output data buffer after completing the tensor calculation task. The output data buffer is filled when the tensor calculation task of stage P(1) ends. The output data buffer can be used for data reuse; for example, the tensor calculation results of graph nodes in the output data buffer can be sent to the processing unit containing graph nodes whose neighbors are those nodes. Since the neighbor data buffer has no data stored, it is in an empty state. Therefore, as... Figure 5 As shown, when the tensor computation task in stage P(1) ends, the processing unit can then use the neighbor buffer to execute the tensor computation task in stage P(2), that is, the tensor computation result generated by the tensor computation task in stage P(2) is output to the neighbor data buffer.

[0160] Specifically, see Figure 6 After step 602a is completed, the processing unit can execute step 603 to start the transmission task in the tensor calculation result transmission and aggregation task of the P'(n) stage. That is, the processing unit where the graph node is located sends the tensor calculation result of the graph node in the P(n) stage to the processing unit where the graph node is located, which is the neighbor node of the graph node.

[0161] The processing unit can execute step 604 to determine whether it has received the tensor computation result from a neighboring node, where the neighboring node is the neighboring node of the graph node in the processing unit. Here, the tensor computation result refers to the tensor computation result in stage P(n).

[0162] If the tensor computation result of a neighboring node is received in step 604, the processing unit can execute step 605a to perform a feature aggregation operation. If a tensor computation task in phase P(n+1) is currently being executed, the processing unit interrupts the ongoing tensor computation task in phase P(n+1) and then executes step 605a. For example, the feature aggregation operation can refer to adding the features (i.e., tensor computation results) of the neighboring nodes of a graph node to the features of the graph node itself. The feature aggregation operation can also be described above and will not be repeated here.

[0163] After step 605a, if the tensor computation task in phase P(n+1) has not been completed, the tensor computation task in phase P(n+1) can continue to be executed.

[0164] If no tensor calculation result is received from a neighboring node in step 604, the processing unit executes step 605b to perform the tensor calculation task in phase P(n+1).

[0165] The processing unit can also execute step 607 to determine that the tensor calculation result transmission and aggregation task in stage P'(n) and the tensor calculation task in stage P(n+1) have both ended.

[0166] If either the tensor computation result transmission and aggregation task in stage P'(n) or the tensor computation task in stage P(n+1) has not ended, or if either the tensor computation result transmission and aggregation task in stage P'(n) or the tensor computation task in stage P(n+1) has not ended, then proceed to step 604 and the subsequent steps of step 604.

[0167] If the tensor computation result transmission and aggregation tasks in stage P'(n) and the tensor computation tasks in stage P(n+1) are both completed, then step 608 can be executed to output the feature aggregation results of the graph nodes, for example, by writing them to off-chip memory. Then, step 609 can be executed to determine if n equals N. If n equals N, it indicates that the tensor computation tasks in all N stages and the tensor data transmission tasks in all N stages have been completed, and the process can end. If n is not equal to N, i.e., n is less than N, then n = n+1 is set, and step 603 and subsequent steps are executed again.

[0168] Thus, through Figure 6 The proposed solution enables graph operations without memory access, thus improving the efficiency of graph processing.

[0169] Next, we will introduce the message-passing-based routing strategy in detail.

[0170] by Figure 3 The strictly orthogonal four-dimensional hypercube network shown serves as the interconnection medium between processing units. It can be configured with a total of 16 processing units, each connected to four other processing units, and capable of simultaneous bidirectional transmission. The specific network topology is as follows: Figure 9 As shown. The necessary and sufficient condition for network topology orthogonality is that processing units can be in an orthogonal network n (where n is perpendicular to n). Figure 6 Organized in an n-dimensional space (independent of each other), the arrangement of each link requires an offset in one dimension. For example, Figure 10The binary code of processing unit 0 (0000) and its interconnected processing units 1 (0001), 2 (0010), 4 (0100), and 8 (1000) differ by only one bit in their binary codes (other computational cores also satisfy the same characteristic). The advantage of strictly orthogonal topology is its simple routing, allowing for efficient routing algorithms to be implemented in hardware. In a four-dimensional hypercube network, the coordinates of the processing units in four-dimensional space can be used as their numbers. Since each link traverses one dimension, and each processing unit has at least one link in each dimension, the distance between two processing units can be calculated by summing the offsets in each dimension. Each processing unit is connected by n-dimensional binary coordinates (x...). n-1 ,x n-2 The necessary and sufficient condition for two processing units to be adjacent is defined as follows: there exists j such that y j =x j ±1, and for any i ≠ j and 0 ≤ i ≤ n-1, we have y i =x i A four-dimensional hypercube network can be abstracted as an equivalent multi-level interconnected network (MIN), such as... Figure 10 As shown, the processing unit has 16 inputs and 16 outputs, and consists of four levels. Each level has 16 line switching modules. The line switching modules can be equivalent to, for example,... Figure 4 The switch shown is similar to a cross switch. As long as the input or output port that issued the request is idle, a new connection can be established at any time. The binary bits of its corresponding dimension change by one bit each time it passes through a level.

[0171] Next, we will introduce the specific methods for calculating routing information.

[0172] This application provides an efficient parallel neighbor routing algorithm that enables deadlock-free transmission between processing units with high interconnection utilization. After the single-cycle combination phase calculation is completed within the processing unit, this data can be stored in the output data buffer or neighbor buffer within the processing unit. This data serves as the source data for each processing unit to transmit neighbors. The communication is characterized by low bit width per data unit but high communication frequency. To ensure communication bandwidth, reducing the length of the message header is crucial. Similarly, due to the high transmission frequency requirement, the network should avoid deadlock-related transmissions that could cause link congestion and affect neighbor transmission efficiency. Therefore, a street-marker routing strategy can be adopted. The message header is similar to providing a set of directions for the data. It only needs to provide the target processing unit number and the corresponding turning direction for the data flow at the next moment. The data flow only needs to compare the local processing unit number with the node address in the message to either turn or reach its destination. The node message address for each cycle is calculated by the street-marker router within the processing unit based on the edge table, and this routing path must be deadlock-free.

[0173] The edge indices in the graph data are read in, and the neighboring nodes of a graph node can be obtained through the edge index. The calculation of the routing table involves three steps: mapping the row indices of the adjacency matrix from routers to destination processing unit numbers, and mapping the column indices from routers to source processing unit numbers. Therefore, the adjacency matrix is ​​transformed into the following... Figure 11 The source processing unit encoding and destination processing unit encoding matrices are shown, where Figure 11 In this context, N represents no neighbors. For example, in the first column, the neighbors of some graph nodes in processing unit 0 are located in the buffers corresponding to processing units 2, 3, 13, and 15. This data needs to be sent to the target processing unit, i.e., processing unit 0. Therefore, the row order of each column (the order in which the node neighbors arrive) can be changed.

[0174] The three steps for calculating the routing table are as follows.

[0175] Step 1: Find a conflict-free starting processing unit. This requires that the processing unit does not have multiple graph node feature data transmission requests within the same unit at the beginning. First, it searches for duplicate element indices in row elements and records their column numbers. Then, it sends exchange requests to subsequent rows and performs element matching. A successful match is achieved if the row element being exchanged does not appear repeatedly in the current row, and the row element exchanged to another row does not appear repeatedly in other rows. If no row matches, an empty period is added by default, and the element is exchanged with the column corresponding to the empty period.

[0176] Step 2: Calculate the route set for each processing unit. Based on the elements of each starting row and the elements of the target row in Step 1, calculate the next path set for each processing unit through an XOR operation (the set of binary coordinates of the processing unit where the target graph node is located differs by 1 bit, until the difference is 1 bit).

[0177] Step 3: Group and populate, and then delete from the collections, such as... Figure 12 As shown. The purpose of grouping is to improve the bandwidth utilization of the interconnection network, allowing multiple routing tables to be sent in parallel without collisions in each transmission cycle. We can assume that each processing unit has at least four transmission registers and only one interconnection line with other processing units (both bidirectional and unidirectional). This means it can simultaneously receive data from four interconnections and simultaneously send data to four interconnections. This requires that the four simultaneously arriving data cannot originate from duplicate nodes, and that after these data arrive, two or more data cannot be sent to the same processing unit simultaneously. If these rules are violated, collisions and contention will inevitably occur in each transmission cycle. Therefore, it is necessary to select suitable intermediate processing units from the set of next-step paths for the characteristic data transmission of each graph node. Routing tables intended for parallel transmission can be merged into a group (assuming routing table D0 and routing table D1). The next step of the routing table is then populated sequentially in descending order of the offset (step size) between the source and destination processing units. An intermediate processing unit for data forwarding is randomly selected from this group, and the single-step path sets of all processing units are refreshed. The refresh rule is that if the processing unit number is in routing table D0, then any other routing sets in routing table D0 containing that intermediate processing unit number are deleted. For other routing table numbers, the deletion condition is that the intermediate processing unit number exists and its previous processing unit number is the same as the previous node in routing table D0. In this way, although the processing unit may appear in other routing tables within the same group, they originate from different senders. The path refresh operation during routing table filling removes conflicting intermediate processing units, preventing conflicts at their receivers (e.g., ...). Figure 12 Routing tables in different groups may not match.

[0178] like Figure 12 As shown, the routing tables can be configured as D0, D1, D2, D3, and D4. The periods can be E1, E2, E3, and E4. The groups can be F0 and F1.

[0179] If the path set of the processing unit is empty during the filling process, the following situations may occur: (1) The step size of the processing unit from the target processing unit is 0; (2) The processing node is about to complete the transmission, and the step size from the target node is 1; (3) The data of the processing unit has not yet reached the target processing unit, and the intermediate path is occupied by other processing units. Figure 13 As shown, if an empty set appears, an × mark is made on the routing table. This symbol means that the virtual channel corresponding to the target processing unit is inserted. For example, if the first period is × and the second period is K, the data will be inserted into the virtual channel to K in the first period. The reason is that the channel may be occupied by other higher priority processing units in this period, and the channel will be idle in the next or future period. After the second sending period, the virtual channel will send the data to the K processing unit through this path. The routing table calculation is completed when the distance step between the current node pointer and the target node of all nodes is 1.

[0180] The characteristic of being in the same group is that data from these processing units can be sent and received in parallel without collisions in each cycle. This greatly improves the transmission efficiency of neighboring processing units and allows more data to be transmitted without increasing the interconnect bit width (i.e., bandwidth), maximizing the effective bandwidth of the interconnect network in each cycle (average bandwidth utilization of 80% in each cycle when transmitting data from 64 nodes (4 routing tables) simultaneously). This data can reach the target processing unit in the same cycle. Furthermore, the number of groups can be flexibly adjusted based on the number of non-zero elements in each row. For example, during the aggregation process, most graph nodes have already been aggregated, leaving only a few graph nodes with a large number of neighbors. In this case, most of the data in the initial row is N (where N is related to...). Figure 6 (The N in the table is irrelevant). They may come from the same processing unit or different processing units, but the target processing unit number is the same. In this case, the number of groups can be increased so that these processing units can complete the sending and receiving of neighbors on different paths, which can reduce the impact of the power-law distribution of the number of node neighbors on transmission efficiency.

[0181] In summary, the graph processing scheme provided in this application eliminates random memory accesses during graph operations, thereby improving the processing efficiency of graphs and eliminating the need for a dedicated hardware module for aggregation operations, thus reducing hardware costs.

[0182] Specifically, such as Figure 14As shown, this application embodiment provides a graph processing scheme that utilizes a single hardware module to enable parallel execution of tensor operations and graph aggregation operations. Specifically, the inputs can be a tensor X (i.e., the graph node feature matrix), a weight matrix W, and an adjacency matrix A. The router reads the adjacency matrix A to perform route calculation. While the computation kernel (i.e., the processing unit) executes the tensor operation XW, it also performs message passing on a portion of the calculation results of XW. When the message arrives, the tensor operation is converted into a graph aggregation calculation. The calculation results of a portion of AXW are output.

[0183] like Figure 15 As shown, the execution of the tensor computation task (i.e., the combinatorial computation task) and the tensor computation result transmission process in the aggregation memory access (tensor computation result transmission and aggregation task) can be executed in parallel, thus eliminating the process of accessing memory to obtain tensor computation results during aggregation computation and improving the efficiency of relational graph processing.

[0184] In other words, the solution improved in this application embodiment achieves low-cost expansion of existing processing units without increasing computing resources, enabling them to efficiently execute memory-intensive graph operation tasks, converting random memory access into message passing between registers of each AI computing core, making full use of existing processing units, and achieving high data reuse and high resource utilization.

[0185] In some embodiments, the computation time for tensor computation and graph operations can be expressed as:

[0186] t total =MAX(t) 张量计算 +t 图聚合计算 , t 图通信 )

[0187] like Figure 16 As shown, experiments demonstrate that in single-stage tensor computation and graph aggregation computation, the scheme provided in this application embodiment can fully utilize computational resources, enabling tensor operations and graph operations to be efficiently parallelized, satisfying the following:

[0188] t(P(n) tensor computation) ≥ t(P(n-1) graph communication)

[0189] At this time, the data transmission time of graph operations can be basically covered by the tensor computation stage. Therefore, the solution provided in this application embodiment can realize the parallel execution of computation and memory access, while improving the efficiency of existing processing units in performing graph operations.

[0190] in, Figure 16 In the diagram, FK, RD, YP, and AM represent different relationship diagrams.

[0191] It should be noted that the memory access in this embodiment does not refer to actual memory access, but rather to the transfer of tensor computation results between processing units. In other words, in this embodiment, the transfer of tensor computation between processing units replaces the memory access used in the prior art to obtain tensor computation results.

[0192] In summary, in one possible implementation of the graph processing scheme provided in this application, from a computational perspective, a fusion computational scheme for tensor operations and graph operations in GNN computation is proposed. From a computational form perspective, random memory access in graph operations is converted into message passing between registers within each AI computing core. Specifically, a centralized router outside the AI ​​computing core uses a routing algorithm to convert the graph's connectivity into non-blocking message passing information between the AI ​​computing cores, enabling tensor operations within the AI ​​computing core and message passing operations outside the computing core to be performed synchronously during execution.

[0193] From a computing device perspective, based on the strictly orthogonal topology (butterfly, cubic, Omega) of existing AI tensor computing cores (Ascend AI Core, TPU pulsating array, etc.), the router sends single-step routing information to each AI computing core during the fusion computation of tensor-graph operations to complete the data dependencies between the AI ​​computing cores. This achieves low-cost, high-efficiency parallel execution of tensor-graph operations without increasing the number of additional computing resources (DSPs) in the entire device.

[0194] Table 2 shows the performance comparison of GNN computation on the experimental platform VCU128 FPGA, P100 GPU (PyG framework), and Intel Xeon Platinum8260 CPU (PyG framework). As can be seen from Table 2, the solution provided in this application improves the computational graph operation capabilities of traditional AI computing cores (Ascend AI Core, TPU systolic array, GPU CudaCore, etc.) in terms of computational performance.

[0195] Table 2

[0196]

[0197] Next, in terms of hardware deployment, the performance of the 4-dimensional (4-D) hypercube topology in the solution provided in this application embodiment will be compared with that of other mainstream non-orthogonal topology (Cross-Bar, 2-D Tours) interconnection networks.

[0198] Table 3 shows a comparison of FPGA placement and routing resource usage.

[0199] Table 3

[0200]

[0201] Figure 17A , Figure 17B , Figure 17C The FPGA chip routing logic layouts for 4-D Hypercube, Cross-Bar, and 2-D Tours are shown in sequence.

[0202] in, Figure 17A The diagram shows the FPGA chip routing logic layout with a Cross-Bar topology, where the AI ​​computing core (i.e., processing unit) uses CrossBar as the interconnect, with each interconnect line being 32 bytes wide.

[0203] Figure 17B The diagram shows the FPGA chip routing logic layout with a 2-D Tours topology, where the AI ​​computing core uses 2-D Tours as interconnects, with each interconnect line being 32 bytes wide.

[0204] Figure 17C The diagram shows the wiring logic layout of an FPGA chip with a 4-D hypercube topology, in which the AI ​​computing core uses 4-D hypercubes as interconnects, with each interconnect line having a bit width of 32 bytes.

[0205] By comparison, Cross-Bar consumes the most resources for placement and routing of each AI computing core, followed by 2-D Tours and 4-D Hypercube. In terms of successfully placed resources, Cross-Bar's LUT usage is 1.47 times that of the latter (×), and its FF usage is 1.1 times that of the latter. Its power consumption and placement / routing time are also higher. As the number of AI computing cores increases, routing failures occur, as shown in Table 3 (Conflict Net). Approximately 27% of the logic cells in AI computing cores using Cross-Bar interconnects fail to be routed. Therefore, from a resource consumption perspective, 2-D Tours and orthogonal topologies are relatively superior.

[0206] Regarding routing computation overhead, Cross-Bar eliminates the need for routing calculations because it uses a direct connection between AI computing cores. However, the long cabling leads to severe timing issues, making high-frequency transmission difficult compared to 2-D Tours and 4-D Hypercubes. In 2-D Tours and 4-D Hypercubes, the overhead primarily lies in calculating single-step routes. Since 4-D Hypercubes uses an orthogonal topology, calculating a single-step route requires only one XOR gate, while 2-D Tours requires addition and subtraction to determine surrounding computing nodes. Therefore, 4-D Hypercubes requires lower logic resources in terms of computation speed and resource consumption, making the orthogonal topology a relatively better choice.

[0207] Based on the relationship graph processing scheme described above, this application provides a relationship graph processing method. It is understood that this method is another expression of the relationship graph processing scheme described above; the two are combined. Some or all of the content of this method can be found in the above description of the relationship graph processing scheme.

[0208] This method can be applied to a computing device comprising multiple processing units, such as computing device 100. Each of the multiple processing units is assigned graph nodes in a relational graph, and the graph nodes assigned to different processing units are different. Figure 18 As shown, the method includes the following steps.

[0209] Step 1801: The processing unit executes a first-stage tensor computation task. This first-stage task includes performing a first tensor operation on the feature data of the graph nodes allocated to the processing unit to obtain the first tensor computation result of the graph nodes. For example, refer to the above description... Figure 5 Middle P(1) stage or Figure 6 The implementation of step 602a will not be described in detail here.

[0210] Step 1802: After completing the first stage of tensor computation, the processing unit sends the first tensor computation result of the graph node obtained by the processing unit in the first stage of tensor computation to the processing unit where the graph node with that graph node as a neighbor is located, and begins to execute the second stage of tensor computation. For example, refer to the above description... Figure 5 Middle P'(1) stage or Figure 6 The implementation of step 603 is described below.

[0211] Step 1803: When the first processing unit, which is assigned a first graph node, receives the first tensor calculation result of the second graph node sent by the second processing unit, which is assigned a second graph node, the first processing unit interrupts the tensor calculation task of the second stage and performs a feature aggregation operation on the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node to obtain the first aggregation result of the first graph node; wherein, the second graph node is a neighbor node of the first graph node in the relation graph. For example, refer to the above description... Figure 5 The implementation of the P(1) and P'(1) phases is described above, or refer to the above text. Figure 6 The implementation of steps 604 and 605a is described below.

[0212] Step 1804: When the feature aggregation operation of the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node is completed, the first processing unit continues to execute the tensor calculation task of the second stage. For example, refer to the above description... Figure 5 The implementation of the P(1) and P'(1) phases is described above, or refer to the above text. Figure 6 The implementation of steps 604 and 605b is described below.

[0213] In some embodiments, the processing unit includes a calculation module, a buffer, and a communication module. The step of performing a first tensor operation on the feature data of the graph nodes allocated to the processing unit to obtain a first tensor calculation result for the graph nodes includes: the calculation module of the processing unit performs a first tensor operation on the feature data of the graph nodes allocated to the processing unit and outputs the obtained first tensor calculation result of the graph nodes to the buffer of the processing unit. The step of sending the first tensor calculation result of the graph nodes obtained by the processing unit in performing the first stage of tensor calculation tasks to the processing unit where the graph node with that graph node as a neighbor node is located includes: the communication module of the processing unit sends the first tensor calculation result of the graph nodes in the buffer of the processing unit to the processing unit where the graph node with that graph node as a neighbor node is located. The step of performing a feature aggregation operation on the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node includes: the calculation module of the first processing unit receives the first tensor calculation result of the second graph node through the communication module of the first processing unit, and obtains the first tensor calculation result of the first graph node from the buffer of the first processing unit, and performs a feature aggregation operation on the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node. For details, please refer to the above text. Figure 4 The implementation is described in the example shown.

[0214] In one example of this embodiment, before the processing unit executes the first stage of tensor computation tasks, the method further includes: dividing the tensor operations to be performed by the processing unit into N stages of tensor computation tasks, wherein the N stages of tensor computation tasks are executed sequentially by the processing unit, the data size of the output result of each stage of tensor computation tasks is consistent with the space size of the buffer of the processing unit, and N is an integer greater than 1. (Refer to the above...) Figure 6 The implementation of step 601 is described below.

[0215] In one example of this example, the tensor operation to be performed by the processing unit includes: updating the feature data of the graph nodes assigned to the processing unit using a weight matrix with M columns; M is an integer greater than 1; dividing the tensor operation to be performed by the processing unit into N stages of tensor computation tasks includes: dividing the weight matrix into N sub-matrices with L columns, wherein the N stages of tensor computation tasks correspond one-to-one with the N sub-matrices, and M×L=N; performing the first tensor operation on the feature data of the graph nodes assigned to the processing unit includes: updating the feature data of the graph nodes assigned to the processing unit using the sub-matrix corresponding to the first stage of tensor computation tasks to obtain the first tensor computation result of the graph nodes. (Refer to the above for further details.) Figure 8 The implementation of the illustrated embodiment is described below.

[0216] In some embodiments, the second processing unit further allocates a third graph node in the relational graph, the third graph node being a neighbor node of the first graph node in the relational graph; sending the first tensor calculation result of the graph node obtained by the processing unit in performing the tensor calculation task of the first stage to the processing unit where the graph node with the graph node as a neighbor node is located includes: the second processing unit performs feature aggregation operation on the first tensor calculation result of the second graph node and the first tensor calculation result of the third graph node to obtain a pre-aggregated result of the second graph node and the third graph node; the second processing unit sends the pre-aggregated result to the first processing unit; the feature aggregation operation of the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node includes: performing feature aggregation operation on the first tensor calculation result of the first graph node and the pre-aggregated result to obtain a first aggregated result of the first graph node.

[0217] In some embodiments, sending the first tensor computation result of the graph node obtained by the processing unit performing the tensor computation task of the first stage to the processing unit where the graph node with that graph node as a neighbor node is located includes:

[0218] The second processing unit confirms that the first tensor calculation result of the second graph node is the only information sent by the second processing unit to the first processing unit at the first moment;

[0219] At the first moment, the second processing unit sends the first tensor calculation result of the second graph node to the first processing unit.

[0220] In one example of this embodiment, each of the plurality of processing units has P neighboring units, wherein each processing unit's neighboring units are the processing units among the plurality of processing units, and each processing unit and its neighboring units have a data path, where P is an integer greater than 1; when the first processing unit is a neighboring unit of the second processing unit, the second processing unit sending the first tensor calculation result of the second graph node to the first processing unit includes: the second processing unit sending the first tensor calculation result of the second graph node to the first processing unit through the data path between the first processing unit and the second processing unit.

[0221] In one example of this example, the computing device further includes a router; when the first processing unit is not a neighboring unit of the second processing unit, the second processing unit sending the first tensor calculation result of the second graph node to the first processing unit includes: the second processing unit receiving a forwarding unit instruction from the router; the second processing unit sending the first tensor calculation result of the second graph node to the processing unit indicated by the forwarding unit instruction, so as to send the first tensor calculation result of the second graph node to the first processing unit through the processing unit indicated by the forwarding unit instruction.

[0222] In one example of this example, the forwarding unit indication is generated by the router based on a routing table, wherein a next-hop processing unit of the forwarding unit corresponds to at most a previous-hop processing unit of the forwarding unit.

[0223] In one example of this example, the method further includes: the router calculating the shortest path from each source processing unit to each destination processing unit and the set of single-step paths corresponding to the shortest paths, obtaining multiple shortest paths and the set of single-step paths corresponding to each of the multiple shortest paths, wherein the source processing unit and the destination processing unit are different processing units among the multiple processing units, and the source processing unit is the transmission start point of the tensor calculation result, and the destination processing unit is the transmission end point of the tensor calculation result; the router, according to the path length of the multiple shortest paths in ascending order, and according to the principle that a next-hop processing unit of a forwarding unit corresponds to at most a previous-hop processing unit of the forwarding unit, sequentially selects single-step paths to form the shortest paths from the multiple single-step path sets to obtain the routing table.

[0224] The graph processing method provided in this application allows the processing unit to obtain the tensor calculation results of the neighboring nodes of a graph node without memory access. This enables feature aggregation operations on the tensor calculation results of the graph node and the tensor calculation results of the graph nodes whose neighbors are that node. In other words, this solution implements graph operations in graph processing without memory access, avoiding the low processing efficiency caused by random memory access in graph processing.

[0225] This application also provides a computing device 1900. For example... Figure 19 As shown, the computing device 1900 includes multiple processing units such as processing unit 1910 and processing unit 1920. These multiple processing units are assigned graph nodes in a relational diagram, and the graph nodes assigned to different processing units are different.

[0226] The processing unit is used to perform a first-stage tensor computation task, which includes performing a first tensor operation on the feature data of the graph nodes allocated to the processing unit to obtain the first tensor computation result of the graph nodes.

[0227] The processing unit is used to send the first tensor calculation result of the graph node obtained by the processing unit in executing the first stage tensor calculation task to the processing unit where the graph node with the graph node as its neighbor node is located after the first stage tensor calculation task is completed, and start executing the second stage tensor calculation task.

[0228] When the processing unit 1910, which is assigned a first graph node, receives the first tensor calculation result of the second graph node sent by the processing unit 1920, which is assigned a second graph node, the processing unit 1910 interrupts the tensor calculation task of the second stage and performs a feature aggregation operation on the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node to obtain the first aggregation result of the first graph node; wherein, the second graph node is a neighbor node of the first graph node in the relation graph;

[0229] When the feature aggregation operation of the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node is completed, the processing unit 1910 is used to continue to execute the tensor calculation task of the second stage.

[0230] The functions of each processing unit in the computing device 1900 can be implemented with reference to the descriptions of the embodiments above, for example... Figure 18 The method implementation shown is illustrated in the example.

[0231] This application also provides a computing system 2000. For example... Figure 20As shown, the computing system 2000 includes: a memory 2010 for storing feature data of graph nodes in a relational graph, and a computing device 1900.

[0232] This application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any usable medium. When the computer program product runs on a computing device, it causes at least one computing device to execute... Figure 18 The method shown.

[0233] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a host migration device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute... Figure 18 The method shown.

[0234] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for processing relationship diagrams, characterized in that, A method applicable to a computing device comprising multiple processing units, each of the multiple processing units being assigned graph nodes in a relational graph, wherein different processing units are assigned different graph nodes; the method includes: The processing unit performs a first-stage tensor computation task, which includes performing a first tensor operation on the feature data of the graph nodes allocated to the processing unit to obtain the first tensor computation result of the graph nodes. After the processing unit finishes the tensor computation task of the first stage, it sends the first tensor computation result of the graph node obtained by the processing unit in the first stage tensor computation task to the processing unit where the graph node with the graph node as its neighbor is located, and starts to execute the tensor computation task of the second stage. When the first processing unit, which is assigned a first graph node, receives the first tensor calculation result of the second graph node sent by the second processing unit, which is assigned a second graph node, the first processing unit interrupts the tensor calculation task of the second stage and performs a feature aggregation operation on the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node to obtain the first aggregation result of the first graph node; wherein, the second graph node is a neighbor node of the first graph node in the relation graph. When the feature aggregation operation of the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node is completed, the first processing unit continues to execute the tensor calculation task of the second stage.

2. The method according to claim 1, characterized in that, The processing unit includes a computing module, a buffer, and a communication module, wherein... The step of performing a first tensor operation on the feature data of the graph nodes allocated to the processing unit to obtain the first tensor calculation result of the graph nodes includes: the calculation module of the processing unit performs a first tensor operation on the feature data of the graph nodes allocated to the processing unit, and outputs the obtained first tensor calculation result of the graph nodes to the buffer of the processing unit. The step of sending the first tensor calculation result of the graph node obtained by the processing unit in performing the tensor calculation task of the first stage to the processing unit where the graph node with the graph node as a neighbor node is located includes: the communication module of the processing unit sending the first tensor calculation result of the graph node in the buffer of the processing unit to the processing unit where the graph node with the graph node as a neighbor node is located. The feature aggregation operation of executing the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node includes: the calculation module of the first processing unit receives the first tensor calculation result of the second graph node through the communication module of the first processing unit, and obtains the first tensor calculation result of the first graph node from the buffer of the first processing unit, and performs feature aggregation operation on the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node.

3. The method according to claim 2, characterized in that, Before the processing unit performs the first-stage tensor computation task, the method further includes: The tensor operations to be performed by the processing unit are divided into N stages of tensor computation tasks. The N stages of tensor computation tasks are executed sequentially by the processing unit. The data size of the output result of each stage of tensor computation task is the same as the space size of the buffer of the processing unit, and N is an integer greater than 1.

4. The method according to claim 3, characterized in that, The tensor operations to be performed by the processing unit include: using a weight matrix with M columns to update the feature data of the graph nodes assigned to the processing unit; where M is an integer greater than 1. The tensor computation task of dividing the tensor operation to be performed by the processing unit into N stages includes: dividing the weight matrix into N sub-matrices with L columns, wherein the N stages of tensor computation tasks correspond one-to-one with the N sub-matrices, and M×L=N; The first tensor operation on the feature data of the graph nodes allocated to the processing unit includes: using the submatrix corresponding to the tensor computation task of the first stage to update the features of the feature data of the graph nodes allocated to the processing unit, so as to obtain the first tensor computation result of the graph nodes.

5. The method according to claim 1, characterized in that, The second processing unit is also allocated a third graph node in the relation graph, wherein the third graph node is a neighbor node of the first graph node in the relation graph; The step of sending the first tensor calculation result of the graph node obtained by the processing unit in performing the first stage tensor calculation task to the processing unit where the graph node with that graph node as a neighbor node is located includes: The second processing unit performs feature aggregation operations on the first tensor calculation results of the second graph node and the first tensor calculation results of the third graph node to obtain the pre-aggregation results of the second graph node and the third graph node; The second processing unit sends the pre-aggregation result to the first processing unit; The feature aggregation operation of executing the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node includes: performing feature aggregation operation on the first tensor calculation result of the first graph node and the pre-aggregation result to obtain the first aggregation result of the first graph node.

6. The method according to claim 1, characterized in that, The step of sending the first tensor calculation result of the graph node obtained by the processing unit in performing the first stage tensor calculation task to the processing unit where the graph node with that graph node as a neighbor node is located includes: The second processing unit confirms that the first tensor calculation result of the second graph node is the only information sent by the second processing unit to the first processing unit at the first moment; At the first moment, the second processing unit sends the first tensor calculation result of the second graph node to the first processing unit.

7. The method according to claim 6, characterized in that, Each of the plurality of processing units has P neighboring units, wherein each processing unit's neighboring units are the processing units among the plurality of processing units, and each processing unit and its neighboring units have a data path, where P is an integer greater than 1. When the first processing unit is a neighboring unit of the second processing unit, the second processing unit sending the first tensor calculation result of the second graph node to the first processing unit includes: the second processing unit sending the first tensor calculation result of the second graph node to the first processing unit through the data path between the first processing unit and the second processing unit.

8. The method according to claim 7, characterized in that, The computing device further includes a router; when the first processing unit is not a neighboring unit of the second processing unit, the second processing unit sends the first tensor calculation result of the second graph node to the first processing unit, including: The second processing unit receives an instruction from the forwarding unit from the router; The second processing unit instructs the forwarding unit to send the first tensor calculation result of the second graph node to the indicated processing unit, so that the forwarding unit instructs the indicated processing unit to send the first tensor calculation result of the second graph node to the first processing unit.

9. The method according to claim 8, characterized in that, The forwarding unit indication is generated by the router based on the routing table, wherein in the routing table, a next-hop processing unit of the forwarding unit corresponds to at most a previous-hop processing unit of the forwarding unit.

10. The method according to claim 9, characterized in that, The method further includes: The router calculates the shortest path from each source processing unit to each destination processing unit and the set of single-step paths corresponding to the shortest path, thus obtaining multiple shortest paths and the set of single-step paths corresponding to each shortest path. The source processing unit and the destination processing unit are different processing units among the multiple processing units, and the source processing unit is the transmission starting point of the tensor calculation result, and the destination processing unit is the transmission endpoint of the tensor calculation result. The router selects single-step paths from the multiple single-step path sets in ascending order of path length of the multiple shortest paths, and follows the principle that a next-hop processing unit of a forwarding unit corresponds to at most a previous-hop processing unit of the forwarding unit, to obtain the routing table.

11. A computing device, characterized in that, It includes multiple processing units, wherein the multiple processing units are assigned graph nodes in a relational graph, and different processing units are assigned different graph nodes; The processing unit is used to perform a first-stage tensor computation task, which includes performing a first tensor operation on the feature data of the graph nodes allocated to the processing unit to obtain the first tensor computation result of the graph nodes. The processing unit is used to send the first tensor calculation result of the graph node obtained by the processing unit in executing the first stage tensor calculation task to the processing unit where the graph node with the graph node as its neighbor node is located after the first stage tensor calculation task is completed, and start executing the second stage tensor calculation task. When the first processing unit, which is assigned a first graph node, receives the first tensor calculation result of the second graph node sent by the second processing unit, which is assigned a second graph node, the first processing unit is used to interrupt the tensor calculation task of the second stage and perform feature aggregation operation on the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node to obtain the first aggregation result of the first graph node; wherein, the second graph node is a neighbor node of the first graph node in the relation graph. When the feature aggregation operation of the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node is completed, the first processing unit is used to continue to execute the tensor calculation task of the second stage.

12. The apparatus according to claim 11, characterized in that, The processing unit includes a computing module, a buffer, and a communication module, wherein... The computation module of the processing unit is used to perform a first tensor operation on the feature data of the graph nodes allocated to the processing unit, and output the first tensor computation result of the graph nodes to the buffer of the processing unit. The communication module of the processing unit is used to send the first tensor calculation result of the graph node in the buffer of the processing unit to the processing unit where the graph node with the graph node as its neighbor is located. The calculation module of the first processing unit is used to receive the first tensor calculation result of the second graph node through the communication module of the first processing unit, and to obtain the first tensor calculation result of the first graph node from the buffer of the first processing unit, and to perform feature aggregation operation on the first tensor calculation result of the first graph node and the first tensor calculation result of the second graph node.

13. The apparatus according to claim 12, characterized in that, The device further includes a partitioning unit; the partitioning unit is used to divide the tensor operations to be performed by the processing unit into N stages of tensor computation tasks, wherein the N stages of tensor computation tasks are executed sequentially by the processing unit, and the data size of the output result of each stage of tensor computation task is consistent with the space size of the buffer of the processing unit, and N is an integer greater than 1.

14. The apparatus according to claim 13, characterized in that, The processing unit is used to update the feature data of the graph nodes assigned to the processing unit using a weight matrix with M columns; M is an integer greater than 1. The partitioning unit is used to divide the weight matrix into N sub-matrices with L columns, wherein the N stages of tensor computation tasks correspond one-to-one with the N sub-matrices, and M×L=N; The processing unit is used to update the feature data of the graph nodes allocated to the processing unit using the sub-matrix corresponding to the tensor computation task of the first stage, so as to obtain the first tensor computation result of the graph nodes.

15. The apparatus according to claim 11, characterized in that, The second processing unit is also allocated a third graph node in the relation graph, wherein the third graph node is a neighbor node of the first graph node in the relation graph; The second processing unit is used to perform feature aggregation operation on the first tensor calculation result of the second graph node and the first tensor calculation result of the third graph node to obtain the pre-aggregation result of the second graph node and the third graph node; The second processing unit is used to send the pre-aggregation result to the first processing unit; The first processing unit is used to perform feature aggregation operation on the first tensor calculation result of the first graph node and the pre-aggregation result to obtain the first aggregation result of the first graph node.

16. The apparatus according to claim 11, characterized in that, The second processing unit is used to confirm that the first tensor calculation result of the second graph node is the only information sent by the second processing unit to the first processing unit at the first moment; At the first moment, the second processing unit is used to send the first tensor calculation result of the second graph node to the first processing unit.

17. The apparatus according to claim 16, characterized in that, Each of the plurality of processing units has P neighboring units, wherein each processing unit's neighboring units are the processing units among the plurality of processing units, and each processing unit and its neighboring units have a data path, where P is an integer greater than 1. When the first processing unit is a neighboring unit of the second processing unit, the second processing unit is used to send the first tensor calculation result of the second graph node to the first processing unit through the data path between the first processing unit and the second processing unit.

18. The apparatus according to claim 17, characterized in that, The computing device also includes a router; When the first processing unit is not a neighboring unit of the second processing unit, the second processing unit is used to receive a forwarding unit instruction from the router; The second processing unit is used to instruct the forwarding unit to send the first tensor calculation result of the second graph node to the indicated processing unit, so that the forwarding unit instructs the indicated processing unit to send the first tensor calculation result of the second graph node to the first processing unit.

19. The apparatus according to claim 18, characterized in that, The forwarding unit indication is generated by the router based on the routing table, wherein in the routing table, a next-hop processing unit of the forwarding unit corresponds to at most a previous-hop processing unit of the forwarding unit.

20. The apparatus according to claim 19, characterized in that, The router is also used for: Calculate the shortest path from each source processing unit to each destination processing unit and the set of single-step paths corresponding to the shortest path to obtain multiple shortest paths and the set of single-step paths corresponding to each shortest path in the multiple shortest paths. The source processing unit and the destination processing unit are different processing units among the multiple processing units, and the source processing unit is the transmission starting point of the tensor calculation result, and the destination processing unit is the transmission ending point of the tensor calculation result. According to the path length of the multiple shortest paths in ascending order, and following the principle that a next-hop processing unit of a forwarding unit corresponds to at most a previous-hop processing unit of the forwarding unit, single-step paths for forming the shortest paths are selected sequentially from the multiple single-step path sets to obtain the routing table.

21. A computing system, characterized in that, include: A memory used to store the feature data of nodes in a relational graph; The computing device according to any one of claims 11-20.

Citation Information

Patent Citations

  • Method and device for optimizing tensor calculation performance

    CN112559163A

  • Neural hardware accelerator for parallel and distributed tensor computations

    US20190332925A1