Neural network accelerator data transmission method and device based on outward spiral algorithm

Through the neural network accelerator data transmission method based on the outward spiral algorithm, the problems of insufficient flexibility and large data transmission overhead are solved, and efficient data transmission and processing unit utilization is achieved, which is suitable for large-scale industrial-grade neural network accelerators Chip design.

CN117852599BActive Publication Date: 2024-11-01UNIV OF CHINESE ACAD OF SCI
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410035152.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-10
Publication Date
2024-11-01
Estimated Expiration
2044-01-10

AI Technical Summary

Technical Problem

The existing neural network accelerators lack flexibility in processing neural networks, low utilization rate of processing unit arrays, and excessive overall data transmission overhead, making it difficult to meet the efficient training and processing needs of large-scale artificial intelligence and deep learning applications.

Method used

Adopt the neural network accelerator data transmission method based on the outward helical algorithm. By obtaining the logical processing element set, iteratively segmenting and mapping it to the physical processing element array, and optimizing data transmission using discrete two-dimensional grid algorithm to achieve efficient data reuse and low overhead transmission. .

Benefits of technology

Improves the flexibility of data flow and processing unit utilization, reduces data transmission overhead, and is suitable for large-scale industrial-grade neural network accelerator chip design, with high performance and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117852599B_ABST
    Figure CN117852599B_ABST
Patent Text Reader

Abstract

The present invention discloses a neural network accelerator data transmission method and device based on an outward spiral algorithm, comprising the following steps: step S1, obtaining a logical PE set; step S2, iteratively segmenting the logical PE set; step S3, mapping the segmented logical PE set to a physical PE array; step S4, transmitting the initial parameters of the neural network to be trained from an off-chip memory to the physical PE array and accelerating the calculation. The technical solution of the present invention overcomes the shortcomings of the existing neural network accelerator in processing neural networks, such as insufficient flexibility, low PE array utilization, and excessive overall data transmission overhead, and can be effectively applied to the design of large-scale industrial-grade neural network accelerator chips.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and in particular relates to a neural network accelerator data transmission method and device based on an outward spiral algorithm. Background Art

[0002] Artificial Intelligence (AI) is a branch of computer science that aims to develop machines and programs that can simulate human intelligence. In the late 1980s, the improvement of computing power and the study of complex mathematical models promoted the rapid development of the AI ​​paradigm represented by Machine Learning (ML). Machine learning can make autonomous decisions based on previous learning and current scenarios, and solve complex AI problems with more advanced algorithms, showing a promising research path. Various algorithms are used in the machine learning process, such as regression algorithms, decision trees, support vector machines, clustering algorithms, and neural networks.

[0003] Neural Networks (NN) not only outperform other ML algorithms, but also approximate human intelligence to some extent in specific tasks, such as image classification on the ImageNet dataset. The above results have prompted researchers to study the structure of neural networks in more depth, and further design and implement more complex neural networks with large-scale parameters, network layers, and computing operations. These networks are classified as deep neural networks (DNN). DNN can be further subdivided into structured network technologies for different application scenarios, such as recurrent neural networks (RNN) that focus on natural language processing. At present, artificial intelligence applications based on neural networks have been deployed in various fields such as agriculture, medicine, commerce, networking, autonomous driving, and computer vision.

[0004] As Moore's Law gradually fails, the performance improvement of general-purpose processors slows down at a foreseeable rate, and domain-specific architecture (DSA) is becoming a research focus in the field of artificial intelligence. Due to the widespread application of machine learning, especially neural networks in artificial intelligence tasks, and considering the computational complexity represented by a large number of repeated convolution operations and data transmission that are common in current large-scale neural network models, performance acceleration and optimization of neural networks have become the primary research goal. In order to solve the above problems, many researchers have turned their attention to neural network accelerators, and hope to efficiently train and run neural networks on various hardware platforms such as graphics processing units (GPUs), field programmable gate arrays (FPGAs), and application-specific integrated circuits (ASICs). Hardware accelerator designs for artificial intelligence have sprung up in an attempt to find a satisfactory compromise between processing performance and accuracy.

