Data processing device, method, computer equipment and storage medium

By connecting the processing engine PE array and multiple storage units in parallel in the AI ​​accelerator hardware architecture, efficient data transmission and processing is achieved, solving the problem of low data processing efficiency in the existing technology.

CN112967172BActive Publication Date: 2024-09-17CHENGDU SENSETIME TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110221038.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-26
Publication Date
2024-09-17
Estimated Expiration
2041-02-26

AI Technical Summary

Technical Problem

The existing AI accelerator hardware architecture has low data transmission efficiency when processing image data, resulting in low data processing efficiency.

Method used

By introducing multiple storage units into the data processing device and connecting the processing engine PE array with these storage units in parallel, different PEs are allowed to access different storage units in parallel, increasing data transmission channels, improving data transmission efficiency, and utilizing the data scheduler for efficient data transfer.

Benefits of technology

The efficiency of reading data from the storage unit and the efficiency of storing data to the storage unit are improved, thereby improving the overall data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112967172B
    Figure CN112967172B
Patent Text Reader

Abstract

The present disclosure provides a data processing device, method, computer equipment and storage medium, wherein the device includes: a first storage unit and a computing unit; the computing unit includes a processing engine PE array; a plurality of first storage units are respectively connected to PEs in the PE array; the PE is used to perform read / write access to the connected first storage unit; the plurality of first storage units are used to store data transmitted during the read / write access of the connected PE. The embodiment of the present disclosure can access different first storage units in parallel through different PEs connected to different first storage units in the PE array, thereby improving the efficiency of reading data from the first storage unit and the efficiency of storing data in the first storage unit, thereby improving the data processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing apparatus, method, computer equipment and storage medium. Background Art

[0002] Image processing algorithms are widely used in different fields such as image recognition and target detection. Artificial Intelligence (AI) accelerator hardware architecture is usually used to implement image processing algorithms. The commonly used AI accelerator hardware architecture mainly includes storage units, computing units, control units, etc. Among them, the core computing unit is generally composed of a two-dimensional PE array (Processing Engine) and a register array (local register file); the storage unit can be composed of different hierarchical caches, including double data rate synchronous dynamic random access memory (Double Data Rate, DDR), static random access memory (Static Random Access Memory, SRAM), registers, post-relational database cache and other storage spaces. The input data stream is cached and transferred in different storage spaces, and enters the register array corresponding to the PE array. After being read from the register array by the PE array, arithmetic operations (or logical operations) are performed, and finally the results are written back to the corresponding storage space.

[0003] The current method of storing control input data in a register array has the problem of low data processing efficiency. Summary of the invention

[0004] The embodiments of the present disclosure at least provide a data processing apparatus, method, computer equipment, and storage medium.

[0005] In a first aspect, an embodiment of the present disclosure provides a data processing device, comprising: a first storage unit and a computing unit; the computing unit comprises a processing engine PE array; a plurality of first storage units are respectively connected to PEs in the PE array; the PE is used to perform read / write access to the connected first storage unit; the plurality of first storage units are used to store data transmitted during the read / write access of the connected PE.

[0006] In this way, different PEs in the PE array connected to different first storage units can access different first storage units in parallel, which improves the efficiency of reading data from the first storage unit and the efficiency of storing data in the first storage unit, thereby improving data processing efficiency.

[0007] In an optional implementation, the plurality of first storage units are used to be respectively connected to different PE groups in the PE array.

[0008] In an optional implementation manner, each first storage unit is connected to a PE in a PE group; different PEs belong to different PE groups.

[0009] In an optional implementation, the one PE group includes multiple PEs having a physical connection relationship in the PE array, and the multiple PEs are located in the same row, or in the same half row, or in the same block in hardware layout.

[0010] In this way, by allocating the corresponding first storage unit to the PE in the PE array, the number of data transmission channels can be increased, so that when the PE performs read / write access to the first storage unit, more data can be transmitted to improve the efficiency of data transmission; at the same time, the flexibility of the data processing device can be increased to adapt to different data processing requirements.

[0011] In an optional embodiment, the PE is used to perform read access to the connected first storage unit in a first processing cycle to obtain first data corresponding to the PE; and / or perform write access to the connected first storage unit in a second processing cycle to store second data generated by the PE in the connected first storage unit.

[0012] In an optional embodiment, different PEs connected to the same first storage unit perform read / write access to the same first storage unit in different processing cycles; and / or, in the PE groups connected to different first storage units, there is respectively one PE that performs read / write access to the connected first storage unit in the same processing cycle.

[0013] In an optional implementation, in each PE group connected to different first storage units, PEs with the same relative position perform read / write access to the connected first storage units in the same processing cycle.

[0014] In this way, multiple PEs can synchronously read / write access to different first storage units, thereby improving data transmission efficiency.

[0015] In an optional implementation, it also includes: a control unit; the control unit is used to generate a first control signal based on a data processing instruction and transmit the first control signal to the PE; the PE is used to read the first data to be processed by the PE from a first storage unit connected to the PE in response to receiving the first control signal transmitted by the control unit.

[0016] In an optional embodiment, the control unit is further used to generate a second control signal based on the data processing instruction and transmit the second control signal to the PE; the PE is used to write the data generated by the PE into a first storage unit connected to the PE in response to receiving the second control signal transmitted by the control unit.

[0017] In an optional implementation, it also includes: a data scheduler; the control unit is also used to generate a third control signal based on the data processing instruction and transmit the third control signal to the data scheduler; the data scheduler is used to perform write access to the first storage unit based on the third control signal.

