Mapping method of neural network accelerator based on three-dimensional network-on-chip

By grouping and sorting the load of the neural network layer in the three-dimensional network on chip, combined with link traffic and temperature constraints, an optimal mapping sequence is generated, which solves the problem of excessive temperature of the neural network accelerator in the three-dimensional network on chip and achieves load balancing and thermal management. Comprehensive optimization of management.

CN118504635APending Publication Date: 2024-08-16NANJING NINGQI INTELLIGENT COMPUTING CHIP RES INST CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410660335.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2024-08-16

AI Technical Summary

Technical Problem

Existing technology is difficult to effectively solve the problem of excessive temperature of neural network accelerators in three-dimensional on-chip networks. Existing mapping optimization methods ignore temperature factors or fail to take into account thermal sensing and traffic balancing requirements.

Method used

By grouping the workload of the neural network layer and sorting it according to the average load size, high-load layers are mapped first, and link traffic and temperature constraints are considered during the mapping process. Random mapping and iterative optimization are used to generate the optimal mapping sequence to ensure that data packets are Transmission distance and temperature are within thresholds.

Benefits of technology

It effectively reduces the peak temperature of the chip, makes full use of the cooling capacity of the radiator, balances the flow distribution, improves system stability and reliability, and significantly reduces the temperature gradient and communication delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118504635A
    Figure CN118504635A
Patent Text Reader

Abstract

The invention discloses a mapping method of a neural network accelerator based on a three-dimensional network-on-chip, and belongs to the field of network-on-chip, and the method comprises the steps: grouping the workload of each layer of a neural network; sorting the neural network layers according to the average workload of each layer, wherein the layer with the highest average workload has the highest mapping priority; selecting idle nodes in a preset range of the radiator as a mapping range in the chip of the layer corresponding to the highest mapping priority; randomly mapping each group to nodes in a mapping range to generate a mapping sequence; calculating the sum of the average transmission distances of the data packets in the mapping sequence; screening the mapping sequence according to a link traffic load constraint condition; calculating the temperature of each node in each received mapping sequence, and selecting the mapping sequence of which the node temperature is smaller than a threshold value as the optimal mapping of the current neural network layer; in order to solve the problem that the temperature of a neural network accelerator chip is too high in the prior art, the peak temperature of the chip is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of on-chip networks, and more specifically, to a mapping method for a neural network accelerator based on a three-dimensional on-chip network. Background Art

[0002] With the rapid development of semiconductor technology, the integration of single chips continues to increase, and multi-core chips have become a current research hotspot and one of the main development directions in the future. Network on Chip (NoC) is a new architecture for communication between multiple processor cores on a chip, which uses packet routing to achieve inter-core communication. Compared with traditional two-dimensional NoC, three-dimensional NoC has the characteristics of high integration, high power density, and long heat dissipation path, which leads to more hot spots and higher temperature gradients. In addition, the non-uniformity of thermal conductivity between heterogeneous layers in three-dimensional NoC makes the heat accumulation rate faster at locations far away from the heat sink, while the cooling efficiency of these locations is relatively small, which aggravates the thermal problem and may cause device failure, shorten life, and even seriously affect system stability and reliability. Therefore, it is urgent to propose a reasonable three-dimensional NoC temperature control method. Existing temperature control methods mainly include heat dissipation design, power consumption control, and task scheduling. However, adding a heat sink will increase the cost, power consumption control technology such as voltage and frequency scaling may lead to reduced throughput and increased congestion, and task scheduling may inadvertently increase network delay and cooling time. Considering that data transmission accounts for a large proportion of the total power consumption of multi-core systems, optimizing the uneven thermal distribution problem of three-dimensional NoC through mapping has become a new idea.

[0003] The mapping strategy not only affects the communication delay between processing elements (PEs), but also affects the load distribution of each layer of the 3D NoC. Some existing mapping optimization methods have the following shortcomings: although the neural network-aware mapping algorithm based on random exhaustive enumeration can reduce the routing distance and balance data traffic, it ignores the chip temperature factor; the mapping method based on genetic algorithm is easily affected by the initial mapping and may obtain a suboptimal solution; although the automatic mapping optimization based on reinforcement learning can find the best neural network hardware mapping, it does not consider that temperature may cause local hot spots; the thermal-aware mapping technology based on hill climbing algorithm is only applicable to 2D NoC; the thermal-aware defect recovery method for TSV is not specifically used for neuron mapping; a mapping algorithm for optimizing the communication computing performance of 3D NoC under thermal constraints focuses on application runtime mapping; although an advanced thermal model can capture the relationship between system thermal distribution and thread core mapping, its thermal-aware mapping algorithm targets traditional application threads; although the pre-mapping clustering technology under the NASH architecture can adjust the cada core temperature, it mainly focuses on the neuron clustering of the spiking neural network. All existing technologies have certain limitations and it is difficult to take into account the thermal perception and traffic balancing requirements of 3D NoC neural network accelerators.

