WO2019077933A1 - 演算回路および演算方法 - Google Patents

演算回路および演算方法 Download PDF

Info

Publication number
WO2019077933A1
WO2019077933A1 PCT/JP2018/034834 JP2018034834W WO2019077933A1 WO 2019077933 A1 WO2019077933 A1 WO 2019077933A1 JP 2018034834 W JP2018034834 W JP 2018034834W WO 2019077933 A1 WO2019077933 A1 WO 2019077933A1
Authority
WO
WIPO (PCT)
Prior art keywords
output
circuit
input
elements
vector
Prior art date
Application number
PCT/JP2018/034834
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 DE112018004972.8T priority Critical patent/DE112018004972T5/de
Priority to US16/645,599 priority patent/US11281376B2/en
Priority to JP2019549165A priority patent/JP6906622B2/ja
Priority to CN201880066106.8A priority patent/CN111201525A/zh
Publication of WO2019077933A1 publication Critical patent/WO2019077933A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0613Improving I/O performance in relation to throughput
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
    • G06N3/065Analogue means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • 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 disclosure relates to an arithmetic circuit and an arithmetic method, and, for example, to an arithmetic circuit and an arithmetic method suitably used for arithmetic operations performed in parallel using a plurality of arithmetic units.
  • CNN Convolutional Neural Network
  • CNN consists of a convolution layer that performs convolution operations, a pooling layer that calculates local statistics, and an entire combined layer.
  • the convolutional layer repeatedly performs a product-sum operation of the corresponding part of the input feature map and the kernel while scanning the kernel (also referred to as a filter) on a pixel basis on the input feature map, and the final product-sum operation result is non-linear Output feature map is generated by conversion.
  • the main operation in these layers is the operation (Ax + b) of the sum of the product of the large matrix (A) with many zero-valued elements and the vector (x) and the offset (b).
  • processing time is reduced by processing operations by a parallel processing device using a plurality of computing units.
  • Patent Document 1 describes a vector having a plurality of operation pipelines Disclose a processor. This vector processor causes the pipeline not executing an instruction to execute the next vector operation instruction, when the number of data to be operated on of one vector operation instruction is not an integral multiple of the number of pipelines. This speeds up parallel processing.
  • Patent Document 2 discloses a product-sum operation device that reads N data in a predetermined address order and performs a product-sum operation.
  • This product-sum operation unit does not generate an address corresponding to data having a value of 0 when generating an address of a storage device storing data when N pieces of data include the value 0.
  • the product-sum operation of data having the value 0 is not performed, the amount of operation is reduced, and speeding up of the operation is realized.
  • the operation processing of the product of the matrix (A) and the vector (x) in the parallel operation device having a plurality of operation units is roughly divided into (i) matrix (A) of which each operation unit is an object of operation Elements and offsets (b), processing of fetching input vector (x) from an external device, (ii) processing of executing operations in parallel using data fetched by a plurality of computing units, and (iii)
  • the computing unit is configured to output the result of the computation to an external device.
  • the operation processing time is shortened, so that requests for access from each computing unit to the external device are likely to occur simultaneously.
  • arbitration such as arranging and reordering the access requests from each arithmetic unit is required, and data input processing (i) and data output processing from an external device (iii Processing time is not shortened. Therefore, the overall processing time is limited by data input processing (i) and data output processing (iii) despite speeding up of parallel arithmetic processing, and as a result, the overall processing time can not be reduced as much as expected. Become.
  • Patent Document 1 discloses a technique for speeding up parallel operation processing, but does not disclose a technique related to shortening the processing time of the data input processing (i) or the data output processing (iii) described above.
  • Patent Document 2 discloses a technique for speeding up the operation by not generating an address corresponding to data having a value 0, but the data input process (i) or the data output described above in parallel operation processing is disclosed. It does not disclose a technique for shortening the processing time of the treatment (iii).
  • the present disclosure takes the above problems into consideration, and an object thereof is to provide an arithmetic circuit and an arithmetic method capable of shortening the overall processing time.
  • the arithmetic circuit in one embodiment includes: a parallel arithmetic circuit including a plurality of arithmetic units configured to multiply an input vector from the right by a coefficient matrix including non-zero elements and zero elements, and output an operation result to an output vector; And an input interface including a plurality of storage circuits.
  • the arithmetic circuit supplies the elements of the vector to be operated by the operator in the order to be operated, to each operator.
  • the plurality of computing units respectively correspond to the plurality of storage circuits.
  • Each memory circuit is an input memory circuit for storing elements of an input vector, a coefficient memory circuit including a ring buffer, and the coefficient memory circuit for storing elements of a row or column vector constituting a coefficient matrix in the ring buffer And.
  • the elements of the input vector and the elements of the coefficient matrix have indices that specify the order in which the elements are to be multiplied.
  • the input interface includes input vector and coefficient matrix elements, based on the indexes of the elements, to an input storage circuit corresponding to one computing element out of the plurality of computing elements and to a ring buffer of the coefficient storage circuit, respectively. It is configured to store in order.
  • Each operator sequentially performs multiplication of elements of the row or column vector of the coefficient matrix of the memory circuit and the corresponding elements of the input vector, and based on the indices of the elements, the result of the multiplication is the corresponding element of the output vector It is configured to integrate to
  • the element of the input vector or the element of the row or column vector constituting the coefficient matrix is an input memory corresponding to one of the plurality of arithmetic elements based on the index of the element.
  • the circuit and coefficient storage circuit are stored in the order of the order to be calculated in the ring buffer.
  • each operation is repeated when the operation using elements of the same row or column vector of the coefficient matrix is repeated while changing the input vector.
  • the process of initializing the coefficient storage circuit can be omitted at the start of the process. In addition, by omitting the initialization process, it is possible to shorten the overall processing time required for parallel computation.
  • FIG. 2 is a diagram showing an example of the configuration of the arithmetic circuit 12 according to the first embodiment in association with peripheral circuits. 5 is a diagram for explaining the computing unit CLk of FIG. 4 in association with input / output data.
  • FIG. 2 is a diagram showing configurations of an input I / F and an output I / F according to the first embodiment.
  • FIG. 2 is a diagram showing an example of configurations of an input storage circuit, an output storage circuit, and a coefficient storage circuit according to the first embodiment.
  • FIG. 2 is a diagram schematically illustrating a storage method according to the first embodiment.
  • FIG. 2 is a diagram showing an example of a configuration of an input conversion circuit according to a first embodiment.
  • FIG. 1 is a diagram showing an example of a configuration of an output conversion circuit according to a first embodiment.
  • FIG. 6 is a diagram showing a specific example of the association between the computing unit CLk shown in FIG. 5 and an element to be computed.
  • 7 is a flowchart illustrating parallel processing according to the first embodiment.
  • FIG. 7 is a diagram showing a configuration of an input I / F and an output I / F of an arithmetic circuit 12A according to a second embodiment. It is a figure which shows the structure of the input notification circuit 133C of FIG. FIG.
  • FIG. 16 is a diagram showing the configuration of an input I / F and an output I / F of an arithmetic circuit 12B according to a third embodiment.
  • FIG. 16 is a diagram showing the configuration of the output notification circuit 143 of FIG. 15 in association with peripheral circuits.
  • FIG. 17 is a diagram showing the configuration of an input I / F and an output I / F of an arithmetic circuit 12B according to a fourth embodiment.
  • FIG. 18 is a diagram showing the configuration of an input I / F and an output I / F of an arithmetic circuit 12D according to a fifth embodiment.
  • FIG. 18 is a diagram showing the configuration of an input I / F and an output I / F of an arithmetic circuit 12E according to a sixth embodiment.
  • FIG. 21 is a diagram showing the configuration of an input I / F and an output I / F of an arithmetic circuit 12F according to a seventh embodiment.
  • FIG. 18 is a diagram showing a configuration of an arithmetic circuit according to an eighth embodiment.
  • FIG. 18 is a diagram showing a configuration of an arithmetic circuit according to a ninth embodiment.
  • FIG. 21 is a diagram showing a configuration of an arithmetic circuit according to a tenth embodiment. It is a figure which shows typically an example of the structure which can perform calculation according to the "matrix case" of the arithmetic circuit which concerns on each embodiment of this invention. It is a figure which shows typically another example of the structure which can perform calculation according to the "matrix case” of the arithmetic circuit which concerns on each embodiment of this invention.
  • FIG. 1 is a flowchart showing operation processing by CNN.
  • CNN includes an input layer S201, convolutional layers S202 and S204, pooling layers S203 and S205, a total coupling layer S206, and an output layer S207.
  • the input layer S201 receives input of data to be processed, such as image data.
  • the output layer S207 outputs the final result after data processing.
  • the combination of the convolution layer and the pooling layer (S202, S203; S204, S205) is repeated twice for simplicity, but may be repeated more times.
  • the input data of the convolutional layer is called an input feature map
  • the output data of the convolutional layer is called an output feature map.
  • the convolutional layers S202 and S204 repeatedly perform a product-sum operation of the corresponding part of the input feature map and the kernel while scanning the kernel (also referred to as a filter) on a pixel basis on the input feature map, and perform the final product-sum operation.
  • Output feature maps are generated by non-linear transformation of the results.
  • the elements of the kernel also called "weights" are determined in advance by learning. Details of the convolution operation will be described later with reference to FIG.
  • the pooling layers S203 and S205 reduce the space size of the feature map by performing an operation to combine local regions of the output feature map into one element.
  • the pooling layers S203 and S205 for example, take the maximum value of the local region, and average elements included in the local region.
  • the entire bonding layer S206 is provided adjacent to the output layer S207 in one or more layers.
  • Each neuron in S206 of the total connection layer has connections with all neurons in the adjacent layer.
  • FIG. 2 is a diagram for explaining the convolution operation.
  • output data 102 is generated by a convolution operation of input data 100 as an input feature map and kernel 101.
  • Output feature data is generated by adding a bias to each element of the output data 102 and further applying an activation function.
  • a non-linear function such as ReLU (Rectified Linear Unit) is used as the activation function.
  • the input data size is (7, 7) and the kernel size is (3, 3) for simplicity.
  • the perimeter 104 of the input data 100 may be filled with fixed data (e.g., 0) to adjust the output data size. This is called padding. Padding having a width of 1 and a value of 0 is applied to the input data 100 of FIG.
  • elements of the kernel 101 are multiplied by corresponding elements of the input data 100 while sliding the kernel 101 at regular intervals on the input data 100 including the padding part, and their sum is obtained. That is, a product-sum operation is performed. The result of the product-sum operation is stored in the corresponding element of the output data 102.
  • the interval at which the kernel 101 is slid is referred to as stride. In the case of FIG. 2, the stride is one.
  • the product-sum operation result “30” is stored at the position of the corresponding element 106 of the output data 102.
  • the product-sum operation result “13” is stored at the position of the corresponding element 107 of the output data 102.
  • FIG. 3 is a diagram for explaining the development of the feature map and the kernel.
  • the feature map in order to shorten the processing time of the convolution operation, the feature map is expanded into one column by connecting the respective rows of the feature map.
  • the input vector 110 of FIG. 3 is generated by connecting the respective rows of the input data 100 of FIG.
  • the output data 102 of FIG. 2 is also expanded into one column by connecting the rows one by one.
  • the number of elements of the output vector corresponding to the output data 102 is also 49.
  • Kernel 101 of FIG. 2 is expanded into a matrix such that when the input vector 110 is multiplied from the right, an output vector corresponding to the output data 102 of FIG. 2 is generated.
  • the coefficient matrix 111 is thereby generated.
  • the number of rows of the coefficient matrix 111 is 49 in the first to 49th rows, and the number of columns of the coefficient matrix 111 is 49 in the first to 49th columns.
  • the first row of the coefficient matrix 111 is (3, 2, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0), and the kernel 101 of FIG. It corresponds to the case where it is located in the frame 105 of the thick broken line of.
  • the ninth row of the coefficient matrix 111 is (3, 2, 1, 0, 0, 0, 0, 1, 3, 2, 2, 0, 0, 0, 0, 2, 1, 3, 3, 0, ... , 0), which corresponds to the case where the kernel 101 of FIG. 2 is positioned in the thick solid frame 103 on the feature map.
  • data "30" stored at the position of the corresponding element 106 of the output data 102 of FIG. 2 is generated.
  • the matrix equation executed in the convolution operation is generally represented by equation (1). That is, the output vector f of the convolution operation is obtained by multiplying the coefficient matrix A by the input vector x from the right and adding the bias vector b to the result of the operation.
  • the coefficient matrix A is characterized in that it contains a relatively large number of elements whose value is zero.
  • the elements of the output vector f are f 1 ,..., F n .
  • An element of the i-th output vector f is described as f i or f (i).
  • An element of the j-th input vector x is described as x j or x (j).
  • the elements of the bias vector b are b 1 ,..., B n .
  • An element of the i-th bias vector b is described as b i or b (i).
  • the coefficient matrix A is configured by the first to n-th n rows and the first to m-th m columns.
  • An element of the coefficient matrix A in the i-th row and the j-th column is described as A ij or A (i, j).
  • the value ij or j which is an index of each element, is an identifier of the element, and an operator CLk described later which should operate the element and the element designate and operate the operator CLk. It is also possible to specify the order to be done.
  • FIG. 4 is a diagram showing an example of the configuration of the arithmetic circuit 12 according to the first embodiment in association with peripheral circuits.
  • the arithmetic circuit 12 is an example of the “arithmetic unit”.
  • Arithmetic circuit 12 includes a plurality of arithmetic units CLk. Each computing unit CLk is provided corresponding to each row of the coefficient matrix A.
  • each arithmetic unit CLk executes the product-sum operation in parallel with the other arithmetic units CLk.
  • the control circuit 30 includes a processor 31 and a memory 32 including, for example, a non-volatile storage medium.
  • the memory 32 stores a control program 150 for controlling the arithmetic circuit 12.
  • Arithmetic circuit 12 inputs an external input device 61 for inputting data for arithmetic operation to arithmetic circuit 12, an external output device 63 for outputting the arithmetic result from arithmetic circuit 12 to the outside, and an external such as a static random access memory (SRAM).
  • a storage device 62 is connected via a bus 45.
  • a central processing unit (CPU) 51 including a memory 50 is connected to the external input device 61, the external storage device 62, and the external output device 63 via a bus 40.
  • the memory 50 stores the coefficient matrix A, the input vector x and the bias vector b, and the calculation result of the calculation circuit 12.
  • the CPU 51 controls the external input device 61, the external storage device 62, and the external output device 63.
  • the CPU 51 reads the coefficient matrix A, the input vector x and the bias vector b from the memory 50 and outputs the coefficient matrix A, the input vector x and the bias vector b to the input I / F 122 of the arithmetic circuit 12 through the external input device 61 or the external storage device 62.
  • the external output device 63 receives an operation result from the output I / F 123 and outputs the input operation result to the CPU 51 via the bus 40.
  • the CPU 51 stores the calculation result from the external output device 63 in the memory 51. Further, the calculation result from the output I / F 123 may be stored in the external storage device 62.
  • the external storage device 62 and the external output device 63 are connected to the output I / F 123 via a plurality of wired or wireless circuits.
  • the output I / F 123 includes a port 17 that connects each line.
  • the memory 51 may be connected to the bus 40 instead of the CPU 50.
  • the external storage device 62 may include the memory 50.
  • FIG. 5 is a diagram for explaining the computing unit CLk of FIG. 4 in association with input / output data.
  • arithmetic unit CLk includes an accumulator T1, a multiplier T2, an adder T3 and a register T4.
  • a coefficient storage circuit 132 and an input storage circuit 133 which can be read from the computing unit CLk are connected to the computing unit CLk.
  • the “input storage circuit” is a circuit that stores an input to the parallel operation circuit 121 between the parallel operation circuit 121 and the external device.
  • the coefficient storage circuit 132 and the input storage circuit 133 are included in the input I / F 122 of FIG.
  • FIG. 5 shows one of the plurality of computing units CLk of the parallel computing device, the other computing units have the same configuration.
  • the coefficient storage circuit 132 stores the elements A k1 to A kn of the k-th row of the coefficient matrix A and the k-th element b k of the bias vector b. Further, in the input storage circuit 133, elements x 1 to x n of the input vector x are stored.
  • the accumulator T1 adds the element b k read from the input storage circuit 133 and the sum from the adder T3 and adds the addition result to the accumulated value sum. Thus, one operation process is completed.
  • Such a product-sum operation consisting of the sum of the product of the element A km of the coefficient storage circuit 132 and the corresponding element x m of the input storage circuit 133 and the accumulated value sum is repeated n times.
  • each computing unit CLk performs the product-sum operation of the assigned row independently of the other computing units CLk, the element A km of the coefficient storage circuit 132 and the element x m of the corresponding input storage circuit 133. Repeat the total number (m) of the set of. As a result, the accumulated value sum of the accumulator T1 of each computing unit CLk is output to the output I / F 123 as the element f k of the output vector f.
  • FIG. 6 is a diagram showing the configuration of an input I / F and an output I / F according to the first embodiment.
  • the configurations of the input I / F and the output I / F are shown in association with peripheral circuits excluding the control circuit 30.
  • the parallel operation circuit 121 connects the shared memory 124.
  • the shared memory 124 is configured to be writable and readable by each computing unit CLk.
  • input I / F 122 includes an input conversion circuit 131, a coefficient storage circuit 132, and an input storage circuit 133.
  • the output I / F 123 includes an output conversion circuit 141 and an output storage circuit 142.
  • the “output storage circuit” is a circuit that stores the output from the parallel operation circuit 121 between the parallel operation circuit 121 and the external device.
  • FIG. 7 is a diagram showing an example of configurations of an input storage circuit, an output storage circuit, and a coefficient storage circuit according to the first embodiment.
  • FIG. 8 is a diagram schematically illustrating the storage method according to the first embodiment.
  • FIG. 9 is a diagram showing an example of the configuration of the input conversion circuit according to the first embodiment.
  • FIG. 10 is a diagram showing an example of the configuration of the output conversion circuit according to the first embodiment.
  • the plurality of storage circuits MIk are provided corresponding to the respective operation units CLk, that is, provided corresponding to the respective rows of the input vector x, and are configured to be readable by the corresponding operation units CLk.
  • Memory circuit MIk includes a plurality of registers for storing element x j of input vector x.
  • the plurality of storage circuits MOk are configured so that the element f i of the output vector f can be written and the element f i can be read.
  • the plurality of storage circuits Ck are provided corresponding to the respective operation units CLk, that is, provided corresponding to the respective rows of the coefficient matrix A, and are configured to be readable by the corresponding operation units CLk.
  • Storage circuit Ck for example as shown in FIG. 8 (B), comprising a plurality of registers for storing elements A ij elements b i and the coefficient matrix A in the bias vector b.
  • the input conversion circuit 131 has, for example, the configuration shown in FIG. Referring to FIG. 9, input conversion circuit 131 includes selector 13 corresponding to each storage circuit of coefficient storage circuit 132 and input storage circuit 133, and table or dedicated circuit 15.
  • the table or dedicated circuit 15 outputs the selection command 151 to each selector.
  • Selection command 151 selects any one of elements A ij of coefficient matrix A from external storage device 62 or external input device 61, elements x j of input vector x and elements b i of bias vector b, Indicates a command to write to the memory circuit.
  • the selection command 151 includes, for example, the index values of the element A ij , the element x j and the element b i .
  • each selector 13 receives the received element A ij , an element According to the index of x j and element b i and selection command 151, the element is selected, and the selected element A ij , element x j and element b i are written in corresponding memory circuit MIk or memory circuit Ck.
  • the selector 13 selects only the non-zero element A ij among the elements A ij according to the selection command 151. Then, the selector 13 stores the selected element A ij and element b i in the corresponding storage circuit Ck.
  • Each selector 13 of input conversion circuit 131 selects element x j to be stored in corresponding memory circuit MIk in accordance with the index of element x j received from external storage device 62 or external input device 61 and selection command 151. . In this selection, the selector 13 selects only the element x j corresponding to the non-zero element A ij according to the selection command 151. Selector 13 stores the selected element x j in the corresponding memory circuit MIk.
  • selector 13 of input conversion circuit 131 corresponds to the corresponding storage in the order indicated by the index value of the element.
  • the selector 13 among the plurality of registers of the storage circuit Ck containing the elements A ij to a register addressed value indicated by the index of the element A ij (the number) as an address.
  • the selector 13 stores the element b i in a predetermined register different from the register of the element A ij among the plurality of registers of the memory circuit Ck.
  • the selector 13 among the plurality of registers of the storage circuit MIk containing the elements x j to a register addressed value indicated by the index of the element x j a (numerical) as an address.
  • the storage circuit Ck and the storage circuit MIk store the element x j necessary for the product-sum operation of the corresponding computing unit CLk, the non-zero element A ij and the element b i .
  • non-zero elements A ij are stored in the order to be calculated
  • elements b i corresponding to non-zero elements A ij are stored in the order to be calculated Be done.
  • Table of input conversion circuit or dedicated circuit In the first embodiment, it is determined in advance which row of the coefficient matrix A each operation unit CLk is assigned, and the position in the input vector x of the element x j to be calculated with the non-zero element A ij. There is. Therefore, information indicating such predetermined contents is stored in the table or dedicated circuit 15, and the dedicated circuit generates and generates selection commands 151 for each selector 13 according to the stored information. The selected command 161 is output to the selector 13. If the assignment of the row of the coefficient matrix A to the computing unit CLk and the position in the input vector x of the element x j to be computed as the nonzero element A ij are not changed, the table or dedicated circuit 15 is fixed Can be configured as a circuit of
  • the output conversion circuit 141 has, for example, the configuration shown in FIG. Referring to FIG. 10, output conversion circuit 141 includes a plurality of selectors 14 and a table or dedicated circuit 16. The plurality of selectors 14 correspond to the plurality of storage circuits MOk of the output storage circuit 142, respectively. Memory circuit MOk includes one or more registers.
  • the output f i stored in the output storage circuit 142 is output to the external storage device 62 or the external output device 63, but the output f that can be simultaneously output to the external storage device 62 or the external output device 63
  • the number of i is predetermined. Therefore, the output storage circuit 142 has the same number of storage circuits MOk as the number of outputs f i that can be output simultaneously.
  • the plurality of storage circuits MOk are connected to the external storage device 62 or the external output device 63 via the port 17 respectively.
  • Each selector 14 of the output conversion circuit 141 when storing the output f i from the parallel arithmetic operation circuit 121 in the memory circuit MOk, based on the value of the index of the output f i and selection command 161 from a table or dedicated circuit 16, a plurality One of the storage circuits MOk (ie, one of the plurality of ports 17) is determined, and the output f i is stored in the determined storage circuit MOk.
  • the index of the output f i also plays the role as an identifier for identifying the output f i.
  • the selector 14, when storing the output f i determines the address from the index of the selection command 161 output f i, are addressed by the determined address to store the output f i in the register of the storage circuit MOk.
  • the table or dedicated circuit 16 stores the reference information described above.
  • the table or dedicated circuit 16 generates a selection command 161 addressed to each selector 14 based on the stored reference information, and outputs the generated selection command 161 to the selector 14.
  • the plurality of rows of coefficient matrix A correspond one-to-one to the plurality of computing units CLk
  • the position (capacity, number of registers) for storing the output f i of each memory circuit MOk may be only one.
  • the table or dedicated circuit 16 selects, for each selector 14, an instruction to select which one of the elements f i which is the operation result from the parallel operation circuit 121 to write to the corresponding memory circuit MOk.
  • the command 161 is output.
  • the selection command 161 includes, for example, the index value of the element f i .
  • the selector 14 the memory circuit MOk the parallel arithmetic operation circuit 121 selects an element f i on the basis of the selection command 161 from among the elements f i for color of each calculator CLk of the corresponding selected elements f i Store in Each memory circuit MOk is composed of a plurality of registers.
  • the output conversion circuit 141 stores the element f i in the register of the memory circuit MOk in the order according to the selection command 161.
  • the memory circuit MIk, the memory circuit MOk, and the memory circuit Ck include a plurality of addressable registers, the invention is not limited to the configuration using the registers.
  • any addressable storage circuit may be used, and may be configured to include, for example, an SRAM.
  • FIG. 11 is a diagram showing a specific example of the association between the computing unit CLk shown in FIG. 5 and the element to be computed.
  • the input conversion circuit 131 According to the input conversion circuit 131, only the non-zero element A ij and the element x j to be calculated by the corresponding operation unit CLk are stored in the storage circuit Ck and the storage circuit MIk. And they are stored in the order to be calculated.
  • multiplier T2 of operation unit CLk only reads elements from memory circuit Ck and memory circuit MIk in order in synchronization with the clock, and only the element to be subjected to product-sum operation in operation unit CLk is operated. It can be acquired according to the order to be done.
  • the method of storing coefficients is the first method of FIG. 8 (A) and the second method of FIG. 8 (B). Including the scheme of
  • 1 nd method corresponds to one line L of the corresponding memory circuit Ck to the element b i to continue with the coefficient matrix A calculator CLk Element A ij is stored in the order of index.
  • the coefficient read from the storage circuit Ck can be stored in the output storage circuit 142 via the output conversion circuit 141 by skipping the parallel operation circuit 121. .
  • the original coefficient data The second method (element A ij corresponding to the element b i and a line L), adds a flag F to specify the execution mode.
  • the flag F instructs the parallel operation circuit 121 on the type of processing such as operation to be performed using each coefficient (element A ij or element b i ) stored in the storage circuit Ck. Do.
  • the type of processing indicated by the execution flag is the product of element A ij and element x j , product-sum operation, loading of coefficient (element A ij or element b i ), input data (element x j ), Writing to the shared memory 124 (eg, writing the operation result (element f j )), reading from the shared memory 124, skipping each coefficient (element A ij or element b i ), the parallel operation circuit 121 And the output storage circuit 142 via the output conversion circuit 141.
  • the storage circuit Ck stores elements A ij corresponding to a plurality of rows L1 in the order of the index. It can also be transformed into
  • the arithmetic circuit 12 can be configured by an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA) including a plurality of arithmetic units capable of executing the matrix operation represented by the above equation (1) by parallel operation.
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • the parallel operation circuit 121 including the plurality of operation units CLk may be configured to execute a plurality of processes (for example, product-sum operation) in parallel.
  • the parallel operation circuit 121 is configured by a multi-core processor obtain. In that case, the plurality of processor cores respectively correspond to the plurality of computing units CLk.
  • the nonzero elements A ij of the matrix A and the corresponding elements x j of the input vector are stored in the coefficient storage circuit 132 via the input conversion circuit 131 at the time of initialization processing of the arithmetic circuit 12. It can be done. If the value of the nonzero element A ij of the matrix A and the value of the corresponding element x j of the input vector are fixed, the coefficient storage circuit 132 stores the value of the element x j corresponding to the nonzero element A ij May include a read only memory (ROM).
  • ROM read only memory
  • the product-sum operation for one row of the matrix A may be performed by two or more operators CLk.
  • the output storage circuit 142 can be used to store the calculation result of each calculator CLk in order to sum the calculation results from each calculator CLk.
  • a configuration specialized to the convolution operation capable of avoiding duplicate reading or reference of input data may be added between external storage device 62 or external input device 61 and input conversion circuit 131 of arithmetic circuit 12. .
  • the processing for cutting out the image part of the image from the line buffer as the input vector x requires line buffer fetching and kernel coefficient register (window) having the same number of lines as the height of a normal convolution kernel. It assumes that it takes in input data from.
  • a line buffer has a ring buffer structure in which data is fetched in raster scan order, and the oldest line is used as a next data fetch line when data for a line is fetched. Also good.
  • FIG. 12 is a flowchart illustrating parallel processing according to the first embodiment.
  • the process according to the flowchart of FIG. 12 is stored as the control program 150 in the memory 32 of the control circuit 30.
  • the processor 31 reads the control program 150 from the memory 32 and executes the read control program 150.
  • step S1 the processor 31 performs an initialization process
  • the processor 31 activates the input conversion circuit 131 to perform the initialization process.
  • Input conversion circuit 131 stores non-zero elements A ij of coefficient matrix A from external storage device 62 or external input device 61 and elements b i of bias vector b in a plurality of storage circuits Cn of coefficient storage circuit 132. .
  • the selector 13 corresponding to the memory circuit Cn, based on the index and selection command 151 elements A ij and element b i, the selected element A ij and element b i It is stored in the corresponding storage circuit Cn.
  • the arithmetic circuit 12 shifts to the normal processing.
  • the processor 31 of the control circuit 30 determines that the elements x 1 ,..., X m of the input vector x are output from the external storage device 62 or the external input device 61 to the arithmetic circuit 12.
  • the conversion circuit 131 stores the elements x 1 ,..., X m in the input storage circuit 133 (step S3).
  • the selector 13 stores the selected element x j in the corresponding memory circuit MIk based on the index of the elements x 1 ,..., X m and the selection command 151.
  • each storage circuit Ck is stored in the order in which non-zero elements A ij are to be calculated, and each storage circuit MI k is a non-zero element A ij.
  • the elements b i corresponding to are stored in the order to be calculated.
  • the processor 31 of the control circuit 30 causes the parallel operation circuit 121 to perform the operation (step S7).
  • coefficient data non-zero elements A ij and elements b i ) are stored in the memory circuit Ck according to the first method shown in FIG. 8A will be described.
  • Each operation unit CLk of the parallel operation circuit 121 has a nonzero element A ij read from the position (address) of the corresponding storage circuit Ck and an element x j read from the address corresponding to the address of the corresponding storage circuit MIk. Is repeated for each of the elements A ij stored in the memory circuit Ck, thereby completing the (product-sum operation processing) described above. In all arithmetic units CLk, the product-sum operation process is performed simultaneously (in parallel).
  • the processor 31 of the control circuit 30 outputs the accumulated value sum (output f i ), which is the operation result, to the output conversion circuit 141 when the product-sum operation processing is completed in all the operation units CLk. To control. Further, the processor 31 controls the output conversion circuit 141 to store the output f i from each computing unit CLk in each storage circuit MOk using a control command (step S9).
  • the processor 31 of the control circuit 30 determines whether the storage of the output f i is completed (step S11). If the processor 31 determines that the storage is not completed (NO in step S11), the process returns to step S11, but if the processor 31 determines that the storage is completed (YES in step S11), the processor 31 converts the output storage circuit 142 into The output f i stored in each memory circuit MOk is controlled to be output to the external storage device 62 or the external output device 63 (step S13). At this time, the output storage circuit 142 reads out the outputs f i in the order stored from the storage circuits MOk, and sends the read out outputs f i to the line in the read order. The sending of the output f i from each storage circuit MOk to the external storage device 62 or the external output device 63 is simultaneously performed.
  • the processor 31 of the control circuit 30 determines whether the arithmetic processing has been completed (step S15). If the processor 31 determines that the process has ended, the process of FIG. 12 ends (YES in step S15), but if it determines that the process does not end (NO in step S15), the process returns to step S3.
  • the determination in step S15 is made based on, for example, an instruction from the CPU 51.
  • the storage method of the storage circuit Ck of the coefficient storage circuit 132 is the first method of FIG. 8A, but it is the second storage method of FIG. 8B. It is also good.
  • the parallel operation circuit 121 adds the flag F corresponding to the element A ij to each element A ij stored in the memory circuit Ck corresponding to each operation unit CLk of the coefficient storage circuit 132. It performs operations or processing of the type indicated by the instruction. Also in this case, all the computing units CLk of the parallel computing circuit 121 operate simultaneously.
  • the operation for one row of the coefficient matrix A is distributed to two (or more) computing units CLk in order to equalize the amount of operations for each computing unit CLk of the parallel computing circuit 121.
  • the parallel operation circuit 121 calculates the sum of the results calculated by the two (or more) computing units CLk to which the assignment has been made, using the shared memory 124. Further, when the number of computing units CLk to which the assignment is made is not large, the number of the assignment processing for all the operation numbers is small, and the influence of the assignment processing on the computation performance of the computation circuit 12 can be ignored.
  • the coefficient data (element A ij) is to be calculated by the computing unit CLk in the storage circuits Ck and MIk which can be read only by each computing unit CLk of the parallel computing circuit 121 by the input I / F 122.
  • the elements b i ) and the input data (element x j ) can be stored prior to the operation. This makes it possible to reliably avoid contention for access (reading) of coefficient data and input data when all the arithmetic units CLk simultaneously (parallelly) carry out an operation, thereby performing parallel processing at high speed. It becomes possible.
  • FIG. 13 is a diagram showing the configuration of the input I / F and the output I / F of the arithmetic circuit 12A according to the second embodiment.
  • the arithmetic circuit 12A of FIG. 13 has an input I / F 122A different from the input I / F 122 of FIG.
  • the other configuration of arithmetic circuit 12A is the same as that of FIG. 6 and therefore description will not be repeated.
  • input I / F 122A includes input conversion circuit 131A and input notification circuit 133C in place of input conversion circuit 131 and input storage circuit 133.
  • FIG. 14 is a diagram showing a configuration of the input notification circuit 133C of FIG. 14, input notification circuit 133C includes a plurality of selectors 13A including the function of selector 13 of FIG. 9 and the output function of notification N. The plurality of selectors 13A correspond to computing units CLk, respectively.
  • input conversion circuit 131A When input conversion circuit 131A receives element x j of input vector x from external input device 61 or external storage device 62, based on the value of the index of element x j , the element x x among the plurality of operation units CLk A computing unit CLk that performs an operation using j is identified, and the element x j is output only to the identified computing unit CLk. Further, at this time, in the input notification circuit 133C of FIG. 14, the selector 13A corresponding to the operator CLk specified by the input conversion circuit 131A outputs the notification N of the operation to the corresponding operator CLk.
  • the input conversion circuit 131A directly inputs the element x j to the computing unit CLk.
  • the computing unit CLk that has not received a notification from the input notification circuit 133C can pause the computing unit CLk that does not need to perform computation using the element x j . Therefore, the circuit scale and power consumption of the arithmetic circuit 12 can be reduced.
  • FIG. 15 is a diagram showing the configuration of the input I / F and the output I / F of the arithmetic circuit 12B according to the third embodiment.
  • the arithmetic circuit 12B of FIG. 15 has an output I / F 123B different from the output I / F 123 of FIG.
  • the other configuration of arithmetic circuit 12B is similar to that of FIG. 6, and therefore description will not be repeated.
  • output I / F 123B includes an output conversion circuit 141, an output storage circuit 142, and an output notification circuit 143.
  • FIG. 16 is a diagram showing the configuration of the output notification circuit 143 of FIG. 15 in association with peripheral circuits.
  • output notification circuit 143 includes a table 144 and a determination circuit 145.
  • the table 144 stores, for example, index information identifying an output f i to be sent to the external storage device 62 or the external output device 63.
  • the index information indicates an output f i of the type or number required by the external storage device 62 or the external output device 63.
  • the determination circuit 145 performs a monitoring process 1451 that monitors the output f i sent from each computing unit CL k via the output conversion circuit 141. In the monitoring process 1451, for example, the index of the output f i is read.
  • the determination circuit 145 determines that the notification N1 is stored in the external storage device 62 when it determines that all outputs f i of the necessary type or number indicated by the index information in the table 144 have been output from the parallel operation circuit 121 based on the monitoring result. Or output to the external output device 63.
  • External storage device 62 or external output device 63 pauses until notification N1 is output from determination circuit 145, and is activated when notification N1 is received from determination circuit 145, and outputs f i from output storage circuit 142.
  • Accept
  • the period until output notification circuit 143 outputs notification N 1, ie, bus 40 it is possible to pause the external storage device 62 or the external output device 63 in a period during which data output to the external device is not required. As a result, the amount of power consumption of the external storage device 62 or the external output device 63 can be reduced.
  • FIG. 17 is a diagram showing the configuration of the input I / F and the output I / F of the arithmetic circuit 12B according to the fourth embodiment.
  • the arithmetic circuit 12C of FIG. 17 includes the input I / F 122A of the second embodiment and the output I / F 123B of the third embodiment.
  • Embodiment 5 shows a modification of the first embodiment.
  • FIG. 18 is a diagram showing the configuration of an input I / F and an output I / F of an arithmetic circuit 12D according to the fifth embodiment.
  • the arithmetic circuit 12D of FIG. 18 has an input I / F 122D different from the input I / F 122 of FIG.
  • Other configurations of arithmetic circuit 12D are similar to those of FIG. 6, and therefore description will not be repeated.
  • input I / F 122D includes an input conversion circuit 131, a coefficient storage circuit 132, a duplex input storage circuit 133A and a duplex input storage circuit 133B.
  • the input storage circuit 133 of FIG. 6 is duplicated by the dual input storage circuits 133A and 133B.
  • Each of the dual input storage circuits 133A and 133B has the same configuration as the input storage circuit 133 described in the first embodiment, and can perform the same operation.
  • the processor 31 of the control circuit 30 switches one function of the dual input storage circuits 133A and 133B to a function that accepts the element x j from the external input device 61 or the external storage device 62, and the other function in parallel. It switches to the function of outputting the element x j to the arithmetic circuit 121.
  • the processor 31 switches one function to the function of outputting the element x j to the parallel operation circuit 121 when each of the duplexed input storage circuits 133A and 133B completes each operation, and the other function to the external input It switches to a function that accepts the element x j from the device 61 or the external storage device 62.
  • the dual input storage circuits 133 A and 133 B are used. It becomes possible for the arithmetic circuit 12D to simultaneously execute the process of receiving the element x j from the external input device 61 or the external storage device 62 and the arithmetic process by the parallel arithmetic circuit 121. Therefore, it is possible to speed up the calculation speed by the calculation circuit 12D.
  • FIG. 19 is a diagram showing the configuration of an input I / F and an output I / F of an arithmetic circuit 12E according to the sixth embodiment.
  • the arithmetic circuit 12E of FIG. 19 has an output I / F 123E different from the output I / F 123 of FIG.
  • Other configurations of arithmetic circuit 12E are similar to those of FIG. 6 and therefore description will not be repeated.
  • output I / F 123E includes output conversion circuit 141, duplex output storage circuit 142A and duplex output storage circuit 142B.
  • the output storage circuit 142 of FIG. 6 is duplicated by the dual output storage circuits 142A and 142B.
  • Each of the dual output storage circuits 142A and 142B has the same configuration as the output storage circuit 142 described in the first embodiment, and can perform the same operation.
  • the processor 31 of the control circuit 30 switches one function of the dual output storage circuits 142A and 142B to the function of storing the output f i from the parallel operation circuit 121 via the output conversion circuit 141 in the storage circuit MOk, Function is switched to a function of reading out the output f i from the memory circuit MOk and transmitting the read out output f i to the external storage device 62 or the external output device 63.
  • duplexing output storage circuit 142A, each 142B is, upon completion of each operation, the delivery of one of the functions from the memory circuit MOk reads the output f i, the external storage device 62 or the external output device 63 The other function is switched to the function of storing the output f i from the parallel operation circuit 121 via the output conversion circuit 141 in the storage circuit MOk.
  • the sixth embodiment can be applied, for example, in the case where it is required to rapidly output the output f i from the arithmetic circuit 12 to the external storage device 62 or the external output device 63.
  • the processing of outputting the output f i to the external storage device 62 or the external output device 63 by the output storage circuit being duplicated, and the operation processing by the parallel operation circuit 121 Can be performed simultaneously (in parallel), and the processing speed of the arithmetic circuit 12 can be further speeded up.
  • Embodiment 7 The seventh embodiment shows a modification of the first embodiment.
  • FIG. 20 is a diagram showing the configuration of an input I / F and an output I / F of an arithmetic circuit 12F according to the seventh embodiment.
  • the arithmetic circuit 12F of FIG. 20 includes the duplex input storage circuits 133A and 133B of the fifth embodiment and the duplex output storage circuits 142A and 142B of the sixth embodiment.
  • Arithmetic circuit 12F of the seventh embodiment includes an input storage circuit and an output storage circuit in duplicate. According to operation circuit 12F, reception of element x j output at high speed from external input device 61 or external storage device 62, high-speed transmission of output f i to external storage device 62 or external output device 63, and parallel operation Arithmetic processing by the circuit 121 is simultaneously enabled.
  • FIG. 21 is a diagram showing the configuration of an arithmetic circuit according to the eighth embodiment.
  • the arithmetic circuit of FIG. 21 includes an arithmetic circuit 12G and an arithmetic circuit 12H connected to the arithmetic circuit 12G.
  • the arithmetic circuit 12G although the output I / F 123 of the arithmetic circuit 12 of the first embodiment is deleted, the other parts are the same as the arithmetic circuit 12.
  • the arithmetic circuit 12H includes an input I / F 122H, a parallel arithmetic circuit 121, and an output I / F 123.
  • the input I / F 122H includes an input / output conversion circuit 131H, a coefficient storage circuit 132, and an input storage circuit 133.
  • the configuration other than input / output conversion circuit 131H is the same as the configuration provided in arithmetic circuit 12 of the first embodiment, and therefore the description will not be repeated.
  • the input / output conversion circuit 131H directly receives the outputs f i from the plurality of computing units CLk of the computing circuit 12G, and is computed by the computing units CLk for each computing unit CLk of the computing circuit 12H from the received outputs f i.
  • the output f i to be identified is specified.
  • the input / output conversion circuit 131H stores the specified output f i in the order to be calculated in the memory circuit MIk of the input memory circuit 133 corresponding to the arithmetic unit CLk.
  • the number of connected arithmetic circuits 12 may be three or more.
  • two or more arithmetic circuits 12 can be connected.
  • two or more arithmetic circuits 12 can be connected in an LSI (Large-Scale Integration) circuit.
  • the input / output conversion circuit 131H is provided at the connection portion connecting the arithmetic circuits, whereby the selector 14 (the output conversion circuit 141 and the input conversion circuit 131) Alternatively, two processes using the selector 13) can be completed by one process by the input / output conversion circuit 131H. Therefore, even if a plurality of arithmetic circuits are connected, the processing can be speeded up.
  • FIG. 22 is a diagram showing the configuration of an arithmetic circuit according to the ninth embodiment.
  • the arithmetic circuit of FIG. 22 includes an arithmetic circuit 12G and an arithmetic circuit 12I connected to the arithmetic circuit 12G.
  • the output I / F 123 of the arithmetic circuit 12 of the first embodiment is deleted, the other parts are the same as the arithmetic circuit 12, and therefore the description will not be repeated.
  • the arithmetic circuit 12I includes an input I / F 122H, a parallel arithmetic circuit 121, and an output I / F 123B.
  • the parallel operation circuit 121 and the output I / F 123B are similar to those shown in the third embodiment.
  • the input I / F 122I includes the input / output conversion circuit 131H, the output notification circuit 143I, the coefficient storage circuit 132, and the input storage circuit 133 described in the eighth embodiment. Since input / output conversion circuit 131H, coefficient storage circuit 132 and input storage circuit 133 are similar to those shown in the third or eighth embodiment, the description will not be repeated.
  • the output notification circuit 143I outputs the notification N2 to each arithmetic unit CLk of the arithmetic circuit 12I. Specifically, when the input / output conversion circuit 131H stores the output f i from the plurality of operation units CLk of the previous operation circuit 12G in the storage circuit MIk corresponding to each operation unit CLk of the operation circuit 12I, output notification circuit 143I determines whether the output f i to be computed prior to the output f i in the storage circuit MIk is stored. The output notification circuit 143I performs this determination, for example, based on the value of the index of the output f i .
  • the output notification circuit 143I When it is determined that all the outputs f i to be calculated first are stored in the storage circuit MIk, the output notification circuit 143I outputs the notification N2 to the computing unit CLk corresponding to the storage circuit MIk. Thereby, operation unit CLk receives the notification N2 that all the elements x j (that is, output f i ) necessary for starting the product-sum operation are stored in corresponding memory circuit MIk, the product-sum operation Can be started.
  • the number of connected arithmetic circuits 12 may be three or more.
  • the ninth embodiment it is possible to connect two or more arithmetic circuits 12B shown in the third embodiment.
  • two or more arithmetic circuits 12B are connected in an LSI circuit, by providing the input / output conversion circuit 131H at the connection portion, two processes of the processing of the output conversion circuit 141 and the processing by the input conversion circuit 131 are performed. Can be completed by one process by the input / output conversion circuit 131H. Therefore, even if a plurality of arithmetic circuits are connected, the processing can be speeded up.
  • FIG. 23 is a diagram showing the configuration of an arithmetic circuit according to the tenth embodiment.
  • the arithmetic circuit of FIG. 23 includes an arithmetic circuit 12J and an arithmetic circuit 12K connected to the arithmetic circuit 12J.
  • the output I / F 123 is deleted from the arithmetic circuit 12F shown in the seventh embodiment, but the other configurations are the same as those of the arithmetic circuit 12F, and therefore the description will not be repeated.
  • the arithmetic circuit 12K also includes an input I / F 122K, a parallel arithmetic circuit 121, and an output I / F 123E.
  • the input I / F 122 K includes an input / output conversion circuit 131 K, dual input storage circuits 133 A and 133 B, and a coefficient storage circuit 132.
  • the configuration other than input / output conversion circuit 131K in operation circuit 12K is the same as that of operation circuit 12F in the seventh embodiment, and therefore the description will not be repeated.
  • the input / output conversion circuit 131 K directly receives the outputs f i from the plurality of arithmetic units CL k of the arithmetic circuit 12 J, and calculates the arithmetic units CL k for each arithmetic unit CL k of the arithmetic circuit 12 K from the received outputs f i.
  • the output f i to be identified is specified.
  • the input / output conversion circuit 131 K stores the specified output f i in the order to be calculated in the memory circuit MIk of the input memory circuit 133 corresponding to the arithmetic unit CLk.
  • the number of connected arithmetic circuits may be three or more.
  • the tenth embodiment it is possible to connect two or more arithmetic circuits 12F shown in the seventh embodiment.
  • two or more arithmetic circuits 12F are connected in an LSI circuit, by providing the input / output conversion circuit 131K at the connection portion, two processes of the processing of the output conversion circuit 141 and the processing of the input conversion circuit 131 are performed. Can be completed by one process by the input / output conversion circuit 131K. Therefore, even if a plurality of arithmetic circuits are connected, the processing can be speeded up.
  • FIG. 24 is a diagram schematically showing an example of a configuration capable of executing an operation according to the “matrix case” of the operation circuit according to each embodiment of the present invention.
  • Embodiment 1 Embodiment 8
  • the arithmetic circuit of can be configured to be able to calculate a product-sum operation according to the “matrix case” as shown in FIG.
  • FIG. 24 shows an arithmetic unit CLk capable of executing the product-sum operation of the n ⁇ n coefficient matrix A and the n ⁇ n matrix X corresponding to the input data 100.
  • the operation unit CLk has the same configuration as that shown in FIG. 11, and therefore the description will not be repeated.
  • the coefficient storage circuit 132R readable from the computation unit CLk, the coefficient storage circuit 132 storing the elements of the bias vector b, and the input storage circuit 133 are connected to the computation unit CLk.
  • the input storage circuit 133 has the same configuration as that shown in FIG.
  • the coefficient storage circuit 132R includes a ring buffer as indicated by a broken line.
  • FIG. 24 shows one of the plurality of computing units CLk included in the computing unit, the other computing units CLk also have the same configuration.
  • the matrix X is considered to be composed of n column vectors, and the elements of the matrix X are input to the input storage circuit 133 of FIG. 24 in the order of column priority.
  • elements x k1 to x kn of the k-th column of the matrix X are stored.
  • the arithmetic unit CLk repeats the product-sum operation for one column of the matrix X for each column of the matrix X as in the case of the first to eighth embodiments.
  • the arithmetic unit CLk performs a product-sum operation on the k-th row of the coefficient matrix A and each column of the matrix X, and outputs n values of the product-sum operation (corresponding to the output fi).
  • a non-zero element A ij is selected among the elements of the k-th row of the coefficient matrix A, and a product-sum operation using the selected non-zero element A ij is performed.
  • the k-th row of the coefficient matrix A does not contain the nonzero element A ij .
  • the values of the n product-sum operations output from operation unit CLk are stored in n registers RG of memory circuit AMOk, respectively.
  • n registers RG of memory circuit AMOk For example, when the arithmetic unit CLk executes a product-sum operation using the k-th column of the matrix X, the value of the product-sum operation corresponds to the k-th register RG of the memory circuit AMOk (indicated by hatching). The state stored in the stored register RG) is shown.
  • the product-sum operation of the k-th column of the matrix X is completed, and then the next column (k + 1-th column) is performed.
  • the product-sum operation it is necessary to initialize the input of the coefficient matrix A of the arithmetic unit CLk before starting the product-sum operation of the next column. For example, initialization is required to enable reading from the first element of the kth row of the coefficient matrix A. Therefore, the start of the product-sum operation of the next column may be delayed by the time taken for the initialization.
  • the elements of the kth row of the coefficient matrix A are stored in the ring buffer of the coefficient storage circuit 132R.
  • the arithmetic unit CLk of FIG. 24 performs the product-sum operation of the next column (k + 1-th column) without the above initialization. It can start. Therefore, it is possible to carry out the product-sum operation in the "matrix case" at high speed.
  • Embodiment 1 Also in the product-sum operation of the coefficient matrix A and the input vector x as described above, a coefficient storage circuit including a ring buffer can be used. Therefore, by applying the operation circuit of FIG. 24, it is possible to speed up the product-sum operation in both the matrix-vector product-sum operation and the matrix-matrix product-sum operation according to the “matrix case”.
  • FIG. 25 is a view schematically showing another example of the configuration capable of executing the operation according to the “matrix case” of the operation circuit according to each embodiment of the present invention.
  • Embodiment 1 Embodiment 8 The arithmetic circuit as shown in FIG. 25 can be applied to the arithmetic circuit of FIG. Similarly to FIG. 24, FIG. 25 also shows an arithmetic unit CLk capable of executing the product-sum operation of the n ⁇ n coefficient matrix A and the n ⁇ n matrix X.
  • the arithmetic circuit comprises an output interface 123R.
  • the elements of matrix X are stored in the order of row priority in input storage circuit 133, and the elements of the kth column of coefficient matrix A are stored in coefficient storage circuit 132R. .
  • matrix X is considered to be composed of row vectors
  • coefficient matrix A is considered to be composed of column vectors.
  • operator CLk of FIG. 25 stores the stored elements x k1 to x kn And a k-th column element A k1 to A kn of the coefficient matrix A to perform a product-sum operation.
  • a nonzero element A ij is selected among the elements A k1 to A kn and a product-sum operation is performed using the selected non-zero element A ij .
  • the k-th column of the coefficient matrix A does not contain nonzero elements A ij .
  • the processor 31 determines the order of the elements Tij to be read from the matrix T, and outputs the control command CM to the output interface 123R so that the elements Tij are read from the register RG in the determined order.
  • the control command CM includes, as input data to the next arithmetic circuit 12, designation of whether the input data conforms to the column priority order or the input data conforms to the row priority order.
  • Output interface 123R reads element Tij from n ⁇ n registers RG in accordance with control command CM. Thereby, the next arithmetic circuit 12 can receive the elements x ij of the matrix X of the input data in the order of the column priority or the row priority.
  • the output interface 123R reads the element Tij from the output storage circuit 142R in accordance with the control command CM.
  • the processor 31 sets the control command CM based on, for example, the type of input data (that is, the element T ij of the matrix T) to be subjected to product-sum operation processing. This type may include an image. If the type of input data is an image, the processor 31 sets a read command of “row priority” in the control command CM, and otherwise sets a read command of “column priority”.
  • the output interface 123R reads the elements Tij from the n ⁇ n registers RG in the row priority order according to the index, and the control command CM indicates “column priority”.
  • elements Tij are read in the order of column priority according to the index.
  • the next arithmetic circuit 12 inputs the input Tj element of matrix T (ie, matrix X) arranged according to either column priority or row priority. It can be accepted, and the reordering process of the elements x ij of the matrix X can be omitted. Thereby, the arithmetic circuit 12 can perform the product-sum operation process at high speed.

