Arithmetic processing apparatus and control method of arithmetic processing apparatus
By employing a common bus with compression techniques based on exponent part assessment, the systolic array accelerator improves operating rates and processing performance despite constraints on bus width, addressing the challenge of increased processing element counts.
Patent Information
- Application Number
- JP2023031585
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-02
- Publication Date
- 2024-09-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The increase in the number of processing elements in systolic array type accelerators leads to a widening of the bus width required for data input and output, which constrains parallel operation of arithmetic units, reducing the operating rate and processing performance.
A common bus with a width smaller than the maximum required is used, accompanied by a compression determining unit that assesses data for compressibility based on the exponent part, allowing data to be compressed or transferred uncompressed, and a compression unit that executes the necessary transformations.
This approach enhances the operating rate and processing performance of multiple arithmetic units without increasing the bus width by optimizing data transfer through compression and decompression techniques.
Smart Images

Figure 2024123842000001
Abstract
Description
[Technical field]
[0001] The present invention relates to a processor and a method for controlling the processor. [Background technology]
[0002] Matrix operations are often used in scientific and technological calculations or machine learning. It is known that there is a limit to the performance improvement of large-scale matrix operations using a general-purpose CPU. Therefore, a systolic array type accelerator has been proposed that performs large-scale matrix multiplication at high speed by arranging multiple processing elements vertically and horizontally (for example, see Patent Document 1). [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Special Publication No. 2022-523760 Summary of the Invention [Problem to be solved by the invention]
[0004] The width of the bus that inputs and outputs data to and from the processing elements increases as the number of processing elements increases. For example, when multiple arithmetic units each including multiple processing elements and operating independently are arranged vertically and horizontally, it is preferable to simultaneously supply data to the arithmetic units arranged in one direction in order to improve performance. However, if a bus width that can simultaneously supply data to the arithmetic units arranged in one direction cannot be secured due to constraints such as the wiring area of the bus, it becomes difficult to operate the multiple arithmetic units in parallel. As a result, the operating rate of the arithmetic units decreases, and the processing performance of the accelerator decreases.
[0005] In one aspect, the present invention aims to improve the operating rate of a plurality of arithmetic units without increasing the bus width. [Means for solving the problem]
[0006] According to one aspect, an arithmetic processing device includes a plurality of arithmetic units that perform arithmetic operations, a bus that is provided common to the plurality of arithmetic units and has a bus width smaller than a bus width capable of simultaneously transferring data to the plurality of arithmetic units, a compression determination unit that determines whether or not the first data can be compressed based on a value of an exponent part of first data to be transferred to each of the plurality of arithmetic units, and a compression unit that outputs second data obtained by compressing the first data to the bus if the compression determination unit determines that compression is possible, and outputs the first data to the bus if the compression determination unit determines that compression is impossible. Effect of the Invention
[0007] The operating rate of a plurality of arithmetic units can be improved without increasing the bus width. [Brief description of the drawings]
[0008] [Figure 1] FIG. 2 is a block diagram illustrating an example of an accelerator according to one embodiment. [Diagram 2] FIG. 2 is an explanatory diagram showing an example of the operation of the accelerator in FIG. [Diagram 3] FIG. 13 is a block diagram illustrating an example of an accelerator according to another embodiment. [Figure 4] FIG. 4 is a block diagram showing an example of elements included in the dashed-dotted frame of FIG. 3. [Diagram 5] FIG. 4 is a block diagram showing an example of a matrix operation unit MOU in FIG. 3. [Figure 6] 6 is an explanatory diagram showing an example of calculation by the matrix calculation unit MOU of FIG. 5; [Figure 7] 4 is a block diagram showing an example of an information processing device in which the accelerator shown in FIG. 3 is installed. [Figure 8] 4 is an explanatory diagram showing an overview of how the type determination unit DTYP in FIG. 3 determines a compression availability flag FLG0. [Figure 9] 4 is a flow diagram showing an example of the operation of the type determination unit DTYP of FIG. 3. [Figure 10] 5 is an explanatory diagram showing an overview of arbitration by the bus control unit BCNT of FIG. [Figure 11] 4 is a flow diagram showing an example of an arbitration operation of a request REQ by the bus control units BCNT(A) and BCNT(C) of FIG. 3. [Figure 12] 8 is a flow chart showing an example of an operation of the information processing device in FIG. 7. [Figure 13] 4 is a flow chart showing an example of the operation of the matrix operation unit MOU of FIG. 3. [Figure 14] 4 is a flow chart showing an example of the operation of a control unit CNT that controls the matrix operation unit MOU in FIG. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments will be described with reference to the drawings. In the following, the same reference numerals as the names of the signals are used for signal lines through which signals such as data, addresses, and commands are transmitted.
[0010] Fig. 1 shows an example of an accelerator in one embodiment. The accelerator 100 shown in Fig. 1 includes a determination unit 10, a memory 20, a compression control unit 30, a compression unit 40, decompression units 50a, 50b, arithmetic units 60a, 60b, arithmetic control units 70a, 70b, an input bus IBUS, and an output bus OBUS. The determination unit 10 and the compression control unit 30 are an example of a compression determination unit.
[0011] The decompression unit 50a and the arithmetic control unit 70a are provided corresponding to the arithmetic unit 60a, and the decompression unit 50b and the arithmetic control unit 70b are provided corresponding to the arithmetic unit 60b. The input bus IBUS and the output bus OBUS are provided in common to the arithmetic units 60a and 60b. For example, each of the arithmetic units 60a and 60b operates as a systolic array. In the following, when the arithmetic units 60a and 60b are described without distinction, they are also referred to as arithmetic units 60.
[0012] For example, the determination unit 10, memory 20, compression control unit 30, compression unit 40, decompression units 50a and 50b, and input bus IBUS indicate circuit blocks that supply data to be transferred in the column direction X of the systolic array to the systolic array. The accelerator 100 may have a determination unit 10, memory 20, compression control unit 30, compression units 40, decompression units 50a and 50b, and input bus IBUS (not shown) that supply data to be transferred in the row direction Y of the systolic array to the systolic array.
[0013] The determination unit 10 determines whether or not data DTa, DTb transferred from outside the accelerator 100 can be compressed. The data DTa, DTb may be transferred to the accelerator 100 simultaneously or at different times. The data DTa, DTb are an example of first data. In the following description, when the data DTa, DTb are described without distinction, they are also referred to as data DT.
[0014] The determination unit 10 stores in the memory 20, together with the data DTa and DTb, compression availability flags FLG0a and FLG0b, which indicate whether or not the data DTa and DTb can be compressed. Hereinafter, when the compression availability flags FLG0a and FLG0b are described without distinction, they are also referred to as compression availability flag FLG0. Although not particularly limited, for example, each of the data DTa and DTb is 32 pieces of 64-bit floating point number data, which is an access unit by the requests REQa and REQb. Hereinafter, the 64-bit floating point number data is also referred to as FP64.
[0015] For example, when the maximum and minimum values of the exponent part of the 32 pieces of data DT (FP64) fit within the exponent part of the data type of 32-bit floating-point number data, the determination unit 10 sets the compression flag FLG0 to "1". That is, the compression flag FLG0 of "1" indicates that all the exponent part values of the 32 pieces of FP64 can be expressed in the data type of 32-bit floating-point number data and are compressible. Hereinafter, the 32-bit floating-point number data is also referred to as FP32.
[0016] By generating the compression enable / disable flag FLG0 according to the maximum and minimum values of the exponent part, even when compressing FP64 to generate FP32, the exponent value can be made the same before and after compression, and it is possible to prevent the arithmetic unit 60 from executing an erroneous matrix operation. As a result, it is possible to prevent the accelerator 100 from malfunctioning.
[0017] If the maximum value, the minimum value, or both the maximum value and the maximum value of the 32 FP64 exponent parts do not fit into the exponent part of the FP32 data type, the determination unit 10 sets the compression feasibility flag FLG0 to "0." In other words, the "0" of the compression feasibility flag FLG0 indicates that one or more of the 32 FP64 exponent parts cannot be represented in the FP32 data type and cannot be compressed.
[0018] When the memory 20 receives an address ADa from the compression control unit 30, it outputs the data DTa and the compression enable / disable flag FLG0a stored in the area indicated by the address ADa. When the memory 20 receives an address ADb from the compression control unit 30, it outputs the data DTb and the compression enable / disable flag FLG0b stored in the area indicated by the address ADb. For example, the data DTa and DTb are input to the compression unit 40, and the compression enable / disable flags FLG0a and FLG0b are input to the compression control unit 30. Hereinafter, when the addresses ADa and ADb are described without distinction, they are also referred to as the addresses AD.
[0019] The compression control unit 30 receives a compression permission flag FLG1a together with a request REQa including an address ADa from the operation control unit 70a, and receives a compression permission flag FLG1b together with a request REQb including an address ADb from the operation control unit 70b. The requests REQa and REQb are examples of data transfer requests.
[0020] In the following, when the calculation control units 70a and 70b are described without distinction, they are also referred to as the calculation control unit 70. When the compression permission flags FLG1a and FLG1b are described without distinction, they are also referred to as the compression permission flag FLG1. When the requests REQa and REQb are described without distinction, they are also referred to as the request REQ.
[0021] For example, the calculation control unit 70 sets the compression permission flag FLG1 to "0" when the calculation accuracy cannot be reduced, and sets the compression permission flag FLG1 to "1" when the calculation accuracy can be reduced. That is, the calculation control unit 70 generates the compression permission flag FLG1 according to the required accuracy of the matrix calculation by the calculation unit 60. Note that the compression permission flag FLG1a may be included in the request REQa, and the compression permission flag FLG1b may be included in the request REQb.
[0022] The compression control unit 30 determines whether or not to compress the data DTa based on the compression possible flag FLG0a and the compression permission flag FLG1a for each request REQa, and outputs a compression control signal CCNTa indicating compression or non-compression to the compression unit 40 and the decompression unit 50a. The compression control unit 30 determines whether or not to compress the data DTb based on the compression possible flag FLG0b and the compression permission flag FLG1b for each request REQb, and outputs a compression control signal CCNTb indicating compression or non-compression to the compression unit 40 and the decompression unit 50b. In the following, when the compression control signals CCNTa and CCNTb are described without distinction, they are also referred to as the compression control signal CCNT. The compression control signals CCNTa and CCNTb are an example of compression information.
[0023] When the compression unit 40 receives a compression control signal CCNTa indicating compression, it compresses the data DTa (32 FP64) to generate 32 FP32, and outputs it to the input bus IBUS. When the compression unit 40 receives a compression control signal CCNTa indicating non-compression, it outputs the data DTa (32 FP64) to the input bus IBUS without compressing it. The data DTa (32 FP64 or 32 FP32) is supplied to the decompression unit 50a as compressed data CDTa via the input bus IBUS. The compressed data CDTa is an example of second data.
[0024] When the compression unit 40 receives a compression control signal CCNTb indicating compression, it compresses the data DTb (32 FP64) to generate 32 FP32, and outputs them to the input bus IBUS. When the compression unit 40 receives a compression control signal CCNTb indicating non-compression, it outputs the data DTb (32 FP64) to the input bus IBUS without compressing it. Hereinafter, when the compression control signals CCNTa and CCNTb are described without distinction, they are also referred to as compression control signals CCNT.
[0025] The data DTb (32 FP64 or 32 FP32) is supplied to the decompression unit 50b as compressed data CDTb via the input bus IBUS. The compressed data CDTb is an example of the second data. For example, the input bus IBUS has a width of 256B (bytes) and can transfer 32 FP64 or 64 FP32 simultaneously.
[0026] When the compression control signal CCNTa indicates compression, the decompression unit 50a decompresses the compressed data CDTa (32 FP32) received via the input bus IBUS to generate 32 FP64, and outputs them to the arithmetic unit 60a as data DTa1. When the compression control signal CCNTa indicates non-compression, the decompression unit 50a outputs the compressed data CDTa (32 FP64) received via the input bus IBUS as it is to the arithmetic unit 60a as data DTa1.
[0027] When the compression control signal CCNTb indicates compression, the decompression unit 50b decompresses the compressed data CDTb (32 FP32) received via the input bus IBUS to generate 32 FP64, and outputs them to the arithmetic unit 60b as data DTb1. When the compression control signal CCNTb indicates non-compression, the decompression unit 50b outputs the compressed data CDTb (32 FP64) received via the input bus IBUS as it is to the arithmetic unit 60b as data DTb1.
[0028] The arithmetic unit 60 has 1024 processing elements (systolic array) (not shown) arranged in 32 columns and 32 rows in a Y direction. For example, the arithmetic units 60a and 60b have a systolic array similar to the matrix arithmetic unit MOU shown in FIG.
[0029] The arithmetic unit 60 supplies the 32 FP64s received via the decompression unit 50a (or decompression unit 50b) to the 32 processing elements PE lined up along the row direction Y at one end of the column direction X of the systolic array (transfer in the column direction X). The arithmetic unit 60 also supplies the 32 FP64s received via the decompression unit 50a (or decompression unit 50b) (not shown) for transfer in the row direction Y to the 32 processing elements PE lined up along the column direction X at one end of the row direction Y of the systolic array.
[0030] For example, each processing element multiplies one FP64 by one FP64 previously stored. Each processing element adds the multiplication result to an FP64 (e.g., a partial sum) received from an upstream processing element in the row direction Y to generate a new partial sum, and outputs the new partial sum to a downstream processing element in the row direction Y. Then, matrix operations are sequentially performed using data sequentially supplied to the systolic array. The result of the matrix operation by the systolic array is output to an output bus OBUS as output data ODTa (or ODTb) including 64 FP64s. For example, the output bus OBUS may have a width of 256B or 512B.
[0031] The calculation control unit 70a generates a request REQa and a compression permission flag FLG1a and outputs them to the compression control unit 30, thereby causing data for the calculation unit 60a to be transferred from the memory 20 and causing the calculation unit 60a to perform a matrix operation on the transferred data. The calculation control unit 70b generates a request REQb and a compression permission flag FLG1b and outputs them to the compression control unit 30, thereby causing data for the calculation unit 60b to be transferred from the memory 20 and causing the calculation unit 60b to perform a matrix operation on the transferred data.
[0032] Fig. 2 shows an example of the operation of the accelerator 100 in Fig. 1. In operations 1, 2, and 3 shown in Fig. 2, the compression control unit 30 receives requests REQa and REQb in the same cycle.
[0033] In operation 1, the compression control unit 30 receives the compression permission flag FLG1a="1" together with the request REQa, and receives the compression permission flag FLG1b="1" together with the request REQb. The compression control unit 30 receives the compression permission flag FLG0a="1" from the memory 20 corresponding to the address ADa included in the request REQa, and receives the compression permission flag FLG0b="1" from the memory 20 corresponding to the address ADb included in the request REQb.
[0034] The compression control unit 30 determines that the 64 pieces of data DTa, DTb corresponding to the requests REQa, REQb can be compressed and output simultaneously to the input bus IBUS based on the compression permission flags FLG1a, FLG1b and the compression availability flags FLG0a, FLG0b being "1". Then, the compression control unit 30 outputs a compression control signal CCNT to the compression unit 40 to compress the data DT from FP64 to FP32.
[0035] The compression unit 40 outputs the compressed 64 data CDTa(FP32), CDTb(FP32) to the input bus IBUS in one transfer cycle. The decompression units 50a, 50b decompress the data CDTa(FP32), CDTb(FP32) to data DTa1(FP64), DTb1(FP64) and output them to the arithmetic units 60a, 60b, respectively. The arithmetic units 60a, 60b use the data DTa1, DTb1, respectively, to perform matrix operations.
[0036] By compressing 64 pieces of data DTa (FP64) and DTb (FP64), whose bit width is twice the width of the input bus IBUS, the data DTa and DTb can be transferred at once. Since the data DTa and DTb can be compressed, transferred, and expanded without increasing the bus width of the input bus IBUS, and matrix operations can be performed by the arithmetic units 60a and 60b, the operating rate of the arithmetic units 60a and 60b can be improved.
[0037] In operation 2, the compression control unit 30 receives the compression permission flag FLG1a="1" or "0" together with the request REQa, and receives the compression permission flag FLG1b="1" or "0" together with the request REQb. The compression control unit 30 receives the compression permission flag FLG0a="1" or "0" from the memory 20 corresponding to the address ADa included in the request REQa. Also, the compression control unit 30 receives the compression permission flag FLG0a="0" from the memory 20 corresponding to the address ADb included in the request REQb.
[0038] When one or more of the compression permission flags FLG1a, FLG1b and the compression availability flags FLG0a, FLG0b are "0", the compression control unit 30 determines that the input bus IBUS is occupied by the data transfer of one of the requests REQa, REQb. Therefore, the compression control unit 30 determines that the data DTa, DTb cannot be transferred simultaneously.
[0039] In the first transfer cycle (1), the compression control unit 30 outputs a compression control signal CCNT for transferring either the data DTa (FP64) or the data DTb (FP64) uncompressed to the compression unit 40. In the next transfer cycle (2), the compression control unit 30 outputs a compression control signal CCNT for transferring the other of the data DTa (FP64) or the data DTb (FP64) uncompressed to the compression unit 40.
[0040] The compression unit 40 sequentially outputs the data DTa, DTb to the input bus IBUS without compressing them. The decompression units 50a, 50b output the data DTa, DTb to the arithmetic units 60a, 60b, respectively, in different cycles, without decompressing them. The arithmetic units 60a, 60b execute matrix operations using the data DTa, DTb, respectively, in different cycles. For this reason, in operation 2, the operating rate of the arithmetic units 60a, 60b is not improved.
[0041] In operation 3, the compression control unit 30 receives the compression permission flag FLG1a="0" along with the request REQa, and receives the compression permission flag FLG1b="1" or "0" along with the request REQb. The compression control unit 30 receives the compression permission flag FLG0a="1" or "0" from the memory 20 corresponding to the address ADa included in the request REQa. Also, the compression control unit 30 receives the compression permission flag FLG0b="1" or "0" from the memory 20 corresponding to the address ADb included in the request REQb.
[0042] The compression control unit 30 determines that the data DTa and DTb cannot be transferred simultaneously, as in operation 2. Then, the compression control unit 30 outputs a compression control signal CCNT to the compression unit 40 to transfer the data DTa (FP64) and data DTb (FP64) uncompressed, using two transfer cycles (1) and (2).
[0043] In operation 4, the compression control unit 30 receives the compression permission flag FLG1a="1" or "0" together with the request REQa, but does not receive the request REQb. The compression control unit 30 receives the compression permission flag FLG0a="1" or "0" from the memory 20 in response to the address ADa included in the request REQa.
[0044] When the compression control unit 30 receives only the request REQa, it determines to transfer the data DTa (FP64) to the arithmetic unit 60a without compression. When the compression control unit 30 receives only the request REQb, it determines to transfer the data DTb (FP64) to the arithmetic unit 60b without compression. The compression unit 40 outputs the data DTa to the input bus IBUS without compression. The decompression unit 50a outputs the data DTa as it is to the arithmetic unit 60a as data DTa1. The arithmetic unit 60a performs a matrix operation using the data DTa1.
[0045] As described above, in this embodiment, when the compression permission flags FLG1a and FLG1b are "1", the determination unit 10 determines that the data DTa and DTb can be compressed, and the compression unit 40 compresses and outputs the data DTa and DTb output from the memory 20 based on the determination result. This allows the data DTa and DTb to be transferred to the arithmetic units 60a and 60b in the same transfer cycle via the input bus IBUS, and the operating rate of the arithmetic units 60a and 60b can be improved. As a result, the processing performance of the accelerator 100 can be improved compared to the case where the data DTa and DTb are transferred sequentially in different transfer cycles without being compressed.
[0046] The compression control unit 30 determines whether or not to compress the data DTa, DTb based on not only the compression possible flag FLG0 but also the compression permission flag FLG1. This allows the data DTa, DTb to be compressed or uncompressed according to the required accuracy of the matrix calculation by the calculation units 60a, 60b.
[0047] The determination unit 10 generates a compression feasibility flag FLG0 according to the magnitude of the value of the exponent part of the 32 pieces of data DT (FP64). For example, the determination unit 10 generates a compression feasibility flag value indicating a data type capable of expressing the maximum and minimum values of the exponent part of the 32 pieces of data DT (FP64). As a result, even when compressing FP64 to generate FP32, the exponent values of all 32 pieces of data DT can be made the same before and after compression, and it is possible to prevent the arithmetic unit 60 from executing an erroneous matrix operation. As a result, it is possible to prevent the accelerator 100 from malfunctioning.
[0048] The determination unit 10 generates a compression feasibility flag FLG for each data DT stored in the memory 20, and stores it together with the data DT in the memory 20. The compression control unit 30 outputs an address AD included in the request REQ to the memory 20, and causes the memory 20 to output the data DT and the compression feasibility flag FLG0 corresponding to the request REQ.
[0049] Therefore, the determination unit 10 does not need to read the data DT from the memory 20 to generate the compression feasibility flag FLG0, and does not need to store the generated compression feasibility flag FLG0 separately from the data DT in the memory 20. This improves the efficiency of generating the compression feasibility flag FLG0. Also, since the determination unit 10 does not need to generate the compression feasibility flag FLG0 after receiving a request REQ from the compression control unit 30, the compression control unit 30 can quickly determine whether compression is possible.
[0050] The decompression section 50a provided corresponding to the arithmetic unit 60a decompresses the compressed data CDTa in response to a compression control signal CCNTa from the compression control section 30. The decompression section 50b provided corresponding to the arithmetic unit 60b decompresses the compressed data CDTb in response to a compression control signal CCNTb from the compression control section 30. This makes it possible to restore the data CDTa, CDTb compressed by the compression section 40 and transferred to the input bus IBUS to data corresponding to the original data DTa, DTb, respectively.
[0051] Fig. 3 shows an example of an accelerator in another embodiment. Fig. 4 shows an example of an element included in the dashed line frame in Fig. 3. The accelerator 100A shown in Fig. 3 has a function of performing matrix calculations using data transferred from a memory MEM via a DMAC (Direct Memory Access Controller) and transferring the results of the calculations to the memory MEM via the DMAC. The accelerator 100A is an example of a calculation processing device. An example of an information processing device in which the accelerator 100A is mounted is shown in Fig. 7.
[0052] The accelerator 100A has a plurality of matrix calculation units MOU, a scratch pad memory SPM for holding data, and buses A, B, Ci, and Co connecting the scratch pad memory SPM and the matrix calculation units MOU. Each of the buses A, B, Ci, and Co is commonly connected to the plurality of matrix calculation units MOU.
[0053] The accelerator 100A has a data type determination unit DTYP, a compression unit CMP, a bus control unit BCNT, and a decompression unit DCMP provided corresponding to each bus A, Ci, and a bus control unit BCNT provided corresponding to each bus B. The accelerator 100A also has a control unit CNT provided corresponding to each matrix operation unit MOU.
[0054] The data type determination unit DTYP and the bus control unit BCNT are an example of a compression determination unit. The bus control unit BCNT(A) is an example of a compression control unit. In the following, in order to make elements with the same name identifiable, a number in parentheses is added to the end of the name of each element, or a bus name and a number in parentheses are added to the end of the name of each element.
[0055] For example, the accelerator 100A has 16 matrix operation units MOU, 4 arranged in the column direction X and 4 arranged in the row direction Y. For example, the number of matrix operation units MOU is not limited to 16 as long as it is 2 n (n is an integer equal to or greater than 2). The number of matrix operation units MOU is not limited to 2 n. It is preferable that the numbers of matrix operation units MOU arranged in the column direction X and the row direction Y are equal to each other. Each matrix operation unit MOU has 1024 processing elements PE (not shown), 32 of which are arranged in the column direction X and 32 of which are arranged in the row direction Y. An example of the processing elements PE is shown in FIG. 5.
[0056] The data type determination unit DTYP(A), the scratch pad memory SPM(A), the bus control unit BCNT(A), the compression unit CMP(A) and the bus A are an example of a data supply unit. The data type determination unit DTYP(C), the scratch pad memory SPM(C), the bus control unit BCNT(C), the compression unit CMP(C) and the bus Ci are an example of a data supply unit. In this embodiment, for each data supply unit, it is possible to determine whether the data held in the scratch pad memory SPM can be compressed, and the compressed data can be transferred to the corresponding matrix operation unit MOU based on the determination result.
[0057] Each bus A, B, Ci, Co is assigned a number from 0 to 3 to identify its position in the column direction X or its position in the row direction Y. The data type determination unit DTYP, scratch pad memory SPM, compression unit CMP, and bus control unit BCNT are assigned a code combining one of the buses A, B, Ci connected thereto and one of the numbers from 0 to 3 to identify its position in the column direction X or its position in the row direction Y. The matrix calculation unit MOU, decompression unit DCMP, and control unit CNT are assigned a code combining one of the buses A, B, Ci connected thereto and one of the numbers from 0 to 3 to identify its position in the row direction Y and one of the numbers from 0 to 3 to identify its position in the column direction X.
[0058] Although not limited thereto, each of the buses A, B, Ci, and Co has a width of 256B (bytes) and can transfer, for example, 32 pieces of 64-bit floating-point number data (FP64) simultaneously. The bus width of each of the buses A and Ci is smaller than the bus width (1024B) that can transfer FP64 simultaneously to the four matrix operation units MOU corresponding to each of the buses A and Ci. Each matrix operation unit MOU can execute a multiply-and-accumulate operation of FP64 in each of the 32 processing elements PE arranged in the row direction Y.
[0059] For this reason, when performing matrix operations on different data using all four matrix operation units MOU arranged in the column direction X connected to the bus A, each matrix operation unit MOU arranged in the column direction X can only receive data once every four cycles. Similarly, when performing matrix operations on different data using all four matrix operation units MOU connected to the bus Ci and arranged in the row direction Y, each matrix operation unit MOU can only receive data once every four cycles. However, if the data is the same, it is possible to simultaneously perform matrix operations using all four matrix operation units MOU.
[0060] Therefore, in this embodiment, the compression unit CMP compresses FP64 into 32-bit floating-point data (FP32) and 16-bit floating-point data (FP16 or bflort (brain floating point format)16), and outputs the data to the bus A (or bus Ci). When the decompression unit DCMP receives compressed data, it decompresses it into FP64 and outputs it to the matrix operation unit MOU. Hereinafter, the 16-bit floating-point data FP16 will also be referred to as FP16, and bflort16 will also be referred to as BF16.
[0061] For example, by compressing FP64 to FP16 or BF16 by the compression unit CMP, data equivalent to 32 FP64s can be transferred to each matrix calculation unit MOU via the bus A (or the bus Ci) at one time. Also, for example, assume that two of the four matrix calculation units MOU arranged in the column direction X execute matrix calculations in parallel. In this case, by compressing FP64 to FP32 by the compression unit CMP, data equivalent to 32 FP64s can be transferred to the two matrix calculation units MOU via the bus A at one time.
[0062] Furthermore, for example, assume that three of the four matrix calculation units MOU arranged in the column direction X execute matrix calculations in parallel. In this case, by compressing FP64 into FP32 and two FP16 or BF16 by the compression unit CMP, data equivalent to 32 FP64 can be transferred at once to the three matrix calculation units MOU via the bus A.
[0063] The data type determination unit DTYP(A) (e.g., (A0)-(A3)) determines which of FP32, FP16, or BF16 is a compressible data type based on the value of the exponent part of the 32 FP64s received from the DMAC. The data type determination unit DTYP(A) stores a compression possibility flag FLG0 indicating the type determined to be compressible in the scratch pad memory SPM(A) (e.g., (A0)-(A3)) together with the 32 FP64s received from the DMAC. The data type determination unit DTYP(A) can receive a maximum of four sets of 32 FP64s from the DMAC, and generates a compression possibility flag FLG0 for each set.
[0064] The data type determination unit DTYP(C) (e.g., (C0)-(C3)) determines the compressible type among FP32, FP16, and BF16 based on the value of the exponent part of up to 32 FP64s received from the DMAC or the matrix calculation unit MOU. The data type determination unit DTYP(C) stores a compression possibility flag FLG0 indicating the type determined to be compressible in the scratch pad memory SPM(C) (e.g., (C0)-(C3)) together with up to 32 FP64s received from the DMAC or the matrix calculation unit MOU. The data type determination unit DTYP(C) can receive up to four sets of 32 FP64s from the DMAC, and generates a compression possibility flag FLG0 for each set. An example of the operation of the data type determination unit DTYP is shown in FIG. 8. The FP64s received by the data type determination units DTYP(A) and DTYP(C) from the DMAC are an example of the first data.
[0065] The scratch pad memory SPM(A) (any of (A0)-(A3)) outputs the FP64 indicated by the access request (address AD) from the bus control unit BCNT(A) (any of (A0)-(A3)) to the compression unit CMP(A) (any of (A0)-(A3)).
[0066] The scratch pad memory SPM(C) (any of (C0)-(C3)) outputs the FP64 indicated by the access request (address AD) from the bus control unit BCNT(C) (any of (C0)-(C3)) to the compression unit CMP(C) (any of (C0)-(C3)).
[0067] The scratch pad memory SPM(B) (any of (B0)-(B3)) outputs the FP64 indicated by the access request (address AD) from the bus control unit BCNT(B) (any of (B0)-(B3)) to the compression unit CMP(B) (any of (B0)-(B3)).
[0068] The compression unit CMP(A) ((A0)-(A3)) compresses or decompresses the FP64 output from the scratch pad memory SPM(A) ((A0)-(A3)) based on the compression control signal CCNT (CCNT0-CCNT3) from the bus control unit BCNT(A) ((A0)-(A3)). The compression control signal CCNT0-CCNT3 is an example of compression information. The compression unit CMP(A) transfers the compressed or decompressed data to the bus A ((A0)-(A3)).
[0069] The compression unit CMP(C) ((C0)-(C3)) compresses or decompresses the FP64 output from the scratch pad memory SPM(C) ((C0)-(C3)) based on the compression control signal CCNT (CCNT0-CCNT3) from the bus control unit BCNT(C) ((C0)-(C3)). The compression unit CMP(C) transfers the compressed or decompressed data to the bus Ci ((Ci0)-(Ci3)). Note that the compression control signal CCNT output from the bus control unit BCNT(C) is different from the compression control signal CCNT output from the bus control unit BCNT(A). The data compressed by the compression units CMP(A) and CMP(C) is an example of the second data.
[0070] The bus control unit BCNT(A) has arbitration units ARB(A) ((A0)-(A3)). The arbitration unit ARB(A) receives a compression permission flag FLG0 from the corresponding scratch pad memory SPM(A) and a compression permission flag FLG1 from the four control units CNT located in the column direction X of the arbitration unit ARB(A). The compression permission flag FLG1 may be included in the request REQ(A). The requests REQ(A), REQ(B), and REQ(C) are examples of data transfer requests. An example of the operation of the bus control unit BCNT(A) is described in FIG. 10 and FIG. 11.
[0071] When the arbitration unit ARB(A) receives a request REQ(A) (e.g., any one of A00, A01, A02, and A03) from only one of the four control units CNT located in the column direction X, it decides to output the FP64 to the bus A without compressing it. When the arbitration unit ARB(A) receives requests REQ(A) from more than one of the four control units CNT, it decides whether to compress the FP64 requested by each request REQ(A) and output it to the bus A at once, or to output the FP64 to the bus A for each matrix operation unit MOU. At this time, the arbitration unit ARB(A) decides the compression specification based on the compression availability flag FLG0 and the compression permission flag FLG1.
[0072] When outputting FP64 to bus A for each matrix calculation unit MOU, the arbitration unit ARB(A) determines the output order to bus A. Based on the arbitration decision, the arbitration unit ARB(A) outputs compression control signals CCNT0-CCNT3 indicating the data compression specifications to the compression unit CMP(A). The compression control signals CCNT0-CCNT3 are generated for each bus control unit BCNT(A). For example, the compression control signals CCNT0-CCNT3 are generated corresponding to four requests REQ (e.g., REQ(A00), REQ(A01), REQ(A02), REQ(A03)) from the four control units CNT, respectively.
[0073] The bus control unit BCNT(C) has arbitration units ARB(C) ((C0)-(C3)). The arbitration unit ARB(C) receives a compression permission flag FLG0 from the corresponding scratch pad memory SPM(C) and a compression permission flag FLG1 from the four control units CNT located in the row direction Y of the arbitration unit ARB(C). The compression permission flag FLG1 may be included in the request REQ(C). The function and operation of the bus control unit BCNT(C) are similar to those of the bus control unit BCNT(A). An example of the operation of the bus control unit BCNT(C) is described in FIG. 10 and FIG. 11.
[0074] The compression permission flag FLG1 indicates, in 3 bits, which of multiple data types can be used. For example, if only FP64 can be used, the compression permission flag FLG1 is set to "000". If FP32 can be used (compressible), the compression permission flag FLG1 is set to "1**". Here, the sign "*" indicates that the value can be either "0" or "1". If BF16 can be used (compressible), the compression permission flag FLG1 is set to "*1*". If FP16 can be used (compressible), the compression permission flag FLG1 is set to "**1".
[0075] 5, data b (FP64) to the matrix calculation unit MOU via the bus B is transferred in advance to the matrix calculation unit MOU before starting the matrix calculation. For this reason, the FP64 transferred to the bus B is not compressed. However, when compressing the FP64 and transferring it to the bus B, an arbitration unit ARB(B) (not shown) may be provided in the bus control unit BCNT(B) as well as the bus control unit BCNT(C) and the compression unit CMP(C), and a compression unit CMP(B) (not shown) may be provided corresponding to the bus B.
[0076] A control unit CNT (e.g., (00)) provided corresponding to each matrix calculation unit MOU controls the operation of the corresponding decompression units DCMP(A), DCMP(C), FIFO (First-In First-Out) (A), (C) and matrix calculation unit MOU.
[0077] The decompression unit DCMP(A) decompresses the data transferred via the corresponding bus A based on the corresponding compression control signal CCNT to generate 32 FP64s. The decompression unit DCMP(A) stores the generated FP64s in FIFO(A).
[0078] The decompression unit DCMP(C) decompresses the data transferred via the corresponding bus Ci based on the corresponding compression control signal CCNT to generate 32 FP64s. The decompression unit DCMP(C) stores the generated FP64s in the FIFO(C).
[0079] The FIFO(A) sequentially holds 32 FP64s output from the corresponding decompression unit DCMP(A). Based on an instruction from the corresponding control unit CNT, the FIFO(A) outputs the 32 FP64s held first to the matrix operation unit MOU in order.
[0080] Each control unit CNT controls the operation of the corresponding decompression unit DCMP(A), DCMP(C), FIFO(A), FIFO(C) and matrix calculation unit MOU. Each control unit CNT has a command buffer CMDB that holds a command CMD received from outside the accelerator 100A.
[0081] Each control unit CNT generates a request REQ (data transfer request) based on the command CMD held in the command buffer CMDB, and outputs the generated request REQ to the corresponding bus control unit BCNT. Each control unit CNT outputs control signals to the decompression units DCMP(A), DCMP(C), FIFO(A), FIFO(C) and the matrix calculation unit MOU to cause the matrix calculation unit MOU to perform a matrix calculation of the data transferred via the bus in response to the request REQ.
[0082] Each matrix operation unit MOU executes a matrix operation using the FP64 stored in the corresponding FIFO (A), (C) and the FP64 transferred via the corresponding bus B. The matrix operation unit MOU outputs the execution result to the corresponding type judgment unit DTYP (C) via the bus Co (one of Co0-Co3). An example of the matrix operation unit MOU is shown in FIG. 5.
[0083] Fig. 5 shows an example of the matrix operation unit MOU of Fig. 3. For the sake of simplicity, elements such as a compression unit CMP and a decompression unit DCMP arranged between the scratch pad memories SPM(A), SPM(B), and SPM(C) and the matrix operation unit MOU are omitted in Fig. 5. In reality, the compressed data transferred via the buses A and C, respectively, are decompressed before being supplied to the matrix operation unit MOU.
[0084] The matrix operation unit MOU has 1024 processing elements PE, with 32 arranged in the column direction X and 32 arranged in the row direction Y. Adjacent processing elements PE are connected via registers or FIFOs. The matrix operation unit MOU constructs a systolic array that can continuously execute matrix operations such as inner products by sequentially using the operation results without storing them in an external register or the like. Hereinafter, the matrix operation unit MOU is also referred to as a systolic array.
[0085] The matrix calculation unit MOU receives 256 B of data a from the scratch pad memory SPM(A) via the bus A, and receives 256 B of data b from the scratch pad memory SPM(B) via the bus B. The matrix calculation unit MOU also receives 256 B of data c from the scratch pad memory SPM(C) via the bus Ci, and transmits 256 B of data c to the scratch pad memory SPM(C) via the bus Co.
[0086] Each processing element PE has at least one register REG that holds data b (one FP64), a multiplier MUL, and an adder ADD. The multiplier MUL multiplies data a (one FP64) by the data b held in the register REG and outputs the multiplication result to the adder ADD. The adder ADD adds the multiplication result to data c (one FP64) and outputs the result as a partial sum to the processing element PE downstream in the row direction Y.
[0087] Data a is sequentially transferred to downstream processing elements PE in the column direction X via a register or a FIFO. Data b is sequentially transferred in advance to downstream processing elements PE in the row direction Y via a register or a FIFO.
[0088] Fig. 6 shows an example of an operation by the matrix operation unit MOU of Fig. 5. For the sake of simplicity, Fig. 6 shows an example in which two processing elements PE are arranged in each of the column direction X and the row direction Y. Data b is pre-stored in the register REG of each processing element PE.
[0089] The processing element PE00 is arranged at the most upstream side in the column direction X and row direction Y. The processing element PE01 is arranged at the downstream side in the column direction X. The processing element PE10 is arranged at the downstream side in the row direction Y. The processing element PE11 is arranged at the most downstream side in the column direction X and row direction Y. The processing elements PE indicated with thick frames execute a valid matrix operation in the corresponding cycle CYC.
[0090] In cycle CYC=0, the processing element PE00 adds the product of matrix a[0][0] and matrix b[0][0] held in the register REG to matrix c[0][0], and outputs the operation result (a[0][0]*b[0][0]+c[0][0]). The sign * in the formula indicates multiplication. The operation result is transferred to the processing element PE10.
[0091] In cycle CYC=1, the processing element PE00 adds the product of matrix a[1][0] and matrix b[0][0] held in the register REG to matrix c[1][0], and outputs the operation result (a[1][0]*b[0][0]+c[1][0]). The operation result is transferred to the processing element PE10 as a partial sum.
[0092] In cycle CYC=1, the processing element PE01 adds the product of matrix a[0][0] and matrix b[0][1] held in the register REG to matrix c[0][1], and outputs the calculation result (a[0][0]*b[0][1]+c[0][1]). The calculation result is transferred to the processing element PE11 as a partial sum.
[0093] In cycle CYC=1, the processing element PE10 adds the product of matrix a[0][1] and matrix b[1][0] held in the register REG to the matrix (a[0][0]*b[0][0]+c[0][0]) which is the partial sum in cycle CYC=0. The processing element PE10 outputs the addition result to the processing element PE downstream in the row direction Y (in this example, PE20, not shown).
[0094] Fig. 7 shows an example of an information processing device 200 equipped with the accelerator 100A of Fig. 3. The information processing device 200 is used for learning or inference such as image processing using a neural network, or for both learning and inference. Note that the accelerator 100 of Fig. 1 may be equipped in the information processing device 200.
[0095] For example, the information processing device 200 is a server, and includes a CPU 210, an accelerator 100A, a memory 220, an auxiliary storage device 230, a communication interface 240, and an input / output interface 250, which are interconnected via a bus BUS. Note that the information processing device 200 may include elements other than those shown in the figure.
[0096] The CPU 210 controls the entire information processing device 200, transmits a command sequence for causing the accelerator 100A to execute a matrix calculation, and waits for a notification of completion of the matrix calculation from the accelerator 100A. The accelerator 100A sequentially executes commands included in the command sequence until the command sequence received from the CPU 210 is completed, and loads data from the memory 220, executes the matrix calculation, and stores the calculation result in the memory 220.
[0097] The memory 220 holds target data for the matrix operation, execution results of the matrix operation, various programs, etc. The memory MEM shown in Fig. 3 may be the memory 220. The auxiliary storage device 230 holds an OS (Operating System) executed by the CPU 210 and various programs such as an information processing program that operates the information processing device 200.
[0098] The auxiliary storage device 230 may hold data used in the calculation of the neural network and various variables such as weights. For example, the program stored in the auxiliary storage device 230 may be transferred to the memory 220 and executed by the CPU 210. Furthermore, the data and various variables used in the calculation of the neural network stored in the auxiliary storage device 230 may be transferred from the auxiliary storage device 230 to the memory 220 when the neural network is trained or when inference is made using the neural network.
[0099] The communication interface 240 has a function of communicating with other information processing devices, for example, via a network. This makes it possible to execute neural network calculations in parallel using a plurality of information processing devices. The input / output interface 250 has a function of inputting and outputting data, programs, etc. to and from a recording medium 300 connected to the information processing device 200.
[0100] For example, the recording medium 300 is a CD (Compact Disc: registered trademark), a DVD (Digital Versatile Disc: registered trademark), a USB (Universal Serial Bus) memory, etc. The program recorded on the recording medium 300 may be transferred to the auxiliary storage device 230 via the input / output interface 250, and then developed on the memory 220 and executed by the CPU 210.
[0101] Fig. 8 shows an overview of how the compression enable / disable flag FLG0 is calculated by the type determination unit DTYP in Fig. 3. Each of the type determination units DTYP(A0)-DTYP(A3) extracts the exponent part E of all 32 FP64 data received from the DMAC, and calculates the maximum value EMAX and minimum value EMIN of the exponent part E.
[0102] Each of the type determination units DTYP(C0)-DTYP(C3) extracts the exponent part E of all 32 FP64 received from the DMAC, and finds the maximum value EMAX and minimum value EMIN of the exponent part E. Also, each of the type determination units DTYP(C0)-DTYP(C3) extracts the exponent part E of all up to 32 FP64 received from the four matrix operation units MOU via the buses Co (Co0-Co3), and finds the maximum value EMAX and minimum value EMIN of the exponent part E.
[0103] Although not limited to this, the compression flag FLG0 has two bits. The compression flag FLG0 of "00" indicates that only FP64 can be used (compression is not possible). The compression flag FLG0 of "10" indicates that FP64, FP32, or BF16 can be used. The compression flag FLG0 of "11" indicates that all data types FP64, FP32, BF16, and FP16 can be used. The compression flag FLG0 may have three bits, similar to the compression permission flag FLG1. In this case, the compression flag FLG0 of "000" indicates that only FP64 can be used (compression is not possible). The compression flag FLG0 of "110" indicates that FP64, FP32, or BF16 can be used. The compression flag FLG0 of "111" indicates that all data types FP64, FP32, BF16, and FP16 can be used.
[0104] Each type determination unit DTYP determines the data type of at least one floating-point number data that can compress FP64 based on the calculated maximum value EMAX and minimum value EMIN. Each type determination unit DTYP adds a compression possibility flag FLG0 including information indicating the data type of the determined floating-point number data to the 32 FP64s and stores the resulting data in the scratch pad memory SPM.
[0105] For example, in IEEE (Institute of Electrical and Electronics Engineers) 754, FP64 includes a 1-bit sign part, an 11-bit exponent part, and a 52-bit mantissa part. The exponent part of FP64 can represent -1022 to 1023. FP32 includes a 1-bit sign part, an 8-bit exponent part, and a 23-bit mantissa part. The exponent part of FP32 can represent -126 to 127. FP16 includes a 1-bit sign part, a 5-bit exponent part, and a 10-bit mantissa part. The exponent part of FP16 can represent -14 to 15. BF16, which is a format in which the 16 bits of the mantissa part of FP32 are truncated, includes a 1-bit sign part, an 8-bit exponent part, and a 7-bit mantissa part. The exponent part of BF16 can represent -126 to 127.
[0106] Fig. 9 shows an example of the operation of the type determination unit DTYP in Fig. 3. Fig. 9 shows an example of a control method for the accelerator 100A. In Fig. 9, it is assumed that the compression enable / disable flag FLG0 is set to 2 bits. The type determination unit DTYP(A) executes the operation shown in Fig. 8 every time it receives 32 FP64 from the DMAC. The type determination unit DTYP(C) executes the operation shown in Fig. 8 every time it receives 32 FP64 from the DMAC or every time it receives up to 32 FP64 from the matrix calculation unit MOU.
[0107] First, in step S11, the type determination unit DTYP determines the maximum value EMAX of the exponent part E of up to 32 FP64 numbers received. Next, in step S12, the type determination unit DTYP determines the minimum value EMIN of the exponent part E of up to 32 FP64 numbers received. The exponent part E of FP64 can express values from -1022 to 1023 using 11 bits.
[0108] Next, in step S13, the type determination unit DTYP determines whether the maximum value EMAX is greater than 127 or the minimum value EMIN is less than -126. If the maximum value EMAX is greater than 127 or the minimum value EMIN is less than -126, there is a risk that the data will exceed the range that can be expressed by compressing FP64 to FP32, FP16 or BF16, resulting in a value far removed from the original value. For this reason, the type determination unit DTYP executes step S15. If the maximum value EMAX and the minimum value EMIN are between -126 and 127, the type determination unit DTYP executes step S14 to determine whether FP64 can be compressed to FP32, FP16 or BF16.
[0109] In step S14, the type determination unit DTYP determines whether the maximum value EMAX is greater than 15 or the minimum value EMIN is less than -14. If the maximum value EMAX is greater than 15 or the minimum value EMIN is less than -14, there is a risk of data loss due to compression from FP64 to FP16. For this reason, the type determination unit DTYP executes step S16. If the maximum value EMAX and the minimum value EMIN are between -14 and 15, FP64 can be compressed to any of FP32, BF16, or FP16, so the type determination unit DTYP executes step S17.
[0110] In step S15, the type determination unit DTYP adds the compression enable / disable flag FLG0="00" to the 32 FP64s, stores them in the scratch pad memory SPM, and ends the operation in Fig. 8. As shown in Fig. 8, the compression enable / disable flag FLG0="00" indicates that only FP64 can be used.
[0111] In step S16, the type determination unit DTYP adds the compression availability flag FLG0="10" to the 32 FP64s, stores them in the scratch pad memory SPM, and ends the operation in Fig. 8. As shown in Fig. 8, the compression availability flag FLG0="10" indicates that FP64, FP32, or BF16 can be used.
[0112] In step S17, the type determination unit DTYP adds the compression availability flag FLG0="11" to the 32 FP64s, stores them in the scratch pad memory SPM, and ends the operation in Fig. 8. As shown in Fig. 8, the compression availability flag FLG0="11" indicates that any of FP64, FP32, BF16, and FP16 can be used.
[0113] Fig. 10 shows an overview of arbitration by the bus control unit BCNT of Fig. 4. The data combinations shown in Fig. 10 may be held in the bus control unit BCNT as, for example, a combination table.
[0114] When the number of received requests REQ is one, the bus control unit BCNT determines not to perform arbitration by the arbitration unit ARB because FP64 can be output to a bus (for example, bus A) uncompressed. This allows FP64 to be transferred from the scratchpad memory SPM to the matrix operation unit MOU without reducing its accuracy, and prevents a reduction in the accuracy of the matrix operation by the matrix operation unit MOU.
[0115] When the number of received requests REQ is between two and four, the bus control unit BCNT determines to perform arbitration by the arbitration unit ARB since FP64 compression is required to output the data to the bus at once.
[0116] When the number of received requests REQ is two, the bus control unit BCNT causes the arbitration unit ARB to generate compression control signals CCNT0-CCNT3 for compressing FP64 to FP32. Then, 64 FP32 compressed by the compression unit CMP in response to the two requests REQ are output to the bus A (or the bus Ci).
[0117] When the number of received requests REQ is three, the bus control unit BCNT determines to compress one FP64 of the request REQ to FP32 and compress the remaining two FP64 of the request REQ to FP16 or BF16. The bus control unit BCNT causes the arbitration unit ARB to generate compression control signals CCNT0-CCNT3 based on the determined compression specification. Then, 32 FP32 and 64 FP16 (or BF16) compressed by the compression unit CMP in response to the three requests REQ are output to the bus A (or the bus Ci).
[0118] When the number of received requests REQ is four, the bus control unit BCNT determines that the FP64 of each of the four requests REQ should be compressed to FP16 or BF16. The bus control unit BCNT causes the arbitration unit ARB to generate compression control signals CCNT0-CCNT3 based on the determined compression specification. As a result, 32 FP16 or 32 BF16 are output to the bus for each of the four requests REQ.
[0119] When the compression specification is restricted by the compression availability flag FLG0 and the compression permission flag FLG1, the arbitration unit ARB determines the compression specification regardless of the judgment result of the bus control unit BCNT. Then, the arbitration unit ARB generates, for example, a compression control signal CCNT0-CCNT3 that outputs FP64 for each request REQ to the bus A (or the bus Ci) in a different cycle.
[0120] Fig. 11 shows an example of arbitration operation of requests REQ by the bus control units BCNT(A) and BCNT(C) in Fig. 3. Fig. 11 shows an example of a control method for the accelerator 100A. The operation shown in Fig. 11 is started based on each bus control unit BCNT(A), BCNT(C) receiving a request REQ from at least one of the four control units CNT. Since the operations of the bus control units BCNT(A) and BCNT(C) are similar to each other, the operation of the bus control unit BCNT(A) will be described below.
[0121] First, in step S21, the bus control unit BCNT(A) calculates an AND logic between the compression permission flag FLG1 included in each of the received requests REQ and the compression feasibility flag FLG0 received from the scratch pad memory SPM(A). At this time, the bus control unit BNCT(A) copies the most significant bit of the two bits of the compression feasibility flag FLG0 to the most significant side to generate an expanded 3-bit compression feasibility flag FLG0.
[0122] For example, when the 2-bit compression enable / disable flag FLG0 is "00", a 3-bit compression enable / disable flag FLG0="000" is generated. When the 2-bit compression enable / disable flag FLG0 is "10", a 3-bit compression enable / disable flag FLG0="110" is generated. When the 2-bit compression enable / disable flag FLG0 is "11", a 3-bit compression enable / disable flag FLG0="111" is generated.
[0123] As described in Fig. 8, when the compression flag FLG0 is set to 3 bits, the bus control unit BNCT(A) uses the compression flag FLG0 received from the scratch pad memory SPM(A) as is. The bus control unit BCNT(A) determines a compressible floating-point number data format from the obtained AND logic value (a 3-bit temporary compression flag). The compressible floating-point number data format also includes FP64, which does not compress.
[0124] The specifications of the tentative compression flag are the same as the compression possible flag FLG0 and the compression permission flag FLG1 extended to 3 bits. That is, "000" indicates that only FP64 can be used, "100" indicates that FP64 or FP32 can be used, "110" indicates that FP64, FP32 or BF16 can be used, and "111" indicates that any of FP64, FP32, BF16 or FP16 can be used.
[0125] Next, in step S22, when the bus control unit BCNT(A) has completed the determination of all received requests REQ, it executes step S23, and when there are requests REQ that have not been determined, it returns to the operation of step S21.
[0126] In step S23, when the bus control unit BCNT(A) receives a plurality of requests REQ, the bus control unit BCNT(A) sorts the requests REQ according to a predetermined priority order. That is, the bus control unit BCNT(A) determines the order in which the requests REQ are output to the bus A.
[0127] Next, in step S24, the bus control unit BCNT(A) determines whether or not the data types of the compressible floating-point number data determined in step S21 include a combination of the data types of the floating-point number data in FIG. 10 for all received requests REQ.
[0128] If a combination shown in the combination table exists, the bus control unit BCNT(A) executes step S26 since it can simultaneously transfer multiple sets of data corresponding to multiple requests REQ. If a combination shown in the combination table does not exist, the bus control unit BCNT(A) executes step S25 since it cannot simultaneously transfer at least one set of multiple sets of data corresponding to multiple requests REQ.
[0129] That is, when there is no combination shown in the combination table, the bus control unit BCNT(A) determines to transfer data corresponding to multiple requests REQ in multiple batches to the bus A. Then, the bus control unit BCNT(A) causes the arbitration unit ARB to generate compression control signals CCNT0-CCNT3 for transferring the data in multiple batches to the bus A.
[0130] In step S25, the bus control unit BCNT(A) determines to retransmit the request REQ with the lowest priority used in the sorting in step S23, removes the determined request REQ from the requests REQ to be output, and returns to the operation of step S24. Data corresponding to the request REQ removed from the requests REQ to be output is transferred to the bus A in the subsequent cycle.
[0131] In step S26, the bus control unit BCNT(A) updates the priority order of the requests REQ included in the existing combinations. Next, in step S27, the bus control unit BCNT (arbitration unit ARB) generates compression control signals CCNT0-CCNT3 based on the above-mentioned determination results and outputs them to the compression unit CMP(A) and decompression unit DCMP(A), and ends the operation shown in FIG.
[0132] 11, even when data of a compressible data type determined by the compression possibility flag FLG0 and the compression permission flag FLG1 cannot be simultaneously transferred to the bus A, the data can be transferred using the subsequent cycle. That is, even when the bus control unit BCNT(A) receives multiple requests REQ simultaneously, it can transfer the data to each matrix operation unit MOU in one or multiple times according to the compressible data type.
[0133] Fig. 12 shows an example of the operation of the information processing device 200 in Fig. 7. When the accelerator 100 is mounted in the information processing device 200 instead of the accelerator 100A, the operation of the accelerator 100A may be interpreted as the operation of the accelerator 100.
[0134] First, in step S210, CPU 210 transmits a command sequence for causing accelerator 100A to execute a matrix operation. Next, in step S220, CPU 210 waits until it receives a completion notification of the execution of the command sequence from accelerator 100A, and when it receives the completion notification, ends the command sequence transmission process of FIG.
[0135] On the other hand, in step S110, accelerator 100A waits for reception of a command sequence, and when the command sequence is received, executes step S120. In step S120, accelerator 100A executes a command included in the received command sequence. An example of the command is described in FIG.
[0136] Next, in step S130, accelerator 100A determines whether or not execution of all commands included in the received command sequence has been completed. If execution of all commands has been completed, accelerator 100A executes step S140, and if there is still a command that has not been executed, accelerator 100A returns to the operation of step S120. In step S140, accelerator 100A transmits a notification of completion of execution of the command sequence to CPU 210, and ends the command execution process of FIG.
[0137] Fig. 13 shows an example of the operation of the matrix operation unit MOU in Fig. 3. Fig. 13 shows an example of a control method for the accelerator 100A. The operation shown in Fig. 13 is started by the matrix operation unit MOU based on the accelerator 100A receiving a command string from the CPU 210. For example, Fig. 13 shows an example of the command processing executed in step 120 in Fig. 12. Fig. 13 shows an example of the operation when the accelerator 100A receives a load command for data a and c, a preload command for data b, a command to execute a matrix operation, and a store command for the operation result as a command string from the CPU 210.
[0138] First, in step S121, the matrix calculation unit MOU starts the DMAC based on a load command and loads data from the memory MEM into each of the scratch pad memories SPM(A), SPM(B), and SPM(C). Next, in step S122, the matrix calculation unit MOU preloads data b from the scratch pad memory SPM(B) into the systolic array based on a preload command.
[0139] Next, in step S123, the matrix calculation unit MOU inputs data a and c from the scratchpad memories SPM(A) and SPM(C) into the systolic array and executes a matrix calculation. The matrix calculation unit MOU stores the matrix calculation result in the scratchpad memory SPM(C). Next, in step S124, the matrix calculation unit MOU starts the DMAC, stores the matrix calculation result from the scratchpad memory SPM(C) in the memory MEM, and ends the operation shown in FIG. 13.
[0140] Fig. 14 shows an example of the operation of the control unit CNT that controls the matrix operation unit MOU of Fig. 3. Fig. 14 shows an example of a control method for the accelerator 100A. For example, Fig. 14 shows the operation corresponding to step S123 of Fig. 13.
[0141] First, in step S31, the control unit CNT transmits a request REQ requesting data to the bus control units BCNT(A) and BCNT(C). Next, in step S32, if the control unit CNT receives data in response to the request REQ, it executes step S34, and if it does not receive data in response to the request REQ, it executes step S33.
[0142] In step S33, the control unit CNT stalls the execution of the matrix operation by the systolic array, and executes step S31 again. In step S34, the control unit CNT inputs data into the systolic array, and causes the systolic array to execute the matrix operation.
[0143] Next, in step S35, when the control unit CNT has completed the execution of the matrix calculation corresponding to the predetermined number of requests REQ, it ends the operation shown in Fig. 14. When the control unit CNT has not completed the execution of the matrix calculation corresponding to the predetermined number of requests REQ, it executes the operation of step S31 again.
[0144] As described above, this embodiment can also provide the same effects as the embodiment shown in Figures 1 and 2. For example, based on the data type determination unit DTYP determining that FP64 can be compressed, the compression unit CMP compresses FP64 output from the scratch pad memory SPM and simultaneously outputs it to the bus A (or the bus Ci).
[0145] This allows the FP64 compressed data to be transferred to multiple matrix operation units MOU in the same transfer cycle via bus A (or bus Ci), improving the operating rate of the matrix operation units MOU. As a result, the performance of the accelerator 100A can be improved compared to the case where FP64 is transferred in different transfer cycles without being compressed.
[0146] The bus control unit BCNT (arbitration unit ARB) determines whether or not to compress FP64 for each request REQ based on the compression enable flag FLG0 and the compression permission flag FLG1. This allows FP64 to be compressed or uncompressed according to the required accuracy of the matrix calculation by the matrix calculation unit MOU.
[0147] The type determination unit DTYP finds the maximum and minimum values of the exponent part E of 32 FP64 corresponding to one request REQ, and generates a compression feasibility flag FLG0 indicating the data type that can express the maximum and minimum values. As a result, whether FP64 is compressed to FP32, BF16, or FP16, the exponent values of all 32 pieces of data DT can be made the same before and after compression, and erroneous matrix calculation by the matrix calculation unit MOU can be prevented.
[0148] The compression availability flag FLG0 generated by the type determination unit DTYP is stored in the scratchpad memory SPM together with the corresponding 32 FP64s. This allows the scratchpad memory SPM to output the 32 FP64s and the compression availability flag FLG0 in response to a request REQ (address AD), reducing the access frequency of the scratchpad memory SPM and enabling arbitration determination by the arbitration unit ARB.
[0149] The decompression unit DCMP provided corresponding to each matrix operation unit MOU receives a compression control signal CCNT generated by the bus control unit BCNT (arbitration unit ARB) for each request REQ. Therefore, each decompression unit DCMP can generate FP64 corresponding to the original FP64 from the data compressed by the corresponding compression unit CMP and transferred via the bus.
[0150] Even when data of a compressible data type determined by the compression possibility flag FLG0 and the compression permission flag FLG1 cannot be transferred simultaneously to the bus A, the data can be transferred using the subsequent cycle. That is, even when each bus control unit BCNT(A), BCNT(C) receives multiple requests REQ simultaneously, it can transfer data to each matrix operation unit MOU in one or multiple times according to the compressible data type.
[0151] When the number of received requests REQ is one, the FP64 is transferred to the bus as is, so that the FP64 can be transferred from the scratchpad memory SPM to the matrix calculation unit MOU without reducing the accuracy of the FP64. This makes it possible to prevent a reduction in the accuracy of the matrix calculation by the matrix calculation unit MOU.
[0152] The data type determination unit DTYP, scratch pad memory SPM, bus control unit BCNT, and compression unit CMP corresponding to buses A and Ci, respectively, determine whether data can be compressed or not, and based on the determination result, the compressed data can be transferred to the corresponding matrix operation unit MOU.
[0153] Regarding the above embodiment, the following supplementary notes are further disclosed. (Appendix 1) A plurality of computation units for performing computations; a bus provided in common to the plurality of arithmetic units and having a bus width smaller than a bus width capable of simultaneously transferring data to the plurality of arithmetic units; a compression determination unit that determines whether or not the first data is compressed based on a value of an exponent part of the first data to be transferred to each of the plurality of arithmetic units; a compression unit that outputs second data obtained by compressing the first data to the bus when the compression determination unit determines that compression is possible, and outputs the first data to the bus when the compression determination unit determines that compression is impossible. Processing unit. (Appendix 2) a plurality of operation control units each controlling an operation of the plurality of operation units and outputting a data transfer request and a compression permission flag indicating permission of compression; The compression determination unit a determination unit that generates a compression flag indicating whether the first data is compressible; a compression control unit that generates compression information indicating a compression specification based on the compression enable flag and a plurality of the compression enable flags received from the plurality of arithmetic control units, The compression unit compresses the first data based on the compression information. 2. The processor of claim 1. (Appendix 3) the first data is floating point number data, The determination unit generates the compression availability flag according to the magnitude of the exponent part of a plurality of floating-point number data that is an access unit according to the data transfer request. 3. The processor according to claim 2. (Appendix 4) The determination unit generates the compression availability flag indicating a data type capable of expressing a maximum value and a minimum value of the exponent part of the plurality of floating-point number data. 4. The processor of claim 3. (Appendix 5) When a size of the plurality of second data for the plurality of arithmetic units when compressed according to the generated compression information becomes larger than a bus width of the bus, the compression control unit generates compression information for transferring data from the compression unit to the bus in a plurality of transfers regardless of the generated compression information. 5. The processor according to claim 2, (Appendix 6) When the compression control unit receives a single data transfer request from any one of the plurality of operation control units, the compression control unit generates the compression information indicating non-compression regardless of the compression availability flag and the compression permission flag. 5. The processor according to claim 2, (Appendix 7) a memory for storing the first data; the determination unit generates the compression feasibility flag for each of the first data stored in the memory, and stores the generated compression feasibility flag together with the first data in the memory; The compression control unit generates the compression information based on the compression permission flag received together with the data transfer request and the compression permission flag output from the memory together with the first data in response to the data transfer request. 5. The processor according to claim 2, (Appendix 8) a decompression unit provided corresponding to each of the plurality of arithmetic units and configured to decompress compressed data received via the bus based on the compression information; 5. The processor according to claim 2, (Appendix 9) The apparatus includes a plurality of data supply units each including the bus, the compression determination unit, and the compression unit. 5. The processor according to claim 2, (Appendix 10) Each of the plurality of arithmetic units includes a systolic array. 5. The processor according to claim 2, (Appendix 11) 1. A method for controlling an arithmetic processing device having a plurality of arithmetic units that execute arithmetic operations, and a bus that is provided in common to the plurality of arithmetic units and has a bus width smaller than a bus width capable of simultaneously transferring data to the plurality of arithmetic units, comprising: a compression determination unit included in the arithmetic processing device determines whether or not the first data can be compressed based on values of exponent parts of the first data to be transferred to each of the plurality of arithmetic units; A compression unit included in the arithmetic processing device outputs second data obtained by compressing the first data to the bus when the compression determination unit determines that compression is possible, and outputs the first data to the bus when the compression determination unit determines that compression is impossible. A method for controlling a processor.
[0154] The features and advantages of the embodiments will be apparent from the above detailed description. It is intended that the claims cover the features and advantages of the embodiments as described above without departing from the spirit and scope of the claims. In addition, any improvements and modifications can be easily made by a person having ordinary skill in the art. Therefore, it is not intended to limit the scope of the inventive embodiments to the above, and appropriate improvements and equivalents within the scope of the embodiments disclosed can be used. [Explanation of symbols]
[0155] 10 Judgment section 20 Memory 30 Compression control section 40 Compression section 50a, 50b extension part 60a, 60b Calculation unit 70a, 70b Calculation control unit 100, 100A Accelerator 200 Information processing device 210 CPU 220 Memory 230 Auxiliary storage 240 Communication Interface 250 Input / Output Interface 300 Recording media A Bus AD Address ARB Mediation Department B Bus BCNT Bus Control Unit C-Bus CCNT Compression control signal CMP Compression CNT control section Co Bus DCMP extension DTYP Data type determination section FLG0 Compression flag FLG1 Compression flag MOU Matrix Operation Unit REQ Request SPM Scratch Pad Memory X column direction Y row direction
Claims
1. A plurality of computation units for performing computations; a bus provided in common to the plurality of arithmetic units and having a bus width smaller than a bus width capable of simultaneously transferring data to the plurality of arithmetic units; a compression determination unit that determines whether or not the first data is compressed based on a value of an exponent part of the first data to be transferred to each of the plurality of arithmetic units; a compression unit that outputs second data obtained by compressing the first data to the bus when the compression determination unit determines that compression is possible, and outputs the first data to the bus when the compression determination unit determines that compression is impossible. Processing unit.
2. a plurality of operation control units each controlling an operation of the plurality of operation units and outputting a data transfer request and a compression permission flag indicating permission of compression; The compression determination unit a determination unit that generates a compression flag indicating whether the first data is compressible; a compression control unit that generates compression information indicating a compression specification based on the compression enable flag and a plurality of the compression enable flags received from the plurality of arithmetic control units, The compression unit compresses the first data based on the compression information. The processor according to claim 1 .
3. the first data is floating point number data, The determination unit generates the compression availability flag according to the magnitude of the exponent part of a plurality of floating-point number data that is an access unit according to the data transfer request. The processor according to claim 2 .
4. The determination unit generates the compression availability flag indicating a data type capable of expressing a maximum value and a minimum value of the exponent part of the plurality of floating-point number data. The processor according to claim 3 .
5. When a size of the plurality of first data for the plurality of arithmetic units to be compressed by the generated compression information is larger than a bus width of the bus, the compression control unit generates the compression information for transferring the data from the compression unit to the bus in a plurality of transfers regardless of the generated compression information. The processor according to any one of claims 2 to 4.
6. When the compression control unit receives a single data transfer request from any one of the plurality of operation control units, the compression control unit generates the compression information indicating non-compression regardless of the compression availability flag and the compression permission flag. The processor according to any one of claims 2 to 4.
7. a memory for storing the first data; the determination unit generates the compression feasibility flag for each of the first data stored in the memory, and stores the generated compression feasibility flag together with the first data in the memory; The compression control unit generates the compression information based on the compression permission flag received together with the data transfer request and the compression permission flag output from the memory together with the first data in response to the data transfer request. The processor according to any one of claims 2 to 4.
8. a decompression unit provided corresponding to each of the plurality of arithmetic units and configured to decompress compressed data received via the bus based on the compression information; The processor according to any one of claims 2 to 4.
9. The apparatus includes a plurality of data supply units each including the bus, the compression determination unit, and the compression unit. The processor according to any one of claims 2 to 4.
10. 1. A method for controlling an arithmetic processing device having a plurality of arithmetic units that execute arithmetic operations, and a bus that is provided in common to the plurality of arithmetic units and has a bus width smaller than a bus width capable of simultaneously transferring data to the plurality of arithmetic units, comprising: a compression determination unit included in the arithmetic processing device determines whether or not the first data can be compressed based on values of exponent parts of the first data to be transferred to each of the plurality of arithmetic units; A compression unit included in the arithmetic processing device outputs second data obtained by compressing the first data to the bus when the compression determination unit determines that compression is possible, and outputs the first data to the bus when the compression determination unit determines that compression is impossible. A method for controlling a processor.
Citation Information
Patent Citations
Systolic Decomposition within a Matrix Accelerator Architecture
JP2022523760A