[0005] The data flow in a neural network accelerator reflects the core operations of the accelerator and the data transfer mapping, which usually determines the overall performance and power consumption of the accelerator. Variable neural network layer shapes are a big challenge for hardware architects because they cause changes in a key feature of neural networks - data reuse. Most neural network accelerators rely on data reuse to improve computational efficiency. For three data types in deep neural network layers, input activations (IActs), weights (Weights), and partial sums (PSums), the amount of data reuse for each is a function of layer shape and size. For example, the amount of input activation reuse is positively correlated with the number of output channels and the filter size in the layer. Therefore, the reduction in data dimensionality means that it is more difficult to exploit data reuse from any specific dimension. Many existing neural network accelerators rely on a set of pre-selected data dimensions to achieve high performance by leveraging high parallelism and data reuse between processing unit arrays.

[0006] The spatial accumulation array architecture is usually applicable to the weight stationary (WS) data flow, which uses the parallelism of output and input channels to map the computation space of the neural network layer onto the processing element (PE) array. At the same time, for weights from different output channels, each input activation can be reused vertically in the processing element array, and the partial sums from the processing elements in the same row can be accumulated together before being written back to the global buffer; Similarly, the temporal accumulation array architecture applicable to the output stationary (OS) data flow relies on another set of data dimensions. In this design, each input activation is still reused vertically between different processing elements in the same column, while each weight is reused horizontally between different processing elements in the same row; the row stationary (RS) data flow is an advanced energy-saving data flow. Unlike the output and weight stationary data flows, the row stationary data flow maximizes the reuse of partial sums in the input feature map, weights, and computation of three-dimensional convolution, thereby improving the utilization of computing units. The row stationary data flow is one of the most flexible data flows, which can implement various data flattening methods in convolution operations, including the height and channel direction of the input feature map and weights.

[0007] By adopting appropriate data flow patterns, neural network accelerators can improve training efficiency by maximizing local data reuse to reduce data transmission overhead during deep convolutional neural network training. However, the mapping strategies used by existing neural network accelerators cannot be applied to neural network layers of any scale, the utilization efficiency of PE units in the processing unit array is low, and the neural network calculation and training overhead is large. These problems limit the further application of neural network accelerators. In summary, the data transmission technology of traditional neural network accelerators has inherent defects, and the existing methods are not sufficient to meet the efficient training and processing of large-scale artificial intelligence and deep learning applications on neural network accelerators. Summary of the invention

[0008] The technical problem to be solved by the present invention is to provide a neural network accelerator data transmission method and device based on an outward spiral algorithm, which overcomes the shortcomings of existing neural network accelerators in processing neural networks, such as insufficient flexibility, low PE array utilization, and excessive overall data transmission overhead, and can be effectively applied to the design of large-scale industrial-grade neural network accelerator chips.

[0009] To achieve the above object, the present invention adopts the following technical solution:

[0010] A neural network accelerator data transmission method based on an outward spiral algorithm comprises the following steps:

[0011] Step S1, obtaining a logical PE set;

[0012] Step S2, iteratively splitting the logical PE set;

[0013] Step S3, mapping the segmented logical PE set to the physical PE array;

[0014] Step S4: transfer the initial parameters of the neural network to be trained from the off-chip memory to the physical PE array and accelerate the calculation.

[0015] Preferably, in step S1, a logical PE set is generated based on initial parameters of the neural network CONV layer and the neural network accelerator PE array.

[0016] Preferably, in step S2, the logical PE set is iteratively partitioned based on a complete column mapping that maximizes PE array utilization.

[0017] Preferably, in step S3, the segmented logical PE set is mapped to the physical PE array based on an outward spiral algorithm of a discrete two-dimensional grid.

[0018] The present invention also provides a neural network accelerator data transmission device based on an outward spiral algorithm, comprising:

[0019] An acquisition module, used to acquire a logical PE set;

[0020] A segmentation module, used for iteratively segmenting the logical PE set;

[0021] A mapping module, used for mapping the segmented logical PE set to a physical PE array;