Landscapes

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

Abstract

全体の処理時間を短縮し得る演算回路を提供する。演算回路は、非零要素と零要素とを含む係数行列に右から入力ベクトルを掛け、演算結果を出力ベクトルに出力する複数の演算器(CLk)を含む並列演算回路と、複数の記憶回路を含む入力インターフェイス(122)を備える。入力ベクトルおよび係数行列の各要素は、当該要素が乗算されるべき順番を指定するインデックスを有する。各記憶回路は、入力ベクトルの要素をインデックスに基づく順番で記憶する入力記憶回路(133)と、係数行列を構成する行または列ベクトルの要素をインデックスに基づく順番で記憶するリングバッファを含む係数記憶回路(132)とを有する。各演算器は、記憶回路の係数行列の要素と入力ベクトルの対応する要素との乗算を順次実行し、当該要素のインデックスに基づき、乗算の結果を出力ベクトルの対応する要素に積算する。

Description

演算回路および演算方法
 この開示は、演算回路および演算方法に関し、たとえば、複数の演算器を用いて並列に実施される演算に好適に用いられる演算回路および演算方法に関する。
 画像処理、声紋分析、ロボディクスなどパターン認識がなされる多くの分野において、畳み込みニューラルネットワーク(CNN:Convolutional Neural Network)と呼ばれる演算方法がしばしば用いられる。一般にCNNは、畳み込み演算を行う畳み込み層、局所統計量を計算するプーリング層、および全結合層で構成される。畳み込み層は、カーネル(フィルタとも称する)を入力特徴マップ上において画素単位で走査させながら、入力特徴マップの対応部分とカーネルとの積和演算を繰り返して行い、最終的な積和演算結果を非線形変換することによって出力特徴マップを生成する。
 これらの層における主要な演算は、0値要素が多い大規模な行列(A)とベクトル(x)の積とオフセット(b)との和の演算(Ax+b)である。従来は、複数の演算器を用いた並列処理装置により演算を処理することにより、演算にかかる時間を短縮している。
 0値要素が多い大規模な行列(A)とベクトル(x)の演算を高速化する技術として、例えば、特開2009-251724号公報(特許文献1)は、複数の演算パイプラインを持つベクトルプロセッサを開示する。このベクトルプロセッサは、1つのベクトル演算命令の演算対象となるデータ数がパイプライン数の整数倍で無い場合に、命令を実行していないパイプラインに、次のベクトル演算命令を実行させる。これにより、並列処理の高速化がなされている。
 また、特開2003-67360号公報(特許文献2)は、N個のデータを所定のアドレス順で読出して積和演算を行う積和演算装置を開示する。この積和演算装置は、N個のデータが値0を含む場合、データを格納する記憶装置のアドレスを生成するとき、値0であるデータに対応のアドレスを生成しない。これにより、値0であるデータの積和演算が実施されず、演算量が削減されて、演算の高速化が実現されている。