[0004] The Chinese patent application, application number CN202211054665.1, published on December 13, 2022, discloses an on-chip network autonomous optimal mapping exploration system based on reinforcement learning, including: converting the neural network convolution layer required for calculation of the on-chip network into an artificial neural network layer, and grouping the neurons to obtain neuron groups; the array composed of the serial numbers of the grouped neuron groups and the corresponding on-chip network processing unit serial numbers is the simplified hardware mapping expression; setting and configuring the action space, state value, reward value, environment, reinforcement learning algorithm, value network and policy network of the on-chip network autonomous optimal mapping exploration system based on reinforcement learning; converting the hardware mapping configuration problem into a sequence decision The problem is to automatically generate hardware mappings, and the mapping generation follows soft constraints and hard constraints; after generating the mapping strategy according to the probability of the reinforcement learning algorithm policy network, the mapping file, neural network model file, neural network weight and bias file, neural network input data file, and on-chip network hardware resource parameters are input into the on-chip network simulator; the on-chip network simulator returns the state value and reward value required by the agent as the environment, and the agent calculates the loss value based on the return value, updates the policy and value network parameters, and optimizes the sequence decision process; repeat until the policy network finally learns how to predict the mapping configuration action to maximize the optimization of the reward value. When the reward value converges, the sequence action corresponding to the optimal reward value is the ideal optimal hardware mapping. Although the mapping exploration system based on reinforcement learning can automatically find the best, it lacks targeted constraints and feedback on hot issues, so it is difficult to meet the stringent requirements of the three-dimensional on-chip network neural network accelerator for heat dissipation and power consumption. Summary of the invention

[0005] 1. Technical issues to be solved

[0006] In response to the problem of excessively high temperature of neural network accelerator chips in the prior art, the present application provides a mapping method for a neural network accelerator based on a three-dimensional on-chip network. By grouping the workload of the neural network layers and sensing the temperature and link traffic of the mapped nodes, the optimal hardware resource mapping of each layer of the neural network in the on-chip network is explored, thereby effectively reducing the peak temperature of the chip.

[0007] 2. Technical solution

[0008] The purpose of this application is achieved through the following technical solutions.

[0009] The present specification provides a mapping method for a neural network accelerator based on a three-dimensional network on chip, comprising: step 1, grouping the workload of each layer of the neural network; wherein the workload includes a computing load, a memory access load, and a communication load; step 2, sorting the neural network layers according to the average workload size of each layer, and the layer with the highest average workload has the highest mapping priority; in the chip corresponding to the layer with the highest mapping priority, selecting the idle nodes within the preset range of the radiator as the mapping range; step 3, according to the current layer to be mapped and the corresponding node mapping range, randomly mapping each group to a node within the mapping range to generate a mapping sequence; step 4, calculating the sum of the average transmission distances of the data packets in the mapping sequence, selecting the mapping sequence with the sum of the average transmission distances less than a threshold value and outputting it to step 5; if the current layer to be mapped is the first layer, the generated mapping sequence is directly output to step 6 ; Step 5, filter the mapping sequence output from step 4 according to the link traffic load constraint, and output the mapping sequence that meets the constraint to step 6; wherein the constraint includes that the load on each used link is less than a preset maximum load threshold, and the number of used links with a load greater than a preset high load threshold is less than a preset number threshold; Step 6, calculate the temperature of each node in each received mapping sequence, and select the mapping sequence with a node temperature less than the threshold as the best mapping for the current neural network layer; Step 7, mark the nodes in the best mapping output from step 6 as used nodes, and mark the neural network layers corresponding to the used nodes as mapped layers; if all neural network layers have been mapped, output the mapping sequence composed of the best mappings of the current layers; otherwise, output the unmapped neural network layers to step 2, and repeat steps 2 to 6 until all neural network layers have been mapped.

[0010] Furthermore, the idle nodes are selected as the mapping range by the following formula:

[0011]

[0012] Among them, R i Indicates the mapping range of the i-th layer network, F i Indicates the idle node number of the i-th layer chip, N g Indicates the number of groups in the current layer, X i Represents the number of remaining nodes in the i-th layer chip.