[0022] The computing module is used to transfer the initial parameters of the neural network to be trained from the off-chip memory to the physical PE array and accelerate the calculation.

[0023] Preferably, the acquisition module generates a logical PE set based on initial parameters of the neural network CONV layer and the neural network accelerator PE array.

[0024] Preferably, the partitioning module iteratively partitions the logical PE set based on a complete column map that maximizes PE array utilization.

[0025] Preferably, the mapping module maps the segmented logical PE set to the physical PE array based on an outward spiral algorithm of a discrete two-dimensional grid.

[0026] The present invention maps convolution (CONV) layers of any size to PE arrays of any size to improve data flow flexibility, generates a logical PE set according to neural network layer parameters and neural network accelerator types, and reasonably divides it into multiple complete columns and partial columns. The divided logical PE set is then mapped to the physical PE array in a manner that satisfies the lowest possible data transmission overhead, reducing data handling overhead while ensuring high PE unit utilization and high data reuse rate. This solution makes full use of the data reuse of input feature maps, filter weights, and accumulated partial sums, and stores the filter weights participating in the same accumulated partial sum in a fixed manner in a specified PE unit, while reducing the transmission overhead of the accumulated partial sum between PE arrays.

[0027] The present invention does not require additional analysis of whether the CONV layer of the neural network matches the physical PE array of the neural network accelerator, which greatly reduces the processing difficulty of artificial intelligence applications; it has general scalability and high performance for the neural network benchmark test set widely recognized by the academic community, and the core algorithm of data transmission has good scalability; it can be applied to the design of large-scale industrial-grade neural network accelerator chips, and has industrial application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0029] Figure 1 It is a schematic diagram of the implementation process of the data transmission technology of the neural network accelerator based on the outward spiral algorithm;

[0030] Figure 2 A schematic diagram of the implementation process for generating a logical PE set based on the initial parameters of the neural network CONV layer and the neural network accelerator PE array;

[0031] Figure 3 Generate a schematic for mapping the CONV1 layer of AlexNet to the logical PE set of a row-fixed dataflow neural network accelerator with an 8×8 physical PE array;

[0032] Figure 4 A schematic diagram of a specific implementation process for iteratively partitioning a logical PE set based on a complete list map that maximizes PE array utilization;

[0033] Figure 5 Generate a schematic diagram for the iterative partitioning of the 11×55 logical PE set corresponding to the CONV1 layer of AlexNet;

[0034] Figure 6 A schematic diagram of the implementation process of mapping the partitioned logical PE set to the physical PE array based on the outward spiral algorithm of the discrete two-dimensional grid;

[0035] Figure 7 Schematic diagram of a row-fixed data flow neural network accelerator that fully maps the 11×55 logical PE set corresponding to the CONV1 layer of AlexNet to an 8×8 physical PE array;

[0036] Figure 8 A schematic diagram of a process flow for transferring the initial parameters of a neural network to be trained from an off-chip memory to a physical PE array and accelerating the calculation based on the above mapping method;

[0037] Fig. 9 Schematic diagram of filter weight transmission of the complete mapping of the 11×55 logical PE set corresponding to the CONV1 layer of AlexNet to the row-fixed data flow neural network accelerator with an 8×8 physical PE array;

[0038] Fig.10 The output part and transmission diagram of the row-fixed data flow neural network accelerator with an 8×8 physical PE array, in which the 11×55 logical PE set corresponding to the CONV1 layer of AlexNet is completely mapped to the output part of the row-fixed data flow neural network accelerator with an 8×8 physical PE array. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0040] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0041] Embodiment 1:

[0042] like Figure 1 As shown, an embodiment of the present invention provides a neural network accelerator data transmission method based on an outward spiral algorithm, comprising:

[0043] Step S1, generating a logical PE set based on the initial parameters of the neural network CONV layer and the neural network accelerator PE array;

[0044] Step S2, iteratively partitioning the logical PE set based on the complete column mapping that maximizes the PE array utilization;

[0045] Step S3, mapping the segmented logical PE set to the physical PE array based on the outward spiral algorithm of the discrete two-dimensional grid;

