DATA PLACEMENT PROGRAM, PROCESSOR, AND DATA PLACEMENT METHOD
The data placement program optimizes data grouping and placement in cache memory to reduce computational time for deep learning operations, achieving substantial speed improvements by minimizing memory access and leveraging sector cache functionality.
Patent Information
- Application Number
- JP2021100602
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-06-17
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-06-17
AI Technical Summary
The computational time for operations involving large data sets in deep learning models, such as CNN folding operations in image recognition, is excessively long due to the enormous number of combinations required in matrix multiplications.
A data placement program that determines the optimal division and placement of data groups in cache memory based on the size of calculation results and cache memory capacity, allowing efficient reuse of data without unnecessary memory access.
Reduces operation time significantly, achieving a speedup of about 1/10 to 1/100 for CNN folding operations by minimizing memory access and leveraging sector cache functionality.
Smart Images

Figure 0007622563000002 
Figure 0007622563000003 
Figure 0007622563000004
Abstract
Description
[Technical field]
[0001] The present invention relates to a data placement technique. [Background technology]
[0002] In recent years, technologies such as image recognition, character recognition, and voice recognition using deep learning have been rapidly developing. In these technologies, in a learning mode, a computer reads big data including a huge amount of data, and mechanically learns the features of the data according to a specific algorithm. Then, in an operational mode, when data to be estimated is input, the computer estimates the similarity or identity between the input data and the learned data.
[0003] The effectiveness, scope of application, and effects of deep learning technologies are extremely large, and the demand for them is increasing in various fields. However, due to the extremely large scale of calculations, the calculation times in learning mode and operational mode are long.
[0004] For example, in a convolutional neural network (CNN), which is a learning model of deep learning often used in image recognition, a convolution operation is performed to apply a filter to pixel data of an image (see, for example, Non-Patent Document 1). The Winograd algorithm is known as an algorithm for speeding up the product-sum operation included in the convolution operation of a CNN (see, for example, Non-Patent Document 2).
[0005] A processing method for efficiently performing convolution calculations using a processor capable of processing SIMD (Single Instruction / Multiple Data) instructions is also known (see, for example, Patent Document 1). An information processing device for speeding up convolution calculations is also known (see, for example, Patent Document 2). [Prior art documents] [Patent documents]
[0006] [Patent Document 1] JP 2019-8421 A [Patent Document 2] Patent Publication No. 2021-5242 [Non-patent literature]
[0007] [Non-Patent Document 1] “Explaining Convolutional Neural Networks (CNN) in an easy-to-understand way”, [online], AI Antenna: Starting Artificial Intelligence (AI) from Scratch, July 12, 2019, [Retrieved April 8, 2021], Internet<URL:https: / / ai-antena.net / ai-cnn> [Non-Patent Document 2] “Various ways to speed up convolutional neural networks”, [online], SmartNews Engineering Blog, June 15, 2017, [Retrieved April 8, 2021], Internet<URL:https: / / developer.smartnews.com / blog / 2017 / 06 / convolution-speed-up / > Summary of the Invention [Problem to be solved by the invention]
[0008] In the convolutional operation of CNN for image recognition, a matrix representing an output image is obtained by multiplying a matrix representing an input image by a matrix representing a filter. However, the number of combinations of matrices representing input images and matrices representing filters becomes enormous, which results in a long calculation time.
[0009] This problem is not limited to the convolution calculation of CNN in image recognition, but occurs in various calculations.
[0010] In one aspect, the present invention aims to reduce the calculation time for a calculation using a plurality of data. [Means for solving the problem]
[0011] In one proposal, the data placement program causes a computer to execute the following processes.
[0012] When performing an operation using a plurality of first data groups and a plurality of second data groups to generate a plurality of operation result data representing an operation result of the operation, the computer determines the number of the first data groups and the number of the second data groups. At this time, the computer determines the number of the first data groups and the number of the second data groups based on the size of one of the plurality of operation result data and the size of the operation result area in the cache memory.
[0013] The operation result area is an area in the cache memory that stores some of the multiple operation result data. The number of first data groups represents the number of first data groups that correspond to some of the operation result data among the multiple first data groups. The number of second data groups represents the number of second data groups that correspond to some of the operation result data among the multiple second data groups.
[0014] The computer arranges the first data groups and the second data groups in the main memory based on the number of the first data groups and the number of the second data groups. Effect of the Invention
[0015] According to one aspect, it is possible to reduce the calculation time for a calculation using a plurality of data. [Brief description of the drawings]
[0016] [Figure 1] FIG. 1 is a diagram illustrating a convolution operation using the Winograd algorithm. [Diagram 2] FIG. 1 is a hardware configuration diagram of a CPU that does not have a sector cache function. [Diagram 3] FIG. 1 is a hardware configuration diagram of a CPU having a sector cache function. [Figure 4] FIG. 2 is a functional configuration diagram of a processor according to the embodiment. [Diagram 5]13 is a flowchart of a data arrangement process. [Figure 6] FIG. 1 is a first hardware configuration diagram of an information processing device. [Figure 7] FIG. 13 is a diagram showing a data group of an input image and a filter. [Figure 8] FIG. 13 is a diagram illustrating a method for determining the number of data groups. [Figure 9] FIG. 1 is a diagram showing a method for arranging N data groups. [Figure 10] FIG. 13 is a diagram showing a method for arranging K data groups. [Figure 11A] FIG. 13 is a diagram (part 1) showing a calculation process using data of groups P1 and Q1. [Figure 11B] FIG. 2 is a diagram (part 2) showing a calculation process using data of groups P1 and Q1. [Figure 11C] FIG. 11 is a diagram (part 3) showing a calculation process using data of groups P1 and Q1. [Figure 11D] FIG. 4 shows a fourth diagram illustrating a calculation process using data of groups P1 and Q1. [Figure 11E] FIG. 5 is a diagram (part 5) showing a calculation process using data of groups P1 and Q1. [Figure 11F] FIG. 6 shows a sixth diagram illustrating a calculation process using data of groups P1 and Q1. [Figure 12] FIG. [Figure 13] FIG. 11 is a diagram showing a calculation process using data of groups P1 to P3 and groups Q1 to Q4. [Figure 14] 13 is a flowchart of a convolution calculation process. [Figure 15] FIG. 2 is a second hardware configuration diagram of the information processing device. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0017] Hereinafter, the embodiments will be described in detail with reference to the drawings.
[0018] In the convolution operation of CNN in image recognition, a matrix representing an output image is obtained by multiplying a matrix representing an input image by a matrix representing a filter. In the convolution operation using the Winograd algorithm, a matrix I(i,m) (i=1 to K, m=1 to M) representing a part of the input image and a matrix f(j,m) (j=1 to N, m=1 to M) representing the j-th filter are transformed by the following formula.
[0019] I'(i,m)=B T I(i,m)B (1) f'(j,m)=G T f(j,m)G (2)
[0020] I'(i,m) is a matrix representing a part of the input image after transformation, and f'(j,m) is a matrix representing the filter after transformation. B and G represent transformation matrices, and B T and G T represent the transposed matrices of B and G, respectively.
[0021] M represents the number of channels of the input image, N represents the number of channels of the output image, and K represents the number of I(i,m) included in the input image of each channel.
[0022] A matrix O(i,j) (i=1 to K, j=1 to N) representing a part of an output image obtained by multiplying I(i,m) and f(j,m) is calculated by the following formula.
[0023]
number
[0024] The right side of equation (3) represents the result of adding the Hadamard product of I'(i,m) and f'(j,m) for m = 1 to M. O'(i,j) is a matrix representing a part of the output image after transformation, A represents the transformation matrix, and A T represents the transpose of A.
[0025] 1 shows an example of a convolution operation using the Winograd algorithm. A data group 111-i (i=1 to K) included in an input image 101 corresponds to M channel I(i,m). WI represents the width (number of pixels) of the input image 101, and HI represents the height (number of pixels) of the input image 101.
[0026] Data group 121-j (j=1 to N) corresponds to f(j,m) of M channels. Data 131-ij included in output image 102 corresponds to O(i,j). WO represents the width (number of pixels) of output image 102, and HO represents the height (number of pixels) of output image 102.
[0027] Data group 141-i (i=1 to K) corresponds to I'(i, m) of M channels, data group 151-j (j=1 to N) corresponds to f'(j, m) of M channels, and data 161-ij corresponds to O'(i, j).
[0028] Although the speed of convolution calculations can be improved by using the Winograd algorithm, a huge number of combinations, as shown in Figure 1, are still calculated. In a commonly used deep learning model, M and N are in the hundreds to thousands. For example, K=100, M=10 3 , N=10 3 So the total number of combinations is 10 3 ×10 2 ×10 3 =10 8 10 8 For each combination, the Hadamard product of I'(i,m) and f'(j,m) is calculated.
[0029] In this case, if the sector cache included in Fujitsu's A64FX (trademark) architecture can be utilized, it is expected that the calculation time can be further reduced. The sector cache is a function that distinguishes between reusable and non-reusable data and stores them in each sector of the cache memory. By utilizing the sector cache, data that has been stored in the cache memory can be reused without having to be evicted.
[0030] Fig. 2 shows an example of the hardware configuration of a CPU (Central Processing Unit) that does not have a sector cache function. The CPU 201 in Fig. 2 includes an arithmetic unit 211 and sectors 212-1 to 212-4. The arithmetic unit 211 includes a register and an ALU (Arithmetic and Logic Unit) that are not shown. The sectors 212-1 to 212-4 are storage areas of a cache memory.
[0031] First, the cache memory loads data a into sector 212-1 from the main memory 202. Next, the cache memory loads data b into sector 212-1 from the main memory 202. At this time, if there is no free space in sector 212-1, data a may be evicted from sector 212-1.
[0032] Fig. 3 shows an example of the hardware configuration of a CPU having a sector cache function. The CPU 301 in Fig. 3 includes an arithmetic unit 311 and sectors 312-1 to 312-4. The arithmetic unit 311 includes a register and an ALU (not shown). The sectors 312-1 to 312-4 are storage areas of a cache memory.
[0033] Sector 312-1 is a storage area for storing non-reusable data, and sectors 312-2 to 312-4 are storage areas for storing reusable data. The sector cache function prevents the data stored in sectors 312-2 to 312-4 from being purged.
[0034] The programmer explicitly instructs the program to load data b into any one of sectors 312-2 to 312-4. The cache memory loads data a into sector 312-1 from the main memory 202. Next, the cache memory loads data b into sector 312-2 from the main memory 202. The data b stored in sector 312-2 is reused without being evicted.
[0035] The following pragmas are available to make the compiler take advantage of the sector cache:
[0036] #pragma statement scache_isolate_assign
[0037] However, because the storage capacity of each sector is small, even if this pragma is used, if the amount of calculation per combination shown in Figure 1 is large, data that cannot be stored in the sector will occur. This causes memory access due to cache misses, and the calculation speed decreases.
[0038] Fig. 4 shows an example of a hardware configuration of a processor according to an embodiment. The processor 401 in Fig. 4 includes a calculation unit 411 and a cache memory 412. The calculation unit 411 and the cache memory 412 are hardware.
[0039] Fig. 5 is a flowchart showing an example of data allocation processing performed by the processor 401 in Fig. 4. First, when performing a calculation using a plurality of first data groups and a plurality of second data groups to generate a plurality of calculation result data representing the calculation results of the calculation, the calculation unit 411 determines the number of first data groups and the number of second data groups (step 501).
[0040] At this time, the calculation unit 411 determines the number of the first data groups and the number of the second data groups based on the size of one of the multiple pieces of calculation result data and the size of the calculation result area in the cache memory.
[0041] The operation result area is an area for storing some of the multiple operation result data in the cache memory 412. The number of first data groups represents the number of first data groups corresponding to some of the operation result data among the multiple first data groups. The number of second data groups represents the number of second data groups corresponding to some of the operation result data among the multiple second data groups.
[0042] Next, the calculation unit 411 allocates a plurality of first data groups and a plurality of second data groups in the main memory based on the number of first data groups and the number of second data groups (step 502).
[0043] According to the processor 401 in FIG. 4, it is possible to reduce the calculation time for calculations using a plurality of data.
[0044] Fig. 6 shows a first hardware configuration example of an information processing device (computer) including the processor 401 of Fig. 4. The information processing device 601 of Fig. 6 includes a CPU 611 and a main memory 612. The CPU 611 and the main memory 612 are hardware. The main memory 612 is a semiconductor memory such as a RAM (Random Access Memory) and stores programs and data used in processing.
[0045] The CPU 611 includes an arithmetic unit 621 and a cache memory 622. The arithmetic unit 621 includes a register and an ALU (not shown), and the cache memory 622 includes sectors 631-1 to 631-4. A CPU having a sector cache function is used as the CPU 611. The CPU 611 may be a CPU of A64FX (trademark) architecture, or may be a CPU of another architecture.
[0046] Sector 631-1 is a storage area for storing non-reusable data, and sectors 631-2 to 631-4 are storage areas for storing reusable data. The sector cache function prevents the data stored in sectors 631-2 to 631-4 from being purged.
[0047] The CPU 611 corresponds to the processor 401 in Fig. 4, and the calculation unit 621 and the cache memory 622 correspond to the calculation unit 411 and the cache memory 412 in Fig. 4. As an example, the information processing device 601 performs the convolution calculation of the CNN shown in Fig. 1.
[0048] Fig. 7 shows the data group 111-i of the input image 101 and the data group 121-j of the filter shown in Fig. 1. wI represents the width of a portion of the input image of each channel included in each data group 111-i, and hI represents the height of the portion of the input image of each channel included in each data group 111-i.
[0049] NI represents the number of data groups 111-i arranged in the horizontal direction in the input image 101. In Fig. 1, NI = 5. wf represents the filter width of each channel included in each data group 121-j, and hf represents the filter height of each channel included in each data group 121-j.
[0050] The storage capacity of sector 631-k (k=1 to 4) of cache memory 622 is Sc. Sector 631-2, sector 631-3, and sector 631-4 are used to store data group 151-j, data group 141-i, and data 161-ij, respectively. The width and height of each data 161-ij are determined by the Winograd algorithm and are represented by wO' and hO', respectively.
[0051] The data group 141-i corresponds to the first data group, the data group 151-j corresponds to the second data group, and the data 161-ij corresponds to the operation result data. The sector 631-4 corresponds to the operation result area, Sc corresponds to the size of the operation result area, and the size wO'×hO' of the data 161-ij corresponds to the size of the operation result data. The sector 631-2 is an example of the second storage area, and the sector 631-3 is an example of the first storage area.
[0052] First, the calculation unit 621 of the CPU 611 determines a division method for the K×N pieces of data 161-ij. When determining the division method, the calculation unit 621 uses Sc and wO′×hO′ to calculate the number NO′ of pieces of data 161-ij that can be stored in the sector 631-4 by the following formula.
[0053] NO' = Sc / (wO' × hO') (11)
[0054] Next, the number NI' of the data groups 141-i and the number Nf' of the data groups 151-j used to calculate the NO' pieces of data 161-ij are determined by the following equations.
[0055] NI'=Nf'=NO'^(1 / 2) (12)
[0056] As a result, the K×N pieces of data 161-ij are divided into a plurality of groups each including NO' pieces of data 161-ij. The K pieces of data groups 141-i are divided into a plurality of groups each including NI' pieces of data groups 141-i, and the N pieces of data groups 151-j are divided into a plurality of groups each including Nf' pieces of data groups 151-j.
[0057] 8 shows an example of a method for determining NI' and Nf'. When Sc=144 and wO'=hO'=4, NO'=144 / (4×4)=9 is obtained from equation (11), and NI'=Nf'=9^(1 / 2)=3 is obtained from equation (12).
[0058] Therefore, the K×N pieces of data 161-ij are divided into a plurality of groups each including nine pieces of data 161-ij. The K pieces of data groups 141-i are divided into a plurality of groups each including three pieces of data groups 141-i, and the N pieces of data groups 151-j are divided into a plurality of groups each including three pieces of data groups 151-j.
[0059] Next, the calculation unit 621 determines a layout method for arranging the K data groups 141-i and the N data groups 151-j in the main memory 612 using NI′ and Nf′.
[0060] 9 shows an example of a method of arranging N data groups 151-j. In this example, N=9, M=6, and Nf'=3. The width of the filter after conversion of each channel included in each data group 151-j is wO', and the height of the filter after conversion of each channel included in each data group 151-j is hO'.
[0061] The calculation unit 621 divides the nine data groups 151-j into groups P1 to P3. Group P1 includes data groups 151-1 to 151-3, group P2 includes data groups 151-4 to 151-6, and group P3 includes data groups 151-7 to 151-9. Groups P1 to P3 are examples of the plurality of second groups.
[0062] Data 911-jm (j=1 to 9, m=1 to 6) corresponds to a matrix f'(j,m) representing a filter after conversion of the m-th channel included in data group 151-j. When Sc=144 and wO'=hO'=4, the number of data 911-jm that can be stored in sector 631-2 is 9, the same as NO'. On the other hand, the number of data 911-jm (j=1 to 3, m=1 to 6) included in group P1 is 18.
[0063] Therefore, the calculation unit 621 divides the 18 data 911-jm into two channel groups each including Nf' channels. The first channel group includes nine data 911-jm (j=1 to 3, m=1 to 3), and the second channel group includes nine data 911-jm (j=1 to 3, m=4 to 6). The first and second channel groups are an example of the multiple second partial data groups.
[0064] Then, the calculation unit 621 arranges the nine pieces of data 911-jm of the first channel group in a continuous area in the main memory 612, and arranges the nine pieces of data 911-jm of the second channel group in the following continuous area. A continuous area refers to a storage area with continuous addresses.
[0065] Next, the calculation unit 621 arranges 18 pieces of data 911-jm (j=4 to 6, m=1 to 6) included in group P2 in the main memory 612 in the same manner as for group P1. Furthermore, the calculation unit 621 arranges 18 pieces of data 911-jm (j=7 to 9, m=1 to 6) included in group P3 in the main memory 612 in the same manner as for group P1.
[0066] In this way, by determining Nf' from NO', it becomes possible to arrange N×M pieces of data 911-jm in the main memory 612 so that the sector 631-2 of the cache memory 622 is used efficiently.
[0067] 9, the nine data 911-jm loaded in the sector 631-2 can be accessed consecutively, and the sector cache can be easily utilized using pragmas. In this case, the nine data 911-jm used in the calculation of the nine data 161-ij in each group are preloaded in the sector 631-2 by pragmas.
[0068] 10 shows an example of a method for arranging K data groups 141-i. In this example, K=12, M=6, and N1'=3. The width of a portion of the converted input image of each channel included in each data group 141-i is wO', and the height of a portion of the converted input image of each channel included in each data group 141-i is hO'.
[0069] The calculation unit 621 divides the 12 data groups 141-i into groups Q1 to Q4. Group Q1 includes data groups 141-1 to 141-3, and group Q2 includes data groups 141-4 to 141-6. Group Q3 includes data groups 141-7 to 141-9, and group Q4 includes data groups 141-10 to 141-12. Groups Q1 to Q4 are examples of the plurality of first groups.
[0070] Data 1011-im (i = 1 to 12, m = 1 to 6) corresponds to a matrix I' (i, m) representing a part of the converted input image of the mth channel included in data group 141-i. When Sc = 144 and wO' = hO' = 4, the number of data 1011-im that can be stored in sector 631-3 is 9, the same as NO'. On the other hand, the number of data 1011-im (i = 1 to 3, m = 1 to 6) included in group Q1 is 18.
[0071] Therefore, the calculation unit 621 divides the 18 data 1011-im into two channel groups each including NI' channels. The first channel group includes nine data 1011-im (i=1 to 3, m=1 to 3), and the second channel group includes nine data 1011-im (i=1 to 3, m=4 to 6). The first and second channel groups are an example of a plurality of first partial data groups.
[0072] Then, the calculation unit 621 arranges the nine data 1011-im of the first channel group in a continuous area in the main memory 612, and arranges the nine data 1011-im of the second channel group in the following continuous area.
[0073] Next, the calculation unit 621 arranges 18 pieces of data 1011-im (i = 4 to 6, m = 1 to 6) included in group Q2 in the main memory 612 in the same manner as group Q1. Next, the calculation unit 621 arranges 18 pieces of data 1011-im (i = 7 to 9, m = 1 to 6) included in group Q3 in the main memory 612 in the same manner as group Q1.
[0074] Furthermore, the calculation unit 621 allocates the 18 pieces of data 1011-im (i=10 to 12, m=1 to 6) included in the group Q4 in the main memory 612 in the same manner as the group Q1.
[0075] In this way, by determining NI' from NO', it becomes possible to arrange K×M pieces of data 1011-im in the main memory 612 so that the sector 631-3 of the cache memory 622 can be used efficiently.
[0076] 10, the nine data 1011-im loaded in the sector 631-3 can be accessed consecutively, and the sector cache can be easily utilized using pragmas. In this case, the nine data 1011-im used in the calculation of the nine data 161-ij in each group are preloaded in the sector 631-3 by pragmas.
[0077] 11A to 11F show an example of a calculation process using 18 pieces of data 911-jm of group P1 and 18 pieces of data 1011-im of group Q1 arranged in main memory 612. FIG.
[0078] In this calculation process, nine data 161-ij (i=1 to 3, j=1 to 3) are calculated using sectors 631-2 to 631-4 of the cache memory 622. The data 161-ij corresponds to a matrix O'(i,j) that represents a part of the output image after conversion.
[0079] 11A shows an example of intermediate results of calculation of data 161-1-1, data 161-2-1, and data 161-3-1. First, the cache memory 622 loads nine pieces of data 911-jm (j=1 to 3, m=1 to 3) from the main memory 612 into sector 631-2, and loads nine pieces of data 1011-im (i=1 to 3, m=1 to 3) into sector 631-3.
[0080] Next, the calculation unit 621 calculates the sum for m=1 to 3 on the right side of equation (3) using three data 911-1-m (m=1 to 3) in sector 631-2 and three data 1011-1-m (m=1 to 3) in sector 631-3. Then, the calculation unit 621 stores the obtained sum in sector 631-4 as an intermediate result of data 161-1-1.
[0081] Next, the calculation unit 621 calculates the sum for m=1 to 3 on the right side of equation (3) using three data 911-1-m (m=1 to 3) in sector 631-2 and three data 1011-2-m (m=1 to 3) in sector 631-3. Then, the calculation unit 621 stores the obtained sum in sector 631-4 as an intermediate result of data 161-2-1.
[0082] Next, the calculation unit 621 calculates the sum for m=1 to 3 on the right side of equation (3) using three data 911-1-m (m=1 to 3) in sector 631-2 and three data 1011-3-m (m=1 to 3) in sector 631-3. Then, the calculation unit 621 stores the obtained sum in sector 631-4 as an intermediate result of data 161-3-1.
[0083] 11B shows an example of intermediate results of calculation of data 161-1-2, data 161-2-2, and data 161-3-2. First, the calculation unit 621 calculates the sum for m=1 to 3 on the right side of equation (3) using three data 911-2-m (m=1 to 3) in sector 631-2 and three data 1011-1-m (m=1 to 3) in sector 631-3. Then, the calculation unit 621 stores the obtained sum in sector 631-4 as an intermediate result of data 161-1-2.
[0084] Next, the calculation unit 621 calculates the sum for m=1 to 3 on the right side of equation (3) using three data 911-2-m (m=1 to 3) in sector 631-2 and three data 1011-2-m (m=1 to 3) in sector 631-3. Then, the calculation unit 621 stores the obtained sum in sector 631-4 as an intermediate result of data 161-2-2.
[0085] Next, the calculation unit 621 calculates the sum for m=1 to 3 on the right side of equation (3) using three data 911-2-m (m=1 to 3) in sector 631-2 and three data 1011-3-m (m=1 to 3) in sector 631-3. Then, the calculation unit 621 stores the obtained sum in sector 631-4 as an intermediate result of data 161-3-2.
[0086] 11C shows an example of intermediate results of calculation of data 161-1-3, data 161-2-3, and data 161-3-3. First, the calculation unit 621 calculates the sum for m=1 to 3 on the right side of equation (3) using three pieces of data 911-3-m (m=1 to 3) in sector 631-2 and three pieces of data 1011-1-m (m=1 to 3) in sector 631-3. Then, the calculation unit 621 stores the obtained sum in sector 631-4 as the intermediate result of data 161-1-3.
[0087] Next, the calculation unit 621 calculates the sum for m=1 to 3 on the right side of equation (3) using three data 911-3-m (m=1 to 3) in sector 631-2 and three data 1011-2-m (m=1 to 3) in sector 631-3. Then, the calculation unit 621 stores the obtained sum in sector 631-4 as an intermediate result of data 161-2-3.
[0088] Next, the calculation unit 621 calculates the sum for m=1 to 3 on the right side of equation (3) using three data 911-3-m (m=1 to 3) in sector 631-2 and three data 1011-3-m (m=1 to 3) in sector 631-3. Then, the calculation unit 621 stores the obtained sum in sector 631-4 as an intermediate result of data 161-3-3.
[0089] 11A to 11C are being performed, data 911-jm (j=1 to 3, m=1 to 3) is stored in sector 631-2, and data 1011-im (i=1 to 3, m=1 to 3) is stored in sector 631-3. Therefore, these data are reused without being evicted from cache memory 622, and cache memory 622 does not need to reload these data from main memory 612.
[0090] 11D shows an example of the final result of calculation of data 161-1-1, data 161-2-1, and data 161-3-1. First, the cache memory 622 loads nine pieces of data 911-jm (j=1 to 3, m=4 to 6) from the main memory 612 into sector 631-2, and loads nine pieces of data 1011-im (i=1 to 3, m=4 to 6) into sector 631-3.
[0091] Next, the calculation unit 621 calculates the sum for m=4 to 6 on the right side of equation (3) using three data 911-1-m (m=4 to 6) in sector 631-2 and three data 1011-1-m (m=4 to 6) in sector 631-3. Then, the calculation unit 621 adds the obtained sum to the data 161-1-1 in sector 631-4 to obtain the final result of the data 161-1-1.
[0092] Next, the calculation unit 621 calculates the sum for m=4 to 6 on the right side of equation (3) using three data 911-1-m (m=4 to 6) in sector 631-2 and three data 1011-2-m (m=4 to 6) in sector 631-3. Then, the calculation unit 621 adds the obtained sum to the data 161-2-1 in sector 631-4 to obtain the final result of the data 161-2-1.
[0093] Next, the calculation unit 621 calculates the sum for m=4 to 6 on the right side of equation (3) using three data 911-1-m (m=4 to 6) in sector 631-2 and three data 1011-3-m (m=4 to 6) in sector 631-3. Then, the calculation unit 621 adds the obtained sum to the data 161-3-1 in sector 631-4 to obtain the final result of the data 161-3-1.
[0094] 11E shows an example of the final result of the calculation of data 161-1-2, data 161-2-2, and data 161-3-2. First, the calculation unit 621 calculates the sum for m=4 to 6 on the right side of equation (3) using three data 911-2-m (m=4 to 6) in sector 631-2 and three data 1011-1-m (m=4 to 6) in sector 631-3. Then, the calculation unit 621 adds the obtained sum to data 161-1-2 in sector 631-4 to obtain the final result of data 161-1-2.
[0095] Next, the calculation unit 621 calculates the sum for m=4 to 6 on the right side of equation (3) using three data 911-2-m (m=4 to 6) in sector 631-2 and three data 1011-2-m (m=4 to 6) in sector 631-3. Then, the calculation unit 621 adds the obtained sum to the data 161-2-2 in sector 631-4 to obtain the final result of the data 161-2-2.
[0096] Next, the calculation unit 621 calculates the sum for m=4 to 6 on the right side of equation (3) using three data 911-2-m (m=4 to 6) in sector 631-2 and three data 1011-3-m (m=4 to 6) in sector 631-3. Then, the calculation unit 621 adds the obtained sum to the data 161-3-2 in sector 631-4 to obtain the final result of the data 161-3-2.
[0097] 11F shows an example of the final result of the calculation of data 161-1-3, data 161-2-3, and data 161-3-3. First, the calculation unit 621 calculates the sum for m=4 to 6 on the right side of equation (3) using three pieces of data 911-3-m (m=4 to 6) in sector 631-2 and three pieces of data 1011-1-m (m=4 to 6) in sector 631-3. Then, the calculation unit 621 adds the obtained sum to data 161-1-3 in sector 631-4 to obtain the final result of data 161-1-3.
[0098] Next, the calculation unit 621 calculates the sum for m=4 to 6 on the right side of equation (3) using three data 911-3-m (m=4 to 6) in sector 631-2 and three data 1011-2-m (m=4 to 6) in sector 631-3. Then, the calculation unit 621 adds the obtained sum to the data 161-2-3 in sector 631-4 to obtain the final result of the data 161-2-3.
[0099] Next, the calculation unit 621 calculates the sum for m=4 to 6 on the right side of equation (3) using three data 911-3-m (m=4 to 6) in sector 631-2 and three data 1011-3-m (m=4 to 6) in sector 631-3. Then, the calculation unit 621 adds the obtained sum to the data 161-3-3 in sector 631-4 to obtain the final result of the data 161-3-3.
[0100] 11D to 11F are being performed, data 911-jm (j=1 to 3, m=4 to 6) is stored in sector 631-2, and data 1011-im (i=1 to 3, m=4 to 6) is stored in sector 631-3. Therefore, these data are reused without being evicted from cache memory 622, and cache memory 622 does not need to reload these data from main memory 612.
[0101] 11D to 11F, the intermediate results of data 161-ij (i=1 to 3, j=1 to 3) are stored in sector 631-4. Therefore, these intermediate results are reused without being evicted from cache memory 622.
[0102] 12 shows an example of a conversion process for converting the calculated data 161-ij. The calculation unit 621 converts the data 161-ij (i=1 to 3, j=1 to 3) in the sector 631-4 into data 131-ij by equation (4). The data 131-ij corresponds to a matrix O(i,j) representing a part of an output image. The cache memory 622 outputs the data 131-ij to the main memory 612.
[0103] FIG. 13 shows an example of a calculation process using data 911-jm of groups P1 to P3 and data 1011-im of groups Q1 to Q4 arranged in main memory 612.
[0104] First, the calculation unit 621 calculates data 161-ij (i=1 to 3, j=1 to 3) using the 18 pieces of data 911-jm of group P1 and the 18 pieces of data 1011-im of group Q1 through the calculation process shown in Figures 11A to 11F. Then, the calculation unit 621 converts the data 161-ij into data 131-ij through the conversion process shown in Figure 12, and stores it in the main memory 612.
[0105] 11A to 11F, the calculation unit 621 calculates data 161-ij (i=1 to 3, j=4 to 6) using the 18 pieces of data 911-jm of group P2 and the 18 pieces of data 1011-im of group Q1. Then, the calculation unit 621 converts the data 161-ij into data 131-ij using the same conversion process as in FIG.
[0106] 11A to 11F, the calculation unit 621 calculates data 161-ij (i=1 to 3, j=7 to 9) using the 18 pieces of data 911-jm of group P3 and the 18 pieces of data 1011-im of group Q1. Then, the calculation unit 621 converts the data 161-ij into data 131-ij using the same conversion process as in FIG.
[0107] Next, the calculation unit 621 changes group Q1 to group Q2 and repeats the same calculation process to calculate data 161-ij (i = 4 to 6, j = 1 to 9), converts the data 161-ij to data 131-ij, and stores it in the main memory 612.
[0108] Next, the calculation unit 621 changes group Q2 to group Q3 and repeats the same calculation process to calculate data 161-ij (i = 7 to 9, j = 1 to 9), converts the data 161-ij to data 131-ij, and stores it in the main memory 612.
[0109] Next, the calculation unit 621 changes group Q3 to group Q4 and repeats the same calculation process to calculate data 161-ij (i = 10 to 12, j = 1 to 9), converts the data 161-ij to data 131-ij, and stores it in the main memory 612.
[0110] 6, the number NO' of data 161-ij to be calculated at one time is determined in consideration of the storage capacity of sector 631-4 of cache memory 622. Then, based on NO', the number NI' of data groups 141-i and the number Nf' of data groups 151-j used in the calculation are determined, and data 911-jm and data 1011-im are arranged in main memory 612 using NI' and Nf'.
[0111] This makes it possible to reuse various data stored in sectors 631-2 to 631-4, reducing memory accesses and shortening operation time. For example, the operation time for convolution operations of CNN in image recognition is shortened to about 1 / 10 to 1 / 100.
[0112] The arrangement method shown in Figures 9 and 10 and the calculation process shown in Figures 11A to 11F are not limited to convolution calculations using the Winograd algorithm, but can be applied to various calculations such as generating multiple third matrices using multiple first matrices and multiple second matrices.
[0113] Fig. 14 is a flowchart showing an example of the convolution calculation process performed by the information processing device 601 in Fig. 6. The calculation unit 621 of the CPU 611 performs the convolution calculation process in Fig. 14 by executing a program for the convolution calculation process using the main memory 612.
[0114] First, the calculation unit 621 determines a division method for the K×N pieces of data 161-ij using equations (11) and (12) (step 1401). Next, the calculation unit 621 determines a layout method for arranging the K pieces of data group 141-i and the N pieces of data group 151-j in the main memory 612 using NI′ and Nf′ in equation (12) (step 1402).
[0115] Next, the calculation unit 621 converts a part of the input image of each channel included in each data group 111-i into data 1011-im by equation (1), and converts the filter of each channel included in each data group 121-j into data 911-jm by equation (2). Then, the calculation unit 621 arranges the data 911-jm (j=1 to N, m=1 to M) and the data 1011-im (i=1 to K, m=1 to M) in the main memory 612 according to the determined arrangement method (step 1403).
[0116] Next, the calculation unit 621 selects data 1011-im (i=1 to NI') and selects data 911-jm (j=1 to Nf').
[0117] Next, the calculation unit 621 starts using sectors 631-2, 631-3, and 631-4 of the cache memory 622 in accordance with the sector use start declaration written in the program (step 1404). At this time, the calculation unit 621 allocates sector 631-2 to data 911-jm (j=1 to Nf') and allocates sector 631-3 to data 1011-im (i=1 to NI'). Then, the calculation unit 621 allocates sector 631-4 to data 161-ij (i=1 to NI', j=1 to Nf').
[0118] As a sector usage start declaration, for example, the following pragma can be used.
[0119] #pragma statement scache_isolate_assign\ f',I',O'
[0120] By using a pragma to specify the data to be stored in each sector 631-k (k=2 to 4), data can be easily reused.
[0121] Next, calculation unit 621 selects data 911-jm (j=1 to Nf', m=1 to Nf') of the first channel group, and selects data 1011-im (i=1 to NI', m=1 to NI') of the first channel group.
[0122] Next, the cache memory 622 loads the selected data 911-jm into sector 631-2, and loads the selected data 1011-im into sector 631-3. Then, the calculation unit 621 calculates intermediate results of the data 161-ij (i=1 to NI', j=1 to Nf') by equation (3), and stores them in sector 631-4 (step 1405).
[0123] Next, the calculation unit 621 selects data 911-jm (j=1 to Nf', m=Nf'+1 to 2Nf') of the next channel group, and selects data 1011-im (i=1 to NI', m=NI'+1 to 2NI') of the next channel group. Then, the calculation unit 621 repeats the process of step 1405 to update the intermediate results of data 161-ij (i=1 to NI', j=1 to Nf').
[0124] The calculation unit 621 repeats the process of step 1405 while further changing the selection of the channel group of the data 911-jm and the data 1011-im, thereby further updating the intermediate results of the data 161-ij (i=1 to NI', j=1 to Nf').
[0125] When the last channel group of data 911-jm and data 1011-im is selected, in step 1405, calculation unit 621 calculates the final result of data 161-ij (i=1 to NI', j=1 to Nf') and stores it in sector 631-4. Therefore, the process of step 1405 is repeated M / Nf' (=M / NI') times.
[0126] Next, the calculation unit 621 ends the use of sectors 631-2, 631-3, and 631-4 of the cache memory 622 in accordance with the sector use end declaration written in the program (step 1406). At this time, the calculation unit 621 releases the allocation of sectors 631-2, 631-3, and 631-4.
[0127] To declare the end of sector use, for example, the following pragma can be used.
[0128] #pragma statement end_scache_isolate_assign
[0129] Next, the calculation unit 621 converts the data 161-ij (i=1 to NI', j=1 to Nf') in the sector 631-4 into data 131-ij by equation (4) (step 1407). Then, the cache memory 622 outputs the data 131-ij to the main memory 612. Here, the process of steps 1404 to 1407 is referred to as process X. Process X includes a process of repeating the process of step 1405 M / Nf' times.
[0130] Next, the calculation unit 621 selects the next group of data 911-jm (j=Nf'+1 to 2Nf') and repeats the process X to generate data 131-ij (i=1 to NI', j=Nf'+1 to 2Nf').
[0131] The calculation unit 621 generates data 131-ij (i=1 to NI', j=1 to N) by repeating the process X while further changing the selection of the group of data 911-jm. Therefore, the process X is repeated N / Nf' times. Here, the process of repeating the process X N / Nf' times is referred to as the process Y.
[0132] Next, the calculation unit 621 selects the next group of data 1011-im (i=NI'+1 to 2NI') and repeats the process Y to generate data 131-ij (i=NI'+1 to 2NI', j=1 to N).
[0133] The calculation unit 621 generates data 131-ij (i=1 to K, j=1 to N) by repeating the process Y while further changing the selection of the group of the data 1011-im. Therefore, the process Y is repeated K / NI' times.
[0134] Fig. 15 shows a second hardware configuration example of an information processing device including the processor 401 of Fig. 4. The information processing device of Fig. 15 includes a CPU 611, a main memory 612, an input device 1501, an output device 1502, an auxiliary storage device 1503, a medium drive device 1504, and a network connection device 1505. These components are hardware, and are connected to each other by a bus 1506. The configuration of the CPU 611 is the same as that of Fig. 6.
[0135] The input device 1501 is, for example, a keyboard, a pointing device, etc., and is used to input instructions or information from a user or operator. The output device 1502 is, for example, a display device, a printer, etc., and is used to output inquiries or instructions to a user or operator and processing results. The processing results may be estimation results output by the CNN.
[0136] The auxiliary storage device 1503 is, for example, a magnetic disk device, an optical disk device, a magneto-optical disk device, a tape device, etc. The auxiliary storage device 1503 may be a hard disk drive. The information processing device can store programs and data in the auxiliary storage device 1503 and load them into the main memory 612 for use.
[0137] The medium drive device 1504 drives the portable recording medium 1507 and accesses the recorded contents. The portable recording medium 1507 is a memory device, a flexible disk, an optical disk, a magneto-optical disk, etc. The portable recording medium 1507 may be a CD-ROM (Compact Disk Read Only Memory), a DVD (Digital Versatile Disk), a USB (Universal Serial Bus) memory, etc. A user or operator can store programs and data in the portable recording medium 1507 and load them into the main memory 612 for use.
[0138] Thus, the computer-readable recording medium that stores the program and data used in the processing is a physical (non-transitory) recording medium such as the main memory 612, the auxiliary storage device 1503, or the portable recording medium 1507.
[0139] The network connection device 1505 is a communication interface circuit that is connected to a communication network such as a LAN (Local Area Network) or a WAN (Wide Area Network) and performs data conversion associated with communication. The information processing device can receive programs and data from an external device via the network connection device 1505 and load them into the main memory 612 for use.
[0140] The configuration of the processor 401 in Fig. 4 is merely an example, and some of the components may be omitted or changed depending on the application or conditions of the processor 401. The configurations of the information processing device 601 in Fig. 6 and the information processing device in Fig. 15 are merely an example, and some of the components may be omitted or changed depending on the application or conditions of the information processing device.
[0141] For example, the cache memory 622 in Fig. 6 may include five or more sectors. In the information processing device in Fig. 15, if an interface with a user or operator is not required, the input device 1501 and the output device 1502 may be omitted. If the portable recording medium 1507 or a communication network is not used, the medium drive device 1504 or the network connection device 1505 may be omitted.
[0142] 5 and 14 are merely examples, and some processes may be omitted or changed depending on the configuration or conditions of the processor 401 or the information processing device 601. For example, in the convolution calculation process of Fig. 14, even if the loop process for the data 1011-im (i = 1 to NI') is replaced with the loop process for the data 911-jm (j = 1 to Nf'), the same calculation result can be obtained.
[0143] 1 is merely an example, and the convolution operation changes depending on the information processing to which the CNN is applied. The information processing to which the CNN is applied may be information processing other than image recognition.
[0144] The CPU configurations shown in Figures 2 and 3 are merely examples, and some of the components may be omitted or changed depending on the application or conditions of the CPU. The input image and filter data group shown in Figure 7 are merely examples, and the input image and filter data group change depending on the information processing to which the CNN is applied.
[0145] The method of determining NI' and Nf' shown in FIG. 8 is merely an example, and NI' and Nf' may be determined by another determination method. NI' and Nf' may be different values. The data arrangement method shown in FIG. 9 and FIG. 10 is merely an example, and the data arrangement method changes depending on the information processing to which CNN is applied. The arithmetic processing shown in FIG. 11A to FIG. 11F and FIG. 13 is merely an example, and the arithmetic processing changes depending on the data arrangement method. The conversion processing shown in FIG. 12 is merely an example, and the conversion processing changes depending on the arithmetic processing.
[0146] Equations (1) to (12) are merely examples, and the information processing device 601 may perform the convolution calculation process using other calculation equations.
[0147] Although the disclosed embodiments and their advantages have been described in detail, it will be appreciated that those skilled in the art may make various modifications, additions and omissions therein without departing from the scope of the invention as clearly set forth in the claims.
[0148] The following supplementary notes are further disclosed regarding the embodiment described with reference to FIGS. (Appendix 1) when performing an operation using a plurality of first data groups and a plurality of second data groups to generate a plurality of operation result data representing an operation result of the operation, determining the number of first data groups corresponding to the portion of the operation result data among the plurality of first data groups and the number of second data groups corresponding to the portion of the operation result data among the plurality of second data groups based on a size of one of the plurality of operation result data and a size of an operation result area in a cache memory for storing the portion of the operation result data among the plurality of operation result data; arranging the first data groups and the second data groups in a main memory based on the number of the first data groups and the number of the second data groups; A data placement program for causing a computer to execute processing. (Appendix 2) The process of determining the number of the first data groups and the number of the second data groups includes: A process of calculating the number of pieces of operation result data included in the part of the operation result data based on a size of the one operation result data and a size of the operation result area; 2. The data arrangement program according to claim 1, further comprising a process for determining the number of the first data groups and the number of the second data groups based on the number of the operation result data. (Appendix 3) each of the plurality of first data groups includes a plurality of first data; each of the plurality of second data groups includes a plurality of second data; The process of arranging the plurality of first data groups and the plurality of second data groups in a main memory includes: dividing the plurality of first data groups into a plurality of first groups each including the same number of first data groups as the number of the first data groups; A process of dividing the plurality of first data included in each of the first data groups of the plurality of first groups into a plurality of first partial data groups; A process of selecting a first group from the plurality of first groups; A process of selecting any one of the first partial data groups from the plurality of first partial data groups included in each of the first data groups of the selected first group; a process of consecutively arranging the first partial data groups selected from each of the first data groups of the selected first group in the main memory; dividing the plurality of second data groups into a plurality of second groups each including the same number of second data groups as the number of the second data groups; A process of dividing the plurality of second data included in each of the second data groups of the plurality of second groups into a plurality of second partial data groups; A process of selecting a second group from the plurality of second groups; A process of selecting any one of the second partial data groups from the plurality of second partial data groups included in each of the second data groups of the selected second group; and arranging the second partial data groups selected from each of the second data groups of the selected second group in a continuous manner within the main memory. (Appendix 4) the cache memory includes the calculation result area, a first storage area, and a second storage area; The data arrangement program is loading the first partial data groups selected from the first data groups, the number of which is the first data groups and which are consecutively arranged in the main memory, into the first storage area; loading the second partial data groups selected from the second data groups, the number of which is the number of the second data groups, which are consecutively arranged in the main memory, into the second storage area; generating the part of the operation result data by using the first partial data group loaded into the first storage area and the second partial data group loaded into the second storage area; storing the generated part of the operation result data in the operation result area; 4. The data arrangement program according to claim 3, further causing the computer to execute a process. (Appendix 5) 5. The data allocation program according to claim 4, wherein the calculation result area, the first memory area, and the second memory area are memory areas in which data eviction is inhibited. (Appendix 6) each of the plurality of first data included in each of the plurality of first data groups represents a matrix; each of the plurality of second data included in each of the plurality of second data groups represents a matrix; 6. The data arrangement program according to claim 3, wherein each of the plurality of operation result data represents a matrix. (Appendix 7) A cache memory; a calculation unit which, when performing a calculation using a plurality of first data groups and a plurality of second data groups to generate a plurality of calculation result data representing a result of the calculation, determines the number of first data groups among the plurality of first data groups corresponding to the portion of the calculation result data and the number of second data groups among the plurality of second data groups corresponding to the portion of the calculation result data based on a size of one of the plurality of calculation result data and a size of a calculation result area in the cache memory for storing the portion of the calculation result data of the plurality of calculation result data, and arranges the plurality of first data groups and the plurality of second data groups in a main memory based on the number of the first data groups and the number of the second data groups; A processor comprising: (Appendix 8) The calculation unit is determining the number of pieces of operation result data included in the part of the operation result data based on the size of the one operation result data and the size of the operation result area; 8. The processor according to claim 7, further comprising: determining the number of the first data groups and the number of the second data groups based on the number of the operation result data. (Appendix 9) each of the plurality of first data groups includes a plurality of first data; each of the plurality of second data groups includes a plurality of second data; The calculation unit is Dividing the plurality of first data groups into a plurality of first groups each including the same number of first data groups as the number of the first data groups; Dividing the plurality of first data included in each of the first data groups of the plurality of first groups into a plurality of first partial data groups; selecting a first group from the plurality of first groups; selecting any one of the first partial data groups included in each of the first data groups of the selected first group, the number of which is the number of the first data groups; The first partial data groups selected from each of the first data groups of the selected first group are consecutively arranged in the main memory; Dividing the plurality of second data groups into a plurality of second groups each including the same number of second data groups as the number of the second data groups; Dividing the plurality of second data included in each of the second data groups of the plurality of second groups into a plurality of second partial data groups; selecting a second group from the plurality of second groups; selecting any one of the second partial data groups included in each of the second data groups of the selected second group, the number of which is the number of the second data groups; The processor according to claim 7 or 8, characterized in that the second partial data groups selected from each of the second data groups of the selected second group are arranged contiguously in the main memory. (Appendix 10) the cache memory includes the calculation result area, a first storage area, and a second storage area; The cache memory includes: loading the first partial data groups selected from the first data groups, the number of which is the first data groups and which are consecutively arranged in the main memory, into the first storage area; loading the second partial data groups selected from the second data groups, the number of which is the number of the second data groups, which are consecutively arranged in the main memory, into the second storage area; The calculation unit is generating the part of the operation result data by using the first partial data group loaded into the first storage area and the second partial data group loaded into the second storage area; 10. The processor according to claim 9, wherein the generated part of the operation result data is stored in the operation result area. (Appendix 11) when performing an operation using a plurality of first data groups and a plurality of second data groups to generate a plurality of operation result data representing an operation result of the operation, determining the number of first data groups corresponding to the portion of the operation result data among the plurality of first data groups and the number of second data groups corresponding to the portion of the operation result data among the plurality of second data groups based on a size of one of the plurality of operation result data and a size of an operation result area in a cache memory for storing the portion of the operation result data among the plurality of operation result data; arranging the first data groups and the second data groups in a main memory based on the number of the first data groups and the number of the second data groups; A data arrangement method, the processing of which is executed by a computer. (Appendix 12) The process of determining the number of the first data groups and the number of the second data groups includes: A process of calculating the number of pieces of operation result data included in the part of the operation result data based on a size of the one operation result data and a size of the operation result area; 12. The data arrangement method according to claim 11, further comprising the step of determining the number of the first data groups and the number of the second data groups based on the number of the operation result data. (Appendix 13) each of the plurality of first data groups includes a plurality of first data; each of the plurality of second data groups includes a plurality of second data; The process of arranging the plurality of first data groups and the plurality of second data groups in a main memory includes: dividing the plurality of first data groups into a plurality of first groups each including the same number of first data groups as the number of the first data groups; A process of dividing the plurality of first data included in each of the first data groups of the plurality of first groups into a plurality of first partial data groups; A process of selecting a first group from the plurality of first groups; A process of selecting any one of the first partial data groups from the plurality of first partial data groups included in each of the first data groups of the selected first group; a process of consecutively arranging the first partial data groups selected from each of the first data groups of the selected first group in the main memory; dividing the plurality of second data groups into a plurality of second groups each including the same number of second data groups as the number of the second data groups; A process of dividing the plurality of second data included in each of the second data groups of the plurality of second groups into a plurality of second partial data groups; A process of selecting a second group from the plurality of second groups; A process of selecting any one of the second partial data groups from the plurality of second partial data groups included in each of the second data groups of the selected second group; and arranging the second partial data groups selected from each of the second data groups of the selected second group in a continuous manner within the main memory. (Appendix 14) the cache memory includes the calculation result area, a first storage area, and a second storage area; The computer includes: loading the first partial data groups selected from the first data groups, the number of which is the first data groups and which are consecutively arranged in the main memory, into the first storage area; loading the second partial data groups selected from the second data groups, the number of which is the number of the second data groups, which are consecutively arranged in the main memory, into the second storage area; generating the part of the operation result data by using the first partial data group loaded into the first storage area and the second partial data group loaded into the second storage area; storing the generated part of the operation result data in the operation result area; 14. The data arrangement method according to claim 13, further comprising the steps of: [Explanation of symbols]
[0149] 101 Input images 102 Output images 111-1~111-6, 111-NI, 121-1~121-N, 141-1~141-12, 151-1~151-N data group 131-1-1, 131-2-1, 131-1-2, 131-3-3, 131-1-4, 131-3-6, 131-1-7, 131-3-9, 131-4-1, 131-6-3, 131-4 -4, 161-1-1~161-3-1, 161-1-2~161-3-2, 161-1-3~161-3-3, 161-1-N~161-3-N, 911-1-1~911-1-6, 91 1-2-1~911-2-6, 911-3-1~911-3-6, 911-4-1, 911-6-6, 911-7-1, 911-9-6, 1011-1-1~1011-1-6, 1011-2-1~1011-2-6, 1011-3-1~1011-3-6, 1011-4-1, 1011-6-6, 1011-7-1, 1011-9-6, 1011-10-1, 1011-12-6 Data 201, 301, 611 CPU 202,612 Main memory 211, 311, 411, 621 Arithmetic unit Sectors 212-1~212-4, 312-1~312-4, 631-1~631-4 401 Processor 412, 622 cache memory 601 Information processing equipment 1501 Input Device 1502 Output device 1503 Auxiliary storage device 1504 Media drive unit 1505 Network connection device 1506 Bus 1507 Portable recording media
Claims
1. when performing an operation using a plurality of first data groups and a plurality of second data groups to generate a plurality of operation result data representing an operation result of the operation, determining the number of first data groups corresponding to the portion of the operation result data among the plurality of first data groups and the number of second data groups corresponding to the portion of the operation result data among the plurality of second data groups based on a size of one of the plurality of operation result data and a size of an operation result area in a cache memory for storing the portion of the operation result data among the plurality of operation result data; arranging the first data groups and the second data groups in a main memory based on the number of the first data groups and the number of the second data groups; A data placement program for causing a computer to execute processing.
2. The process of determining the number of the first data groups and the number of the second data groups includes: determining the number of pieces of operation result data included in the part of the operation result data based on a size of the one operation result data and a size of the operation result area; 2. The data allocation program according to claim 1, further comprising a process for determining the number of said first data groups and the number of said second data groups based on the number of said operation result data.
3. each of the plurality of first data groups includes a plurality of first data; each of the plurality of second data groups includes a plurality of second data; The process of arranging the plurality of first data groups and the plurality of second data groups in a main memory includes: dividing the plurality of first data groups into a plurality of first groups each including the same number of first data groups as the number of the first data groups; A process of dividing the plurality of first data included in each of the first data groups, the number of which corresponds to the number of the first data groups in each of the plurality of first groups, into a plurality of first partial data groups; A process of selecting a first group from the plurality of first groups; A process of selecting any one of the first partial data groups from the plurality of first partial data groups included in each of the first data groups of the selected first group; a process of consecutively arranging the first partial data groups selected from each of the first data groups of the selected first group in the main memory; dividing the plurality of second data groups into a plurality of second groups each including the same number of second data groups as the number of the second data groups; A process of dividing the plurality of second data included in each of the second data groups, the number of which corresponds to the number of the second data groups in each of the plurality of second groups, into a plurality of second partial data groups; A process of selecting a second group from the plurality of second groups; A process of selecting any one of the second partial data groups from the plurality of second partial data groups included in each of the second data groups of the selected second group, the number of which corresponds to the number of the second data groups; The data arrangement program according to claim 1 or 2, further comprising a process of consecutively arranging the second partial data groups selected from each of the second data groups of the selected second group in the main memory.
4. the cache memory includes the calculation result area, a first storage area, and a second storage area; The data arrangement program is loading the first partial data groups selected from the first data groups, the number of which is the first data groups, which are consecutively arranged in the main memory, into the first storage area; loading the second partial data groups selected from the second data groups, the number of which is the same as the number of the second data groups, which are consecutively arranged in the main memory, into the second storage area; generating the part of the operation result data by using the first partial data group loaded into the first storage area and the second partial data group loaded into the second storage area; storing the generated part of the operation result data in the operation result area; 4. The data allocation program according to claim 3, further comprising instructions to cause the computer to execute a process.
5. 5. The data allocation program according to claim 4, wherein the operation result area, the first storage area, and the second storage area are storage areas in which data eviction is inhibited.
6. A cache memory; a calculation unit which, when performing a calculation using a plurality of first data groups and a plurality of second data groups to generate a plurality of calculation result data representing a result of the calculation, determines the number of first data groups among the plurality of first data groups corresponding to the portion of the calculation result data and the number of second data groups among the plurality of second data groups corresponding to the portion of the calculation result data based on a size of one of the plurality of calculation result data and a size of a calculation result area in the cache memory for storing the portion of the calculation result data of the plurality of calculation result data, and arranges the plurality of first data groups and the plurality of second data groups in a main memory based on the number of the first data groups and the number of the second data groups; A processor comprising:
7. when performing an operation using a plurality of first data groups and a plurality of second data groups to generate a plurality of operation result data representing an operation result of the operation, determining the number of first data groups corresponding to the portion of the operation result data among the plurality of first data groups and the number of second data groups corresponding to the portion of the operation result data among the plurality of second data groups based on a size of one of the plurality of operation result data and a size of an operation result area in a cache memory for storing the portion of the operation result data among the plurality of operation result data; arranging the first data groups and the second data groups in a main memory based on the number of the first data groups and the number of the second data groups; A data arrangement method, the processing of which is executed by a computer.
Citation Information
Patent Citations
Processing method, program, information processing apparatus, and image processing apparatus
JP2019008421A
Method and apparatus for processing convolution operation in neural network
JP2020107338A
Systems and methods for data management
JP2020513637A
Information processing device, information processing program, and information processing method
JP2021005242A
Computation device, computation method, and program
WO2018235357A1