特開2009-251724号公報 特開2003-67360号公報
 複数の演算器を有する並列演算装置における行列(A)とベクトル(x)の積の演算処理は、基本的に、大きく分けて(i)各演算器が演算の対象となる行列(A)の要素とオフセット(b)、入力のベクトル(x)を外の装置から取り込む処理、(ii)複数の演算器が取込まれたデータを用いて並列に演算を実行する処理、および(iii)各演算器が演算の結果を外部の装置に出力する処理で構成される。
 このような構成によれば、並列演算の並列性が高まると演算処理時間は短縮されるために、各演算器から外部装置へのアクセスの要求が同時に発生しやすくなる。同時に複数のアクセス要求が発生した場合、各演算器からのアクセス要求に順序をつけて並べ直す等の調停が必要とされて、外部の装置からのデータ入力処理(i)とデータ出力処理(iii)の処理時間が短縮されない。そのため、並列演算処理が高速化されたにもかかわらず、データ入力処理(i)とデータ出力処理(iii)により全体の処理時間が律速され、結果として全体の処理時間を思うほど短縮できないことになる。
 特許文献1は、並列演算処理の高速化の技術を開示するが、上記に述べたデータ入力処理(i)またはデータ出力処理(iii)の処理時間の短縮に関する技術を開示していない。
 また、特許文献2は、値0であるデータに対応のアドレスを生成しないことにより、演算を高速化する技術を開示するが、並列演算処理における上記に述べたデータ入力処理(i)またはデータ出力処理(iii)の処理時間の短縮に関する技術を開示していない。
 この開示は、上記の課題を考慮したものであり、その目的は、全体の処理時間を短縮することが可能な演算回路および演算方法を提供することである。
 一実施形態における演算回路は、非零要素と零要素とを含む係数行列に右から入力ベクトルを掛け、演算結果を出力ベクトルに出力するよう構成される複数の演算器を含む並列演算回路と、複数の記憶回路を含む入力インターフェイスと、を備える。演算回路は、各演算器に、当該演算器で演算されるべきベクトルの要素を、演算されるべき順番で供給する。複数の演算器は、複数の記憶回路にそれぞれ対応する。各記憶回路は、入力ベクトルの要素を記憶する入力記憶回路と、リングバッファを備える係数記憶回路であって、当該リングバッファに係数行列を構成する行または列ベクトルの要素を格納する係数記憶回路と、を有する。入力ベクトルの要素および係数行列の要素は、当該要素が乗算されるべき順番を指定するインデックスを有する。入力インターフェイスは、入力ベクトルと係数行列の各要素を、当該要素が有するインデックスに基づき、複数の演算器のうちの1の演算器に対応した入力記憶回路と係数記憶回路のリングバッファに、それぞれ、順番に従い格納するよう構成される。各演算器は、記憶回路の係数行列の行または列ベクトルの要素と入力ベクトルの対応する要素との乗算を順次実行し、当該要素のインデックスに基づき、当該乗算の結果を出力ベクトルの対応する要素に積算するように構成される。
 上記の実施形態によれば、入力ベクトルの要素または係数行列を構成する行または列ベクトルの要素は、当該要素が有するインデックスに基づき、複数の演算器のうちの1の演算器に対応した入力記憶回路と係数記憶回路のリングバッファに、演算されるべき順番に従い格納される。これにより、各演算器が演算を実施する前に、入力記憶回路または係数記憶回路を介して、当該演算器の演算に必要な入力ベクトルの要素と係数行列を構成する行または列ベクトルの要素のみを、演算されるべき順番で準備しておくことができる。したがって、要素の並べ替え処理は不要となり並列演算にかかる全体の処理時間を短縮することができる。
 また、係数行列を構成する行または列ベクトルの要素はリングバッファに格納されるから、入力ベクトルを変化させながら係数行列の同一の行または列ベクトルの要素を用いた演算を繰返す場合に、各演算の開始時に係数記憶回路を初期化する処理を省略することができる。また、初期化処理が省略されることで、並列演算にかかる全体の処理時間を短縮することができる。