[0046] Step S4: transfer the initial parameters of the neural network to be trained from the off-chip memory to the physical PE array and accelerate the calculation.

[0047] As an implementation method of the embodiment of the present invention, Figure 2 As shown, step S1 specifically includes:

[0048] S11, analyze the structure of the CONV layer of the neural network to be processed and the PE array of the neural network accelerator to obtain the input feature map length / width (L i ), filter weight length / width (L f ) and step length (L s ), and the length of the neural network accelerator PE array (L pa ) and width (W pa ).

[0049] S12, generate the length (L) of the logical PE set based on the initial parameters of the neural network CONV layer obtained in the previous step ps ) and width (W ps ) and obtain a complete initial logical PE set.

[0050] Figure 3 The results of mapping the CONV1 layer of AlexNet to the logical PE set generation of a row-fixed dataflow neural network accelerator with an 8×8 physical PE array are shown. The input feature map size is 227×227, the filter weight size is 11×11, and the step size is 4. Based on the above conditions, a logical PE set with a width of 11 and a length of 55 is generated.

[0051] As an implementation method of the embodiment of the present invention, Figure 4 As shown, step S2 specifically includes:

[0052] S21, analyze the logical PE set size (S ps ) and the physical PE array size (S pa ). Multiply the length and width of the neural network accelerator PE array to get the physical PE array size (S pa =W pa ×L pa ), multiply the length and width of the logical PE set to get the logical PE set size (S ps =W ps ×L ps ). Compare the logical PE set and the physical PE array size. If the logical PE set size S ps Greater than or equal to the physical PE array size Spa (S ps ≥S pa ), it means that the logical PE set has not been completely split, and the process goes to sub-step 2; otherwise, the logical PE set has been split, and the process goes to step 3.

[0053] S22, split the logical PE set based on the complete column mapping that maximizes the PE array utilization. ps ×L ps The logical PE set is divided into complete mapping and partial mapping. The complete mapping consists of complete columns and remaining PE units. symbol Indicates rounding down, the number of remaining PE units N rp =S pa %W ps , the symbol % indicates the modulo operation; the partial mapping consists of the remaining complete columns, and the number of remaining complete columns If the number of complete columns N remaining rc =0, we get N m Sub-complete mapped object symbol Indicates rounding up; if the number of complete columns N remaining rc >0, get N m The object of a complete mapping and a partial mapping. Each complete mapping will be N c The PE columns and N rp The logical PE units are mapped to the physical PE array. At this time, the utilization rate of the PE array is 100%; partial mapping rc The PE columns of the logical PE set are mapped to the physical PE array. At this time, the utilization rate of the PE array is N rc ×W ps / S pa .

[0054] S23, update the logical PE set parameters and perform iterative segmentation. rp = 0, the logical PE set segmentation ends and the process goes to step S3; if the number of remaining PE units N rp > 0, then update the logical PE set parameters according to the above segmentation results, where the logical PE set length L ps =N m , logical PE set width W ps =W ps —N rp , and returns to sub-step S21 to continue segmenting the updated logical PE set until N rp =0.

[0055] Figure 5The iterative segmentation results of the 11×55 logical PE set corresponding to the CONV1 layer of AlexNet are shown. Figure 5 (a) shows that 9 sets of complete mappings and 1 set of partial mappings are generated during the first segmentation process, where each set of complete mappings consists of 5 complete columns of logical PE sets and PE units of 9 logical PE sets, and the partial mapping consists of 1 complete column of logical PE sets. Figure 5 (b) shows that after the first split, the length and width of the logical PE set are updated to 9 and 2 respectively and enter the next iterative split operation.

[0056] The outward spiral algorithm based on discrete two-dimensional grid proposed in the present invention regards the physical PE array as a discrete two-dimensional grid, determines the spiral center coordinates and spiral direction according to the length and width of the physical PE array, and further maps the segmented logical PE set to the physical PE array, which can make full use of the data reuse characteristics of the neural network. Through the outward spiral algorithm based on discrete two-dimensional grid, the automatic generation of data mapping and transmission schemes for neural network accelerators can be achieved.