[0018] In this way, by using the data scheduler as a medium for data transmission, it is possible to control the efficient and orderly transmission of data with a large amount of data, thereby avoiding errors during transmission.

[0019] In an optional implementation, a second storage unit is further included; the data scheduler is used to read the data to be processed corresponding to each first storage unit from the second storage unit, and based on the first data storage address carried in the third control signal, store the data to be processed corresponding to each first storage unit in the corresponding first storage unit; wherein the data to be processed corresponding to each first storage unit includes: data that needs to be read by the PE connected to each first storage unit.

[0020] In an optional implementation, the control unit is further used to generate a fourth control signal based on the data processing instruction and transmit the fourth control signal to the data scheduler; the data scheduler is further used to perform read access to the first storage unit based on the fourth control signal.

[0021] In an optional embodiment, the data scheduler is used to read result data from the multiple first storage units based on the fourth control signal, and store the result data in the second storage unit; wherein the result data includes: data generated by the PE connected to the first storage unit and stored in the first storage unit.

[0022] In a second aspect, an embodiment of the present disclosure also provides a data processing method, which is applied to a data processing device, wherein the data processing device includes: a first storage unit and a computing unit; the computing unit includes a processing engine PE array; a plurality of first storage units are respectively connected to PEs in the PE array; the data processing method includes: the PE performs read / write access to the connected first storage unit; the plurality of first storage units store data transmitted during the read / write access of the connected PE.

[0023] In an optional implementation, the plurality of first storage units are respectively connected to different PE groups in the PE array.

[0024] In an optional implementation manner, each first storage unit is connected to a PE in a PE group; different PEs belong to different PE groups.

[0025] In an optional implementation, the one PE group includes multiple PEs having a physical connection relationship in the PE array, and the multiple PEs are located in the same row, or in the same half row, or in the same block in hardware layout.

[0026] In an optional embodiment, the PE performs read / write access to the connected first storage unit, including: the PE performs read access to the connected first storage unit in a first processing cycle to obtain the first data corresponding to the PE; and / or performs write access to the connected first storage unit in a second processing cycle to store the second data generated by the PE in the connected first storage unit.

[0027] In an optional embodiment, the PE performs read / write access to the connected first storage unit, including: different PEs connected to the same first storage unit perform read / write access to the same first storage unit in different processing cycles; and / or, in the PE groups connected to different first storage units, there is respectively a PE that performs read / write access to the connected first storage unit in the same processing cycle.

[0028] In an optional embodiment, in the PE groups connected to the different first storage units, there is a PE in each of the same processing cycles that performs read / write access to the connected first storage units, including: in each of the PE groups connected to the different first storage units, PEs with the same relative position perform read / write access to the connected first storage units in the same processing cycle.

[0029] In an optional embodiment, the data processing device also includes a control unit; the data processing method also includes: the control unit generates a first control signal based on the data processing instruction, and transmits the first control signal to the PE; the PE responds to receiving the first control signal transmitted by the control unit, and reads the first data to be processed by the PE from a first storage unit connected to the PE.

[0030] In an optional implementation, it also includes: the control unit generates a second control signal based on the data processing instruction, and transmits the second control signal to the PE; the PE writes the second data generated by the PE into a first storage unit connected to the PE in response to receiving the second control signal transmitted by the control unit.

[0031] In an optional implementation, the data processing device also includes a data scheduler; the data processing method also includes: the control unit generates a third control signal based on the data processing instruction, and transmits the third control signal to the data scheduler; the data scheduler performs write access to the first storage unit based on the third control signal.

[0032] In an optional embodiment, the data processing device also includes a second storage unit; the data scheduler reads the data to be processed corresponding to each first storage unit from the second storage unit, and based on the first data storage address carried in the third control signal, stores the data to be processed corresponding to each first storage unit in the corresponding first storage unit; wherein the data to be processed corresponding to each first storage unit includes: data that needs to be read by the PE connected to each first storage unit.

[0033] In an optional implementation, it also includes: the control unit generates a fourth control signal based on the data processing instruction, and transmits the fourth control signal to the data scheduler; the data scheduler performs read access to the first storage unit based on the fourth control signal.

[0034] In an optional implementation, the data scheduler performs read access to the first storage unit based on the fourth control signal, including: the data scheduler reads result data from the multiple first storage units based on the fourth control signal, and stores the result data in a second storage unit; wherein the result data includes: data generated by the PE connected to the first storage unit and stored in the first storage unit.

[0035] In a third aspect, an optional implementation of the present disclosure further provides a computer device, comprising: an instruction memory and the data processing apparatus provided in the first aspect of the present disclosure.

[0036] In a fourth aspect, an optional implementation of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the steps of the above-mentioned second aspect, or any possible implementation of the second aspect are executed.

[0037] For a description of the effects of the above-mentioned data processing method, computer device, and computer-readable storage medium, please refer to the description of the above-mentioned data processing device, which will not be repeated here.

[0038] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0040] Figure 1 A schematic diagram of a data processing device provided by an embodiment of the present disclosure is shown;

[0041] Figure 2 A schematic diagram of a PE array provided by an embodiment of the present disclosure is shown;

[0042] Figure 3 A schematic diagram showing the internal structure of a PE provided by an embodiment of the present disclosure is shown;

[0043] Figure 4a A schematic diagram showing a connection method between a first storage unit and a PE array provided by an embodiment of the present disclosure;