CNNによる演算処理を示すフローチャートである。 畳み込み演算について説明するための図である。 特徴マップおよびカーネルの展開について説明するための図である。 本実施の形態1に係る演算回路12の構成の一例を、周辺回路と関連付けて示す図である。 図4の演算器CLkと入出力データを関連付けて説明する図である。 本実施の形態1に係る入力I/Fと出力I/Fの構成を示す図である。 本実施の形態1に係る入力記憶回路と出力記憶回路と係数記憶回路の構成の一例を示す図である。 本実施の形態1に係る記憶方式を模式的に説明する図である。 本実施の形態1に係る入力変換回路の構成の一例を示す図である。 本実施の形態1に係る出力変換回路の構成の一例を示す図である。 図5で示した演算器CLkと演算されるべき要素の関連付けの具体例を示す図である。 本実施の形態1に係る並列処理の説明するフローチャートである。 本実施の形態2に係る演算回路12Aの入力I/Fと出力I/Fの構成を示す図である。 図13の入力通知回路133Cの構成を示す図である。 本実施の形態3に係る演算回路12Bの入力I/Fと出力I/Fの構成を示す図である。 図15の出力通知回路143の構成を周辺回路と関連付けて示す図である。 本実施の形態4に係る演算回路12Bの入力I/Fと出力I/Fの構成を示す図である。 本実施の形態5に係る演算回路12Dの入力I/Fと出力I/Fの構成を示す図である。 本実施の形態6に係る演算回路12Eの入力I/Fと出力I/Fの構成を示す図である。 本実施の形態7に係る演算回路12Fの入力I/Fと出力I/Fの構成を示す図である。 本実施の形態8に係る演算回路の構成を示す図である。 本実施の形態9に係る演算回路の構成を示す図である。 本実施の形態10に係る演算回路の構成を示す図である。 本発明の各実施の形態に係る演算回路の「行列ケース」に従う演算を実行可能な構成の一例を模式的に示す図である。 本発明の各実施の形態に係る演算回路の「行列ケース」に従う演算を実行可能な構成の他の例を模式的に示す図である。
 以下、各実施の形態について図面を参照して詳しく説明する。なお、同一または相当する部分には同一の参照符号を付して、その説明を繰り返さない。なお、この開示による演算回路および演算方法は、CNNにおける畳み込み演算において好適に用いられるものであるが、CNNに限らず他の分野にも適用することができる。
 実施の形態1.
 [CNNの処理]
 最初にCNNについて簡単に説明する。図1は、CNNによる演算処理を示すフローチャートである。
 図1を参照して、CNNは、入力層S201と、畳み込み層S202,S204と、プーリング層S203,S205と、全結合層S206と、出力層S207とを含む。
 入力層S201は、画像データなどの処理対象のデータの入力を受ける。出力層S207は、データ処理後の最終結果を出力する。図1では、簡単のために畳み込み層とプーリング層の組み合わせ(S202,S203;S204,S205)が2回繰り返されているが、さらに多数回繰り返されていてもよい。
 畳み込み層の入力データを入力特徴マップといい、畳み込み層の出力データを出力特徴マップという。畳み込み層S202,S204は、カーネル(フィルタとも称する)を入力特徴マップ上において画素単位で走査しながら、入力特徴マップの対応部分とカーネルとの積和演算を繰り返して行い、最終的な積和演算結果を非線形変換することによって出力特徴マップを生成する。カーネルの要素(「重み」とも称する)は事前に学習によって決定される。畳み込み演算の詳細は図2を参照して後述する。
 プーリング層S203,S205は、出力特徴マップの局所領域をひとつの要素にまとめるような動作を行うことによって特徴マップの空間サイズを小さくするものである。プーリング層S203,S205は、たとえば、局所領域の最大値を取ったり、局所領域に含まれる要素を平均化したりする。
 全結合層S206は、出力層S207に隣接して1または複数層設けられる。全結合層のS206の各ニューロンは、隣接層の全てのニューロンとの結合を有する。
 [畳み込み演算]
 図2は、畳み込み演算について説明するための図である。図2に示すように、入力特徴マップとしての入力データ100とカーネル101との畳み込み演算によって出力データ102が生成される。出力データ102の各要素にバイアスを加算し、さらに活性化関数を施すことによって出力特徴データが生成される。活性化関数として、たとえば、ReLU(Rectified Linear Unit)などの非線形関数が用いられる。
 図2の例では、簡単のために入力データサイズを(7,7)とし、カーネルサイズを(3,3)としている。出力データサイズの調整のために、入力データ100の周囲104が固定データ(たとえば、0)で埋められていてもよい。これをパッディングと称する。図2の入力データ100には、幅が1で値が0のパディングが適用されている。
 畳み込み演算では、パディングの部分を含めた入力データ100の上においてカーネル101を一定間隔でスライドさせながら、カーネル101の要素と対応する入力データ100の要素とを乗算し、それらの和が求められる。すなわち、積和演算が実行される。積和演算の結果は、出力データ102の対応する要素に格納される。カーネル101をスライドさせる間隔をストライドと称する。図2の場合、ストライドは1である。
 具体的に、カーネル101の配置が図2の太い実線の枠103に対応している場合、積和演算結果である「30」は出力データ102の対応する要素106の位置に格納される。カーネル101の配置が図2の太い破線の枠105に対応している場合、積和演算結果である「13」は、出力データ102の対応する要素107の位置に格納される。
 [特徴マップおよびカーネルの展開]
 図3は、特徴マップおよびカーネルの展開について説明するための図である。本実施の形態1の場合、畳み込み演算の処理時間を短縮するために、特徴マップの各行をつなぎ合わせることによって特徴マップが1列に展開される。
 具体的に、図2および図3を参照して、図2の入力データ100の各行をつなぎ合わせることによって図3の入力ベクトル110が生成される。入力データ100に対応する入力ベクトル110の要素数は7×7=49である。図2の出力データ102も行ごとにつなぎ合わせることによって1列に展開される。出力データ102に対応する出力ベクトルの要素数も49である。
 図2のカーネル101は、入力ベクトル110を右から掛けたときに、図2の出力データ102に対応する出力ベクトルが生成されるように行列に展開される。これによって係数行列111が生成される。係数行列111の行数は第1行から第49行までの49であり、係数行列111の列数は第1列から第49列までの49である。なお、図3に示す係数行列111において空白部分のマス目の要素は0である。
 具体的に、係数行列111の第1行は、(3,2,0,0,0,0,0,1,3,0,…,0)であり、図2のカーネル101が特徴マップ上の太い破線の枠105に位置する場合に相当する。この係数行列111の第1行と入力ベクトル110との積和演算が実行されることによって、図2の出力データ102の対応する要素107の位置に格納されるデータ「13」が生成される。
 同様に、係数行列111の第9行は、(3,2,1,0,0,0,0,1,3,2,0,0,0,0,2,1,3,0,…,0)であり、図2のカーネル101が特徴マップ上の太い実線の枠103に位置する場合に相当する。この係数行列111の第9行と入力ベクトル110との積和演算が実行されることによって、図2の出力データ102の対応する要素106に位置に格納されるデータ「30」が生成される。
 図2においてパディングが適用されていない場合には、入力データ100に対応する入力ベクトル110には変更はなく、その要素数は49である。出力データ102のデータサイズは(5,5)になるので、出力データ102に対応する出力ベクトルの要素数は、5×5=25になる。また、カーネル101に対応する係数行列111の行数は25になり、その列数は49になる。
 畳み込み演算において実行される行列演算式は一般に式(1)で表される。すなわち、畳み込み演算の出力ベクトルfは、係数行列Aに入力ベクトルxを右から掛け、その演算結果にバイアスベクトルbを加算することによって得られる。ここで、係数行列Aは、値が0である要素を比較的多く含んでいる点に特徴がある。