[0057] As an implementation method of the embodiment of the present invention, Figure 6 As shown, step S3 specifically includes:

[0058] Step S31, determine the spiral center and spiral direction. Consider the physical PE array as a discrete two-dimensional grid, and determine the spiral center coordinates (x, y) according to the length and width of the physical PE array, where if Then the initial spiral direction is downward; otherwise, the initial spiral direction is right.

[0059] Step S32: Set the logical PE set width W ps Set the spiral step length to S, and start from the spiral center of the physical PE array in a counterclockwise direction and divide it into several strips of length S until the number of remaining PE units is less than S.

[0060] Step S33: add serial number S to each strip in the order of generation. i (i=1,2,…,N c ), which corresponds to the complete column of the logical PE set, part of the logical PE unit and the remaining complete column.

[0061] Figure 7The results of the complete mapping of the 11×55 logical PE set corresponding to the CONV1 layer of AlexNet to the row-fixed data flow neural network accelerator with an 8×8 physical PE array are shown. PE units with the same filling format belong to the same complete column in the logical PE set, and the PE units represented by the cross-line grid belong to partial PE units in the same column of the logical PE set. This complete mapping maps 5 complete columns of logical PE sets and 9 PE units of logical PE sets to the 8×8 physical PE array, and the utilization rate of the PE array is 100%.

[0062] As an implementation method of the embodiment of the present invention, Figure 8 As shown, step S4 specifically includes

[0063] Step S41: L f The initial filter weights of the group are deployed from the off-chip dynamic random access memory (DRAM) to the sequence number S according to the spiral mapping strategy. 1 In the PE spiral strip.

[0064] Step S42: L f The initial filter weights of the group are from S 1 The PE spiral strips are transmitted to other corresponding PE spiral strips through the PE array on-chip network (Network on Chip, referred to as NoC) according to the shortest routing algorithm. Specifically, suppose that the coordinates of two PE units P1 and P2 with the same filter weight on the physical PE array are (x 1 ,y 1 )、(x 2 ,y 2 ), let x 1 ≤x 2 If y 1 ≤y 2 , then the data transmission path from P1 to P2 is (x 1 ,y 1 )→(x 1 +1,y 1 )→(x 1 +2,y 1 )→···→(x 2 ,y 1 )→(x 2 ,y 1 +1)→(x 2 ,y 1 +2)→···→(x 2 ,y 2 ); if y 1 >y 2 , then the data transmission path from P1 to P2 is (x1 ,y 1 )→(x 1 +1,y 1 )→(x 1 +2,y 1 )→···→(x 2 ,y 1 )→(x 2 ,y 1 -1)→(x 2 ,y 1 -2)→···→(x 2 ,y 2 ).

[0065] Fig. 9 The figure shows the complete mapping of the 11×55 logical PE set corresponding to the CONV1 layer of AlexNet to the filter weight transmission diagram of the row-fixed data flow neural network accelerator with an 8×8 physical PE array. PE units with the same color represent the same group of PE units that use the same filter weights during the calculation of the logical PE set. The initial filter weights are transmitted from the center of the PE array to other PE spiral strips according to the shortest routing algorithm, thereby reducing the data transmission of the filter weights.

[0066] Step S43: deploy the initial input feature map from the off-chip DRAM to the corresponding PE spiral strip according to the spiral mapping strategy.

[0067] Step S44, after receiving the input feature map and filter weight, each physical PE unit immediately starts the multiply-accumulate operation (MAC). After the calculation is completed, the output result part and the shortest routing algorithm introduced in sub-step 2 are transmitted to the first PE unit in the corresponding PE spiral strip for accumulation.

[0068] Fig.10 The diagram shows the complete mapping of the 11×55 logical PE set corresponding to the CONV1 layer of AlexNet to the output partial sum transmission diagram of the row-fixed data flow neural network accelerator with an 8×8 physical PE array. PE units with the same color represent the same group of PE units in the logical PE set that calculate the same output partial sum. According to the shortest routing algorithm introduced in step S402, the output partial sum is transmitted to the first PE unit in the corresponding PE spiral strip for accumulation, thereby reducing the data transmission of the output partial sum.

