Coarse-grained reconfigurable array system and computational method for deep learning
By designing a coarse-grained reconfigurable array system for deep learning and utilizing the reconfigurable array structure of the controller and processing unit group, the problem of high computational cost in ASIC and FPGA design in the existing technology is solved, and high energy efficiency and flexibility are achieved. The combination improves computing parallelism and throughput.
Patent Information
- Application Number
- CN202210798554.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-06
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-07-06
AI Technical Summary
In the existing technology, the gate-level programmable design through ASIC design and FPGA is computationally expensive and cannot take into account both flexibility and computing energy efficiency.
Design a coarse-grained reconfigurable array system for deep learning, including a controller, input bus, configuration bus and processing unit group. By reconstructing the processing unit to form an array, the cost of reconstruction is reduced, and through the configuration bus, The input bus and output bus transmit a variety of data to improve throughput and computing parallelism.
Reduce the cost of reconstruction while maintaining a certain degree of reconfigurability, improve the throughput rate and computing parallelism of the reconfigurable array system, achieve a good compromise between high energy efficiency and flexibility, and overcome the high computing cost in the existing technology. problem.
Smart Images

Figure CN115168284B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of reconfigurable array technology, and more specifically, to a coarse-grained reconfigurable array system and a computing method for deep learning. Background Art
[0002] In related technologies, calculations in deep learning networks are usually performed through application-specific integrated circuits (ASIC) or field programmable gate arrays (FPGA). ASIC can achieve higher energy efficiency, while FPGA can achieve gate-level programmability and has higher reconfigurability.
[0003] In the process of implementing the concept of the present disclosure, the inventors found that there are at least the following problems in the related art: the computational cost of gate-level programmable design such as ASIC design and FPGA in the prior art is relatively high, and cannot take into account both flexibility and computing energy efficiency. Summary of the invention
[0004] In view of this, the present disclosure provides a coarse-grained reconfigurable array system and a computing method for deep learning.
[0005] One aspect of the present disclosure provides a coarse-grained reconfigurable array system for deep learning, comprising:
[0006] A controller, configured to determine input information input to at least one processing unit, wherein the input information includes weights, input data, state instructions, and operation instructions, the state instructions are used to determine an execution state of the operation instructions, and the operation instructions are used by at least one processing unit to calculate the weights and the input data;
[0007] an input bus for inputting weights and input data to at least one processing unit;
[0008] A configuration bus for inputting status instructions and operation instructions to at least one processing unit;
[0009] A processing unit group, including a plurality of processing units, wherein the plurality of processing units form a reconfigurable array, and each processing unit is used to calculate weights and input data according to an operation instruction to obtain result data;
[0010] The output bus is used for at least one processing unit to output result data.
[0011] According to an embodiment of the present disclosure, the reconfigurable array formed by the multiple processing units in the processing unit group has a total of M columns and N rows, M is an integer greater than or equal to 1, and N is an integer greater than or equal to 1, wherein,
[0012] Each column of processing units shares an input bus;
[0013] Each row of processing units shares an output bus;
[0014] Each column of processing elements shares a configuration bus.
[0015] According to an embodiment of the present disclosure,
[0016] Each input bus is connected to an input storage unit;
[0017] Each output bus is connected to an output storage unit;
[0018] Each configuration bus connects to a configuration memory cell.
[0019] According to an embodiment of the present disclosure, the processing unit includes:
[0020] An instruction register subunit, used for storing operation instructions and status instructions;
[0021] An instruction decoding subunit, used for decoding operation instructions and status instructions;
[0022] A weight register subunit, used to store weights or input data;
[0023] A local storage subunit for storing intermediate data;
[0024] The logic operation subunit is used to calculate the weight and input data according to the operation instruction to obtain the result data.
[0025] According to an embodiment of the present disclosure, the logic operation subunit includes:
[0026] At least one multiplier, at least one adder, and at least one selector.
[0027] According to an embodiment of the present disclosure, the state instruction includes a cycle of an operation instruction, wherein each processing unit is used to calculate the weight and input data according to the operation instruction, and the result data obtained includes:
[0028] According to the cycle, the processing unit calculates the weight and input data according to the operation instruction to obtain the result data.
[0029] According to an embodiment of the present disclosure, the instruction register subunit includes:
[0030] An operation instruction register subunit, used for storing operation instructions;
[0031] The status instruction register subunit is used to store status instructions.
[0032] According to an embodiment of the present disclosure, the instruction decoding subunit includes:
[0033] An operation instruction decoding subunit, used for decoding the operation instruction;
[0034] The status instruction decoding subunit is used for decoding the status instruction.
[0035] According to an embodiment of the present disclosure,
[0036] The configuration storage unit is used to store configuration information so that the control unit determines input information according to the configuration information.
[0037] Another aspect of the present disclosure provides a coarse-grained reconfigurable array computing method for deep learning, comprising:
[0038] Determining, by a controller, input information input to at least one processing unit, wherein the input information includes weights, input data, state instructions, and operation instructions, the state instructions are used to determine an execution state of the operation instructions, and the operation instructions are used by at least one processing unit to calculate the weights and the input data;
[0039] inputting weights and input data to at least one processing unit via an input bus;
[0040] inputting status instructions and operation instructions to at least one processing unit via a configuration bus;
[0041] Each processing unit calculates the weight and input data according to the operation instruction to obtain result data;
[0042] The result data is output through the output bus.
[0043] According to an embodiment of the present disclosure, the controller determines the input information to be input to at least one processing unit, the weight and input data in the input information are input to the processing unit through the input bus, and the state instruction and operation instruction are input to the processing unit through the configuration bus, and the processing unit calculates the weight and input data according to the state instruction and the operation instruction, obtains the result data and outputs it through the output bus. By reconfiguring the processing unit to form an array to calculate the input information, the cost of reconstruction can be reduced while maintaining a certain degree of reconfigurability, and multiple data are transmitted through the configuration bus, the input bus and the output bus, thereby improving the throughput rate and computational parallelism of the reconfigurable array system, and ensuring the flexibility of the data flow, so as to at least partially overcome the technical problem that the computational cost of the gate-level programmable design such as ASIC design and FPGA in the prior art is high and flexibility and computational energy efficiency cannot be taken into account. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0045] Figure 1 A schematic diagram of a coarse-grained reconfigurable array system for deep learning according to an embodiment of the present disclosure is schematically shown;
[0046] Figure 2 A schematic diagram of a processing unit of a coarse-grained reconfigurable array system for deep learning according to an embodiment of the present disclosure is schematically shown;
[0047] Figure 3 A schematic diagram of a logic operation subunit of a coarse-grained reconfigurable array system for deep learning according to an embodiment of the present disclosure is schematically shown;
[0048] Figure 4 A schematic diagram of reconfiguration of a logic operator unit of a coarse-grained reconfigurable array system for deep learning according to an embodiment of the present disclosure is schematically shown; and
[0049] Figure 5 A schematic diagram of the reconstruction of a logic operator unit of another coarse-grained reconfigurable array system for deep learning according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0050] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0051] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0052] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0053] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0054] With the rapid development of artificial intelligence technology based on deep learning, the system design of energy-efficient deep learning is particularly important, and the requirements for computing efficiency are getting higher and higher. Most existing processors are calculated through FPGA, ASIC, etc. However, with the advancement of semiconductor manufacturing technology, the R&D cost of a chip is as high as 150 million to 200 million US dollars, and it takes more than 30 million chips to sell to recover the R&D cost.
[0055] As the system architecture becomes more versatile, its energy efficiency gradually decreases. ASIC design can achieve the highest energy efficiency, but ASIC design has low flexibility, high front-end cost, and is easily eliminated; FPGA has high reconfiguration flexibility, but it is too reconfigurable. In order to save economic costs, new solutions need to be found in computing methods and system architecture. Coarse-grained reconfigurable arrays (CGRA) can achieve reconfiguration at the processing unit level. Compared with the gate-level programmability of FPGA, CGRA takes into account computing energy efficiency while retaining a certain degree of flexibility. Therefore, CGRA can achieve a good compromise between high energy efficiency and flexibility, becoming one of the effective solutions for realizing domain-specific high-performance computing, and can effectively alleviate the "energy wall" and "storage wall" problems.
[0056] In view of this, the present disclosure proposes a coarse-grained reconfigurable array system for deep learning. The system includes: a controller, used to determine the input information input to at least one processing unit, wherein the input information includes weights, input data, state instructions and operation instructions, the state instructions are used to determine the execution state of the operation instructions, and the operation instructions are used for at least one processing unit to calculate weights and input data; an input bus, used to input weights and input data to at least one processing unit; a configuration bus, used to input state instructions and operation instructions to at least one processing unit; a processing unit group, including multiple processing units, multiple processing units form a reconfigurable array, each processing unit is used to calculate weights and input data according to the operation instructions to obtain result data; an output bus, used for at least one processing unit to output result data. By reconfiguring the processing units in the embodiments of the present disclosure, it is possible to retain a certain degree of flexibility while taking into account computing energy efficiency.
[0057] Figure 1 A schematic diagram of a coarse-grained reconfigurable array system for deep learning according to an embodiment of the present disclosure is schematically shown.
[0058] like Figure 1 As shown, the system includes a controller 110 , an input bus 120 , a configuration bus 130 , a processing unit group 140 , and an output bus 150 .
[0059] The controller 110 is used to determine input information input to at least one processing unit, wherein the input information includes weights, input data, state instructions and operation instructions, the state instructions are used to determine the execution state of the operation instructions, and the operation instructions are used by at least one processing unit to calculate the weights and input data;
[0060] An input bus 120 for inputting weights and input data to at least one processing unit;
[0061] Configuration bus 130, used to input status instructions and operation instructions to at least one processing unit;
[0062] The processing unit group 140 includes a plurality of processing units, the plurality of processing units form a reconfigurable array, each processing unit is used to calculate the weight and input data according to the operation instruction to obtain result data;
[0063] The output bus 150 is used for at least one processing unit to output result data.
[0064] According to an embodiment of the present disclosure, the controller 110 (Top Ctrl) may be responsible for coordinating the overall execution process of the reconfigurable array, such as the execution process of preloading, execution, idle or interruption.
[0065] According to an embodiment of the present disclosure, the processing unit group 140 can be composed of multiple processing elements (PE), and the PE can be arranged in a square array. The height and width of the array can be set by a controller respectively, and the PE can exchange data with other PEs connected to it, above, below, left and right.
[0066] According to an embodiment of the present disclosure, the data bit width supported by the input bus 120 may be 32 bits, and 32 bits of weights and input data may be input; the data bit width supported by the output bus 120 may be 32 bits, so that the PE can output 32 bits of result data.
[0067] According to an embodiment of the present disclosure, the input data may be video data for detecting a target, picture data for identifying graphic characters, audio data for identifying speech, etc., which are input into the first layer of the deep learning network. When performing calculations through the deep learning network, the result data calculated by the current network layer may be used as the input of the next layer of the network. Therefore, the input data may also be the result data calculated by the network layer in the deep learning network.
[0068] According to an embodiment of the present disclosure, the data bit width supported by the configuration bus 130 may be 20 bits.
[0069] According to an embodiment of the present disclosure, the controller determines the input information to be input to at least one processing unit, the weight and input data in the input information are input to the processing unit through the input bus, and the state instruction and operation instruction are input to the processing unit through the configuration bus, and the processing unit calculates the weight and input data according to the state instruction and the operation instruction, obtains the result data and outputs it through the output bus. By reconfiguring the processing unit to form an array to calculate the input information, the cost of reconstruction can be reduced while maintaining a certain degree of reconfigurability, and multiple data are transmitted through the configuration bus, the input bus and the output bus, thereby improving the throughput rate and computational parallelism of the reconfigurable array system, and ensuring the flexibility of the data flow, so as to at least partially overcome the technical problem that the computational cost of the gate-level programmable design such as ASIC design and FPGA in the prior art is high and flexibility and computational energy efficiency cannot be taken into account.
[0070] According to an embodiment of the present disclosure, a reconfigurable array formed by a plurality of processing units in a processing unit group has a total of M columns and N rows, where M is an integer greater than or equal to 1, and N is an integer greater than or equal to 1, wherein:
[0071] Each column of processing units shares an input bus;
[0072] Each row of processing units shares an output bus;
[0073] Each column of processing elements shares a configuration bus.
[0074] According to an embodiment of the present disclosure, each column of processing units may share an input bus and a configuration bus, and each row of processing units may share an output bus. Figure 1 For example, the processing unit group with four rows and four columns of processing units in Figure 1 In the embodiment, four columns of processing units can share four input buses and four configuration buses, and four rows of processing units can share four output buses.
[0075] According to an embodiment of the present disclosure, each input bus is connected to an input storage unit;
[0076] Each output bus is connected to an output storage unit;
[0077] Each configuration bus connects to a configuration memory cell.
[0078] According to an embodiment of the present disclosure, each input bus is connected to an input storage unit (Din FIFO) to Figure 1 For example, four input buses can connect four input storage units. Figure 1 In the example, Din FIFOs are used to represent four input storage units, and each output bus is connected to an output storage unit (Dout FIFO). Figure 1 The four output buses can connect to four output storage units, which are represented by Dout FIFOs. Each configuration bus connects to a configuration storage unit (Config Bank). Figure 1 The four configuration buses can connect four configuration storage units, which are represented by Config Banks. Multiple input buses, output buses, and configuration buses are used to connect input storage units, output storage units, and configuration storage units, respectively, so that multiple instructions, weights, and input data can be input to multiple processing units at the same time, thereby improving the throughput of the reconfigurable array system.
[0079] According to an embodiment of the present disclosure, the processing unit includes:
[0080] An instruction register subunit, used for storing operation instructions and status instructions;
[0081] An instruction decoding subunit, used for decoding operation instructions and status instructions;
[0082] A weight register subunit, used to store weights or input data;
[0083] A local storage subunit for storing intermediate data;
[0084] The logic operation subunit is used to calculate the weight and input data according to the operation instruction to obtain the result data.
[0085] According to an embodiment of the present disclosure, the instruction register subunit can receive operation instructions and status instructions input through the configuration bus, and then store the operation instructions and status instructions. During the execution phase of the reconfigurable array system, the operation instructions and status instructions can be decoded by the instruction decoding unit, and the operation corresponding to the operation instruction can be executed according to the decoded content.
[0086] According to an embodiment of the present disclosure, the weight register subunit may receive weights input through an input bus and store the weights, and the processing unit may write all required weights into each weight register subunit through the input bus only in the preloading stage.
[0087] According to an embodiment of the present disclosure, the weight register unit can also receive input data input through the input bus and store the input data in the weight register unit. The processing unit can write all required input data into each weight register sub-unit through the input bus only in the preloading stage.
[0088] According to the embodiments of the present disclosure, by reading the local weights or input data for calculation, near storage calculation is realized, effectively reducing the energy consumption of data movement. According to the embodiments of the present disclosure, the local storage subunit can store intermediate data. After the intermediate data is obtained by the logic operation subunit, the intermediate data can be first stored in the local storage subunit, or after the result data is obtained by the logic operation subunit, if other PEs are running and cannot receive the result data, the result data can be first stored in the local storage subunit.
[0089] According to an embodiment of the present disclosure, the logic operation subunit may perform an operation corresponding to the operation instruction according to the content decoded by the instruction decoding subunit.
[0090] According to an embodiment of the present disclosure, the instruction register subunit includes:
[0091] An operation instruction register subunit, used for storing operation instructions;
[0092] The status instruction register subunit is used to store status instructions.
[0093] According to an embodiment of the present disclosure, the instruction decoding subunit includes:
[0094] An operation instruction decoding subunit, used for decoding the operation instruction;
[0095] The status instruction decoding subunit is used for decoding the status instruction.
[0096] According to an embodiment of the present disclosure, the operation instruction and the state instruction can be stored in the operation instruction register subunit and the state instruction register subunit respectively, so as to realize the separate storage of the operation instruction and the state instruction. For example, in the case of the operation instruction loop, it is only necessary to perform the corresponding operation on the operation instruction according to the state instruction.
[0097] According to an embodiment of the present disclosure, the operation instruction of the operation instruction registering subunit may be decoded by the operation instruction decoding subunit, and the state instruction of the state instruction registering subunit may be decoded by the state instruction decoding subunit.
[0098] According to the embodiments of the present disclosure, by storing and decoding the operation instructions and the status instructions respectively, the execution times of the operation instructions are controlled by the status instructions, and it is not necessary to store the operation instructions required for each cycle into the operation instruction register subunit, thereby reducing the storage space of the operation instructions and lowering the logic control cost of the reconfigurable array system.
[0099] Combine the following Figure 2 The processing unit of the embodiment of the present disclosure is further explained.
[0100] Figure 2 A schematic diagram of a processing unit of a coarse-grained reconfigurable array system for deep learning according to an embodiment of the present disclosure is schematically shown.
[0101] like Figure 2 As shown, the PE internal instruction register subunit includes an operation instruction register subunit (Operation Config Register File, OCRF) 32×20bit and a status instruction register subunit (Status Config Register File, SCRF) 32×20bit. Figure 2 PE includes a weight register file (WRF) 32×32 bits and a local register file (LRF) 2×32 bits. Figure 2 In the PE STAT Ctrl, the status instruction register subunit is Figure 2 It is represented as PE_Ctrl in .
[0102] According to an embodiment of the present disclosure, Figure 2The PE in the example also includes two selectors and an output port, which are represented as Op1_MUX, Op2_MUX and Output_Reg respectively. N, S, E and W represent the inputs from other PEs in the southeast, northwest and northeast of the PE respectively. D represents the weight and input data from the input bus input. The selector in the PE can select to receive the weight, input data, other PEs in the southeast, northwest and northwest and the calculation results of Output_Reg.
[0103] According to the embodiments of the present disclosure, the reconfigurable array system is mainly divided into a preloading phase and an operation phase during operation. OCRF and SCRF can only write operation instructions or status instructions in the preloading phase, and WRF only writes all the required weights to each PE through a 32-bit input bus in the preloading phase. The scheduling algorithm needs to provide the number of weights required for each PE and arrange the input data in order. In the operation phase, the input data can be input into the reconfigurable array system, and only read operations are performed on WRF; LRF is a storage that can be called during the operation of the array, and can be read and written.
[0104] According to the embodiments of the present disclosure, the reconfigurable array adopts a distributed storage method, and each PE contains local data storage, wherein WRF can only be written in the preloading stage, and can only be read locally by the PE during the array operation stage. Its read address can be flexibly controlled according to the operation instructions and status instructions, and its write address is generated by the self-increment of this PE, and the upper limit is controlled by the quantity parameter of the weight of this PE. LRF is used for access to intermediate data during the operation of the array, with dual read ports and a single write port, and its read and write addresses are controlled according to the operation instructions. By reading the local weights and input data of the PE for calculation, near storage calculation is realized, effectively reducing the energy consumption of data movement.
[0105] According to the embodiments of the present disclosure, by designing a reasonable instruction format, the state instruction can realize the control of the sequential execution, loop execution, and no-operation of the operation instruction; the operation instruction can realize the control of the source of the operation data per cycle of the PE, the type of operation, the writing back of the result data to the local register subunit, and the output of the result data through the output bus. By looping the operation instruction, the input and storage of the operation instruction can be reduced, and the logic control cost can be reasonably reduced while taking into account flexibility.
[0106] Figure 2 The hollow single-line thick arrow in the figure is the control signal and address information decoded from the 20-bit operation instruction. The specific format of the operation instruction is shown in Table 1.
[0107] Table 1 Operation instruction format
[0108] Control Signal Address Information nop_en 19 dout_bus_en 18 LRF_wen 17 alu_ctrl [16:13] LRF_addr_w 12 LRF_addr_r2 11 LRF_addr_r1 10 mux_ctrl2 [9:7] mux_ctrl1 [6:4] WRF_addr [3:0]
[0109] The mux_ctrl1 and mux_ctrl2 in Table 1 are Figure 2 The control signals of Op1_MUX and Op2_MUX in the control PE can control the PE to receive the result data from the four directions of up, down, left and right PEs connected to it, the weights and input data on the input bus, and can also receive the result data feedback from the inside of the PE, the read data of LRF and WRF, and hardware 0. Hardware 0 can be the operation signal for initializing PE.
[0110] The specific encoding method of mux_ctrl is shown in Table 2.
[0111] Table 2 mux_ctrl coding description
[0112] coding Options explain 000 PE_out / zero mux1 is the feedback of PE output / mux2 is hardware 0 001 North Output from the PE above the current PE 010 South Output from the PE below the current PE 011 West Output from the PE to the left of the current PE 100 East Output from the PE to the right of the current PE 101 LRF_out Output from the local register subunit 110 din_bus From input bus 111 WRF Output from the weight register subunit
[0113] The specific meanings of the definitions of the remaining functional domains nop_en, dout_bus_en, LRF_wen, LRF_addr_w, LRF_addr_r1, and LRF_addr_r2 in Table 1 are shown in Table 3.
[0114] Table 3 Definition of other operation instruction function domains
[0115]
[0116] According to an embodiment of the present disclosure, the logic operation subunit includes:
[0117] At least one multiplier, at least one adder, and a plurality of selectors.
[0118] like Figure 2 As shown, the PE also includes a three-input logic operation subunit (Arithmetic and Logic Unit, ALU), which can perform any number of combinations of multipliers, adders and selectors to meet the computing needs of the reconfigurable array.
[0119] According to the embodiment of the present disclosure, the ALU can perform signed number operations and saturate overflow. Among the three inputs of the ALU, two of them are selected and controlled by the selector MUX, and the other input is the output data of the fixedly connected WRF. alu_ctrl in Table 1 is Figure 2 The ALU control signal in determines the operation type of the ALU in this cycle and the source of operands for certain operation types. The specific encoding method is shown in Table 4. data1 represents the output of Op1_MUX, data2 represents the output of Op2_MUX, and data3 represents the WRF output of the ALU fixed connection.
[0120] Table 4 Coding description of alu_ctrl
[0121]
[0122] Figure 3 A schematic diagram of a logic operator unit of a coarse-grained reconfigurable array system for deep learning according to an embodiment of the present disclosure is schematically shown.
[0123] like Figure 3 As shown, the main arithmetic operation resources of ALU include 4 8-bit multipliers (configurable as complement or original code multipliers), 2 16-bit adders, 1 17-bit adder (with carry), and 1 35-bit adder; the main logic operation resources include 32-bit complement logic left shift and right shift, 32-bit bitwise AND, OR, XOR, XNOR, and 32-bit complement comparison (output larger value); the main reconstruction resource overhead includes MUX and a sign processing unit for processing the complement sign bit (for the carry of the adder, if there is no overflow, the sign bit needs to be filled in the highest bit), and the control signal of MUX comes from the decoding of the input status instruction; the saturation processing unit is mainly used for complement addition overflow processing.
[0124] The reconstruction of ALU is mainly reflected in the operation type, operand type, and operand bit width. The reconstructed control signals all come from the decoding of the input ctrl signal.
[0125] Figure 4 A schematic diagram of the reconstruction of a logic operator unit of a coarse-grained reconfigurable array system for deep learning according to an embodiment of the present disclosure is schematically shown.
[0126] like Figure 4 As shown, redsum uses an addition tree to accumulate the results of four 8-bit two's complement multiplications. Since the accumulation process is the calculation of the true two's complement value, the addition result after the sign processing unit is used, and finally a 35-bit adder is used to add the accumulation result and the data2 input data.
[0127] Figure 5 A schematic diagram of the reconstruction of a logic operator unit of another coarse-grained reconfigurable array system for deep learning according to an embodiment of the present disclosure is schematically shown.
[0128] like Figure 5 As shown, the four 8-bit multipliers are reconstructed into 16-bit complement multipliers, and the implementation structure is as follows Figure 5 The principle of two's complement multiplication is as follows: 6-bit multiplication [a5:a0]×[b5:b0]=[P 11 :P0] as an example, a5 and b5 are sign bits:
[0129]
[0130] It can be seen that when performing two's complement multiplication, the sign bit needs special processing and a special addition operation. Therefore, in the process of reconstructing the four 8-bit multipliers into 16-bit two's complement multipliers, the sign bits of the input 16-bit weights are filled with 0, and then the 8-bit multipliers are configured for original code multiplication. After completing the data calculation except the sign bit, after obtaining the result data, the required sign special processing is used to add it to the calculation result using a 35-bit adder, and finally the 16-bit two's complement multiplication result is obtained. The specific reconstruction ideas are as follows: Figure 5 As shown, the formula is shown as follows, where h and l represent the high 8 bits or low 8 bits respectively:
[0131]
[0132] Therefore, corresponding to Figure 5 , P hl +P lh Completed in add16_0, get 17-bit result, intercept the lower 8 bits and fill 0 in the lower position to fill 16-bit data, and ll Add16_1 completes the addition and obtains a 17-bit result. The highest bit is used as the carry input of add17, and the lower 16 bits are used as the lower 16 bits of the output result. At the same time, the upper 9 bits of the output result of add16_0 are intercepted and filled with 0 in the upper bit to form 17-bit data. hh The addition is completed in add17, and the lower 16 bits of the sum result are the higher 16 bits of the output result. Among them, the partial sum result is directly output by the adder without going through the sign processing unit, and finally the final 16-bit complement multiplication output result is obtained after the complement special sign processing.
[0133] The following are examples of operation instructions:
[0134] 1) No instruction: nop
[0135] 2) Two operands: mul mux1(raddr1), mux2(raddr2), rw / rnw(waddr), be / bne
[0136] 3) Two operands: mulw mux1(raddr1), WRF(WRF_addr), rw / rnw(waddr), be / bne
[0137] 4) Three operands: mac mux1(raddr1),mux2(raddr2),WRF(WRF_addr),rw / rnw(waddr),be / bne
[0138] Eg.mul LRF_out(0), LRF_out(0), rw(1), be / / read the value from register 0, multiply it, write it back to register 1, and send an output request to the output bus
[0139] When mux selects LRF, it means that LRF needs to be read. When alu_ctrl is the weight operation type, that is, mux_ctrl selects WRF or mac, it means that WRF needs to be read; rw—reg_write, rnw—reg_non_write; be—bus_enable, bne—bus_non_enable.
[0140] According to the embodiments of the present disclosure, the ALU uses limited computing resources and implements multiplication operations of various bit widths and forms through reconstruction, thereby further reducing the computing cost.
[0141] According to an embodiment of the present disclosure, the state instruction includes a cycle of an operation instruction, wherein each processing unit is used to calculate the weight and input data according to the operation instruction, and the result data obtained includes:
[0142] According to the cycle, the processing unit calculates the weight and input data according to the operation instruction to obtain the result data.
[0143] According to an embodiment of the present disclosure, the cycle period can be the number of cycles of the operation instruction in a cycle, and the number of cycles of the operation instruction can be carried in the status instruction, thereby determining the entire operation instruction running process. According to an embodiment of the present disclosure, each operation instruction in the PE is only effective for one cycle, which determines the execution state of each cycle of the PE. The effective cycle of the status instruction depends on the cycle period of the operation instruction. The format of the status instruction is shown in Table 5. Since the configuration bus width is 20 bits, we splice two 10-bit status instructions into 20 bits and send them to the PE for storage.
[0144] Table 5 Status command format
[0145] Status Commands op_code1 cycle1 op_code2 cycle2 address [19:17] [16:10] [9:7] [6:0]
[0146] The op_code in Table 5 determines the execution status of the operation instruction controlled by each status instruction. The specific meaning is shown in Table 6.
[0147] Table 6 Status command op_code meaning
[0148]
[0149] Except for PE_end, which must be 0, the number of cycles after other status instructions cannot be 0. PE_loopb is responsible for executing the first inner loop and recording the loop length, followed by the number of inner loop cycles; PE_loopc / ci carries (number of inner loop cycles * (total number of inner loops - 1)), (total number of inner loops - 1) because PE_loopb has been executed once; it can support loops for a single instruction; PE_end only takes one cycle anyway, and is the last large instruction, so the remaining small instructions need to be filled with PE_end.
[0150] According to an embodiment of the present disclosure, the configuration storage unit is used to store configuration information so that the control unit determines the input information according to the configuration information.
[0151] According to an embodiment of the present disclosure, the configuration information may be the number of operation instructions input to each processing unit, the number of state instructions, the number of weights, the cycle period of the processing unit, the weight base address increment, etc.
[0152] According to the embodiment of the present disclosure, since the internal operation instruction execution of the reconfigurable array system is the existence of a pipeline, the PE needs to give a read signal to the Din FIFO in advance. Therefore, the reconfigurable array system will predict when the Din FIFO will be empty through the read signal and write signal of the Din FIFO. When it is predicted that a certain Din FIFO is empty and the relevant PE has a read request for the input bus, the PE will send an interrupt signal to the controller. Similarly, for the Dout FIFO, when the array is stagnant, it is necessary to ensure that the output data of the operation instruction that has been executed in the pipeline can be stored in the Dout FIFO. Therefore, when a certain Dout FIFO has less than two empty positions, it can be regarded as unable to guarantee the output data of all the operation instructions in the pipeline. The PE will send an interrupt signal to the controller; when the controller receives the interrupt signal of a certain PE, it will cause the entire reconfigurable array system to enter an interrupt state, prevent the data flow beat from being disordered, and save the scene. After the interrupt ends, the reconfigurable array system continues to run.
[0153] According to the embodiments of the present disclosure, Figure 1 The address of the configuration information is described by taking the array size of 4 columns and 6 rows as an example. Corresponding to 4 columns of PE, a total of 4 configuration storage units (Config SRAM Bank) are set, and each column of PE corresponds to a ConfigSRAM Bank. Taking Config_Bank0 (corresponding to the first column of PE) as an example, as shown in Table 7.
[0154] Table 7 Configuration information address description
[0155] address Storage Format 0 {2'b0,config_num_2[17:12],config_num_1[11:6],config_num_0[5:0]} 1 {2'b0,config_num_5[17:12],config_num_4[11:6],config_num_3[5:0]} 2 {2'b0,ctrl_num_2[17:12],ctrl_num_1[11:6],ctrl_num_0[5:0]} 3 {2'b0,ctrl_num_5[17:12],ctrl_num_4[11:6],ctrl_num_3[5:0]} 4 {2'b0,weight_num_2[17:12],weight_num_1[11:6],weight_num_0[5:0]} 5 {2'b0,weight_num_5[17:12],weight_num_4[11:6],weight_num_3[5:0]} 6 {ultra_loop_num[19:10],outter_loop_num[9:0]} 7 {10'b0,ultra_loop_w_num[9:5],outter_loop_w_num[4:0]} … PE column program segment
[0156] The addresses in Table 7 are the corresponding storage addresses in the actual Config_Bank0. The order of parameter arrangement of each column of PE can be seen in the name suffix number in Table 7, such as config_num_0, config_num_1. Addresses 0 and 1 store the number of operation instructions of each PE in this column, config_num, and its range is 0 to 32. 0 means that the current PE does not need to load instructions, and 1 to 32 means loading 1 to 32 instructions; Addresses 2 and 3 store the number of state instructions ctrl_num for each PE in this column, and its range is the same as config_num; Addresses 4 and 5 store the number of weights weight_n stored for each PE in this column um, its range is the same as config_num; Addresses 6 and 7 store loop-related setting parameters (only exist in Config_Bank0), the lower 10 bits of address 6 are the number of small outer loops outter_loop_num, and the upper 10 bits are the number of large outer loops ultra_loop_num (both are 1 less than the actual number, for example, 0 means a total of 1 execution, 1 means a total of two executions), the lower 5 bits of address 7 are the number of weights that need to be skipped when switching small outer loops outter_loop_w_num, and the upper 5 bits are the number of weights that need to be skipped when switching large outer loops ultra_loop_w_num (indicated range of 0 to 31). When arranging program segments, for each Config_Bank, arrange all instructions that need to be stored in each PE in order from top to bottom in each column of PE, including operation instructions and status instructions, with operation instructions in front and status instructions in the back.
[0157] The array can flexibly control the WRF read address. The calculation formula is as follows:
[0158] WRF_addr_read
[0159] =WRF_addr_cfg+WRF_base_addr+WRF_base_addr_ol*outter_loop_w_num+WRF_base_addr_ul*ultra_loop_w_num
[0160] According to the embodiments of the present disclosure, the reconfigurable array can support 3 layers of loops, an inner loop (inner_loop) controlled by a PE instruction, a small outer loop (outter_loop) controlled by an outer_loop_num, and a large outer loop (ultra_loop) controlled by an ultra_loop_num. There are different ways to change the weight address in each layer of loop. For the inner loop, there is an offset address WRF_addr_cfg and a small loop base address WRF_base_addr. The small loop base address is incremented by PE_loopci. The other state instructions will not change the small loop base address. When in the PE_loopci state, before each inner loop is executed, WRF_base_addr will be added by 1. In the same small outer loop, WRF_base_addr will not be cleared once it changes until the next small outer loop. In the same large outer loop, the small outer loop base address WRF_base_addr_ol will increase the corresponding small outer loop weight increment outter_loop_w_num after each small outer loop ends, and will be cleared when switching large outer loops. The large outer loop base address WRF_base_addr_ul will increase the corresponding large outer loop weight increment ultra_loop_w_num after each large outer loop ends, and will not be cleared until the calculation is completed. outter_loop_num, ultra_loop_num, outter_loop_w_num, and ultra_loop_w_num are all given by parameters. The specific configuration method is shown in Table 7.
[0161] The overall process can be described as follows. Taking PE_loopci as an example, if it is PE_loopc, the inner_loop layer loop is removed and inner_loop=0 in the formula.
[0162]
[0163] in,
[0164]
[0165] The reason for adding 1 to the above formula is that the cycle recorded by PE_loopb must be included.
[0166] According to an embodiment of the present disclosure, a coarse-grained reconfigurable array computing method for deep learning is also proposed based on the above-mentioned coarse-grained reconfigurable array system for deep learning. The method includes:
[0167] Determining, by a controller, input information input to at least one processing unit, wherein the input information includes weights, input data, state instructions, and operation instructions, the state instructions are used to determine an execution state of the operation instructions, and the operation instructions are used by at least one processing unit to calculate the weights and the input data;
[0168] inputting weights and input data to at least one processing unit via an input bus;
[0169] inputting status instructions and operation instructions to at least one processing unit via a configuration bus;
[0170] Each processing unit calculates the weight and input data according to the operation instruction to obtain result data;
[0171] The resulting data is output via the output bus.
[0172] According to an embodiment of the present disclosure, the parameters of the number of operation instructions, the number of state instructions, the number of weights, the number of small outer loops, the number of large outer loops, the small outer loop weight base address increment, and the large outer loop weight base address increment of each PE can be loaded into the controller through the configuration bus.
[0173] According to an embodiment of the present disclosure, the controller can count the number of operation instructions and the number of status instructions of the PE, and load the operation instructions and status instructions to the corresponding PE through the configuration bus; in parallel, the controller controls the weights to be loaded to the corresponding PE through the input bus according to the number of weights.
[0174] According to the embodiment of the present disclosure, after the preloading of the state instruction, the operation instruction and the weight is completed, the reconfigurable array starts the execution phase, the top controller controls the small outer loop and the large outer loop of the reconfigurable array according to the number of small outer loops and the number of large outer loops, the small outer loop weight base address increment and the large outer loop weight base address increment, the PE controls the inner loop of the operation instruction and the WRF read address calculation according to the state instruction, and the PE can also determine the specific behavior of each cycle according to the operation instruction;
[0175] According to the embodiments of the present disclosure, during the execution phase, if there is a situation where the Din FIFO is empty or the Dout FIFO is full, the reconfigurable array enters an interrupt state to prevent the data flow beat from being disordered, and the scene is saved. After the interruption ends, the array continues to run;
[0176] According to the embodiments of the present disclosure, after all PEs have finished executing, the reconfigurable array enters an idle state, and weight reloading, loop parameter reloading, operation instruction reloading, state instruction reloading, or a random combination of the above four situations can be performed;
[0177] According to an embodiment of the present disclosure, after the reload is completed, the reconfigurable array restarts execution.
[0178] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0179] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A coarse-grained reconfigurable array system for deep learning, include: A controller, configured to determine input information input to at least one processing unit, wherein the input information includes weights, input data, state instructions, and operation instructions, wherein the state instructions are used to determine an execution state of the operation instructions, and the operation instructions are used by at least one of the processing units to calculate the weights and the input data; an input bus, for inputting the weight and the input data to at least one of the processing units; A configuration bus, used to input the state instruction and the operation instruction to at least one of the processing units; A processing unit group, comprising a plurality of the processing units, wherein the plurality of the processing units form a reconfigurable array, and each of the processing units is used to calculate the weight and the input data according to the operation instruction to obtain result data; An output bus, used for at least one of the processing units to output the result data; Wherein, the processing unit includes: An instruction register subunit, used for storing the operation instruction and the status instruction; An instruction decoding subunit, used for decoding the operation instruction and the status instruction; A weight storage subunit, used to store the weight or the input data; A local storage subunit for storing intermediate data; A logic operation subunit, used for calculating the weight and the input data according to the operation instruction to obtain the result data; Wherein, the logic operation subunit includes: At least two multipliers, at least two adders, and a plurality of selectors.
2. The system according to claim 1, in, The reconfigurable array formed by the multiple processing units in the processing unit group has a total of M columns and N rows, where M is an integer greater than or equal to 1, and N is an integer greater than or equal to 1, wherein: Each column of the processing units shares one input bus; Each row of the processing units shares one output bus; Each column of the processing units shares one configuration bus.
3. The system according to claim 2, in, Each of the input buses is connected to an input storage unit; Each of the output buses is connected to an output storage unit; Each of the configuration buses is connected to a configuration storage unit.
4. The system according to any one of claims 1 to 3, wherein the status instruction comprises a cycle period of the operation instruction, in, Each of the processing units is used to calculate the weight and the input data according to the operation instruction, and the result data obtained includes: According to the cycle, the processing unit calculates the weight and the input data according to the operation instruction to obtain the result data.
5. The system according to any one of claims 1 to 3, in, The instruction register subunit comprises: An operation instruction storage subunit, used for storing the operation instruction; The status instruction register subunit is used to store the status instruction.
6. The system according to any one of claims 1 to 3, in, The instruction decoding subunit comprises: An operation instruction decoding subunit, used for decoding the operation instruction; The status instruction decoding subunit is used to decode the status instruction.
7. The system according to claim 3, in, The configuration storage unit is used to store configuration information so that the control unit determines the input information according to the configuration information.
8. A coarse-grained reconfigurable array computing method for deep learning, include: Determining, by a controller, input information input to at least one processing unit, wherein the input information includes weights, input data, state instructions, and operation instructions, the state instructions are used to determine an execution state of the operation instructions, and the operation instructions are used by at least one of the processing units to calculate the weights and the input data; Inputting the weight and the input data to at least one of the processing units via an input bus; inputting the state instruction and the operation instruction to at least one of the processing units via a configuration bus; Calculate the weight and the input data according to the operation instruction by each processing unit to obtain result data; Output the result data via an output bus; The processing unit includes an instruction storage subunit, an instruction decoding subunit, a weight storage subunit, a local storage subunit and a logic operation subunit, and each of the processing units calculates the weight and the input data according to the operation instruction to obtain the result data, including: Storing the operation instruction and the status instruction by the instruction register subunit; Decoding the operation instruction and the status instruction by an instruction decoding subunit; Storing the weight or the input data by a weight storage subunit; Storing intermediate data via local storage subunits; Calculate the weight and the input data according to the operation instruction by a logic operation subunit to obtain the result data; Wherein, the logic operation subunit includes at least two multipliers, at least two adders and a plurality of selectors.
Citation Information
Patent Citations
System for circular convolution calculation data reuse of convolutional neural network
CN106250103A
A programmable device, its method of operation, and a computer usable medium
CN108805275A
In-memory calculation method based on coarse-grained reconfigurable array
CN112463719A
FPGA-based reconfigurable convolutional neural network accelerator
CN113222130A
Defect repair circuits for a reconfigurable data processor
US11327771B1