Figure JPOXMLDOC01-appb-M000001
 この明細書では、出力ベクトルfの要素をf1,…,fnとする。第i番目の出力ベクトルfの要素をfiまたはf(i)と記載する。入力ベクトルxの要素をx1,…,xmとする。第j番目の入力ベクトルxの要素をxjまたはx(j)と記載する。バイアスベクトルbの要素をb1,…,bnとする。第i番目のバイアスベクトルbの要素をbiまたはb(i)と記載する。また、係数行列Aは、第1から第nまでのn行と第1から第mまでのm列で構成される。第i行第j列の係数行列Aの要素をAijまたはA(i,j)と記載する。本実施の形態1では、各要素のインデックスである値ij、またはjは、当該要素の識別子であるとともに、当該要素を演算するべき後述の演算器CLkおよび当該要素が演算器CLkの指定および演算されるべき順番を指定し得るものでもある。
 また、畳み込み演算では、NVIDIA社の技術文献「cuDNN:Efficient Primitives fwor Deep Learning」第4頁の「Figure 1: Convolution lowering」に示されるように、係数が係数行列(Fm)で表現されるとともに、入力および出力もベクトルではなく行列(Dm,Om)として表現されるケースもある。このケースを「行列ケース」と称する。行列ケースにおける畳み込み演算では、行列と行列の積が算出される。
 [演算回路の概略的な構成]
 図4は、本実施の形態1に係る演算回路12の構成の一例を、周辺回路と関連付けて示す図である。演算回路12は、「演算装置」の一実施例である。図4を参照して、演算回路12は、演算回路12内の各部を制御するための専用回路である制御回路30、それぞれが積和演算を実施する複数の演算器CLk(k=1、2、3・・・n)を有する並列演算回路121、入力I/F(Interfaceの略)122および出力I/F(Interface)123を備える。演算回路12は、複数の演算器CLkを有する。各演算器CLkは、係数行列Aの各行に対応して設けられている。
 演算回路12では、式(1)で示される行列演算を実施する場合、各演算器CLkが積和演算を他の演算器CLkと並行して実行する。
 制御回路30は、プロセッサ31と、例えば不揮発性の記憶媒体を含むメモリ32とを備える。メモリ32には、演算回路12を制御するための制御プログラム150が格納されている。
 演算回路12は、演算のためのデータを演算回路12に入力する外部入力装置61、当該演算回路12からの演算結果を外部に出力する外部出力装置63およびSRAM(Static Random Access Memory)等の外部記憶装置62を、バス45を介して接続する。
 外部入力装置61、外部記憶装置62および外部出力装置63は、バス40を介して、メモリ50を備えるCPU(Central Processing Unit)51が接続される。メモリ50は、係数行列A、入力ベクトルxおよびバイアスベクトルb、ならびに演算回路12の演算結果を格納する。
 CPU51は、外部入力装置61、外部記憶装置62および外部出力装置63を制御する。例えば、CPU51は、係数行列A、入力ベクトルxおよびバイアスベクトルbをメモリ50から読出し、外部入力装置61または外部記憶装置62を介して演算回路12の入力I/F122に出力する。外部出力装置63は、出力I/F123からの演算結果を入力し、入力した演算結果を、バス40を介してCPU51に出力する。CPU51は、外部出力装置63からの演算結果をメモリ51に格納する。また、出力I/F123からの演算結果は、外部記憶装置62に格納されてもよい。外部記憶装置62と外部出力装置63は、有線または無線の複数の回線を介して出力I/F123に接続される。出力I/F123は、各回線を接続するポート17を備える。
 なお、メモリ51は、CPU50ではなくバス40に接続されてもよい。また、外部記憶装置62がメモリ50を備えてもよい。
 [演算器の構成]
 図5は、図4の演算器CLkと入出力データを関連付けて説明する図である。図5を参照して、演算器CLkは、アキュムレータT1、乗算器T2、加算器T3およびレジスタT4を含む。演算器CLkには、演算器CLkから読出し可能な係数記憶回路132および入力記憶回路133が接続される。「入力記憶回路」は、並列演算回路121と外部装置との間において並列演算回路121への入力を記憶する回路である。係数記憶回路132および入力記憶回路133は、図4の入力I/F122に含まれる。図5では、並列演算装置の複数の演算器CLkのうち1つを示すが、他の演算器も同様の構成を有する。
 係数記憶回路132には、係数行列Aのk番目の行の要素Ak1~Aknと、バイアスベクトルbのk番目の要素bが格納される。また、入力記憶回路133には、入力ベクトルxの要素x~xが格納される。
 (積和演算処理)
 演算器CLkでは、アキュムレータT1およびレジスタT4は、初期値(例えば0)が予め格納されている。積和演算処理が開始されると、乗算器T2は、クロックに同期して、係数記憶回路132から要素Akm入力記憶回路133から要素xをそれぞれ読出し、読出された要素Akmに要素xを掛けて積を算出し、算出した積を上書きによりレジスタT4に格納する。加算器T3は、レジスタT4の積と、アキュムレータT1に格納されている累算値sumとの和を算出し、算出した和をアキュムレータT1に出力する。アキュムレータT1は、入力記憶回路133から読出した要素bと加算器T3からの和とを加算し、加算結果を累算値sumに加算する。これにより、1回の演算処理が終了する。このような、係数記憶回路132の要素Akmと入力記憶回路133の対応する要素xの積と累算値sumの和からなる積和演算が、n回繰返される。
 このように、各演算器CLkは、他の演算器CLkとは独立して、割当てられた行の積和演算を、係数記憶回路132の要素Akmおよび対応する入力記憶回路133の要素xの組の総数(m個)繰返す。この結果、各演算器CLkのアキュムレータT1の累算値sumが、出力ベクトルfの要素fとして出力I/F123に出力される。
 [入力I/Fと出力I/Fの構成]
 図6は、本実施の形態1に係る入力I/Fと出力I/Fの構成を示す図である。図6では、入力I/Fと出力I/Fの構成が、制御回路30を除く周辺回路と関連づけて示されている。図6では、並列演算回路121は、共有メモリ124を接続する。共有メモリ124は、各演算器CLkにより書込み可能および読出し可能に構成されている。図6を参照して、入力I/F122は、入力変換回路131、係数記憶回路132および入力記憶回路133を含む。出力I/F123は、出力変換回路141および出力記憶回路142を含む。「出力記憶回路」は、並列演算回路121と外部装置との間において並列演算回路121からの出力を記憶する回路である。
 図7は、本実施の形態1に係る入力記憶回路と出力記憶回路と係数記憶回路の構成の一例を示す図である。図8は、本実施の形態1に係る記憶方式を模式的に説明する図である。図9は、本実施の形態1に係る入力変換回路の構成の一例を示す図である。図10は、本実施の形態1に係る出力変換回路の構成の一例を示す図である。
 図7(A)を参照して、入力記憶回路133は、複数の記憶回路MIk(k=1,2,3、・・・)を含む。複数の記憶回路MIkは、それぞれ、各演算器CLkに対応して設けられて、すなわち入力ベクトルxの各行に対応して設けられて、対応の演算器CLkにより読出し可能に構成されている。記憶回路MIkは、入力ベクトルxの要素xjを格納する複数のレジスタを含む。
 図7(B)を参照して、出力記憶回路142は、複数の記憶回路MOk(k=1,2,3、・・・)を含む。複数の記憶回路MOkは、出力ベクトルfの要素fが書込み可能に、また要素fが読出し可能に構成されている。
 図7(C)を参照して、係数記憶回路132は、複数の記憶回路Ck(k=1,2,3、・・・)を含む。複数の記憶回路Ckは、それぞれ、各演算器CLkに対応して設けられて、すなわち係数行列Aの各行に対応して設けられて、対応の演算器CLkにより読出し可能に構成されている。記憶回路Ckは、例えば図8(B)に示すように、バイアスベクトルbの要素biと係数行列Aの要素Aijを格納する複数のレジスタを含む。
 (入力変換回路)
 入力変換回路131は、例えば図9に示す構成を有する。図9を参照して、入力変換回路131は、係数記憶回路132および入力記憶回路133の各記憶回路に対応するセレクタ13と、テーブルまたは専用回路15を備える。テーブルまたは専用回路15は、各セレクタに選択指令151を出力する。選択指令151は、外部記憶装置62または外部入力装置61からの係数行列Aの要素Aij、入力ベクトルxの要素xjおよびバイアスベクトルbの要素biのうち、いずれを選択して、対応の記憶回路に書込むかの指令を示す。選択指令151は、例えば要素Aij、要素xjおよび要素biのインデックの値を含む。
 具体的には、入力変換回路131が、外部記憶装置62または外部入力装置61から要素Aij、要素xjおよび要素biを受付けたとき、各セレクタ13は、受付けられた要素Aij、要素xjおよび要素biのンデックスと選択指令151とに従い、要素を選択し、選択された要素Aij、要素xjおよび要素biを対応の記憶回路MIkまたは記憶回路Ckに書込む。このとき、セレクタ13は、選択指令151により、要素Aijのうち、非零の要素Aijのみを選択する。そして、セレクタ13は、選択された要素Aijおよび要素biを、対応の記憶回路Ckに格納する。
 また、入力変換回路131の各セレクタ13は、外部記憶装置62または外部入力装置61から受付けた要素xjのインデックスと選択指令151とに従い、対応の記憶回路MIkに格納する要素xjを選択する。この選択では、セレクタ13は、選択指令151に従い、非零の要素Aijに対応の要素xjのみを選択する。セレクタ13は、選択された要素xjを、対応の記憶回路MIkに格納する。
 また、入力変換回路131のセレクタ13は、記憶回路MIkに要素xjを、また記憶回路Ckに非零の要素Aijを格納する場合に、要素のインデックスの値が示す順に従い、対応の記憶回路のレジスタに当該要素を格納する。具体的には、セレクタ13は、記憶回路Ckの複数のレジスタのうち、要素Aijのインデックスが示す値(数字)をアドレスとしてアドレス指定されるレジスタに要素Aijを格納する。また、セレクタ13は、記憶回路Ckの複数のレジスタのうち、要素Aijのレジスタとは異なる予め定められたレジスタに要素biを格納する。同様に、セレクタ13は、記憶回路MIkの複数のレジスタのうち、要素xjのインデックスが示す値(数値)をアドレスとしてアドレス指定されるレジスタに要素xjを格納する。
 これにより、記憶回路Ckと記憶回路MIkには、対応の演算器CLkの積和演算に必要な要素xjと非零の要素Aijと要素biが格納される。また、記憶回路Ckでは、非零の要素Aijが演算されるべき順番で格納され、各記憶回路MIkでは、非零の要素Aijに対応する要素biが、演算されるべき順番で格納される。
 (入力変換回路のテーブルまたは専用回路)
 本実施の形態1では、各演算器CLkが係数行列Aのどの行に割当てられるかと、非零の要素Aijと演算されるべき要素xの入力ベクトルxにおける位置とは、予め決定されている。したがって、テーブルまたは専用回路15には、このような予め決定された内容を示す情報が格納されており、専用回路は、格納された情報に従い、各セレクタ13宛の選択指令151を生成し、生成された選択指令161を当該セレクタ13に出力する。なお、演算器CLkへの係数行列Aの行の割当て、および非零の要素Aijと演算されるべき要素xの入力ベクトルxにおける位置が変更されない場合は、テーブルまたは専用回路15は、固定の回路として構成され得る。
 (出力変換回路)
 出力変換回路141は、例えば図10に示す構成を有する。図10を参照して、出力変換回路141は、複数のセレクタ14と、テーブルまたは専用回路16とを備える。複数のセレクタ14は、出力記憶回路142の複数の記憶回路MOkにそれぞれ対応する。記憶回路MOkは1または複数のレジスタを含む。
 出力記憶回路142の格納された出力fは、外部記憶装置62または外部出力装置63に出力されるが、出力記憶回路142が、外部記憶装置62または外部出力装置63に同時に出力可能な出力fの数は、予め決められている。したがって、出力記憶回路142は、同時に出力可能な出力fの数と同じ数の記憶回路MOkを有する。また、複数の記憶回路MOkは、それぞれ、外部記憶装置62または外部出力装置63に、ポート17を介して接続される。
 出力変換回路141の各セレクタ14は、並列演算回路121からの出力fを記憶回路MOkに格納する際、テーブルまたは専用回路16からの選択指令161と出力fのインデックスの値に基づき、複数の記憶回路MOkから1つ(すなわち、複数のポート17のうちの1つ)を決定し、出力fを決定した記憶回路MOkに格納する。本実施の形態では、出力fのインデックスは、当該出力fを識別する識別子としての役割も果たす。セレクタ14は、出力fを格納する際に、選択指令161と出力fのインデックスからアドレスを決定し、決定したアドレスでアドレス指定される記憶回路MOkのレジスタに出力fを格納する。
 一般には、係数行列Aの各行の演算結果である出力fがどの演算器CLkから導出されるか、当該出力fをいずれのポート17に送出するか、および出力fを送出する順番を規定する基準の情報は予め決定されている。
 テーブルまたは専用回路16は、上記に述べた基準情報を格納している。テーブルまたは専用回路16は、格納された基準情報に基づき、各セレクタ14宛の選択指令161を生成し、生成された選択指令161を当該セレクタ14に出力する。
 なお、係数行列Aの複数の行が、複数の演算器CLkにそれぞれ一対一に対応する場合には、演算器CLkと記憶回路MOkを直接に一対一で結合することが可能であり、この場合は各記憶回路MOkの出力fを格納する位置(容量、レジスタの個数)は1つだけでよい。
 テーブルまたは専用回路16は、各セレクタ14に対して、並列演算回路121からの演算結果である要素fiのうち、いずれを選択して、対応の記憶回路MOkに書込むかの指令を示す選択指令161を出力する。選択指令161は、例えば要素fiのインデックの値を含む。
 具体的には、セレクタ14は、並列演算回路121の各演算器CLkのからの要素fiのうちから選択指令161に基づき要素fiを選択し、選択した要素fiを対応する記憶回路MOkに格納する。各記憶回路MOkは複数のレジスタからなる。出力変換回路141は、要素fiを記憶回路MOkに格納する場合、要素fiを、選択指令161に従った順番で当該記憶回路MOkのレジスタに格納する。
 上記に述べたテーブルまたは専用回路16からの選択指令161は、並列演算回路121からの出力(要素fi)を外部記憶装置62または外部出力装置63が期待する要素fiが格納される出力記憶回路142の位置(アドレス)または読み出される順番に基づき予め決定されている。
 なお、記憶回路MIk、記憶回路MOkおよび記憶回路Ckは、アドレス指定可能な複数のレジスタを含むとしているが、レジスタを用いた構成に限定されない。例えば、アドレス指定可能な記憶回路であればよく、例えばSRAMを含んで構成されてもよい。
 [演算器と要素の関連付けの具体例]
 図11は、図5で示した演算器CLkと演算されるべき要素の関連付けの具体例を示す図である。図11に示すように、入力変換回路131によれば、記憶回路Ckおよび記憶回路MIkには、対応の演算器CLkで演算されるべき非零要素Aijと要素xのみが格納されて、且つ演算されるべき順番で格納されている。
 したがって、演算器CLkの乗算器T2は、クロックに同期して、記憶回路Ckおよび記憶回路MIkから要素を順番に読み出すだけで、演算器CLkで積和演算されるべき要素をのみ、演算されるべき順序に従い取得することができる。
 これにより、各演算器CLkからの要素の読出し要求が同時に発生したとしても、要求間の順序付けを行なう等の調停は必要とされず、さらに各演算器CLkでは要素を乗算すべき順序に並べる処理も必要とされない。したがって、当該調停が必要とされる従来の積和演算処理に比べて、全体の処理速度を高速にすることが可能となる。
 [係数記憶回路の変形例]
 図8を参照して、係数記憶回路132は、係数(要素Aijと要素bi)を格納する方式は、図8(A)の1つ目の方式と図8(B)の2つ目の方式を含む。
 図8(A)を参照して、1つ目の方式は、図11に示したように、演算器CLkの対応する記憶回路Ckに要素biに続けて係数行列Aの1行Lに相当する要素Aijをインデックスの順番に格納する方式である。図8(A)の1つ目の方式は、記憶回路Ckから読出された係数を、並列演算回路121をスキップして、出力変換回路141を経由して出力記憶回路142に格納することもできる。
 図8(B)を参照して、2つ目の方式は本来の係数データ(要素biと1行Lに相当する要素Aij)と、実行モードを指定するフラグFを付加する。例えば、フラグFは、記憶回路Ckに格納された各係数(要素Aijまたは要素bi)に対して、当該係数を用いて実施するべき演算等の処理の種類を、並列演算回路121に指示する。本実施の形態1では、実行フラグが指示する処理の種類は、要素Aijと要素xの積、積和演算、係数(要素Aijまたは要素bi)のロード、入力データ(要素x)のロード、共有メモリ124への書込み(例えば、演算結果(要素f)の書込み)、共有メモリ124からの読出し、各係数(要素Aijまたは要素bi)を、並列演算回路121をスキップして、出力変換回路141を経由して出力記憶回路142に格納する等を含む。
 更なる他の方式として、図8(B)の方式は、図8(C)に示されるように、記憶回路Ckは、複数行L1に相当する要素Aijがインデックスの順番に格納されるように変形することもできる。
 [各部の変形例]
 演算回路12は、上記の(1)式で示される行列演算を、並列演算により実行可能な複数の演算器を含むASIC(Application Specific Integrated Circuit)またはFPGA(Field Programmable Gate Array)によって構成され得る。
 また、複数の演算器CLkを備える並列演算回路121は、複数の処理(例えば積和演算)を並列に実行することができる構成であればよく、例えば並列演算回路121は、マルチコアプロセッサにより構成され得る。その場合には、複数のプロセッサコアは、複数の演算器CLkにそれぞれ対応する。
 また、本実施の形態1では、行列Aの非零要素Aijと入力ベクトルの対応する要素xは、演算回路12の初期化処理時に入力変換回路131を経由して係数記憶回路132に格納され得る。なお、行列Aの非零要素Aijと入力ベクトルの対応する要素xの値が固定である場合には、係数記憶回路132は、非零要素Aijと対応する要素xの値を格納したROM(Read Only Memory)を含み得る。
 行列Aとベクトルxの積の計算を高速化するために、行列Aの1行分の積和演算を、2つ以上の演算器CLkにより実施してもよい。その場合には、各演算器CLkからの演算結果の和を取るために、出力記憶回路142は各演算器CLkの演算結果を格納するために使用され得る。
 また、入力データの重複した読込みまたは参照を回避し得る畳み込み演算に特化した構成を、外部記憶装置62または外部入力装置61と演算回路12の入力変換回路131との間に追加してもよい。
 また、行列Aが小さいために、入力ベクトルxとしてラインバッファから画像のイメージ部分を切り出すための処理は、通常の畳込み核の高さと同じライン数をもつラインバッファ取り込みとカーネル係数レジスタ(ウィンドウ)から入力データを取り込むことを前提とする。このようなラインバッファは、ラスタスキャンの順番でデータを取り込み、且つライン分のデータを取り込んだ時点で、もっとも古いラインを次にデータを取り込むラインとして使用するようなリングバッファの構造を有しても良い。
 [全体処理のフローチャート]
 図12は、本実施の形態1に係る並列処理の説明するフローチャートである。図12のフローチャートに従う処理は、制御プログラム150として制御回路30のメモリ32に格納されている。プロセッサ31が、制御プログラム150をメモリ32から読出し、読出された制御プログラム150を実行する。
 図12の処理を、図6を参照しつつ説明する。まず、プロセッサ31は、初期化処理(ステップS1)を実施する。
 具体的に、初期化処理では、プロセッサ31は、入力変換回路131を起動し、初期化処理を実施させる。入力変換回路131は、外部記憶装置62または外部入力装置61からの係数行列Aの非零の要素Aijとバイアスベクトルbの要素biを、係数記憶回路132の複数の記憶回路Cnに格納する。具体的には、図9で説明したように、記憶回路Cnに対応のセレクタ13が、要素Aijと要素biのインデックスと選択指令151とに基づき、選択した要素Aijと要素biを対応の記憶回路Cnに格納する。
 初期化処理が終了すると、演算回路12は通常処理に移行する。通常処理においては、制御回路30のプロセッサ31は、外部記憶装置62または外部入力装置61から演算回路12に入力ベクトルxの要素をx1,…,xmが出力されたことを判定すると、入力変換回路131に、要素x1,…,xmを入力記憶回路133に格納させる(ステップS3)。具体的には、図9で説明したように、セレクタ13が、要素x1,…,xmのインデックスと選択指令151とに基づき、選択した要素xjを対応の記憶回路MIkに格納する。
 制御回路30のプロセッサ31は、セレクタ13により、ベクトルxの要素をx1,…,xmを対応の記憶回路MIkに格納する処理が完了したか否かを判断する(ステップS5)。プロセッサ31は、格納が完了していないと判断した場合(ステップS5でNO)、ステップS3に戻るが、格納が完了していると判断した場合(ステップS5でYES)、ステップS7に移行する。格納が完了した(ステップS5でYES)とき、各記憶回路Ckは、非零の要素Aijが演算されるべき順番で格納された状態となり、また各記憶回路MIkは、非零の要素Aijに対応する要素biが、演算されるべき順番で格納された状態となる。
 制御回路30のプロセッサ31は、並列演算回路121に演算を実施させる(ステップS7)。ここでは、記憶回路Ckには、図8(A)に示した1つ目の方式に従い係数データ(非零の要素Aijと要素bi)が格納されているケースを説明する。
 並列演算回路121の各演算器CLkは、対応の記憶回路Ckの位置(アドレス)から読出した非零の要素Aijと、対応の記憶回路MIkの当該アドレスに対応したアドレスから読出した要素xとの積を、記憶回路Ckに格納された要素Aijのそれぞれについて繰返すことで、上記に述べた(積和演算処理)が完了する。全ての演算器CLkにおいて、積和演算処理は同時に(並行して)実施される。
 制御回路30のプロセッサ31は、全ての演算器CLkにおいて積和演算処理が終了したとき、各演算器CLkを、演算結果である累算値sum(出力f)を出力変換回路141に出力するように制御する。また、プロセッサ31は、出力変換回路141を、各演算器CLkからの出力fを、制御指令を用いて各記憶回路MOkに格納するよう制御する(ステップS9)。
 制御回路30のプロセッサ31は、出力fの格納が完了したか否かを判断する(ステップS11)。プロセッサ31は、格納が完了していないと判断すると(ステップS11でNO)、ステップS11に戻るが、格納は完了したと判断すると(ステップS11でYES)、プロセッサ31は、出力記憶回路142を、各記憶回路MOkに格納されている出力fを外部記憶装置62または外部出力装置63に出力するよう制御する(ステップS13)。このとき、出力記憶回路142は、各記憶回路MOkから格納されている順に出力fの読出し、読出された出力fを読出された順序で回線に送出する。各記憶回路MOkから外部記憶装置62または外部出力装置63への出力fの送出は同時に実行される。
 制御回路30のプロセッサ31は、演算処理は終了したか否かを判断する(ステップS15)。プロセッサ31は、終了したと判断すると図12の処理は終了するが(ステップS15でYES)、終了していないと判断すると(ステップS15でNO)、ステップS3に戻る。なお、ステップS15の判断は、例えばCPU51からの指令に基づきなされる。
 (フローチャートの変形例)
 図12のフローチャートでは、係数記憶回路132の記憶回路Ckの格納方式は、図8(A)の1つ目の方式であったが、図8(B)の2つ目の格納方式であってもよい。
 2つ目の格納方式の場合は、並列演算回路121は、係数記憶回路132の各演算器CLkに対応する記憶回路Ckに格納された各要素Aijに、当該要素Aijに対応のフラグFより指示される種類の演算または処理を施す。この場合も、並列演算回路121の全ての演算器CLkは同時に動作する。
 2つ目の格納方式の場合、並列演算回路121の各演算器CLkに対する演算量の平準化のため、係数行列Aの1行分の演算を2つ(以上)の演算器CLkに振り分けて実施してもよい。この場合、並列演算回路121は、振り分けがなされた2つ(以上)の演算器CLkで計算した結果の和を、共有メモリ124を利用して算出する。また、振り分けがなされる演算器CLkの数が多くない場合、全演算数に対するこの振り分け処理の数は僅かとなり、振り分け処理が演算回路12の演算性能へ及ぼす影響を無視することが可能となる。
 実施の形態1によれば、入力I/F122により、並列演算回路121の各演算器CLkのみが読出し可能な記憶回路CkとMIkに、当該演算器CLkで演算されるべき係数データ(要素Aijおよび要素bi)および入力データ(要素x)を、演算に先立ち格納しておくことができる。これにより、全ての演算器CLkが演算を同時(並列)に実施するときに、係数データおよび入力データのアクセス(読出し)の競合を確実に回避することができて、並列処理を高速に実施することが可能となる。
 また、記憶回路Ckには、非零の要素Aijのみが格納されているから、各演算器CLkにおいて、零である要素Aijを用いた積の演算、すなわち不要な乗算を、積和演算から排除することができる。これにより、並列演算回路121で複数の演算器CLkによる積和演算の並列処理が開始されてから、処理の最終結果である出力ベクトルfの要素をf1,…,fnを得るまでの所要時間を短くすることが可能となる。
 実施の形態2.
 実施の形態2は、実施の形態1の変形例を示す。図13は、本実施の形態2に係る演算回路12Aの入力I/Fと出力I/Fの構成を示す図である。図13の演算回路12Aは、図6の入力I/F122とは異なる入力I/F122Aを有する。演算回路12Aの他の構成は、図6のそれらと同様であるので説明は繰返さない。
 図13を参照して、入力I/F122Aは、入力変換回路131および入力記憶回路133に代えて、入力変換回路131Aおよび入力通知回路133Cを備える。図14は、図13の入力通知回路133Cの構成を示す図である。図14を参照して、入力通知回路133Cは、図9のセレクタ13の機能と、通知Nの出力機能とを備える複数のセレクタ13Aを備える。複数のセレクタ13Aは、演算器CLkにそれぞれ対応する。
 入力変換回路131Aは、外部入力装置61または外部記憶装置62から、入力ベクトルxの要素xjを受付けたとき、要素xjのインデックスの値に基づき、複数の演算器CLkのうち、当該要素xjを用いた演算を実施する演算器CLkを特定し、特定された演算器CLkのみに要素xjを出力する。また、このとき、図14の入力通知回路133Cでは、入力変換回路131Aにより特定された演算器CLkに対応のセレクタ13Aが、対応の演算器CLkに演算の通知Nを出力する。通知Nを受けた演算器CLkは、係数記憶回路132の記憶回路Ckから要素Aijと要素biを読出し、読出された要素Aijと要素biおよび入力変換回路131から要素xjを用いた積和演算を実施する。
 実施の形態2によれば、例えば、外部入力装置61または外部記憶装置62から演算回路12へ要素xjを転送する速度が低速である場合は、図13の演算回路12Aのように、入力記憶回路133による要素xjの記憶に代えて、入力変換回路131Aが要素xjを演算器CLkに直接入力する。
 これにより、入力記憶回路133のためのメモリリソースを不要にすることができる。さらに、入力通知回路133Cから通知を受けなかった演算器CLkは、すなわち当該要素xjを用いた演算をする必要のない演算器CLkを休止させることが可能となる。したがって、演算回路12の回路規模と消費電力を小さくすることが可能になる。
 実施の形態3.
 実施の形態3は、実施の形態1の変形例を示す。図15は、本実施の形態3に係る演算回路12Bの入力I/Fと出力I/Fの構成を示す図である。図15の演算回路12Bは、図6の出力I/F123とは異なる出力I/F123Bを有する。演算回路12Bの他の構成は、図6のそれらと同様であるので説明は繰返さない。
 図15を参照して、出力I/F123Bは、出力変換回路141、出力記憶回路142および出力通知回路143を備える。図16は、図15の出力通知回路143の構成を周辺回路と関連付けて示す図である。図16を参照して、出力通知回路143は、テーブル144および判断回路145を備える。テーブル144には、外部記憶装置62または外部出力装置63に送出されるべき出力fを識別する例えばインデックス情報が格納されている。インデックス情報は、外部記憶装置62または外部出力装置63が必要としている種類または個数の出力fを示す。
 判断回路145は、出力変換回路141を介して各演算器CLkから送出される出力fを監視する監視処理1451を実施する。監視処理1451では、例えば出力fのインデックスが読取られる。判断回路145は、監視の結果に基づき、テーブル144のインデックス情報が示す必要な種類または個数の全ての出力fが、並列演算回路121から出力されたと判断したとき、通知N1を外部記憶装置62または外部出力装置63に出力する。外部記憶装置62または外部出力装置63は、判断回路145から通知N1が出力されるまでは休止し、判断回路145から通知N1を受付けたとき、起動して、出力記憶回路142からの出力fを受付ける。
 実施の形態3によれば、例えば外部記憶装置62または外部出力装置63からバス40へのデータ出力が低速な場合は、出力通知回路143から通知N1が出力されるまでの期間では、すなわちバス40へのデータ出力が不要な期間では、外部記憶装置62または外部出力装置63を休止させることが可能になる。これにより、外部記憶装置62または外部出力装置63の消費電力量を少なくすることが可能になる。
 実施の形態4.
 実施の形態4は、実施の形態1の変形例を示す。図17は、本実施の形態4に係る演算回路12Bの入力I/Fと出力I/Fの構成を示す図である。図17の演算回路12Cは、実施の形態2の入力I/F122Aと実施の形態3の出力I/F123Bとを備える。
 これにより、外部入力装置61または外部記憶装置62から演算回路12Cへデータを転送する速度、または外部記憶装置62または外部出力装置63がバス40へデータを出力する速度が低速である場合に、実施の形態2と実施の形態3における両方の利点を得ることができる。すなわち、入力記憶回路133のためのメモリリソースを不要にすることができる。さらに、演算を実施する必要のない演算器CLkを休止させることが可能となる。また、外部記憶装置62または外部出力装置63を常に動作させることなく休止させることができる。
 実施の形態5.
 実施の形態5は、実施の形態1の変形例を示す。図18は、本実施の形態5に係る演算回路12Dの入力I/Fと出力I/Fの構成を示す図である。図18の演算回路12Dは、図6の入力I/F122とは異なる入力I/F122Dを有する。演算回路12Dの他の構成は、図6のそれらと同様であるので説明は繰返さない。
 図18を参照して、入力I/F122Dは、入力変換回路131、係数記憶回路132、2重化入力記憶回路133Aおよび2重化入力記憶回路133Bを備える。2重化入力記憶回路133A,133Bにより、図6の入力記憶回路133は2重化される。2重化入力記憶回路133A,133Bのそれぞれは、実施の形態1で説明した入力記憶回路133と同じ構成を有し、同様な動作をすることが可能である。
 制御回路30のプロセッサ31は、2重化入力記憶回路133A,133Bの一方の機能を、外部入力装置61または外部記憶装置62からの要素xを受付けるような機能に切替え、他方の機能を並列演算回路121へ要素xを出力する機能に切替える。プロセッサ31は、2重化入力記憶回路133A,133Bのそれぞれが、各動作を完了したとき、一方の機能を並列演算回路121へ要素xを出力する機能に切替え、他方の機能を、外部入力装置61または外部記憶装置62からの要素xの受付けるような機能に切替える。
 実施の形態5によれば、外部入力装置61または外部記憶装置62から演算回路12Dへ要素xを転送する速度が高速であるときは、2重化入力記憶回路133A,133Bを用いることにより、演算回路12Dが、外部入力装置61または外部記憶装置62から要素xを受信する処理と、並列演算回路121による演算処理とを同時に実施することが可能になる。したがって、演算回路12Dによる演算速度を高速化することが可能となる。
 実施の形態6.
 実施の形態6は、実施の形態1の変形例を示す。図19は、本実施の形態6に係る演算回路12Eの入力I/Fと出力I/Fの構成を示す図である。図19の演算回路12Eは、図6の出力I/F123とは異なる出力I/F123Eを有する。演算回路12Eの他の構成は、図6のそれらと同様であるので説明は繰返さない。
 図19を参照して、出力I/F123Eは、出力変換回路141、2重化出力記憶回路142Aおよび2重化出力記憶回路142Bを備える。2重化出力記憶回路142A,142Bにより、図6の出力記憶回路142は2重化される。2重化出力記憶回路142A,142Bのそれぞれは、実施の形態1で説明した出力記憶回路142と同じ構成を有し、同様な動作をすることが可能である。
 制御回路30のプロセッサ31は、2重化出力記憶回路142A,142Bの一方の機能を、並列演算回路121から出力変換回路141を経由した出力fを記憶回路MOkに格納する機能に切替え、他方の機能を記憶回路MOkから出力fを読出し、読出された出力fを外部記憶装置62または外部出力装置63へ送出する機能に切替える。プロセッサ31は、2重化出力記憶回路142A,142Bのそれぞれが、各動作を完了したとき、一方の機能を記憶回路MOkから出力fを読出し、外部記憶装置62または外部出力装置63への送出する機能に切替え、他方の機能を、並列演算回路121から出力変換回路141を経由した出力fを記憶回路MOkに格納する機能に切替える。
 実施の形態6は、例えば、演算回路12から外部記憶装置62または外部出力装置63へ出力fを高速に送出することが要求される場合に適用され得る。具体的には、出力記憶回路が2重化されることにより、演算回路12は、外部記憶装置62または外部出力装置63への出力fを出力する処理と、並列演算回路121による演算処理とを同時に(並列に)実施することが可能となり、演算回路12の演算処理をさらに高速化することができる。
 実施の形態7.
 実施の形態7は、実施の形態1の変形例を示す。図20は、本実施の形態7に係る演算回路12Fの入力I/Fと出力I/Fの構成を示す図である。図20の演算回路12Fは、実施の形態5の2重化入力記憶回路133A,133Bおよび実施の形態6の2重化出力記憶回路142A,142Bを備える。
 実施の形態7の演算回路12Fは、入力記憶回路および出力記憶回路を、それぞれ2重化して備える。演算回路12Fによれば、外部入力装置61または外部記憶装置62から高速に出力される要素xの受付け、外部記憶装置62または外部出力装置63への出力fの高速な送出、および並列演算回路121による演算処理が同時に可能となる。
 実施の形態8.
 実施の形態8は、実施の形態1の変形例を示す。図21は、本実施の形態8に係る演算回路の構成を示す図である。図21の演算回路は、演算回路12Gと、演算回路12Gに接続された演算回路12Hを有する。演算回路12Gは、実施の形態1の演算回路12の出力I/F123が削除されているが、他は演算回路12と同じである。演算回路12Hは、入力I/F122H、並列演算回路121および出力I/F123を備える。入力I/F122Hは、入出力変換回路131H、係数記憶回路132および入力記憶回路133を備える。図21において、入出力変換回路131Hを除く他の構成は、実施の形態1の演算回路12が備える構成と同じであるから、説明は繰返さない。
 入出力変換回路131Hは、演算回路12Gの複数の演算器CLkからの出力fを直接受付けて、受付けた出力fから、演算回路12Hの演算器CLk毎に、当該演算器CLkにより演算されるべき出力fを特定する。そして、入出力変換回路131Hは、特定した出力fを、当該演算器CLkに対応する入力記憶回路133の記憶回路MIkに演算されるべき順序に従い格納する。図21では、演算回路12は2つ接続されるが、接続される個数は、3つ以上であってもよい。
 実施の形態8によれば、2つ以上の演算回路12を接続することが可能となる。例えば、LSI(Large-Scale Integration)回路内で2つ以上の演算回路12を接続することが可能となる。このように、2つ以上の演算回路12を接続するような場合、演算回路どうしを接続する接続部に入出力変換回路131Hを備えることにより、出力変換回路141および入力変換回路131によるセレクタ14(またはセレクタ13)を用いた2つの処理を、入出力変換回路131Hによる1回の処理で済ませることができる。したがって、複数の演算回路を接続するとしても、処理の高速化は可能となる。
 実施の形態9.
 実施の形態9は、実施の形態1の変形例を示す。図22は、本実施の形態9に係る演算回路の構成を示す図である。図22の演算回路は、演算回路12Gと、演算回路12Gに接続された演算回路12Iを有する。演算回路12Gは、実施の形態1の演算回路12の出力I/F123が削除されているが、他は演算回路12と同じであるので、説明は繰返さない。
 演算回路12Iは、入力I/F122H、並列演算回路121および出力I/F123Bを備える。並列演算回路121および出力I/F123Bは、実施の形態3で示されたものと同様である。入力I/F122Iは、実施の形態8で示された入出力変換回路131H、出力通知回路143I、係数記憶回路132および入力記憶回路133を備える。入出力変換回路131H、係数記憶回路132および入力記憶回路133は、実施の形態3または実施の形態8で示されたものと同様であるから、説明は繰返さない。
 出力通知回路143Iは、演算回路12Iの各演算器CLkに通知N2を出力する。具体的には、入出力変換回路131Hが、前段の演算回路12Gの複数の演算器CLkからの出力fを、演算回路12Iの各演算器CLkに対応する記憶回路MIkに格納するときに、出力通知回路143Iは、当該記憶回路MIkに当該出力fよりも先に演算されるべき出力fが格納されているかを判定する。出力通知回路143Iは、この判定を、例えば、出力fのインデックスの値に基づき実施する。出力通知回路143Iは、記憶回路MIkに先に演算されるべき出力fが全て格納されていると判定したとき、当該記憶回路MIkに対応する演算器CLkに通知N2を出力する。これにより、演算器CLkは、対応の記憶回路MIkに積和演算の開始に必要な要素xj(すなわち、出力f)の全てが格納されたことの通知N2を受けたとき、積和演算を開始することができる。
 なお、図22では、演算回路12は2つ接続されるが、接続される個数は、3つ以上であってもよい。
 実施の形態9によれば、実施の形態3に示す2つ以上の演算回路12Bを接続することが可能となる。例えば、2つ以上の演算回路12BをLSI回路内で接続するような場合、接続部に入出力変換回路131Hを備えることにより、出力変換回路141の処理および入力変換回路131による処理の2つの処理を、入出力変換回路131Hによる1回の処理で済ませることができる。したがって、複数の演算回路を接続するとしても、処理の高速化は可能となる。
 実施の形態10.
 実施の形態10は、実施の形態1の変形例を示す。図23は、本実施の形態10に係る演算回路の構成を示す図である。図23の演算回路は、演算回路12Jと、演算回路12Jに接続された演算回路12Kを有する。演算回路12Jは、実施の形態7で示された演算回路12Fから出力I/F123が削除されているが、他の構成は演算回路12Fのそれらと同様であるので、説明は繰返さない。また、演算回路12Kは、入力I/F122K、並列演算回路121、および出力I/F123Eを備える。入力I/F122Kは、入出力変換回路131K、2重化入力記憶回路133A,133Bおよび係数記憶回路132を備える。演算回路12Kにおける入出力変換回路131Kを除く他の構成は、実施の形態7の演算回路12Fのそれらと同じであるので、説明は繰返さない。
 入出力変換回路131Kは、演算回路12Jの複数の演算器CLkからの出力fを直接受付けて、受付けた出力fから、演算回路12Kの演算器CLk毎に、当該演算器CLkにより演算されるべき出力fを特定する。入出力変換回路131Kは、特定した出力fを、当該演算器CLkに対応する入力記憶回路133の記憶回路MIkに演算されるべき順序に従い格納する。ここでは、演算回路は2つ接続されるが、接続される個数は、3つ以上であってもよい。
 実施の形態10によれば、実施の形態7に示す2つ以上の演算回路12Fを接続することが可能となる。例えば、2つ以上の演算回路12FをLSI回路内で接続するような場合、接続部に入出力変換回路131Kを備えることにより、出力変換回路141の処理および入力変換回路131の処理の2つの処理を、入出力変換回路131Kによる1回の処理で済ませることができる。したがって、複数の演算回路を接続するとしても、処理の高速化は可能となる。
 (各実施の形態の変形例)
 各実施の形態に係る演算回路は、図24のように変形されてもよい。図24は、本発明の各実施の形態に係る演算回路の「行列ケース」に従う演算を実行可能な構成の一例を模式的に示す図である。実施の形態1.~実施の形態8.の演算回路は、図24に示すような、「行列ケース」に従う積和演算を算出可能に構成され得る。図24では、n×nの係数行列Aと、入力データ100に相当するn×nの行列Xの積和演算を実行可能な演算器CLkが示される。
 図24を参照して、演算器CLkは、図11に示すものと同様の構成を有するので説明は繰返さない。図24では、演算器CLkには、演算器CLkから読出し可能な係数記憶回路132R、バイアスベクトルbの要素を格納する係数記憶回路132および入力記憶回路133が接続される。入力記憶回路133は、図11に示すものと同様の構成を有する。係数記憶回路132Rは破線で示すようリングバッファを備える。
 演算器CLkの積和演算の結果は記憶回路AMOkに格納される。記憶回路AMOkは、n個のレジスタRGを含む。したがって、記憶回路AMOk(k=1、2、…、n)は、行列の次元数(n×n個)と同数のレジスタRGを備える。
 図24では、演算器が備える複数の演算器CLkのうち1つを示すが、他の演算器CLkも同様の構成を有する。行列Xはn個の列ベクトルから構成されるとみなし、図24の入力記憶回路133には行列Xの要素が列優先の順番で入力される。図24の入力記憶回路133には、例えば、行列Xのk番目の列の要素xk1~xknが格納されている。
 演算器CLkは、行列Xの1列分の積和演算を、実施の形態1~8の場合と同様に、行列Xの列毎に繰返す。演算器CLkは係数行列Aのk番目の行と行列Xの各列との積和演算を実施し、n個の積和演算の値(出力fiに相当)を出力する。この積和演算においても、係数行列Aのk番目の行の要素のうち非零の要素Aijが選択されて、選択された非零要素Aijを用いた積和演算が実施される。説明を簡単にするために、係数行列Aのk番目の行は非零要素Aijを含まないとする。
 演算器CLkから出力されるn個の積和演算の値は、それぞれ、記憶回路AMOkのn個のレジスタRGに格納される。図24では、例えば、演算器CLkが行列Xのk番目の列を用いた積和演算を実行した場合において、その積和演算の値が、記憶回路AMOkのk番目のレジスタRG(斜線で示されたレジスタRG)に格納された状態が示される。
 演算器CLk(k=1、2、…n)が積和演算を終了したとき、出力記憶回路の記憶回路AMOk(k=1、2、…n)が備える(n×n個)のレジスタRGには、係数行列Aと行列Xの積和演算の結果が格納される。
 ここで、実施の形態の背景として、演算器CLkが積和演算を繰返し中は、行列Xのk番目の列の積和演算が完了し、その後に次列(k+1番目の列)の積和演算を開始するとき、当該次列の積和演算を開始する前に、演算器CLkの係数行列Aの入力を初期化する必要がある。例えば、係数行列Aのk番目の行の先頭の要素から読出し開始可能にするような初期化が必要とされる。したがって、次列の積和演算の開始は、当該初期化にかかる時間だけ遅延するおそれがある。
 このような遅延を回避するために、図24では、係数行列Aのk番目の行の要素は、係数記憶回路132Rのリングバッファに格納される。これにより、図24の演算器CLkは、行列Xのk番目の列の積和演算が完了したときは、上記の初期化なしに、次列(k+1番目の列)の積和演算を開始することができる。したがって、「行列ケース」における積和演算を高速に実施することが可能となる。
 なお、実施の形態1.~実施の形態8.で説明したような係数行列Aと入力ベクトルxの積和演算においても、リングバッファを備える係数記憶回路を用いることができる。したがって、図24の演算回路を適用することにより、行列×ベクトルの積和演算および「行列ケース」に従う行列×行列の積和演算の両方において積和演算の高速化できる。
 (各実施の形態のさらなる変形例)
 各実施の形態のさらなる変形例を説明する。各実施の形態に係る演算回路は図25のように変形されてもよい。図25は、本発明の各実施の形態に係る演算回路の「行列ケース」に従う演算を実行可能な構成の他の例を模式的に示す図である。実施の形態1.~実施の形態8.の演算回路は、図25に示すような演算回路を適用することができる。図25でも、図24と同様に、n×nの係数行列Aと、n×nの行列Xの積和演算を実行可能な演算器CLkが示される。
 図25の演算器CLk、係数記憶回路132および132R、入力記憶回路133および記憶回路AMOkの構成は、図24のそれらと同様あるので、これらの説明は繰返さない。図25では、演算回路は出力インターフェイス123Rを備える。出力インターフェイス123Rは、n個の記憶回路AMOk(k=1、2、・・・、n)を含む出力記憶回路142Rを備える。
 図25では、図24のケースとは異なり、行列Xの要素は行優先の順番で入力記憶回路133に格納されて、係数行列Aのk番目の列の要素は係数記憶回路132Rに格納される。このように、図25の演算器CLkを用いた積和演算では、行列Xは行ベクトルから構成されて、係数行列Aは列ベクトルから構成されるとみなされる。
 図25の演算器CLkは、行列Xのk番目の行ベクトル(当該行ベクトルのすべての要素xk1~xkn)が入力記憶回路133に格納されると、格納された要素xk1~xknと係数行列Aのk番目の列の要素Ak1~Aknとを用いた積和演算を実行する。この積和演算においては、要素Ak1~Aknのうち非零の要素Aijが選択されて、選択された非零要素Aijを用いた積和演算が実施される。説明を簡単にするために、係数行列Aのk番目の列は非零要素Aijを含まないとする。
 係数行列Aおよび行列Xを用いた積和演算が完了すると、出力記憶回路142Rのn個の記憶回路AMOkが備えるn×n個のレジスタRGに、それぞれ、要素Tijとして積和演算結果の値が格納される。したがって、出力記憶回路142Rには、(n×n)次元の行列Tが格納される。
 プロセッサ31は、行列Tから読出すべき要素Tijの順番を決定し、決定した順番に従い、要素TijがレジスタRGから読出されるように、出力インターフェイス123Rに制御指令CMを出力する。例えば、図25の演算器CLkを備える演算回路12の出力段に次の(別の)演算回路12が接続される場合を想定する。この場合、制御指令CMは、次の演算回路12の入力データとして、列優先順に従う入力データとするか、または行優先順に従う入力データとするかの指定を含む。出力インターフェイス123Rは制御指令CMに従い、n×n個のレジスタRGから要素Tijを読出す。これにより、次の演算回路12は、入力データの行列Xの要素xijを列優先の順番または行優先の順番で受信することができる。
 図25によれば、演算回路12が行列と行列の積和演算を実行して得られた行列Tを、次の演算回路12が入力(すなわち行列X)として受付ける場合に、次の演算回路12は、積和演算処理を実施するに際して、行列Xの要素xijを列優先の順番または行優先の順番で並べ替える処理を実施する必要はない。
 具体的には、通常、外部入力装置61または外部記憶装置62を介して演算回路12に転送される行列Xが画像等である場合は、外部入力装置61または外部記憶装置62は行列Xの要素xijを行優先の順番で演算回路12に出力する。したがって、行列Tの要素xijが、並べ替えされずに、次の演算回路12に出力される場合は、次の演算回路12は積算処理を開始する前に行列Tの要素Tijを行優先の順番で並べ替える必要がある。これに対し、図25では、出力インターフェイス123Rが制御指令CMに従い出力記憶回路142Rから要素Tijを読出す。
 具体的には、プロセッサ31は、例えば積和演算処理の対象となる入力データ(すなわち行列Tの要素Tij)の種類に基づき制御指令CMを設定する。この種類は画像を含み得る。プロセッサ31は、入力データの種類が画像であれば、制御指令CMに“行優先”の読出指令を設定し、そうでなければ“列優先”の読出指令を設定する。
 出力インターフェイス123Rは、制御指令CMが“行優先”の読出指令を示すとき、n×n個のレジスタRGから要素Tijを、インデックスに従い行優先の順番で読出し、また、制御指令CMが“列優先”の読出指令を示すときは、要素Tijをインデックスに従い列優先の順番で読出す。このように、入力データの種類(画像か否か等)に基づき次の演算回路12は、行列Tの要素Tijが列優先および行優先のいずれか一方に従い配列された入力(すなわち行列X)を受付けることができて、行列Xの要素xijの並べ替え処理を省略することができる。これにより、演算回路12は積和演算処理を高速に実施することができる。
 今回開示された実施の形態はすべての点で例示であって制限的なものでないと考えられるべきである。この発明の範囲は上記した説明ではなくて請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。
 12,12A,12B,12C,12D,12E,12F,12G,12H,12I,12J,12K 演算回路、17 ポート、61 外部入力装置、62 外部記憶装置、63 外部出力装置、x 入力ベクトル、111,A 係数行列、121 並列演算回路、124 共有メモリ、131,131A 入力変換回路、132,132D 係数記憶回路、133 入力記憶回路、133A,133B 2重化入力記憶回路、133C 入力通知回路、141 出力変換回路、142 出力記憶回路、142A,142B 2重化出力記憶回路、143,143I 出力通知回路、CLk 演算器、Ck,Cn,MIk,MOk 記憶回路。

