Data processing apparatus and data processing method
By configuring the input routing and interconnection routing modules of the MIMD processing device through the configuration module, an interconnection route is established between the unidirectional cascaded multiply-accumulate unit modules, which solves the problem of the imbalance between the efficiency of the arithmetic unit and the data transmission efficiency in the MIMD processing device, and realizes efficient complex arithmetic operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SANECHIPS TECH CO LTD
- Filing Date
- 2020-06-23
- Publication Date
- 2026-05-05
AI Technical Summary
Existing MIMD processing devices suffer from an imbalance between computational efficiency, data transmission efficiency, and interconnection overhead in their interconnection routing methods, resulting in wasted computational efficiency and low data transmission efficiency.
The configuration module is used to configure the input routing module, interconnection routing module and multiply-accumulate unit module, and establish a unidirectional cascaded interconnection route. Data transmission between multiple multiply-accumulate unit modules is realized through the input route and interconnection route, and arithmetic operations are performed.
It achieves a balance between computational unit efficiency, data transmission efficiency, and interconnection overhead when performing complex arithmetic operations on multiple input data, reduces redundant forwarding multiply-accumulate unit modules that do not perform actual arithmetic operations, and improves data transmission efficiency.
Smart Images

Figure CN113835675B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data processing apparatus and a data processing method. Background Technology
[0002] Data models for multi-data arithmetic operations are characterized by large amounts of data, wide bit width, and high throughput, typically requiring flexible and complex arithmetic operations on multiple data points. The operations in these models mostly involve multiplication, addition, and subtraction between data points or between data points and constants, as well as basic operations such as the conjugation of data points themselves.
[0003] MIMD (Multiple Instruction Multiple Data) processing devices can perform complex arithmetic operations on multiple input data. The interconnection routing methods used between multiple processing units in an MIMD processing device typically include matrix interconnection, shared bus, or fully mapped routing. However, in matrix interconnection, some processing units are used for routing but cannot actually perform calculations, resulting in wasted processing unit efficiency. In shared bus routing, multiple processing units cannot transmit data simultaneously, leading to low data transmission efficiency between processing units and thus reducing the speed of calculation. In fully mapped routing, the wiring overhead and selector overhead between processing units are relatively large. Therefore, the above interconnection routing methods cannot achieve a balance between processing unit efficiency, data transmission efficiency, and interconnection overhead. Summary of the Invention
[0004] This application provides a data processing apparatus and a data processing method to achieve a balance between the computational efficiency of the computing unit, the data transmission efficiency, and the interconnection overhead when performing complex arithmetic operations on multiple input data.
[0005] In a first aspect, embodiments of this application provide a data processing apparatus, including: a configuration module, an input routing module, an interconnection routing module, and a plurality of multiply and accumulate unit (MAU) modules, wherein,
[0006] The configuration module is used to configure the input routing module, the interconnection routing module, and the plurality of multiply-accumulate unit modules according to the input mathematical model, and obtain the first configuration data, the second configuration data, and the third configuration data accordingly.
[0007] The input routing module is used to establish input routes between the multiple input data channels of the data processing device and the input interfaces of the multiple multiply-accumulate unit modules according to the first configuration data.
[0008] The interconnection routing module is used to establish an interconnection route between the output interface of the preceding multiply-accumulate unit module and the input interface of the following multiply-accumulate unit module according to the configuration data and the numbering order of the multiple multiply-accumulate unit modules, so as to realize the unidirectional cascading between the multiple multiply-accumulate unit modules.
[0009] The multiply-accumulate unit module is used to obtain the input data of the multiply-accumulate unit module through the input route and / or the interconnection route, and to perform arithmetic operations on the input data of the multiply-accumulate unit module according to the third configuration data.
[0010] Secondly, embodiments of this application also provide a data processing method, applied in any of the data processing apparatuses described in embodiments of this application, comprising:
[0011] The configuration module configures the input routing module, interconnection routing module, and multiple multiply-accumulate unit modules according to the input mathematical model, thereby obtaining the first configuration data, the second configuration data, and the third configuration data.
[0012] The input routing module establishes input routes between multiple input data channels and the input interfaces of the multiple multiply-accumulate unit modules based on the first configuration data.
[0013] The interconnection routing module establishes a route between the output interface of the preceding multiply-accumulate unit module and the input interface of the following multiply-accumulate unit module according to the second configuration data of the configuration module and the numbering order of the multiple multiply-accumulate unit modules, so as to realize the unidirectional cascading between the multiple multiply-accumulate unit modules.
[0014] The input routing module receives multiple input data from the data processing device.
[0015] The input data of the multiply-accumulate unit module is obtained by the multiply-accumulate unit module based on the input route and / or the interconnection route, and arithmetic operations are performed on the input data of the multiply-accumulate unit module according to the third configuration data. The arithmetic operation result corresponding to the multiple input data is obtained by the multiply-accumulate unit module whose numbering order is the last one.
[0016] In the technical solution provided by this application embodiment, the data processing device can perform flexible and complex arithmetic operations on multiple device input data, and can meet the needs of switching and updating mathematical models for multi-data arithmetic operations. At the same time, the interconnection routing module in the data processing device establishes an interconnection route between the output interface of the previous multiplication-accumulation unit module and the input interface of the subsequent multiplication-accumulation unit module according to the configuration of the configuration module and the numbering order of the multiple multiplication-accumulation unit modules. This realizes unidirectional cascading between multiple multiplication-accumulation unit modules, rather than bidirectional cascading, thereby reducing the interconnection routing overhead. Moreover, there are no redundant forwarding multiplication-accumulation unit modules in the data processing device that do not perform actual arithmetic operations. The data transmission between multiplication-accumulation unit modules is also higher than that of interconnection routing in the shared bus mode. Therefore, the data processing device provided by this application embodiment can balance the operation efficiency of the operation unit, the data transmission efficiency, and the interconnection overhead when performing complex arithmetic operations on multiple input data. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0018] Figure 2 This is a schematic diagram of the structure of a multiply-accumulate unit module provided in an embodiment of this application;
[0019] Figure 3 This is a schematic diagram of the structure of an input routing module provided in an embodiment of this application;
[0020] Figure 4 An example diagram of the interconnection routing of the second multiply-accumulate unit module in an interconnection routing module provided in this application embodiment;
[0021] Figure 5 An example diagram of the interconnection routing of the third multiply-accumulate unit module in an interconnection routing module provided in this application embodiment;
[0022] Figure 6 An example diagram of the interconnection routing of the 4th bit multiply-accumulate unit module in an interconnection routing module provided in this application embodiment;
[0023] Figure 7 This application provides an example diagram of the interconnection routing of the Xth bit multiply-accumulate unit module in an interconnection routing module.
[0024] Figure 8 This is a schematic diagram of the structure of a data processing method provided in an embodiment of this application. Detailed Implementation
[0025] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0026] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustration and has no inherent meaning. Therefore, "module," "part," or "unit" may be used interchangeably.
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be arbitrarily combined with each other.
[0028] In one exemplary implementation Figure 1 This is a schematic diagram of a data processing apparatus provided in an embodiment of this application. This apparatus is suitable for performing flexible and complex arithmetic operations on multiple input data. Figure 1 As shown, the data processing apparatus provided in this embodiment includes: a configuration module 10, an input routing module 20, an interconnection routing module 30, and multiple multiply-accumulate unit modules 40. Wherein,
[0029] The configuration module 10 is used to configure the input routing module 20, the interconnection routing module 30 and multiple multiply-accumulate unit modules 40 according to the input mathematical model, and obtain the first configuration data, the second configuration data and the third configuration data accordingly.
[0030] The input routing module 20 is used to establish input routes between multiple input data channels of the data processing device and the input interfaces of multiple multiply-accumulate unit modules 40 according to the first configuration data.
[0031] The interconnection routing module 30 is used to establish an interconnection route between the output interface of the previous multiply-accumulate unit module and the input interface of the subsequent multiply-accumulate unit module in the multiple multiply-accumulate unit modules 40 according to the second configuration data and the numbering order of the multiple multiply-accumulate unit modules 40, so as to realize the unidirectional cascading between the multiple multiply-accumulate unit modules;
[0032] The multiply-accumulate unit module 40 is used to obtain input data of the multiply-accumulate unit module 40 through input routing and / or interconnection routing, and to perform arithmetic operations on the input data of the multiply-accumulate unit module 40 according to the third configuration data.
[0033] Optionally, the configuration module 10 is implemented by a CPU (Central Processing Unit) and is connected to the input routing module 20, the interconnection routing module 30, and multiple multiply-accumulate unit modules 40, respectively. It configures the input routing module 20, the interconnection routing module 30, and the multiple multiply-accumulate unit modules 40 to obtain first configuration data corresponding to the input routing module 20, second configuration data corresponding to the interconnection routing module 30, and third configuration data corresponding to each multiply-accumulate unit module 40. Specifically, it can send the corresponding configuration data to the relevant devices in the input routing module 20, the interconnection routing module 30, and the multiple multiply-accumulate unit modules 40, respectively. Optionally, the first configuration data, the second configuration data, and the third configuration data are control signals for the relevant devices.
[0034] In one example, the configuration module 10 can be connected to each multiply-accumulate unit module 40 via separate control signal lines to control each multiply-accumulate unit module 40.
[0035] In another example, configuration module 10 can also be connected to each multiply-accumulate unit module 40 simultaneously via a control bus to control each multiply-accumulate unit module 40. This control method provided in this example significantly reduces wiring overhead.
[0036] The input mathematical model refers to a mathematical model used for multi-data arithmetic operations, input into the configuration module. It can be switched or updated according to actual needs, and features high data volume, large bit width, and high throughput. For example, some mathematical models require adding several input data points first, then multiplying the result with the remaining input data; some require subtracting several input data points first, then multiplying the result with several input data points, and finally adding the result with the remaining input data; some require multiplying all input data. The operational characteristics of most mathematical models are basic operations such as multiplication, addition, and subtraction between input data, or basic operations such as multiplication, addition, and subtraction between input data and constants, or basic operations such as conjugation and inversion of input data itself.
[0037] For a data processing device, there are multiple input data (e.g., N data) and one output data. Optionally, N input data can be input simultaneously, for example, N data can be input simultaneously via a data bus for corresponding arithmetic operations. When there are N input data, the number of multiply-accumulate unit modules 40 can be N, N-1, or fewer, depending on the computing power of the multiply-accumulate unit modules. This embodiment does not impose a specific limitation. Since arithmetic operations are performed at least between two input data, to avoid idle multiply-accumulate unit modules, the number of multiply-accumulate unit modules 40 can be set to N-1. The following explanation uses N-1 multiply-accumulate unit modules as an example.
[0038] After receiving data based on the input route established by the input routing module 20 and / or the interconnection route established by the interconnection routing module, the multiply-accumulate unit module 40 performs arithmetic operations on the received data according to the third configuration data. Optionally, the third configuration data is used to indicate the data selected for arithmetic operations, and / or to indicate the type of each arithmetic operation, etc. The input route is created by the input routing module 20 to map the input data of the data processing device to the input data of the multiply-accumulate unit module; the interconnection route is created by the interconnection routing module 30 to map the output data of one multiply-accumulate unit module to the input data of another multiply-accumulate unit module. It is worth noting that for a multiply-accumulate unit module 40, its input data can come solely from the input route, solely from the interconnection route, or simultaneously from both the input route and the interconnection route.
[0039] The multiply-accumulate unit module has multiple input interfaces and one output interface. The input interfaces can be used to receive input data from the data processing device, output data from other multiply-accumulate unit modules, and constants configured by the configuration module.
[0040] In a specific example, the multiply-accumulate unit module is used to implement common arithmetic operations between two data points, such as addition, multiplication, negation, and conjugation. For example... Figure 2 As shown, the input interface of the multiply-accumulate unit module includes: two device data input interfaces 4001, two interconnect data input interfaces 4002, and one constant input interface 4003. The device data input interfaces are used to receive input data from the data processing device, the interconnect data input interfaces are used to receive output data from the preceding multiply-accumulate unit module, and the constant input interface is used to receive constants configured by the configuration module.
[0041] Furthermore, such as Figure 2As shown, the multiply-accumulate unit module also includes a control interface 4004 for receiving third configuration data from the configuration module. Furthermore, the multiply-accumulate unit module is specifically used to select one or two data points from the data received through the input interface for arithmetic operations based on the third configuration data from the configuration module; that is, to select one or two data points from multiple data points received through two device data input interfaces, two interconnect data input interfaces, and one constant input interface for corresponding arithmetic operations.
[0042] In one example, the multiply-accumulate unit module may include at least one of the following: a selector, a conjugate inverting unit, a multiplication unit, an addition unit, and a truncation unit, wherein the conjugate inverting unit is used to perform conjugate operations and / or inverting operations on data, or to perform pass-through operations on data.
[0043] In a specific example, such as Figure 2 As shown, the multiply-add unit module 40 includes a selector 401, a selector 402, a conjugate inversion unit 403, a conjugate inversion unit 404, a multiplication unit 405, an addition unit 406, and a truncation unit 407.
[0044] The selector 401 selects one or two data points from five data points according to the configuration of the configuration module (i.e., the third configuration data); the multiplication unit 405 performs multiplication arithmetic operations; the addition unit 406 performs addition arithmetic operations; the conjugate inversion unit 403 and the conjugate inversion unit 404 perform conjugate operations and / or inversion operations, or pass-through operations, on the two data points passed by the selector 401 according to the configuration of the configuration module (i.e., the third configuration data). A pass-through operation means that no operation is performed on the data input to the conjugate inversion unit; that is, when the conjugate inversion unit performs a pass-through operation on the passed data, its output data is the input data. The selector 402 selects one data point from the four data points—the output data of the multiplication unit 405, the output data of the addition unit 406, the output data of the conjugate inversion unit 403, and the output data of the conjugate inversion unit 404—according to the configuration of the configuration module (i.e., the third configuration data). In addition, the truncation unit 407 truncates the output data of the selector 402 according to the configuration of the configuration module (i.e., the third configuration data) to avoid overflow of the calculation result during multi-data arithmetic operations. Finally, the output of the truncation unit 407 is the output of the multiply-accumulate unit module.
[0045] In this example, the multiply-add unit module can perform combined operations of conjugate / invert and multiply / add on any two received data, or it can perform pass-through, conjugate and invert operations on any single received data.
[0046] It is worth noting that the configurations of selector 401, selector 402, conjugate inverting unit 403, conjugate inverting unit 404, and truncation unit 407 can all be obtained through the control interface 4004 of the multiply-accumulate unit module.
[0047] In the technical solution provided in this embodiment, each multiply-accumulate unit module is assigned a number, and multiple multiply-accumulate unit modules are sorted according to their numbers. This sorting can be done from smallest to largest or from largest to smallest. The multiple multiply-accumulate unit modules are unidirectionally cascaded based on an interconnection route established by the interconnection routing module. In the multiple multiply-accumulate unit modules, the interconnection route is between the output interface of the preceding multiply-accumulate unit module and the input interface of the following multiply-accumulate unit module; that is, the data flow direction is from the output interface of the preceding multiply-accumulate unit module to the input interface of the following multiply-accumulate unit module. Here, "previous multiply-accumulate unit module" and "following multiply-accumulate unit module" are relative terms, and the number of digits in the numbering sequence of the preceding multiply-accumulate unit module is less than the number of digits in the numbering sequence of the following multiply-accumulate unit module.
[0048] In other words, the data mapping between multiply-accumulate unit modules is unidirectional and asymmetric. The output data of the preceding multiply-accumulate unit module can be mapped to the input data of the following multiply-accumulate unit module, but the output data of the following multiply-accumulate unit module cannot be mapped to the input data of the preceding multiply-accumulate unit module.
[0049] Furthermore, the overall data flow of the data processing device is from the first multiply-accumulate unit module in the numbering sequence to the last multiply-accumulate unit module in the numbering sequence. Taking the data processing device as having N-1 multiply-accumulate unit modules as an example, the overall data flow of the data processing device is from the first multiply-accumulate unit module to the N-1th multiply-accumulate unit module.
[0050] Except for the multiply-accumulate unit modules whose numbering order is the last digit (e.g.) Figure 1 Except for the (N-1)th multiply-accumulate unit module, the outputs of the remaining multiply-accumulate unit modules are sent to the interconnection routing module to achieve unidirectional cascading between multiple multiply-accumulate unit modules. The output of the multiply-accumulate unit module whose number is the last in the sequence is the output of the data processing device and does not need to be sent to the interconnection routing module.
[0051] The input routing module 20 establishes routes between N input data channels and N-1 multiply-accumulate unit modules according to the first configuration data. Each input data channel receives one input data point, and the N input data channels can simultaneously receive N input data points from the data processing device. The first configuration data instructs the establishment of a route between a specific input data channel and a specific input interface of a specific multiply-accumulate unit module; specifically, it can be the establishment of a route between a specific input data channel and a specific device data input interface of a specific multiply-accumulate unit module.
[0052] With each multiply-accumulate unit module having two device data input interfaces, the input routing module 20 has the ability to establish a total of N*2*(N-1) mapping routes between N input data channels and N-1 multiply-accumulate unit modules.
[0053] In a specific example, such as Figure 3 As shown, the input routing module 20 includes multiple selectors 201. Each selector 201 provides routing between multiple input data channels of the data processing device and a device data input interface of a multiply-accumulate unit module. Each selector 201 takes configuration data and N input data as input and outputs the input data of a specific device data input interface of a multiply-accumulate unit module. There are N-1 multiply-accumulate unit modules, totaling 2N-2 device data input interfaces. The input data channels corresponding to each device data input interface can be independently configured through the configuration module. Therefore, the input routing module enables the data processing device to perform parallel computation of multiple input data.
[0054] Furthermore, in one example, the input routing module is used to establish input routes between multiple input data channels of the data processing device and the input interfaces of multiple multiply-accumulate unit modules based on the first configuration data. Specifically, this can be achieved as follows:
[0055] The input routing module is used to select an input data target channel from multiple input data channels of the data processing device through a selector based on the first configuration data, and to establish a route between the input data target channel and a device data input interface of a multiply-accumulate unit module.
[0056] like Figure 3 As shown, taking a selector 201 as an example, the selector 201 has the ability to establish a route between any one of the N input data channels and a device data input interface of a multiply-accumulate unit module connected to the selector 201. Figure 3 Input data 0 to input data N-1 are the N input data of the data processing device. Device input data 0 and device input data 1 are the input data of the data processing device received by the two device data input interfaces of the multiply-accumulate unit module, respectively.
[0057] Specifically, selector 201 selects one input data channel from N input data channels as the input data target channel according to the configuration of the configuration module, and establishes a route between the input data target channel and a device data input interface of a multiply-accumulate unit module connected to selector 201.
[0058] It is worth noting that selector 201 can also, according to the configuration of the configuration module, not establish a route between any one of the N input data channels and a device data input interface of a multiply-accumulate unit module connected to selector 201. In this case, the device data input interface of the multiply-accumulate unit module connected to selector 201 cannot receive input data from the data processing device.
[0059] The interconnection routing module 30 can establish routes between the output interfaces of the preceding multiply-accumulate unit modules and the input interfaces of the following multiply-accumulate unit modules in the multiple multiply-accumulate unit modules 40, based on the second configuration data, to complete the unidirectional asymmetric mapping of the output data of the preceding multiply-accumulate unit modules to the interconnection input data of the following multiply-accumulate unit modules. When the multiply-accumulate unit module can process arithmetic operations on a maximum of two data points, the following multiply-accumulate unit module can select the outputs of a maximum of two preceding multiply-accumulate unit modules for cascaded arithmetic operations.
[0060] The second configuration data is used to indicate the establishment of a route between the output interface of a certain pre-stage multiply-accumulate unit module and a certain input interface of a certain post-stage multiply-accumulate unit module. Specifically, it can be the establishment of a route between the output interface of a certain pre-stage multiply-accumulate unit module and a certain interconnect data input interface of a certain post-stage multiply-accumulate unit module.
[0061] Furthermore, after the input routing module establishes input routes between multiple input data channels and the input interfaces of multiple multiply-accumulate unit modules according to the configuration of the configuration module, and the interconnection routing module establishes interconnection routes between the output interface of the preceding multiply-accumulate unit module and the input interface of the following multiply-accumulate unit module according to the configuration of the configuration module, the multiple multiply-accumulate unit modules form a parallel / serial hybrid network topology based on the input routes and interconnection routes.
[0062] In the above technical solution, the configuration module configures the input routing module, multiply-accumulate unit module and interconnection routing module according to the required multi-data arithmetic operation mathematical model, so that the input data of the data processing device and the output data of the multiply-accumulate unit module can be flexibly mapped to the input data of the corresponding multiply-accumulate unit module. The multiply-accumulate unit module performs relevant operations on the data it receives, so that the data processing device has the ability to perform complex multi-data arithmetic operations.
[0063] In one example, the interconnect routing module is used to provide interconnect routing between the output interface of the preceding multiply-accumulate unit module and the interconnect data input interface of the following multiply-accumulate unit module via direct connection and / or selector; wherein the numbering sequence number of the preceding multiply-accumulate unit module is less than the numbering sequence number of the following multiply-accumulate unit module.
[0064] The input data of the selector in the interconnect routing module is the output data of the preceding multiply-accumulate unit module, and the output data is the interconnect input data of the subsequent multiply-accumulate unit module (i.e., the input data received through the interconnect data input interface). Optionally, the selector in the interconnect routing module can have one or more input data points and one output data point. When the selector has only one data point, it is equivalent to directly connecting its input and output data.
[0065] In a specific example, where the multiply-accumulate unit module can handle arithmetic operations on at most two data points, for the first four multiply-accumulate unit modules in the numbering order, the interconnect routing module provides an interconnect route between the output interface of the preceding multiply-accumulate unit module and the interconnect data input interface of the following multiply-accumulate unit module via a direct connection; for multiply-accumulate unit modules other than the first four in the numbering order, the interconnect routing module provides an interconnect route between the output interface of the preceding multiply-accumulate unit module and the interconnect data input interface of the following multiply-accumulate unit module via a direct connection and a selector.
[0066] Let's take the Xth multiply-accumulate unit module with number sorting position X as an example for explanation. First, let's set X to be an integer greater than or equal to 0 and less than or equal to the total number of multiply-accumulate unit modules.
[0067] There are X-1 multiply-accumulate unit modules upstream of the X-th multiply-accumulate unit module data stream. If we want to perform cascaded multiply-accumulate unit module operations among the X multiply-accumulate unit modules, we can decompose the positive integer addition of X-1, such as X-1=1+(X-2)=2+(X-3)=3+(X-4)=……=floor(X-1 / 2)+ceil(X-1 / 2), where floor is the floor function (i.e., the floor function towards negative infinity) and ceil is the floor function (i.e., the floor function towards positive infinity).
[0068] "X-1 = 1 + (X-2)" indicates that the Xth multiply-accumulate unit module can perform cascade arithmetic operations of "output of 1 multiply-accumulate unit module" and "cascaded output of X-2 multiply-accumulate unit modules". Since multiple multiply-accumulate unit modules are unidirectionally cascaded, "output of 1 multiply-accumulate unit module" and "cascaded output of X-2 multiply-accumulate unit modules" correspond to the output of the (X-1)th multiply-accumulate unit module and the output of the (X-2)th multiply-accumulate unit module, respectively. Therefore, "X-1 = 1 + (X-2)" indicates that the Xth multiply-accumulate unit module can perform cascade arithmetic operations of "output of the (X-1)th multiply-accumulate unit module" and "output of the (X-2)th multiply-accumulate unit module".
[0069] "X-1 = 2 + (X-3)" indicates that the Xth multiply-accumulate unit module can perform cascade arithmetic operations of "2 multiply-accumulate unit modules cascaded output" and "X-3 multiply-accumulate unit modules cascaded output". Since multiple multiply-accumulate unit modules are cascaded unidirectionally, "2 multiply-accumulate unit modules cascaded output" and "X-3 multiply-accumulate unit modules cascaded output" correspond to the outputs of the (X-1)th and (X-3)th multiply-accumulate unit modules, respectively. Therefore, "X-1 = 2 + (X-3)" indicates that the Xth multiply-accumulate unit module can perform cascade arithmetic operations of "the output of the (X-1)th multiply-accumulate unit module" and "the output of the (X-3)th multiply-accumulate unit module".
[0070] Similarly, "X-1 = floor((X-1) / 2) + ceil((X-1) / 2)" means that the Xth multiply-accumulate unit module can perform the cascaded arithmetic operations of "floor((X-1) / 2) multiply-accumulate unit modules cascaded output" and "ceil((X-1) / 2) multiply-accumulate unit modules cascaded output". Since multiple multiply-accumulate unit modules are cascaded in a unidirectional manner, "floor((X-1) / 2) multiply-accumulate unit module cascaded output" and "ceil((X-1) / 2) multiply-accumulate unit module cascaded output" correspond to the output of the (X-1)th multiply-accumulate unit module and the output of the ceil((X-1) / 2)th multiply-accumulate unit module, respectively. Therefore, "X-1=floor((X-1) / 2)+ceil((X-1) / 2)" means that the Xth multiply-accumulate unit module can complete the cascaded arithmetic operation of "the output of the (X-1)th multiply-accumulate unit module" and "the output of the ceil((X-1) / 2)th multiply-accumulate unit module".
[0071] In summary, the preceding multiply-accumulate unit module of the Xth bit multiply-accumulate unit module has a fixed X-1th bit multiply-accumulate unit module, and optional X-2th, X-3th, ..., ceil((X-1) / 2)th bit multiply-accumulate unit modules. Therefore, the interconnection routing module does not need to provide routes from the 1st, 2nd, ..., ceil((X-1) / 2)-1th bit multiply-accumulate unit modules to the Xth bit multiply-accumulate unit module, thereby reducing interconnection routing overhead.
[0072] The first four multiply-accumulate unit modules in the numbering sequence, namely the 1st to 4th multiply-accumulate unit modules, are special because their numbers are listed at the beginning of the sequence.
[0073] Among them, the first multiply-accumulate unit module is the first multiply-accumulate unit module in the data processing device, and there is no preceding multiply-accumulate unit module.
[0074] The preceding multiply-accumulate unit module of the second multiply-accumulate unit module has one and only one first multiply-accumulate unit module.
[0075] The preceding multiply-accumulate unit module of the third multiply-accumulate unit module has only the first multiply-accumulate unit module and the second multiply-accumulate unit module.
[0076] The 4th multiply-accumulate unit module has three preceding multiply-accumulate unit modules: the 1st, 2nd, and 3rd multiply-accumulate unit modules. However, when X = 4, X - 2 = ceil((X - 1) / 2) = 2, so the 3rd (i.e., X - 1)th multiply-accumulate unit module and the 2nd multiply-accumulate unit module can be considered as preceding multiply-accumulate unit modules, while the 1st multiply-accumulate unit module is not. The routing between the output of the 1st multiply-accumulate unit module and the input of the 4th multiply-accumulate unit module does not need to be considered in the interconnection routing.
[0077] Furthermore, for the first four multiply-accumulate unit modules in the numbering sequence, their interconnection routes can be implemented only through direct connection, that is, through wiring. Their interconnection routes only have wiring overhead and no selector overhead.
[0078] Reference Figure 4 , Figure 5 and Figure 6 In a specific example, for the first four multiply-accumulate unit modules in the numbering sequence, the interconnect routing module is used to provide interconnect routing between the output interface of the preceding multiply-accumulate unit module and the interconnect data input interface of the following multiply-accumulate unit module via direct connection. Specifically, it can be as follows:
[0079] The interconnection routing module is also used to provide interconnection routing between the output interface of the first multiply-accumulate unit module and the interconnection data input interface of the second multiply-accumulate unit module via direct connection, between the output interfaces of the first and second multiply-accumulate unit modules and the interconnection data input interface of the third multiply-accumulate unit module, and between the output interfaces of the second and third multiply-accumulate unit modules and the interconnection data input interface of the fourth multiply-accumulate unit module.
[0080] That is, the interconnection route of the second multiply-accumulate unit module is the route from the output of the first multiply-accumulate unit module to the interconnection input data 0 (or interconnection input data 1) of the second multiply-accumulate unit module; the interconnection route of the third multiply-accumulate unit module is the route from the output of the second multiply-accumulate unit module to the interconnection input data 0 of the third multiply-accumulate unit module, and the route from the output of the first multiply-accumulate unit module to the interconnection input data 1 of the third multiply-accumulate unit module; the interconnection route of the fourth multiply-accumulate unit module is the route from the output of the third multiply-accumulate unit module to the interconnection input data 0 of the fourth multiply-accumulate unit module, and the route from the output of the second multiply-accumulate unit module to the interconnection input data 1 of the fourth multiply-accumulate unit module.
[0081] Among them, Interconnect Input Data 1 and Interconnect Input Data 0 are the input data received by the two interconnect data input interfaces of the multiply-accumulate unit module.
[0082] The multiply-accumulate unit modules other than the first four in the numbering order, that is, the other multiply-accumulate unit modules after the 4th multiply-accumulate unit module, are still represented by the Xth multiply-accumulate unit module as an example. In this case, X is a natural number greater than 4 and less than or equal to the total number of multiply-accumulate unit modules (N-1), that is, 4 < X ≤ N-1.
[0083] Reference Figure 7 In a specific example, for the multiply-accumulate unit modules excluding the first four digits of the numbering, the interconnect routing module is used to provide interconnect routing between the output interface of the preceding multiply-accumulate unit module and the interconnect data input interface of the following multiply-accumulate unit module through direct connection and selectors. Specifically, it can be as follows:
[0084] The interconnection routing module is used to provide routing between the output interface of the (X-2)th multiply-accumulate unit module and an interconnection data input interface of the Xth multiply-accumulate unit module via a selector; and to provide interconnection routing between the output interface of the (X-1)th multiply-accumulate unit module and another interconnection data input interface of the Xth multiply-accumulate unit module via a direct connection.
[0085] The output interfaces of the (X-2)th multiply-accumulate unit module, the (X-3)th multiply-accumulate unit module, ..., the (X-1)th multiply-accumulate unit module are connected to the selector configured by the configuration module. The output of the selector is directly connected to one interconnect data input interface of the Xth multiply-accumulate unit module. The output interface of the (X-1)th multiply-accumulate unit module is directly connected to the other interconnect data input interface of the Xth multiply-accumulate unit module.
[0086] That is, the interconnection route of the Xth multiply-accumulate unit module is the route from the output of any one of the multiply-accumulate unit modules among the (X-2)th, (X-3)th, ..., and (Ceil((X-1) / 2)th)th multiply-accumulate unit modules to the interconnection input data 1 of the Xth multiply-accumulate unit module, and the route from the output of the (X-1)th multiply-accumulate unit module to the interconnection input data 0 of the Xth multiply-accumulate unit module.
[0087] Furthermore, the interconnection routing module can be used to establish interconnection routes between the output interface of the preceding multiply-accumulate unit module and the input interface of the following multiply-accumulate unit module based on the second configuration data, specifically as follows:
[0088] The interconnection routing module is used to select a target multiply-accumulate unit module from the X-2 bit multiply-accumulate unit module to the ceil((X-1) / 2) bit multiply-accumulate unit module according to the second configuration data, and establish an interconnection route between the output interface of the target multiply-accumulate unit module and an interconnection data input interface of the X bit multiply-accumulate unit module.
[0089] The selector corresponding to the Xth multiply-accumulate unit module selects an interconnect data input interface from the X-2th multiply-accumulate unit module, the X-3th multiply-accumulate unit module, ..., the ceil((X-1) / 2)th multiply-accumulate unit module, according to the second configuration data, to connect to the Xth multiply-accumulate unit module.
[0090] In the above technical solution, the selector overhead of each multiply-accumulate unit module from the 5th to the (N-1)th multiply-accumulate unit module is (X-2-ceil((X-1) / 2)) select 1, thus the order of magnitude of the selector overhead within the interconnection routing module is N^2 / 4. If the interconnection routing module uses the existing full mapping scheme, each multiply-accumulate unit module randomly selects 2 from the other N-2 multiply-accumulate unit modules to perform multiply-accumulate unit module cascade operation, the selector overhead of each multiply-accumulate unit module is 2*(N-2) select 1, and the selector overhead of N-1 multiply-accumulate unit modules is (N-1)*2*(N-2) selector resources, which is on the order of 2*N^2. In comparison, the selector overhead of the interconnection routing module provided in this application embodiment is much smaller than that of the full mapping scheme.
[0091] The interconnection routing module provided in this application does not have redundant forwarding multiply-accumulate unit modules that do not perform actual arithmetic operations. The data transmission between multiply-accumulate unit modules is also higher than that of interconnection routing in the shared bus mode, and the interconnection overhead is lower than that of the fully mapped routing mode, thus balancing the computational efficiency of the arithmetic unit, the data transmission efficiency, and the interconnection overhead.
[0092] In the technical solution provided by the embodiments of this application, the data processing device can perform flexible and complex arithmetic operations on multiple device input data, and can meet the needs of switching and updating mathematical models for multi-data arithmetic operations. At the same time, the interconnection routing module in the data processing device establishes an interconnection route between the output interface of the previous multiplication-accumulation unit module and the input interface of the subsequent multiplication-accumulation unit module according to the configuration of the configuration module and the numbering order of the multiple multiplication-accumulation unit modules, so as to realize unidirectional cascading between multiple multiplication-accumulation unit modules, rather than bidirectional cascading, thereby reducing the interconnection routing overhead. Moreover, there are no redundant forwarding multiplication-accumulation unit modules that do not perform actual arithmetic operations in the data processing device, and the data transmission between multiplication-accumulation unit modules is also higher than that of interconnection routing in the shared bus mode. Therefore, the data processing device provided by the embodiments of this application can balance the operation efficiency of the operation unit, the data transmission efficiency and the interconnection overhead when performing complex arithmetic operations on multiple input data.
[0093] In one exemplary implementation Figure 8 This is a flowchart illustrating a data processing method provided in this application. This method is suitable for situations involving flexible and complex arithmetic operations on multiple input data. This method can be executed by the data processing apparatus provided in any embodiment of this application.
[0094] like Figure 8 As shown, the data processing method provided in this application embodiment, when applied to the data processing apparatus provided in any embodiment of this application, includes:
[0095] S810. The configuration module configures the input routing module, the interconnection routing module, and multiple multiply-accumulate unit modules according to the input mathematical model, and obtains the first configuration data, the second configuration data, and the third configuration data respectively.
[0096] S820: The input routing module establishes input routes between multiple input data channels and the input interfaces of multiple multiply-accumulate unit modules based on the first configuration data.
[0097] S830. Based on the second configuration data, the interconnection routing module establishes an interconnection route between the output interface of the previous multiply-accumulate unit module and the input interface of the subsequent multiply-accumulate unit module according to the numbering order of the multiple multiply-accumulate unit modules, so as to realize the unidirectional cascading between the multiple multiply-accumulate unit modules.
[0098] S840 receives multiple input data from the data processing device through the input routing module.
[0099] After the configuration module completes the relevant configuration, the data processing device can receive input data through the input routing module.
[0100] S850: The input data of the multiply-accumulate unit module is obtained through the multiply-accumulate unit module based on the input route and / or interconnection route, and arithmetic operations are performed on the input data of the multiply-accumulate unit module according to the third configuration data, and the arithmetic operation results corresponding to multiple input data are obtained through the multiply-accumulate unit module whose numbering order is the last one.
[0101] In one example, the multiply-add unit module includes at least one of the following: a selector, a conjugate inversion unit, a multiplication unit, an addition unit, and a truncation unit, wherein the conjugate inversion unit is used to perform conjugate operations and / or inversion operations on data, or to perform pass-through operations on data.
[0102] In one example, the input interface of the multiply-accumulate unit module includes: two device data input interfaces for receiving input data from the data processing device; the input interface of the multiply-accumulate unit module includes: two interconnect data input interfaces for receiving output data from the preceding multiply-accumulate unit module; the input interface of the multiply-accumulate unit module further includes: a constant input interface for receiving constants configured by the configuration module; the multiply-accumulate unit module is specifically used to select one or two data from the data received through the input interface for arithmetic operations based on the third configuration data.
[0103] Accordingly, when configuring the input routing module, the interconnection routing module, and multiple multiply-accumulate unit modules according to the input mathematical model, the configuration module configures each selector within the input routing module according to the input mathematical model to configure the input routing for the 1st multiply-accumulate unit module to the (N-1)th multiply-accumulate unit module; it configures each selector within the interconnection routing module according to the input mathematical model to configure the interconnection routing for the 5th multiply-accumulate unit module to the (N-1)th multiply-accumulate unit module; and it performs relevant configurations for each multiply-accumulate unit module according to the input mathematical model.
[0104] If the input mathematical model includes constants, the configuration module will also input the constants in the mathematical model into the corresponding multiply-accumulate unit module.
[0105] Furthermore, the input routing module includes multiple selectors, which are used to provide input routing between multiple input data channels of the data processing device and a device data input interface of the multiply-accumulate unit module.
[0106] Furthermore, based on the first configuration data, the input routing module selects an input data target channel from multiple input data channels of the data processing device through a selector, and establishes an input route between the input data target channel and a device data input interface of a multiply-accumulate unit module.
[0107] In one example, the interconnect routing module provides interconnect routing between the output interface of the preceding multiply-accumulate unit module and the interconnect data input interface of the following multiply-accumulate unit module through direct connection and / or selectors; wherein the number of digits in the sequence of the preceding multiply-accumulate unit module is less than the number of digits in the sequence of the following multiply-accumulate unit module.
[0108] Furthermore, when the multiply-accumulate unit module processes a maximum of two data items, for the first four multiply-accumulate unit modules in the numbering order, the interconnection routing module provides an interconnection route between the output interface of the preceding multiply-accumulate unit module and the interconnection data input interface of the following multiply-accumulate unit module through a direct connection. For multiply-accumulate unit modules other than the first four in the numbering order, the interconnection routing module provides an interconnection route between the output interface of the preceding multiply-accumulate unit module and the interconnection data input interface of the following multiply-accumulate unit module through a direct connection and a selector.
[0109] Furthermore, the interconnection routing module provides interconnection routes between the output interface of the first multiply-accumulate unit module and the interconnection data input interface of the second multiply-accumulate unit module via direct connection, between the output interfaces of the first and second multiply-accumulate unit modules and the interconnection data input interface of the third multiply-accumulate unit module, and between the output interfaces of the second and third multiply-accumulate unit modules and the interconnection data input interface of the fourth multiply-accumulate unit module.
[0110] The interconnection routing module provides interconnection routing between the output interface of the (X-2)th multiply-accumulate unit module and one interconnection data input interface of the Xth multiply-accumulate unit module through a selector; and provides interconnection routing between the output interface of the (X-1)th multiply-accumulate unit module and another interconnection data input interface of the Xth multiply-accumulate unit module through a direct connection.
[0111] Where X is a natural number greater than 4 and less than or equal to the total number of multiply-accumulate unit modules, and ceil is the floor function.
[0112] Furthermore, based on the second configuration data, the interconnection routing module selects a target multiply-accumulate unit module from the X-2 bit multiply-accumulate unit module to the ceil((X-1) / 2) bit multiply-accumulate unit module using a selector, and establishes an interconnection route between the output interface of the target multiply-accumulate unit module and an interconnection data input interface of the X bit multiply-accumulate unit module.
[0113] For any aspects of this implementation method that are not explained in detail, please refer to the foregoing embodiments; they will not be repeated here.
[0114] In the above technical solution, the data processing device can perform flexible and complex arithmetic operations on input data from multiple devices, and can meet the needs of switching and updating mathematical models for multi-data arithmetic operations. At the same time, the interconnection routing module in the data processing device establishes an interconnection route between the output interface of the previous multiplication-accumulation unit module and the input interface of the subsequent multiplication-accumulation unit module according to the configuration of the configuration module and the numbering order of the multiple multiplication-accumulation unit modules. This realizes unidirectional cascading between multiple multiplication-accumulation unit modules, rather than bidirectional cascading, thereby reducing the interconnection routing overhead. Moreover, there are no redundant forwarding multiplication-accumulation unit modules in the data processing device that do not perform actual arithmetic operations. The data transmission between multiplication-accumulation unit modules is also higher than that of interconnection routing in the shared bus mode. Therefore, the data processing device provided in this application embodiment can balance the operation efficiency of the operation unit, the data transmission efficiency, and the interconnection overhead when performing complex arithmetic operations on multiple input data.
[0115] The above description is merely an exemplary embodiment of this application and is not intended to limit the scope of protection of this application.
[0116] Generally, the various embodiments of this application can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. For example, some aspects can be implemented in hardware, while others can be implemented in firmware or software that can be executed by a controller, microprocessor, or other computing device, although this application is not limited thereto.
[0117] Embodiments of this application can be implemented by executing computer program instructions through the data processor of a mobile device, for example, in a processor entity, or through hardware, or through a combination of software and hardware. The computer program instructions can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages.
[0118] Any block diagram of logical flow in the accompanying drawings of this application may represent program steps, or may represent interconnected logic circuits, modules, and functions, or may represent a combination of program steps and logic circuits, modules, and functions. The computer program may be stored in memory. The memory may be of any type suitable to the local technical environment and may be implemented using any suitable data storage technology, such as, but not limited to, read-only memory (ROM), random access memory (RAM), optical storage devices and systems (Digital Multifunction Discs, DVDs, or CDs), etc. Computer-readable media may include non-transitory storage media. The data processor may be of any type suitable to the local technical environment, such as, but not limited to, general-purpose computers, special-purpose computers, microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable logic devices (FGPAs), and processors based on multi-core processor architectures.
[0119] A detailed description of exemplary embodiments of this application has been provided above through exemplary and non-limiting examples. However, various modifications and adjustments to the above embodiments will be apparent to those skilled in the art when considered in conjunction with the accompanying drawings and claims, without departing from the scope of this application. Therefore, the proper scope of this application will be determined by the claims.
Claims
1. A data processing apparatus, characterized in that, include: The module includes a configuration module, an input routing module, an interconnection routing module, and multiple multiply-accumulate unit modules. The configuration module is used to configure the input routing module, the interconnection routing module, and the plurality of multiply-accumulate unit modules according to the input mathematical model, and obtain the first configuration data, the second configuration data, and the third configuration data accordingly. The input routing module is used to establish input routes between the multiple input data channels of the data processing device and the input interfaces of the multiple multiply-accumulate unit modules according to the first configuration data. The interconnection routing module is used to establish an interconnection route between the output interface of the previous multiply-accumulate unit module and the input interface of the subsequent multiply-accumulate unit module according to the second configuration data and the numbering order of the multiple multiply-accumulate unit modules, so as to realize the unidirectional cascading between the multiple multiply-accumulate unit modules; The multiply-accumulate unit module is used to obtain the input data of the multiply-accumulate unit module through the input route and / or the interconnection route, and to perform arithmetic operations on the input data of the multiply-accumulate unit module according to the third configuration data; The input routing module includes multiple selectors, which are used to provide input routing between multiple input data channels of the data processing device and a device data input interface of the multiply-accumulate unit module. The input routing module is configured to establish input routes between the multiple input data channels of the data processing device and the input interfaces of the multiple multiply-accumulate unit modules based on the first configuration data, including: The input routing module is used to select an input data target channel from multiple input data channels of the data processing device according to the first configuration data, and to establish an input route between the input data target channel and a device data input interface of the multiply-accumulate unit module. The interconnection routing module is used to provide interconnection routing between the output interface of the (X-2)th multiply-accumulate unit module and one interconnection data input interface of the Xth multiply-accumulate unit module via a selector; and to provide interconnection routing between the output interface of the (X-1)th multiply-accumulate unit module and another interconnection data input interface of the Xth multiply-accumulate unit module via a direct connection. Where X is a natural number greater than 4 and less than or equal to the total number of multiply-accumulate unit modules, and ceil is the floor function.
2. The apparatus according to claim 1, characterized in that, The input interface of the multiply-accumulate unit module includes two device data input interfaces for receiving input data from the data processing device; The input interface of the multiply-accumulate unit module includes: two interconnected data input interfaces for receiving output data from the preceding multiply-accumulate unit module; The input interface of the multiply-accumulate unit module further includes: a constant input interface, used to receive the constant configured by the configuration module; The multiply-accumulate unit module is used to select one or two data points from the data received through the input interface and perform arithmetic operations based on the third configuration data.
3. The apparatus according to claim 2, characterized in that, The interconnection routing module is used to provide interconnection routing between the output interface of the preceding multiply-accumulate unit module and the interconnection data input interface of the following multiply-accumulate unit module through direct connection and / or selector; wherein, the number of digits in the serial number of the preceding multiply-accumulate unit module is less than the number of digits in the serial number of the following multiply-accumulate unit module.
4. The apparatus according to claim 3, characterized in that, For the first four multiply-accumulate unit modules in the numbering sequence, the interconnection routing module is used to provide an interconnection route between the output interface of the preceding multiply-accumulate unit module and the interconnection data input interface of the following multiply-accumulate unit module through a direct connection. For the multiply-accumulate unit modules other than the first four digits of the numbering, the interconnection routing module is used to provide interconnection routing between the output interface of the preceding multiply-accumulate unit module and the interconnection data input interface of the following multiply-accumulate unit module through direct connection and selector.
5. The apparatus according to claim 4, characterized in that, For the first four multiply-accumulate unit modules in the numbering sequence, the interconnection routing module is used to provide interconnection routing between the output interface of the preceding multiply-accumulate unit module and the interconnection data input interface of the following multiply-accumulate unit module via direct connection, including: The interconnection routing module is used to provide interconnection routes between the output interface of the first multiply-accumulate unit module and the interconnection data input interface of the second multiply-accumulate unit module via direct connection, between the output interfaces of the first and second multiply-accumulate unit modules and the interconnection data input interface of the third multiply-accumulate unit module, and between the output interfaces of the second and third multiply-accumulate unit modules and the interconnection data input interface of the fourth multiply-accumulate unit module.
6. The apparatus according to claim 1, characterized in that, The interconnection routing module is used to establish an interconnection route between the output interface of the preceding multiply-accumulate unit module and the input interface of the following multiply-accumulate unit module according to the second configuration data, including: The interconnection routing module is used to select a target multiply-accumulate unit module from the X-2 bit multiply-accumulate unit module to the ceil((X-1) / 2) bit multiply-accumulate unit module according to the second configuration data, and establish an interconnection route between the output interface of the target multiply-accumulate unit module and an interconnection data input interface of the X bit multiply-accumulate unit module.
7. The apparatus according to claim 1 or 2, characterized in that, The multiply-add unit module includes at least one of the following: a selector, a conjugate inversion unit, a multiplication unit, an addition unit, and a truncation unit, wherein the conjugate inversion unit is used to perform conjugate operations and / or inversion operations on data, or to perform pass-through operations on data.
8. A data processing method, characterized in that, Applied in the data processing apparatus as described in any one of claims 1-7, comprising: The configuration module configures the input routing module, interconnection routing module, and multiple multiply-accumulate unit modules according to the input mathematical model, thereby obtaining the first configuration data, the second configuration data, and the third configuration data. The input routing module establishes input routes between multiple input data channels and the input interfaces of the multiple multiply-accumulate unit modules based on the first configuration data. The interconnection routing module establishes an interconnection route between the output interface of the preceding multiply-accumulate unit module and the input interface of the following multiply-accumulate unit module according to the second configuration data and the numbering order of the multiple multiply-accumulate unit modules, so as to realize the unidirectional cascading between the multiple multiply-accumulate unit modules. The input routing module receives multiple input data from the data processing device. The input data of the multiply-accumulate unit module is obtained by the multiply-accumulate unit module based on the input route and / or the interconnection route, and arithmetic operations are performed on the input data of the multiply-accumulate unit module according to the third configuration data. The arithmetic operation result corresponding to the multiple input data is obtained by the multiply-accumulate unit module whose numbering order is the last one. The interconnection routing module provides interconnection routing between the output interface of the (X-2)th multiply-accumulate unit module and one interconnection data input interface of the Xth multiply-accumulate unit module via a selector; and provides interconnection routing between the output interface of the (X-1)th multiply-accumulate unit module and another interconnection data input interface of the Xth multiply-accumulate unit module via a direct connection. Where X is a natural number greater than 4 and less than or equal to the total number of multiply-accumulate unit modules, and ceil is the floor function.
Citation Information
Patent Citations
Data processing device and digital signal processor
CN103677735A
Processors, methods, and systems for a configurable spatial accelerator with performance, correctness, and power reduction features
US20190005161A1
Exploiting input data sparsity in neural network compute units
US9818059B1