[0013] Further, the sum of the average transmission distances of the data packets in the mapping sequence is calculated, including: calculating the transmission distance of a single data packet: h = |S x -D x |+S y -D y |+S z -D z |, where the source node coordinates (S x ,Sy ,S z ), the coordinates of the destination node (D x ,D y ,D z ); According to the transmission distance of a single data packet, the sum of the transmission distances of the data packets in the mapping sequence of the i-th neural network layer is calculated: Where ni is the total number of packets sent by the i-th neural network layer.

[0014] Furthermore, the constraint condition expression is as follows: max =MAX(l0,l1,......,l 2L-1 ), Where L is the number of physical links, each physical link is bidirectional, l0,l1,......,l 2L-1 For each link direction, n th is the load threshold in each direction of the link.

[0015] Furthermore, the temperature of each node in each received mapping sequence is calculated, and the expression is as follows:

[0016]

[0017] Among them, TV i is the node; i is the temperature evaluation value, α is the coefficient, d j is the distance between node j and the heat sink; d i,j is the distance between node j and node i.

[0018] Furthermore, the average workload of the neural network layer in step one is obtained by calculating the average computational load, memory access load, and communication load of each group of the corresponding layer of the neural network. Specifically, for each layer of the neural network, the neural network structure parameters of the layer are obtained, including the number of neurons in the layer, the number of connections of each neuron, the amount of weight parameters of each neuron, the type of activation function, etc.; based on the neural network structure parameters, the computational workload of the layer is calculated, specifically including the number of weighted sum operations and activation function calculations of all neurons in the layer; based on the neural network structure parameters, the memory access workload of the layer is calculated, specifically including the number of memory accesses required for all neurons in the layer to read input data, weight parameters, and write back output data; based on the data flow diagram of the neural network, the amount of data interaction between the layer and other layers is calculated as the data flow of the layer. communication workload; for each group, divide the computing workload obtained in step 2, the memory access workload obtained in step 3, and the communication workload obtained in step 4 by the number of neurons in the group, respectively, to obtain the average computing load, average memory access load, and average communication load of each group; sum and average the average computing loads of all groups in the layer to obtain the average computing load of the layer; calculate the average memory access load and average communication load of the layer in the same way; weightedly sum the average computing load, average memory access load, and average communication load obtained in step 6 to obtain the average workload of the layer, where the weight coefficient is pre-set according to the degree of influence of the three load types on system performance.

[0019] Furthermore, in step three, for the current layer to be mapped, the node mapping range output from step two is obtained, and the threshold number of repeated random mappings is determined according to the number of unmapped nodes within the node mapping range; each group of the current layer to be mapped is randomly mapped to an unmapped node to form a random mapping sequence; the random mapping process is repeated until the number of random mapping sequences generated reaches the threshold number of times, and all random mapping sequences are output as candidate mappings.

[0020] Preferably, the number of unmapped nodes n within the node mapping range is counted; the threshold number t of repeated random mapping is calculated according to the formula: t = min (n × α, t_max), wherein α is a mapping range proportional factor, which takes a value between 0 and 1, and t_max is a maximum repetition threshold, which is a preset constant; the candidate mapping set M is initialized as an empty set; an unmapped node is randomly selected from the node mapping range, and a group of the current layer to be mapped is mapped to the node; repeat until all groups of the current layer to be mapped are mapped to unmapped nodes to form a complete random mapping sequence s; add s to the candidate mapping set M; repeat until the number of generated random mapping sequences reaches the threshold number t; output the candidate mapping set M as the candidate mapping of the current layer to be mapped.

[0021] Furthermore, it also includes: before step three, according to the topological structure of the three-dimensional on-chip network, pre-calculating the distance between each node and other nodes, and the distance from each node to the nearest radiator, and storing the calculation results in a lookup table; wherein the distance between nodes is measured using the Manhattan distance; the distance from the node to the nearest radiator is obtained by taking the minimum value of the Manhattan distance from the node to each radiator.

[0022] Specifically, according to the topological structure of the 3D on-chip network, a 3D coordinate system of the network is established, and the 3D coordinates of each node are recorded; for each node i, all other nodes j are traversed, and the Manhattan distance d_ij between node i and node j is calculated: d_ij = |x_i-x_j|+|y_i-y_j|+|z_i-z_j|, where (x_i, y_i, z_i) and (x_j, y_j, z_j) are the 3D coordinates of node i and node j respectively; for each node i, all heat sinks are traversed, and the distance from node i to each heat sink is calculated. Manhattan distance of the heat sink, and find the minimum distance d_i_min as the distance from node i to the nearest heat sink; construct two two-dimensional arrays dist_node and dist_heat to store the distance between nodes and the distance from the node to the nearest heat sink respectively: dist_node[i][j] = d_ij, dist_heat[i] = d_i_min, where i and j are the node numbers; store the dist_node and dist_heat arrays in memory as a lookup table for subsequent steps. In step six, for each candidate mapping sequence, by looking up the dist_node and dist_heat tables, the distance between each node in the mapping and other nodes and the distance to the nearest heat sink can be quickly obtained to calculate the temperature evaluation value of the node.