Claims (17)

  1.  非零要素と零要素とを含む係数行列に右から入力ベクトルを掛け、演算結果を出力ベクトルに出力するよう構成される複数の演算器を含む並列演算回路と、
     複数の記憶回路を含む入力インターフェイスと、を備え、
     前記複数の演算器は、前記複数の記憶回路にそれぞれ対応するように構成され、
     各前記記憶回路は、
     前記入力ベクトルの要素を記憶する入力記憶回路と、
     リングバッファを備える係数記憶回路であって、前記リングバッファに前記係数行列を構成する行または列ベクトルの要素を格納する係数記憶回路と、を有し、
     前記入力ベクトルの要素および前記係数行列の要素は、当該要素が乗算されるべき順番を指定するインデックスを有し、
     前記入力インターフェイスは、前記入力ベクトルと前記係数行列の各要素を、当該要素が有する前記インデックスに基づき、前記複数の演算器のうちの1の前記演算器に対応した前記入力記憶回路と前記係数記憶回路の前記リングバッファに、それぞれ、前記順番に従い格納するよう構成され、
     各前記演算器は、前記記憶回路の前記係数行列の前記行または列ベクトルの要素と前記入力ベクトルの対応する要素との乗算を順次実行し、当該要素の前記インデックスに基づき、当該乗算の結果を前記出力ベクトルの対応する要素に積算するように構成される、演算回路。
  2.  前記並列演算回路は、さらに、前記係数行列に右から入力行列を掛け、演算結果を出力行列に出力するよう構成され、
     前記入力ベクトルは、前記入力行列を構成する行または列ベクトルを含み、
     前記出力行列を構成する行または列ベクトルは、前記各演算器に対応の前記出力ベクトルを含む、請求項1に記載の演算回路。
  3.  前記出力行列を格納するように構成された複数の出力記憶回路を含む出力インターフェイスをさらに備え、
     前記複数の出力記憶回路は、前記複数の演算器にそれぞれ対応するように構成され、
     各前記出力記憶回路は、対応の前記演算器からの前記出力ベクトルを格納するように構成され、
     前記出力インターフェイスは、前記複数の出力記憶回路から前記出力行列の要素を前記インデックスに基づき列優先または行優先で読出すように構成される、請求項2に記載の演算回路。
  4.  前記出力インターフェイスは、制御指令に従い、前記複数の出力記憶回路から前記出力行列の要素を前記列優先または前記行優先で読出すように構成される、請求項3に記載の演算回路。
  5.  前記出力行列を前記入力行列として他の前記演算回路に出力するとき、前記制御指令は、前記出力行列の要素が表すデータの種類に基づき、列優先および行優先のいずれか一方に従う読出指令を含む、請求項4に記載の演算回路。
  6.  前記データの種類は画像を含む、請求項5に記載の演算回路。
  7.  前記入力記憶回路は、2重化された入力記憶回路を含み、
     前記2重化された入力記憶回路の一方は、外部装置からの前記入力ベクトルを格納し、格納が完了したとき、対応する前記演算器による入力ベクトルの読出が可能なように構成され、
     前記2重化された入力記憶回路の他方は、対応する前記演算器により入力ベクトルが読出されて、読出しが完了したとき、前記外部装置からの前記入力ベクトルを格納するよう構成される、請求項1から6のいずれか1項に記載の演算回路。
  8.  前記要素が有するインデックスは、さらに、当該要素を演算するべき前記演算器を指定し、
     前記入力インターフェイスは、
     外部装置からの前記係数行列の前記行または列ベクトルの要素を、当該要素が有する前記インデックスに基づき、前記複数の演算器のうちの1の前記演算器に対応した前記係数記憶回路のリングバッファに、前記順番に従い書込むよう構成される、請求項1から7のいずれか1項に記載の演算回路。
  9.  前記演算回路は、
     前記複数の演算器のうちの1の演算器の演算結果を格納し、他の前記演算器から読出し可能に構成される共有メモリを、さらに備える、請求項1から8のいずれか1項に記載の演算回路。
  10.  前記出力インターフェイスは、さらに、出力回路と、前記各演算器からの前記出力ベクトルを前記外部装置に出力する複数のポートとを含み、
     前記複数の出力記憶回路は、前記複数のポートにそれぞれ対応し、
     前記出力回路は、
     前記各演算器から前記出力ベクトルの要素を受付けたとき、予め定められた基準情報と当該要素の前記インデックスとに基づき、前記複数の出力記憶回路から1つを選択し、選択された出力記憶回路に当該要素を格納するよう構成される、請求項3から6のいずれか1項に記載の演算回路。
  11.  前記出力回路は、さらに、
     前記予め定められた基準情報と前記出力ベクトルの要素の前記インデックスとに基づく順番に従い、前記選択された出力記憶回路に当該要素を格納するよう構成される、請求項10に記載の演算回路。
  12.  前記出力回路は、
     予め定められた数の要素が前記複数の出力記憶回路に格納されたとき、前記複数の出力記憶回路の前記要素を前記複数のポートを介して出力する、請求項10または11に記載の演算回路。
  13.  前記出力回路は、
     前記予め定められた数の要素が前記複数の出力記憶回路に格納されたとき、当該要素を前記複数のポートを介して出力する旨の通知を、前記外部装置に出力する、請求項12に記載の演算回路。
  14.  各前記出力記憶回路は、2重化された出力記憶回路を含み、
     前記2重化された出力記憶回路の一方は、前記演算器からの前記出力ベクトルの要素を格納し、格納が完了したとき、対応する前記ポートによって要素が読出されるように構成され、
     前記2重化された出力記憶回路の他方は、対応する前記ポートにより前記演算結果が読出されて、読出しが完了したとき、前記演算器からの前記出力ベクトルの要素が格納されるように構成される、請求項10から13のいずれか1項に記載の演算回路。
  15.  前記入力ベクトルは、他の前記演算回路が備える前記各演算器からの前記出力ベクトルを含む、請求項1から14のいずれか1項に記載の演算回路。
  16.  前記演算回路は、畳み込みニューラルネットワークにおける畳み込み層の演算を実行するためのものであり、
     前記入力ベクトルは、前記畳み込み層に入力される特徴マップを一列に展開したものであり、
     前記係数行列は、前記畳み込み層で利用されるカーネルに対応する、請求項1から15のいずれか1項に記載の演算回路。
  17.  非零要素と零要素とを含む係数行列に右から入力ベクトルを掛け、演算結果を出力ベクトルに出力するよう構成される複数の演算器を含む並列演算回路を用いた演算方法であって、
     前記入力ベクトルの要素および前記係数行列の要素は、当該要素が乗算されるべき順番を指定するインデックスを有し、
     前記演算方法は、
     前記入力ベクトルの要素を、当該要素が有する前記インデックスに基づき、前記複数の演算器のうちの1つに対応した入力記憶回路に、前記順番に従い格納すること、
     前記係数行列を構成する行または列ベクトルの要素を、当該要素が有する前記インデックスに基づき、前記複数の演算器のうちの1つに対応したリングバッファに、前記順番に従い格納すること、
     各前記演算器を用いて、前記リングバッファの前記係数行列の前記行または列ベクトルの要素と前記入力記憶回路の前記ベクトルの対応する要素との乗算を順次実行し、当該要素の前記インデックスに基づき、当該乗算の結果を前記出力ベクトルの対応する要素に積算すること、とを備える、演算方法。
