WO2020031281A1 - 情報処理装置、情報処理方法、及びコンピュータ読み取り可能な記録媒体 - Google Patents

情報処理装置、情報処理方法、及びコンピュータ読み取り可能な記録媒体 Download PDF

Info

Publication number
WO2020031281A1
WO2020031281A1 PCT/JP2018/029693 JP2018029693W WO2020031281A1 WO 2020031281 A1 WO2020031281 A1 WO 2020031281A1 JP 2018029693 W JP2018029693 W JP 2018029693W WO 2020031281 A1 WO2020031281 A1 WO 2020031281A1
Authority
WO
WIPO (PCT)
Prior art keywords
matrix
cost
processing
data
information processing
Prior art date
Application number
PCT/JP2018/029693
Other languages
English (en)
French (fr)
Inventor
孝道 宮本
Original Assignee
日本電気株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日本電気株式会社 filed Critical 日本電気株式会社
Priority to JP2020535386A priority Critical patent/JP7020555B2/ja
Priority to US17/266,183 priority patent/US20210312013A1/en
Priority to PCT/JP2018/029693 priority patent/WO2020031281A1/ja
Publication of WO2020031281A1 publication Critical patent/WO2020031281A1/ja
Priority to US17/682,132 priority patent/US20220188382A1/en
Priority to US17/682,102 priority patent/US20220179923A1/en
Priority to US17/682,118 priority patent/US20220179924A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Definitions

  • the present invention relates to an information processing device and an information processing method for executing a convolution process, and further relates to a computer-readable recording medium on which a program for realizing the convolution process is recorded.
  • a column matrix transformation process for rearranging a column matrix is performed on an input image (input data: matrix) using a kernel (filter: matrix), and then a matrix product
  • a method for performing gemm: general matrix multiplication
  • the matrix multiplication processing is performed by using a general-purpose central processing unit (CPU: Central Processing Unit) or a BLAS (Basic Linear Algebra Subprograms) library provided by a vendor such as a GPU (Graphic Processing Unit). Speeding up.
  • CPU Central Processing Unit
  • BLAS Basic Linear Algebra Subprograms
  • the reason why the matrix product processing can be accelerated by using the BLAS library is that optimization is performed so that hardware can be used efficiently, such as effective use of a vector operation unit of a CPU and minimization of memory access.
  • Non-Patent Document 1 discloses a technique for speeding up a matrix multiplication process. Specifically, Non-Patent Document 1 discloses that an original matrix is decomposed into a plurality of matrices having a predetermined shape, and a matrix product process is performed according to the shape of each of the decomposed matrices.
  • the library provided by the vendor may not be used.
  • the user must prepare a user function that can efficiently utilize the vector arithmetic unit developed by himself. Specifically, a plurality of user functions (matrix product processing) must be prepared for each combination of two matrices having different parallelism.
  • the matrices having different parallelism are, for example, two matrices to be processed, each of which has the same number of rows but different numbers of columns, or a matrix having one row and one matrix having the same number of rows.
  • the numbers are the same, but the number of columns in one matrix is different from the number of rows in the other matrix.
  • the output data of the column matrix conversion processing as the pre-processing must match the data structure that can be used in the matrix multiplication processing as the post-processing.
  • the output data of the column matrix conversion process in order to effectively use the vector calculator (in order to effectively use the memory instruction executed in the matrix multiplication process) , The output data of the column matrix conversion process must be rearranged using a transposition process or the like. Therefore, a different user function must be prepared for each arrangement of the output data of the column matrix conversion processing.
  • Non-Patent Document 1 the matrix multiplication process is switched according to the parameters corresponding to the shapes of the decomposed matrices.
  • output data of the column matrix conversion processing is rearranged, and processing that matches each of the decomposed matrices is required. The processing speed of the processing cannot be improved.
  • One example of an object of the present invention is to provide an information processing apparatus, an information processing method, and a computer-readable recording medium that improve the processing speed of convolution processing.
  • an information processing device includes: Using input data information representing the data size of the input data, kernel information representing the data size of the kernel, and parameter information representing parameters used in the convolution process, a memory access is performed for each matrix process executed in the convolution process. Based on the, the cost of the matrix processing, a cost calculation unit, Combining the matrix processing, sum the costs corresponding to the matrix processing included in the combination, of the total cost for each combination, select the combination of the matrix processing corresponding to the minimum total cost, A matrix processing selector, It is characterized by having.
  • an information processing method includes: (A) For each matrix process executed in the convolution process, using input data information indicating the data size of the input data, kernel information indicating the data size of the kernel, and parameter information indicating parameters used in the convolution process Calculating the cost of the matrix processing based on memory access; and (B) combining the matrix processes, summing up the costs corresponding to the matrix processes included in the combination, and calculating the minimum of the sums of the matrix processes corresponding to the total cost among the total costs for each combination. Selecting, steps, It is characterized by having.
  • a computer-readable recording medium on which a program according to one aspect of the present invention is recorded, On the computer, (A) For each matrix process executed in the convolution process, using input data information indicating the data size of the input data, kernel information indicating the data size of the kernel, and parameter information indicating parameters used in the convolution process Calculating the cost of the matrix processing based on memory access; and (B) combining the matrix processes, summing up the costs corresponding to the matrix processes included in the combination, and calculating the minimum of the sums of the matrix processes corresponding to the total cost among the total costs for each combination. Selecting, steps, Is executed.
  • the processing speed of the convolution processing can be improved.
  • FIG. 1 is a diagram illustrating an example of an information processing apparatus.
  • FIG. 2 is a diagram specifically illustrating the configuration of the information processing apparatus.
  • FIG. 3 is a diagram for explaining the cost calculation of the column matrix conversion process.
  • FIG. 4 is a diagram illustrating an example of the cost calculation of the column matrix conversion process.
  • FIG. 5 is a diagram showing an example of a matrix product processing program.
  • FIG. 6 is a diagram for explaining a matrix multiplication process using a vector calculator.
  • FIG. 7 is a diagram for explaining a matrix multiplication process using a vector calculator.
  • FIG. 8 is a diagram illustrating an example of the cost calculation of the column matrix conversion process.
  • FIG. 9 is a diagram illustrating an example of the data structure of the matrix processing selection information.
  • FIG. 9 is a diagram illustrating an example of the data structure of the matrix processing selection information.
  • FIG. 10 is a diagram illustrating an example of the operation of the information processing device 1.
  • FIG. 11 is a diagram illustrating an example of the operation of the cost calculation unit and the matrix processing selection unit.
  • FIG. 12 is a diagram illustrating an example of a computer that realizes the information processing device.
  • FIG. 1 is a diagram illustrating an example of an information processing apparatus.
  • the information processing apparatus 1 is an apparatus for improving the processing speed of the convolution processing.
  • the information processing device 1 includes a cost calculation unit 2 and a matrix processing selection unit 3.
  • the cost calculation unit 2 is executed in the convolution process using input data information indicating the data size of the input data, kernel information indicating the data size of the kernel, and parameter information indicating parameters used in the convolution process. For each matrix process, the cost of the matrix process is calculated based on the memory access.
  • the input data information is information such as input data (input image: matrix) input in the convolution processing.
  • the target information has at least the following parameters (num, channels, height, width). In these parameters, “num” indicates the number of input data, “channels” indicates the number of channels, “height” indicates the number of rows, and “width” indicates the number of columns.
  • the kernel information and the parameter information are information indicating processing contents used in the convolution processing.
  • the information indicating the processing content has, for example, the following parameters (num_output, kernel_h, kernel_w, stride_h, stride_w, pad_h, pad_w). In addition, it may have the following parameters (dilation_h, dilation_w, groups).
  • “num_output” indicates the number of output channels
  • “kernel_h” indicates the number of rows of the kernel
  • “kernel_w” indicates the number of columns of the kernel.
  • the parameters “stride_h” and “stride_w” indicate the moving amount of the stride
  • “pad_h” and “pad_w” indicate the size of the padding range.
  • “dilation_h” and “dilation_w” represent an extension rate in the extended convolution
  • “groups” represent the number of groups in the grouping convolution process.
  • the matrix processing is, for example, processing such as column matrix conversion processing (im2col processing), matrix product processing (gemm processing), and data conversion processing (transposition processing) between column matrix conversion processing and matrix product processing.
  • the cost for each matrix process is determined by, for example, a memory access (for example, an access to a CPU register, a cache, a memory area (such as a data area) or the like) described later for each of the column matrix conversion processing, the matrix multiplication processing, and the data conversion processing.
  • the cost is calculated using a cost calculation method based on the cost.
  • the matrix processing selection unit 3 combines the matrix processings, sums up the costs corresponding to the matrix processings included in the combination, and selects a combination of the matrix processings corresponding to the minimum total cost among the total costs for each combination. select.
  • each combination of the matrix processes is a combination of the column matrix conversion process A, the matrix product process B, and the data conversion process C, and the combination of the column matrix conversion process D, the matrix product process E, and the data conversion process F.
  • the sum of the costs of the matrix processes A, B, and C is compared with the sum of the costs of the matrix processes D, E, and F, and the combination of the matrix processes that minimizes the cost is selected.
  • the combination of the matrix processes that minimizes the total cost based on the memory access is selected, and the convolution process is performed using the selected combination of the matrix processes. Speed can be improved.
  • FIG. 2 is a diagram specifically illustrating the configuration of the information processing apparatus.
  • the information processing apparatus 1 includes a convolution processing unit 20 in addition to the cost calculation unit 2 and the matrix processing selection unit 3.
  • the convolution processing unit 20 executes the convolution processing using a combination of the matrix processing selected using the cost calculation unit 2 and the matrix processing selection unit 3. That is, the convolution processing unit 20 executes the convolution process using a combination of the matrix processes that minimizes the cost.
  • the cost calculation unit 2 acquires the above-described parameters, and calculates a cost based on the memory access using the acquired parameters. Further, the cost calculation unit 2 includes a column matrix conversion processing cost calculation unit 21, a matrix product processing cost calculation unit 22, and a data conversion processing cost calculation unit 23.
  • the column matrix conversion processing cost calculation unit 21 calculates the cost of one or more types of column matrix conversion processing based on memory access using the acquired parameters. Specifically, first, the column matrix conversion processing cost calculation unit 21 separates one or more continuous element copies on the memory and one or more continuous constant value copies on the memory, and Calculate the number of copies for the number of elements.
  • the column matrix conversion processing cost calculation unit 21 calculates the number of one or more continuous elements on the memory and the number of copies for the number of elements for one or more continuous elements copied on the memory. In addition, the column matrix conversion processing cost calculation unit 21 calculates the number of one or more continuous elements on the memory and the number of copies for the number of elements when copying a constant value to output data.
  • the column matrix conversion processing cost calculation unit 21 sets a value obtained by multiplying the number of copies for the calculated number of elements by the cost setting value for the copy set according to the number of continuous elements as the cost. Further, the column matrix conversion processing cost calculation unit 21 sets a value obtained by multiplying the number of times of copying the constant value in the calculated number of elements by the cost setting value for the constant value copy set according to the number of continuous elements as the cost. After that, the column matrix conversion processing cost calculation unit 21 calculates the total of the above-described costs, and sets the total as the total cost of the column matrix conversion processing.
  • FIG. 3 illustrates the cost calculation of the column matrix conversion processing in more detail with reference to FIG.
  • FIG. 3 is a diagram for explaining the cost calculation of the column matrix conversion process.
  • FIG. 4 is a diagram illustrating an example of the cost calculation of the column matrix conversion process.
  • FIG. 3 is an example in which column matrix conversion processing is performed on 3 ⁇ 3 input data composed of elements (a, b, c, d, e, f, g, h, and i), and output data is calculated.
  • arrows from the elements a and b of the input data (within the broken line) to the elements a and b of the output data (within the broken line) indicate copies of two continuous elements on the memory.
  • Arrows from the input data elements g, h, i (within the broken line) to the output data elements g, h, i (within the broken line) indicate copies of three consecutive elements on the memory.
  • the constant value “0” within the broken line in the output data indicates that the constant value “0” has been copied into three elements.
  • the constant value 0 is copied to [0] [0: 2] (constant value copy of three elements), and the constant value 0 is copied to [0] [3] (constant value of one element) Copy), input data [0] [0: 1] is copied to output data [0] [4: 5] (two-element memory copy), and constant value 0 is copied to [0] [6] (one-element memory).
  • the input data [1] [0: 1] is classified into output data [0] [7: 8] (two-element memory copy).
  • the constant value 0 is copied to [1] [0: 2] (three-element constant value copy), and the input data [0] [0: 2] is output data [1] [3 : 5] and input data [1] [0: 2] as output data [1] [6: 8] (three-element memory copy).
  • the constant value 0 is copied to [2] [0: 2] (three-element constant value copy), and the input data [0] [1: 2] is output data [2] [3 : 4] (2 element memory copy), constant value 0 is copied to [2] [5] (1 element constant value copy), input data [1] [1: 2] is output data [2] Copying is performed on [6: 7] (two-element memory copy) and constant value 0 is copied on [2] and [8] (one-element constant value copy).
  • the constant value 0 is copied to [3] [0] (one element constant value copy), and the input data [0] [0: 1] is output data [3] [1: 2].
  • constant value 0 is copied to [3] [3] (one element constant value copy)
  • input data [1] [0: 1] is output data [3] [4] : 5] (memory copy of 2 elements)
  • constant value 0 is copied to [3] [6] (copy of constant value of 1 element)
  • input data [2] [0: 1] is output data [3] [7: 8] is classified as copy (two-element memory copy).
  • the input data [0] [0: 2] is copied to the output data [4] [0: 2] (memory copy of three elements), and the input data [1] [0: 2] Is copied to output data [4] [3: 5] (memory copy of three elements), and input data [2] [0: 2] is copied to output data [4] [6: 8] (memory copy of three elements) )are categorized.
  • the input data [0] [1: 2] is copied to the output data [5] [0: 1] (two-element memory copy), and the constant value 0 is set to [5] [2] (1 element constant value copy), input data [1] [1: 2] is copied to output data [5] [3: 4] (two element memory copy), and constant value 0 is copied to [5] [ 5] (1 element constant value copy), input data [2] [1: 2] is copied to output data [5] [6: 7] (2 element memory copy), and constant value 0 is copied to [5]. ] [8] is classified as copy (copy of one-element constant value).
  • the constant value 0 is copied to [6] [0] (one-element constant value copy), and the input data [1] [0: 1] is output data [6] [1: 2]. ] (2 element memory copy), constant value 0 is copied to [6] [3] (one element constant value copy), input data [2] [0: 1] is output data [6] [4] : 5], and the constant value 0 is copied to [6] [6: 8] (three-element constant value copy).
  • the input data [1] [0: 2] is copied to the output data [7] [0: 2] (memory copy of three elements), and the input data [2] [0: 2] Is copied to output data [7] [3: 5] (3-element memory copy) and constant value 0 is copied to [7] [6: 8] (3-element constant value copy).
  • the input data [1] [1: 2] is copied to the output data [8] [0: 1] (memory copy of three elements), and the constant value 0 is set to [8] [2].
  • (1 element constant value copy) input data [2] [1: 2] is copied to output data [8] [3: 4] (3 element memory copy), and constant value 0 is copied to [8] [ 5], and the constant value 0 is copied to [8] [6: 8] (three-element constant value copy).
  • the cost setting value per memory copy of 2 elements 2 is set to 12, the cost is 168. If the cost setting value per memory copy of the number of elements of 3 is 12, the cost is 84. Assuming that a cost setting value per copy of a constant value copy of 1 element is 10, the cost is 140. Assuming that the cost setting value per copy of a constant value copy of three elements is 11, the cost is 66. Therefore, the total cost at this time is 458.
  • the cost setting value is a value used when calculating the cost, and is a value calculated in advance by an experiment, a simulation, or the like.
  • the matrix product processing cost calculation unit 22 calculates the matrix size using the acquired parameters, and calculates the cost of one or more types of matrix product processing based on memory access. Specifically, first, the matrix product processing cost calculation unit 22 calculates the number of multiplications according to the used parallelism and the number of additions according to the used parallelism.
  • the matrix product processing cost calculation unit 22 calculates the cost by multiplying the calculated number of multiplications and the number of additions by a cost setting value for each instruction in the memory. Thereafter, the matrix product processing cost calculation unit 22 calculates the total of the above-described costs, and sets the total as the cost of the matrix product processing.
  • FIG. 5 is a diagram showing an example of a matrix product processing program.
  • the program shown in FIG. 5 calculates a 32-bit integer matrix C [M] [N] using a 6-bit integer matrix A [M] [K] and a 6-bit integer matrix B [K] [N].
  • the program in FIG. 5 shows a general program that transposes a matrix B [K] [N] into a matrix BT [N] [K] and does not use a vector calculator.
  • M is 32
  • N is 100
  • K is 288.
  • FIG. 6 is a diagram for explaining a matrix multiplication process using a vector calculator.
  • FIG. 6 shows an operation image when a vector operation unit is used for the K-direction loop of the program shown in FIG.
  • the vector length of the vector calculator is 256 bits.
  • the K direction data of the matrix A is read into the vector register. Since the data is read into the 256-bit vector register, 32-bit 8-bit data is read into the vector register 0 (VR0) at a time. Further, the K-direction data of the matrix BT is read into the vector register. Since the data is read into the 256-bit vector register, 32 pieces of 8-bit data are read into the vector register 1 (VR1) at a time.
  • Vector register 0 (represented as VR0 [32] [8]) whose data arrangement is [32] [8] and vector register 1 (VR1 [32] [8]) whose data arrangement is [32] [8] ), [0] [8] and [1] [8], and [0] [8] and [1] [8].
  • the result of multiplication between them is added, and the result is written into [0] [16] of 16 vector registers 2 (VR2 [16] [16]) with 16-bit data.
  • FIG. 7 is a diagram for explaining a matrix multiplication process using a vector calculator.
  • FIG. 7 shows a 32-bit operation image for avoiding overflow at 16 bits.
  • VR3 [0] [16] of the vector register 3 (VR3 [16] [16]) and VR3 [1] [16] are added, and VR4 [8] [32] with eight 32-bit data is added.
  • VR4 [0] [32] 16-bit value “1” is multiplied by 16 vector registers 6 (VR6) and VR3 [16] [16].
  • the sum of the eight divided sums is added, and the sum other than the remainder when the sum is divided by 32 is calculated.
  • the remainder after the division by 32 is calculated by adding the multiplication result for each element to the sum other than the remainder without using the vector operation to calculate the sum of the multiplication in the K direction.
  • FIG. 8 is a diagram illustrating an example of the cost calculation of the column matrix conversion process.
  • FIG. 8 shows the cost when a vector operation unit is used for a K-direction loop where M is 32, N is 100, and K is 288.
  • the cost setting value is a value used for calculating the cost, and is a value calculated in advance by an experiment, a simulation, or the like.
  • the data conversion processing cost calculator 23 uses the data structure of the output data (matrix) output by the column matrix conversion processing and the data structure of the data that can be input to the matrix multiplication processing to determine whether data conversion processing is required. Determine whether or not. If data conversion processing is necessary, the data conversion processing cost is calculated based on the memory access. If the data conversion processing is not required, the data conversion processing cost is not calculated.
  • the data conversion processing cost calculation unit 23 determines the data structure of the output data output by the column matrix conversion processing when the data conversion processing is necessary in all combinations of the column matrix conversion processing and the matrix product processing. Into a data structure that can be applied to matrix multiplication.
  • Transposition processing is an example of data conversion processing handled by the cost calculation unit 23.
  • the transposition processing of the A ⁇ B matrix can be defined as that the memory copy of one element is performed A ⁇ B times. Assuming that the cost set value of one element memory copy is 12, the data conversion cost can be calculated as A ⁇ B ⁇ 12.
  • the matrix processing selection unit 3 calculates the cost for each matrix processing (the cost for each column matrix conversion processing (im2col processing), the cost for each matrix multiplication processing (gemm processing), and the data conversion cost (for example, transposition processing)). Is obtained, and the minimum combination among the combinations of the matrix processing is selected. Then, the matrix processing selection unit 3 instructs the convolution processing unit 20 to perform the convolution processing using the matrix processing included in the combination having the lowest cost.
  • FIG. 9 is a diagram illustrating an example of the data structure of the matrix processing selection information.
  • the matrix processing selection information shown in FIG. 9 includes six types of column matrix conversion processing (NN, NT) and three types of matrix multiplication processing (K parallel_NTN, N parallel_NNN, M parallel_TNN) as user functions. Type combinations are shown.
  • the matrix processing selection information indicates the sum total of the column matrix conversion processing cost, the matrix product processing cost, and the data conversion processing cost for the six types of combinations.
  • the type NN of the column matrix conversion process is an im2col process that reconstructs input data information (channels ⁇ (Hight ⁇ Width)) into channels ⁇ kernel_h ⁇ kernel_w ⁇ (outHeight ⁇ outWidth).
  • the type of column matrix conversion process NT is an im2col process of reconstructing input data information (channels ⁇ (Heightx Width)) into (outHeight ⁇ outWidth) ⁇ kernel_h ⁇ kernel_w ⁇ channels.
  • the type of matrix product processing K parallel_NTN indicates a matrix product using parallelism in the K direction
  • the type K parallel_NNN indicates a matrix product using parallelism in the N direction
  • the type M parallel_TNN indicates an M direction. 2 shows a matrix product utilizing the parallelism of.
  • the column matrix conversion processing cost indicates the cost of each of the types NN and NT of the column matrix conversion processing.
  • the matrix product processing cost indicates the cost of each of the types of matrix product processing, K parallel_NTN, K parallel_NNN, and M parallel_TNN.
  • the data conversion processing cost indicates the cost required to convert the output data of the column matrix conversion processing in the six combinations.
  • the matrix processing selecting unit 3 selects a combination corresponding to 1100 having the minimum total cost. That is, the type NT of the column matrix conversion process and the type K parallel_NTN of the matrix product process are selected.
  • FIG. 10 is a diagram illustrating an example of an operation of the information processing device.
  • FIGS. 2 to 9 are appropriately referred to.
  • the information processing method is performed by operating the information processing apparatus 1. Therefore, the description of the information processing method in the present embodiment is replaced with the following description of the operation of the information processing apparatus 1.
  • the information processing apparatus 1 acquires a parameter (step A1). Subsequently, the information processing device 1 uses the acquired parameters to perform matrix processing (column matrix conversion processing (im2col processing), matrix multiplication processing (gemm processing), and data conversion cost (for example, transposition processing, etc.) based on memory access. )) Is calculated (step A2). Subsequently, the information processing apparatus 1 calculates the cost for each matrix process (the cost for each column matrix conversion process (im2col process), the cost for each matrix product process (gemm process), and the data conversion cost (for example, transposition process). ) Is obtained, and the smallest one of the combinations of the matrix processing is selected (step A3).
  • matrix processing column matrix conversion processing
  • gemm processing matrix multiplication processing
  • data conversion cost for example, transposition processing, etc.
  • the information processing apparatus 1 outputs an instruction to cause the convolution processing unit 20 to perform the convolution processing using the matrix processing included in the combination having the lowest cost (step A4). Then, the information processing device 1 executes the convolution process using the matrix process of the combination having the minimum cost (step A5).
  • FIG. 11 is a diagram illustrating an example of the operation of the cost calculation unit and the matrix processing selection unit.
  • step A111 the column matrix conversion processing cost calculation unit 21 calculates costs for one or more types of column matrix conversion processing based on memory access using the acquired parameters.
  • the column matrix conversion processing cost calculation unit 21 separates one or more continuous element copies on the memory and one or more continuous constant value copies on the memory, and Calculate the number of copies for the number of elements.
  • the column matrix conversion processing cost calculation unit 21 calculates the number of one or more continuous elements on the memory and the number of copies for the number of elements. In addition, the column matrix conversion processing cost calculation unit 21 calculates the number of one or more continuous elements on the memory and the number of copies for the number of elements when copying a constant value to output data.
  • the column matrix conversion processing cost calculation unit 21 calculates the cost by multiplying the calculated number of copies of the number of elements by the cost setting value for the copy set according to the number of continuous elements. Further, the column matrix conversion processing cost calculation unit 21 calculates a cost by multiplying the number of times of copying of the constant value in the calculated number of elements by the cost setting value of the constant value copy set according to the number of continuous elements.
  • the column matrix conversion processing cost calculation unit 21 calculates the total of the above-described costs (total cost of the column matrix conversion processing).
  • the matrix product processing cost calculator 22 calculates the matrix size using the acquired parameters, and calculates the cost of one or more types of matrix product processing based on the memory access.
  • the matrix product processing cost calculation unit 22 calculates the number of multiplications according to the used parallelism and the number of additions according to the used parallelism.
  • the matrix product processing cost calculation unit 22 calculates the cost by multiplying the calculated number of multiplications and the number of additions by a cost setting value for each instruction in the memory. Thereafter, the matrix product processing cost calculation unit 22 calculates the total of the above-mentioned costs (the total cost of the matrix product processing).
  • step A113 the data conversion processing cost calculation unit 23 performs data conversion processing using the data structure of the output data (matrix) output by the column matrix conversion processing and the data structure of data that can be input to the matrix multiplication processing. Determine if it is necessary. Subsequently, when the data conversion processing is necessary, the data conversion processing cost is calculated based on the memory access. If the data conversion processing is not required, the data conversion processing cost is not calculated.
  • the data conversion processing cost calculation unit 23 requires the data conversion processing in all combinations of the column matrix conversion processing and the matrix product processing, the data structure of the output data output by the column matrix conversion processing Into a data structure that can be applied to matrix multiplication.
  • the matrix processing selection unit 3 determines the cost for each matrix processing (the cost for each column matrix conversion processing (im2col processing), the cost for each matrix product processing (gemm processing), and the data conversion cost (for example, transposition processing). )), And selects the minimum combination of the matrix processing combinations.
  • the program according to the embodiment of the present invention may be any program that causes a computer to execute steps A1 to A5 shown in FIG. 10 and steps A111 to A114 shown in FIG. By installing and executing this program on a computer, the information processing apparatus and the information processing method according to the present embodiment can be realized.
  • the processor of the computer includes the cost calculation unit 2 (the column matrix conversion processing cost calculation unit 21, the matrix product processing cost calculation unit 22, the data conversion processing cost calculation unit 23), the matrix processing selection unit 3, and the convolution processing unit 20. Function and perform processing.
  • the program according to the present embodiment may be executed by a computer system configured by a plurality of computers.
  • each of the computers may include a cost calculation unit 2 (a column matrix conversion processing cost calculation unit 21, a matrix product processing cost calculation unit 22, a data conversion processing cost calculation unit 23), a matrix processing selection unit 3, It may function as any of the convolution processing units 20.
  • FIG. 12 is a diagram illustrating an example of a computer that realizes the information processing device.
  • the computer 110 includes a CPU 111, a main memory 112, a storage device 113, an input interface 114, a display controller 115, a data reader / writer 116, and a communication interface 117. These units are connected via a bus 121 so as to be able to perform data communication with each other.
  • the computer 110 may include a GPU (Graphics Processing Unit) or an FPGA (Field-Programmable Gate Array) in addition to or instead of the CPU 111.
  • the CPU 111 performs various operations by expanding the program (code) according to the present embodiment stored in the storage device 113 into the main memory 112 and executing them in a predetermined order.
  • the main memory 112 is typically a volatile storage device such as a DRAM (Dynamic Random Access Memory).
  • the program according to the present embodiment is provided in a state stored in computer-readable recording medium 120.
  • the program according to the present embodiment may be distributed on the Internet connected via the communication interface 117.
  • the storage device 113 includes a semiconductor storage device such as a flash memory in addition to a hard disk drive.
  • the input interface 114 mediates data transmission between the CPU 111 and input devices 118 such as a keyboard and a mouse.
  • the display controller 115 is connected to the display device 119 and controls display on the display device 119.
  • the data reader / writer 116 mediates data transmission between the CPU 111 and the recording medium 120 to execute reading of a program from the recording medium 120 and writing of a processing result in the computer 110 to the recording medium 120.
  • the communication interface 117 mediates data transmission between the CPU 111 and another computer.
  • the recording medium 120 include a general-purpose semiconductor storage device such as CF (Compact Flash) and SD (Secure Digital), a magnetic recording medium such as a flexible disk, or a CD-ROM.
  • CF Compact Flash
  • SD Secure Digital
  • An optical recording medium such as a ROM (Compact Disk Read Only Memory) can be used.
  • An information processing apparatus comprising:
  • step (a) The information processing method according to claim 7, wherein In the step (a), a cost of the data conversion process is calculated based on a memory access in a data conversion process for converting output data of the column matrix conversion process.
  • the processing speed of the convolution processing can be improved.
  • the present invention is useful in a field that requires deep learning using a convolutional layer. For example, it is useful in fields such as object recognition, voice recognition, natural language processing, and biometric authentication.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Algebra (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Complex Calculations (AREA)
  • Neurology (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (AREA)

Abstract

入力データのデータサイズを表す入力データ情報と、カーネルのデータサイズを表すカーネル情報と、畳み込み処理で用いるパラメータを表すパラメータ情報とを用いて、畳み込み処理において実行される行列処理ごとに、メモリアクセスに基づいて、行列処理のコストを算出する、コスト算出部2と、行列処理を組み合わせ、組み合わせに含まれる行列処理に対応するコストを合計し、組み合わせごとに合計したコストのうち、最小となる合計したコストに対応する行列処理の組み合わせを選択する、行列処理選択部3と、を有する情報処理装置1である。

Description

情報処理装置、情報処理方法、及びコンピュータ読み取り可能な記録媒体
 本発明は、畳み込み処理を実行する情報処理装置、情報処理方法に関し、更には、これらを実現するためのプログラムを記録したコンピュータ読み取り可能な記録媒体に関する。
 近年、物体認識、音声認識、自然言語処理などの分野において、深層学習が多く利用されている。また、画像を入力とする深層学習においては、多くの畳み込み層を用いることが知られている。そのため、畳み込み層において、入力画像に対して実行させる畳み込み処理は、一般的に処理コストが大きくなるため、高速化が望まれている。
 畳み込み処理を高速化する技術として、入力画像(入力データ:行列)を、カーネル(フィルタ:行列)を用いて、列行列を再配置する列行列変換処理(im2col処理)を実行した後、行列積(gemm:general matrix multiplication)処理を行う方法が知られている。このうち、行列積処理は、汎用の中央演算装置(CPU:Central Processing Unit)、又はGPU(Graphic Processing Unit)などのベンダが提供するBLAS(Basic Linear Algebra Subprograms)ライブラリなどを用いることで、畳み込み処理の高速化を行っている。
 BLASライブラリを用いることにより行列積処理を高速化できる理由は、CPUのベクトル演算器の有効活用、メモリアクセスの最小化など、ハードウェアを高効率に活用できるように最適化しているためである。
 関連する技術として、非特許文献1には、行列積処理を高速化する技術が開示されている。具体的には、非特許文献1では、元の行列を複数の所定の形状の行列に分解し、分解した行列それぞれの形状に応じて、行列積処理を行うことが開示されている。
Kazushige Goto,Robert A. van de Geijn,"Anatomy of High-Performance Matrix Multiplication" ACM Transactions on Mathematical Software (TOMS) Volume 34,2008年5月3日,Article No. 12 P.12:1-12:25,インターネット<URL:https://dl.acm.org/citation.cfm?id=1356053>
 しかしながら、畳み込み処理を、量子化後に実行する場合、又は、BLASライブラリの無い環境で実行する場合、ベンダが提供するライブラリを利用できない場合がある。このような場合、ユーザは自前で開発した、ベクトル演算器を効率的に活用できるような、ユーザ関数を用意しなければならない。具体的には、並列性の異なる二つの行列の組み合わせごとに、複数のユーザ関数(行列積処理)を用意しなければならない。
 並列性の異なる行列とは、例えば、対象となる二つの行列において、行列それぞれの行数は同じであるが、列数がそれぞれ異なる行列、又は、一方の行列の行数と他方の行列の列数は同じであるが、一方の行列の列数と他方の行列数の行は異なる行列などである。
 更に、複数のユーザ関数(行列積処理)を効率的に利用するためには、前処理である列行列変換処理の出力データが、後処理である行列積処理で利用できるデータ構造に合致するようにしなければならない。具体的には、列行列変換処理の後に行列積処理を実行する畳み込み処理において、ベクトル演算器を有効活用するためには(行列積処理時に実行されるメモリ命令を効果的に用いるためには)、転置処理などを用いて、列行列変換処理の出力データを並び替えなければならない。そのため、列行列変換処理の出力データの並びごとに、異なるユーザ関数を用意しなければならない。
 また、非特許文献1に開示の技術では、分解した行列それぞれの形状に対応するパラメータに応じて、行列積処理を切り替えている。しかし、非特許文献1に開示の技術を、畳み込み処理に適用したとしても、上述したように列行列変換処理の出力データを並び替え、分解した行列それぞれに合致する処理が必要となるため、畳み込み処理の処理速度を向上させることができない。
 本発明の目的の一例は、畳み込み処理の処理速度を向上させる情報処理装置、情報処理方法、及びコンピュータ読み取り可能な記録媒体を提供することにある。
 上記目的を達成するため、本発明の一側面における情報処理装置は、
 入力データのデータサイズを表す入力データ情報と、カーネルのデータサイズを表すカーネル情報と、畳み込み処理で用いるパラメータを表すパラメータ情報とを用いて、前記畳み込み処理において実行される行列処理ごとに、メモリアクセスに基づいて、前記行列処理のコストを算出する、コスト算出部と、
 前記行列処理を組み合わせ、組み合わせに含まれる前記行列処理に対応する前記コストを合計し、組み合わせごとに合計したコストのうち、最小となる前記合計したコストに対応する前記行列処理の組み合わせを選択する、行列処理選択部と、
 を有することを特徴とする。
 また、上記目的を達成するため、本発明の一側面における情報処理方法は、
(a)入力データのデータサイズを表す入力データ情報と、カーネルのデータサイズを表すカーネル情報と、畳み込み処理で用いるパラメータを表すパラメータ情報とを用いて、前記畳み込み処理において実行される行列処理ごとに、メモリアクセスに基づいて、前記行列処理のコストを算出する、ステップと、
(b)前記行列処理を組み合わせ、組み合わせに含まれる前記行列処理に対応する前記コストを合計し、組み合わせごとに合計したコストのうち、最小となる前記合計したコストに対応する前記行列処理の組み合わせを選択する、ステップと、
 を有することを特徴とする。
 更に、上記目的を達成するため、本発明の一側面におけるプログラムを記録したコンピュータ読み取り可能な記録媒体は、
 コンピュータに、
(a)入力データのデータサイズを表す入力データ情報と、カーネルのデータサイズを表すカーネル情報と、畳み込み処理で用いるパラメータを表すパラメータ情報とを用いて、前記畳み込み処理において実行される行列処理ごとに、メモリアクセスに基づいて、前記行列処理のコストを算出する、ステップと、
(b)前記行列処理を組み合わせ、組み合わせに含まれる前記行列処理に対応する前記コストを合計し、組み合わせごとに合計したコストのうち、最小となる前記合計したコストに対応する前記行列処理の組み合わせを選択する、ステップと、
 を実行させることを特徴とする。
 以上のように本発明によれば、畳み込み処理の処理速度を向上させることができる。
図1は、情報処理装置の一例を示す図である。 図2は、情報処理装置の構成を具体的に示す図である。 図3は、列行列変換処理のコスト算出を説明するための図である。 図4は、列行列変換処理のコスト算出の一例を示す図である。 図5は、行列積処理のプログラムの一例を示す図である。 図6は、ベクトル演算器を利用した行列積処理を説明するための図である。 図7は、ベクトル演算器を利用した行列積処理を説明するための図である。 図8は、列行列変換処理のコスト算出の一例を示す図である。 図9は、行列処理選択情報のデータ構造の一例を示す図である。 図10は、情報処理装置1の動作の一例を示す図である。 図11は、コスト算出部、行列処理選択部の動作の一例を図である。 図12は、情報処理装置を実現するコンピュータの一例を示す図である。
(実施の形態)
 以下、本発明の実施の形態について、図1から図12を参照しながら説明する。
[装置構成]
 最初に、図1を用いて、本実施の形態における情報処理装置の構成について説明する。図1は、情報処理装置の一例を示す図である。
 図1に示す本実施形態における情報処理装置1は、畳み込み処理の処理速度を向上させるための装置である。図1に示すように、情報処理装置1は、コスト算出部2と、行列処理選択部3とを有する。
 このうち、コスト算出部2は、入力データのデータサイズを表す入力データ情報と、カーネルのデータサイズを表すカーネル情報と、畳み込み処理で用いるパラメータを表すパラメータ情報とを用いて、畳み込み処理において実行される行列処理ごとに、メモリアクセスに基づいて、行列処理のコストを算出する。
 入力データ情報は、畳み込み処理において入力される、入力データ(入力画像:行列)などの情報である。また、対象情報は、少なくとも次のようなパラメータ(num、channels、height、width)を有する。これらのパラメータは、「num」が入力データの数を表し、「channels」がチャンネル数を表し、「height」が行数を表し、「width」が列数を表している。
 カーネル情報とパラメータ情報とは、畳み込み処理で用いる処理内容を示す情報である。処理内容を示す情報は、例えば、次のようなパラメータ(num_output、kernel_h、kernel_w、stride_h、stride_w、pad_h、pad_w)を有する。なお、更に次のようなパラメータ(dilation_h、dilation_w、groups)を有してもよい。
 それらのパラメータは、「num_output」が出力チャネル数を表し、「kernel_h」がカーネルの行数を表し、「kernel_w」がカーネルの列数を表している。また、パラメータ「stride_h」及び「stride_w」はストライドの移動量を表し、「pad_h」及び「pad_w」がパディングする範囲のサイズを表す。また、「dilation_h」及び「dilation_w」は拡張畳み込みにおける拡張レートを表し、「groups」はグループ化畳み込み処理におけるグループ数を表す。
 行列処理は、例えば、列行列変換処理(im2col処理)、行列積処理(gemm処理)、列行列変換処理と行列積処理との間のデータ変換処理(転置処理)などの処理である。
 行列処理ごとのコストは、例えば、列行列変換処理、行列積処理、データ変換処理それぞれについて、後述するメモリアクセス(例えば、CPUのレジスタ、キャシュ、メモリ領域(データ領域など)などへのアクセス)に基づくコスト算出方法を用いて算出する。
 行列処理選択部3は、行列処理それぞれを組み合わせ、組み合わせに含まれる行列処理に対応するコストを合計し、組み合わせごとに合計したコストのうち、最小となる合計したコストに対応する行列処理の組み合わせを選択する。
 例えば、行列処理それぞれの組み合わせが、列行列変換処理A、行列積処理B、データ変換処理Cの組み合わせ、及び、列行列変換処理D、行列積処理E、データ変換処理Fの組み合わせであったとする。その場合、行列処理A、B、Cそれぞれのコストの合計と、行列処理D、E、Fそれぞれのコストの合計とを比較し、最小となる行列処理の組み合わせを選択する。
 このように、本実施の形態では、メモリアクセスに基づいたコストの合計が最小となる行列処理の組み合わせを選択し、選択した行列処理の組み合わせを用いて、畳み込み処理を行うので、畳み込み処理の処理速度を向上させることができる。
 続いて、図2を用いて、本実施の形態における情報処理装置1の構成をより具体的に説明する。図2は、情報処理装置の構成を具体的に示す図である。
 図2に示すように、本実施の形態における情報処理装置1は、コスト算出部2と行列処理選択部3とに加えて、畳み込み処理部20を有する。畳み込み処理部20は、コスト算出部2と行列処理選択部3とを用いて選択した、行列処理の組み合わせを用いて、畳み込み処理を実行する。すなわち、畳み込み処理部20は、コストが最小となる行列処理の組み合わせを用いて、畳み込み処理を実行する。
 コスト算出部2は、畳み込み処理部20が畳み込み処理を実行する場合、上述したパラメータを取得し、取得したパラメータを用いて、メモリアクセスに基づくコストを算出する。また、コスト算出部2は、列行列変換処理コスト算出部21と、行列積処理コスト算出部22と、データ変換処理コスト算出部23とを有する。
 列行列変換処理コスト算出部21は、取得したパラメータを用いて、メモリアクセスに基づいて、一つ以上の種類の列行列変換処理のコストを算出する。具体的には、まず、列行列変換処理コスト算出部21は、メモリ上で一以上の連続な要素のコピーと、メモリ上で一以上の連続な定数値のコピーとに分けて、要素数と要素数に対するコピー回数を算出する。
 すなわち、列行列変換処理コスト算出部21は、メモリ上で一以上の連続な要素のコピーに対して、メモリ上で一以上連続な要素数と、当該要素数に対するコピー回数とを算出する。また、列行列変換処理コスト算出部21は、定数値を出力データにコピーする場合の値のコピーを、メモリ上で一以上連続な要素数と、当該要素数に対するコピー回数を算出する。
 続いて、列行列変換処理コスト算出部21は、算出した要素数に対するコピー回数と、連続な要素数に応じて設定したコピーに対するコスト設定値とを乗算した値をコストとする。また、列行列変換処理コスト算出部21は、算出した要素数における定数値のコピー回数と、連続な要素数に応じて設定した定数値コピーに対するコスト設定値とを乗算した値をコストとする。その後、列行列変換処理コスト算出部21は、上述したコストの合計を算出し、当該列行列変換処理のコスト総和とする。
 図3は、図4を用いて、列行列変換処理のコスト算出について、更に詳細に説明をする。図3は、列行列変換処理のコスト算出を説明するための図である。図4は、列行列変換処理のコスト算出の一例を示す図である。
 図3は、要素(a、b、c、d、e、f、g、h、i)から構成される3×3の入力データに対する列行列変換処理をし、出力データを算出した例である。また、図3において、入力データの要素a、b(破線内)から出力データの要素a、b(破線内)までの矢印は、メモリ上連続な二つの要素のコピーを示している。また、入力データの要素g、h、i(破線内)から出力データの要素g、h、i(破線内)までの矢印は、メモリ上連続な三つの要素のコピーを示している。更に、図3において、出力データにおける破線内の定数値「0」は、定数値「0」を三つの要素にコピーしたことを示している。
 図3を用いて、3×3の入力データから9×9の出力データを生成する場合のメモリ上で一以上の連続な要素のコピー(メモリコピー)と、ある定数値のメモリ上で一以上の領域へのコピー(定数値コピー)の分類方法を説明する。図3の例では、対象となる入力データ情報は、num=1、channels=1、height=3、width=3とする。
 また、畳み込み処理で用いる処理内容を示す情報(カーネル情報、パラメータ情報)は、num_output=1、kernel_h=3、kernel_w=3、stride_h=1、stride_w=1、pad_h=1、pad_w=1、dilation_h=1、dilation_w=1、groups=1とする。
 出力データの1行目においては、定数値0を[0][0:2]にコピー(3要素の定数値コピー)、定数値0を[0][3]にコピー(1要素の定数値コピー)、入力データ[0][0:1]を出力データ[0][4:5]にコピー(2要素のメモリコピー)、定数値0を[0][6]にコピー(1要素の定数値コピー)、入力データ[1][0:1]を出力データ[0][7:8]にコピー(2要素のメモリコピー)に分類される。
 出力データの2行目においては、定数値0を[1][0:2]にコピー(3要素の定数値コピー)、入力データ[0][0:2]を出力データ[1][3:5]にコピー(3要素のメモリコピー)、入力データ[1][0:2]を出力データ[1][6:8]にコピー(3要素のメモリコピー)に分類される。
 出力データの3行目においては、定数値0を[2][0:2]にコピー(3要素の定数値コピー)、入力データ[0][1:2]を出力データ[2][3:4]にコピー(2要素のメモリコピー)、定数値0を[2][5]にコピー(1要素の定数値コピー)、入力データ[1][1:2]を出力データ[2][6:7]にコピー(2要素のメモリコピー)、定数値0を[2][8]にコピー(1要素の定数値コピー)に分類される。
 出力データの4行目においては、定数値0を[3][0]にコピー(1要素の定数値コピー)、入力データ[0][0:1]を出力データ[3][1:2]にコピー(2要素のメモリコピー)、定数値0を[3][3]にコピー(1要素の定数値コピー)、入力データ[1][0:1]を出力データ[3][4:5]にコピー(2要素のメモリコピー)、定数値0を[3][6]にコピー(1要素の定数値コピー)、入力データ[2][0:1]を出力データ[3][7:8]にコピー(2要素のメモリコピー)に分類される。
 出力データの5行目においては、入力データ[0][0:2]を出力データ[4][0:2]にコピー(3要素のメモリコピー)、入力データ[1][0:2]を出力データ[4][3:5]にコピー(3要素のメモリコピー)、入力データ[2][0:2]を出力データ[4][6:8]にコピー(3要素のメモリコピー)に分類される。
 出力データの6行目においては、入力データ[0][1:2]を出力データ[5][0:1]にコピー(2要素のメモリコピー)、定数値0を[5][2]にコピー(1要素の定数値コピー)、入力データ[1][1:2]を出力データ[5][3:4]にコピー(2要素のメモリコピー)、定数値0を[5][5]にコピー(1要素の定数値コピー)、入力データ[2][1:2]を出力データ[5][6:7]にコピー(2要素のメモリコピー)、定数値0を[5][8]にコピー(1要素の定数値コピー)に分類される。
 出力データの7行目においては、定数値0を[6][0]にコピー(1要素の定数値コピー)、入力データ[1][0:1]を出力データ[6][1:2]にコピー(2要素のメモリコピー)、定数値0を[6][3]にコピー(1要素の定数値コピー)、入力データ[2][0:1]を出力データ[6][4:5]にコピー(2要素のメモリコピー)、定数値0を[6][6:8]にコピー(3要素の定数値コピー)に分類される。
 出力データの8行目においては、入力データ[1][0:2]を出力データ[7][0:2]にコピー(3要素のメモリコピー)、入力データ[2][0:2]を出力データ[7][3:5]にコピー(3要素のメモリコピー)、定数値0を[7][6:8]にコピー(3要素の定数値コピー)に分類される.
 出力データの9行目においては、入力データ[1][1:2]を出力データ[8][0:1]にコピー(3要素のメモリコピー)、定数値0を[8][2]にコピー(1要素の定数値コピー)、入力データ[2][1:2]を出力データ[8][3:4]にコピー(3要素のメモリコピー)、定数値0を[8][5]にコピー(1要素の定数値コピー)、定数値0を[8][6:8]にコピー(3要素の定数値コピー)に分類される。
 図4を用いて、図3の例に対するコスト算出の説明をする。図3の例に対して、要素数2のメモリコピー回数は14回、要素数3のメモリコピー回数は7回、要素数1の定数値コピー回数は14回、要素数3の定数値コピー回数は6回となる。
 要素数2のメモリコピーの一回当たりのコスト設定値を12とすると、コストは168となる。要素数3のメモリコピーの一回当たりのコスト設定値を12とすると、コストは84となる。要素数1の定数値コピーの一回当たりのコスト設定値を10とすると、コストは140となる。要素数3の定数値コピーの一回当たりのコスト設定値を11とすると、コストは66となる。従って、このときのコスト総和は458となる。なお、コスト設定値は、コストを算出する際に用いる値で、予め実験、シミュレーションなどにより算出した値である。
 行列積処理コスト算出部22は、取得したパラメータを用いて行列サイズを算出し、メモリアクセスに基づいて、一つ以上の種類の行列積処理のコストを算出する。具体的には、まず、行列積処理コスト算出部22は、利用する並列性に応じた乗算回数と、利用する並列性に応じた加算回数とを算出する。
 続いて、行列積処理コスト算出部22は、算出した乗算回数と加算回数とに、メモリに対する命令ごとのコスト設定値を乗算してコストを算出する。その後、行列積処理コスト算出部22は、上述したコストの合計を算出し、当該行列積処理のコストのコスト総和とする。
 図5、図6、図7、図8を用いて、行列積処理のコスト算出について、更に詳細に説明をする。図5は、行列積処理のプログラムの一例を示す図である。図5のプログラムは、6bit整数の行列A[M][K]と、6bit整数の行列B[K][N]とを用いて、32bit整数の行列C[M][N]を算出する行列積のプログラムを示す。また、図5のプログラムは、行列B[K][N]を転置して行列BT[N][K]とし、ベクトル演算器を利用しない一般的なプログラムを示す。なお、図5のプログラムでは、Mが32、Nが100、Kが288とする。
 図6は、ベクトル演算器を利用した行列積処理を説明するための図である。図6は、図5に示したプログラムのK方向のループに対して、ベクトル演算器を利用した場合の動作イメージを示す。また、図6の例では、ベクトル演算器のベクトル長は256bitとする。
 まず、行列AのK方向データをベクトルレジスタに読み込む。256bitのベクトルレジスタに読み込まれるため、8bitデータが、32個一括でベクトルレジスタ0(VR0)に読み込まれる。また、行列BTのK方向データをベクトルレジスタに読み込む。256bitのベクトルレジスタに読み込まれるため、8bitデータが、32個一括でベクトルレジスタ1(VR1)に読み込まれる。
 データ並びを[32][8]とするベクトルレジスタ0(VR0[32][8]と表現する)と、データ並びを[32][8]とするベクトルレジスタ1(VR1[32][8]と表現する)に対して、[0][8]同士、[1][8]同士となるような同一位置の8bitデータの乗算と、[0][8]同士と[1][8]同士の乗算結果の加算をし、その結果を16bitデータが16個のベクトルレジスタ2(VR2[16][16])の[0][16]に書き込む。
 次に、上述した乗算と加算により算出したベクトルレジスタ2(VR2)の結果と、総和を算出するために用いるベクトルレジスタ3(VR3[16][16])の結果とを繰り返し加算する。このようにすることで、32で除算したときの余り以外のK方向の乗算の総和は、分割された16個の総和としてベクトルレジスタ3(VR3)に書き込まれる。
 ところで、行列Aと行列Bとのbit数に応じて16bitのベクトルレジスタ3(VR3)でのオーバーフローを回避するためには、16bitで保持していた結果を32bitで保持する必要がある。そこで、行列Aと行列Bとのデータのbit数の和に応じて、16bit加算がある回数ごとに32bitへの変換を行う。
 図7は、ベクトル演算器を利用した行列積処理を説明するための図である。図7は、16bitでのオーバーフローを回避するための32bit化の動作イメージを示す。
 図7の例では、行列Aと行列Bとがともに6bit整数の行列ため、乗算によっては最大12bitで隣の要素との加算で13bitとなる。そのため、16bitでの一時的な総和は、最大で32回の加算まで可能となる。そこで、32回に一度32bit化を行い、32bitのレジスタに書き込む。
 例えば、ベクトルレジスタ3(VR3[16][16])のVR3[0][16]と、VR3[1][16]とを加算して、32bitデータが8個のVR4[8][32]のVR4[0][32]に書き込むために、16bitで値「1」が16個のベクトルレジスタ6(VR6)とVR3[16][16]を乗算する。
 また、上述した乗算の結果と、総和を算出するために用いるベクトルレジスタ(VR5[32][8])の結果とをベクトル加算することで、K方向の乗算の総和は、分割された8個の総和結果となる。
 最後に、分割された8個の総和結果をそれぞれ加算して32で除算したときの余り以外の総和を算出する。32で除算したときの余り部分は、ベクトル演算を用いずに一要素ずつの乗算結果を余り以外の総和に加算することでK方向の乗算の総和を算出する。
 図8は、列行列変換処理のコスト算出の一例を示す図である。図8は、Mが32、Nが100、Kが288の場合のK方向ループに対してベクトル演算器を利用した場合のコストを示す。
 図8において、8bit乗算+加算命令は、K方向に対して、K/32回とM×N回行われるため、当該命令回数はM×N×(K/32)回と表される。従って、当該命令では命令回数は、28800(=32×100×(288/32))となる。また、一回当たりのコスト設定値を0.5とすると、コストは14400となる。コスト設定値は、コストを算出する際に用いる値で、予め実験、シミュレーションなどにより算出した値である。
 また、図8において、16bit加算命令は、K方向に対して、K/32回とM×N回行われるため、当該命令回数はM×N×(K/32)回と表される。従って、当該命令では命令回数は、28800(=32×100×(288/32))となる。また、一回当たりのコスト設定値を0.33とすると、コストは9504となる。
 また、32bitベクトル変換命令は、16bit乗算+加算命令の回数は、K方向に対して、K/32/32回とM×N回(又は、最低1回)行われるため、M×N×(K/32/32)回と表される。従って、当該変換では命令回数は、900(=32×100×(288/32/32))となる。また、一回当たりのコスト設定値を0.5とすると、コストは450となる。
 また、32bitベクトル加算命令において、16bit乗算+加算命令の回数は、K方向に対して、K/32/32回とM×N回(又は、最低1回)行われるため、M×N×(K/32/32)回と表される。従って、当該変換では命令回数は、900(=32×100×(288/32/32))となる。また、一回当たりのコスト設定値を0.33とすると、コストは297となる。
 データ変換処理コスト算出部23は、列行列変換処理が出力した出力データ(行列)のデータ構造と、行列積処理に入力可能なデータのデータ構造とを用いて、テータ変換処理が必要であるか否かを判定する。テータ変換処理が必要である場合、メモリアクセスに基づいて、テータ変換処理コストを算出する。テータ変換処理が必要でない場合、テータ変換処理コストを算出しない。
 具体的には、データ変換処理コスト算出部23は、列行列変換処理と行列積処理との全ての組み合わせにおいて、データ変換処理が必要である場合、列行列変換処理が出力した出力データのデータ構造を行列積処理に適用できるデータ構造に変換する。
 データ変換処理コスト算出部23が扱うデータ変換処理として転置処理があげられる。A×Bの行列の転置処理は1要素のメモリコピーがA×B回行われると定義できる。1要素のメモリコピーのコスト設定値を12とした場合、データ変換のコストはA×B×12として算出できる。図3で示したim2colの出力データを転置する場合、データ変換処理コスト算出部23は、9×9×12=972のコストを算出する。
 行列処理選択部3は、行列処理ごとのコスト(列行列変換処理(im2col処理)ごとのコストと、行列積処理(gemm処理)ごとのコストと、データ変換コスト(例えば、転置処理など))とを取得し、行列処理の組み合わせのうち最小となる、組み合わせを選択する。そして、行列処理選択部3は、コストが最小の組み合わせに含まれる行列処理を用いて、畳み込み処理をするように、畳み込み処理部20へ指示をする。
 図9を用いて具体的に説明をする。図9は、行列処理選択情報のデータ構造の一例を示す図である。図9の行列処理選択情報には、ユーザ関数として列行列変換処理が二種類(NN、NT)、行列積処理が三種類(K並列_NTN、N並列_NNN、M並列_TNN)に対して、6種類の組み合わせが示されている。また、行列処理選択情報には、6種類の組み合わせに対して、列行列変換処理コスト、行列積処理コスト、データ変換処理コストの総和が示されている。
 列行列変換処理の種類NNは、入力データ情報(channels×(Height×Width))を、channels×kernel_h×kernel_w×(outHeight×outWidth)へと再構成する、im2col処理である。
 列行列変換処理の種類NTは、入力データ情報(channels×(Heightx Width))を、(outHeight×outWidth)×kernel_h×kernel_w×channelsへと再構成する、im2col処理である。
 行列積処理の種類K並列_NTNは、K方向の並列性を利用する行列積を示し、種類K並列_NNNは、N方向の並列性を利用する行列積を示し、種類M並列_TNNは、M方向の並列性を利用する行列積を示している。
 列行列変換処理コストは、列行列変換処理の種類NN、NTそれぞれのコストを示している。行列積処理コストは、行列積処理の種類K並列_NTN、K並列_NNN、M並列_TNNそれぞれのコストを示している。データ変換処理コストは、六種類の組み合わせにおける、列行列変換処理の出力データを変換するのに必要なコストを示している。
 例えば、行列処理選択部3は、図9の場合であれば、コスト総和が最小の1100に対応する組み合わせを選択する。すなわち、列行列変換処理の種類NTと行列積処理の種類K並列_NTNとを選択する。
[装置動作]
 次に、本発明の実施の形態における情報装置1の動作について図10を用いて説明する。図10は、情報処理装置の動作の一例を示す図である。以下の説明においては、適宜図2から図9を参酌する。また、本実施の形態では、情報処理装置1を動作させることにより、情報処理方法が実施される。よって、本実施の形態における情報処理方法の説明は、以下の情報処理装置1の動作説明に代える。
 情報処理装置1はパラメータを取得する(ステップA1)。続いて、情報処理装置1は、取得したパラメータを用いて、メモリアクセスに基づき、行列処理(列行列変換処理(im2col処理)、行列積処理(gemm処理)、データ変換コスト(例えば、転置処理など))ごとのコストを算出する(ステップA2)。続いて、情報処理装置1は、行列処理ごとのコスト(列行列変換処理(im2col処理)ごとのコストと、行列積処理(gemm処理)ごとのコストと、データ変換コスト(例えば、転置処理など))とを取得し、行列処理の組み合わせのうち最小となる、組み合わせを選択する(ステップA3)。続いて、情報処理装置1は、コストが最小の組み合わせに含まれる行列処理を用いて、畳み込み処理部20に畳み込み処理をさせるための指示を出力する(ステップA4)。そして、情報処理装置1は、コストが最小となる組み合わせが有する行列処理を用いて、畳み込み処理を実行する(ステップA5)。
 続いて、図11を用いて、図10に示したステップA2、A3について詳細に説明する。図11は、コスト算出部、行列処理選択部の動作の一例を示す図である。
 ステップA111において、列行列変換処理コスト算出部21は、取得したパラメータを用いて、メモリアクセスに基づいて、一つ以上の種類の列行列変換処理に対してコストを算出する。
 具体的には、まず、列行列変換処理コスト算出部21は、メモリ上で一以上の連続な要素のコピーと、メモリ上で一以上の連続な定数値のコピーとに分けて、要素数と要素数に対するコピー回数を算出する。
 すなわち、列行列変換処理コスト算出部21は、メモリ上で一以上連続な要素数と、当該要素数に対するコピー回数とを算出する。また、列行列変換処理コスト算出部21は、定数値を出力データにコピーする場合の値のコピーを、メモリ上で一以上連続な要素数と、当該要素数に対するコピー回数を算出する。
 続いて、列行列変換処理コスト算出部21は、算出した要素数のコピー回数と、連続な要素数に応じて設定したコピーに対するコスト設定値とを乗算してコストを算出する。また、列行列変換処理コスト算出部21は、算出した要素数における定数値のコピー回数と、連続な要素数に応じて設定した定数値コピーのコスト設定値とを乗算してコストを算出する。
 その後、列行列変換処理コスト算出部21は、上述したコストの合計(当該列行列変換処理のコスト総和)を算出する。
 ステップA112において、行列積処理コスト算出部22は、取得したパラメータを用いて行列サイズを算出し、メモリアクセスに基づいて、一つ以上の種類の行列積処理のコストを算出する。
 具体的には、まず、行列積処理コスト算出部22は、利用する並列性に応じた乗算回数と、利用する並列性に応じた加算回数とを算出する。
 続いて、行列積処理コスト算出部22は、算出した乗算回数と加算回数とに、メモリに対する命令ごとのコスト設定値を乗算してコストを算出する。その後、行列積処理コスト算出部22は、上述したコストの合計(当該行列積処理のコスト総和)を算出する。
 ステップA113において、データ変換処理コスト算出部23は、列行列変換処理が出力した出力データ(行列)のデータ構造と、行列積処理に入力可能なデータのデータ構造とを用いて、テータ変換処理が必要であるか否かを判定する。続いて、テータ変換処理が必要である場合、メモリアクセスに基づいて、テータ変換処理コストを算出する。テータ変換処理が必要でない場合、テータ変換処理コストを算出しない。
 具体的には、データ変換処理コスト算出部23は、列行列変換処理と行列積処理との全ての組み合わせにおいて、テータ変換処理が必要である場合、列行列変換処理が出力した出力データのデータ構造を行列積処理に適用できるデータ構造に変換する。
 ステップA114において、行列処理選択部3は、行列処理ごとのコスト(列行列変換処理(im2col処理)ごとのコストと、行列積処理(gemm処理)ごとのコストと、データ変換コスト(例えば、転置処理など))とを取得し、行列処理の組み合わせのうち最小となる、組み合わせを選択する。
[本実施の形態の効果]
 以上のように本実施の形態によれば、メモリアクセスに基づいたコストの合計が最小となる行列処理の組み合わせを選択し、選択した行列処理の組み合わせを用いて、畳み込み処理を行うので、畳み込み処理の処理速度を向上させることができる。
[プログラム]
 本発明の実施の形態におけるプログラムは、コンピュータに、図10に示すステップA1からA5、図11に示すステップA111からA114を実行させるプログラムであればよい。このプログラムをコンピュータにインストールし、実行することによって、本実施の形態における情報処理装置と情報処理方法とを実現することができる。この場合、コンピュータのプロセッサは、コスト算出部2(列行列変換処理コスト算出部21、行列積処理コスト算出部22、データ変換処理コスト算出部23)、行列処理選択部3、畳み込み処理部20として機能し、処理を行なう。
 また、本実施の形態におけるプログラムは、複数のコンピュータによって構築されたコンピュータシステムによって実行されてもよい。この場合は、例えば、各コンピュータが、それぞれ、コスト算出部2(列行列変換処理コスト算出部21、行列積処理コスト算出部部22、データ変換処理コスト算出部23)、行列処理選択部3、畳み込み処理部20のいずれかとして機能してもよい。
[物理構成]
 ここで、実施の形態におけるプログラムを実行することによって、情報装置を実現するコンピュータについて図12を用いて説明する。図12は、情報処理装置を実現するコンピュータの一例を示す図である。
 図12に示すように、コンピュータ110は、CPU111と、メインメモリ112と、記憶装置113と、入力インターフェイス114と、表示コントローラ115と、データリーダ/ライタ116と、通信インターフェイス117とを備える。これらの各部は、バス121を介して、互いにデータ通信可能に接続される。なお、コンピュータ110は、CPU111に加えて、又はCPU111に代えて、GPU(Graphics Processing Unit)、又はFPGA(Field-Programmable Gate Array)を備えていてもよい。
 CPU111は、記憶装置113に格納された、本実施の形態におけるプログラム(コード)をメインメモリ112に展開し、これらを所定順序で実行することにより、各種の演算を実施する。メインメモリ112は、典型的には、DRAM(Dynamic Random Access Memory)等の揮発性の記憶装置である。また、本実施の形態におけるプログラムは、コンピュータ読み取り可能な記録媒体120に格納された状態で提供される。なお、本実施の形態におけるプログラムは、通信インターフェイス117を介して接続されたインターネット上で流通するものであってもよい。
 また、記憶装置113の具体例としては、ハードディスクドライブの他、フラッシュメモリ等の半導体記憶装置があげられる。入力インターフェイス114は、CPU111と、キーボード及びマウスといった入力機器118との間のデータ伝送を仲介する。表示コントローラ115は、ディスプレイ装置119と接続され、ディスプレイ装置119での表示を制御する。
 データリーダ/ライタ116は、CPU111と記録媒体120との間のデータ伝送を仲介し、記録媒体120からのプログラムの読み出し、及びコンピュータ110における処理結果の記録媒体120への書き込みを実行する。通信インターフェイス117は、CPU111と、他のコンピュータとの間のデータ伝送を仲介する。
 また、記録媒体120の具体例としては、CF(Compact Flash(登録商標))及びSD(Secure Digital)等の汎用的な半導体記憶デバイス、フレキシブルディスク(Flexible Disk)等の磁気記録媒体、又はCD-ROM(Compact Disk Read Only Memory)などの光学記録媒体があげられる。
[付記]
 以上の実施の形態に関し、更に以下の付記を開示する。上述した実施の形態の一部又は全部は、以下に記載する(付記1)から(付記12)により表現することができるが、以下の記載に限定されるものではない。
(付記1)
 入力データのデータサイズを表す入力データ情報と、カーネルのデータサイズを表すカーネル情報と、畳み込み処理で用いるパラメータを表すパラメータ情報とを用いて、前記畳み込み処理において実行される行列処理ごとに、メモリアクセスに基づいて、前記行列処理のコストを算出する、コスト算出部と、
 前記行列処理を組み合わせ、組み合わせに含まれる前記行列処理に対応する前記コストを合計し、組み合わせごとに合計したコストのうち、最小となる前記合計したコストに対応する前記行列処理の組み合わせを選択する、行列処理選択部と、
 を有することを特徴とする情報処理装置。
(付記2)
 付記1に記載の情報処理装置であって、
 前記コスト算出部は、列行列変換処理におけるメモリアクセスに基づいて、前記列行列変換処理のコストを算出する
 ことを特徴とする情報処理装置。
(付記3)
 付記2に記載の情報処理装置であって、
 前記コスト算出部は、行列積処理におけるメモリアクセスに基づいて、前記行列積処理のコストを算出する
 ことを特徴とする情報処理装置。
(付記4)
 付記3に記載の情報処理装置であって、
 前記コスト算出部は、前記列行列変換処理の出力データを変換するデータ変換処理におけるメモリアクセスに基づいて、前記データ変換処理のコストを算出する
 ことを特徴とする情報処理装置。
(付記5)
(a)入力データのデータサイズを表す入力データ情報と、カーネルのデータサイズを表すカーネル情報と、畳み込み処理で用いるパラメータを表すパラメータ情報とを用いて、前記畳み込み処理において実行される行列処理ごとに、メモリアクセスに基づいて、前記行列処理のコストを算出する、ステップと、
(b)前記行列処理を組み合わせ、組み合わせに含まれる前記行列処理に対応する前記コストを合計し、組み合わせごとに合計したコストのうち、最小となる前記合計したコストに対応する前記行列処理の組み合わせを選択する、ステップと、
 を有することを特徴とする情報処理方法。
(付記6)
 付記5に記載の情報処理方法であって、
 前記(a)のステップにおいて、列行列変換処理におけるメモリアクセスに基づいて、前記列行列変換処理のコストを算出する
 ことを特徴とする情報処理方法。
(付記7)
 付記6に記載の情報処理方法であって、
 前記(a)のステップにおいて、行列積処理におけるメモリアクセスに基づいて、前記行列積処理のコストを算出する
 ことを特徴とする情報処理方法。
(付記8)
 付記7に記載の情報処理方法であって、
 前記(a)のステップにおいて、前記列行列変換処理の出力データを変換するデータ変換処理におけるメモリアクセスに基づいて、前記データ変換処理のコストを算出する
 ことを特徴とする情報処理方法。
(付記9)
 コンピュータに、
(a)入力データのデータサイズを表す入力データ情報と、カーネルのデータサイズを表すカーネル情報と、畳み込み処理で用いるパラメータを表すパラメータ情報とを用いて、前記畳み込み処理において実行される行列処理ごとに、メモリアクセスに基づいて、前記行列処理のコストを算出する、ステップと、
(b)前記行列処理を組み合わせ、組み合わせに含まれる前記行列処理に対応する前記コストを合計し、組み合わせごとに合計したコストのうち、最小となる前記合計したコストに対応する前記行列処理の組み合わせを選択する、ステップと、
 を実行させるプログラムを記録したコンピュータ読み取り可能な記録媒体。
(付記10)
 付記9に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体であって、
 前記(a)のステップにおいて、列行列変換処理におけるメモリアクセスに基づいて、前記列行列変換処理のコストを算出する
 プログラムを記録したコンピュータ読み取り可能な記録媒体。
(付記11)
 付記10に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体であって、
 前記(a)のステップにおいて、行列積処理におけるメモリアクセスに基づいて、前記行列積処理のコストを算出する
 プログラムを記録したコンピュータ読み取り可能な記録媒体。
(付記12)
 付記11に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体であって、
 前記(a)のステップにおいて、前記列行列変換処理の出力データを変換するデータ変換処理におけるメモリアクセスに基づいて、前記データ変換処理のコストを算出する
 プログラムを記録したコンピュータ読み取り可能な記録媒体。
 以上、実施の形態を参照して本願発明を説明したが、本願発明は上記実施の形態に限定されるものではない。本願発明の構成や詳細には、本願発明のスコープ内で当業者が理解し得る様々な変更をすることができる。
 以上のように本発明によれば、畳み込み処理の処理速度を向上させることができる。本発明は、畳み込み層を用いた深層学習を必要とする分野において有用である。例えば、物体認識、音声認識、自然言語処理、生体認証などの分野において有用である。
  1 情報処理装置
  2 コスト算出部
  3 行列処理選択部
 20 畳み込み処理部
 21 列行列変換処理コスト算出部
 22 行列積処理コスト算出部
 23 データ変換処理コスト算出部
110 コンピュータ
111 CPU
112 メインメモリ
113 記憶装置
114 入力インターフェイス
115 表示コントローラ
116 データリーダ/ライタ
117 通信インターフェイス
118 入力機器
119 ディスプレイ装置
120 記録媒体
121 バス

Claims (12)

  1.  入力データのデータサイズを表す入力データ情報と、カーネルのデータサイズを表すカーネル情報と、畳み込み処理で用いるパラメータを表すパラメータ情報とを用いて、前記畳み込み処理において実行される行列処理ごとに、メモリアクセスに基づいて、前記行列処理のコストを算出する、コスト算出手段と、
     前記行列処理を組み合わせ、組み合わせに含まれる前記行列処理に対応する前記コストを合計し、組み合わせごとに合計したコストのうち、最小となる前記合計したコストに対応する前記行列処理の組み合わせを選択する、行列処理選択手段と、
     を有することを特徴とする情報処理装置。
  2.  請求項1に記載の情報処理装置であって、
     前記コスト算出手段は、列行列変換処理におけるメモリアクセスに基づいて、前記列行列変換処理のコストを算出する
     ことを特徴とする情報処理装置。
  3.  請求項2に記載の情報処理装置であって、
     前記コスト算出手段は、行列積処理におけるメモリアクセスに基づいて、前記行列積処理のコストを算出する
     ことを特徴とする情報処理装置。
  4.  請求項3に記載の情報処理装置であって、
     前記コスト算出手段は、前記列行列変換処理の出力データを変換するデータ変換処理におけるメモリアクセスに基づいて、前記データ変換処理のコストを算出する
     ことを特徴とする情報処理装置。
  5. (a)入力データのデータサイズを表す入力データ情報と、カーネルのデータサイズを表すカーネル情報と、畳み込み処理で用いるパラメータを表すパラメータ情報とを用いて、前記畳み込み処理において実行される行列処理ごとに、メモリアクセスに基づいて、前記行列処理のコストを算出する、ステップと、
    (b)前記行列処理を組み合わせ、組み合わせに含まれる前記行列処理に対応する前記コストを合計し、組み合わせごとに合計したコストのうち、最小となる前記合計したコストに対応する前記行列処理の組み合わせを選択する、ステップと、
     を有することを特徴とする情報処理方法。
  6.  請求項5に記載の情報処理方法であって、
     前記(a)のステップにおいて、列行列変換処理におけるメモリアクセスに基づいて、前記列行列変換処理のコストを算出する
     を有することを特徴とする情報処理方法。
  7.  請求項6に記載の情報処理方法であって、
     前記(a)のステップにおいて、行列積処理におけるメモリアクセスに基づいて、前記行列積処理のコストを算出する
     を有することを特徴とする情報処理方法。
  8.  請求項7に記載の情報処理方法であって、
     前記(a)のステップにおいて、前記列行列変換処理の出力データを変換するデータ変換処理におけるメモリアクセスに基づいて、前記データ変換処理のコストを算出する
     を有することを特徴とする情報処理方法。
  9.  コンピュータに、
    (a)入力データのデータサイズを表す入力データ情報と、カーネルのデータサイズを表すカーネル情報と、畳み込み処理で用いるパラメータを表すパラメータ情報とを用いて、前記畳み込み処理において実行される行列処理ごとに、メモリアクセスに基づいて、前記行列処理のコストを算出する、ステップと、
    (b)前記行列処理を組み合わせ、組み合わせに含まれる前記行列処理に対応する前記コストを合計し、組み合わせごとに合計したコストのうち、最小となる前記合計したコストに対応する前記行列処理の組み合わせを選択する、ステップと、
     を実行させるプログラムを記録したコンピュータ読み取り可能な記録媒体。
  10.  請求項9に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体であって、
     前記(a)のステップにおいて、列行列変換処理におけるメモリアクセスに基づいて、前記列行列変換処理のコストを算出する
     プログラムを記録したコンピュータ読み取り可能な記録媒体。
  11.  請求項10に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体であって、
     前記(a)のステップにおいて、行列積処理におけるメモリアクセスに基づいて、前記行列積処理のコストを算出する
     プログラムを記録したコンピュータ読み取り可能な記録媒体。
  12.  請求項11に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体であって、
     前記(a)のステップにおいて、前記列行列変換処理の出力データを変換するデータ変換処理におけるメモリアクセスに基づいて、前記データ変換処理のコストを算出する
     プログラムを記録したコンピュータ読み取り可能な記録媒体。
PCT/JP2018/029693 2018-08-07 2018-08-07 情報処理装置、情報処理方法、及びコンピュータ読み取り可能な記録媒体 WO2020031281A1 (ja)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP2020535386A JP7020555B2 (ja) 2018-08-07 2018-08-07 情報処理装置、情報処理方法、及びプログラム
US17/266,183 US20210312013A1 (en) 2018-08-07 2018-08-07 Information processing apparatus, information processing method, and computer-readable recording medium
PCT/JP2018/029693 WO2020031281A1 (ja) 2018-08-07 2018-08-07 情報処理装置、情報処理方法、及びコンピュータ読み取り可能な記録媒体
US17/682,132 US20220188382A1 (en) 2018-08-07 2022-02-28 Information processing apparatus, information processing method, and computer-readable recording medium
US17/682,102 US20220179923A1 (en) 2018-08-07 2022-02-28 Information processing apparatus, information processing method, and computer-readable recording medium
US17/682,118 US20220179924A1 (en) 2018-08-07 2022-02-28 Information processing apparatus, information processing method, and computer-readable recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2018/029693 WO2020031281A1 (ja) 2018-08-07 2018-08-07 情報処理装置、情報処理方法、及びコンピュータ読み取り可能な記録媒体

Related Child Applications (4)

Application Number Title Priority Date Filing Date
US17/266,183 A-371-Of-International US20210312013A1 (en) 2018-08-07 2018-08-07 Information processing apparatus, information processing method, and computer-readable recording medium
US17/682,132 Continuation US20220188382A1 (en) 2018-08-07 2022-02-28 Information processing apparatus, information processing method, and computer-readable recording medium
US17/682,102 Continuation US20220179923A1 (en) 2018-08-07 2022-02-28 Information processing apparatus, information processing method, and computer-readable recording medium
US17/682,118 Continuation US20220179924A1 (en) 2018-08-07 2022-02-28 Information processing apparatus, information processing method, and computer-readable recording medium

Publications (1)

Publication Number Publication Date
WO2020031281A1 true WO2020031281A1 (ja) 2020-02-13

Family

ID=69415427

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2018/029693 WO2020031281A1 (ja) 2018-08-07 2018-08-07 情報処理装置、情報処理方法、及びコンピュータ読み取り可能な記録媒体

Country Status (3)

Country Link
US (4) US20210312013A1 (ja)
JP (1) JP7020555B2 (ja)
WO (1) WO2020031281A1 (ja)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111951269B (zh) * 2020-10-16 2021-01-05 深圳云天励飞技术股份有限公司 图像处理方法及相关设备

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018018422A (ja) * 2016-07-29 2018-02-01 株式会社デンソーアイティーラボラトリ 予測装置、予測方法および予測プログラム
WO2018067603A1 (en) * 2016-10-04 2018-04-12 Magic Leap, Inc. Efficient data layouts for convolutional neural networks

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2017279610A1 (en) * 2017-12-19 2019-07-04 Canon Kabushiki Kaisha Memory access optimisation using per-layer computational mapping and memory allocation for CNN application
CN109993275B (zh) * 2017-12-29 2021-01-29 华为技术有限公司 一种信号处理方法及装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018018422A (ja) * 2016-07-29 2018-02-01 株式会社デンソーアイティーラボラトリ 予測装置、予測方法および予測プログラム
WO2018067603A1 (en) * 2016-10-04 2018-04-12 Magic Leap, Inc. Efficient data layouts for convolutional neural networks

Also Published As

Publication number Publication date
JPWO2020031281A1 (ja) 2021-08-02
US20220179924A1 (en) 2022-06-09
US20220179923A1 (en) 2022-06-09
JP7020555B2 (ja) 2022-02-16
US20210312013A1 (en) 2021-10-07
US20220188382A1 (en) 2022-06-16

Similar Documents

Publication Publication Date Title
CN111465924B (zh) 用于将矩阵输入转换为矩阵处理器的向量化输入的系统和方法
US10534607B2 (en) Accessing data in multi-dimensional tensors using adders
US10802956B2 (en) Accessing prologue and epilogue data
JP2020506454A (ja) ハードウェアにおける平均プーリングの実行
JP6922556B2 (ja) 生成プログラム、生成方法、生成装置、及び剽窃検知プログラム
JP6079433B2 (ja) 移動平均処理プログラム、及びプロセッサ
JP2018197906A (ja) 情報処理装置、マルチスレッド行列演算方法、およびマルチスレッド行列演算プログラム
US20220179923A1 (en) Information processing apparatus, information processing method, and computer-readable recording medium
US20210319080A1 (en) Tensor data calculating apparatus, tensor data calculating method and program
US11573765B2 (en) Fused convolution and batch normalization for neural networks
US20230161555A1 (en) System and method performing floating-point operations
Zhang et al. Pass-efficient randomized LU algorithms for computing low-rank matrix approximation
Hishinuma et al. AVX acceleration of DD arithmetic between a sparse matrix and vector
WO2016056503A1 (ja) 部分文字列位置検出装置、部分文字列位置検出方法及びプログラム
CN113724127B (zh) 一种图像矩阵卷积的实现方法、计算设备及储存介质
CN113924610B (zh) 秘密共轭梯度法计算系统及方法、秘密计算装置、共轭梯度法计算装置及方法、以及记录介质
Ruffa et al. Parallelized solution of banded linear systems with an introduction to p-adic computation
US20230281270A1 (en) Recording medium and information processing method
CN111723917A (zh) 运算方法、装置及相关产品
US20230118082A1 (en) Apparatus, method and system for matrix multiplication reusing multiply accumulate operation
JP7052874B2 (ja) 情報処理装置、情報処理方法及びプログラム
US11853211B2 (en) Computer-readable recording medium storing data placement program, processor, and data placement method
KR20240041036A (ko) 메모리 프로세서 연산 방법 및 장치
CN113778376A (zh) 改进的用于执行乘法/累加运算的设备
KR20210019917A (ko) 뉴럴 네트워크를 위한 데이터 처리 방법 및 장치

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18929691

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020535386

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18929691

Country of ref document: EP

Kind code of ref document: A1