[0044] Figure 4b A schematic diagram showing another connection method between a first storage unit and a PE array provided by an embodiment of the present disclosure;

[0045] Figure 5 A schematic diagram of a data processing device provided by an embodiment of the present disclosure when performing data processing is shown.

[0046] Figure 6 A flow chart of a data processing method provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure claimed for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0048] Research has found that when using the AI ​​accelerator hardware structure to process the image data to be processed, it is usually necessary to transfer the image data to be processed from the external memory to the registers included in the PE in the PE array, so that the computing units in each PE in the PE array can read the corresponding image data to be processed from the registers and process it. The register array composed of registers included in different PEs shares the same bus, and the bandwidth of the bus is limited. In order to avoid data conflicts when data is transmitted in the bus, the data required by each register will enter the corresponding register from the external memory one by one. This results in a lot of time being consumed in the process of transferring the image to be processed to the register array, resulting in low data processing efficiency.

[0049] In addition, after the PE array processes the image data to be processed, it will generate result data; the generated result data needs to be stored in the external memory; at this time, the bus is also needed to transfer the result data generated by different PEs in the PE array to the external memory one by one. This results in a long time being spent in the process of storing the result data in the external memory, resulting in a reduced efficiency in data transmission, and also resulting in a low efficiency in data processing.

[0050] Based on the above research, the present disclosure provides a data processing device, in which a plurality of first storage units are included, and different first storage units are respectively connected to different PEs in a PE array, and each PE in the PE array can perform read / write access to the first storage unit connected thereto, and thus, different PEs in the PE array connected to different first storage units can access different first storage units in parallel, thereby improving the efficiency of reading data from the first storage unit and improving the efficiency of storing data in the first storage unit, thereby improving the data processing efficiency.

[0051] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.

[0052] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0053] To facilitate understanding of this embodiment, a data processing device provided by an embodiment of the present disclosure is first introduced in detail.

[0054] See also Figure 1, which is a schematic diagram of a data processing device provided by an embodiment of the present disclosure, the device includes: a first storage unit (a plurality of first storage units are shown in the figure, including first storage unit 0 to first storage unit 3) and a computing unit; the computing unit includes a processing engine PE array; the plurality of first storage units are respectively connected to PEs in the PE array (a plurality of PEs are shown in the figure, including PE0 to PE15); wherein,

[0055] PE, for performing read / write access to the connected first storage unit;

[0056] The plurality of first storage units are used to store data transmitted during the read / write access process of the connected PE.

[0057] Exemplarily, the computing unit includes at least one PE array; wherein the physical connection relationship between any PE in the PE array and other PEs is as follows: Figure 2 As shown, multiple PEs together form a 2D (dimension) torus network, and the PEs can be connected to different PEs that are physically connected to them, including those located at the top, bottom, left, and right positions.

[0058] The PE array includes PE22 that specifically completes related computing tasks and PE21 located at the edge of the PE array. Figure 2 PE21 located at the edge of the PE array is marked as halo. Among them, PE22 can complete operations such as multiply-accumulate (MAC) on data; PE21 forms a peripheral ring array outside the PE array. When PE22 in the PE array processes data, data may be shifted between different PEs. PE21 in the peripheral ring array can ensure that data will not be lost when it moves between different PEs inside the PE array.

[0059] Also, see Figure 3 , which is a schematic diagram of the internal structure of a PE provided by an embodiment of the present disclosure. In this example, it includes a PE22 that specifically completes related computing tasks, and a PE21 connected to it and located at the edge of the PE array. In PE22, it includes a memory access module 33, represented by M1; an arithmetic and logic unit 34 (Arithmetic and Logic Unit, ALU), represented by ALU1; an internal register 35, represented by R0_1; and a shift register stack 36, where:

[0060] The memory access module M1 is used for performing read / write access to the first memory unit connected to PE22. When performing read access to the first memory unit, the memory access module M1 can transfer the data obtained from the first memory unit to the internal register R0_1 or ALU1 to wait for the obtained data to be processed by ALU1 in PE22; or, transfer it to the shift register stack corresponding to PE22 so that the obtained data is transferred to PE21 connected to PE22; or, when performing write access to the first memory unit, the result operation data calculated by ALU1 can be written into the corresponding first memory unit.

[0061] The arithmetic logic unit ALU1 is used to process the received data. Since there may be multiple intermediate calculation steps when processing the data, the intermediate operation data obtained can also be transferred to the internal register in the PE, and the intermediate operation data in the internal register can be called in the next calculation for further processing. After the result operation data is obtained, it can be transferred to the memory access module M1 according to the actual data processing instruction to wait for output; or, the result operation data can also be transferred to the shift register stack corresponding to PE22, waiting to be transmitted to PE21 connected to PE22.

[0062] Here, for PE21, since PE21 does not bear the function of data calculation, it may not include ALU inside to reduce equipment requirements and thus reduce equipment costs; or ALU exists but ALU does not actually perform related data calculations to reduce the complexity of equipment integration. Figure 3 In FIG. 1 , a dotted line indicates a possible connection relationship similar to ALU1 in PE21 when ALU2 exists in PE21.

[0063] The internal register R0_1 is used to receive and store the data read by M1 from the first memory unit connected to PE22; or connected to ALU1 to store the generated intermediate operation data, and transmit the intermediate operation data to ALU1 so that ALU1 obtains the result operation data and stores the result operation data; or transmits the result operation data to M1.