PCT/JP2018/034834 2017-10-18 2018-09-20 演算回路および演算方法 WO2019077933A1 (ja)

Priority Applications (4)

Application Number Priority Date Filing Date Title
DE112018004972.8T DE112018004972T5 (de) 2017-10-18 2018-09-20 Operationsschaltung und operationsverfahren
US16/645,599 US11281376B2 (en) 2017-10-18 2018-09-20 Operation circuit and method of operation for use in operations that are performed in parallel using multiple operators
JP2019549165A JP6906622B2 (ja) 2017-10-18 2018-09-20 演算回路および演算方法
CN201880066106.8A CN111201525A (zh) 2017-10-18 2018-09-20 运算电路以及运算方法

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JPPCT/JP2017/037712 2017-10-18
JP2017037712 2017-10-18

Publications (1)

Publication Number Publication Date
WO2019077933A1 true WO2019077933A1 (ja) 2019-04-25

Family

ID=66173320

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2018/034834 WO2019077933A1 (ja) 2017-10-18 2018-09-20 演算回路および演算方法

Country Status (5)

Country Link
US (1) US11281376B2 (ja)
JP (1) JP6906622B2 (ja)
CN (1) CN111201525A (ja)
DE (1) DE112018004972T5 (ja)
WO (1) WO2019077933A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750232A (zh) * 2019-10-17 2020-02-04 电子科技大学 一种基于sram的并行乘加装置

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117574036B (zh) * 2024-01-16 2024-04-12 北京壁仞科技开发有限公司 运算装置、操作方法和机器可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009080693A (ja) * 2007-09-26 2009-04-16 Canon Inc 演算処理装置および方法
JP2013206095A (ja) * 2012-03-28 2013-10-07 Fujitsu Ltd データ処理装置及びデータ処理装置の制御方法
JP2017027314A (ja) * 2015-07-21 2017-02-02 キヤノン株式会社 並列演算装置、画像処理装置及び並列演算方法
JP2017126203A (ja) * 2016-01-14 2017-07-20 株式会社デンソー 演算処理装置
JP2018026027A (ja) * 2016-08-12 2018-02-15 富士通株式会社 演算処理装置及び演算処理装置の制御方法

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63311569A (ja) 1987-06-15 1988-12-20 Hitachi Ltd コプロセツサ演算装置
JPH0748207B2 (ja) * 1989-04-14 1995-05-24 シャープ株式会社 行列演算装置
JPH05266060A (ja) * 1992-03-19 1993-10-15 Fujitsu Ltd マトリクス演算回路
JP2003067360A (ja) 2001-08-24 2003-03-07 Seiko Epson Corp 積和演算方法および積和演算装置
JP2005149517A (ja) 2004-12-06 2005-06-09 Fujitsu Ltd 積和演算器
JP5255885B2 (ja) 2008-04-02 2013-08-07 株式会社日立製作所 ベクトルプロセッサ制御装置
JP5376920B2 (ja) * 2008-12-04 2013-12-25 キヤノン株式会社 コンボリューション演算回路、階層的コンボリューション演算回路及び物体認識装置
JP2016095764A (ja) * 2014-11-17 2016-05-26 三菱電機株式会社 並列処理装置および並列処理方法
GB201611083D0 (en) * 2016-06-24 2016-08-10 Dialog Semiconductor Bv Digital sample rate conversion
CN112214727A (zh) * 2017-07-07 2021-01-12 华为技术有限公司 运算加速器

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009080693A (ja) * 2007-09-26 2009-04-16 Canon Inc 演算処理装置および方法
JP2013206095A (ja) * 2012-03-28 2013-10-07 Fujitsu Ltd データ処理装置及びデータ処理装置の制御方法
JP2017027314A (ja) * 2015-07-21 2017-02-02 キヤノン株式会社 並列演算装置、画像処理装置及び並列演算方法
JP2017126203A (ja) * 2016-01-14 2017-07-20 株式会社デンソー 演算処理装置
JP2018026027A (ja) * 2016-08-12 2018-02-15 富士通株式会社 演算処理装置及び演算処理装置の制御方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750232A (zh) * 2019-10-17 2020-02-04 电子科技大学 一种基于sram的并行乘加装置