[0069] Step S45, when all PE units in any PE spiral strip have completed MAC calculation and the output partial sum has been accumulated in the first PE unit of the spiral strip, the output feature map is transmitted to the off-chip DRAM through the NoC according to the shortest routing algorithm introduced in sub-step 2.

[0070] Step S46: When all PE spiral strips have completed the neural network training and processing tasks and transferred the output feature map to the off-chip DRAM, enter sub-step 3 to start the next stage of neural network acceleration calculation until the accelerated calculation of the neural network CONV layer on the physical PE array is completed.

[0071] The embodiment of the present invention transmits the initial parameters of the neural network to be trained from the off-chip DRAM to the physical PE array based on the above-mentioned mapping method, and diffuses the filter weights outward from the PE spiral strip located at the center according to the shortest routing algorithm, thereby achieving high reusability and low transmission overhead of the filter weights; according to the shortest routing algorithm, the output partial sum is aggregated inside the PE spiral strip and finally the output feature map is transmitted to the off-chip DRAM through the NoC, thereby achieving low transmission overhead of the output partial sum.

[0072] The embodiment of the present invention maps CONV layers of any size to PE arrays of any size to improve data flow flexibility, and reasonably divides the logical PE set into multiple complete columns and partial columns to map as much data in the logical PE set as possible to the PE units in the PE array. Afterwards, the divided logical PE set is mapped to the physical PE array in a manner that satisfies the lowest possible data transmission overhead, thereby reducing data handling overhead while ensuring high PE unit utilization and high data reuse rate. This solution makes full use of the data reuse of input feature maps, filter weights, and accumulated partial sums in the neural network data stream, and stores the filter weights participating in the same accumulated partial sum in the designated PE unit, while reducing the transmission overhead of the accumulated partial sum between PE arrays. This technical solution greatly reduces the processing difficulty of artificial intelligence applications, has general accelerability and high performance for the neural network benchmark test set widely recognized by the academic community, and has good scalability of the core algorithm for data transmission; it can be applied to the design of large-scale industrial-grade neural network accelerator chips, and has industrial application prospects.

[0073] Embodiment 2:

[0074] The embodiment of the present invention further provides a neural network accelerator data transmission device based on an outward spiral algorithm, comprising:

[0075] An acquisition module, used to acquire a logical PE set;

[0076] A segmentation module, used for iteratively segmenting the logical PE set;

[0077] A mapping module, used for mapping the segmented logical PE set to a physical PE array;

[0078] The computing module is used to transfer the initial parameters of the neural network to be trained from the off-chip memory to the physical PE array and accelerate the calculation.

[0079] As an implementation method of an embodiment of the present invention, the acquisition module generates a logical PE set based on initial parameters of the neural network CONV layer and the neural network accelerator PE array.

[0080] As an implementation method of the embodiment of the present invention, the partitioning module iteratively partitions the logical PE set based on the complete column mapping that maximizes the utilization of the PE array.

[0081] As an implementation method of the embodiment of the present invention, the mapping module maps the segmented logical PE set to the physical PE array based on an outward spiral algorithm of a discrete two-dimensional grid.