[0064] Here, for PE21, since PE21 can only complete the function of transmitting data between multiple PEs, or only receive data transmitted in the first storage unit, it may not contain internal registers to reduce device requirements and thus reduce device costs; or there may be internal registers but no storage-related tasks are completed to reduce the complexity of device integration. Figure 3 In FIG. 1 , a dotted line indicates a possible connection relationship similar to the internal register R0_1 in PE21 when the internal register R0_2 exists in PE21.

[0065] The shift register stack is used to transfer the data acquired by the PE to other PEs connected to the PE. Figure 3 In the embodiment, the shift register stack 36 corresponding to PE22 can be connected in circuit with the shift register stacks corresponding to PEs that are connected in the four directions of up, down, left and right. There are four shift registers corresponding to the shift register stack, including R1, R2, R3, and R4. Similarly, in PE21, there is also a shift register stack 37, including R1', R2', R3', and R4'. When data is transferred from PE22 to PE21, it can be realized by the shift register in the shift register stack 36 that is connected to the shift register stack 37. For example, when the shift register R4 in PE22 is connected to the shift register R4' in PE21, PE22 can receive the data through R4' corresponding to PE21 after transferring the data to R4, so that PE21 receives the data.

[0066] Here, the structures of other PEs are similar to the internal structure of the above-mentioned PEs, which are only given as examples and will not be described in detail.

[0067] Different PEs in the PE array can be connected to different first storage units, or connected to the same first storage unit. The PEs and first storage units that have a connection relationship can perform data transmission, and the PEs can read the data in the first storage unit and transmit the processed data to the first storage unit.

[0068] Each first storage unit may be connected to a corresponding plurality of PEs, so the first storage unit may include a plurality of storage units corresponding to the number of PEs, for correspondingly storing the data when each PE in the connected plurality of PEs is read / written.

[0069] Specifically, when determining the connection relationship between the multiple first storage units and the multiple PEs in the PE array, for example, the multiple PEs may be grouped first, and a corresponding first storage unit may be determined for each group of PEs after grouping. When the multiple PEs are grouped, the multiple PEs with a physical connection relationship may be grouped as a PE group, and the multiple PEs are located in the same row, the same half row, or the same block in the hardware layout.

[0070] For example, in a possible implementation, a row of PEs can be regarded as a PE group, see Figure 4a As shown, it shows a schematic diagram of a connection method between a first storage unit and a PE array. Figure 4aIn the example, the first row of PE is regarded as a PE group, denoted as G0, the second row is regarded as a PE group, denoted as G1, and so on, until the nth row is divided into a PE group, denoted as Gn. The corresponding first storage unit 0 is allocated to the PE group G0, the corresponding first storage unit 1 is allocated to the PE group G1, and so on, until the corresponding first storage unit n is allocated to the PE group Gn.

[0071] In another possible implementation, see Figure 4b As shown, it is a schematic diagram showing another connection method between the first storage unit and the PE array. Figure 4b In the figure, two rows of PE are regarded as a PE group, the first and second rows of PE can be regarded as a PE group, denoted as G0, and the third and fourth rows of PE can be regarded as a PE group, denoted as G1, and so on. Multiple rows of PE in the PE array can be divided into n different PE groups, that is, the PE array is divided into n PE groups, and then the corresponding n first storage units are allocated to these n different PE groups, for example, they can include the first storage unit 0 to the first storage unit n.

[0072] In particular, each PE in the PE array can be regarded as a PE group, and a corresponding first storage unit is allocated to each PE, that is, each PE in the PE array corresponds to a storage unit. This method further divides the first storage unit, and can maximize the throughput of data interaction, thereby reducing the time consumed when data is transmitted.

[0073] Here, the number of PEs included in each of the multiple PE groups may be the same or different. For example, in order to reduce the influence of the complexity of the routing in the circuit, PEs with a closer physical connection relationship are grouped as a PE group, or in more targeted equipment, multiple PEs with stronger computing and processing functions are grouped as a PE group. That is, the specific method of determining the PE group can be determined according to actual conditions and is not limited here.

[0074] When the PE performs read / write access to the first storage unit, for the case where the PE performs read access to the first storage unit: for example, in the first processing cycle, the PE may perform read access to the connected first storage unit to obtain first data corresponding to the PE;

[0075] In the case of performing write access to the first storage unit, for example, in the second processing cycle, write access may be performed to the connected first storage unit to store the second data generated by the PE in the connected first storage unit.

[0076] The processing cycle can be determined according to the actual data processing process. For example, in the processing step of multiplying and adding data, since the calculation is relatively simple, it can include two or three clock cycles; in the processing step of weighted filtering of data, since the calculation is relatively complex, it can include four or five clock cycles. That is, the number of clock cycles included in the processing cycle is related to the actual processing process, and the number of clock cycles included in different processing cycles can be the same or different.

[0077] In addition, since there are multiple PE groups, and when data is transmitted for PEs in the PE group, the data transmission between each group of PEs and its corresponding first storage unit is implemented in a Single Instruction Multiple Data (SIMD) manner, different PEs connected to the same first storage unit can perform read / write access to the same first storage unit in different data processing cycles; and / or, for PE groups connected to different first storage units, there is each PE that performs read / write access to the connected first storage unit in the same processing cycle.