[0023] Furthermore, when calculating the node temperature in step six, for each candidate mapping sequence, the coordinates of each node in the candidate mapping sequence are obtained, the distance between the node and other nodes, and the distance from the node to the nearest heat sink are obtained by looking up the table, and the temperature evaluation value of the corresponding node is calculated; the temperature evaluation values ​​of all nodes are averaged, and the average temperature evaluation value is used as the temperature cost of the current mapping sequence, and the mapping sequence with the lowest temperature cost and less than the threshold is selected as the optimal mapping of the current neural network layer.

[0024] Preferably, for each candidate mapping sequence, the three-dimensional coordinates of each node therein are obtained; for each node i in the candidate mapping sequence, the table dist_node is looked up to obtain the distance d_ij between the node and other nodes j, and the table dist_heat is looked up to obtain the distance d_i_heat from the node to the nearest heat sink; the temperature evaluation value T_i of node i is calculated according to the formula: T_i=∑_(j≠i)P_j / (d_ij+ε)-λ×d_i_heat, where P_j is the power consumption of node j, ε is a small constant used to avoid the denominator being zero, and λ is a heat dissipation factor, which represents the degree of influence of the heat sink on the node temperature; for all nodes in the candidate mapping sequence, the weighted temperature evaluation values ​​thereof are calculated. Average value T_avg: T_avg = (∑_(i=1)^nw_i×T_i) / (∑_(i=1)^nw_i), where n is the number of nodes in the candidate mapping sequence, w_i is the weight of node i, which can be set according to factors such as the power consumption and number of connections of the node; T_avg is used as the temperature cost of the current candidate mapping sequence; the temperature costs of all candidate mapping sequences are calculated; among the candidate mapping sequences whose temperature costs are less than the preset threshold T_max, the mapping sequence with the lowest temperature cost is selected as the optimal mapping of the current neural network layer; if the temperature costs of all candidate mapping sequences are greater than or equal to T_max, the value of T_max is relaxed and repeated until a suitable optimal mapping is found.

[0025] Furthermore, before step 2, according to the computational graph of the neural network, for each layer, the parallelism of all groups in each layer is counted, and the parallelism represents the number of tasks that can be executed in parallel in each group; and the average parallelism of the corresponding layer is calculated; according to the topological structure of the on-chip network, for each node in the mapping range, the number of processing units of the node is counted as the parallelism of the corresponding node; when generating a random mapping sequence, for each group of the current layer to be mapped, a node with a parallelism greater than a threshold and a minimum absolute value of the difference between the parallelism of the corresponding group is selected from the mapping range for mapping, so as to improve the parallelism matching between the neural network layer and the on-chip network node.

[0026] Preferably, if after multiple iterations, it is still not possible to find a suitable mapping for all neural network layers, a recursive backtracking method is used to reconsider the mapping selection of the previous layer and try to find a global optimal solution. Specifically, starting from the last neural network layer that cannot find a suitable mapping, mark it as the current layer to be adjusted, and record its mapping result and corresponding mapping cost as the backtracking point; recursively backtrack to the previous neural network layer, mark it as the current layer to be adjusted, and record its original mapping result and corresponding mapping cost as the new backtracking point; within the mapping range of the current layer to be adjusted, select a new mapping different from the original mapping result, and calculate the cost of the new mapping; if the cost of the new mapping is better than the cost recorded at the backtracking point, update the mapping result of the current layer to be adjusted to the new mapping, and based on the new mapping, repeat steps 2 to 6 to try to complete the mapping of the remaining neural network layers; if after updating the mapping of the current layer to be adjusted, still no suitable mapping can be found, backtrack, select another new mapping within the mapping range of the current layer to be adjusted, and repeat the execution; if all possible mappings of the current layer to be adjusted have been tried and still no suitable mapping can be found, backtrack, recursively backtrack to the next previous neural network layer, mark it as the new current layer to be adjusted, and continue to try different mapping options; repeat the execution until a feasible global mapping is found, or the preset upper limit of the backtracking times is reached.

[0027] 3. Beneficial effects

[0028] Compared with the prior art, the advantages of this application are:

[0029] By sorting the neural network layers according to the average workload and mapping the layers with the highest load first, potential hot spots can be eliminated in the early stages of mapping and sufficient cooling resources can be reserved for the layers with heavier loads, thereby effectively controlling the chip temperature.

[0030] By defining a mapping range around the chip heat sink and mapping the high-load layer to the area with good heat dissipation effect first, the cooling capacity of the heat sink can be fully utilized to reduce the peak temperature and temperature gradient of the chip.

[0031] The mapping sequence is generated by random mapping and iterative optimization. Under the premise of satisfying the transmission distance constraint, the solution space is expanded through multiple random attempts to improve the probability of finding the optimal mapping.

[0032] Link traffic load constraints are introduced to screen the mapping sequence. By controlling the upper limit of single link load and the number of high-load links, the traffic distribution of the on-chip network can be balanced, local congestion can be alleviated, and communication delay can be reduced.

[0033] Using the node temperature as the final evaluation indicator, the optimal thermal distribution mapping scheme is screened out, which can minimize the overall temperature level of the chip while meeting performance requirements, thereby improving the stability and reliability of the system.

[0034] A hierarchical recursive mapping strategy is adopted to mark the used resources in each round of mapping, and dynamically adjust the optimization direction and resource constraints of subsequent layers. It can gradually approach the global optimum based on the local optimum and achieve a balance between mapping effect and computational efficiency.

[0035] By grouping the workload of each layer of the neural network and considering multi-dimensional loads such as computing, memory access, and communication, we can more comprehensively evaluate the resource requirements of each layer and provide a reasonable granularity and basis for subsequent mapping. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is a flowchart of optimal mapping exploration according to some embodiments of this specification;

[0037] Figure 2 is a schematic diagram of neural network group mapping according to some embodiments of this specification;

[0038] Figure 3 is a graph showing the relationship between network injection rate and delay according to some embodiments of the present specification;

[0039] Figure 4 is a schematic diagram of link load according to some embodiments of this specification;

[0040] Figure 5 is a graph showing changes in average temperature in a VGG16 simulation according to some embodiments of this specification;

[0041] Figure 6 is a graph showing changes in temperature variance in a VGG16 simulation according to some embodiments of this specification;

[0042] Figure 7 is a graph showing the variation of the maximum temperature in a VGG16 simulation according to some embodiments of the present specification;

[0043] Figure 8 is a diagram of temperature ranges of different nodes at the end of a VGG16 simulation according to some embodiments of this specification. DETAILED DESCRIPTION

[0044] The present application is described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0045] A mapping method for a neural network accelerator based on a three-dimensional network on chip, comprising: step one, grouping the workload of each layer of the neural network; wherein the workload includes a computing load, a memory access load and a communication load; step two, sorting the neural network layers according to the average workload size of each layer, and the layer with the highest average workload has the highest mapping priority; in the chip corresponding to the layer with the highest mapping priority, selecting the idle nodes within the preset range of the radiator as the mapping range; step three, randomly mapping each group to a node within the mapping range according to the current layer to be mapped and the corresponding node mapping range, and generating a mapping sequence; step four, calculating the sum of the average transmission distances of the data packets in the mapping sequence, selecting the mapping sequence with the sum of the average transmission distances less than a threshold value and outputting it to step five; if the current layer to be mapped is the first layer, the generated mapping sequence is directly output to step six; step 5. Filter the mapping sequence output from step 4 according to the link traffic load constraint, and output the mapping sequence that meets the constraint to step 6; wherein the constraint includes that the load on each used link is less than a preset maximum load threshold, and the number of used links with a load greater than a preset high load threshold is less than a preset number threshold; step 6. Calculate the temperature of each node in each received mapping sequence, and select the mapping sequence with a node temperature less than the threshold as the best mapping for the current neural network layer; step 7. Mark the nodes in the best mapping output from step 6 as used nodes, and mark the neural network layers corresponding to the used nodes as mapped layers; if all neural network layers have been mapped, output the mapping sequence composed of the best mappings of the current layers; otherwise, output the unmapped neural network layers to step 2, and repeat steps 2 to 6 until all neural network layers have been mapped.

[0046] This embodiment provides an optimal mapping exploration system for a neural network accelerator based on a three-dimensional network on chip, and its workflow is as follows: Figure 1 First, the system needs to group the workload of each layer of the neural network evenly and input the grouping results into the system. This step can refer to Figure 2 The schematic diagram shown divides the computational tasks of the neural network layer into multiple groups with similar loads, laying the foundation for subsequent mapping.