[0082] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. A neural network accelerator data transmission method based on an outward spiral algorithm, characterized in that: The following steps are involved: Step S1, obtaining a logical PE set; Step S2, iteratively splitting the logical PE set; Step S3, mapping the segmented logical PE set to the physical PE array; Step S4, transferring the initial parameters of the neural network to be trained from the off-chip memory to the physical PE array and accelerating the calculation; In step S1, a logical PE set is generated based on the initial parameters of the neural network CONV layer and the neural network accelerator PE array; specifically, it includes: S11. Analyze the structure of the CONV layer of the neural network to be processed and the PE array of the neural network accelerator to obtain the input feature map length / width L of the CONV layer of the neural network i , filter weight length / width L f and step length L s , and the length L of the neural network accelerator PE array pa and width W pa ; S12, generate the length L of the logical PE set based on the initial parameters of the neural network CONV layer obtained in the previous step ps and width W ps , and obtain a complete initial logical PE set; In step S2, the logical PE set is iteratively segmented based on the complete column mapping that maximizes the PE array utilization; specifically, it includes: S21, analyze the logical PE set size and the physical PE array size; multiply the length and width of the neural network accelerator PE array to obtain the physical PE array size, and multiply the length and width of the logical PE set to obtain the logical PE set size; compare the logical PE set and the physical PE array size, if the logical PE set size S ps Greater than or equal to the physical PE array size S pa , it means that the logical PE set has not been completely split, and the process goes to step S22; otherwise, the logical PE set has been split, and the process goes to step S3; S22, based on the complete column mapping that maximizes the utilization of the PE array, the logical PE set is split into a set of W ps ×L ps The logical PE set is divided into complete mapping and partial mapping; the complete mapping consists of complete columns and remaining PE units. symbol Indicates rounding down, the number of remaining PE units N rp =S pa %W ps , the symbol % indicates the modulo operation; the partial mapping consists of the remaining complete columns, and the number of remaining complete columns If the number of complete columns N remaining rc =0, we get N m Sub-complete mapped object symbol Indicates rounding up; if the number of complete columns N remaining rc >0, get N m The object of a complete mapping and a partial mapping; each complete mapping will be N c The PE columns and N rp The logical PE units are mapped to the physical PE array. At this time, the utilization rate of the PE array is 100%; partial mapping rc The PE columns of the logical PE set are mapped to the physical PE array. At this time, the utilization rate of the PE array is N rc ×W ps / S pa ; S23, update the logical PE set parameters and perform iterative segmentation, if the number of remaining PE units N rp = 0, the logical PE set segmentation ends and the process goes to step S3; if the number of remaining PE units N rp > 0, then update the logical PE set parameters according to the above segmentation results, where the logical PE set length L ps =N m , logical PE set width W ps =W ps —N rp , and returns to S21 to continue segmenting the updated logical PE set until N rp =0; In step S3, the divided logical PE set is mapped to the physical PE array based on the outward spiral algorithm of the discrete two-dimensional grid; specifically, the following steps are included: Step S31, determine the spiral center and spiral direction, regard the physical PE array as a discrete two-dimensional grid, and determine the spiral center coordinates (x, y) according to the length and width of the physical PE array, where: if Then the initial spiral direction is downward; otherwise, the initial spiral direction is right; Step S32: Set the logical PE set width W ps Set the spiral step length to S, and start from the spiral center of the physical PE array in a counterclockwise direction and divide it into several strips of length S until the number of remaining PE units is less than S; Step S33: add serial number S to each strip in the order of generation. i , the serial number corresponds to the complete column, partial logical PE unit and remaining complete column of the logical PE set; i = 1, 2, ..., N c .

2. A neural network accelerator data transmission device based on an outward spiral algorithm that implements the neural network accelerator data transmission method based on an outward spiral algorithm as described in claim 1, characterized in that: The following steps are involved: An acquisition module, used to acquire a logical PE set; A segmentation module, used for iteratively segmenting the logical PE set; A mapping module, used for mapping the segmented logical PE set to a physical PE array; A computing module, used to transfer the initial parameters of the neural network to be trained from the off-chip memory to the physical PE array and accelerate the calculation; The acquisition module generates a logical PE set based on the initial parameters of the neural network CONV layer and the neural network accelerator PE array; The partitioning module iteratively partitions the logical PE set based on the complete column mapping that maximizes the PE array utilization; The mapping module maps the partitioned logical PE set to the physical PE array based on the outward spiral algorithm of the discrete two-dimensional grid.

Citation Information

Patent Citations

  • Row fixed data stream mapping method based on graph segmentation

    CN110110849A

  • Convolutional neural network acceleration engine, convolutional neural network acceleration system and method

    CN111178519A

  • Neural model mapping method of brain-like computer operating system

    CN112561042A

  • Convolutional neural network training-oriented efficient reconfigurable hardware accelerator

    CN115496190A

  • Systolic array

    US20080028015A1