[0078] For example, Figure 1 The multiple first storage units and multiple PEs are shown, so in one processing cycle, the PE at the same position in each group of PEs can read the first storage unit corresponding to it, so as to Figure 1 Taking the corresponding embodiment as an example, there are 4 first storage units, namely: first storage unit 0, first storage unit 1, first storage unit 2, and first storage unit 3, the PEs connected to the first storage unit 0 include: PE0, PE1, PE2, PE3, the PEs connected to the first storage unit 1 include PE4, PE5, PE6, PE7, the PEs connected to the first storage unit 2 include PE8, PE9, PE10, PE11, and the PEs connected to the first storage unit 3 include PE12, PE13, PE14, PE15; in this example, the first processing cycle may include 4 clock cycles; in the first clock cycle, PE0 reads the first storage unit 0, PE4 reads the first storage unit 1, PE8 reads the first storage unit 2, and PE12 reads the first storage unit 3.

[0079] Then, PE0, PE4, PE8, and PE12 can store the read data in the corresponding internal memory so that the PE containing the arithmetic logic unit can perform operations on the read data, or the PE without the arithmetic logic unit can store it and wait for the movement of the next processing cycle or other data transmission.

[0080] In the second clock cycle, PE1 reads the first storage unit 0, and at the same time, PE5 reads the first storage unit 1, PE9 reads the first storage unit 2, and PE13 reads the first storage unit 3; in the third clock cycle, PE2 reads the first storage unit 0, and at the same time, PE6 reads the first storage unit 1, PE10 reads the first storage unit 2, and PE14 reads the first storage unit 3; in the fourth clock cycle, PE3 reads the first storage unit 0, and at the same time, PE7 reads the first storage unit 1, PE11 reads the first storage unit 2, and PE15 reads the first storage unit 3. In this way, the PE completes the read access to the first storage unit in the first processing cycle, and transmits the first data stored in the first storage unit and waiting for PE to be processed to the internal registers corresponding to each PE, waiting for further data access.

[0081] In another possible implementation, when the number of PEs in the PE array is large and the size of the image to be processed is small, it may be necessary to use only some of the PEs in the PE array to process the image to be processed. Therefore, it may be possible that some PEs do not access the corresponding first storage unit in the first processing cycle and continue to wait for data processing instructions in the next processing cycle.

[0082] Specifically, when PE performs a read access to the first storage unit, the control unit in the data processing device generates a first control signal based on the data processing instruction and transmits the first control signal to PE. In response to receiving the first control signal transmitted by the control unit, PE reads the first data to be processed by PE from the first storage unit connected to PE.

[0083] The data processing instructions may include related instructions for controlling the PE to operate on the data in the first storage unit, such as data transfer instructions (MOV), addition instructions (ADD), subtraction instructions (SUB), logical AND instructions (AND), and other different instructions.

[0084] Taking the use of a data processing device to process any image to be processed as an example, after the first storage unit processes and stores the image, the control unit can generate a first control signal based on the data transfer instruction. The first control signal includes the data address accessed by the PE receiving the first control signal when performing a read access to the first storage unit, and is used to control the PE receiving the first control signal to read data from the corresponding first storage unit, and store the read data in the corresponding internal register.

[0085] For example, in Figure 1In the first storage unit 0 shown, since four PEs, PE0 to PE3, are connected, four corresponding data storage spaces (Space), represented by s0, s1, s2, and s3, can be included. The first control signal transmitted by the control unit to PE0 can, for example, include the address of s0. After PE0 receives the first control signal, it can read the corresponding data from the data storage space s0 in the connected first storage unit 0 according to the address of s0 carried therein.

[0086] The way in which other PEs read data from the corresponding first storage units is similar to the way in which PE0 reads data from the first storage unit 0, and will not be described in detail here.

[0087] In addition, when processing the image to be processed and storing it in the first storage unit, for example, the following method can be adopted: the control unit generates a third control signal based on the data processing instruction, and transmits the third control signal to the data scheduler in the data processing device; the data scheduler performs write access to the first storage unit based on the third control signal.

[0088] The third control signal may carry, for example, a first data storage address, and the first data storage address is used to determine a storage location of the to-be-processed data stored in the first storage unit.

[0089] In a specific implementation, the data processing device further includes a second storage unit, which may include an external memory for storing data such as the original image to be processed and the feature map. The embodiment of the present disclosure takes the processing of the original image as an example to illustrate the detailed process of the data processing performed by the data processing device. Figure 1 Take the PE array shown in as an example, when each PE therein can process sub-image data composed of 4×4 pixels, when the image size (in pixels) is 16×16, each PE can process the corresponding 4×4 pixels on average. At this time, the data contained in the obtained 16 sub-images can be stored in the second storage unit, waiting for the data scheduler to read the data from the second storage unit; and, since the data stored in the second storage unit is the data that the PE can directly process, when the data in the second storage unit is stored in the first storage unit, only the data transmission can be completed without the need to perform data segmentation and other processing, thereby reducing the processing tasks of the data processing device during data transmission and improving the efficiency of data transmission; in addition, since the data stored in the second storage unit can be directly used as the to-be-processed data corresponding to the first storage unit, it is also beneficial for the first storage unit and the PE connected to the first storage unit to read the to-be-processed data.

[0090] Specifically, the data scheduler reads the data to be processed corresponding to each first storage unit from the second storage unit, and based on the first data storage address carried in the third control signal, stores the data to be processed corresponding to each first storage unit in the corresponding first storage unit; wherein the data to be processed corresponding to each first storage unit includes: the data that needs to be read by the PE connected to each first storage unit.