[0047] Next, the system sorts the layers according to their average load, mapping the layers with higher loads first. In the first processing, since no mapping has been done yet, the system can directly select the best solution from a series of randomly generated mappings by evaluating the thermal effects of nodes under different mapping sequences. After selecting the best mapping, the system updates the set of mapped layers and used nodes, marking them as unavailable.

[0048] For subsequent layers, after generating the random mapping sequence, the system needs to go through two more steps for further screening. The first step is to limit the average transmission distance of the data packet to optimize the network latency. This is because the communication latency of the on-chip network is closely related to the data transmission distance, and reducing the transmission distance can significantly improve the system performance.

[0049] The second step is to limit the link load level and the number of high-load links. Figure 3 As shown in Figure 1, there is an exponential relationship between network latency and link load. When the load exceeds a certain threshold, a small increase in traffic will cause a sharp increase in latency, which in turn causes congestion. Therefore, it is necessary to control the link load to avoid hot spots while ensuring communication performance. Figure 4 A schematic diagram of link load control is shown, which achieves balanced distribution of network traffic by setting a reasonable load upper limit and constraints on the number of high-load links.

[0050] After completing the above two steps of screening, the system will evaluate the thermal effect of the nodes under the remaining mapping sequence, select the best mapping, and update the status of the mapped layers and used nodes. If all neural network layers have been mapped at this time, the best mapping sequence for the entire network will be output; otherwise, the system will continue to perform the above mapping optimization process on the remaining layers until all layers are mapped.

[0051] Through this hierarchical recursive mapping strategy and refined thermal perception optimization, this embodiment can comprehensively consider multiple factors such as load balancing, delay control and temperature management, and quickly search for the optimal or suboptimal solution in a large number of mapping solutions. Compared with the existing technology, this system can significantly improve the performance and energy efficiency of the three-dimensional on-chip network neural network accelerator, and provide new ideas and methods for the efficient deployment of complex deep learning applications.

[0052] In order to verify the effectiveness of the mapping exploration system proposed in the present invention in improving the effect of the 3D network-on-chip neural network accelerator, this embodiment conducted a comparative experiment on different mapping methods on the Access Noxim simulation platform. Access Noxim is a simulation environment that integrates the NoC simulator Noxim and the architecture-level thermal model Hotspot, which can simultaneously evaluate the communication performance and temperature distribution of the system.

[0053] In the experiment, we adopted a 3D mesh topology of 884, the input buffer depth of each router was 4 flits, and the size of the data packet transmitted in the network was 8 flits. The routing algorithm used in the simulation was XYZ dimensional order routing, that is, the data packet was routed in the X direction first, then in the Y direction, and finally reached the destination in the Z direction. The initial temperature of the chip was set to 65°C, and the total simulation time was 3*106 cycles, of which the warm-up time was 105 cycles. The number of multiplication and accumulation units (MACs) of each processing element (PE) was set to 256.

[0054] In order to fully evaluate the performance of the mapping strategy, we selected several classic convolutional neural networks as test cases, including AlexNet, VGG11, VGG13, and VGG16. The simulation trace data of these networks comes from a high-level abstract model that uses a fully expanded pipeline data flow similar to Tianji Core and processes the output of PE in parallel in the channel dimension.

[0055] In the experiment, we compared the mapping strategy of the present invention with three other common mapping strategies, namely: Random mapping: randomly mapping the neural network layer to the on-chip network node without considering any optimization objectives. Exhaustive neural network-aware mapping: exhaustively search all possible mapping schemes, count the communication volume on each link, and select the mapping with the smallest maximum link load as the optimal solution. Mapping based on cost model: map the neural network layers in the original order, similar to the sequential execution of traditional applications. At the same time, a cost function is used to weigh heat dissipation and communication delay, and the mapping with the lowest cost is selected.

[0056] In contrast, the mapping exploration system of the present invention adopts a hierarchical recursive strategy. When mapping each layer of the network, a series of random mappings are first generated, and then the optimal mapping is gradually screened out by limiting the data transmission distance, link load level, and the number of high-load links, combined with thermal effect evaluation. This fine-grained hierarchical optimization method can significantly reduce the search space and computational complexity while balancing multiple objectives.

[0057] By conducting comparative experiments on different mapping strategies on a unified simulation platform and using industry-standard neural networks as test cases, this embodiment fully verifies the effectiveness and superiority of the proposed mapping exploration system. The experimental results show that the system can effectively control chip power consumption and temperature while ensuring inference performance, providing a reliable solution for the efficient deployment of complex deep learning applications on 3D on-chip network accelerators.

