Serializing physical mapping method and apparatus
Patent Information
- Application Number
- CN202310416452.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-18
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-04-18
AI Technical Summary
[0054]基于此,本公开提供了一种序列化物理映射方法及装置。首先对需要物理映射的单任务的各节点根据节点和节点之间的权重进行排序生成节点序列,然后根据各个节点的顺序以及当前的节点映射情况确定目标节点,利用神经网络对目标节点进行特征提取得到节点特征,根据节点特征和当前物理核部署状态并利用神经网络确定目标物理核,将目标节点物理映射至目标物理核直到节点序列中的每个节点都物理映射到对应的物理核中,完成单任务的物理映射并更新当前物理核部署状态。这样依次物理映射序列化的节点并提炼节点信息可以方便神经网络更加高效地处理节点信息,从而加快物理映射的速度。
Smart Images

Figure CN116467255B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a serialization physical mapping method and apparatus. Background Technology
[0002] With the development of multi-chip many-core architecture neuromorphic systems, achieving efficient data flow exchange between multiple chips has become an increasingly important goal. Therefore, the main direction of current work is to propose an optimization method to improve the performance of the system to varying degrees, such as time latency, communication consumption and deadlock rate, by optimizing the physical mapping. Summary of the Invention
[0003] In view of this, this disclosure proposes a serialization physical mapping method and apparatus.
[0004] According to one aspect of this disclosure, a serialized physical mapping method is provided, comprising: obtaining a logical graph of a single task and node information of each node in the logical graph; the node information including the weights between each node and other nodes;
[0005] The node with the largest sum of weights in the logical graph is determined as the first node. Based on the weights between each of the other nodes and the first node, the other nodes are sorted to generate a node sequence. The node sequence includes the first node and the other nodes sorted from largest to smallest according to their weights with the first node.
[0006] Based on the order of the nodes in the node sequence and the current node mapping, the target node is determined from multiple nodes in the node sequence.
[0007] The node information of the target node is extracted using the policy network in the neural network to obtain the node features of the target node;
[0008] Using the policy network, the current physical core deployment status, and the node characteristics, a target physical core is determined from multiple physical cores. The current physical core deployment status is used to indicate the current status of each physical core. The current status of each physical core includes either unoccupied or occupied. The target physical core is one of the unoccupied physical cores.
[0009] The target node is physically mapped to the target physical core. The steps of determining the target node and the steps after determining the target node are repeated until each node in the node sequence is physically mapped to the corresponding physical core. The physical mapping of a single task is completed and the current physical core deployment status is updated.
[0010] In this context, the same physical core can be physically mapped by at least one node of the same single task.
[0011] In one possible implementation, the node information further includes multi-dimensional node features of each node, including the placement of the node, the degree at which the node enters, the degree at which the node exits, the weight at which the node enters, and the weight at which the node exits.
[0012] The node information of the target node is extracted using a policy network in a neural network to obtain the node features of the target node, including:
[0013] The multi-dimensional node features are then normalized.
[0014] The graph convolutional neural network in the policy network is used to extract features from the normalized multi-dimensional node features to obtain the single-dimensional node features.
[0015] In one possible implementation, the neural network further includes a value network, and the method further includes:
[0016] Based on the node characteristics and the current physical core deployment status, the policy network is used to generate actions targeting the current physical core deployment status.
[0017] Based on the action, the reward function corresponding to the current physical core deployment state, and the value network, a reward is generated for the policy network;
[0018] When the adjustment conditions are met, the parameters of the policy network are adjusted based on some or all of the rewards obtained between the current time and the last time the parameters were adjusted.
[0019] In one possible implementation, the target physical core is determined from multiple physical cores using a policy network, the current physical core deployment status, and the node characteristics, and further includes:
[0020] Using the fully connected network in the policy network and the node features, the positions of multiple physical cores are sampled, and the physical cores corresponding to the sampled positions are determined as candidate physical cores;
[0021] If it is determined that the current state of the candidate physical core is unoccupied, then the candidate physical core is determined as the target physical core;
[0022] If it is determined that the current state of the candidate physical core is that it is occupied, then resampling is performed near the candidate physical core until a candidate physical core whose current state is unoccupied is found.
[0023] In one possible implementation, the reward function is a weighted sum of the variance factor and the energy consumption factor corresponding to the current physical core deployment state;
[0024] The variance factor is used to represent the distribution of links in routing communication; the energy consumption factor is used to represent the energy consumption in routing communication.
[0025] The reward function further includes at least one coefficient, each of which is used to adjust the weight of the variance factor and the energy consumption factor in the reward function.
[0026] According to another aspect of this disclosure, a serialized physical mapping apparatus is proposed, comprising: an acquisition module, which acquires a logic graph of a single task and node information of each node in the logic graph; the node information includes the weights between each node and other nodes;
[0027] The node sequence generation module determines the node with the largest weight in the logical graph as the first node, sorts the other nodes (excluding the first node) based on their weights with the first node, and generates a node sequence. The node sequence includes the first node and other nodes sorted from largest to smallest according to their weights with the first node.
[0028] The target node determination module determines the target node from multiple nodes in the node sequence based on the order of each node in the node sequence and the current node mapping.
[0029] The node feature extraction module uses the policy network in the neural network to extract features from the node information of the target node, thereby obtaining the node features of the target node.
[0030] The target physical core module is determined by using the policy network, the current physical core deployment status, and the node characteristics to identify the target physical core from multiple physical cores. The current physical core deployment status is used to indicate the current status of each physical core. The current status of each physical core includes either unoccupied or occupied. The target physical core is one of the unoccupied physical cores.
[0031] The target node is physically mapped to the target physical core. The steps of determining the target node and the steps after determining the target node are repeated until each node in the node sequence is physically mapped to the corresponding physical core. The physical mapping of a single task is completed and the current physical core deployment status is updated.
[0032] In this context, the same physical core can be physically mapped by at least one node of the same single task.
[0033] In one possible implementation, the node information further includes multi-dimensional node features of each node, including the placement of the node, the degree at which the node enters, the degree at which the node exits, the weight at which the node enters, and the weight at which the node exits.
[0034] The node information of the target node is extracted using a policy network in a neural network to obtain the node features of the target node, including:
[0035] The multi-dimensional node features are then normalized.
[0036] The graph convolutional neural network in the policy network is used to extract features from the normalized multi-dimensional node features to obtain the single-dimensional node features.
[0037] In one possible implementation, the neural network further includes a value network, and the device further includes a parameter adjustment module, the parameter adjustment module being used for:
[0038] Based on the node characteristics and the current physical core deployment status, the policy network is used to generate actions targeting the current physical core deployment status.
[0039] Based on the action, the reward function corresponding to the current physical core deployment state, and the value network, a reward is generated for the policy network;
[0040] When the adjustment conditions are met, the parameters of the policy network are adjusted based on some or all of the rewards obtained between the current time and the last time the parameters were adjusted.
[0041] In one possible implementation, the target physical core is determined from multiple physical cores using a policy network, the current physical core deployment status, and the node characteristics, and further includes:
[0042] Using the fully connected network in the policy network and the node features, the positions of multiple physical cores are sampled, and the physical cores corresponding to the sampled positions are determined as candidate physical cores;
[0043] If it is determined that the current state of the candidate physical core is unoccupied, then the candidate physical core is determined as the target physical core;
[0044] If it is determined that the current state of the candidate physical core is that it is occupied, then resampling is performed near the candidate physical core until a candidate physical core whose current state is unoccupied is found.
[0045] In one possible implementation, the reward function is a weighted sum of the variance factor and the energy consumption factor corresponding to the current physical core deployment state;
[0046] The variance factor is used to represent the distribution of links in routing communication; the energy consumption factor is used to represent the energy consumption in routing communication.
[0047] The reward function further includes at least one coefficient, each of which is used to adjust the weight of the variance factor and the energy consumption factor in the reward function.
[0048] According to another aspect of this disclosure, a serialization physical mapping apparatus is proposed, comprising:
[0049] processor;
[0050] Memory used to store processor-executable instructions;
[0051] The processor is configured to implement the above method when executing instructions stored in the memory.
[0052] According to another aspect of this disclosure, a non-volatile computer-readable storage medium is proposed, on which computer program instructions are stored, which, when executed by a processor, implement the above-described method.
[0053] According to another aspect of this disclosure, a computer program product is provided, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device implements the above-described method.
[0054] Based on this, this disclosure provides a serialized physical mapping method and apparatus. First, the nodes of a single task requiring physical mapping are sorted according to their weights to generate a node sequence. Then, a target node is determined based on the order of the nodes and the current node mapping status. A neural network is used to extract features from the target node to obtain node features. Based on the node features and the current physical core deployment state, the target physical core is determined using the neural network. The target nodes are then physically mapped to the target physical core until each node in the node sequence is physically mapped to its corresponding physical core, completing the physical mapping for the single task and updating the current physical core deployment state. This sequential physical mapping of nodes and extraction of node information allows the neural network to process node information more efficiently, thereby accelerating the physical mapping speed.
[0055] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0056] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.
[0057] Figure 1 A schematic diagram of logical mapping and physical mapping is shown.
[0058] Figure 2 A flowchart of a serialization physical mapping method according to an embodiment of the present disclosure is shown.
[0059] Figure 3 A flowchart illustrating a serialization physical mapping method according to an embodiment of the present disclosure is shown.
[0060] Figure 4a A schematic diagram of node information according to an embodiment of the present disclosure is shown.
[0061] Figure 4b A schematic diagram of data-based node information according to an embodiment of the present disclosure is shown.
[0062] Figure 5 This is a block diagram illustrating an apparatus 1900 for serializing physical maps according to an exemplary embodiment. Detailed Implementation
[0063] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0064] In the description of this disclosure, it should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this disclosure and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure.
[0065] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise expressly specified.
[0066] In this disclosure, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this disclosure according to the specific circumstances.
[0067] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0068] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0069] As neural network models become deeper and more complex, higher demands are placed on the computing and communication capabilities of processing devices. In recent years, multi-chip many-core neuromorphic systems have emerged. However, in practical applications, complex chip control logic and data flow planning often become bottlenecks limiting performance.
[0070] Figure 1 A schematic diagram of logical mapping and physical mapping is shown. (For example...) Figure 1 As shown, deploying algorithms on a multi-chip many-core architecture system mainly involves two processes: logical mapping and physical mapping. Logical mapping is the process of grouping neurons in an artificial neural network according to the computing power and storage capacity of the physical computing devices. The resulting groups are usually represented as a weighted acyclic directed graph, also known as a logical graph. The logical graph includes multiple nodes, which can be divided into different groups. For example, ... Figure 1 As shown, nodes of different colors belong to different groups. Physical mapping is the process of mapping nodes in a logical graph to a neuromorphic physical structure. This process needs to consider efficiency and physical constraints. Physical mapping has a significant impact on the performance of neural network algorithms implemented on neuromorphic chip platforms. Optimizing physical mapping can make the system execute faster and more efficiently. Therefore, how to optimize physical mapping for a single task to achieve efficient control and reasonable data flow planning for multi-chip many-core architecture systems has become an important task.
[0071] Based on this, this disclosure provides a serialized physical mapping method and apparatus. First, the nodes of a single task requiring physical mapping are sorted according to their weights to generate a node sequence. Then, a target node is determined based on the order of the nodes and the current node mapping status. A neural network is used to extract features from the target node to obtain node features. Based on the node features and the current physical core deployment state, the target physical core is determined using the neural network. The target nodes are then physically mapped to the target physical core until each node in the node sequence is physically mapped to its corresponding physical core, completing the physical mapping for the single task and updating the current physical core deployment state. This sequential physical mapping of nodes and extraction of node information allows the neural network to process node information more efficiently, thereby accelerating the physical mapping speed.
[0072] Figure 2 A flowchart of a serialization physical mapping method according to an embodiment of the present disclosure is shown. Figure 2 As shown, the serialization physical mapping method provided in this disclosure includes steps S101-S106. Furthermore, to more intuitively demonstrate the serialization physical mapping method of this disclosure, Figure 3 A flowchart illustrating a serialization physical mapping method according to an embodiment of the present disclosure is shown. Figure 3 The diagram illustrates an example of an application of the method of this disclosure, such as... Figure 3 As shown in the example, the circle represents a single-task node, the 16 small squares represent physical cores, the medium square composed of 4 small squares can be considered as a chip, and the large square composed of 4 medium squares can be considered as a multi-chip many-core architecture. Figure 3 The current physical core deployment status is indicated by the color of the physical core. The logical graph is a weighted acyclic directed graph for a single task. The following is combined with... Figure 2 and Figure 3 The implementation of the serialization physical mapping method disclosed herein is illustrated.
[0073] In step S101, the logic diagram of a single task and the node information of each node in the logic diagram are obtained. The node information includes the weights of each node relative to other nodes.
[0074] In step S102, the node with the largest weight in the logical graph is determined as the first node. Based on the weights between the first node and the other nodes, the other nodes are sorted to generate a node sequence. The node sequence includes the first node and the other nodes sorted from largest to smallest according to their weights with the first node.
[0075] The logical graph for a single task can be a weighted acyclic directed graph obtained after logical mapping. The weighted acyclic directed graph can include the weights between each node. The node with the largest sum of weights between itself and all other nodes in the weighted acyclic directed graph is determined as the head node. Other nodes are sorted according to their weights with the head node, generating a node sequence where the first node is the head node and the other nodes are sorted in descending order of their weights with the head node.
[0076] In step S103, the target node is determined from multiple nodes in the node sequence according to the order of each node in the node sequence and the current node mapping.
[0077] The current node mapping status indicates which nodes in the node sequence have completed physical mapping at the current time, or which nodes have not yet completed physical mapping at the current time. In some embodiments, since the method provided by this disclosure performs physical mapping on nodes sequentially according to the order of nodes in the node sequence, the current node mapping status can be represented by the number of nodes that have completed physical mapping at the current time. For example, if the physical mapping of the first two nodes in the node sequence has been successfully completed, the current node mapping status can be "2", thus determining the third node in the node sequence as the target node. This disclosure's sorting and sequential physical mapping of nodes can improve the speed of physical mapping for subsequent networks of the same type. For example, when a single physical mapping task is required, after the above-mentioned sequential sorting of nodes (i.e., generating a node sequence) and physical mapping, the next time this single task is executed, the arrangement and processing will be more efficient.
[0078] In step S104, the node information of the target node is extracted using the policy network in the neural network to obtain the node features of the target node.
[0079] in, Figure 4a A schematic diagram of node information according to an embodiment of the present disclosure is shown, illustrating the node information in a graphical manner. Figure 4b A schematic diagram of digitized node information according to an embodiment of the present disclosure is shown, representing it in a data format. Figure 4a Node information. For example... Figure 4a and Figure 4b As shown, the node information obtained in step S101 may further include multi-dimensional node features of each node. These multi-dimensional node features may include the placement of the node, the degree at which the node enters, the degree at which the node exits, the weight at which the node enters, and the weight at which the node exits. For example, as... Figure 4a and Figure 4bAs shown, node 1 is "placed," meaning its placement value is "0." There is one arrow pointing to node 1, indicating the node entered with a degree of "1" and a weight of "132." There are two arrows pointing out of node 1, indicating the node exited with a degree of "2" and a weight of "256." In practical applications, there may be more than this. Figure 4a , Figure 4b The three nodes shown may have multi-dimensional node features or contain a large amount of complex node information, which is not conducive to the policy network in the neural network extracting the main information and converging. Therefore, before determining the target physical kernel, the node information of the above nodes can be refined, that is, feature extraction can be performed on each node. Figure 3 (Feature extraction steps not marked) to accelerate the convergence speed of the policy network in the neural network, making it easier for the neural network to process node information more efficiently, thereby speeding up the physical mapping process.
[0080] In one possible implementation, step S104 may include: first, normalizing the multi-dimensional node features in the node information of each node. For example... Figure 4a , Figure 4b In the normalized placement of node 1, the degree of the node entering is "0.5", and the corresponding weight of the node entering is "0.52". The degree of the node leaving is "1", and the corresponding weight of the node leaving is "1". Then, the graph convolutional neural network in the policy network is used to extract features from the normalized multi-dimensional node features to obtain the single-dimensional node features.
[0081] The policy network in a neural network can include a Graph Convolutional Network (GCN) layer. GCNs can transform multi-dimensional information into single-dimensional information, that is, convert multi-dimensional node information into single-dimensional node features. This allows the policy network in the neural network to process node information more efficiently when determining the target physical kernel among multiple physical kernels, thereby accelerating the speed of single-task physical mapping. The number of layers in the GCN can be selected based on the task characteristics, choosing the radius of the task network as the number of layers, which can better reflect the connectivity relationships near nodes.
[0082] In step S105, the target physical core is determined from multiple physical cores using the policy network, the current physical core deployment status, and the node characteristics. The current physical core deployment status is used to indicate the current status of each physical core. The current status of each physical core includes either unoccupied or occupied. The target physical core is one of the unoccupied physical cores.
[0083] In some embodiments, step S105 may include: sampling multiple physical cores using the fully connected network in the policy network and the node characteristics to determine candidate physical cores. If the current state of a candidate physical core is determined to be unoccupied, then the candidate physical core is determined as the target physical core. If the current state of a candidate physical core is determined to be occupied, then resampling is performed near the candidate physical core until a candidate physical core with a current state of unoccupied is found.
[0084] The policy network in the neural network may further include a fully connected network (MLP). The fully connected network takes the single-dimensional node features output by the graph convolutional network in step S104 and the current physical kernel deployment state as input, and calculates the target physical kernel. The graph convolutional network and the fully connected network in the policy network can be considered as a series connection, with the output of the graph convolutional network serving as the input of the fully connected network. In related technologies, although using two-dimensional spatial encoding with convolutional neural networks (CNNs) is more reliable, it focuses more on extracting spatial states, thus losing some important information. Therefore, a fully connected network is chosen to use one-dimensional information. Since the graph convolutional network outputs single-dimensional node features, the fully connected network can directly utilize the output of the graph convolutional network without processing it. In some embodiments, such as... Figure 3 The policy network shown can perform reinforcement learning to improve the accuracy of the output target physical kernel, that is, accumulate the experience of selecting the position of each physical mapping. After the network model is successfully trained, it can accelerate the execution speed of subsequent similar tasks.
[0085] In this context, the current state of each physical core (i.e., the physical core deployment state) includes either unoccupied or occupied. Occupied physical cores cannot be reused in subsequent tasks until the task occupying that physical core exits. A physical core can be understood as a computing core; each physical core can only process one task at a time, but subsequent tasks can seek processing from other physical cores. Furthermore, the nodes of a single task can be mapped to one or more physical cores, and the same physical core can be physically mapped by at least one node of the same single task.
[0086] In one possible implementation, such as Figure 3 As shown, the neural network can also include a value network, and the serialized physical mapping method disclosed herein can further include an action generation step, a reward generation step, and a parameter adjustment step. This enables the adjustment of the policy network and can also output the adjustment magnitude of the measurement network. Therefore, the learning capability of reinforcement learning can be fully utilized, thereby continuously accelerating the physical mapping process through continuous learning.
[0087] In the action generation step, based on the node characteristics of the target node and the current physical core deployment state, the policy network is used to generate an action targeting the current physical core deployment state.
[0088] Specifically, after inputting the node characteristics of the target node and the current physical core deployment state into the neural network, the policy network within the neural network can generate actions based on these characteristics and the current physical core deployment state. These actions can include the probability of each physical core being occupied. For example, the policy network can first... Figure 3 The 16 physical cores are represented by expanding a two-dimensional 4x4 matrix into a one-dimensional 16. For example, a physical core with coordinates (0, 0) can be represented as 0, a physical core with coordinates (0, 1) can be represented as 1, and a physical core with coordinates (1, 0) can be represented as 4. That is, each physical core is represented by a number from 0 to 15 in sequence. Then, the policy network outputs a 1x16 matrix as the action, and each position in the matrix records the probability of the corresponding physical core being occupied.
[0089] In the reward generation step, a reward for the policy network can be generated based on the action, the reward function corresponding to the current physical core deployment state, and the value network.
[0090] As mentioned above, the policy network outputs a matrix containing the probability of each physical core being occupied, which represents the action. Therefore, the probability of each physical core being occupied can be determined based on the action. Based on the action and the reward function of the current physical core deployment state, the suitability of physical mapping based on the probability in the action and the current environmental conditions can be determined, i.e., generating a realistic environmental reward that incorporates the environment. Using the value network and actions, the suitability of physical mapping based on the probability in the action and the estimated situation can be predicted, i.e., generating a predicted reward. The predicted reward generated by the value network and the realistic environmental reward generated by the reward function can be combined to generate a reward for the policy network. This reward is then sent to the policy network, causing it to change its strategy for determining the target physical core based on the reward, which may affect the next selected target physical core or the probability included in the generated action.
[0091] The aforementioned reward can focus more on the real-world reward generated by the reward function, making the learning and output of the entire neural network more adaptable to real-world environments. This disclosure can employ a routing communication method for physical mapping. The advantage of routing communication lies in its computational simplicity, avoiding the significant time required for routing simulation. However, it cannot accurately reflect the actual application environment under complex tasks. In one possible implementation, the reward function Reward can be a weighted sum of a variance factor and an energy consumption factor corresponding to the current physical core deployment state. The variance factor represents the distribution of links in the routing communication, and the energy consumption factor represents the energy consumption in the routing communication. The reward function also includes at least one coefficient, each used to adjust the weight of the variance factor and the energy consumption factor in the reward function.
[0092] The reward function Reward can be expressed as follows:
[0093]
[0094] Where α is a coefficient. This can be the variance factor of the current physical core deployment status, or the average VAR_link of the communication variance of each link in the routing communication and the average VAR_link of the communication variance of the routing communication after a certain number of random searches. ave The ratio of . Multiplying by the coefficient α, it represents the distribution of links in routing communication. The communication variance VAR_link can be understood as the variance of the remaining links after removing unused links, assuming there are multiple links in routing communication. It can also represent the time delay of current routing communication. The expected time delay can be adjusted by changing the value of the coefficient α. For example, if the impact of time delay can be disregarded when determining the target physical core, α can be set to 0. Alternatively, α can be set to a number in the range of 0-1 depending on the degree of importance (expected value). This disclosure does not limit this. The reward function includes a variance factor. This can make the links more evenly distributed, which can indirectly reduce computation time.
[0095] in, This can be the energy consumption factor of the current physical core deployment state, or the average energy consumption Cost_link of each link in the routing communication and the average energy consumption Cost_link of the routing communication after a certain number of random searches. ave The ratio of . Multiplying by the coefficient 1-α represents the energy consumption in routing communication. The expected energy consumption can be adjusted by changing the value of the coefficient 1-α. For example, if there is no requirement for energy consumption when determining the target physical core, 1-α can be set to 0. Alternatively, 1-α can be set to a number in the range of 0-1 depending on the level of importance (expected value). This disclosure does not impose any other limitations on this. Including an energy consumption factor in the reward function allows for flexible adjustment of the reward fed back to the policy network based on the current environment, actual needs, and expected energy consumption.
[0096] Among these, the single-task physical mapping methods of related technologies mainly focus on energy consumption, without proposing a scientifically sound solution for time delay in the physical mapping scheme. In contrast, the serialized physical mapping method disclosed in this paper simultaneously considers the impact of energy consumption and time delay on physical mapping. Furthermore, the reward function can serve as an evaluation metric to judge the quality of the physical mapping process; a higher reward function value indicates a worse physical mapping effect, such as excessive time delay or excessive energy consumption. The reward function can also balance time delay and communication consumption according to actual needs by changing the value of the coefficient α. Moreover, related technologies arrange all physical kernels all at once during each physical mapping, failing to fully utilize the reinforcement learning algorithm's ability to perceive and judge the environment, and hindering the accumulation of learned experience for subsequent arrangements. This disclosure, however, combines environmental factors and leverages the learning ability of reinforcement learning through a serialization method, enabling the neural network to continuously acquire experience during the learning process.
[0097] In the parameter adjustment step, when it is determined that the adjustment conditions are met, the parameters of the policy network can be adjusted based on some or all of the rewards obtained between the current time and the last time the parameters were adjusted.
[0098] In this process, after generating rewards for the policy network by combining the value network and the reward function, the policy network can receive the rewards and adjust its parameters when adjustment conditions are met. The adjustment conditions can be set according to actual needs, and this disclosure does not impose any limitations on them. In one embodiment of this disclosure, the adjustment condition can be the update frequency of the policy network. For example, the adjustment condition can be set to meet the policy network's update frequency of 5 times. During this period, the policy network can update the current physical core deployment status 5 times and save 5 rewards. Then, when the adjustment condition is met, some or all of these 5 rewards can be used to adjust the parameters of the policy network to adjust its strategy for selecting the target physical core next time.
[0099] In step S106, the target node is physically mapped to the target physical core. The steps of determining the target node and the steps after determining the target node are repeated, that is, steps S103-S106 are repeatedly executed until each node in the node sequence is physically mapped to the corresponding physical core, the physical mapping of a single task is completed and the current physical core deployment status is updated.
[0100] The physical mapping disclosed herein is specific to a single node, allowing for more flexible selection of the target physical core, thereby achieving physical mapping with maximized performance.
[0101] In related technologies, single-task physical mapping mainly includes linear programming, random search algorithm, simulated annealing algorithm, genetic algorithm and tree search algorithm. Compared with the methods of the above related technologies, this disclosure uses reinforcement learning algorithm to optimize the physical mapping scheme, focusing on improving the performance of the communication consumption of the mapping scheme.
[0102] In one embodiment of this disclosure, tests were conducted using a test set created by the Tsinghua University Brain-Inspired Laboratory: CNN54, CNN154, MLP154, RESNET50, BIGCNN, and GPT-S. Compared with zigzag arrangement, nearest neighbor arrangement, random search, simulated annealing, and manual arrangement, the serialization physical mapping method of this disclosure, under energy-efficient algorithms, has lower communication consumption than the aforementioned related technologies, with average performance improvements of 20%-40%. Under latency-efficient algorithms, the serialization physical mapping method of this disclosure has lower latency than the aforementioned related technologies, with average performance improvements of 20%-40%.
[0103] It should be noted that although a serialized physical mapping method has been described above with reference to the embodiments described, those skilled in the art will understand that this disclosure is not limited thereto. In fact, the physical mapping order can be flexibly set according to individual circumstances and / or actual application scenarios, and the reward function can be flexibly applied to evaluate the mapping quality, and is not limited to the content given in this example.
[0104] According to another aspect of this disclosure, a serialized physical mapping apparatus is proposed, comprising: an acquisition module for acquiring a logic graph of a single task and node information of each node in the logic graph. The node information includes the weights of each node relative to other nodes. A node sequence generation module for determining the node with the largest sum of weights in the logic graph as the first node, and sorting the other nodes (excluding the first node) according to their weights relative to the first node to generate a node sequence, the node sequence including the first node and other nodes sorted in descending order of their weights relative to the first node. A target node determination module for determining a target node from multiple nodes in the node sequence according to the order of the nodes in the node sequence and the current node mapping status. A node feature extraction module for extracting features from the node information of the target node using a policy network in a neural network to obtain the node features of the target node. The target physical core module is determined by using a policy network, the current physical core deployment status, and the node characteristics to identify the target physical core from multiple physical cores. The current physical core deployment status indicates the current state of each physical core, which can be either unoccupied or occupied. The target physical core is one of the unoccupied physical cores. The target node is then physically mapped to the target physical core. The steps of determining the target node and subsequent steps are repeated until each node in the node sequence is physically mapped to its corresponding physical core. This completes the physical mapping for a single task and updates the current physical core deployment status. Note that the same physical core can be physically mapped by at least one node within the same single task.
[0105] In one possible implementation, the node information further includes multi-dimensional node features for each node. These multi-dimensional node features include the node's placement, the degree at which the node enters, the degree at which the node leaves, the weight at which the node enters, and the weight at which the node leaves. Feature extraction of the target node's node information using a policy network within the neural network to obtain the target node's node features includes: normalizing the multi-dimensional node features. Then, feature extraction is performed on the normalized multi-dimensional node features using a graph convolutional neural network within the policy network to obtain single-dimensional node features.
[0106] In one possible implementation, the neural network further includes a value network, and the apparatus further includes a parameter adjustment module, which is configured to: generate an action for the current physical core deployment state using the policy network based on the node features and the current physical core deployment state; generate a reward for the policy network based on the action, a reward function corresponding to the current physical core deployment state, and the value network; and adjust the parameters of the policy network based on some or all of the rewards obtained between the current time and the last time the parameters were adjusted, when it is determined that the adjustment conditions are met.
[0107] In one possible implementation, the target physical core is determined from multiple physical cores using a policy network, the current physical core deployment status, and the node characteristics. This further includes: sampling the locations of the multiple physical cores using the fully connected network in the policy network and the node characteristics, and determining the physical core corresponding to the sampled location as a candidate physical core. If the current state of the candidate physical core is determined to be unoccupied, then the candidate physical core is determined as the target physical core. If the current state of the candidate physical core is determined to be occupied, then resampling is performed near the candidate physical core until a candidate physical core with a current unoccupied state is found.
[0108] In one possible implementation, the reward function is a weighted sum of a variance factor and an energy consumption factor corresponding to the current physical core deployment state. The variance factor represents the distribution of links in the routing communication. The energy consumption factor represents the energy consumption in the routing communication. The reward function also includes at least one coefficient, each coefficient used to adjust the weight of the variance factor and the energy consumption factor in the reward function.
[0109] In this way, sequentially mapping nodes to physical maps and extracting node information allows neural networks to process node information more efficiently, thereby accelerating the physical mapping process. It also improves the speed of physical mapping for subsequent networks of the same type, fully leverages the learning capabilities of reinforcement learning, and allows physical mapping to continuously accelerate through learning. Furthermore, it provides the concept of a reward function as a standard for evaluating the quality of physical mapping, enabling quick and flexible calculations and easy assessment of the quality of physical mappings.
[0110] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to execute / implement the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0111] This disclosure also proposes a computer-readable storage medium storing computer program instructions thereon, which, when executed by a processor, implement the aforementioned apparatus. The computer-readable storage medium may be volatile or non-volatile.
[0112] This disclosure also proposes a serialization physical mapping apparatus, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above apparatus when executing the instructions stored in the memory.
[0113] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device implements the above-described apparatus.
[0114] The above description is merely an exemplary embodiment of the present invention and is not intended to limit the scope of protection of the present invention, which is determined by the appended claims.
[0115] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0116] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0117] Figure 5This is a block diagram illustrating an apparatus 1900 for serializing physical maps according to an exemplary embodiment. For example, apparatus 1900 may be provided as a server or terminal device. (Refer to...) Figure 5 The apparatus 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.
[0118] Device 1900 may also include a power supply component 1926 configured to perform power management of device 1900, a wired or wireless network interface 1950 configured to connect device 1900 to a network, and an input / output interface 1958 (I / O interface). Device 1900 can operate on an operating system, such as Windows Server, stored in memory 1932. TM macOS X TM Unix TM Linux TM FreeBSD TM Or similar.
[0119] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by a processing component 1922 of the device 1900 to perform the above-described method.
[0120] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.
[0121] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0122] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0123] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0124] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0125] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0126] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0127] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0128] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A serialized physical mapping method, characterized in that, include: Obtain the logic diagram of a single task and the node information of each node in the logic diagram; The node information includes the weights of each node relative to other nodes; The node with the largest sum of weights in the logical graph is determined as the first node. Based on the weights between each of the other nodes and the first node, the other nodes are sorted to generate a node sequence. The node sequence includes the first node and the other nodes sorted from largest to smallest according to their weights with the first node. Based on the order of the nodes in the node sequence and the current node mapping, the target node is determined from multiple nodes in the node sequence. The node information of the target node is extracted using the policy network in the neural network to obtain the node features of the target node; Using the policy network, the current physical core deployment status, and the node characteristics, a target physical core is determined from multiple physical cores. The current physical core deployment status is used to indicate the current status of each physical core. The current status of each physical core includes either unoccupied or occupied. The target physical core is one of the unoccupied physical cores. The target node is physically mapped to the target physical core. The steps of determining the target node and the steps after determining the target node are repeated until each node in the node sequence is physically mapped to the corresponding physical core. The physical mapping of a single task is completed and the current physical core deployment status is updated. In this context, the same physical core can be physically mapped by at least one node of the same single task.
2. The method according to claim 1, characterized in that, The node information also includes multi-dimensional node features of each node, including the placement of the node, the degree at which the node enters, the degree at which the node exits, the weight at which the node enters, and the weight at which the node exits. The node information of the target node is extracted using a policy network in a neural network to obtain the node features of the target node, including: The multi-dimensional node features are then normalized. The graph convolutional neural network in the policy network is used to extract features from the normalized multi-dimensional node features to obtain the single-dimensional node features.
3. The method according to claim 1, characterized in that, The neural network further includes a value network, and the method further includes: Based on the node characteristics and the current physical core deployment status, the policy network is used to generate actions targeting the current physical core deployment status. Based on the action, the reward function corresponding to the current physical core deployment state, and the value network, a reward is generated for the policy network; When the adjustment conditions are met, the parameters of the policy network are adjusted based on some or all of the rewards obtained between the current time and the last time the parameters were adjusted.
4. The method according to claim 1, characterized in that, Using the policy network, the current physical core deployment status, and the node characteristics, the target physical core is determined from multiple physical cores, and the method further includes: Using the fully connected network in the policy network and the node features, the positions of multiple physical cores are sampled, and the physical cores corresponding to the sampled positions are determined as candidate physical cores; If it is determined that the current state of the candidate physical core is unoccupied, then the candidate physical core is determined as the target physical core; If it is determined that the current state of the candidate physical core is that it is occupied, then resampling is performed near the candidate physical core until a candidate physical core whose current state is unoccupied is found.
5. The method according to claim 3, characterized in that, The reward function is a weighted sum of the variance factor and the energy consumption factor corresponding to the current physical core deployment state; The variance factor is used to represent the distribution of links in routing communication; the energy consumption factor is used to represent the energy consumption in routing communication. The reward function further includes at least one coefficient, each of which is used to adjust the weight of the variance factor and the energy consumption factor in the reward function.
6. A serialization physical mapping device, characterized in that, include: The acquisition module acquires the logic diagram of a single task and the node information of each node in the logic diagram; The node information includes the weights of each node relative to other nodes; The node sequence generation module determines the node with the largest weight in the logical graph as the first node, sorts the other nodes (excluding the first node) based on their weights with the first node, and generates a node sequence. The node sequence includes the first node and other nodes sorted from largest to smallest according to their weights with the first node. The target node determination module determines the target node from multiple nodes in the node sequence based on the order of each node in the node sequence and the current node mapping. The node feature extraction module uses the policy network in the neural network to extract features from the node information of the target node, thereby obtaining the node features of the target node. The target physical core module is determined by using the policy network, the current physical core deployment status, and the node characteristics to identify the target physical core from multiple physical cores. The current physical core deployment status is used to indicate the current status of each physical core. The current status of each physical core includes either unoccupied or occupied. The target physical core is one of the unoccupied physical cores. The target node is physically mapped to the target physical core. The steps of determining the target node and the steps after determining the target node are repeated until each node in the node sequence is physically mapped to the corresponding physical core. The physical mapping of a single task is completed and the current physical core deployment status is updated. In this context, the same physical core can be physically mapped by at least one node of the same single task.
7. The apparatus according to claim 6, characterized in that, The node information also includes multi-dimensional node features of each node, including the placement of the node, the degree at which the node enters, the degree at which the node exits, the weight at which the node enters, and the weight at which the node exits. The node information of the target node is extracted using a policy network in a neural network to obtain the node features of the target node, including: The multi-dimensional node features are then normalized. The graph convolutional neural network in the policy network is used to extract features from the normalized multi-dimensional node features to obtain the single-dimensional node features.
8. The apparatus according to claim 6, characterized in that, The neural network further includes a value network, and the device further includes a parameter adjustment module, the parameter adjustment module being used for: Based on the node characteristics and the current physical core deployment status, the policy network is used to generate actions targeting the current physical core deployment status. Based on the action, the reward function corresponding to the current physical core deployment state, and the value network, a reward is generated for the policy network; When the adjustment conditions are met, the parameters of the policy network are adjusted based on some or all of the rewards obtained between the current time and the last time the parameters were adjusted.
9. The apparatus according to claim 6, characterized in that, Using the policy network, the current physical core deployment status, and the node characteristics, the target physical core is determined from multiple physical cores, and the method further includes: Using the fully connected network in the policy network and the node features, the positions of multiple physical cores are sampled, and the physical cores corresponding to the sampled positions are determined as candidate physical cores; If it is determined that the current state of the candidate physical core is unoccupied, then the candidate physical core is determined as the target physical core; If it is determined that the current state of the candidate physical core is that it is occupied, then resampling is performed near the candidate physical core until a candidate physical core whose current state is unoccupied is found.
10. The apparatus according to claim 8, characterized in that, The reward function is a weighted sum of the variance factor and the energy consumption factor corresponding to the current physical core deployment state; The variance factor is used to represent the distribution of links in routing communication; the energy consumption factor is used to represent the energy consumption in routing communication. The reward function further includes at least one coefficient, each of which is used to adjust the weight of the variance factor and the energy consumption factor in the reward function.
11. A serialization physical mapping device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to implement the method of any one of claims 1 to 5 when executing instructions stored in the memory.
12. A non-volatile computer-readable storage medium storing computer program instructions thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 5.