Shift adder tree structure, computing core architecture, computing execution method and chip
Through the multi-level shift adder tree structure and dynamically adjusted shift nodes, the problem of insufficient parallelism in matrix-vector multiplication operations is solved, achieving efficient computing performance and hardware resource utilization, and adapting to the needs of different computing tasks.
Patent Information
- Application Number
- CN202410664649.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, in efficient computing-intensive tasks, the parallelism of matrix-vector multiplication operation is insufficient, which limits the throughput and speed of calculation. It is especially difficult to meet the performance requirements when processing large-scale matrices and high data volumes.
Using a multi-level shift adder tree structure, by setting shifter nodes between the addition nodes, the shift nodes and the addition nodes are dynamically adjusted according to the bit width and parallelism of the computing task to achieve highly parallel addition calculations, and through The input buffer, SRAM storage array and shift accumulator perform data processing and result accumulation.
It improves computing speed and hardware resource utilization, adapts to the needs of different computing tasks, significantly shortens data processing delays and improves computing performance.
Smart Images

Figure CN118535124A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to a shift adder tree structure, a computing core architecture, a method for executing computing, and a chip. Background Art
[0002] In the current digital storage and computing integrated architecture design, matrix-vector multiplication is a key step widely used in various computationally intensive tasks. Especially in the field of deep learning and big data analysis, the efficient implementation of such operations is of great significance to improving the overall performance of the system. In this context, the technical solution of efficiently calculating the inner product of the input vector and the weight matrix has become a hot topic of research.
[0003] At present, the commonly used technical solution is to process the input vector bit by bit and divide the weight matrix into multiple column vectors according to the bit width. The calculation process performs an element multiplication of an input vector bit and the corresponding weight vector in each clock cycle, and accumulates them through the addition tree to obtain the inner product results of the input vector bit and the weight vector. Subsequently, these inner product results are processed by the shift accumulator to provide the final multiplication output.
[0004] Taking a 64×64 weight matrix and a 64×1 input vector with 4 bits in each element as an example, according to the prior art solution, the calculation process requires four clock cycles to complete. In these four cycles, each bit of the input vector is multiplied by the 4-bit weight vector stored in the SRAM, and then the results are summed through the addition tree to finally obtain the inner product of the 4-bit input vector and the 4-bit weight vector. There are 64 such operation structures, which operate in parallel. After four cycles, a 64×1 output vector can be obtained, in which each element contains 14 bits.
[0005] However, in the actual application of this existing technology, obvious technical bottlenecks have emerged. Taking the addition tree as an example, the addition tree in the existing architecture is usually designed with a parallelism of 64, which may be sufficient in previous applications, but with the growing demand for high-performance computing, especially in modern computing tasks that need to process larger matrices and higher data volumes, this parallelism is far from enough. This limits the throughput and speed of the overall calculation, becoming the main obstacle to improving performance.
[0006] Therefore, how to achieve high parallelism while providing support for high hardware resource utilization for low-parallelism addition calculations of different bit widths has become a technical problem that needs to be solved urgently. Summary of the invention
[0007] The main purpose of the present invention is to provide a shift adder tree structure, a computing core architecture, a method for executing calculations and a chip, aiming to achieve high parallelism while providing support for high hardware resource utilization for low-parallelism addition calculations of different bit widths.
[0008] In order to achieve the above object, the present invention proposes a shift adder tree structure, comprising: A multi-level shift-addition tree, wherein each level except the top level has a plurality of addition nodes and shifter nodes can be set between the addition nodes of each level according to preset conditions, and the shifter nodes are configured to perform a shift operation of a predetermined number of bits after receiving the calculation result of the previous addition node; and according to the bit width and parallelism of the calculation task, the shift nodes and / or addition nodes corresponding to the bit width and the bit width of the calculation task can be used as output nodes.
[0009] In one embodiment of the present application, the level of the shift-addition tree is 8, and a first shifter node controlled by a control signal is provided between any 128-degree parallel input partial summation result in the shift-addition tree and two interconnected 64-degree parallel input partial summation results, and the first shifter node is shifted left by one position; a second shifter node controlled by a control signal is provided between the 256-degree parallel input partial summation result in the shift-addition tree and two interconnected 128-degree parallel input partial summation results, and the second shifter node is shifted left by two positions; any 64-degree parallel input partial summation result, any 128-degree parallel input partial summation result, and any 256-degree parallel input partial summation result are all connected to the output multiplexer, which is used to select the node partial sum result according to the selection signal to select and output each output result.
[0010] The present application also discloses a chip computing core architecture, including: An input buffer, for converting an input vector into an input vector of a predetermined format according to a weight bit width and an input vector size, and generating a weight control signal; An SRAM storage and calculation array stores weight data, receives an input vector in a predetermined format and a weight control signal, performs multiplication calculation on the input vector in the predetermined format and the stored weight data, and generates a shifter control signal and a multiplexer control signal to adjust a shifter and an output multiplexer in the shift-add tree; A shift-adder tree, using the shift-adder tree structure as claimed in any one of claims 1 to 2, for summing the product results output by the SRAM storage array to obtain an inner product calculation result of a single input vector bit and a weight; and A shift accumulator receives the output result of the shift addition tree and is used to perform shift accumulation on each bit of the input vector and the calculation result of the weight vector to obtain the inner product calculation result of the multi-bit input and the weight.
[0011] The present application also discloses a method for performing calculations using a chip computing core architecture, comprising the following steps: The input buffer converts the input vector into an input vector of a predetermined format according to the weight bit width and the input vector size, and generates a weight control signal; An input vector of a predetermined format enters an input buffer, an integer power of 2 close to the number of elements of the input vector of the predetermined format is obtained, and the integer power of 2 close to the number of elements of the input vector of the predetermined format is compared with the number of elements of the input vector at the most bit; When it is less than an integer power of 2, the input vector bits are truncated to the integer power of 2, and the remaining elements of the vector are left for the next round of processing; According to the weight bit width and the number of elements of the input vector bits, copy the truncated input vector bits to a parallelism of 256, and select the shifter and multiplexer; The shift accumulator inputs the processed input vector into the SRAM storage array bit by bit, calculates the element product of the input vector bit and the weight vector, and inputs it into the shift addition tree; The shift-add tree calculates the sum of the element product results or the shift-accumulate result, and the output result is obtained by the output multiplexer and input to the shift-accumulator; The shift accumulator shifts and accumulates the processed element product results to obtain the inner product result of the input vector and the weight vector.
[0012] In one embodiment of the present application, when the integer power is greater than 2, the input vector bits are padded with zeros to the integer power of 2; According to the weight bit width and the number of elements of the input vector bits, copy the zero-padded input vector bits to a parallelism of 256, and select the shifter and multiplexer; The shift accumulator inputs the processed input vector into the SRAM storage array bit by bit, calculates the element product of the input vector bit and the weight vector, and inputs it into the shift addition tree; The shift-add tree calculates the sum of the element product results or the shift-accumulate result, and the output result is obtained by the output multiplexer and input to the shift-accumulator; The shift accumulator shifts and accumulates the processed element product results to obtain the inner product result of the input vector and the weight vector.
[0013] The present application also discloses a chip, comprising the chip computing core architecture as described above.
[0014] With the above technical solution, the calculation can dynamically adjust the bit width and parallelism of the output results according to different computing tasks to meet different computing needs. The multi-level structure can process data in parallel, increase the computing speed and reduce the delay of data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The present invention is described in detail below with reference to specific embodiments and accompanying drawings, wherein: Figure 1 It is a structural schematic diagram of a first embodiment of the present invention; Figure 2 This is a schematic diagram of 4-bit weight calculation in the present invention; Figure 3 This is a schematic diagram of 2-bit weight 128 parallelism calculation of the present invention; Figure 4 This is a schematic diagram of a 2-bit 64-degree parallelism calculation scheme of the present invention; Figure 5 This is a schematic diagram of a 1-bit 256-degree parallelism calculation scheme of the present invention; Figure 6 This is a schematic diagram of 1-bit 128-degree parallelism calculation of the present invention; Figure 7 This is a schematic diagram of 1-bit 64-degree parallelism calculation of the present invention; Figure 8 A schematic diagram of the flow structure of a method for executing calculations using the chip computing core architecture of the present invention. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention is described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the following specific embodiments are only used to explain the present invention and do not constitute a limitation to the present invention.
[0017] like Figure 1 As shown, in order to achieve the above purpose, the present invention proposes a shift adder tree structure, comprising: A multi-level shift-addition tree, in which, except for the top level, each level has multiple addition nodes and shifter nodes can be set between the addition nodes of each level according to preset conditions, and the shifter nodes are configured to perform a shift operation of a predetermined number of bits after receiving the calculation result of the previous addition node; according to the bit width and parallelism of the calculation task, the shift nodes and / or addition nodes corresponding to the bit width and the bit width of the calculation task can be used as output nodes.
[0018] Specifically, the shift adder tree structure adopts a multi-level adder tree, in which the top layer has an adder node, and each layer except the top layer has multiple adder nodes, and shifter nodes can be set between the adder nodes of each layer according to preset conditions. In this architecture, the adder node is responsible for performing the sum calculation of the input data, and the shifter node performs a shift operation of a predetermined number of bits on the calculation result after the summation. The shift operation can be a left shift or a right shift, which can effectively expand or reduce the value, and can flexibly adjust the number of bits and the scale of the calculation result.
[0019] Data enters the shift adder tree structure from the input end, and performs preliminary summation operations in each level of the shift adder. The intermediate results of the calculation are then sent to the shifter node of the layer, and the shifter performs shift operations on these intermediate results according to the pre-set requirements to match the bit width requirements of subsequent calculations. Through this layer-by-layer processing, the data is gradually accumulated and adjusted in bit width when passing through each level. It can select appropriate shift nodes and / or addition nodes as the final output nodes according to the bit width and parallelism requirements of the task being executed to obtain the final calculation results, and is not limited to the result output at the last layer.
[0020] With the above technical solution, the calculation can dynamically adjust the bit width and parallelism of the output results according to different computing tasks to meet different computing needs. The multi-level structure can process data in parallel, increase the computing speed and reduce the delay of data processing.
[0021] In one embodiment of the present application, the level of the shift-addition tree is 8, and a first shifter node controlled by a control signal is provided between any 128-degree parallel input partial summation result in the shift-addition tree and two interconnected 64-degree parallel input partial summation results, and the first shifter node is shifted left by one position; a second shifter node controlled by a control signal is provided between the 256-degree parallel input partial summation result in the shift-addition tree and two interconnected 128-degree parallel input partial summation results, and the second shifter node is shifted left by two positions; any 64-degree parallel input partial summation result, any 128-degree parallel input partial summation result, and any 256-degree parallel input partial summation result are all connected to the output multiplexer, which is used to select the node partial sum result according to the selection signal to select and output each output result.
[0022] Specifically, taking 4-bit input as an example, it is recorded as , use subscripts to represent different bits of a vector, and use superscripts to distinguish multiple vectors, such as " and ", which means the lowest bit of the 0th input vector and the lowest bit of the 1st input vector. The calculation scheme of the present invention is explained below according to the different weight bit widths, and the bold line indicates that the connected shifter / output is selected.
[0023] like Figure 2 , calculate the 4-bit weight.
[0024] Let the 4-bit weight be The input buffer is truncated or filled with zeros to obtain a vector of length 64 according to the number of weight bits.
[0025] The parallelism is 64: the processed input data is copied four times, input into the SRAM storage array bit by bit, and multiplied by the 4-bit weight respectively to obtain the input bit For example, after the SRAM storage array is obtained , , , Vector, these four vectors are 256 parallel vectors output in parallel, such as Figure 5 The bold g, h, i, and j in the figure represent the selection of all shifters in the addition tree and the output of the calculation result of the node C1 of the addition tree. After passing through the A layer of the addition tree, the calculation results of each node from A1 to A4 are , , , After passing through shifters S1 and S2, the results at B1 and B2 are and , after passing through shifter S3, the calculation result at C1 is , which is a 4-bit weight With input The inner product of .
[0026] Finally, the calculation results in four cycles are shifted and accumulated through the shift accumulator to obtain a 4-bit weight. With 4-bit input The inner product calculation result of .
[0027] Calculate the 2-bit weight.
[0028] Let the 2-bit weight be The input buffer obtains a vector of length 128 or a vector of length 64 by truncating or padding with zeros according to the number of weight bits and the input data size, in accordance with the principle of high hardware resource utilization. For example, when the input vector size is close to 128, it is processed as a vector of length 128.
[0029] like Figure 3As shown in the figure, when the parallelism is 128: the processed input data is copied twice and input into the SRAM storage array and multiplied by the 2 bits of the weight respectively to obtain the input vector bit For example, the multiplication calculation is , The two vectors are output in parallel, with a total length of 256. Figure 6 As shown in the figure. The bold j and g in the figure indicate that the shifter S3 is selected and the calculation result of the addition tree node C1 is output. After passing through the B layer of the addition tree, the calculation results of the B1 and B2 nodes are respectively and After shifter S3, the calculation result of node C1 is , which is a 2-bit weight With input Finally, the calculation results in four cycles are shifted and accumulated through the shift accumulator to obtain the 2-bit weight With 4-bit input The inner product result of .
[0030] like Figure 4 As shown in the figure, when the degree of parallelism is 64, the processing method is similar to that when the degree of parallelism is 128. The input data also needs to be copied into two copies. The difference is that in order to make the most of the addition tree resources, two sets of input data need to be processed at the same time. Figure 7 As shown in the figure, the two sets of input data are copied into two copies and put together to form a vector of length 256. and For example, . With weight Perform element multiplication. The bold e, f, h, and i in the figure represent the selection of shifters S1 and S2, and the output multiplexer selects the calculation results of nodes B1 and B2. Finally, the calculation results are output to the shift accumulator.
[0031] Calculate 1-bit weight.
[0032] The weight is The input buffer obtains a vector of length 256, 128, or 64 by truncating or padding with zeros according to the number of weight bits and the size of the input data and the principle of high hardware resource utilization.
[0033] like Figure 5 As shown, when the parallelism is 256: the input vector directly enters the SRAM storage array and the weight bit Multiply to input bits For example, we can calculate , whose total length is 256, is input into the addition tree, as Figure 8The bold g in the figure indicates that the selector in the addition tree is not selected, and the calculation result of the C1 node of the addition tree is output. The calculation result of the C1 node is , which is the weight With input Finally, the calculation results in four cycles are shifted and accumulated through the shift accumulator to obtain a 1-bit weight With 4-bit input The inner product result of .
[0034] like Figure 6 As shown in the figure, when the parallelism is 128: the processing method is similar to that when the parallelism is 256. In order to make full use of the addition tree computing resources, two sets of input data are processed simultaneously. The two sets of input data are put together to form a 256-length vector. and For example, , with weight A bitwise multiplication operation is performed. The bold e and f in the figure indicate that the shifter in the addition tree is not selected, and the multiplexer selects the calculation results of the B1 and B2 nodes and inputs them into the shift accumulator.
[0035] like Figure 7 As shown in the figure, when the parallelism is 64: the processing method is similar to that when the parallelism is 128. In order to make full use of the addition tree computing resources, four sets of input data are processed simultaneously. The four sets of input data are put together in parallel to form a 256-length vector. , , , For example, . Processed input vector bits and weights The bold a, b, c, and d in the figure indicate that the shift accumulator is not selected, and the multiplexer selects the calculation results at A1, A2, A3, and A4 to be output to the shift accumulator.
[0036] The present application also discloses a chip computing core architecture, including: An input buffer, for converting an input vector into an input vector of a predetermined format according to a weight bit width and an input vector size, and generating a weight control signal; An SRAM storage and calculation array stores weight data, receives an input vector in a predetermined format and a weight control signal, performs multiplication calculation on the input vector in the predetermined format and the stored weight data, and generates a shifter control signal and a multiplexer control signal to adjust a shifter and an output multiplexer in the shift-add tree; A shift-adder tree, using the shift-adder tree structure as claimed in any one of claims 1 to 2, for summing the product results output by the SRAM storage array to obtain an inner product calculation result of a single input vector bit and a weight; and A shift accumulator receives the output result of the shift addition tree and is used to perform shift accumulation on each bit of the input vector and the calculation result of the weight vector to obtain the inner product calculation result of the multi-bit input and the weight.
[0037] Specifically, at the beginning, the input vector is sent to the input buffer. Here, the vector will be formatted by the buffer according to the weight bit width to be calculated and the input vector size to ensure that the data format is compatible with the calculation core. The input buffer is also responsible for generating control signals related to the weights, which are used to control the calculation process of the weights.
[0038] The formatted input vector and weight control signal are sent to the SRAM storage array. In the SRAM storage array, the input vector is multiplied with the stored weight data at the element level. After the multiplication calculation, the SRAM storage array generates the shifter control signal and the multiplexer control signal, which are used to precisely control the operation of the shift-add tree to ensure that the data flow passes through the shift-add tree correctly.
[0039] The product result calculated and output by the SRAM storage array will enter the shift-add tree. The shift-add tree uses its multi-level structure to accumulate and sum the product results, thereby obtaining the inner product calculation result between each input vector bit and the weight. In this process, the addition node is used for summation, and the shifter node performs shift operations according to the control signal to match the accuracy and size requirements of the calculation task.
[0040] The output from the shift-add tree is sent to the shift accumulator, which performs a further shift-accumulation operation on each bit of the input vector and the result of the weight vector, and finally obtains the result of the inner product of the multi-bit input and the weight.
[0041] By adopting the above technical solution, the architecture realizes high-speed parallel computing capability through the combination of SRAM storage array and shift-adder tree, which greatly shortens the processing time. The preprocessing function of the input buffer and the dynamic structure design of the shift-adder tree enable the architecture to flexibly adapt to computing requirements of different sizes and precisions, increasing the versatility of the architecture.
[0042] like Figure 8 As shown, the present application also discloses a method for performing calculations using a chip computing core architecture, comprising the following steps: The input buffer converts the input vector into an input vector of a predetermined format according to the weight bit width and the input vector size, and generates a weight control signal; An input vector of a predetermined format enters an input buffer, an integer power of 2 close to the number of elements of the input vector of the predetermined format is obtained, and the integer power of 2 close to the number of elements of the input vector of the predetermined format is compared with the number of elements of the input vector at the most bit; When it is less than an integer power of 2, the input vector bits are truncated to the integer power of 2, and the remaining elements of the vector are left for the next round of processing; According to the weight bit width and the number of elements of the input vector bits, copy the truncated input vector bits to a parallelism of 256, and select the shifter and multiplexer; The shift accumulator inputs the processed input vector into the SRAM storage array bit by bit, calculates the element product of the input vector bit and the weight vector, and inputs it into the shift addition tree; The shift-add tree calculates the sum of the element product results or the shift-accumulate result, and the output result is obtained by the output multiplexer and input to the shift-accumulator; The shift accumulator shifts and accumulates the processed element product results to obtain the inner product result of the input vector and the weight vector.
[0043] Specifically, the input buffer first converts the input vector into a predetermined format that matches the weight bit width and the input vector size, and generates a corresponding weight control signal.
[0044] Convert the number of elements of the formatted input vector to the nearest integer power of 2. If the number of elements of the input vector is less than this integer power, truncate the input vector to this integer power and keep the extra elements for the next round of calculation. Then, expand the input vector to a parallelism of 256 based on the current weight bit width and the number of elements of the truncated input vector bits.
[0045] The shift accumulator loads the prepared input vector bit by bit into the SRAM storage array, where the input vector bits are multiplied with the elements of the pre-stored weight vector.
[0046] The product results in the SRAM storage array are sent to the shift-add tree for accumulation processing, and the shift operation is performed according to a predetermined strategy. The structure of the shift-add tree can effectively merge multiple operation results and perform shift adjustment according to the control signal.
[0047] After being processed by the shift-add tree, the result of accumulation or shift accumulation is determined by the output multiplexer to the final output node and is passed to the shift accumulator. The shift accumulator further shifts and accumulates the result to obtain the final inner product calculation result.
[0048] By adopting the above technical solution, the calculation step can complete a large number of calculation tasks in a short time by processing the input vector and weight data in parallel, which significantly improves the processing efficiency. By using the SRAM storage array and the shift-addition tree structure, the data flow and calculation process are optimized to ensure high data throughput.
[0049] In one embodiment of the present application, when the integer power is greater than 2, the input vector bits are padded with zeros to the integer power of 2; According to the weight bit width and the number of elements of the input vector bits, copy the zero-padded input vector bits to a parallelism of 256, and select the shifter and multiplexer; The shift accumulator inputs the processed input vector into the SRAM storage array bit by bit, calculates the element product of the input vector bit and the weight vector, and inputs it into the shift addition tree; The shift-add tree calculates the sum of the element product results or the shift-accumulate result, and the output result is obtained by the output multiplexer and input to the shift-accumulator; The shift accumulator shifts and accumulates the processed element product results to obtain the inner product result of the input vector and the weight vector.
[0050] Specifically, when it is found that the number of elements of the input vector bits exceeds the integer power of 2 closest to its order of magnitude, the system will automatically pad the input vector with zeros until the number of its elements reaches the next integer power of 2.
[0051] The zero-padded input vector will be sent to the computing core according to the set parallelism. At this time, the system will perform a copy operation based on the weight bit width and the actual number of elements in the zero-padded input vector to ensure efficient parallel processing in the subsequent calculation process.
[0052] The shift accumulator loads the prepared input vector bit by bit into the SRAM storage array, where the input vector bits are multiplied with the elements of the pre-stored weight vector.
[0053] The product results in the SRAM storage array are sent to the shift-add tree for accumulation processing, and the shift operation is performed according to a predetermined strategy. The structure of the shift-add tree can effectively merge multiple operation results and perform shift adjustment according to the control signal.
[0054] After being processed by the shift-add tree, the result of accumulation or shift accumulation is determined by the output multiplexer to the final output node and is passed to the shift accumulator. The shift accumulator further shifts and accumulates the result to obtain the final inner product calculation result.
[0055] The present application also discloses a chip, comprising the chip computing core architecture as described above.
[0056] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the inventive concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A shift adder tree structure, characterized in that: include: A multi-level shift-addition tree, in which, except for the top level, each level has multiple addition nodes and shifter nodes can be set between the addition nodes of each level according to preset conditions, and the shifter nodes are configured to perform a shift operation of a predetermined number of bits after receiving the calculation result of the previous addition node; according to the bit width and parallelism of the calculation task, the shift nodes and / or addition nodes corresponding to the bit width and the bit width of the calculation task can be used as output nodes.
2. The shift adder tree structure as claimed in claim 1, characterized in that: The level of the shift-addition tree is 8. A first shifter node controlled by a control signal is provided between any 128-degree parallel input partial summation result and two interconnected 64-degree parallel input partial summation results in the shift-addition tree, and the first shifter node is shifted left by one position. A second shifter node controlled by a control signal is provided between the 256-degree parallel input partial summation result and two interconnected 128-degree parallel input partial summation results in the shift-addition tree, and the second shifter node is shifted left by two positions. Any 64-degree parallel input partial summation result, any 128-degree parallel input partial summation result, and any 256-degree parallel input partial summation result are all connected to an output multiplexer, which is used to select the node partial sum result according to the selection signal, so as to select and output each output result.
3. A chip computing core architecture, characterized in that: include: An input buffer, for converting an input vector into an input vector of a predetermined format according to a weight bit width and an input vector size, and generating a weight control signal; An SRAM storage and calculation array stores weight data, receives an input vector in a predetermined format and a weight control signal, performs multiplication calculation on the input vector in the predetermined format and the stored weight data, and generates a shifter control signal and a multiplexer control signal to adjust a shifter and an output multiplexer in the shift-add tree; A shift adder tree, using a shift adder tree structure as claimed in any one of claims 1 to 2, for summing the product results output by the SRAM storage array to obtain an inner product calculation result of a single input vector bit and a weight; as well as A shift accumulator receives the output result of the shift addition tree and is used to perform shift accumulation on each bit of the input vector and the calculation result of the weight vector to obtain the inner product calculation result of the multi-bit input and the weight.
4. A method for performing calculations using a chip computing core architecture, characterized in that: The following steps are involved: The input buffer converts the input vector into an input vector of a predetermined format according to the weight bit width and the input vector size, and generates a weight control signal; An input vector of a predetermined format enters an input buffer, an integer power of 2 close to the number of elements of the input vector of the predetermined format is obtained, and the integer power of 2 close to the number of elements of the input vector of the predetermined format is compared with the number of elements of the input vector at the most bit; When it is less than an integer power of 2, the input vector bits are truncated to the integer power of 2, and the remaining elements of the vector are left for the next round of processing; According to the weight bit width and the number of elements of the input vector bits, copy the truncated input vector bits to a parallelism of 256, and select the shifter and multiplexer; The shift accumulator inputs the processed input vector into the SRAM storage array bit by bit, calculates the element product of the input vector bit and the weight vector, and inputs it into the shift addition tree; The shift-add tree calculates the sum of the element product results or the shift-accumulate result, and the output result is obtained by the output multiplexer and input to the shift-accumulator; The shift accumulator shifts and accumulates the processed element product results to obtain the inner product result of the input vector and the weight vector.
5. The method for performing calculations using a chip computing core architecture as claimed in claim 4, characterized in that: When it is greater than an integer power of 2, the input vector bits are padded with zeros to the integer power of 2; According to the weight bit width and the number of elements of the input vector bits, copy the zero-padded input vector bits to a parallelism of 256, and select the shifter and multiplexer; The shift accumulator inputs the processed input vector into the SRAM storage array bit by bit, calculates the element product of the input vector bit and the weight vector, and inputs it into the shift addition tree; The shift-add tree calculates the sum of the element product results or the shift-accumulate result, and the output result is obtained by the output multiplexer and input to the shift-accumulator; The shift accumulator shifts and accumulates the processed element product results to obtain the inner product result of the input vector and the weight vector.
6. A chip, characterized in that: Comprising the chip computing core architecture as described in claim 3.
Citation Information
Patent Citations
Floating-point adder circuitry
CN104423926A
Accelerator for deep neural networks
CN109416754A
Information processing method and terminal equipment
CN109726806A
Multiplier unit and method and device for calculating dot product of floating point values
CN113515261A
Neural network arithmetic device and method of operating same
CN114970843A