[0091] After the data that the connected PE needs to read is stored in the first storage unit, the PE can wait to receive the control signal transmitted by the control unit, and after receiving the first control signal sent by the control unit, read the corresponding data from the corresponding first storage unit for processing. At this time, for more complex image processing algorithms, such as convolution processing of images, including multiple steps such as weighted summation, there may be multiple intermediate data during processing. These intermediate data can be temporarily stored in the internal memory corresponding to the PE, and then the data temporarily stored in the internal memory can be directly called for processing during the next processing until all data processing tasks for the original image are completed.

[0092] Alternatively, the intermediate data may be transferred to the first storage unit, but since the intermediate data is not the final output result data and needs to be further processed, the intermediate data in the first storage unit may not be output to the second storage unit.

[0093] Specifically, the control unit may generate a second control signal based on the data processing instruction, and transmit the second control signal to the PE; in response to receiving the second control signal transmitted by the control unit, the PE writes the data generated by the PE into the first storage unit connected to the PE.

[0094] Among them, the second control signal is similar to the above-mentioned first control signal, and includes the data address accessed by the PE receiving the second control signal when performing write access to the first storage unit, and is used to control the PE receiving the second control signal to write data to the corresponding first storage unit, so that the first storage unit receives the data written by the corresponding PE and waits for output to the second storage unit, thereby obtaining the processing result of the original image.

[0095] After PE completes all processing steps on the data in the original image, the result data for output can be obtained. At this time, the control unit can also generate a fourth control signal and transmit the fourth control signal to the data scheduler; the data scheduler reads the result data from multiple first storage units based on the fourth control signal, and stores the result data in the second storage unit; wherein the result data includes the data generated by the PE connected to the first storage unit and stored in the first storage unit.

[0096] Specifically, the fourth control signal may carry a second data storage address, and the second data storage address is used to indicate the location where the data scheduler stores the result data in the second storage unit. In addition, the fourth control signal may not carry the storage address of the second data.

[0097] Exemplarily, the data scheduler can read the result data generated by PE0, PE1, PE2, and PE3 respectively from the first storage unit 0, that is, the result data stored in the four data storage spaces s0, s1, s2, and s3 in the first storage unit 0, and then store the result data in the second storage unit to obtain the processing result of the original image.

[0098] In a possible implementation, the control unit may further control the plurality of result data output from the second storage unit to be spliced ​​in sequence, so as to restore the plurality of result data obtained from the original image divided into a plurality of sub-images to the result data corresponding to the original image.

[0099] The disclosed embodiment also provides a specific example of performing convolution processing on the original image A using a data processing device.

[0100] See also Figure 5 As shown, it is a schematic diagram of the data processing device when performing data processing; wherein, there are 4 memory units, respectively denoted as PE_RAM0 to PE_RAM3, and the PE array includes 16 PEs, respectively denoted as PE0 to PE15.

[0101] Among them, PE0 to PE3 are regarded as a PE group, PE4 to PE7 are regarded as a PE group, PE8 to PE11 are regarded as a PE group, and PE12 to PE15 are regarded as a PE group, which are represented as G0, G1, G2, and G3 respectively.

[0102] After determining the PE subarray, it can be determined that PE_RAM0 in the first storage unit is used as the first storage unit corresponding to G0; PE_RAM1 in the first storage unit is used as the first storage unit corresponding to G1; PE_RAM2 in the first storage unit is used as the first storage unit corresponding to G2; and PE_RAM3 in the first storage unit is used as the first storage unit corresponding to G3.

[0103] When the data processing device is used to complete the operation of the convolution layer, the control unit generates a third control signal C3 based on the data processing instruction, and sends the third control signal to the data scheduler, and the data scheduler reads the second storage unit, in which the data corresponding to the original image A is stored, and then the data scheduler stores the data used for the convolution calculation in the second storage unit in the first storage unit.

[0104] Afterwards, the control unit sends a first control signal C1 to the PE, and each working PE in the PE array reads the first data to be processed from the corresponding first storage unit, and then performs corresponding calculations.

[0105] Among them, C1 controls the following operations: in the first clock cycle, PE0, PE4, PE8, and PE12 corresponding to PE_RAM0~PE_RAM3 respectively read the first data to be processed respectively; in the second clock cycle, PE1, PE5, PE9, and PE13 read the first data to be processed respectively; in the third clock cycle, PE2, PE6, PE10, and PE14 read the first data to be processed respectively; in the fourth clock cycle, PE3, PE7, PE11, and PE15 read the first data to be processed respectively.

[0106] Then, PE0 to PE15 respectively perform data processing on the corresponding first data to be processed, for example, perform convolution operation processing on the first data to obtain second data.

[0107] Here, the second data is the result data.

[0108] After the PE in the PE array processes the first data to obtain the second data, the control unit sends a second control signal C2 to the PE to write the second data in the PE into the first storage unit corresponding to the PE. At this time, the control unit sends a fourth control signal C4 to the data scheduler to enable the data scheduler to read the result data from the first storage unit and store it in the second storage unit.

[0109] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0110] Based on the same inventive concept, a data processing method corresponding to the data processing device is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the method in the embodiment of the present disclosure is similar to the above-mentioned data processing device in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0111] Reference Figure 6 FIG. 1 is a schematic diagram of a data processing method provided by an embodiment of the present disclosure, wherein the data processing method is applied to a data processing device; the data processing method includes:

[0112] S601: PE performs read / write access to the connected first storage unit;