Also Published As

Publication number Publication date
JPWO2019077933A1 (ja) 2020-10-22
DE112018004972T5 (de) 2020-06-18
JP6906622B2 (ja) 2021-07-21
CN111201525A (zh) 2020-05-26
US20200278798A1 (en) 2020-09-03
US11281376B2 (en) 2022-03-22

Similar Documents

Publication Publication Date Title
JP7329533B2 (ja) 演算を加速するための方法および加速器装置
US11775313B2 (en) Hardware accelerator for convolutional neural networks and method of operation thereof
CN110135581B (zh) 用于执行人工神经网络反向运算的装置和方法
EP3451162B1 (en) Device and method for use in executing matrix multiplication operations
US10768894B2 (en) Processor, information processing apparatus and operation method for processor
CN108304922B (zh) 用于神经网络计算的计算设备和计算方法
CN111666255B (zh) 脉动阵列和处理系统
US20190187983A1 (en) Neural processing accelerator
KR20200143686A (ko) 연산을 가속하기 위한 가속기 및 시스템
US20190243790A1 (en) Direct memory access engine and method thereof
JPH0425586B2 (ja)
CN111338695B (zh) 基于流水线技术的数据处理方法及相关产品
EP4024290A1 (en) Implementing fully-connected neural-network layers in hardware
CN110377874B (zh) 卷积运算方法及系统
WO2019082859A1 (ja) 推論装置、畳み込み演算実行方法及びプログラム
WO2019077933A1 (ja) 演算回路および演算方法
KR20220154764A (ko) 추론 엔진 회로 아키텍처
CN110414672B (zh) 卷积运算方法、装置及系统
CN111091181B (zh) 卷积处理单元、神经网络处理器、电子设备及卷积运算方法
CN109726798B (zh) 一种数据处理方法及装置
WO2020052265A1 (en) System and method for cascaded dynamic max pooling in neural networks
CN110399976B (zh) 计算装置和计算方法
JP2022518640A (ja) データ処理方法、装置、機器、記憶媒体及びプログラム製品
US11249722B2 (en) Semiconductor device and method of controlling the semiconductor device
KR101031680B1 (ko) 고속 pe 간 데이터 재배치 기능을 갖는 프로세서 어레이 시스템

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: 18867570

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019549165

Country of ref document: JP

Kind code of ref document: A

122 Ep: pct application non-entry in european phase

Ref document number: 18867570

Country of ref document: EP

Kind code of ref document: A1