[0058] Specifically, this embodiment compares and analyzes the performance of the mapping strategy (TTNNM) of the present invention and the other three mapping strategies in terms of average temperature, temperature variance, maximum temperature, and average packet delay for different neural network models. The specific results are as follows: For AlexNet and VGG11 networks, compared with random mapping, exhaustive perceptual mapping, and cost model-based mapping, TTNNM reduces the average temperature by 4.0°C, 3.0°C, and 4.0°C, respectively, and the temperature variance is reduced by 70.6%, 70.4%, and 81.7%, the maximum temperature is reduced by 11.8°C, 11.2°C, and 15.6°C, and the packet delay is reduced by 31.6%, 21.5%, and 23.8%.

[0059] For the VGG13 network, TTNNM reduces the average temperature by 5.1℃, 1.1℃, and 1.9℃, the temperature variance by 69.2%, 46.3%, and 56.9%, the maximum temperature by 11.4℃, 0.1℃, and 1.1℃, and the packet delay by 31.8%, 19.2%, and 16.6%.

[0060] For the VGG16 network, TTNNM reduces the average temperature by 5.2℃, 3.6℃, ​​and 5.3℃, the temperature variance by 47.3%, 45.0%, and 60.3%, the maximum temperature by 6.4℃, 6.6℃, and 13.2℃, and the packet delay by 59.4%, 38.7%, and 64.4%.

[0061] It can be seen that the mapping strategy of the present invention has achieved significant optimization effects in various indicators. In particular, TTNNM performs particularly well in controlling chip temperature and heat distribution uniformity. Taking the VGG16 network as an example, Figure 5 , 6 , 7 show the dynamic changes of the average temperature, temperature variance and maximum temperature during the whole simulation process. The results show that TTNNM always maintains the average temperature and temperature variance at the lowest level throughout the simulation, and can effectively suppress the rising trend of the maximum temperature, reflecting its excellent thermal management capabilities.

[0062] Figure 8 We further counted the number of nodes in different temperature ranges on the chip at the end of the VGG16 network simulation. Compared with the exhaustive perceptual mapping, TTNNM significantly reduces the number of nodes in the high temperature range, and the temperature distribution is more concentrated in the safe temperature range. This helps to avoid device aging and performance degradation caused by local overheating.

[0063] In summary, this embodiment fully demonstrates the effectiveness of the neural network mapping exploration system of the present invention in optimizing the performance and thermal management of the three-dimensional on-chip network accelerator through detailed simulation experiments. Compared with traditional mapping strategies, TTNNM can significantly improve the communication performance of the system while reducing the average chip temperature and temperature fluctuations.

[0064] The invention of the present application and its implementation methods are described schematically above. The description is not restrictive. Without departing from the spirit or basic features of the present application, the present application can be implemented in other specific forms. What is shown in the accompanying drawings is only one of the implementation methods of the invention of the present application. The actual structure is not limited to this. Any figure mark in the claims should not limit the claims involved. Therefore, if a person of ordinary skill in the art is inspired by it, without departing from the purpose of the present invention, a structural method and an embodiment similar to the technical solution are designed without creativity, which should all fall within the scope of protection of this patent. In addition, the word "including" does not exclude other elements or steps, and the word "one" before the element does not exclude the inclusion of "multiple" elements. The multiple elements stated in the product claim can also be implemented by one element through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.

Claims

1. A mapping method for a neural network accelerator based on a three-dimensional network on chip, comprising: Step 1: group the workload of each layer of the neural network; the workload includes computing load, memory access load and communication load; Step 2: Sort the neural network layers according to the average workload size of each layer, and the layer with the highest average workload has the highest mapping priority; in the chip corresponding to the layer with the highest mapping priority, select the idle nodes within the preset range of the heat sink as the mapping range; Step 3: According to the current layer to be mapped and the corresponding node mapping range, each group is randomly mapped to a node within the mapping range to generate a mapping sequence; Step 4, calculate the sum of the average transmission distances of the data packets in the mapping sequence, select the mapping sequence whose sum of the average transmission distance is less than the threshold and output it to step 5; if the current layer to be mapped is the first layer, the generated mapping sequence is directly output to step 6; Step 5: filter the mapping sequence outputted from step 4 according to the link traffic load constraint condition, and output the mapping sequence satisfying the constraint condition to step 6; wherein the constraint condition includes that the load on each used link is less than a preset maximum load threshold, and the number of used links with a load greater than a preset high load threshold is less than a preset number threshold; Step 6, calculating the temperature of each node in each received mapping sequence, and selecting the mapping sequence with the node temperature less than the threshold as the best mapping of the current neural network layer; Step seven, mark the nodes in the best mapping output in step six as used nodes, and mark the neural network layers corresponding to the used nodes as mapped layers; if all neural network layers have been mapped, output the mapping sequence composed of the best mappings of the current layers; otherwise, output the unmapped neural network layers in step two, and repeat steps two to six until all neural network layers have been mapped.