[0113] S602: A plurality of first storage units store data transmitted during a read / write access process of the connected PEs.

[0114] In an optional implementation, the plurality of first storage units are respectively connected to different PE groups in the PE array.

[0115] In an optional implementation manner, each first storage unit is connected to a PE in a PE group; different PEs belong to different PE groups.

[0116] In an optional implementation, the one PE group includes multiple PEs having a physical connection relationship in the PE array, and the multiple PEs are located in the same row, or in the same half row, or in the same block in hardware layout.

[0117] In an optional embodiment, the PE performs read / write access to the connected first storage unit, including: the PE performs read access to the connected first storage unit in a first processing cycle to obtain the first data corresponding to the PE; and / or performs write access to the connected first storage unit in a second processing cycle to store the second data generated by the PE in the connected first storage unit.

[0118] In an optional embodiment, the PE performs read / write access to the connected first storage unit, including: different PEs connected to the same first storage unit perform read / write access to the same first storage unit in different processing cycles; and / or, in the PE groups connected to different first storage units, there is respectively a PE that performs read / write access to the connected first storage unit in the same processing cycle.

[0119] In an optional embodiment, in the PE groups connected to the different first storage units, there is a PE in each of the same processing cycles that performs read / write access to the connected first storage units, including: in each of the PE groups connected to the different first storage units, PEs with the same relative position perform read / write access to the connected first storage units in the same processing cycle.

[0120] In an optional embodiment, the data processing device also includes a control unit; the data processing method also includes: the control unit generates a first control signal based on the data processing instruction, and transmits the first control signal to the PE; the PE responds to receiving the first control signal transmitted by the control unit, and reads the first data to be processed by the PE from a first storage unit connected to the PE.

[0121] In an optional implementation, it also includes: the control unit generates a second control signal based on the data processing instruction, and transmits the second control signal to the PE; the PE writes the second data generated by the PE into a first storage unit connected to the PE in response to receiving the second control signal transmitted by the control unit.

[0122] In an optional implementation, the data processing device also includes a data scheduler; the data processing method also includes: the control unit generates a third control signal based on the data processing instruction, and transmits the third control signal to the data scheduler; the data scheduler performs write access to the first storage unit based on the third control signal.

[0123] In an optional embodiment, the data processing device also includes a second storage unit; the data scheduler reads the data to be processed corresponding to each first storage unit from the second storage unit, and based on the first data storage address carried in the third control signal, stores the data to be processed corresponding to each first storage unit in the corresponding first storage unit; wherein the data to be processed corresponding to each first storage unit includes: data that needs to be read by the PE connected to each first storage unit.

[0124] In an optional implementation, it also includes: the control unit generates a fourth control signal based on the data processing instruction, and transmits the fourth control signal to the data scheduler; the data scheduler performs read access to the first storage unit based on the fourth control signal.

[0125] In an optional implementation, the data scheduler performs read access to the first storage unit based on the fourth control signal, including: the data scheduler reads result data from the multiple first storage units based on the fourth control signal, and stores the result data in a second storage unit; wherein the result data includes: data generated by the PE connected to the first storage unit and stored in the first storage unit.

[0126] The embodiment of the present disclosure further provides a computer device, comprising: an instruction memory and a data processing device provided by the embodiment of the present disclosure.

[0127] The data processing device provided in the embodiment of the present disclosure may include a chip, an AI chip, etc. The computer device provided in the embodiment of the present disclosure may include an intelligent terminal such as a mobile phone, or may also be other devices, servers, etc. that can be used for data processing, which is not limited here.

[0128] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data processing method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0129] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the data processing method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0130] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0131] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0132] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0133] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0134] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0135] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A data processing device, characterized in that: include: a first storage unit and a computing unit; The computing unit includes a processing engine PE array; The plurality of PEs in the PE array form a torus network, and any PE has different PEs physically connected in a plurality of different orientations; A plurality of first storage units are respectively connected to the PEs in the PE array; The PE is used to perform read / write access to the connected first storage unit; The PEs in the array include: PEs located inside the PE array for completing computing tasks, and PEs located at the edge of the PE array for ensuring that data is not lost when moving between different PEs inside the PE array; The multiple first storage units are used to store data transmitted during the read / write access process of the connected PE.

2. The data processing device according to claim 1, characterized in that: The multiple first storage units are used to be connected to different PE groups in the PE array respectively.

3. The data processing device according to claim 1 or 2, characterized in that: Each first storage unit is connected to a PE in a PE group; different PEs belong to different PE groups respectively.

4. The data processing device according to claim 3, characterized in that: The one PE group includes a plurality of PEs having a physical connection relationship in the PE array, and the plurality of PEs are located in the same row, or in the same half row, or in the same block in hardware layout.

5. The data processing device according to any one of claims 1 to 4, characterized in that: The PE is used to read the first storage unit connected thereto in a first processing cycle to obtain first data corresponding to the PE; and / or In a second processing cycle, write access is performed on the connected first storage unit to store the second data generated by the PE in the connected first storage unit.

6. The data processing device according to any one of claims 1 to 5, characterized in that: Different PEs connected to the same first storage unit perform read / write access to the same first storage unit in different processing cycles; and / or, In the PE groups connected to different first storage units, there is respectively one PE that performs read / write access to the connected first storage unit in the same processing cycle.

7. The data processing device according to claim 6, characterized in that: In each PE group connected to different first storage units, PEs with the same relative position perform read / write access to the connected first storage units in the same processing cycle.

