Calculation device and data transfer method
A multi-dimensional processor arrangement in arithmetic devices addresses the inefficiencies in data movement within conventional mesh structures, improving calculation speed and power efficiency by enabling data transfer between processors in additional dimensions beyond the traditional X and Y axes.
Patent Information
- Application Number
- PCT/JP2024/005102
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-07
- Filing Date
- 2024-02-14
- Publication Date
- 2024-09-12
AI Technical Summary
Conventional arithmetic devices with a mesh structure of processors face inefficiencies in data movement, particularly for aggregation processing like Sum and Max processing, which hinders calculation speed and increases power consumption due to the need for multiple data transfers between processors.
The introduction of a multi-dimensional processor arrangement, allowing data input/output between processors in additional dimensions beyond the traditional X and Y directions, enabling faster data movement by reducing the number of processors required and optimizing wiring lengths.
This configuration significantly reduces the number of data movements needed, enhancing calculation speed and reducing power consumption by allowing data to be transferred faster and more efficiently between processors.
Smart Images

Figure JP2024005102_12092024_PF_FP
Abstract
Description
Arithmetic device and data movement method CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application is based on Japanese Application No. 2023-34879, filed on March 7, 2023, the contents of which are incorporated herein by reference.
[0002] The present disclosure relates to a computing device and a data movement method.
[0003] A computing device (accelerator) has been developed that is configured with a plurality of PEs (Processing Elements), which are processors arranged in a two-dimensional mesh structure (Patent Document 1).
[0004] In such an arithmetic device, data input / output between PEs is performed, for example, by broadcasting, which allows data input / output between an external memory and all PEs, or by data input / output between adjacent PEs.
[0005] Fig. 11 is a schematic diagram of a conventional accelerator 100 including a plurality of PEs 12 arranged in a mesh structure on the XY plane. In the example of Fig. 11, although some of the PEs 12 in the Y direction are omitted, the PEs 12 are arranged two-dimensionally, with eight PEs in each of the X and Y directions (eight rows and eight columns), for a total of 64 PEs 12. Fig. 12 is a diagram showing the PEs 12 shown in Fig. 11 in XY coordinates. The three-digit numbers 000 to 707 shown in Fig. 12 correspond to the subscripts of the PEs 12 shown in Fig. 11.
[0006] 11 , dashed arrows indicate data input / output by broadcast between the external memory 14 and the PEs 12. Solid arrows indicate data input / output between adjacent PEs 12. In an actual accelerator 100, wiring similar to the arrows is provided between the external memory 14 and the PEs 12, and between the PEs 12, to enable data input / output.
[0007] 11, only some of the arrows indicating data input / output are shown, and data input / output is similarly performed between the external memory 14 and the PEs 12, and between the PEs 12, where no arrow indicates data input / output. Also, although the rectangles indicating the PEs 12 differ in the presence or absence of hatching and the type of hatching, all the PEs 12 have the same function.
[0008] U.S. Patent Application Publication No. 2020 / 0225884
[0009] In a conventional accelerator 100 having a plurality of PEs 12 arranged in a mesh structure as shown in Fig. 11, data can only be moved one PE 12 at a time. Therefore, it takes time to move data between PEs 12 for performing aggregation processing such as sum processing or max processing. For example, in Fig. 11, 007 From the leftmost PE12 001 When moving data to the rightmost PE12 407 From the leftmost PE12 400 When data is moved to the DDR3, seven moves are required, as shown by the broken lines. A large number of data moves hinders improvements in calculation speed and reductions in power consumption.
[0010] The present disclosure aims to provide a computing device and a data movement method that can move data between processors faster.
[0011] The present disclosure employs the following technical solutions to solve the above problems. The reference symbols in parentheses in the claims and in this section are merely examples showing the correspondence with the specific solutions described in the embodiments below as one aspect, and do not limit the technical scope of the present disclosure.
[0012] A computing device according to one aspect of the present disclosure is a computing device comprising a plurality of processors, the processors being represented in a coordinate system including two dimensions indicating the X and Y directions as well as two or more other dimensions indicating other directions, and the processors being capable of inputting and outputting data between adjacent processors in the X and Y directions, and also capable of inputting and outputting data between adjacent processors in the other dimensions.
[0013] In this configuration, processors can input and output data to and from processors that are not adjacent in the X and Y directions. This reduces the number of processors required to move data, making this configuration faster than conventional methods for moving data between processors.
[0014] In the above-described arithmetic device, four or more of the processors, each of which is of a different dimension, may be virtually grouped, and the processors in the group may be capable of inputting and outputting data between at least two of the processors, and may be capable of inputting and outputting data between the processors included in other of the groups and adjacent to each other in the X and Y directions.
[0015] In the above-described arithmetic device, the processor may be capable of inputting and outputting data to and from another processor located in a direction diagonal to at least one of the X direction, the Y direction, and the other direction.
[0016] The above-described arithmetic device may include a plurality of external memories that store data to be calculated by the processor and transfer the data to the processor, and the plurality of external memories may store data in a coordinate system that includes two dimensions indicating the X and Y directions as well as two or more other dimensions indicating other directions, allowing input and output of data to and from the processor at the same coordinates.
[0017] In the above-described arithmetic device, the plurality of processors may be arranged so that the total length of wiring for inputting and outputting data between the processors is minimized.
[0018] In the above-described arithmetic device, together with the processing data to be processed this time, duplicate data, which is data adjacent to the processing data and to be used in the next calculation, is transferred from an external memory, and the processor may be capable of inputting and outputting the duplicate data together with the processing data between adjacent processors in the X direction and Y direction, and may be capable of inputting and outputting the duplicate data together with the processing data between adjacent processors in the other dimension.
[0019] In the above-described computing device, the processor may be capable of performing different processing or processing at different timing for each of the other dimensions.
[0020] A data movement method according to one aspect of the present disclosure is a method for moving data between a plurality of processors constituting a computing device, in which the processors are represented by a coordinate system including, in addition to two dimensions indicating the X and Y directions, two or more other dimensions indicating other directions, and the processors input and output data with adjacent processors in the X and Y directions, and input and output data with adjacent processors in the other dimensions, perform operations on the input data, and output the operation results.
[0021] The present disclosure allows for faster movement of data between processors.
[0022] The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description taken in conjunction with the accompanying drawings. 1 is a schematic diagram showing the arrangement of PEs included in the accelerator of the first embodiment, FIG. 2 is a schematic diagram showing the coordinates of PEs included in the accelerator of the first embodiment, FIG. 3 is a schematic diagram showing the coordinates of PEs included in the accelerator of the second embodiment, FIG. 4 is a schematic diagram showing the arrangement of PEs included in the accelerator of the second embodiment, FIG. 5 is a schematic diagram showing the coordinates of PEs included in the accelerator of the third embodiment, FIG. 6 is a schematic diagram of data to be calculated in the fourth embodiment, FIG. 7 is a diagram showing coordinates indicating data of divided regions assigned to PEs in the conventional embodiment, FIG. 8 is a diagram showing coordinates indicating data of divided regions assigned to PEs in the fourth embodiment, FIG. 9 is a diagram showing a calculation formula indicating data reading for each PE in the fourth embodiment, FIG. 10 is a diagram showing a calculation formula indicating data reading for each PE in the modified fourth embodiment, FIG. 11 is a schematic diagram showing the arrangement of PEs included in the conventional accelerator, and FIG. 12 is a schematic diagram showing coordinates of PEs included in the conventional accelerator.
[0023] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. Note that the embodiments described below are examples of how the present disclosure may be implemented, and the present disclosure is not limited to the specific configurations described below. When implementing the present disclosure, specific configurations according to the embodiments may be appropriately adopted.
[0024] 1 is a schematic diagram of an accelerator 10, which is a computing device according to this embodiment. The accelerator 10 according to this embodiment includes a plurality of PEs 12, which are processors, and performs computations using a neural network, for example. Data to be computed by the PEs 12 is stored in an external memory 14 and transferred from the external memory 14 to the PEs 12. The external memory 14 also stores parameters, such as weighting coefficients, used in the computations using the neural network, and transfers these parameters to the PEs 12.
[0025] The accelerator 10 shown in FIG. 1 includes, for example, 64 PEs 12, although some of the PEs are not shown. 000 ~12 007 , PE12 100 ~12 107 , PE12 200 ~12 207 , PE12 300 ~12 307 , PE12 400 ~12 407 , PE12 500 ~12 507 , PE12 600 ~12 607 , PE12 700 ~12 707 It is equipped with:
[0026] In FIG. 1, the dashed arrows indicate input and output of data between the external memory 14 and the PEs 12 by broadcast, and the solid arrows indicate input and output of data between adjacent PEs 12.
[0027] The hatched rectangles and symbols representing the PEs 12 in Fig. 1 correspond to the PEs 12 in Fig. 11. That is, between PEs 12 with the same hatching and adjacent in the X and Y directions, data input / output is possible as indicated by solid arrows. Note that PEs 12 that can input / output data are PEs 12 that are connected to each other by wiring.
[0028] Furthermore, the PEs 12 of this embodiment are capable of inputting and outputting data between adjacent PEs 12 in the X and Y directions, and also between two or more other PEs 12 that are not adjacent in the X and Y directions. In the example of Figure 1, the directions of the other PEs 12 relative to the PE 12 are called the Z direction and the W direction. The Z direction and the W direction are not orthogonal to the X direction and the Y direction on the XY plane, but intersect with the X direction and the Y direction.
[0029] For example, PE12 101 In contrast, PE12 102 , 12 100 is the PE12 adjacent in the X direction, and PE12 001 , 12 201 is the PE 12 adjacent in the Y direction.
[0030] Also, PE12 101 In contrast, PE12 105 and PE12 501 is another PE 12. In the example of FIG. 101 and PE12 105 Between PE12 101 and PE12 501 Data can be input and output between the PE12 and the PE12. 101 PE12 for 105 The direction is called the Z direction, and PE12 101 PE12 for 501 The direction is called the W direction.
[0031] In addition, PE12 105 PE12 adjacent in the X and Y directions 104 , 12 106 , 12 005 , 12 205 Together with PE12 105 PE12 in the Z direction, which is another PE12101 and PE12 in the W direction. 505 Inputs and outputs data between the device and the server.
[0032] Similarly, PE12 501 PE12 adjacent in the X and Y directions 500 , 12 502 , 12 401 , 12 601 Together with PE12 501 PE12 in the Z direction, which is another PE12 505 and PE12 in the W direction. 101 Inputs and outputs data between the device and the server.
[0033] Also, PE12 505 PE12 adjacent in the X and Y directions 504 , 12 506 , 12 405 , 12 605 Together with PE12 505 PE12 in the Z direction, which is another PE12 501 and PE12 in the W direction. 105 Inputs and outputs data between the device and the server.
[0034] In this embodiment, the PE 12 in the X direction is referred to as the first-dimensional element, the PE 12 in the Y direction is referred to as the second-dimensional element, the PE 12 in the Z direction is referred to as the third-dimensional element, and the PE 12 in the W direction is referred to as the fourth-dimensional element. 101 Based on this, PE12 100 , 12 102 , is the PE12 in the first dimension (X direction), and PE12 001 , 12 201 is PE12 in the second dimension (Y direction), and PE12 105 is PE12 in the third dimension (Z direction), and PE12 501 is PE12 in the fourth dimension (W direction).
[0035] In the example of Figure 1, four PEs 12 are arranged in each of the X and Y directions, and two PEs 12 are arranged in each of the Z and W directions. In the following description, this arrangement will be expressed in terms of the number of elements as 4D(X, Y, Z, W) = (4, 4, 2, 2). In this way, the arrangement of the PEs 12 in Figure 1 will be described in four dimensions (4D), namely, the X, Y, Z, and W directions.
[0036] 2, the PE 12 is expressed in xyzw coordinates. The three-digit numbers shown in FIG. 2 correspond to the three-digit subscripts of the PE 12 in FIG. 1. x indicates the coordinate in the X direction, y indicates the coordinate in the Y direction, z indicates the coordinate in the Z direction, and w indicates the coordinate in the W direction. That is, in this embodiment, the x coordinate indicating the position in the X direction is expressed as 0 to 7, the y coordinate indicating the position in the Y direction is expressed as 0 to 7, the z coordinate indicating the position in the Z direction is expressed as 0, 1, and the w coordinate indicating the position in the W direction is expressed as 0, 1.
[0037] In this way, the PE 12 is represented by a coordinate system including two dimensions indicating the X direction and the Y direction, as well as two or more other dimensions indicating other directions (Z direction and W direction). The PE 12 is capable of inputting and outputting data to and from adjacent PEs 12 in the X direction and Y direction, and is also capable of inputting and outputting data to and from adjacent PEs 12 in the other dimensions (Z direction and W direction).
[0038] In addition, the PEs 12 of this embodiment can be considered as four or more PEs 12 that are not adjacent to each other in the X and Y directions virtually constituting one group 16. In this embodiment, four PEs 12 constitute a group 16, and for example, the PEs 12 surrounded by the two-dot chain line in FIG. 000 , PE12 004 , PE12 400 , PE12 404 A group 16 is formed by these PEs. 101 , PE12 105 , PE12 501 , PE12 505 This forms one group 16.
[0039] Each PE 12 in a group 16 is capable of inputting and outputting data between at least two other PEs 12, and is also capable of inputting and outputting data between PEs 12 in other groups 16 that are adjacent to each other in the X and Y directions.
[0040] As an example, the input and output of data based on group 16 is 101 , PE12 105 , PE12 501 , PE12 505 This will be explained using group 16, which consists of:
[0041] PE12 101 PE12 in group 16 105 , 12 501 and inputs and outputs data between the PE 12 included in the other group 16 and the adjacent PE 12 100 , 12 102 , 12 001 , 12 201 and inputs and outputs data.
[0042] PE12 105 other PEs 12 in group 16 101 , 12 505 and inputs and outputs data between the PE 12 included in the other group 16 and the adjacent PE 12 104 , 12 106 , 12 005 , 12 205 Inputs and outputs data between the device and the server.
[0043] PE12 501 other PEs 12 in group 16 101 , 12 505 and inputs and outputs data between the PE 12 included in the other group 16 and the adjacent PE 12 500 , 12 502 , 12 401 , 12 601 Inputs and outputs data between the device and the server.
[0044] PE12 505 other PEs 12 in group 16 105 , 12 501 and inputs and outputs data between the PE 12 included in the other group 16 and the adjacent PE 12 504 , 12 506, 12 405 , 12 605 Inputs and outputs data between the device and the server.
[0045] Group 16 will be described with reference to the coordinates shown in FIG. 2 . As described above, group 16 is made up of four PEs 12. This group 16 is made up of PEs 12 with the same x and y coordinates corresponding to each combination of z and w coordinates, i.e., for each of the coordinates (z, w) = (0, 0), (0, 1), (1, 0), and (1, 1). In other words, when x coordinates = 4, 5, 6, 7 where z coordinate = 1 are set to 0, 1, 2, 3, and y coordinates = 4, 5, 6, 7 where w coordinate = 1 are set to 0, 1, 2, 3, PEs 12 with the same x and y coordinates constitute one group 16.
[0046] For example, PE12 shown in FIG. 101 , PE12 105 , PE12 501 , PE12 505 The coordinates of group 16 consisting of the above are expressed as (1,1,0,0), (5(1),1,1,0), (1,5(1),0,1), and (5(1),5(1),1,1).
[0047] The PEs 12 are capable of inputting and outputting data between adjacent PEs 12 of the same dimension. 101 is PE12 100 , PE12 102 , PE12 001 , PE12 201 As mentioned above, these PEs 12 are not in the same group 16.
[0048] Furthermore, the PE 12 can input and output data to and from the PE 12 in the adjacent dimension and at the same x and y coordinates. 101 is PE12 105 and PE12 501 On the other hand, PE12 101 and PE12 505 The coordinates of PE12 are (1,1,0,1) and (5(1),5(1),1,1), and they are not adjacent in the XY direction and the ZW direction. 101 and PE12505 In FIG. 2, the PE 12 does not allow data input / output. 101 The PEs 12 that are capable of inputting and outputting data are indicated by hatching.
[0049] In this embodiment, not only is it possible to input and output data between PEs 12 whose coordinates are adjacent in the XY direction or ZW direction, but PEs 12 may also be able to input and output data between PEs 12 that are located diagonally with respect to at least one of the X direction, Y direction, and other directions (Z direction, W direction).
[0050] For example, PE12 101 Based on this, PE12 shown by the arrow in FIG. 000 , 12 002 , 12 200 , 12 202 is PE12 in the diagonal direction in the XY direction, and PE12 101 The PE 12 may be capable of inputting and outputting data to and from the PE 12. 101 is a diagonal data movement, and the other dimension is PE12. 505 and data input / output may be possible.
[0051] 1 is an example in which the PEs 12 are arranged so as to minimize the total length of the wiring for inputting and outputting data between the PEs 12. Therefore, for example, the PEs 12 may be arranged in parallel in the X and Y directions as shown in FIG.
[0052] As described above, the PEs 12 included in the accelerator 10 of this embodiment are capable of inputting and outputting data to and from other PEs 12 that are not adjacent in the XY direction. That is, in the conventional accelerator 100, data input and output was not possible between PEs 12 that were not adjacent in the XY direction. However, in this embodiment, by using a new concept of the ZW direction (three and four dimensions) that is different from the XY directions (one and two dimensions), data input and output is possible between other PEs 12 that are not adjacent in the XY direction. Therefore, in the accelerator 10 of this embodiment, data can be moved between PEs 12 faster than in the past.
[0053] Specifically, in FIG. 007 From PE12 000 When data is moved to 007 →PE12 006 →PE12 005 →PE12 004 →PE12 000 In this way, data is moved four times. On the other hand, in the conventional method, as explained with reference to FIG. 007 From PE12 000 In this way, the accelerator 10 of this embodiment moves data faster than the conventional accelerator. 407 From PE12 400 In the case of moving data to the new location, seven moves were required in the past, but in this embodiment, only four moves are required.
[0054] In the accelerator 10 of this embodiment, where the number of elements is 4D(X, Y, Z, W) = (4, 4, 2, 2), if the number of directions in which data can be moved simultaneously is four, the Sum operation can be performed with eight data movements. On the other hand, in the conventional accelerator 100 shown in FIG. 11, the Sum operation under the same conditions requires 16 data movements.
[0055] Furthermore, in the accelerator 10 of this embodiment, if diagonal data movement is enabled and simultaneous movement is performed in four directions, the Sum process can be performed with six data movements. In this example, data movement in diagonal directions and data movement to adjacent PEs 12 in the vertical, horizontal, and vertical directions are alternately performed. On the other hand, the conventional accelerator 100 shown in FIG. 11 requires nine data movements for the Sum process under the same conditions.
[0056] Furthermore, if data movement in a diagonal direction and data movement to adjacent PEs 12 in the vertical and horizontal directions are simultaneously enabled, the accelerator 10 of this embodiment can perform the Sum processing with four data movements. On the other hand, the conventional accelerator 100 shown in FIG. 11 requires eight data movements for the Sum processing under the same conditions.
[0057] Second Embodiment In the first embodiment, a configuration in which the number of elements 4D(X, Y, Z, W) = (4, 4, 2, 2) was described. In the present embodiment, a configuration in which the number of elements 4D(X, Y, Z, W) = (4, 4, 4, 4) will be described.
[0058] 3 is a schematic diagram showing the coordinates of the PEs 12 included in the accelerator 10 of this embodiment. When the number of elements is 4D (X, Y, Z, W) = (4, 4, 4, 4), the accelerator 10 is configured with a total of 256 PEs 12. One group 16 is configured with 16 PEs 12. FIG. 4 is a schematic diagram showing an example in which the PEs 12 of this embodiment are arranged so as to minimize the total length of wiring. A group 16 is configured with the 16 PEs shown in FIG. 4.
[0059] In the coordinate system of FIG. 505 The coordinates where data can be input / output are shown in black based on the coordinates (x, y, z, w) = (1, 1, 1, 1). 505 The PEs 12 connected to the input / output destination of data are the PEs 12 of adjacent elements in each dimension, so they are (0,1,1,1), (2,1,1,1), (1,0,1,1), (1,2,1,1), (1,1,0,1), (1,1,2,1), (1,1,1,0), (1,1,1,2), (1,1,1,0), and (1,1,1,2).
[0060] Furthermore, if data can be moved diagonally in the X direction (one dimension) and the Y direction (two dimensions), PE12 505 The PEs 12 to which the PE 12 is connected also include (0,0,1,1), (2,0,1,1), (0,2,1,1), and (2,2,1,1).
[0061] Furthermore, if data can be moved diagonally in the Z direction (three dimensions) and the W direction (four dimensions), PE12 505 The PEs 12 connected to include (1,1,0,0), (1,1,2,0), (1,1,0,2), and (1,1,2,2).
[0062] Third Embodiment In this embodiment, a configuration will be described in which the number of elements is 6D (X, Y, Z, W, U, V) = (4, 4, 2, 2, 2, 2). 6D includes the concepts of the U and V directions in addition to the X, Y, Z, and W directions, and represents the coordinates of the PEs 12 in six dimensions. In this way, when the number of PEs 12 included in the accelerator 10 is increased or when it is desired to increase the speed of data movement between the PEs 12, the number of elements in each dimension or the number of dimensions can be increased, as in the second and third embodiments. For example, the number of dimensions may be increased to 8D or 10D.
[0063] Furthermore, when increasing the dimension, if the number of elements in the odd-numbered dimension differs greatly from the number of elements in the even-numbered dimension, the dimension may be divided into only the dimension with the larger number of elements. For example, when increasing the dimension from 4D, the dimension is increased to 6D, 8D, and so on. In this case, the number of elements in the odd-numbered dimension may be small, and the number of elements in 5D or 7D may be 1. In such a case, a dimension with 1 element may not be set, and the dimension may be divided, for example, so that 6D is divided into 5D, and 8D is divided into 6D.
[0064] 5 is a schematic diagram showing the coordinates of the PEs 12 included in the accelerator 10 of this embodiment. When the number of elements is 6D (X, Y, Z, W, U, V) = (4, 4, 2, 2, 2, 2), the accelerator 10 is configured with a total of 256 PEs 12. One group 16 is configured with 16 PEs 12.
[0065] In the coordinate system of FIG. 5, PE12 1313 The coordinates where data can be input / output are shown in black based on the coordinates (X, Y, Z, W, U, V) = (1, 1, 1, 1, 1, 1) when there is no diagonal data movement. 1313 The PEs 12 connected to, i.e., the PEs 12 to which data is input and output, are the PEs 12 of adjacent elements in each dimension, so they are (0,1,1,1,1,1,1), (2,1,1,1,1,1,1), (1,0,1,1,1,1), (1,2,1,1,1,1), (1,1,0,1,1,1), (1,1,1,0,1,1), (1,1,1,1,0,1), (1,1,1,1,1,0,1).
[0066] Furthermore, if data can be moved diagonally in the X direction (one dimension) and the Y direction (two dimensions), PE12 1313 The PEs 12 connected to include (0,0,1,1,1,1), (2,0,1,1,1,1), (0,2,1,1,1,1), and (2,2,1,1,1,1).
[0067] Furthermore, if data can be moved diagonally in the Z direction (three dimensions) and the W direction (four dimensions), PE12 1313 The PEs 12 connected to include (1, 1, 0, 0, 1, 1).
[0068] Furthermore, if data movement in diagonal directions in the U direction (five dimensions) and V direction (four dimensions) is also possible, PE12 1313 The PEs 12 connected to include (1, 1, 1, 1, 0, 0).
[0069] Fourth Embodiment In this embodiment, a form will be described in which overlapping data is used in a calculation by a neural network. The overlapping data is data that is the target of the current calculation (referred to as "processing data" in this embodiment) and is adjacent to the processing data and is used in the next calculation.
[0070] 6 is a schematic diagram of a data area 20 that is the target of operations in the accelerator 10 of this embodiment. The data area 20 is divided into process data areas 22_1 to 22_8 numbered 1 to 8, and operations are performed by the accelerator 10 for each of these areas. Note that the order of operations, i.e., the order in which the data is read into the accelerator 10, is, as an example, the order of the numbers 1 to 8 assigned to the process data areas 22.
[0071] Then, for each processing data area 22, calculations are performed using some of the data (overlapping data) contained in other adjacent processing data areas 22, as indicated by dashed lines, etc. For example, for processing data area 22_1, the data contained in other processing data areas 22_2, 22_5, and 22_6 surrounded by dashed lines become overlapping data. Also, for processing data area 22_2, the data contained in other processing data areas 22_1, 22_3, 22_5, 22_6, and 22_7 surrounded by dashed-dotted lines become overlapping data. Also, for processing data area 22_5, the data contained in other processing data areas 22_1, 22_2, and 22_6 surrounded by dashed-dotted lines become overlapping data.
[0072] That is, the accelerator 10 reads data from the external memory 14 for each of the read data areas 24_1, 24_2, and 24_5 indicated by dashed lines, dashed lines, and dashed two-dot lines, and performs calculations using a neural network while taking into account overlapping data. Note that in Fig. 6, the read data areas 24_3, 24_4, and 24_6 to 24_8 corresponding to the process data areas 22_3, 22_4, and 22_6 to 22_8 are not shown.
[0073] 7 shows coordinates indicating data in the processing data area 22_1 allocated to the conventional PE 12. The conventional PE 12 is the PE 12 arranged two-dimensionally (2D) as shown in FIGS.
[0074] The data areas with hatched coordinates in Figure 7 are overlapping data, and are data contained in other processing data areas 22 adjacent to the processing data area 22_1. In other words, data that is not hatched is processing data that is the subject of calculation by the neural network. In Figure 7, coordinates with no numerical values indicate that there is no data to be calculated, and for convenience, these coordinates are given a minus sign. Note that overlapping data is read from the external memory 14 into a dedicated PE 12 (Border Core, hereinafter also referred to as "BC"). In other words, hatched coordinates indicate BC.
[0075] FIG. 8 shows coordinates indicating data in the processing data area 22_1 allocated to the PE 12 in this embodiment. The numerical values of each coordinate correspond to the numerical values of the coordinates in FIG. 7. In the example of FIG. 8, the number of elements is 4D (X, Y, Z, W) = (4, 4, 2, 2), and data is moved between the PEs 12 in the same manner as in the above embodiment. Note that in this embodiment, the processing data area 22_1 to be operated on is divided into four areas in order to represent it in 4D. Therefore, duplicate data corresponding to each of the divided processing data areas 22_1 is required, and therefore more BCs are required than when the PEs 12 are arranged in 2D.
[0076] The PE 12 is capable of inputting and outputting overlapping data together with processing data between adjacent PEs 12 in the X and Y directions, and is also capable of inputting and outputting overlapping data together with processing data between adjacent PEs 12 in other dimensions (the Z and W directions). This allows the accelerator 10 of this embodiment to move data between PEs 12 faster, even when overlapping data is used in neural network calculations. Note that, because the overlapping data area is primarily an overlap in the X and Y directions, if there is little need to input and output overlapping data in the ZW direction, input and output of overlapping data in the ZW direction is not necessary.
[0077] Fig. 9 is an example of a calculation formula showing data reading for each PE 12. Tx and Ty included in the calculation formula in Fig. 9 are set as Tx = 0 and Ty = 0 for the read data area 24_1 indicated by the dashed line in Fig. 6, as Tx = 1 and Ty = 0 for the read data area 24_2 indicated by the dashed line, and as Tx = 0 and Ty = 1 for the read data area 24_5 indicated by the dashed line.
[0078] (Variation of the Fourth Embodiment) The accelerator 10 of this variation does not include a BC that reads duplicate data, and the PEs 12 read and store necessary duplicate data along with the processing data. This eliminates the need for a BC in the accelerator 10. In this case, the processing data and duplicate data are sent from the external memory 14 to all the PEs 12 by, for example, broadcast burst transfer, and the PEs 12 obtain the data at their own processing timing.
[0079] Fig. 10 is an example of a calculation formula showing data reading for each PE 12. "a" included in Fig. 10 indicates the width of one side of the overlapping data, and is set to a value of 1 or more.
[0080] Fifth Embodiment Hereinafter, processing of the external memory 14 and calculation processing of the PE 12 that can be implemented in conjunction with the above-described embodiments will be described.
[0081] (Configuration of External Memory) The number of dimensions of the external memory 14 may be increased so that different data can be transferred simultaneously in different dimensions. That is, similar to the accelerator 10, the external memory 14 stores data in a coordinate system including two dimensions indicating the X and Y directions, as well as two or more other dimensions indicating other directions, and data can be input / output to / from the PEs 12 at the same coordinates.
[0082] The accelerator 10 may also include multiple external memories 14. The multiple external memories 14 store data in a coordinate system including three or more dimensions, and are capable of inputting and outputting data between PEs 12 at the same coordinates. For example, a specific external memory 14 accesses a PE 12 corresponding to the first element of a third or fourth dimension to input and output data. Meanwhile, another external memory 14 accesses a PE 12 corresponding to an element different from the first element of the third or fourth dimension to input and output data. This allows data to be input and output simultaneously between the multiple external memories 14 and the multiple PEs 12, thereby enabling the accelerator 10 to efficiently input and output data between the external memories 14 and the PEs 12.
[0083] In this case, for example, when the numbers (coordinates) of elements in the third dimension and beyond are different between the external memory 14 and the PE 12 and the PE 12 has more elements, different data may be transferred to the PE 12. Also, when the coordinates of the data to be transferred are the same between the external memory 14 and the PE 12, switching is possible so that external data with the same coordinates can be transferred to all the PEs 12.
[0084] (Specifying a range of PEs 12 to execute different processes) Basically, the PEs 12 are capable of executing different processes. Therefore, a range of PEs 12 to execute the same or different prepared processes may be specified, or if multiple external memories 14 are provided, the external memories 14 to be used may be specified. Furthermore, since the timing or processing time may differ depending on the process, it may be possible to request the PEs 12 to execute the process at different timings. In other words, the PEs 12 are capable of executing different processes or processes at different timings for each higher dimension, such as three dimensions or four dimensions. This allows the accelerator 10 to perform processes efficiently.
[0085] Furthermore, when all PEs 12 are operated with the same program, if the amount of data is large, the calculation speed can be increased by increasing the number of PEs 12 or the number of dimensions, but if the amount of data is small, even if the number of dimensions is increased, some PEs 12 will not perform calculations, etc. Therefore, when the amount of data is small and multiple pieces of data exist, the range of PEs 12 is specified so that different programs can be operated, and the PEs 12 are operated efficiently.
[0086] For example, in an accelerator 10 that processes data with the number of elements 4D(X, Y, Z, W) = (8, 8, 2, 2), the fourth dimension (W) is divided into two accelerators 10 that process data with (8, 8, 2, 1), and different programs are run on the PEs 12 in the divided range.
[0087] Similarly, in an accelerator 10 that processes data with 4 elements D(X, Y, Z, W) = (8, 8, 2, 2), if there are two pieces of data with a vertical width of only 4 and you want to process each piece with a different program, you can divide the second dimension (Y) as (8, 4, 2, 2) and run each program simultaneously on the PEs 12 in the divided range. In this case, although there are eight PEs 12 in the second dimension, the program is constructed so that the 5th to 8th PEs 12 and onwards virtually operate as the 1st to 4th PEs 12.
[0088] Furthermore, multiple external memories 14 may be provided so that different programs implemented in the PE 12 can simultaneously transfer data. In this case, the range of data transfer between the external memories 14 and the PE 12 or from a given PE 12 to another PE 12 may be within a range determined by each program. In this case, different external memories 14 may be used for transfers of read and write so that read and write can be performed simultaneously.
[0089] Furthermore, when PE12 is allowed to execute different programs, processing may be performed in a pipelined manner, with a certain group of PEs dedicated to input from external memory 14, other groups of PEs receiving read data and performing arithmetic processing, and other groups of PEs receiving processed data and outputting it to external memory 14.
[0090] Although the present disclosure has been described using the above-mentioned embodiments, the technical scope of the present disclosure is not limited to the scope described in the above-mentioned embodiments. Various modifications or improvements can be made to the above-mentioned embodiments without departing from the gist of the disclosure, and such modifications or improvements are also included in the technical scope of the present disclosure.
Claims
1. A calculation device (10) comprising a plurality of processors (12), wherein the processors are represented in a coordinate system including two dimensions indicating the X and Y directions as well as two or more other dimensions indicating other directions, and the processors are capable of inputting and outputting data between adjacent processors in the X and Y directions, and are also capable of inputting and outputting data between adjacent processors in the other dimensions.
2. The arithmetic device according to claim 1, wherein four or more of the processors, each of which is of a different dimension, are virtually grouped together (16), and the processors in the group are capable of inputting and outputting data between at least two of the processors, and are capable of inputting and outputting data between the processors in the other groups adjacent thereto in the X and Y directions.
3. The arithmetic device according to claim 1 or 2, wherein the processor is capable of inputting and outputting data to and from a processor located diagonally with respect to at least one of the X direction, the Y direction, and the other direction.
4. The arithmetic device according to claim 3, further comprising a plurality of external memories (14) for storing data to be calculated by the processor and for transferring the data to the processor, the plurality of external memories storing data in a coordinate system including two dimensions indicating the X and Y directions as well as two or more other dimensions indicating other directions, and enabling input and output of data to and from the processor at the same coordinates.
5. The arithmetic device according to claim 1 or 2, wherein the plurality of processors are arranged so as to minimize the overall length of wiring for inputting and outputting data between the processors.
6. The arithmetic device according to claim 1 or 2, wherein together with the processing data to be processed this time, duplicate data which is adjacent to the processing data and is to be used in a next calculation is transferred from an external memory, and the processor is capable of inputting and outputting the duplicate data together with the processing data between adjacent processors in the X direction and Y direction, and is also capable of inputting and outputting the duplicate data together with the processing data between adjacent processors in the other dimension.
7. The arithmetic device according to claim 1 or 2, wherein the processor is capable of performing different processing or processing at different timing for each of the other dimensions.
8. A method of moving data between multiple processors constituting an arithmetic device, wherein the processors are represented in a coordinate system including two dimensions indicating the X and Y directions as well as two or more other dimensions indicating other directions, the processors input and output data between adjacent processors in the X and Y directions, input and output data between adjacent processors in the other dimensions, calculate input data, and output the results of the calculation.
Citation Information
Patent Citations
Machine perception and dense algorithm integrated circuit
US20200225884A1
Virtual information processing system
JP1988085846A
Method for scheduling plurality of computing processes including all-to-all (A2A) communication across plurality of nodes (processors) constituting network, program, and parallel computer system
WO2011059090A1
Processor and data path reconstruction method
WO2021182223A1