2. The mapping method of a neural network accelerator based on a three-dimensional network on chip according to claim 1, characterized in that: The free nodes are selected as the mapping range by the following formula: Among them, R i Indicates the mapping range of the i-th layer network, F i Indicates the idle node number of the i-th layer chip, N g Indicates the number of groups in the current layer, X i Represents the number of remaining nodes in the i-th layer chip.

3. The mapping method of a neural network accelerator based on a three-dimensional network on chip according to claim 1, characterized in that: Calculate the sum of the average transmission distances of the data packets in the mapping sequence, including: Calculate the transmission distance of a single data packet: h=|S x -D x |+|S y -D y |+|S z -D z | Among them, the source node coordinates (S x ,S y ,S z ), the coordinates of the destination node (D x ,D y ,D z ); According to the transmission distance of a single data packet, the sum of the transmission distances of the data packets in the mapping sequence of the i-th neural network layer is calculated: Where ni is the total number of packets sent by the i-th neural network layer.

4. The mapping method of a neural network accelerator based on a three-dimensional network on chip according to claim 1, characterized in that: The constraint expressions are as follows: l max =MAX(l0,l1,......,l 2L-1 ) Where L is the number of physical links, each physical link is bidirectional, l0,l1,......,l 2L-1 For each link direction, n th is the load threshold in each direction of the link.

5. The mapping method of the neural network accelerator based on the three-dimensional network on chip according to claim 1, characterized in that: Calculate the temperature of each node in each received mapping sequence. The expression is as follows: Among them, TV i is the node; i is the temperature evaluation value, α is the coefficient, d j is the distance between node j and the heat sink; d i,j is the distance between node j and node i.

6. The mapping method of a neural network accelerator based on a three-dimensional network on chip according to claim 1, characterized in that: The average workload of the neural network layer in step 1 is obtained by calculating the average computational load, memory access load, and communication load of each group of the corresponding layer neural network.

7. The mapping method of a neural network accelerator based on a three-dimensional network on chip according to any one of claims 1 to 6, characterized in that: In step 3, for the current layer to be mapped, the node mapping range output in step 2 is obtained, and the threshold of the number of repeated random mappings is determined according to the number of unmapped nodes in the node mapping range; Randomly map each group of the current to-be-mapped layer to an unmapped node to form a random mapping sequence; The random mapping process is repeated until the number of generated random mapping sequences reaches the number threshold, and all random mapping sequences are output as candidate mappings.

8. The mapping method of the neural network accelerator based on the three-dimensional network on chip according to claim 7, characterized in that: Also includes: Before step three, based on the topological structure of the three-dimensional on-chip network, the distance between each node and other nodes and the distance from each node to the nearest heat sink are pre-calculated, and the calculation results are stored in a lookup table; the distance between nodes is measured using the Manhattan distance; the distance from a node to the nearest heat sink is obtained by taking the minimum value of the Manhattan distance from the node to each heat sink.

9. The mapping method of a neural network accelerator based on a three-dimensional network on chip according to claim 8, characterized in that: When calculating the node temperature in step 6, for each candidate mapping sequence, obtain the coordinates of each node in the candidate mapping sequence, obtain the distance between the node and other nodes, and the distance from the node to the nearest heat sink by looking up the table, and calculate the temperature evaluation value of the corresponding node; The temperature evaluation values ​​of all nodes are averaged, and the average temperature evaluation value is used as the temperature cost of the current mapping sequence. The mapping sequence with the lowest temperature cost and less than the threshold is selected as the best mapping of the current neural network layer.

10. The mapping method of a neural network accelerator based on a three-dimensional network on chip according to claim 9, characterized in that: Before step 2, according to the computational graph of the neural network, for each layer, the degree of parallelism of all groups in each layer is counted. The degree of parallelism represents the number of tasks that can be executed in parallel in each group. The average degree of parallelism of the corresponding layer is calculated. According to the topological structure of the on-chip network, for each node in the mapping range, the number of processing units of the node is counted as the parallelism of the corresponding node; When generating a random mapping sequence, for each group of the current layer to be mapped, a node with a parallelism greater than a threshold and a minimum absolute value of the difference between the parallelism of the corresponding group is selected from the mapping range for mapping, so as to improve the parallelism matching between the neural network layer and the on-chip network nodes.

Citation Information

Cited By

  • Reconfigurable network-on-chip of data stream accelerator

    CN120670367A