8. The data processing device according to any one of claims 1 to 7, characterized in that: Also includes: Control unit; The control unit is configured to generate a first control signal based on the data processing instruction and transmit the first control signal to the PE; The PE is used to read first data to be processed by the PE from a first storage unit connected to the PE in response to receiving a first control signal transmitted by the control unit.

9. The data processing device according to claim 8, characterized in that: The control unit is further configured to generate a second control signal based on the data processing instruction, and transmit the second control signal to the PE; The PE is used to write the data generated by the PE into a first storage unit connected to the PE in response to receiving the second control signal transmitted by the control unit.

10. The data processing device according to claim 8 or 9, characterized in that: Also includes: Data Scheduler; The control unit is further configured to generate a third control signal based on the data processing instruction, and transmit the third control signal to the data scheduler; The data scheduler is used to perform write access to the first storage unit based on the third control signal.

11. The data processing device according to claim 10, characterized in that: Also included is a second storage unit; The data scheduler is configured to read the to-be-processed data corresponding to each first storage unit from the second storage unit, and store the to-be-processed data corresponding to each first storage unit into the corresponding first storage unit based on the first data storage address carried in the third control signal; The data to be processed corresponding to each of the first storage units include: data that needs to be read by the PE connected to each of the first storage units.

12. The data processing device according to claim 10 or 11, characterized in that: The control unit is further configured to generate a fourth control signal based on the data processing instruction, and transmit the fourth control signal to the data scheduler; The data scheduler is further used to perform a read access to the first storage unit based on the fourth control signal.

13. The data processing device according to claim 12, characterized in that: The data scheduler is configured to read result data from the plurality of first storage units and store the result data in a second storage unit based on the fourth control signal; The result data includes: data generated by the PE connected to the first storage unit and stored in the first storage unit.

14. A data processing method, characterized in that: The invention is applied to a data processing device, the data processing device comprising: a first storage unit and a computing unit; the computing unit comprises a processing engine PE array; a plurality of PEs in the PE array form a ring network, and any PE has different PEs physically connected in a plurality of different orientations; a plurality of first storage units are respectively connected to the PEs in the PE array; the data processing method comprises: The PE performs read / write access to the connected first storage unit; the PE in the array includes: a PE located inside the PE array for completing a computing task, and a PE located at an edge of the PE array for ensuring that data is not lost when moving between different PEs inside the PE array; The plurality of first storage units store data transmitted during a read / write access process of the connected PE.

15. The data processing method according to claim 14, characterized in that: The PE performs read / write access to the connected first storage unit, including: The PE performs a read access to the first storage unit connected thereto in a first processing cycle to obtain first data corresponding to the PE; and / or In a second processing cycle, write access is performed on the connected first storage unit to store the second data generated by the PE in the connected first storage unit.

16. The data processing method according to claim 14 or 15, characterized in that: The PE performs read / write access to the connected first storage unit, including: Different PEs connected to the same first storage unit perform read / write access to the same first storage unit in different processing cycles; and / or, In the PE groups connected to different first storage units, there is respectively one PE that performs read / write access to the connected first storage unit in the same processing cycle.

17. The data processing method according to claim 16, characterized in that: The PE groups connected to the different first storage units each have a PE in the same processing cycle that performs read / write access to the connected first storage unit, including: in each PE group connected to the different first storage units, PEs with the same relative position perform read / write access to the connected first storage unit in the same processing cycle.

18. The data processing method according to any one of claims 14 to 17, characterized in that: The data processing device further includes a control unit; and the data processing method further includes: The control unit generates a first control signal based on the data processing instruction, and transmits the first control signal to the PE; In response to receiving the first control signal transmitted by the control unit, the PE reads the first data to be processed by the PE from the first storage unit connected to the PE.

19. The data processing method according to claim 18, characterized in that: Also includes: The control unit generates a second control signal based on the data processing instruction, and transmits the second control signal to the PE; In response to receiving the second control signal transmitted by the control unit, the PE writes the second data generated by the PE into the first storage unit connected to the PE.

20. The data processing method according to claim 18 or 19, characterized in that: The data processing device further includes a data scheduler; and the data processing method further includes: The control unit generates a third control signal based on the data processing instruction, and transmits the third control signal to the data scheduler; The data scheduler performs write access to the first storage unit based on the third control signal.

21. The data processing method according to claim 20, characterized in that: The data processing device further includes a second storage unit; The data scheduler reads the to-be-processed data corresponding to each first storage unit from the second storage unit, and stores the to-be-processed data corresponding to each first storage unit into the corresponding first storage unit based on the first data storage address carried in the third control signal; The data to be processed corresponding to each of the first storage units include: data that needs to be read by the PE connected to each of the first storage units.

22. The data processing method according to claim 20 or 21, characterized in that: Also includes: The control unit generates a fourth control signal based on the data processing instruction, and transmits the fourth control signal to the data scheduler; The data scheduler performs a read access to the first storage unit based on the fourth control signal.

23. The data processing method according to claim 22, characterized in that: The data scheduler performs a read access to the first storage unit based on the fourth control signal, including: The data scheduler reads result data from the plurality of first storage units based on the fourth control signal, and stores the result data in a second storage unit; The result data includes: data generated by the PE connected to the first storage unit and stored in the first storage unit.

24. A computer device, characterized in that: include: An instruction memory and a data processing device as claimed in any one of claims 1 to 13.

25. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a data processing device, the steps of the data processing method according to any one of claims 14 to 23 are executed.