Processing unit, systolic array, data processing method, and electronic device
The systolic array enhances operating speed and efficiency through dual-direction data transmission paths and selection modules, addressing limitations in existing systolic arrays.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SMARTER SILICON (SHANGHAI) TECH CO LTD
- Filing Date
- 2025-12-02
- Publication Date
- 2026-07-09
AI Technical Summary
Existing systolic arrays face challenges in improving operating speed and pipeline efficiency due to limitations in data transmission and processing.
The systolic array incorporates a processing unit with dual sets of data transmission paths in different directions for bidirectional data transmission, utilizing selection modules and delay modules to manage data flow and processing, enhancing data transmission efficiency.
This approach improves the operating speed and pipeline efficiency of the systolic array by allowing simultaneous data input from two directions, reducing data processing disorders and optimizing data transmission paths.
Smart Images

Figure CN2025139229_09072026_PF_FP_ABST
Abstract
Description
PROCESSING UNIT, SYSTOLIC ARRAY, DATA PROCESSING METHOD, AND ELECTRONIC DEVICECROSS-REFERENCE TO RELATED APPLICATION
[0001] The International Application claims priority to Chinese Patent Application No. 202411998812. X, titled “PROCESSING UNIT, SYSTOLIC ARRAY, DATA PROCESSING METHOD, AND ELECTRONIC DEVICE” filed with the China National Intellectual Property Administration on December 31, 2024, the entire content of which is incorporated herein by reference.TECHNICAL FIELD
[0002] The present disclosure generally relates to the data processing technology field and, more particularly, to a processing unit, a systolic array, a data processing method, and an electronic device.BACKGROUND
[0003] A systolic array is a parallel computing architecture that is implemented through hardware circuits. In some embodiments, the systolic array consists of a plurality of same processing elements (PE) according to a certain interconnection rule. Each processing element communicates with neighboring processing elements and performs certain computing tasks to execute matrix operations and other linear algebra operations efficiently.
[0004] A key idea of the systolic array is to let data flow in the array of processing elements to reduce a number of memory accesses, thereby improving computing frequency. Therefore, how to improve the operating speed and a pipeline efficiency in the systolic array has become an interesting research topic.SUMMARY
[0005] A processing unit in a systolic array includes a first set of data transmission paths for transmitting data in a first dimension and a second set of data transmission paths for transmitting data in a second dimension. The first set of data transmission paths is configured to transmit first data, and the second set of data transmission paths is configured to transmit second data.
[0006] The first set of data transmission paths includes a first data transmission path transmitting data in a first direction and a second data transmission path transmitting data in a second direction.
[0007] The second set of data transmission paths includes a third data transmission path transmitting data in a third direction and a fourth data transmission path transmitting data in a fourth direction.
[0008] In some embodiments, the first set of data transmission paths includes a first selection module configured to select, based on a selection signal, the first data transmission path to transmit the first data, or the second data transmission path to transmit the first data.
[0009] The second set of data transmission paths includes a second selection module configured to select, based on the selection signal, the third data transmission path to transmit the second data, or the fourth data transmission path to transmit the second data.
[0010] The processing unit further includes a data processing module. The data processing module includes a computing unit. The computing unit is located on data transmission paths of the first sets of data transmission paths and the second sets of data transmission paths and configured to process the first data and the second data to generate third data and store the third data.
[0011] In some embodiments, the first set of data transmission paths further includes a first set of output ports in the first dimension, and the second set of data transmission paths further includes a second set of output ports in the second dimension.
[0012] The first set of output ports includes a first output port and a second output port. The first output port and the second output port are configured to output the first data. The second set of output ports includes a third output port and a fourth output port. The third output port and the fourth output port are configured to output the second data.
[0013] A first data output terminal of the computing unit is connected to the first set of output ports.
[0014] A second data output terminal of the computing unit is connected to the second set of output ports.
[0015] In some embodiments, the first set of data transmission paths further includes a first set of input ports in the first dimension, and the second set of data transmission paths further includes a second set of input ports in the second dimension. The first set of input ports includes a first input port and a second input port, and the first input port and the second input port are configured to input the first data. The second set of input ports includes a third input port and a fourth input port. The third input port and the fourth input port are configured to input the second data.
[0016] Two input terminals of the first selection module are connected to the first input port and the second input port, and an output terminal is connected to a first data input terminal of the computing unit.
[0017] Two input terminals of the second selection module are connected to the third input port and the fourth input port, and an output terminal is connected to a second data input terminal of the computing unit.
[0018] Control terminals of the first selection module and the second selection module are configured to input selection signals.
[0019] In some embodiments, the processing unit further includes a selection signal generation module configured to generate a corresponding selection signal based on signal input statuses of the two input terminals of the first selection module or the two input terminals of the second selection module. A selection signal output terminal of the selection signal generation module is connected to the control terminals of the first selection module and the second selection module.
[0020] The selection signal generation module is configured to generate a first selection signal when the first input port first receives the first data or the third input port first receives the second data, to allow the first selection module to select the first data transmission path to transmit the first data and the second selection module to select the third data transmission path to transmit the second data.
[0021] The selection signal generation module is further configured to generate a second selection signal when the second input port first receives the first data or the fourth input port first receives the second data, to allow the first selection module to select the second data transmission path to transmit the first data and the second selection module to select the fourth data transmission path to transmit the second data.
[0022] In some embodiments, the systolic array further includes a first delay module and a second delay module.
[0023] Two input terminals of the first delay module are connected to the first input port and the second input port, and two output terminals of the first delay module are connected to two input terminals of the first selection module. The first delay module is connected to delay the first data for one cycle and output the first data to the first selection module.
[0024] Two input terminals of the second delay module are connected to the third input port and the fourth input port, and two output terminals of the second delay module are connected to the two input terminals of the second selection module. The second delay module is configured to delay the second data for one cycle and output the second data to the second selection module.
[0025] The two input terminals of the selection generation module are connected to the two input terminals of the first delay module or the two input terminals of the second delay module.
[0026] A systolic array includes m *n processing units. The processing units include a first set of data transmission paths for transmitting data in a first dimension and a second set of data transmission paths for transmitting data in a second dimension. The first set of data transmission paths is configured to transmit first data, and the second set of data transmission paths is configured to transmit second data.
[0027] The first set of data transmission paths includes a first data transmission path for transmitting data in a first direction and a second data transmission path for transmitting data in a second direction.
[0028] The second set of data transmission paths includes a third data transmission path for transmitting data in a third direction and a fourth data transmission path for transmitting data in a fourth direction.
[0029] In some embodiments, processing units in a first row and processing units in an n-th column of the m*n processing units are first processing units, and the remaining processing units are second processing units, or processing units in an m-th row and processing units in a first column of the m*n processing units are first processing units, and the remaining processing units are second processing units, wherein m > 1 and / or n > 1.
[0030] The first processing units generate selection signals based on the input statuses of data input ports of the first set of data transmission paths and / or second set of data transmission paths and, based on the selection signals, select to input the first data transmitted by the first data transmission path and the second data transmitted by the third data transmission path, and output the first data and the second data to downstream processing units through the first set of data transmission paths and the second set of data transmission paths.
[0031] The second processing units are configured to receive data output from upstream processing units and, based on the selection signals received from upstream processing units, select to input the first data transmitted by the first data transmission path and the second data transmitted by the third data transmission path and output the first data and the second data to downstream processing units through the first set of data transmission paths and the second set of data transmission paths.
[0032] The first processing units generate the selection signals based on the input statuses of the data input ports of the first set of data transmission paths and / or the second set of data transmission paths, based on the selection signals, select to input the first data transmitted by the second data transmission path and the second data transmitted by the fourth data transmission path, and output the first data and the second data to the downstream processing units through the first set of data transmission paths and the second set of data transmission paths.
[0033] The second processing units are configured to receive data output by the upstream processing units, and, based on the selection signals output by the upstream processing units, select to input the first data transmitted by the second data transmission path and the second data transmitted by the fourth data transmission path and output the first data and the second data to the downstream processing units through the first set of data transmission paths and the second set of data transmission paths.
[0034] In some embodiments, the systolic array includes: a first processing unit and a second processing unit adjacent to each other and in the first dimension, a first output port of the first processing unit being connected to a first input port of the second processing unit, and a second input port of the first processing unit being connected to a second output port of the second processing unit; and a first processing unit and a second processing unit adjacent to each other and in the second dimension, a third output port of the first processing unit being connected to a third input port of the second processing unit, and a fourth input port of the first processing unit being connected to a fourth output port of the second processing unit.
[0035] In some embodiments, second processing units located along several diagonal directions in parallel to an array diagonal direction are connected to selection signal output terminals of the first processing units along the array diagonal direction.
[0036] An electronic device includes the systolic array or a systolic array composed of processing units.
[0037] A data processing method applied to a systolic array. The systolic array includes m * n processing units. The processing units include a first set of data transmission paths for transmitting data in a row direction and a second set of data transmission paths for transmitting data in a column direction. The first set of data transmission paths transmits first data, and the second set of data transmission paths transmits second data, and each set includes 2 data transmission directions. In response to m=n, the method includes, at a same moment, controlling a processing unit at i-th row and j-th column to transmit the first data through a first data transmission path and the second data through a third data transmission path, and controlling a processing unit at (m+1-i) -th row and (n+1-j) -th column to transmit the first data through a second data transmission path and the second data through a fourth data transmission path.
[0038] The processing unit at i-th row and j-th column and a processing unit at r-row and s-column transmit data simultaneously, i+j = r+s, i and r being integers not smaller than 1 and not greater than m in sequence, and j and s being integers not smaller than 1 and not greater than in sequence.
[0039] In some embodiments, in the row direction, starting from a first column, second data of columns starting from a first column in a second data matrix is input to processing units of a first row of different columns after the columns being delayed for one cycle starting from the first column. Each piece of second data of the columns in the second data array is transmitted to processing units of a next row, row by row, according to a data transmission cycle. Meanwhile, starting from a last column, the columns are delayed for one cycle, second data of columns starting from a last column in the second data matrix is input to processing units of the last row of previous columns. Each piece of second data of the columns in the second data array is transmitted to processing units of a previous row, row by row, according to the data transmission cycle.
[0040] In the column direction, after the rows starting from the first row being delayed for one cycle, first data of the rows starting from the first row in the first data matrix is input to processing units of a first column of the rows. Each piece of first data of the rows in the first data array is transmitted to processing units of a next column by column according to the data transmission cycle. Meanwhile, starting from the last row, the rows are delayed for once cycle, the first data of the rows starting from the last row in the first data matrix is input to the processing units of the last column of the rows. Each piece of first data of the columns in the first data array is transmitted to the processing units of the previous column, column by column, according to the data transmission cycle.
[0041] In some embodiments, the data processing method further includes, according to processing units of a first row and processing units of a last column or data input statuses of the processing units of the first row and the processing units of the last column in the systolic array, based on the input states of the first-row and last-column units, or first-column and last-row units, selecting a data transmission path of a corresponding direction to allow the processing units in the diagonal direction to select a same data transmission direction at a same moment.
[0042] In some embodiments, the data processing method further includes: after the processing unit at the first row and the n-th column outputs a third signal, synchronously outputting the third data stored in the processing units of the rows, and the third signal indicates that a data processing process of the processing unit at the first row and the n-th column ends; or after the processing unit at the m-th row and the first column outputs a third signal, synchronously outputting the third data stored in the processing units of the rows, and the third signal indicates that a data processing process of the processing unit at the m-th row and the first column ends.
[0043] An electronic device includes a systolic array, a processor, and a memory. The systolic array is the systolic array above. The memory stores a computer program. The processor is configured to execute the computer program to allow the electronic device to implement the data processing method above.BRIEF DESCRIPTION OF THE DRAWINGS
[0044] To more clearly illustrate the technical solutions of the present disclosure or related technologies, the accompanying drawings used in the description of embodiments or the existing technologies are briefly described below. Apparently, the accompanying drawings described below are merely embodiments of the present disclosure. For those ordinary skills in the art, other accompanying drawings can also be obtained according to the provided accompanying drawings without creative efforts.
[0045] The structures, proportions, sizes, etc. depicted in the accompanying drawings of the present disclosure are only used to cooperate with the contents disclosed in the present disclosure for those skilled in the art to understand and read and are not used as restriction conditions of restricting embodiments of the present disclosure. Thus, the structures, proportions, sizes, etc. have no substantive technical significance. Any modification of structures, change of proportional relationships, or adjustment of sizes, under the condition of not affecting the effects and purposes that can be achieved by the present disclosure, should be within the scope of the present disclosure.
[0046] FIG. 1 illustrates a schematic diagram of a processing unit according to embodiments of the present disclosure.
[0047] FIG. 2 illustrates a schematic diagram of another processing unit according to embodiments of the present disclosure.
[0048] FIG. 3 illustrates a schematic structural diagram of the processing unit of FIG. 2.
[0049] FIG. 4 illustrates a schematic structural diagram of the processing unit of FIG. 1.
[0050] FIG. 5 illustrates another schematic structural diagram of the processing unit of FIG. 1.
[0051] FIG. 6 illustrates another schematic structural diagram of the processing unit of FIG. 1.
[0052] FIG. 7 illustrates a schematic diagram of a data transmission path of a first delay module in a processing unit according to embodiments of the present disclosure.
[0053] FIG. 8 illustrates a schematic diagram of another data transmission path of a first delay module in a processing unit according to embodiments of the present disclosure.
[0054] FIG. 9 illustrates a schematic diagram showing a data processing process of a calculation unit in a processing unit according to embodiments of the present disclosure.
[0055] FIG. 10 illustrates a schematic diagram of a systolic array according to embodiments of the present disclosure.
[0056] FIG. 11 illustrates a schematic diagram of another systolic array according to embodiments of the present disclosure.
[0057] FIG. 12 illustrates a schematic local diagram of a systolic array according to embodiments of the present disclosure.
[0058] FIG. 13 illustrates a schematic diagram showing a data transmission method in a systolic array in a data processing method according to embodiments of the present disclosure.
[0059] FIG. 14 illustrates a schematic diagram showing another data transmission method in a systolic array in a data processing method according to embodiments of the present disclosure.
[0060] FIG. 15 to FIG. 24 illustrate a schematic diagram showing a data input process when a data matrix is input bi-directionally by a systolic array in a same dimension in another data processing method according to embodiments of the present disclosure.
[0061] FIG. 25 illustrates a schematic diagram of selecting a signal transmission direction in another data processing method according to embodiments of the present disclosure.
[0062] FIG. 26 illustrates a schematic diagram of selecting another signal transmission direction in another data processing method according to embodiments of the present disclosure.
[0063] FIG. 27 illustrates a schematic diagram of an output result after synchronously outputting third data stored in processing units of different rows, third data stored in processing units of a same row being output sequentially from a left side of the systolic array when the data matrix is input bi-directionally in a same dimension by the systolic array according to embodiments of the present disclosure.
[0064] FIG. 28 illustrates a schematic diagram of an output result after synchronously outputting third data stored in processing units of different rows sequentially based on completion time of data processing processes of the corresponding processing units, third data stored in processing units of a same row being output sequentially from a left side of the systolic array when the data matrix is input bi-directionally in a same dimension by the systolic array according to embodiments of the present disclosure.
[0065] FIG. 29 illustrates a schematic structural diagram of an electronic device according to embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0066] Embodiments of the present disclosure are described in detail in connection with the accompanying drawings of embodiments of the present disclosure. Obviously, the described embodiments are only some embodiments of the present disclosure, not all the embodiments. Based on embodiments of the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts should be within the scope of the present disclosure.
[0067] Without departing from the spirit or scope of the present disclosure, various modifications and changes can be made in the present disclosure, which are obvious to those skilled in the art. Therefore, the present disclosure is intended to cover the modifications and changes of the present disclosure that fall within the scope of the corresponding claims (the technical solutions requested for protection) and their equivalents. Implementation provided by embodiments of the present disclosure can be combined with each other where there is no conflict.
[0068] To make the above-mentioned objectives, features, and advantages of the present disclosure more obvious and understandable, the present disclosure can be described further in detail in connection with the accompanying drawings and specific implementations.
[0069] As described in the background section, how to improve the operating speed and the pipeline operating efficiency in the systolic array needs to be solved.
[0070] Thus, embodiments of the present disclosure provide a processing element (PE) in a systolic array. As shown in FIG. 1, the processing element (PE) includes a first set of data transmission paths a for data transmission in a first dimension X and a second set of data transmission paths b for data transmission in a second dimension Y. The first set of data transmission paths a is configured to transmit first data, and the second set of data transmission paths b is configured to transmit second data, thereby realizing the data transmission in the data array. The first dimension X and the second dimension Y are different.
[0071] In some embodiments, as shown in FIG. 1, the first set of data transmission paths a includes a first data transmission path a1 for transmitting data along a first direction and a second data transmission path a2 for transmitting data along a second direction. The second set of data transmission paths b includes a third data transmission path b1 for transmitting data along a third direction and a fourth data transmission path b2 for transmitting data along a fourth direction. The first direction and the second direction are different, and the third direction and the fourth direction are different. Thus, the processing element (PE) can bidirectionally transmit data in the same dimension, thereby enabling the processing element (PE) , when applied to the systolic array, to simultaneously receive data matrices from two directions. Thus, the operating speed and the pipeline operating efficiency of the systolic array can be improved.
[0072] In embodiments of the present disclosure, the first direction and the second direction can be opposite, and the third direction and the fourth direction can be opposite.
[0073] As shown in FIG. 2 and FIG. 3, in embodiments of the present disclosure, the first set of data transmission paths of the processing element includes a first selection module 10. The first selection module 10 is configured to select, based on a selection signal select, the first data transmission path a1 to transmit first data, or select the second data transmission path a2 to transmit the first data. Thus, the processing element (PE) only selects one data transmission path to transmit the first data in the first dimension at one time, thereby avoiding disorder in the data processing process of the processing element (PE) . The second set of data transmission paths includes a second selection module 20. The second selection module 20 is configured to select, based on the selection signal select, the third data transmission path b1 to transmit second data, or the fourth data transmission path b2 to transmit the second data. Thus, the processing element (PE) only selects one data transmission path to transmit the second data in the second dimension at one time, thereby avoiding disorder in the data processing process of the processing element (PE) .
[0074] In embodiments of the present disclosure, as shown in FIG. 3, the selection module 10 and the selection module 20 are implemented by a MUX selector. When the selection signal select is 1, the first selection module 10 selects the first data transmission path a1 to transmit the first data, and the second selection module 20 selects the third data transmission path b1 to transmit the second data. When the selection signal select is 0, the first selection module 10 selects the second data transmission path a2 to transmit the first data, and the second selection module 20 selects the fourth data transmission path b2 to transmit the second data.
[0075] In some embodiments, as shown in FIG. 3, the processing element (PE) further includes a data processing module. The data processing module includes a computing unit 30. The computing unit 30 is arranged on a data transmission path of the first set of data transmission paths a and the second set of data transmission paths b, and is configured to process the first data and the second data to generate and store third data.
[0076] Based on the above embodiments, in embodiments of the present disclosure, as shown in FIG. 1 to FIG. 3, the first set of data transmission paths a of the processing element (PE) includes a first set of input ports arranged on the first dimension X, and the second set of data transmission paths b includes a second set of input ports arranged on the second dimension Y. The first set of input ports includes a first input port a1i and a second input port a2i. The first input port a1i and the second input port a2i are configured to input the first data. The second set of input ports includes a third input port b1i and a fourth input port b2i. The third input port b1i and the fourth input port b2i are configured to input the second data.
[0077] In embodiments of the present disclosure, the first set of data transmission paths of the processing element (PE) can further include a first set of output ports arranged on the first dimension, and the second set of data transmission paths can further include a second set of output ports arranged on the second dimension. As shown in FIG. 2 and FIG. 3, the first set of output ports of the processing element (PE) includes a first output port a1o and a second output port a2o. When the first data transmission path a1 transmits the first data, the first output port a1o can output the first data transmitted in the first data transmission path a1. When the second data transmission path a2 transmits the first data, the second output port a2o can output the first data transmitted in the second data transmission path a2. The second set of output ports includes a third output port b1o and a fourth output port b2o. When the third data transmission path b1 transmits the second data, the third output port b1o can output the second data transmitted in the third data transmission path b1. When the fourth data transmission path b2 transmits the second data, the fourth output port b2o can output the second data transmitted in the fourth data transmission path b2.
[0078] As shown in FIG. 3, in some embodiments, the first data output end of the computing unit 30 is connected to the first set of output ports to transmit the first data outward through the first set of output ports. The second data output end of the computing unit 30 is connected to the second set of output ports to transmit the second data outward through the second set of output ports.
[0079] In some embodiments, the signal transmission path between the first input port a1i and the first output port a1o can be the signal transmission path of the first data transmission path a1. That is, when the first data transmission path a1 transmits the first data, the first data can be input from the first input port a1i and transmitted along the first data transmission path a1 to the first output port a1o for output.
[0080] The signal transmission path between the second input port a2i and the second output port a2o can be the signal transmission path of the second data transmission path a2. That is, when the second data transmission path a2 transmits the first data, the first data can be input from the second input port a2i and transmitted along the second data transmission path a2 to the second output port a2o for output.
[0081] The signal transmission path between the third input port b1i and the third output port b1o can be the signal transmission path of the third data transmission path b1. That is, when the third data transmission path b1 transmits the second data, the second data can be input from the third input port b1i, and transmitted along the third data transmission path b1 to the third output port b1o for output.
[0082] The signal transmission path between the fourth input port b2i and the fourth output port b2o can be the signal transmission path of the fourth data transmission path b2. That is, when the fourth data transmission path b2 transmits the second data, the second data can be input from the fourth input port b2i, and transmitted along the fourth data transmission path b2 to the fourth output port b2o for output.
[0083] Based on the above embodiments, in embodiments of the present disclosure, the two input terminals of the first selection module 10 can be connected to the first input port a1i and the second input port a2i, respectively. The output terminal can be connected to the first data input terminal of the computing unit 30, and the control terminal can be configured to input the selection signal select. Based on the selection signal select, the first selection module can be configured to select whether to input the data output from the first input port a1i or the data output from the second input port a2i. When the selection signal is 1, the data output by the first input port a1i can be input to the first data input terminal of the computing unit 30. When the selection signal is 0, the data output by the second input port a2i can be input to the first data input terminal of the computing unit 30.
[0084] The two input terminals of the second selection module 20 can be connected to the third input port b1i and the fourth input port b2i, respectively. The output terminal can be connected to the second data input terminal of the computing unit 30. The control terminal can be configured to input the selection signal select. Based on the selection signal select, the second selection module 20 can select to input the data output from the third input port b1i or the data output from the fourth input port b2i. For example, when the selection signal is 1, the data output from the third input port b1i can be input to the second data input terminal of the computing unit 30. When the selection signal is 0, the data output from the fourth input port b2i can be input to the second data input terminal of the computing unit 30.
[0085] In embodiments of the present disclosure, as shown in FIG. 4, the processing element further includes a selection signal generation module 40, which is configured to generate a corresponding selection signal select based on the signal input statuses of the two input terminals of the first selection module 10 or the two input terminals of the second selection module 20. The selection signal output terminal of the selection signal generation module 40 is connected to the control terminals of the first selection module 10 and the second selection module 20. Then, the corresponding selection signal select can be generated and output to the control terminals of the first selection module and the second selection module based on the signal input statuses of the two input terminals of the first selection module 10 and the two input terminals of the second selection module 20.
[0086] In some embodiments, the selection signal generation module 40 can be configured to generate a first selection signal when the first input port a1i first receives the first data or the third input port b1i first receives the second data. Then, the first selection module 10 can select the first data transmission path a1 to transmit the first data. The second selection module 20 can select the third data transmission path b1 to transmit the second data.
[0087] The selection signal generation module 40 can be further configured to generate a second selection signal when the second input port a2i first receives the first data or the fourth input port b2i first receives the second data. Then, the first selection module 10 can select the second data transmission path a2 to transmit the first data. The second selection module 20 can select the fourth data transmission path b2 to transmit the second data.
[0088] Based on the above description, in some embodiments, the processing element can include two data transmission paths in different directions on the same dimension. When data is selected for input, the data transmitted by the first data transmission path and the third data transmission path can be selected based on whether the first input port a1i and the third input port b1i first receive the valid data, or the second input port a2i and the fourth input port b2i first receive the valid data. If the first input port a1i and the second input port a2i receive the valid data simultaneously, the processing unit can arbitrarily select to input any of the data input from the first input port a1i or the data input from the second input port a2i. Similarly, if the third input port b1i and the fourth input port b2i receive the valid data simultaneously, the processing unit can select arbitrarily or based on the default configuration to input any of the data input from the third input port b1i or the data input from the fourth input port b2i.
[0089] In some embodiments of the present disclosure, as shown in FIG. 4 and FIG. 5, the selection signal generation module 40 includes a logic element 41 and a trigger assembly 42.
[0090] The logic element 41 includes a fifth input port, a sixth input port, and a fifth output port.
[0091] The trigger assembly 42 includes a seventh input port D1, an eighth input port D2, and a sixth output port Q2. The seventh input port D1 is connected to the fifth output port of the logic element 41. The eighth input port D2 is connected to the fifth output port of the logic element 41.
[0092] Based on the above embodiments, in embodiments of the present disclosure, when the first signal a1_pre is input to the fifth input port of the logic element 41, the eighth input port D2 can output the first selection signal, e.g., the first selection signal is 1. When the second signal a2_pre is input to the fifth input port of the logic element 41, the eighth input port D2 can output the second selection signal, e.g., the first selection signal is 0. The first signal a1_pre can indicate that the first data is input to the first input port a1i of the first data transmission path a1. The second selection signal a2_pre can indicate that the first data is input to the second input port a2i of the second data transmission path a2.
[0093] In some other embodiments of the present disclosure, as shown in FIG. 5, when the first signal b1_pre is input to the fifth input port of the logic element 41, the eighth input port D2 outputs the first selection signal, e.g., the first selection signal is 1. When the second signal b2_pre is input to the fifth input port of the logic element 41, the eighth input port D2 outputs the second selection signal, e.g., the first selection signal is 0. The first signal b1_pre can indicate that the third input port b1i of the third data transmission path b1 can input the second data. The second signal b2_pre can indicate that the fourth input port b2i of the fourth data transmission path b2 can input the second data.
[0094] Hereinafter, the processing unit of the systolic array of embodiments of the present disclosure can be described by taking the first signal a1_pre indicating that the first input port a1i of the first data transmission path a1 inputs the first data, and the second signal a2_pre indicating that the second input port a2i of the second data transmission path a2 inputs the first data as an example.
[0095] In embodiments of the present disclosure, the trigger assembly 42 includes a first trigger unit 421 and a second trigger unit 422. The first trigger unit 421 includes an input port D1, an input port E1, an output port Q1, and an output port Qn1. The second trigger unit 422 includes an input port D2, an input port E2, an output port Q2, and an output port Qn2. The input port D1 of the first trigger unit 421 is the seventh input port of the trigger assembly. The input port E1 is connected to the output port Qn1. The output port Qn1 is connected to the input port E2 of the second trigger unit 422. The input port D2 of the second trigger unit 422 is connected to the fifth input port of the logic element 41. The output port Q2 is the sixth output port of the trigger assembly and is configured to output the selection signal.
[0096] In the above embodiments, the first trigger unit 421 further includes a first reset terminal RST1, configured to input a reset signal. The second trigger unit 422 includes a second reset terminal RST2, configured to input a reset signal. Before the systolic array starts operating, reset signals can be input to the first reset terminal and the second reset terminal to cause E1 to be 1 and E2 to be 1. If E1 is 1, the signal input to the input port D1 can be output from Q1 with a delay of one cycle. Similarly, if E2 is 1, the signal input to the input port D2 can be output from Q2 with a delay of one cycle. If E1 is 0, the signal input to the input port D1 may not be transferred to Q1. Similarly, if E2 is 0, the signal input to the input port D2 may not be transferred to Q2. When Q1 is 1, Qn1 is 0. When Q1 is 0, Qn1 is 0. Similarly, when Q2 is 1, Qn2 is 0. When Q2 is 0, Qn2 is 1.
[0097] In embodiments of the present disclosure, the logic element can be an OR gate. In some embodiments, the operation process of the selection generation module can include the following process.
[0098] In an initial state, E1 is 1, and E2 is 1. If a1_pre is 1, and a2_pre is 0, the logic element 41 outputs 1, D1 is 1, and D2 is 1, and in the next cycle, Q1 is 1, Q2 is 1, Qn1 is 0, E2 is 0, and Q2 keeps outputting 1. The first selection module 10 can select the signal input to the first input port a1i. The second selection module 20 can select the signal input to the third input port b1i. Meanwhile, the second trigger unit 422 can store the value of a1_pre (i.e., the output signal of the logic element) until a next reset signal arrives.
[0099] In the initial state, E1 is 1, and E2 is 1. If a1_pre is 0 and a2_pre is 1, the logic element 41 outputs 1, D1 is 1, and D2 is 0. In the next cycle, Q1 is 1, Q2 is 0, Qn1 is 0, E2 is 0, and Q2 keeps outputting 0. The first selection module 10 can select the signal input from the second input port a2i, and the second selection module 20 can select the signal input from the fourth input port b2i. Meanwhile, the second trigger unit 422 can store the value of a1_pre (i.e., the output signal of the logic element) until a next reset signal arrives.
[0100] If a1_pre is 1, and a2_pre is 1, the logic element 41 can output 1, D1 is 1, D2 is 1, and in the next cycle Q1 is 1, Q2 is 1, Qn1 is 0, E2 is 0, and Q2 keeps outputting 1. The first selection module 10 can select the signal input to the first input port a1i. The second selection module 20 can select the signal input to the third input port b1i. Meanwhile, the second trigger unit 422 can store the value of a1_pre (i.e., the output signal of the logic element) until the next reset signal arrives.
[0101] In the above embodiments, the output signal a_pre of the logic element can also be output to a downstream processing unit of the processing unit to notify the downstream processing unit that the data in the processing unit is valid data.
[0102] In some other embodiments of the present disclosure, the processing unit may not include the selection signal generation module, and can only include one logic element. As shown in FIG. 2, the processing unit does not generate a selection signal but receives the selection signal output by an upstream processing unit of the processing unit. As shown in FIG. 3, according to the selection signal input, the processing unit selects whether to input the first data input to the first input port a1i and the second data input to the third input port b1i, or to input the first data input to the second input port a2i and the second data input to the fourth input port b2i. Meanwhile, the first signal a1_pre and the second signal a2_pre corresponding to the processing unit can be calculated to obtain a value based on an OR operation, which can be used as a new a_pre value for output and transmitted to the downstream processing unit.
[0103] In embodiments of the present disclosure, as shown in FIG. 6, the first data transmission path a1 includes two signal transmission paths, which are configured to transmit the first data a1_data and a first valid signal a1_valid indicating that the first data is valid, respectively. The second data transmission path a2 includes two signal transmission paths, which are configured to transmit the first data a2_data and the second valid signal a2_valid, indicating that the second data is valid, respectively. For example, a1_valid is 1, and a2_valid is 0 to indicate that the first data a1_data transmitted by the first data transmission path is valid data. a1_valid is 0, and a2_valid is 1 to indicate that the first data a2_data transmitted by the second data transmission path is valid data.
[0104] As described above, since the output terminal Q2 of the second trigger unit outputs the selection signal select one cycle later than the time when the signal is input to the input terminal D2, the selection generation module can output the selection signal one cycle later than the time when the signal is input to the input terminal of the logic element. If a1_valid and a2_valid are directly input into the two input terminals of the logic element, the time when the selection signal is input to the control terminal of the first selection module can be one cycle later than the time when the signals are input to the two input terminals of the first selection module, and the time when the selection signal is input to the control terminal of the second selection module can be one cycle later than the time when the signals are input to the two input termina of the second selection module.
[0105] Thus, based on the above embodiments, in embodiments of the present disclosure, the processing unit can further include a first delay module and a second delay module.
[0106] Two input terminals of the first delay module can be connected to the first input port and the second input port, respectively. Two output terminals can be connected to the two input terminals of the first selection module to output the first data with one cycle delay to the first selection module. Thus, the signals input to the two input terminals of the first selection module and the selection signal input to the control terminal can be input to the first selection module simultaneously.
[0107] Two input terminals of the second delay module can be connected to the third input port and the fourth input port, respectively. Two output terminals can be connected to the two input terminals of the second selection module, respectively, to output the second data with one cycle delay to the selection module. Thus, the signals input to the two input terminals of the second selection module and the selection signal input to the control terminal can be input to the second selection module simultaneously. In the above embodiments, the two input terminals of the selection module can be connected to the two input terminals of the first delay module or the two input terminals of the second delay module, respectively.
[0108] In embodiments of the present disclosure, the first delay module and the second delay module can be implemented by registers, which is not limited in the present disclosure.
[0109] Hereinafter, the operation principle of the first delay module can be described by taking the two input terminals of the selection generation module being connected to the two input terminals of the first delay module, respectively, as an example.
[0110] In some embodiments, as shown in FIG. 7, the first valid signal a1_valid0 indicating whether the first data a1_data0 is valid is directly used as the first signal a1_pre and input to the fifth input port of the logic element 41. That is, one input terminal of the selection generation module 40 is selected. The first valid signal a1_valid0 indicating whether the first data a1_data0 is valid and the first data a1_data0 are input to the input terminal of the first delay module REG1, and output to the first input port a1i of the first selection module 10 after being delayed for one cycle by the first delay module REG1. Thus, the first data a1_data and the first valid signal a1_valid input to the first input port a1i of the first selection module 10 and the selection signal input to the control terminal are input to the first selection module 10 simultaneously.
[0111] Similarly, as shown in FIG. 8, the second valid signal a2_valid0 indicating whether the first data a2_data0 is valid is directly used as the second signal a2_pre and input to the sixth input port of the logic element 41. That is, another input terminal of the selection generation module 40 is selected. The second valid signal a2_valid0 indicating whether the first data a2_data0 is valid and the first data a2_data0 are input to the input terminal of the first delay module REG1 and output to the second input port a2i of the first selection module 10 after being delayed for one cycle by the first delay module REG1. Thus, the first data a2_data and the second valid signal a2_valid indicating whether the first data a2_data is valid of the second input port a2i of the first selection module 10 and the selection signal input to the control terminal are input to the first selection module 10 simultaneously.
[0112] In the above embodiments, the first delay module can realize the delay of the data input to the first input port and the delay of the data input to the second input port through different delay units (e.g., registers) or the same delay unit (e.g., register) , which is not limited in the present disclosure.
[0113] Based on the above embodiments, in embodiments of the present disclosure, for example, as shown in FIG. 9, a computing unit 30 is configured to realize a convolution operation. The computing unit 30 can perform the convolution operation on the first data output by the first selection module 10 and the second data output by the second selection module 20 (corresponding to Mul in FIG. 9) , and perform accumulation operation (corresponding to acc in FIG. 9) with the third data stored in the last cycle (corresponding to psum in FIG. 9) to obtain the third data of the current moment (psum sel in FIG. 9) . The computing unit 30 can be further configured to store the third data of the current moment (psum reg in FIG. 9) and output the third data of the current moment (psumo in FIG. 9) . The computing unit 30 can be further configured to output the first data output by the first selection module 10 after one delay unit reg through the first output port a1o and the second output port a2o in the next cycle. The computing unit 30 can be further configured to output the second data output by the second selection module 20 after one delay unit reg through the third output port b1o and the fourth output port b2o in the next cycle. In some embodiments, the delay unit can be implemented by a register, which is not limited in the present disclosure.
[0114] In embodiments of the present disclosure, the processing unit PE can further include a third data input terminal and a third data output terminal. The third data input terminal of the processing unit PE can be connected to the third data output terminal of the upstream processing unit PE and can be configured to receive the third data output by the third data output terminal of the processing unit at the upstream node. The third data output terminal of the processing unit PE can be connected to the third data input terminal of the downstream processing unit PE and can be configured to transmit the third data to the processing unit PE at the downstream node.
[0115] Correspondingly, as shown in FIG. 10, embodiments of the present disclosure further provide a systolic array. The systolic array includes m *n processing units Pes (e.g., a first processing unit PE_1 and a second processing unit PE_2) . The processing units PE can include the first set of data transmission paths a configured to transmit data in the first dimension X and the second set of data transmission paths b configured to transmit data in the second dimension Y. The first set of data transmission paths a can be configured to transmit the first data, and the second set of data transmission paths b can be configured to transmit the second data.
[0116] The first set of data transmission paths a includes a first data transmission path a1 for transmitting data along the first direction and a second data transmission path a2 for transmitting data along the second direction. The first direction can be different from the second direction.
[0117] The second set of data transmission paths b can include a third data transmission path b1 for transmitting data along the third direction and a fourth data transmission path b2 for transmitting data along the fourth direction. The third direction and the fourth direction can be different.
[0118] In embodiments of the present disclosure, the first direction can be opposite to the second direction, and the third direction can be opposite to the fourth direction.
[0119] In the systolic array provided in embodiments of the present disclosure, the processing unit PE can transmit data bidirectionally in the same dimension. Thus, when the processing unit PE is applied to the systolic array, the systolic array can receive data matrix bidirectionally to improve the operating speed and the pipeline operating efficiency of the systolic array.
[0120] In embodiments of the present disclosure, as shown in FIG. 10, the processing unit of the first row and the processing unit of the n-th column in the m *n processing units are first processing units PE_1, and the rest processing units are second processing units PE_2. In some other embodiments of the present disclosure, the processing unit of the m-th row and the processing unit of the first column in the m *n processing units can be the first processing units PE_1, and the rest processing units can be the second processing units PE_2, where m is greater than 1, and / or n is greater than 1, which is not limited in the present disclosure.
[0121] The systolic array provided by embodiments of the present disclosure can be described by taking the processing unit of the first row and the processing unit of the n-th column in the m *n processing units as the first processing units PE_1 for example.
[0122] In some embodiments, the first processing unit PE_1 can generate the selection signal select based on the input statuses of the data input ports of the first set of data transmission paths a and / or the second set of data transmission paths b. For example, the selection signal can be the first selection signal. The first data transmitted by the first data transmission path a1 can be selected for input, and the second data transmitted by the third data transmission path b1 can be selected for input based on the selection signal select. The first data and the second data can be output to the downstream processing unit through the first set of data transmission paths a and the second set of data transmission paths b. The second processing unit PE_2 can be configured to receive the data output by the processing unit at the upstream node and select the first data transmitted by the first data transmission path a1 and the second data transmitted by the second data transmission path b1 for input based on the selection signal select output by the upstream processing unit. The second processing unit PE_2 can be further configured to output the first data and the second data to the downstream processing unit through the first set of data transmission paths a and the second set of data transmission paths b.
[0123] In some other embodiments, the first processing unit PE_1 can generate the selection signal select based on the input statuses of the data input ports of the first set of data transmission paths a and / or the second set of data transmission paths b. For example, the selection signal can be the second selection signal. The first processing unit PE_1 can be configured to select the first data transmitted by the second data transmission path a2 and the second data transmitted by the fourth data transmission path b2 for input based on the selection signal select. The first processing unit PE_1 can be further configured to output the first data and the second data to the downstream processing unit through the first set of data transmission paths a and the second set of data transmission paths b.
[0124] The second processing unit PE_2 can be configured to receive the data output by the processing unit at the upstream node and select the first data transmitted by the second data transmission path a2 and the second data transmitted by the fourth data transmission path b2 for input based on the selection signal select output by the upstream processing unit. The second processing unit PE_2 can be further configured to output the first data and the second data to the downstream processing unit through the first set of data transmission paths a and the second set of data transmission paths b.
[0125] From the above description, the first processing unit may need to generate a selection signal, while the second processing unit may not need to generate a selection signal but may only need to receive the selection signal. Therefore, the first processing unit may be any of the processing units provided in the above embodiments. As shown in FIG. 1 and FIG. 4, the first processing unit includes a first selection module, a second selection module, a data processing module, a selection signal generation module, a first delay module, or a second delay module. Compared to the first processing unit, the second processing unit does not include the selection signal generation module. As shown in FIG. 2 and FIG. 3, the second processing unit includes a first selection module, a second selection module, and a data processing module. In some embodiments, the second processing unit can include or not include the first delay module or the second delay module, depending on the specific situation.
[0126] Since the structures and operation principles of the first selection module, the second selection module, the data processing module, the selection signal generation module, the first delay module, and the second delay module have already been described in the embodiments of the processing unit, the description is not repeated here.
[0127] In embodiments of the present disclosure, as shown in FIG. 11, among the m*n processing units (PE) , the processing units (PE) of the first column and the processing units (PE) of the last column include first delay modules Input REG1. The processing units (PE) of the first row and the processing units (PE) of the last row among the processing units (PE) of different columns include the second delay modules Input REG2, which is not limited in the present disclosure.
[0128] Based on the above embodiments, in embodiments of the present disclosure, FIG. 12 is a local enlarged view of FIG. 11. The systolic array includes a first processing unit 101 and a second processing unit 102 that are adjacent in the first dimension X. The first output port a1o of the first processing unit 101 is connected to the first input port a1i of the second processing unit 102. The second input port a2i of the first processing unit 101 is connected to the second output port a2o of the second processing unit 102. The first processing unit 101 and the second processing unit 102 can be any two adjacent processing units in the first dimension X of the systolic array.
[0129] The systolic array further includes a first processing unit 103 and a second processing unit 104 that are adjacent in the second dimension Y. The third output port b1o of the first processing unit 103 is connected to the third input port b1i of the second processing unit 104. The fourth input port b2i of the first processing unit 103 is connected to the fourth output port b2o of the second processing unit 104. The first processing unit 103 and the second processing unit 104 can be any two adjacent processing units in the second dimension Y of the systolic array.
[0130] In the above embodiments, as shown in FIG. 12, in the row direction, any one of the processing units also receives the third data psumo output by the upstream processing unit of the any one of the processing units and output the third data psumo to the downstream processing unit of the any one of the processing units.
[0131] In embodiments of the present disclosure, as shown in FIG. 11, several second processing units PE_2 located along oblique diagonal directions parallel to the diagonal direction of the array are connected to the selection signal output terminal of the first processing unit PE_1 located along the diagonal direction. Thus, selection signals input to the control terminals of all the processing units along the same diagonal direction of the systolic array can be the same.
[0132] To facilitate description, the i-th row and the j-column can be represented by PE (I, j) . The processing unit at the first row and the first column can be represented by PE (1, 1) . The processing unit at the first row and the second column can be represented by PE (1, 2) . The processing unit at the second row and the first column can be represented by PE (2, 1) . The processing unit at the second row and the second column can be represented by PE (2, 2) , and so on. FIG. 13 shows the coordinates of the processing units when the systolic array includes 5*5 processing units. In some embodiments, PE (1, 1) can be the first processing unit and can be configured to generate the selection signal as the selection signal of its own.
[0133] PE (1, 2) can be a first processing unit and can be configured to generate and output the selection signal. PE (2, 1) can be a second processing unit. The selection signal input terminal of PE(2, 1) can be connected to the selection signal input terminal of PE (1, 2) . The selection signal output by PE (1, 2) can be input to the selection signal input terminal of PE (2, 1) .
[0134] PE (1, 3) can be a first processing unit and configured to generate and output the selection signal. PE (2, 2) and PE (3, 1) can be second processing units. The selection signal terminals of PE (2, 2) and PE (3, 1) can be connected to the selection signal output terminal of PE (1, 3) . The selection signal output by PE (1, 3) can be input to PE (2, 2) and PE (3, 1) .
[0135] PE (1, 4) can be a first processing unit and configured to generate and output a selection signal. PE (2, 3) , PE (3, 2) , and PE (4, 1) can be second processing units. The selection signal input terminals of PE (2, 3) , PE (3, 2) , and PE (4, 1) can be connected to the selection signal output terminal of PE (1, 4) . The selection signal output by PE (1, 4) can be input to PE (2, 3) , PE (3, 2) , and PE (4, 1) .
[0136] PE (1, 5) can be a first processing unit and configured to generate and output a selection signal. PE (2, 4) , PE (3, 3) , PE (4, 2) , and PE (5, 1) can be second processing units. The selection signal input terminals of PE (2, 4) , PE (3, 3) , PE (4, 2) , and PE (5, 1) can be connected to the selection signal output terminal of PE (1, 5) . The selection signal output by PE (1, 5) can be input to PE (2, 4) , PE (3, 3) , PE (4, 2) , and PE (5, 1) .
[0137] PE (2, 5) can be a first processing unit and configured to generate and output a selection signal. PE (3, 4) , PE (4, 3) , and PE (5, 2) can be second processing units. The selection signal input terminals of PE (3, 4) , PE (4, 3) , and PE (5, 2) can be connected to the selection signal output terminal of PE (2, 5) . The selection signal output by PE (2, 5) can be input to PE (3, 4) , PE (4, 3) , and PE (5, 2) .
[0138] And so on. That is, in the systolic array, the processing unit of the i-th row and the j-th column and the processing unit of the r-th row and the s-th column can correspond to the same selection signal, where i+j = r+s, i and r being integers no less than 1 and no greater than m, and j and s being integers no less than 1 and no greater than n.
[0139] Based on the above embodiments, in embodiments of the present disclosure, m=n. Thus, data matrices can be input in two different directions in the same dimension to the systolic array to improve the operating speed and the pipeline operating efficiency of the systolic array. However, this is not limited in the present disclosure. In some other embodiments of the present disclosure, m may not be equal to n. If m is not equal to n, the data matrix can be input in one direction in the same dimension to the systolic array.
[0140] Correspondingly, embodiments of the present disclosure can further provide an electronic device. The electronic device can include the systolic array of any embodiments above or the systolic array formed by the processing units of the systolic array of any embodiments above, which is not limited in the present disclosure. The contents related to the systolic array and the processing units of the systolic array have been described above and are not repeated here.
[0141] In addition, embodiments of the present disclosure can further provide a data processing method applied to the systolic array of any embodiments above. The systolic array can include m*n processing units. The processing units can include the first set of data transmission paths for transmitting data in the row direction and the second set of data transmission paths for transmitting data in the column direction. The first set of data transmission paths can be configured to transmit the first data, and the second set of data transmission paths can be configured to transmit the second data. Each set can include 2 data transmission directions. I some embodiments, the first set of data transmission paths can include a first data transmission path for transmitting the data along the first direction and a second data transmission path for transmitting the data along the second direction. The second set of data transmission paths can include a third data transmission path for transmitting data along the third direction and a fourth data transmission path for transmitting data along the fourth direction. Since the related description of the systolic array has been made above in the above embodiments, the systolic array is not repeated here.
[0142] In some embodiments of the present disclosure, if m=n, the data processing method can include controlling the processing unit at the i-th row and the j-column to transmit the first data through the first data transmission path and transmit the second data through the third data transmission path, and control the processing unit at the (m+1-i) -th row and the (n+1-j) -th column to transmit the first data through the second data transmission path and transmit the second data through the fourth data transmission path at the same moment. The processing unit at the i-th row and the j-th column and the processing unit at the r-th row and the s-column can transmit the data simultaneously. i+j = r+s, and i and r are integers sequentially not smaller than 1 and greater than m, and j and s are integers sequentially not smaller than 1 and greater than n.
[0143] For example, the systolic array can include 5*5 processing units, and the input process of the data matrix in the systolic array can be described. As shown in FIG. 13, PE (1, 1) transmits the first data through the first data transmission path a1 and the second data through the third data transmission path b1. Simultaneously, PE (5, 5) transmits the first data through the second data transmission path a2 and the second data through the fourth data transmission path b2.
[0144] PE (1, 2) receives and transmits the first data transmitted by PE (1, 1) through the first data transmission path a1 and receives and transmits the second data transmitted by PE (1, 1) through the third data transmission path b1. Simultaneously, PE (5, 4) receives and transmits the first data transmitted by PE (5, 5) through the second data transmission path a2 and receives and transmits the second data transmitted by PE (5, 5) through the fourth data transmission path b2. PE (2, 1) receives and transmits the first data transmitted by PE (1, 1) through the first data transmission path a1 and receives and transmits the second data transmitted by PE (1, 1) through the third data transmission path b1. Simultaneously, PE (4, 5) receives and transmits the first data transmitted by PE (5, 5) through the second data transmission path a2 and receives and transmits the second data transmitted by PE (5, 5) through the fourth data transmission path b2. PE (1, 2) and PE (2, 1) can transmit data simultaneously.
[0145] And so on, PE (1, 3) and PE (5, 3) can transmit data simultaneously, PE (3, 1) and PE (3, 5) can transmit data simultaneously, PE (2, 2) and PE (4, 4) can transmit data simultaneously, PE (1, 3) , PE (3, 1) , and PE (2, 2) can transmit data simultaneously. PE (5, 3) , PE (3, 5) , and PE (4, 4) can transmit data simultaneously.
[0146] PE (1, 4) and PE (5, 2) can transmit data simultaneously, PE (4, 1) and PE (2, 5) can transmit data simultaneously, PE (2, 3) and PE (4, 3) can transmit data simultaneously, PE (3, 2) and PE (3, 4) can transmit data simultaneously, PE (1, 4) , PE (2, 3) , PE (3, 2) , and PE (4, 1) can transmit data simultaneously. PE (5, 2) , PE (4, 3) , PE (3, 4) , and PE (2, 5) can transmit data simultaneously.
[0147] PE (1, 5) , PE (2, 4) , PE (3, 3) , PE (4, 2) , and PE (5, 1) can transmit data simultaneously.
[0148] Thus, with the systolic array of embodiments of the present disclosure, the plurality of processing units can be configured to input data from different directions to input the data matrices to improve the operating speed and the pipeline operating efficiency of the systolic array.
[0149] In embodiments of the present disclosure, in the row direction, the second data of the columns from the first column in the second data matrix can be input to the processing units at the first row of the columns after the columns being delayed for one cycle sequentially from the first column. Each piece of the second data in the second data array can be transmitted to the processing units of a next row according to the data transmission cycle row by row. Simultaneously, from the last column, the columns can be delayed for one cycle, and the second data of the columns from the last column in the second data matrix can be input to the processing units at the last row of the columns. Each piece of the second data of the columns in the second data array can be transmitted to the processing units of the previous row according to the data transmission cycle row by row.
[0150] In the column direction, the first data of the rows from the first row in the first data matrix can be input to the processing units at the first column of the rows after the rows from the first row being delayed for one cycle. Each piece of the first data of the first data array of the rows can be transmitted to the processing units of a next column according to the data transmission cycle column by column. Simultaneously, from the last column, the columns can be delayed for one cycle, the first data of the rows from the last row in the first data matrix can be input to the processing units at the last column of the previous rows. Each piece of the first data in the first data arrays of the rows can be transmitted to the processing units of the previous column according to the data transmission cycle column by column.
[0151] The first data matrix can be a data matrix formed by a plurality of pieces of first data. The second data matrix can be a data matrix formed by a plurality of pieces of second data.
[0152] For example, the systolic array can include 5*5 processing units, and the input process of the data matrices of the systolic array can be described. In some embodiments, when the systolic array includes 5*5 processing units, the first data matrix can be and the second data matrix can be
[0153] In some embodiments, as shown in FIG. 14 to 24, when the above first data matrix and the above second data matrix are input into the systolic array including the 5*5 processing units, the input process of the data matrix of the systolic array can include the following processes.
[0154] In the first data transmission cycle T1, data a0, 0 and b0, 0 are input to PE (1, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 1) generates third data a0, 0*b0, 0 and transmits a0, 0 and b0, 0 to the two downstream processing units PE (1, 2) and PE (2, 1) according to the transmission directions. Meanwhile, data a4, 0 and b0, 4 are input to PE (5, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 5) transmits a4, 0 and b0, 4 to two downstream processing units PE (4, 5) and PE (5, 4) according to the transmission directions and generates third data a4, 0*b0, 4. Then, the systolic matrix changes from FIG. 15 to FIG. 16. A processing unit may need to transmit the first data and the second data received to the downstream processing units PE according to the input transmission direction, which will not be repeated hereafter.
[0155] In the second data transmission cycle T2, as shown in FIG. 17, data a0, 1 and data b1, 0 are input to PE (1, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 1) generates third data a0, 0*b0, 0 + a0, 1*b1, 0.
[0156] Data a0, 0 and data b0, 1 are input to PE (1, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 2) generates third data a0, 0*b0, 1.
[0157] Data a1, 0 and data b0, 0 are input to PE (2, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 1) generates third data a1, 0*b0, 0.
[0158] Meanwhile, data a4, 1 and data b1, 4 are input to PE (5, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 5) generates third data a4, 0*b0, 4 + a4, 1*b1, 4.
[0159] Data a4, 0 and data b0, 3 are input to PE (5, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 4) generates third data a4, 0*b0, 3.
[0160] Data a3, 0 and data b0, 4 are input to PE (4, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 5) generates third data a3, 0*b0, 4.
[0161] In the third data transmission cycle T3, as shown in FIG. 18, data a0, 2 and data b2, 0 are input to PE (1, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 1) generates third data a0, 0*b0, 0 + a0, 1*b1, 0 + a0, 2*b2, 0.
[0162] Data a0, 1 and data b1, 1 are input to PE (1, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 2) generates third data a0, 0*b0, 1 + a0, 1*b1, 1.
[0163] Data a0, 0 and data b0, 2 are input to PE (1, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 3) generates third data a0, 0*b0, 2.
[0164] Data a1, 1 and data b1, 0 are input to PE (2, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 1) generates third data a1, 0*b0, 0 + a1, 1*b1, 0.
[0165] Data a2, 0 and data b0, 0 are input to PE (3, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 1) generates third data a2, 0*b0, 0.
[0166] Data a1, 0 and data b0, 1 are input to PE (2, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 2) generates third data a1, 0*b0, 1.
[0167] Meanwhile, data a4, 2 and data b2, 4 are input to PE (5, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 5) generates third data a4, 0*b0, 4 + a4, 1*b1, 4 + a4, 2*b2, 4.
[0168] Data a4, 1 and data b1, 3 are input to PE (5, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 4) generates third data a4, 0*b0, 3 +a4, 1*b1, 3.
[0169] Data a4, 0 and data b0, 2 are input to PE (5, 3) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 3) generates third data a4, 0*b0, 2.
[0170] Data a3, 1 and data b1, 4 are input to PE (4, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 5) generates third data a3, 0*b0, 4 +a3, 1*b1, 4.
[0171] Data a2, 0 and data b0, 4 are input to PE (3, 5) inputs through the second data transmission path a2 and the fourth data transmission path b2, and PE (3, 5) generates third data a2, 0*b0, 4.
[0172] Data a3, 0 and data b0, 3 are input to PE (4, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 4) generates third data a3, 0*b0, 3.
[0173] In the fourth data transmission cycle T4, as shown in FIG. 19, data a0, 3 and data b3, 0 are input to PE (1, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 1) generates third data a0, 0*b0, 0 + a0, 1*b1, 0 + a0, 2*b2, 0 + a0, 3*b3, 0.
[0174] Data a0, 2 and data b2, 1 are input to PE (1, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 2) generates third data a0, 0*b0, 1 + a0, 1*b1, 1 + a0, 2*b2, 1.
[0175] Data a0, 1 and data b1, 2 are input to PE (1, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 3) generates third data a0, 0*b0, 2 + a0, 1*b1, 2.
[0176] Data a0, 0 and data b0, 3 are input to PE (1, 4) through the first data transmission path a1 and the third data transmission path b1, PE (1, 4) generates third data a0, 0*b0, 3.
[0177] Data a1, 2 and data b2, 0 are input to PE (2, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 1) generates third data a1, 0*b0, 0 + a1, 1*b1, 0 + a1, 2*b2, 0.
[0178] Data a1, 1 and data b1, 1 are input to PE (2, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 2) generates third data a1, 0*b0, 1 + a1, 1*b1, 1.
[0179] Data a1, 0 and data b0, 2 are input to PE (2, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 3) generates third data a1, 0*b0, 2.
[0180] Data a2, 1 and data b1, 0 are input to PE (3, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 1) generates third data a2, 0*b0, 0 + a2, 1*b1, 0.
[0181] Data a2, 0 and data b0, 1 are input to PE (3, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 2) generates third data a2, 0*b0, 1.
[0182] Data a3, 0 and data b0, 0 are input to PE (4, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (4, 1) generates third data a3, 0*b0, 0.
[0183] Meanwhile, data a4, 3 and data b3, 4 are input to PE (5, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 5) generates third data a4, 0*b0, 4 + a4, 1*b1, 4 + a4, 2*b2, 4 + a4, 3*b3, 4.
[0184] Data a4, 2 and data b2, 3 are input to PE (5, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 4) generates third data a4, 0*b0, 3 + a4, 1*b1, 3 + a4, 2*b2, 3.
[0185] Data a4, 1 and data b1, 2 are input to PE (5, 3) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 3) generates third data a4, 0*b0, 2 +a4, 1*b1, 2.
[0186] Data a4, 0 and data b0, 1 are input to PE (5, 2) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 2) generates third data a4, 0*b0, 1.
[0187] Data a3, 2 and data b2, 4 are input to PE (4, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 5) generates third data a3, 0*b0, 4 + a3, 1*b1, 4 + a3, 2*b2, 4.
[0188] Data a3, 1 and data b1, 4 are input to PE (4, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 4) generates third data a3, 0*b0, 3 +a3, 1*b1, 3.
[0189] Data a3, 0 and data b0, 4 are input to PE (4, 3) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 3) generates third data a3, 0*b0, 2.
[0190] Data a2, 1 and data b1, 4 are input to PE (3, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (3, 5) generates third data a2, 0*b0, 4 +a2, 1*b1, 4.
[0191] Data a2, 0 and data b0, 3 are input to PE (3, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (3, 4) generates third data a2, 0*b0, 3.
[0192] Data a1, 0 and data b0, 4 are input to PE (2, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (2, 5) generates third data a1, 0*b0, 4.
[0193] In the fifth data transmission cycle T5, as shown in FIG. 20, data a0, 4 and b4, 0 are input to PE (1, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 1) generates third data a0, 0*b0, 0 + a0, 1*b1, 0 + a0, 2*b2, 0 + a0, 3*b3, 0 + a0, 4*b4, 0.
[0194] Data a0, 3 and data b3, 1 are input to PE (1, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 2) generates third data a0, 0*b0, 1 + a0, 1*b1, 1 + a0, 2*b2, 1 + a0, 3*b3, 1.
[0195] Data a0, 2 and data b2, 2 are input to PE (1, 3) through the first data transmission path a1 and the third data transmission path b1, PE (1, 3) generates third data a0, 0*b0, 2 + a0, 1*b1, 2 +a0,2*b2, 2.
[0196] Data a0, 1 and data b1, 3 are input to PE (1, 4) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 4) generates third data a0, 0*b0, 3 + a0, 1*b1, 3.
[0197] Data a0, 0 and data b0, 4 are input to PE (1, 5) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 5) generates third data a0, 0*b0, 4.
[0198] Data a1, 3 and data b3, 0 are input to PE (2, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 1) generates third data a1, 0*b0, 0 + a1, 1*b1, 0 + a1, 2*b2, 0 + a1, 3*b3, 0.
[0199] Data a1, 2 and data b2, 1 are input to PE (2, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 2) generates third data a1, 0*b0, 1 + a1, 1*b1, 1 + a1, 2*b2, 1.
[0200] Data a1, 1 and data b1, 2 are input to PE (2, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 3) generates third data a1, 0*b0, 2 + a1, 1*b1, 2.
[0201] Data a1, 0 and data b0, 3 are input to PE (2, 4) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 4) generates third data a1, 0*b0, 3.
[0202] Data a2, 2 and data b2, 0 are input to PE (3, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 1) generates third data a2, 0*b0, 0 + a2, 1*b1, 0 + a2, 2*b2, 0.
[0203] Data a2, 1 and data b1, 1 are input to PE (3, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 2) generates third data a2, 0*b0, 1 + a2, 1*b1, 1.
[0204] Data a2, 0 and data b0, 2 are input to PE (3, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 3) generates third data a2, 0*b0, 2.
[0205] Data a3, 1 and data b1, 0 are input to PE (4, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (4, 1) generates third data a3, 0*b0, 0 + a3, 1*b1, 0.
[0206] Data a3, 0 and data b0, 1 are input to PE (4, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (4, 2) generates third data a3, 0*b0, 1.
[0207] Data a4, 0 and data b0, 0 are input to PE (5, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (5, 1) generates third data a4, 0*b0, 0.
[0208] Meanwhile, data a4, 4 and data b4, 4 are input to PE (5, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 5) generates third data a4, 0*b0, 4 + a4, 1*b1, 4 + a4, 2*b2, 4 + a4, 3*b3, 4 + a4, 4*b4, 4.
[0209] Data a4, 3 and data b3, 3 are input to PE (5, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 4) generates third data a4, 0*b0, 3 +a4, 1*b1, 3 + a4, 2*b2, 3 + a4, 3*b3, 3.
[0210] Data a4, 2 and data b2, 2 are input to PE (5, 3) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 3) generates third data a4, 0*b0, 2 +a4, 1*b1, 2 + a4, 2*b2, 2.
[0211] Data a4, 1 and data b1, 1 are input to PE (5, 2) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 2) generates third data a4, 0*b0, 1 +a4, 1*b1, 1.
[0212] Data a3, 3 and data b3, 4 are input to PE (4, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 5) generates third data a3, 0*b0, 4 +a3, 1*b1, 4 + a3, 2*b2, 4 + a3, 3*b3, 4.
[0213] Data a3, 2 and data b2, 4 are input to PE (4, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 4) generates third data a3, 0*b0, 3 +a3, 1*b1, 3 + a3, 2*b2, 4.
[0214] Data a3, 1 and data b1, 2 are input to PE (4, 3) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 3) generates third data a3, 0*b0, 2 +a3, 1*b1, 2.
[0215] Data a2, 2 and data b2, 4 are input to PE (3, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (3.5) generates third data a2, 0*b0, 4 +a2, 1*b1, 4 + a2, 2*b2, 4.
[0216] Data a2, 1 and data b1, 3 are input to PE (3, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (3, 4) generates third data a2, 0*b0, 3 +a2, 1*b1, 3.
[0217] Data a1, 1 and data b1, 4 are input to PE (2, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (2, 5) generates third data a1, 0*b0, 4 +a1, 1*b1, 4.
[0218] In the sixth data transmission cycle T6, as shown in FIG. 21, data is no longer input to PE (1, 1) , and PE (1, 1) maintains third data as a0, 0*b0, 0 + a0, 1*b1, 0 + a0, 2*b2, 0 + a0, 3*b3, 0 +a0, 4*b4, 0.
[0219] Data a0, 4 and data b4, 1 are input to PE (1, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 2) generates third data a0, 0*b0, 1 + a0, 1*b1, 1 + a0, 2*b2, 1 + a0, 3*b3, 1 + a0, 4*b4, 1.
[0220] Data a0, 3 and data b3, 2 are input to PE (1, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 3) generates third data a0, 0*b0, 2 + a0, 1*b1, 2 + a0, 2*b2, 2 + a0, 3*b3, 2.
[0221] Data a0, 2 and data b2, 3 are input to PE (1, 4) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 4) generates third data a0, 0*b0, 3 + a0, 1*b1, 3 + a0, 2*b2, 3.
[0222] Data a0, 1 and data b1, 4 are input to PE (1, 5) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 5) generates third data a0, 0*b0, 4 + a0, 1*b1, 4.
[0223] Data a1, 4 and data b4, 0 are input to PE (2, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 1) generates third data a1, 0*b0, 0 + a1, 1*b1, 0 + a1, 2*b2, 0 + a1, 3*b3, 0 + a1, 4*b4, 0.
[0224] Data a1, 3 and data b3, 1 are input to PE (2, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 2) generates third data a1, 0*b0, 1 + a1, 1*b1, 1 + a1, 2*b2, 1 + a1, 3*b3, 1.
[0225] Data a1, 2 and data b2, 2 are input to PE (2, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 3) generates third data a1, 0*b0, 2 + a1, 1*b1, 2 + a1, 2*b2, 2.
[0226] Data a1, 1 and data b1, 3 are input to PE (2, 4) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 4) generates third data a1, 0*b0, 3 + a1, 1*b1, 3.
[0227] Data a2, 3 and data b3, 0 are input to PE (3, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 1) generates third data a2, 0*b0, 0 + a2, 1*b1, 0 + a2, 2*b2, 0 + a2, 3*b3, 0.
[0228] Data a2, 2 and data b2, 1 are input to PE (3, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 2) generates third data a2, 0*b0, 1 + a2, 1*b1, 1 + a2, 2*b2, 1.
[0229] Data a2, 1 and data b1, 2 are input to PE (3, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 3) generates third data a2, 0*b0, 2 + a2, 1*b1, 2.
[0230] Data a3, 2 and data b2, 0 are input to PE (4, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (4, 1) generates third data a3, 0*b0, 0 + a3, 1*b1, 0 + a3, 2*b2, 0.
[0231] Data a3, 1 and data b1, 1 are input to PE (4, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (4, 2) generates third data a3, 0*b0, 1 + a3, 1*b1, 1.
[0232] Data a4, 1 and data b1, 0 are input to PE (5, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (5, 1) generates third data a4, 0*b0, 0 + a4, 1*b1, 0.
[0233] Meanwhile, data is no longer input to PE (5, 5) , and PE (5, 5) maintains the third data a4, 0*b0, 4 + a4, 1*b1, 4 + a4, 2*b2, 4 + a4, 3*b3, 4 + a4, 4*4, 4.
[0234] Data a4, 4 and data b4, 3 are input to PE (5, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 4) generates third data a4, 0*b0, 3 +a4, 1*b1, 3 + a4, 2*b2, 3 + a4, 3*b3, 3 + a4, 4*b4, 3.
[0235] Data a4, 3 and data b3, 2 are input to PE (5, 3) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 3) generates third data a4, 0*b0, 2 +a4, 1*b1, 2 + a4, 2*b2, 2 + a4, 3*b3, 2.
[0236] Data a4, 2 and data b2, 1 are input to PE (5, 2) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 2) generates third data a4, 0*b0, 1 +a4, 1*b1, 1 + a4, 2*b2, 1.
[0237] Data a3, 4 and data b4, 4 are input to PE (4, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 5) generates third data a3, 0*b0, 4 +a3, 1*b1, 4 + a3, 2*b2, 4 + a3, 3*b3, 4 + a3, 4*b4, 4.
[0238] Data a3, 3 and data b2, 3 are input to PE (4, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 4) generates third data a3, 0*b0, 3 + a3, 1*b1, 3 + a3, 2*b2, 4 + a3, 3*b3, 4.
[0239] Data a3, 2 and data b2, 2 are input to PE (4, 3) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 3) generates third data a3, 0*b0, 2 +a3, 1*b1, 2 + a3, 2*b2, 2.
[0240] Data a2, 3 and data b3, 4 are input to PE (3, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (3, 5) generates third data a2, 0*b0, 4 +a2, 1*b1, 4 + a2, 2*b2, 4 + a2, 3*b3, 4.
[0241] Data a2, 2 and data b2, 3 are input to PE (3, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (3, 4) generates third data a2, 0*b0, 3 +a2, 1*b1, 3 + a2, 2*b2, 3.
[0242] Data a1, 2 and data b2, 4 are input to PE (2, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (2, 5) generates third data a1, 0*b0, 4 +a1, 1*b1, 4 + a1, 2*b2, 4.
[0243] In the seventh data transmission cycle T7, as shown in FIG. 22, data is no longer input to PE (1, 1) , and PE (1, 1) maintains the third data a0, 0*b0, 0 + a0, 1*b1, 0 + a0, 2*b2, 0 + a0, 3*b3, 0 +a0, 4*b4, 0.
[0244] Data is no longer input to PE (1, 2) , and PE (1, 2) maintains the third data a0, 0*b0, 1 +a0, 1*b1, 1 + a0, 2*b2, 1 + a0, 3*b3, 1 + a0, 4*b4, 1.
[0245] Data a0, 4 and data b4, 2 are input to PE (1, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 3) generates third data a0, 0*b0, 2 + a0, 1*b1, 2 + a0, 2*b2, 2 + a0, 3*b3, 2 + a0, 4*b4, 2.
[0246] Data a0, 3 and data b3, 3 are input to PE (1, 4) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 4) generates third data a0, 0*b0, 3 + a0, 1*b1, 3 + a0, 2*b2, 3 + a0, 3*b3, 3.
[0247] Data a0, 2 and data b2, 4 are input to PE (1, 5) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 5) generates third data a0, 0*b0, 4 + a0, 1*b1, 4 + a0, 2*b2, 4.
[0248] Data is no longer input to PE (2, 1) , and PE (2, 1) maintains the third data a1, 0*b0, 0 +a1, 1*b1, 0 + a1, 2*b2, 0 + a1, 3*b3, 0 + a1, 4*b4, 0.
[0249] Data a1, 4 and data b4, 1 are input to PE (2, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 2) generates third data a1, 0*b0, 1 + a1, 1*b1, 1 + a1, 2*b2, 1 + a1, 3*b3, 1 + a1, 4*b4, 1.
[0250] Data a1, 3 and data b3, 2 are input to PE (2, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 3) generates third data a1, 0*b0, 2 + a1, 1*b1, 2 + a1, 2*b2, 2 + a1, 3*b3, 2.
[0251] Data a1, 2 and data b2, 3 are input to PE (2, 4) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 4) generates third data a1, 0*b0, 3 + a1, 1*b1, 3 + a1, 2*b2, 3.
[0252] Data a2, 4 and data b4, 0 are input to PE (3, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 1) generates third data a2, 0*b0, 0 + a2, 1*b1, 0 + a2, 2*b2, 0 + a2, 3*b3, 0 + a2, 4*b4, 0.
[0253] Data a2, 3 and data b3, 1 are input to PE (3, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 2) generates third data a2, 0*b0, 1 + a2, 1*b1, 1 + a2, 2*b2, 1 + a2, 3*b3, 1.
[0254] Data a2, 2 and data b2, 2 are input to PE (3, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 3) generates third data a2, 0*b0, 2 + a2, 1*b1, 2 + a2, 2*b2, 2.
[0255] Data a3, 3 and data b3, 0 are input to PE (4, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (4, 1) generates third data a3, 0*b0, 0 + a3, 1*b1, 0 + a3, 2*b2, 0 + a3, 3*b3, 0.
[0256] Data a3, 2 and data b2, 1 are input to PE (4, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (4, 2) generates third data a3, 0*b0, 1 + a3, 1*b1, 1 + a3, 2*b2, 1.
[0257] Data a4, 2 and data b2, 0 are input to PE (5, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (5, 1) generates third data a4, 0*b0, 0 + a4, 1*b1, 0 + a4, 2*b2, 0.
[0258] Meanwhile, data is no longer input to PE (5, 5) , and PE (5, 5) maintains the third data a4, 0*b0, 4 + a4, 1*b1, 4 + a4, 2*b2, 4 + a4, 3*b3, 4 + a4, 4*b4, 4.
[0259] Data is no longer input to PE (5, 4) , and PE (5, 4) maintains the third data a4, 0*b0, 3 +a4, 1*b1, 3 + a4, 2*b2, 3 + a4, 3*b3, 3 + a4, 4*b4, 3.
[0260] Data a4, 4 and data b4, 2 are input to PE (5, 3) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 3) generates third data a4, 0*b0, 2 +a4, 1*b1, 2 + a4, 2*b2, 2 + a4, 3*b3, 2 + a4, 4*b4, 2.
[0261] Data a4, 3 and data b3, 1 are input to PE (5, 2) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 2) generates third data a4, 0*b0, 1 +a4, 1*b1, 1 + a4, 2*b2, 1 + a4, 3*b3, 1.
[0262] Data is no longer input to PE (4, 5) , and PE (4, 5) maintains the third data a3, 0*b0, 4 +a3, 1*b1, 4 + a3, 2*b2, 4 + a3, 3*b3, 4 + a3, 4*b4, 4.
[0263] Data a3, 4 and data b4, 3 are input to PE (4, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 4) generates third data a3, 0*b0, 3 +a3, 1*b1, 3 + a3, 2*b2, 4 + a3, 3*b3, 4 + a3, 4*b4, 3.
[0264] Data a3, 3 and data b3, 2 are input to PE (4, 3) through the second data transmission path a2 and the fourth data transmission path b2, and PE (4, 3) generates third data a3, 0*b0, 2 +a3, 1*b1, 2 + a3, 2*b2, 2 + a3, 3*b3, 2.
[0265] Data a2, 4 and data b4, 4 are input to PE (3, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (3, 5) generates third data a2, 0*b0, 4 +a2, 1*b1, 4 + a2, 2*b2, 4 + a2, 3*b3, 4 + a2, 4*b4, 4.
[0266] Data a2, 3 and data b3, 3 are input to PE (3, 4) through the second data transmission path a2 and the fourth data transmission path b2, and PE (3, 4) generates third data a2, 0*b0, 3 +a2, 1*b1, 3 + a2, 2*b2, 3 + a2, 3*b3, 3.
[0267] Data a1, 3 and data b3, 4 are input to PE (2, 5) through the second data transmission path a2 and the fourth data transmission path b2, and PE (2, 5) generates third data a1, 0*b0, 4 +a1, 1*b1, 4 + a1, 2*b2, 4 + a1, 3*b3, 4.
[0268] In the eighth data transmission cycle T8, as shown in FIG. 23, data is no longer input to PE (1, 1) , and PE (1, 1) maintains the third data a0, 0*b0, 0 + a0, 1*b1, 0 + a0, 2*b2, 0 + a0, 3*b3, 0 +a0, 4*b4, 0.
[0269] Data is no longer input to PE (1, 2) , and PE (1, 2) maintains the third data a0, 0*b0, 1 +a0, 1*b1, 1 + a0, 2*b2, 1 + a0, 3*b3, 1 + a0, 4*b4, 1.
[0270] Data is no longer input to PE (1, 3) , and PE (1, 3) maintains the third data a0, 0*b0, 2 +a0, 1*b1, 2 + a0, 2*b2, 2 + a0, 3*b3, 2 + a0, 4*b4, 2.
[0271] Data a0, 4 and data b4, 3 are input to PE (1, 4) through the first data transmission path a1 and the third data transmission path b1, and PE (1, 4) generates third data a0, 0*b0, 3 + a0, 1*b1, 3 + a0, 2*b2, 3 + a0, 3*b3, 3 + a0, 4*b4, 3.
[0272] Data a0, 3 and data b3, 4 are input to PE (1, 5) through the first data transmission path a1 and the third data transmission path b1, PE (1, 5) generates third data a0, 0*b0, 4 + a0, 1*b1, 4 +a0, 2*b2, 4 + a0, 3*b3, 4.
[0273] Data is no longer input to PE (2, 1) , and PE (2, 1) maintains the third data a1, 0*b0, 0 +a1, 1*b1, 0 + a1, 2*b2, 0 + a1, 3*b3, 0 + a1, 4*b4, 0.
[0274] Data is no longer input to PE (2, 2) , and PE (2, 2) maintains the third data a1, 0*b0, 1 +a1, 1*b1, 1 + a1, 2*b2, 1 + a1, 3*b3, 1 + a1, 4*b4, 1.
[0275] Data a1, 4 and data b4, 2 are input to PE (2, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 3) generates third data a1, 0*b0, 2 + a1, 1*b1, 2 +a1, 2*b2, 2 + a1, 3*b3, 2 + a1, 4*b4, 2.
[0276] Data a1, 3 and data b3, 3 are input to PE (2, 4) through the first data transmission path a1 and the third data transmission path b1, and PE (2, 4) generates third data a1, 0*b0, 3 + a1, 1*b1, 3 + a1, 2*b2, 3 + a1, 3*b3, 3;
[0277] Data is no longer input to PE (3, 1) , and PE (3, 1) maintains the third data a2, 0*b0, 0 +a2, 1*b1, 0 + a2, 2*b2, 0 + a2, 3*b3, 0 + a2, 4*b4, 0.
[0278] Data a2, 4 and data b4, 1 are input to PE (3, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 2) generates third data a2, 0*b0, 1 + a2, 1*b1, 1 + a2, 2*b2, 1 + a2, 3*b3, 1 + a2, 4*b4, 1.
[0279] Data a2, 3 and data b3, 2 are input to PE (3, 3) through the first data transmission path a1 and the third data transmission path b1, and PE (3, 3) generates third data a2, 0*b0, 2 + a2, 1*b1, 2 + a2, 2*b2, 2 + a2, 3*b3, 2.
[0280] Data a3, 4 and data b4, 0 are input to PE (4, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (4, 1) generates third data a3, 0*b0, 0 + a3, 1*b1, 0 + a3, 2*b2, 0 + a3, 3*b3, 0 + a3, 4*b4, 0.
[0281] Data a3, 3 and data b3, 1 are input to PE (4, 2) through the first data transmission path a1 and the third data transmission path b1, and PE (4, 2) generates third data a3, 0*b0, 1 + a3, 1*b1, 1 + a3, 2*b2, 1 + a3, 3*b3, 1.
[0282] Data a4, 3 and data b3, 0 are input to PE (5, 1) through the first data transmission path a1 and the third data transmission path b1, and PE (5, 1) generates third data a4, 0*b0, 0 + a4, 1*b1, 0 + a4, 2*b2, 0 + a4, 3*b3, 0.
[0283] Meanwhile, data is no longer input to PE (5, 5) , and PE (5, 5) maintains the third data a4, 0*b0, 4 + a4, 1*b1, 4 + a4, 2*b2, 4 + a4, 3*b3, 4 + a4, 4*b4, 4.
[0284] Data is no longer input to PE (5, 4) , and PE (5, 4) maintains the third data a4, 0*b0, 3 +a4, 1*b1, 3 + a4, 2*b2, 3 + a4, 3*b3, 3 + a4, 4*b4, 3.
[0285] Data is no longer input to PE (5, 3) , and PE (5, 3) maintains the third data a4, 0*b0, 2 +a4,1 *b1, 2 + a4, 2*b2, 2 + a4, 3*b3, 2 + a4, 4*b4, 2.
[0286] Data a4, 4 and data b4, 1 are input to PE (5, 2) through the second data transmission path a2 and the fourth data transmission path b2, and PE (5, 2) generates third data a4, 0*b0, 1 +a4, 1*b1, 1 + a4, 2*b2, 1 + a4, 3*b3, 1 + a4, 4*b4, 1.
[0287] Data is no longer input to PE (4, 5) , and PE (4, 5) maintains the third data a3, 0*b0, 4 +a3, 1*b1, 4 + a3, 2*b2, 4 + a3, 3*b3, 4 + a3, 4*b4, 4.
[0288] Data is no longer input to PE (4, 4) , and PE (4, 4) maintains the third data a3, 0*b0, 3 +a3, 1*b1, 3 + a3, 2*b2, 4 + a3, 3*b3, 4 + a3, 4*b4, 3.
[0289] Data a3, 4 and data b4, 2 are input to PE (4, 3) through the second data transmission path a2 and fourth data transmission path b2, and PE (4, 3) generates third data a3, 0*b0, 2 + a3, 1*b1, 2 + a3, 2*b2, 2 + a3, 3*b3, 2 + a3, 4*b4, 2.
[0290] Data is no longer input to PE (3, 5) , and PE (3, 5) maintains the third data a2, 0*b0, 4 +a2, 1*b1, 4 + a2, 2*b2, 4 + a2, 3*b3, 4 + a2, 4*b4, 4.
[0291] Data a2, 4 and data b4, 3 are input to PE (3, 4) through the second data transmission path a2 and fourth data transmission path b2, and PE (3, 4) generates third data a2, 0*b0, 3 + a2, 1*b1, 3 + a2, 2*b2, 3 + a2, 3*b3, 3 + a2, 4*b4, 3.
[0292] Data a1, 4 and data b4, 4 are input to PE (2, 5) through the second data transmission path a2 and fourth data transmission path b2, and PE (2, 5) generates third data a1, 0*b0, 4 + a1, 1*b1, 4 + a1, 2*b2, 4 + a1, 3*b3, 4 + a1, 4*b4, 4.
[0293] In the ninth data transmission cycle T9, as shown in FIG. 24, data is no longer input to PE (1, 1) , and PE (1, 1) maintains the third data a0, 0*b0, 0 + a0, 1*b1, 0 + a0, 2*b2, 0 + a0, 3*b3, 0 +a0, 4*b4, 0.
[0294] Data is no longer input to PE (1, 2) , and PE (1, 2) maintains the third data a0, 0*b0, 1 +a0, 1*b1, 1 + a0, 2*b2, 1 + a0, 3*b3, 1 + a0, 4*b4, 1.
[0295] Data is no longer input to PE (1, 3) , and PE (1, 3) maintains the third data a0, 0*b0, 2 +a0, 1*b1, 2 + a0, 2*b2, 2 + a0, 3*b3, 2 + a0, 4*b4, 2.
[0296] Data is no longer input to PE (1, 4) , and PE (1, 4) maintains the third data a0, 0*b0, 3 +a0, 1*b1, 3 + a0, 2*b2, 3 + a0, 3*b3, 3 + a0, 4*b4, 3.
[0297] Data a0, 4 and data b4, 4 are input to PE (1, 5) through the first data transmission path a1 and third data transmission path b1, and PE (1, 5) generates third data a0, 0*b0, 4 + a0, 1*b1, 4 +a0, 2*b2, 4 + a0, 3*b3, 4 + a0, 4*b4, 4.
[0298] Data is no longer input to PE (2, 1) , and PE (2, 1) maintains the third data a1, 0*b0, 0 +a1, 1*b1, 0 + a1, 2*b2, 0 + a1, 3*b3, 0 + a1, 4*b4, 0.
[0299] Data is no longer input to PE (2, 2) , and PE (2, 2) maintains the third data a1, 0*b0, 1 +a1, 1*b1, 1 + a1, 2*b2, 1 + a1, 3*b3, 1 + a1, 4*b4, 1.
[0300] Data is no longer input to PE (2, 3) , and PE (2, 3) maintains the third data a1, 0*b0, 2 +a1, 1*b1, 2 + a1, 2*b2, 2 + a1, 3*b3, 2 + a1, 4*b4, 2.
[0301] Data a1, 4 and data b4, 3 are input to PE (2, 4) through the first data transmission path a1 and third data transmission path b1, and PE (2, 4) generates third data a1, 0*b0, 3 + a1, 1*b1, 3 +a1, 2*b2, 3 + a1, 3*b3, 3 + a1, 4*b4, 3.
[0302] Data is no longer input to PE (3, 1) , and PE (3, 1) maintains the third data a2, 0*b0, 0 +a2, 1*b1, 0 + a2, 2*b2, 0 + a2, 3*b3, 0 + a2, 4*b4, 0.
[0303] Data is no longer input to PE (3, 2) , and PE (3, 2) maintains the third data a2, 0*b0, 1 +a2, 1*b1, 1 + a2, 2*b2, 1 + a2, 3*b3, 1 + a2, 4*b4, 1.
[0304] Data a2, 4 and data b4, 2 are input to PE (3, 3) through the first data transmission path a1 and third data transmission path b1, and PE (3, 3) generates third data a2, 0*b0, 2 + a2, 1*b1, 2 +a2, 2*b2, 2 + a2, 3*b3, 2 + a2, 4*b4, 2.
[0305] Data is no longer input to PE (4, 1) , and PE (4, 1) maintains the third data a3, 0*b0, 0 +a3, 1*b1, 0 + a3, 2*b2, 0 + a3, 3*b3, 0 + a3, 4*b4, 0.
[0306] Data a3, 4 and data b4, 1 are input to PE (4, 2) through the first data transmission path a1 and third data transmission path b1, and PE (4, 2) generates third data a3, 0*b0, 1 + a3, 1*b1, 1 +a3, 2*b2, 1 + a3, 3*b3, 1 + a3, 4*b4, 1.
[0307] Data a4, 4 and data b4, 0 are input to PE (5, 1) through the first data transmission path a1 and third data transmission path b1, and PE (5, 1) generates third data a4, 0*b0, 0 + a4, 1*b1, 0 +a4, 2*b2, 0 + a4, 3*b3, 0 + a4, 4*b4, 0.
[0308] Meanwhile, data is no longer input to PE (5, 5) , and PE (5, 5) maintains the third data a4, 0*b0, 4 + a4, 1*b1, 4 + a4, 2*b2, 4 + a4, 3*b3, 4 + a4, 4*b4, 4.
[0309] Data is no longer input to PE (5, 4) , and PE (5, 4) maintains the third data a4, 0*b0, 3 +a4, 1*b1, 3 + a4, 2*b2, 3 + a4, 3*b3, 3 + a4, 4*b4, 3.
[0310] Data is no longer input to PE (5, 3) , and PE (5, 3) maintains the third data a4, 0*b0, 2 +a4, 1*b1, 2 + a4, 2*b2, 2 + a4, 3*b3, 2 + a4, 4*b4, 2.
[0311] Data is no longer input to PE (5, 2) , and PE (5, 2) maintains the third data a4, 0*b0, 1 +a4, 1*b1, 1 + a4, 2*b2, 1 + a4, 3*b3, 1 + a4, 4*b4, 1.
[0312] Data is no longer input to PE (4, 5) , and PE (4, 5) maintains the third data a3, 0*b0, 4 +a3, 1*b1, 4 + a3, 2*b2, 4 + a3, 3*b3, 4 + a3, 4*b4, 4.
[0313] Data is no longer input to PE (4, 4) , and PE (4, 4) maintains the third data a3, 0*b0, 3 +a3, 1*b1, 3 + a3, 2*b2, 4 + a3, 3*b3, 4 + a3, 4*b4, 3.
[0314] Data is no longer input to PE (4, 3) , and PE (4, 3) maintains the third data a3, 0*b0, 2 +a3, 1*b1, 2 + a3, 2*b2, 2 + a3, 3*b3, 2 + a3, 4*b4, 2.
[0315] Data is no longer input to PE (3, 5) , and PE (3, 5) maintains the third data a2, 0*b0, 4 +a2, 1*b1, 4 + a2, 2*b2, 4 + a2, 3*b3, 4 + a2, 4*b4, 4.
[0316] Data is no longer input to PE (3, 4) , and PE (3, 4) maintains the third data a2, 0*b0, 3 +a2, 1*b1, 3 + a2, 2*b2, 3 + a2, 3*b3, 3 + a2, 4*b4, 3.
[0317] Data is no longer input to PE (2, 5) , and PE (2, 5) maintains the third data a1, 0*b0, 4 +a1, 1*b1, 4 + a1, 2*b2, 4 + a1, 3*b3, 4 + a1, 4*b4, 4.
[0318] After the above nine cycles, the input and calculation of the data matrix of the systolic array are completed.
[0319] In embodiments of the present disclosure, according to the processing units at the first row and the processing units at the last column or the data input statuses of the processing units at the first row and the processing units at the last column in the systolic array, the data transmission path of the corresponding direction can be selected. Thus, the processing units on the diagonal direction at the same moment can select the same data transmission direction.
[0320] In embodiments of the present disclosure, the data input can start from the processing units of the first row and the processing units of the last column in the systolic array. As shown in FIG. 10, the transmission direction of the selection signal can be from PE (1, n) to PE (m, 1) . The data transmission paths refer to FIG. 15 to FIG. 24. In some other embodiments of the present disclosure, the data input can start from the processing units of the first column and the processing units of the last row in the systolic array. As shown in FIG. 25, the transmission direction of the selection signal is from PE (m, 1) to PE (n, 1) , which is not limited in the present disclosure.
[0321] In embodiments of the present disclosure, when the data input starts from the processing units of the first row and the processing units of the last column in the systolic array, the data processing method can further include synchronously outputting the third data stored in the processing units of different rows after the processing unit at the first row and the n-th column outputs the third signal. The third signal can indicate that the data processing process of the processing unit at the first row and n-th column ends.
[0322] In some other embodiments of the present disclosure, the data processing method can further include after other processing units in the diagonal directions with the processing unit of the m-th row and the first column, synchronously outputting the third data stored in the processing unit. The third data can indicate that the processing processes in the other processing units in the diagonal direction with the processing unit at the m-th row and the first column or the processing unit at the first row and the n-th column have been ended, which is not limited in the present disclosure. For example, m=n=5, in some embodiments, the data processing method can include synchronously outputting the third data stored I the processing units of different rows after any one of the processing units PE (1, 5) , PE (2, 4) , PE (3, 3) , FE (4, 2) , and PE (5, 1) outputs the third signal.
[0323] In the above embodiments, the data processing method is described by taking bi-direction input method in the same dimension for example when the data matrices are input to the systolic array, which is not limited in the present disclosure. In some other embodiments of the present disclosure, a single-direction data input method in the same dimension can be used to process the data in the systolic array.
[0324] In embodiments of the present disclosure, if the single-direction data input method in the same dimension is applied to the systolic array, the data processing method can include the following processes.
[0325] In the row direction, the second data of the columns starting from the first column in the second data matrix can be input to the processing units of the first rows of the columns after the columns starting from the first column are delayed for one cycle. Each piece of the second data of the columns in the second data matrix can be transmitted to the next row processing units in sequence according to the data transmission cycle.
[0326] In the column direction, the first data of the rows starting from the first row in the first data matrix can be input to the processing units of the first column of the rows after the processing units of the rows starting from the first row are delayed for one cycle in sequence. Each piece of the first data of the rows in the first data matrix can be transmitted to the processing units of the next column in sequence, column by column, according to the data transmission cycle.
[0327] Since the data transmission is only performed in a single direction, in embodiments of the present disclosure, the first selection module of each processing unit (PE) in the systolic array may all select the data transmission path in the row direction of the same direction for transmission. The second selection module of each processing unit (PE) in the systolic array may all select the data transmission path in the column direction of the same direction for transmission.
[0328] Based on the above embodiments, in embodiments of the present disclosure, the method can further include, after the processing unit at the i-th row and n-th column outputs the third signal, outputting the data stored in the processing units at the i-th row. The third signal can indicate that all the data processing processes in the processing unit at the i-th row and the n-th column have been completed. That is, when the data matrix can be input bi-directionally in the same dimension in the data processing method, since the data processing processes of the rows end simultaneously, the third data stored in the processing units of different rows can be output synchronously at once after the data processing processes of all the processing units end. When the data matrix is input in a single direction in the same dimension in the data processing method, since data computation ends at different times for different rows, the third data stored in the processing units in a row may need to be output after all the data processing processes of the processing units of the row end.
[0329] Embodiments of the present disclosure are described by taking the systolic array outputting the third data along the row direction for example, which is not limited in the present disclosure. In some other embodiments of the present disclosure, the systolic array can output the third data along the column direction, which depends on situations. If the systolic array outputs the third data along the column direction, by taking the systolic array adopting the bi-directional data input in the same dimension as an example, the data processing method can include the following processes.
[0330] After the processing unit at the first row and the n-th column outputs the third signal, the third data stored in the processing units of different columns can be output synchronously. The third signal can indicate that the data processing processes in the processing unit at the first row and the n-th column end.
[0331] Alternatively, after the processing unit at the m-th row and the first column outputs the third signal, the third data stored in the processing units of the columns can be output synchronously. The third signal can indicate that data processing processes in the processing unit at the m-th row and the first column end.
[0332] In some other embodiments of the present disclosure, if the systolic array adopts the method of inputting the data matrix in a single direction in the same dimension, the data processing method can include the following processes.
[0333] Starting from the last column, the columns can be delayed for one cycle in sequence. The second data of the columns starting from the last column of the second data matrix can be input to the processing units of the last row of the columns. Each piece of second data in the second data matrix of the columns can be transmitted to the processing units of the previous row in sequence, row by row, according to the data transmission cycle.
[0334] Starting from the last row, the rows can be delayed for one cycle in sequence. The first data of the rows starting from the last row in the first data matrix can be input to the last processing units of the last column of the previous rows. Each piece of the first data of the rows in the first data matrix can be transmitted to the processing units of the previous column according to the data transmission cycle column by column.
[0335] Based on the above embodiments, in embodiments of the present disclosure, the method can further include, after the processing unit at the i-th row and the first column outputs the third signal, outputting the data stored in the processing units of the i-th row. The third signal can indicate that all the data processing processes in the processing unit at the i-th row and the first column have been completed. That is, when the data processing method adopts the b-directional input of the data matrix in the same dimension, the third data stored in the processing units of the rows can be output synchronously after all the data processing processes of all the processing units have been completed. When the data processing method adopts the single-direction input of the data matrix in the same dimension, the third data stored in the processing units of a row can be output after all the data processing processes of the row end.
[0336] In embodiments of the present disclosure, as shown in FIG. 26, the data processing method includes outputting the third data psum stored in the processing units of the same row in sequence from a single side of the systolic array. In some embodiments, no matter the data processing method adopts the single direction data matrix input or the bi-direction data matrix input, the data processing method can include transmitting the third data psum stored in the processing units from the single side of the systolic array in sequence to the output direction to output the third data stored in the processing units in the same row in sequence to the cache to output and store the third data in the processing units, which is not limited in the present disclosure. As shown in FIG. 27 and FIG. 28, FIG. 27 illustrates a schematic diagram of an output result after the systolic array outputs the third data stored in the processing units in the same row and outputs the third data stored in the processing units of different rows synchronously when the systolic array adopts the bi-direction data matrix input in the same dimension. FIG. 28 illustrates a schematic diagram of an output result after synchronously outputting third data stored in processing units of different rows sequentially based on completion time of data processing processes of the corresponding processing units, third data stored in processing units of a same row being output sequentially from a left side of the systolic array when the data matrix is input bi-directionally in a same dimension by the systolic array according to embodiments of the present disclosure.
[0337] In embodiments of the present disclosure, if m=n in the systolic array, the systolic array can adopt the method of inputting the data matrix bi-directionally in the same dimension to perform the data processing, or the method of inputting the data matrix in a single direction in the same dimension to perform the data processing. If m≠n in the systolic array, the systolic array may adopt the method of inputting the data matrix in a single direction in the same dimension to perform the data processing, or only a partial systolic array d*d can realize the bi-directional input function. That is, the other processing units of the m*n processing units, excluding the d*d processing units, can be bypassed or only transmit data and do not perform data processing.
[0338] Since the systolic array adopting the method of inputting the data matrix in the single direction for data processing is well known to those skilled in the art, the method is not repeated in the present disclosure.
[0339] The first data matrix and the second data matrix can both be an n *n matrix. When the data processing method inputs a data matrix in one direction in the same dimension, the data processing method can sequentially load the parameters of the first data matrix and the second data matrix along the horizontal direction (i.e., first dimension) and the vertical direction (i.e., second dimension) . With this calculation method, many PE units can be idle at the beginning and end of the computation. (3n-2) data transmission cycles may be required to complete the whole data processing. The computation time can be long, and the design complexity can be high. When the data matrix is input in two directions in the same dimension, the number of cycles required to complete the whole data processing can be reduced from (3n-2) to (2n-1) . Thus, the data processing operating speed and the pipeline operating efficiency of the systolic array can be greatly improved.
[0340] Based on any of the above embodiments, in embodiments of the present disclosure, the data processing method can be implemented using hardware circuits for regular algorithms, such as matrix operations, convolution, or other algorithmic data processing, which is not limited in the present disclosure and depends on the specific situation.
[0341] In embodiments of the present disclosure, the data processing method can be applied to computation in neural network units, such as AI model computation, which is not limited in the present disclosure and depends on the specific situation.
[0342] Additionally, embodiments of the present disclosure provide an electronic device. As shown in FIG. 29, the electronic device includes a systolic array 100, a processor 200, and a memory 300. The systolic array 100 can be any systolic array of the above embodiments. The memory 300 can be used to store a computer program. The processor 200 can execute the computer program so that the electronic device can implement the data processing method provided in any of the embodiments described above. The relevant contents of the systolic array and the data processing method have been described in the above embodiments, and are not repeated here.
[0343] In summary, the electronic device, systolic array, and data processing method of embodiments of the present disclosure can adopt the bi-directional data matrix input in the same dimension to input the data matrix into the systolic array, thereby improving the data processing operating speed and pipeline operating efficiency of the systolic array.
[0344] In this specification, embodiments are described progressively, in parallel, or in a combination of progressive and parallel modes. Each embodiment focuses on the differences from other embodiments, and similar parts can be cross-referenced. For the device disclosed in an embodiment, since it corresponds to the method disclosed in embodiments of the present disclosure, the description is simpler, and the relevant part can be referred to the method description.
[0345] It should be noted that in the present disclosure, the description of the accompanying drawings and embodiments are illustrative, not limiting. The same reference numerals in the specification denote the same structures. Furthermore, terms like “first” and “second” are used to distinguish one entity or operation from another and do not necessarily require or imply any actual relationship or order between the entities or operations. Terms such as “comprising, ” “including, ” or any of their variants are intended to cover non-exclusive inclusion, meaning an item or device comprising a series of elements includes not only those elements but also other elements not explicitly listed or inherent to such an item or device. Without further limitation, the expression “comprising one ... ” does not exclude the presence of additional identical elements in the item or device comprising the above elements.
[0346] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be applied in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments shown herein, but should be accorded the broadest scope consistent with the principles and novel features of the present disclosure.
Claims
1.A processing unit in a systolic array comprising a first set of data transmission paths for transmitting data in a first dimension and a second set of data transmission paths for transmitting data in a second dimension, the first set of data transmission paths being configured to transmit first data, and the second set of data transmission paths being configured to transmit second data, wherein:the first set of data transmission paths includes a first data transmission path transmitting data in a first direction and a second data transmission path transmitting data in a second direction; andthe second set of data transmission paths includes a third data transmission path transmitting data in a third direction and a fourth data transmission path transmitting data in a fourth direction.2.The processing unit in the systolic array according to claim 1, wherein:the first set of data transmission paths includes a first selection module configured to select, based on a selection signal, the first data transmission path to transmit the first data, or the second data transmission path to transmit the first data;the second set of data transmission paths includes a second selection module configured to select, based on the selection signal, the third data transmission path to transmit the second data, or the fourth data transmission path to transmit the second data; andthe processing unit further comprises a data processing module, the data processing module including a computing unit, the computing unit being located on data transmission paths of the first sets of data transmission paths and the second sets of data transmission paths and configured to process the first data and the second data to generate third data and store the third data.3.The processing unit in the systolic array according to claim 2, wherein:the first set of data transmission paths further includes a first set of output ports in the first dimension, and the second set of data transmission paths further includes a second set of output ports in the second dimension;the first set of output ports includes a first output port and a second output port, the first output port and the second output being configured to output the first data, the second set of output ports includes a third output port and a fourth output port, the third output port and the fourth output being configured to output the second data;a first data output of the computing unit is connected to the first set of output ports; anda second data output of the computing unit is connected to the second set of output ports.4.The processing unit in the systolic array according to claim 2, wherein:the first set of data transmission paths further includes a first set of input ports in the first dimension, and the second set of data transmission paths further includes a second set of input ports in the second dimension;the first set of input ports includes a first input port and a second input port, the first input port and the second input port being configured to input the first data;the second set of input ports includes a third input port and a fourth input port, the third input port and the fourth input port being configured to input the second data;two input terminals of the first selection module are connected to the first input port and the second input port, and an output terminal is connected to a first data input terminal of the computing unit;two input terminals of the second selection module are connected to the third input port and the fourth input port, and an output terminal is connected to a second data input terminal of the computing unit;control terminals of the first selection module and the second selection module are configured to input selection signals.5.The processing unit in the systolic array according to claim 4, further comprising:a selection signal generation module configured to generate a corresponding selection signal based on signal input statuses of the two input terminals of the first selection module or the two input terminals of the second selection module, a selection signal output terminal of the selection signal generation module being connected to the control terminals of the first selection module and the second selection module;wherein:the selection signal generation module is configured to generate a first selection signal when the first input port first receives the first data or the third input port first receives the second data, to allow the first selection module to select the first data transmission path to transmit the first data and the second selection module to select the third data transmission path to transmit the second data;the selection signal generation module is further configured to generate a second selection signal when the second input port first receives the first data or the fourth input port first receives the second data, to allow the first selection module to select the second data transmission path to transmit the first data and the second selection module to select the fourth data transmission path to transmit the second data.6.The processing unit according to claim 5, further comprising:a first delay module, two input terminals of the first delay module being connected to the first input port and the second input port, and two output terminals of the first delay module being connected to two input terminals of the first selection module, the first delay module being connected to delay the first data for one cycle and output the first data to the first selection module; anda second delay module, two input terminals of the second delay module being connected to the third input port and the fourth input port, and two output terminals of the second delay module being connected to the two input terminals of the second selection module, the second delay module being configured to delay the second data for one cycle and output the second data to the second selection module;wherein the two input terminals of the selection generation module are connected to the two input terminals of the first delay module or the two input terminals of the second delay module.7.A systolic array comprising m *n processing units, the processing units including a first set of data transmission paths for transmitting data in a first dimension and a second set of data transmission paths for transmitting data in a second dimension, the first set of data transmission paths being configured to transmit first data, and the second set of data transmission paths being configured to transmit second data;wherein:the first set of data transmission paths includes a first data transmission path for transmitting data in a first direction and a second data transmission path for transmitting data in a second direction; andthe second set of data transmission paths includes a third data transmission path for transmitting data in a third direction and a fourth data transmission path for transmitting data in a fourth direction.8.The systolic array according to claim 7, wherein:processing units in a first row and processing units in an n-th column of the m*n processing units are first processing units, and the remaining processing units are second processing units, or processing units in an m-th row and processing units in a first column of the m*n processing units are first processing units, and the remaining processing units are second processing units, wherein m > 1 and / or n > 1;the first processing units generate selection signals based on the input statuses of data input ports of the first set of data transmission paths and / or second set of data transmission paths and, based on the selection signals, select to input the first data transmitted by the first data transmission path and the second data transmitted by the third data transmission path, and output the first data and the second data to downstream processing units through the first set of data transmission paths and the second set of data transmission paths; andthe second processing units are configured to receive data output from upstream processing units and, based on the selection signals received from upstream processing units, select to input the first data transmitted by the first data transmission path and the second data transmitted by the third data transmission path and output the first data and the second data to downstream processing units through the first set of data transmission paths and the second set of data transmission paths; orthe first processing units generate the selection signals based on the input statuses of the data input ports of the first set of data transmission paths and / or the second set of data transmission paths, based on the selection signals, select to input the first data transmitted by the second data transmission path and the second data transmitted by the fourth data transmission path, and output the first data and the second data to the downstream processing units through the first set of data transmission paths and the second set of data transmission paths; andthe second processing units are configured to receive data output by the upstream processing units, and, based on the selection signals output by the upstream processing units, select to input the first data transmitted by the second data transmission path and the second data transmitted by the fourth data transmission path and output the first data and the second data to the downstream processing units through the first set of data transmission paths and the second set of data transmission paths.9.The systolic array according to claim 8, further comprising:a first processing unit and a second processing unit adjacent to each other and in the first dimension, a first output port of the first processing unit being connected to a first input port of the second processing unit, and a second input port of the first processing unit being connected to a second output port of the second processing unit; anda first processing unit and a second processing unit adjacent to each other and in the second dimension, a third output port of the first processing unit being connected to a third input port of the second processing unit, and a fourth input port of the first processing unit being connected to a fourth output port of the second processing unit.10.The systolic array according to claim 7, wherein second processing units located along several diagonal directions in parallel to an array diagonal direction are connected to selection signal output terminals of the first processing units along the array diagonal direction.11.An electronic device, comprising a systolic array according to any one of claims 7 to 10 or a systolic array composed of processing units according to any one of claims 1 to 6.12.A data processing method applied to a systolic array, the systolic array including m * n processing units, the processing units including a first set of data transmission paths for transmitting data in a row direction and a second set of data transmission paths for transmitting data in a column direction, the first set of data transmission paths transmitting first data, and the second set of data transmission paths transmitting second data, and each set includes 2 data transmission directions, comprising, in response to m=n:at a same moment, controlling a processing unit at i-th row and j-th column to transmit the first data through a first data transmission path and the second data through a third data transmission path, and controlling a processing unit at (m+1-i) -th row and (n+1-j) -th column to transmit the first data through a second data transmission path and the second data through a fourth data transmission path;wherein:the processing unit at i-th row and j-th column and a processing unit at r-row and s-column transmit data simultaneously, i+j = r+s, i and r being integers not smaller than 1 and not greater than m in sequence, and j and s being integers not smaller than 1 and not greater than in sequence.13.The data processing method according to claim 12, wherein:in the row direction, second data of columns starting from a first column in a second data matrix is input to processing units of a first row of different columns after the columns starting from the first column being delayed for one cycle starting from the first column, each piece of second data of the columns in the second data array are transmitted to processing units of a next row, row by row, according to a data transmission cycle, meanwhile, starting from a last column, the columns are delayed for one cycle, second data of columns starting from a last column in the second data matrix is input to processing units of the last row of previous columns, and each piece of second data of the columns in the second data array are transmitted to processing units of a previous row, row by row, according to the data transmission cycle; andin a column direction, after the rows starting from the first row being delayed for one cycle, first data of the rows starting from the first row in the first data matrix is input to processing units of a first column of the rows, and each piece of first data of the rows in the first data array is transmitted to processing units of a next column by column according to the data transmission cycle, meanwhile, starting from the last row, the rows are delayed for once cycle, the first data of the rows starting from the last row in the first data matrix is input to the processing units of the last column of the rows, and each piece of first data of the columns in the first data array is transmitted to the processing units of the previous column, column by column, according to the data transmission cycle.14.The data processing method according to claim 12, further comprising, according to processing units of a first row and processing units of a last column or data input statuses of the processing units of the first row and the processing units of the last column in the systolic array, based on the input states of the first-row and last-column units, or first-column and last-row units, selecting a data transmission path of a corresponding direction to allow the processing units in the diagonal direction to select a same data transmission direction at a same moment.15.The data processing method according to claim 13, further comprising:after the processing unit at the first row and the n-th column outputs a third signal, synchronously outputting the third data stored in the processing units of the rows, the third signal indicating that a data processing process of the processing unit at the first row and the n-th column ends; orafter the processing unit at the m-th row and the first column outputs a third signal, synchronously outputting the third data stored in the processing units of the rows, the third signal indicating that a data processing process of the processing unit at the m-th row and the first column ends.16.An electronic device, comprising a systolic array, a processor, and a memory, wherein the systolic array is the systolic array according to any one of claims 7 to 10, the memory stores a computer program, and the processor is configured to execute the computer program to allow the electronic device to implement the data processing method according to any one of claims 12 to 15.