WO2019215907A1 - 演算処理装置 - Google Patents

演算処理装置 Download PDF

Info

Publication number
WO2019215907A1
WO2019215907A1 PCT/JP2018/018306 JP2018018306W WO2019215907A1 WO 2019215907 A1 WO2019215907 A1 WO 2019215907A1 JP 2018018306 W JP2018018306 W JP 2018018306W WO 2019215907 A1 WO2019215907 A1 WO 2019215907A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
unit
storage memory
coefficient
zero
Prior art date
Application number
PCT/JP2018/018306
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 PCT/JP2018/018306 priority Critical patent/WO2019215907A1/ja
Priority to JP2020518334A priority patent/JP7261226B2/ja
Priority to CN201980027100.4A priority patent/CN112005251A/zh
Priority to PCT/JP2019/018565 priority patent/WO2019216376A1/ja
Publication of WO2019215907A1 publication Critical patent/WO2019215907A1/ja
Priority to US17/081,006 priority patent/US20210042616A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • 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/15Correlation function computation including computation of convolution operations
    • 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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C11/00Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor
    • G11C11/21Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using electric elements
    • G11C11/34Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using electric elements using semiconductor devices
    • G11C11/40Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using electric elements using semiconductor devices using transistors
    • G11C11/41Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using electric elements using semiconductor devices using transistors forming static cells with positive feedback, i.e. cells not needing refreshing or charge regeneration, e.g. bistable multivibrator or Schmitt trigger
    • G11C11/413Auxiliary circuits, e.g. for addressing, decoding, driving, writing, sensing, timing or power reduction

Definitions

  • the present invention relates to an arithmetic processing device, and more particularly to a circuit configuration of an arithmetic processing device that performs deep learning using a convolutional neural network.
  • CNN convolutional Neural Network
  • FIG. 19 is a diagram showing the flow of deep learning processing using CNN.
  • the object included in the image is recognized by sequentially processing the input image data (pixel data) in a plurality of processing layers of CNN. Final calculation result data is obtained.
  • Image recognition by deep learning using CNN can realize a high recognition rate.
  • a convolution operation process that extracts a certain area from image data and multiplies a plurality of filters having different coefficients (coefficients) to create a feature map (FeatureMap, FM).
  • the combination (one processing layer) of reduction processing (pooling processing) for extracting a partial region from the feature amount map is performed a plurality of times (in a plurality of processing layers). These processes are the processes of the convolution layer (convolution layer).
  • a FullConnect process is performed a plurality of times (in a plurality of processing layers) in which cumulative addition is performed by multiplying each data of the one-dimensional data string by a different coefficient. These processes are processes for the entire coupling layer (FullConnect layer).
  • the probability that the object included in the image has been detected is output as the subject estimation result that is the final calculation result.
  • the probability that a dog is detected is 0.01 (1%)
  • the probability that a cat is detected is 0.04 (4%)
  • the probability that a boat is detected Is 0.94 (94%)
  • the probability that a bird is detected is 0.02 (2%).
  • the processing layer of the CNN multiplies the conversion layer (convolution layer) for performing the conversion process including the convolution calculation process, the nonlinear process, the reduction process (pooling process), etc., and all the inputs (pixel data) by the coefficients. It is broadly classified into a FullConnect layer (full coupling layer) for performing a FullConnect process for cumulative addition. However, there are also convolutional neural networks that do not have a FullConnect layer.
  • FIG. 20 is a diagram showing the flow of the Convolution process.
  • oFM output feature map
  • the above-described Convolution process is repeated by performing filter processing with different coefficients using the output feature map (oFM) as the input feature map (iFM). In this way, a plurality of Convolution processes are performed to obtain an output feature map (oFM).
  • FIG. 21 is a diagram showing the flow of the FullConnect process. The same number of coefficients are prepared and multiplied for a plurality of input data, the multiplied products are cumulatively added, and one output data is generated through a non-linear operation. By repeating this process a plurality of times with different coefficients, a plurality of output data can be generated.
  • image recognition by deep learning using CNN since the data unit to be handled is different for each processing layer of CNN, it is difficult to optimize the processing unit and the memory. For this reason, image recognition by deep learning using CNN is performed using software processing using a high-performance PC (hardware) or GPU (Graphics Processing Unit), or a configurable device such as FPGA (Field Programmable Gate Array) ( In general, it is implemented by a circuit.
  • PC hardware
  • GPU Graphics Processing Unit
  • FPGA Field Programmable Gate Array
  • Patent Document 1 and Patent Document 2 configure a convolution operation processing unit that performs Convolution processing by arranging product-sum operation groups in a two-dimensional array for high speed, and use this convolution operation processing unit also in FullConnect processing. By sharing (sharing), the structure which reduces the circuit for FullConnect processing is disclosed.
  • Patent Document 1 and Patent Document 2 control a part of a circuit (convolution operation processing unit) on the assumption that the content of the Convolution process (filter operation process) and the FullConnect process (matrix operation process) are different. By switching automatically, the Convolution process and the FullConnect process are shared. That is, by changing part of the circuit in a control manner, the calculation process is changed to realize the Convolution process and the Full Connect process. However, only a part of the circuit is shared between the Convolution process and the FullConnect process.
  • Patent Document 1 a high-speed operation is performed by a multi-parallel operation configured by a systolic array, but the filter size is determined by the size of the systolic array. The same applies to Patent Document 2.
  • Patent Document 1 when a FullConnect process is executed, an invalid pixel process must be performed in the case of a feature amount map having a fraction with respect to the filter kernel size.
  • an object of the present invention is to provide an arithmetic processing device capable of sharing the entire circuit between the Convolution process and the FullConnect process in image recognition by deep learning using CNN.
  • a first aspect of the present invention is an arithmetic processing device for deep learning that performs a conversion process and a full connect process, a data storage memory that stores input feature quantity map data, and a data storage memory that controls the data storage memory
  • a data storage memory management unit having a control circuit, a coefficient storage memory for storing coefficients, a coefficient storage memory management unit having a coefficient storage memory control circuit for controlling the coefficient storage memory, and an external memory for storage, the input features
  • An arithmetic unit that acquires feature amount map data, acquires the coefficient from the coefficient storage memory, and performs filter processing, cumulative addition processing, nonlinear arithmetic processing, and pooling processing; the data storage memory management unit; and the coefficient storage memory
  • the data storage memory may include a buffer for storing a data set necessary for calculating one data after pooling processing, and the buffer may store data read from the data storage memory.
  • the calculation control unit further controls the processing of the calculation unit, and the calculation control unit converts the input one-dimensional data string (number of elements n) into a data string N of a predetermined size (Fx ⁇ Fy) during FullConnect processing.
  • the arithmetic unit is controlled so as to perform processing for conversion into a surface area (where n ⁇ Fx ⁇ Fy ⁇ N, at least one of Fx and Fy is 2 or more), and the filter size is set to the predetermined size (Fx ⁇ Fy)
  • the calculation unit may be controlled so that the output feature map data size is 1 ⁇ 1 and the number of elements is m as an output one-dimensional data string (number of elements m).
  • the FM size and the filter size may be different, and the relationship between the sizes is determined by the network to be adopted (it is of course possible to change).
  • the above is a specific setting method at the time of FullConnect processing.
  • P ⁇ Q P ⁇ 2 or Q ⁇ 2 may be satisfied.
  • the calculation execution determination unit notifies the filter processing unit of calculation through when at least one of the input feature quantity map data and the coefficient is zero, and the calculation execution determination unit notifies of calculation through
  • the filter processing unit may stop the arithmetic processing.
  • the coefficient storage memory management unit includes a data zero detection unit that detects whether or not the input feature amount map data read from the data storage memory is zero, and from the corresponding data storage memory among the coefficient storage memories
  • the read input feature value map data is accessed only to a coefficient storage memory that is not zero to retrieve the coefficient
  • the calculation execution determination unit detects a portion where the coefficient is zero, and the result and the data zero detection unit
  • the filter processing unit may be notified of calculation through.
  • the N-parallel data storage memory management unit detects whether or not all N parallel coefficients among the N ⁇ M coefficients stored in the coefficient storage memory are zero, and outputs a coefficient zero detection signal A coefficient zero detection unit that performs the calculation, and an SRAM read control unit that extracts the input feature amount map data only from the data storage memory corresponding to the coefficient for which the coefficient zero detection signal is not zero among the data storage memory, and
  • the execution determination unit may detect a portion where the input feature amount map data is zero, and if the logical sum of the result and the result of the coefficient zero detection unit is zero, may notify the filter processing unit of calculation through. .
  • the data storage memory management unit is N parallel.
  • the arithmetic processing device in the image recognition by deep learning using CNN, not only a part of the circuit is shared in the Convolution process and the FullConnect process, but the entire circuit is shared. Can do.
  • the processing of the FullConnect layer is a special Convolution process in which the size of the input feature map (iFM) is equal to the filter size, the size of the output feature map (oFM) is 1 ⁇ 1, and no pooling process is performed. I believe that. Based on this idea, the Convolution process and the FullConnect process are performed by the same circuit. That is, as in the prior art, not only a part of the circuit is shared in the Convolution process and the FullConnect process, but the entire circuit is shared.
  • the input (data sequence of the input feature map) of the FullConnect layer is iFM [j] (number of elements n, 0 ⁇ j ⁇ n), and the output (data sequence of the output feature map) is oFM [i] (number of elements m, When 0 ⁇ i ⁇ m) and a coefficient group for calculating oFM [i] is k [i] [j], the following expression is satisfied.
  • a process (n ⁇ Fx ⁇ Fy ⁇ N) is performed to convert the input one-dimensional data sequence (the number of elements n) into the data sequence N plane of a predetermined size (Fx ⁇ Fy).
  • Fx is the size of the data string in the x direction (horizontal direction)
  • Fy is the size of the data string in the y direction (vertical direction)
  • at least one of Fx and Fy is two or more.
  • a one-dimensional data string in the FullConnect layer can be considered as a one-dimensional or higher data string.
  • FIG. 1 is a diagram for illustrating interpretation of data in a FullConnect layer according to an embodiment of the present invention.
  • the size of the input feature map (iFM) is equal to the filter size and the size of the output feature map (oFM) data is 1 ⁇ 1, so the pooling process is performed. The difference is not done.
  • the filter size needs to be variable.
  • FIG. 2 is a block diagram showing a configuration of an arithmetic processing device that performs deep learning using CNN according to an embodiment of the present invention for realizing interpretation of data in the above-described FullConnect layer.
  • the arithmetic processing device 1 includes a controller 2, a data input unit 3, a coefficient input unit 4, an IBUF (data storage memory) management unit 5, a WBUF (coefficient storage memory) management unit 6, a calculation unit 7, and data An output unit 8 is provided.
  • the data input unit 3, the coefficient input unit 4, and the data output unit 8 are connected to a DRAM (external storage memory) 9 via a bus 10.
  • the IBUF management unit 5 includes an input feature map (iFM) data storage memory (data storage memory, IBUF) and a data storage memory management / control circuit (data storage memory control circuit).
  • the IBUF management unit 5 counts the number of valid data in the input data, converts it into coordinates, stores the data (iFM data) converted into an IBUF address in the data storage memory, and uses the iFM data by a predetermined method. From the data storage memory.
  • the WBUF management unit 6 includes a coefficient storage memory (coefficient storage memory, WBUF) and a coefficient storage memory management / control circuit (coefficient storage memory control circuit).
  • the WBUF management unit 6 refers to the status of the IBUF management unit 5 and extracts the coefficient corresponding to the data extracted from the IBUF management unit 5 from the coefficient storage memory.
  • the DRAM 9 stores iFM data, oFM data, and coefficients.
  • the data input unit 3 acquires an input feature amount map (iFM) from the DRAM 9 by a predetermined method and passes it to the IBUF (data storage memory) management unit 5.
  • the data output unit 8 writes output feature amount map (oFM) data to the DRAM 9 by a predetermined method.
  • the data output unit 8 concatenates M parallel data output from the arithmetic unit 7 and outputs the concatenated data to the DRAM 9.
  • the coefficient input unit 4 acquires a coefficient from the DRAM 9 by a predetermined method and passes it to the WBUF (coefficient storage memory) management unit 6.
  • the calculation unit 7 acquires data from the IBUF (data storage memory) management unit 5 and a coefficient from the WBUF (coefficient storage memory) management unit 6 and performs data processing such as filter processing, cumulative addition, nonlinear calculation, and pooling processing. .
  • the controller 2 controls the entire circuit.
  • the arithmetic unit 7 has only data and coefficients necessary for processing for one layer and performs processing for one layer, and the data and coefficients are stored in the DRAM 9. Placed one by one. Then, processing for the required number of layers is repeatedly executed.
  • the arithmetic processing unit 1 outputs a subject estimation result as final output data, and obtains a subject estimation result by processing the final output data using a processor (or a circuit).
  • FIG. 3 is a diagram illustrating a configuration of a calculation unit of the calculation processing device according to the embodiment of the present invention.
  • the number of input channels of the arithmetic unit 7 is N (N ⁇ 1), that is, the input data is N-dimensional, and the N-dimensional input data is processed in parallel (input N parallel).
  • the number of output channels of the arithmetic unit 7 is M (M ⁇ 1), that is, the output data is M-dimensional, and M-dimensional input data is output in parallel (output M parallel). As shown in FIG.
  • iFM data (d_0 to d_N-1) and coefficients (k_0 to k_N-1) are input for each channel (ich_0 to ich_N-1), and one piece of data Is output.
  • This process is performed in parallel for the M layers, and M pieces of data och_0 to och_M-1 are output.
  • pooling one piece of data is output only after “filter size ⁇ 4” set of data is included.
  • pooling is not performed, one piece of data is output with the data corresponding to the “filter size” set.
  • the calculation unit 7 has a configuration in which the number of input channels is N and the number of output channels is M, and the parallelism is N ⁇ M. Since the number of input channels N and the number of output channels M can be set (changed) according to the size of CNN, they are set appropriately in consideration of processing performance and circuit scale.
  • the calculation unit 7 includes a calculation control unit 71 that controls each unit in the calculation unit.
  • the calculation unit 7 includes N filter processing units 72, a second adder 75, a non-linear conversion unit 76, and a pooling processing unit 77 for each layer. There are M such layers. That is, there are N ⁇ M filter processing units 72.
  • the calculation control unit 71 issues a request to the preceding stage of the calculation unit 7, whereby predetermined data is input to the filter processing unit 72.
  • the filter processing unit 72 includes a multiplier 73 and a first adder 74, and performs a filtering process on input data.
  • the multiplier 73 multiplies FM data (feature amount map data) d_0 to d_N ⁇ 1 input from the outside and coefficients k_0 to k_N ⁇ 1 input in synchronization with the FM data.
  • the first adder 74 cumulatively adds the multiplication results for the filter size, and the filter processing in the filter processing unit 72 is completed. That is, the filter size is changed according to the number of cumulative additions.
  • the N filter processing units 72 perform the above-described processing simultaneously (in parallel) on different FM data.
  • the second adder 75 cumulatively adds the results of the filter processing in the N filter processing units 72 executed in N parallel.
  • the non-linear conversion unit 76 performs non-linear calculation processing using an Activate function or the like on the cumulative addition result in the second adder 75.
  • a specific implementation is not particularly defined, but for example, nonlinear calculation processing is performed by broken line approximation.
  • the pooling processing unit 77 performs a pooling process such as selecting and outputting a maximum value (Max Pooling) from a plurality of data input from the nonlinear conversion unit 76, and calculating an average value (Average Pooling). Note that the nonlinear conversion unit 76 and the pooling processing unit 77 may not operate depending on the network, and therefore can be passed through by the arithmetic control unit 71. Since the pooling process is not performed during the FullConnect process, the pooling processing unit 77 is passed through.
  • a pooling process such as selecting and outputting a maximum value (Max Pooling) from a plurality of data input from the nonlinear conversion unit 76, and calculating an average value (Average Pooling). Note that the nonlinear conversion unit 76 and the pooling processing unit 77 may not operate depending on the network, and therefore can be passed through by the arithmetic control unit 71. Since the pooling process is not performed during the FullConnect process, the pooling processing unit 77 is passed through.
  • the calculation control unit 71 controls the above-described processing performed in each unit in the calculation unit 7.
  • the size of the input channel number N and the output channel number M can be set (changed) in accordance with the size of the CNN in the arithmetic unit 7, so that the processing performance and the circuit scale are taken into consideration. Set appropriately.
  • the FM size and the filter size may be different and can be changed.
  • the output is two-dimensional data.
  • FIG. 4A is a diagram showing a data arrangement of iFM (input feature amount map), and FIG. 4B is a diagram showing coefficients corresponding to this data.
  • a to p indicate data values (corresponding to d_0 to d_N ⁇ 1 in FIG. 3).
  • w1 to w9 indicate coefficient values (corresponding to k_0 to k_N-1 in FIG. 3). That is, d * indicates a data line, and k * indicates a coefficient line.
  • FIG. 5 is a diagram showing a timing chart at the time of Convolution processing. It is assumed that time flows from the left to the right in the figure.
  • the multiplier 73 multiplies the coefficients w1 to w9.
  • the first adder 74 cumulatively adds the multiplication results of the multiplier 73 by the filter size (9 ⁇ 3 ⁇ 3) ( ⁇ in FIG. 5).
  • the result of cumulative addition ( ⁇ ) by the first adder 74 becomes the filter processing result in the filter processing unit 72.
  • the second adder 75 takes the sum of the results ( ⁇ ) of the first adders 74 arranged in N parallel (A in FIG. 5). A corresponds to one pixel of the output.
  • the process of calculating the sum is performed at the timing when the filter process result is output from the first adder 74.
  • the nonlinear converter 76 performs a nonlinear converter on the sum (A) calculated by the second adder 75 (f (A) in FIG. 5).
  • the process proceeds to data processing for the filter size of the next filter (9 ⁇ 3 ⁇ 3).
  • the input order of data is “e, f, g, i, j, k, m, next to“ a, b, c, e, f, g, i, j, k ”.
  • n, o followed by“ b, c, d, f, g, h, j, k, l ”.
  • the center of gravity position of the filter moves in the order of “f ⁇ j ⁇ g ⁇ k” in the data shown in FIG.
  • the nonlinear conversion unit 76 and the subsequent steps are entered in this order, and the pooling processing unit 77 performs pooling processing on a plurality of data.
  • the arithmetic unit 7 performs processing to convert the input one-dimensional data sequence (number of elements n) into a two-dimensional data sequence N plane (N parallel) of Fx ⁇ Fy (n ⁇ Fx ⁇ Fy). ⁇ N). That is, the arithmetic unit 7 sets the filter size to a predetermined size (Fx ⁇ Fy), and outputs an oFM size of 1 ⁇ n and an oFM number of m as an output two-dimensional data string (number of elements i ⁇ j). Set to be.
  • the filter size need not be the same as that at the time of Convolution processing.
  • N is the input parallelism of the circuit, and is fixed by mounting. Therefore, in order to handle a large n, normally Fx and Fy are set as large as possible (within a corresponding range).
  • a coefficient group k [i] [j] for calculating an output (data string of output feature map) oFM [i] (number of elements, 0 ⁇ i ⁇ m) of the FullConnect layer is represented by k [i].
  • FIG. 6A is a diagram showing the data arrangement of the iFM (input feature amount map) in the first set
  • FIG. 6B is a diagram showing coefficients corresponding to this data.
  • a1 to i1 indicate data values
  • w11 to w19 in FIG. 6C indicate coefficient values.
  • FIG. 6C is a diagram showing the data arrangement of iFM (input feature amount map) in the second set
  • FIG. 6D is a diagram showing coefficients corresponding to this data.
  • a2 to i2 indicate data values
  • w21 to w29 in FIG. 6D indicate coefficient values.
  • FIG. 7 is a diagram showing a timing chart at the time of FullConnect processing. If the difference between the input data in FIG. 4 and FIG. 6 is taken into consideration, the timing chart at the time of FullConnect processing shown in FIG. 7 is exactly the same processing as the timing chart at the time of Convolution processing shown in FIG. Therefore, the description of FIG. 7 is omitted. However, in the processing after this timing chart, the non-linear conversion output at the time of the conversion processing shown in FIG. 5 is the data of one pixel forming the oFM (more precisely, the pooling processing for generating the data of one pixel forming the oFM) On the other hand, the non-linear conversion output at the time of FullConnect processing shown in FIG. 7 is oFM data for one surface as it is.
  • the invention can cope with an arbitrary filter size only by changing the setting parameter, achieves high speed by paralleling in an array shape in the filter type direction, not the filter size direction, and the filter size.
  • the structure which can set (change) is realized.
  • both the Convolution process and the FullConnect process can be handled by a completely identical circuit, and no dedicated control is required, and there is an effect of reducing the scale (power reduction).
  • the filter size is variable, the convenience is high.
  • the circuit resource for the Convolution process can be fully utilized in the FullConnect process, the FullConnect process can also be executed at high speed.
  • the same data is read from the data storage memory (IBUF) a plurality of times.
  • the data shown in FIG. 4A nine data centered on “f” are read out to calculate one output data, and nine data centered on “j” are read out.
  • One output data is calculated, nine pieces of data centered on “g” are read out, one piece of output data is calculated, nine pieces of data centered on “k” are read out, and one piece of output data is read out. calculate.
  • an FF array (buffer) that retrieves and stores data from the data storage memory in units of 4 ⁇ 4 shown in FIG. It may be provided inside the memory.
  • FIG. 8 is a diagram illustrating an example of an IBUF control code at the time of conversion when the FF array is mounted.
  • An equivalent function may be implemented by a circuit.
  • the filter operation is realized by multiplying data and a coefficient in units of pixels, and cumulatively adding the multiplication results by a cumulative adder. At this time, if at least one of the coefficient and the data is zero, the multiplication result is zero, and the result of the cumulative addition is not updated, so that the calculation is wasted. In particular, in Deep Learning, many of the coefficients may become zero, and this problem is remarkable.
  • FIG. 9 is a diagram illustrating the connection of the IBUF management unit 5, the WBUF management unit 6, and the calculation unit 7 according to the calculation processing device of the present modification.
  • the SRAM read control unit 51 of the IBUF (data storage memory) management unit 5 reads N FM data from the N IBUFs (0 to N-1), and performs the calculation. Send to part 7.
  • the WBUF reading unit 61 of the WBUF (coefficient storage memory) management unit 6 reads out N ⁇ M coefficients from the M WBUFs (0 to M ⁇ 1) and transmits them to the calculation unit 7.
  • a status signal is transmitted from the SRAM read control unit 51 of the IBUF management unit 5 to the WBUF read unit 61 of the WBUF management unit 6.
  • the status signal is a signal for transmitting information of FM data taken out by the IBUF management unit 5 to the WBUF management unit 6.
  • FIG. 10 is a diagram showing an internal configuration of the calculation unit 7 in FIG.
  • a calculation execution determination unit 78 is provided before the filter processing unit 72.
  • the calculation execution determination unit 78 is a calculation through signal (vz_0,%) Indicating whether one of the data (data_0, data_1,%) Input from the IBUF and the coefficients (coef_0, coef_1,%) Input from the WBUF is zero. vz_1, ...) is notified to the filter processing unit 72.
  • the calculation through signals (vz_0, vz_1,%) May be enable signals, or may be used for gating (stopping) the clock input to the filter processing unit 72.
  • FIG. 11 is a diagram illustrating an example of calculation through by clock gating. “CG” in the figure indicates a clock gating cell.
  • the zero detection unit of the calculation execution determination unit 78 detects zero of the data (data) or the coefficient (coef)
  • the value of the calculation through signal (vz_0, vz_1,...) Is set to zero and notified to the clock gating cell.
  • the clock gating cell transmits a signal for stopping the clock, and the calculation in the filter processing unit 72 stops.
  • W coefficient value
  • D data value
  • IBUF data storage memory
  • the calculation execution determination unit 78 notifies the filter processing unit 72 of calculation through when at least one of the input feature value map data and the coefficient is zero.
  • the filter processing unit 72 passes through the calculation.
  • FIG. 13 is a diagram illustrating the connection of the IBUF management unit 5, the WBUF management unit 6, and the calculation unit 7 according to the calculation processing device of the present modification.
  • the SRAM read control unit 51 of the IBUF (data storage memory) management unit 5 reads N FM data from the N IBUFs (0 to N-1), and displays the delay.
  • the calculation unit 7 via the circuit 52 it transmits to the data zero detection unit 62 of the WBUF (coefficient storage memory) management unit 6.
  • the WBUF reading unit 61 of the WBUF (coefficient storage memory) management unit 6 accesses only the WBUF whose corresponding data is not zero among the M WBUFs (0 to M ⁇ 1). The coefficient is read and transmitted to the calculation unit 7. Coefficients that are not accessing the WBUF (not read from the WBUF) are set to zero and transmitted to the calculation unit 7.
  • FIG. 14 is a diagram illustrating an internal configuration of the calculation unit 7 in the present modification.
  • the calculation execution determination unit 78 of the calculation unit 7 detects a portion where the coefficients (coef_0, coef_1,%) Transmitted from the WBUF reading unit 61 are zero, and the detection signal (from the data zero detection unit 62)
  • the logical sum of iz_0, iz_1,...) is an operation through signal (vz0, vz1,).
  • FIG. 15 is a diagram showing a timing chart at the time of calculation in this modification.
  • the data value (D) in the IBUF data storage memory
  • the value of the detection signal (iz_0, iz_1,...) Becomes zero, and the coefficient is not read from the corresponding WBUF (“ ⁇ ” in the figure).
  • a calculation through signal (vz0, vz0) based on the zero detection result in the data value (D) in the IBUF (data storage memory) and the zero detection result in the coefficient value (W) in the WBUF (coefficient storage memory).
  • vz1,...) the calculation in the multiplier 73 of the filter processing unit 72 is passed through (“ ⁇ ” in the figure).
  • the final result obtained is the same as that of the first modification.
  • the WBUF management unit 6 includes the data zero detection unit 62 that detects whether or not the FM data read from the IBUF (data storage memory) is zero. Then, the WBUF reading unit 61 of the WBUF (coefficient storage memory) management unit 6 accesses only the WBUF whose coefficient data read from the corresponding IBUF (data storage memory) is not zero in the WBUF (coefficient storage memory). Extract coefficients. Further, the calculation execution determination unit 78 of the calculation unit 7 detects a portion where the coefficient is zero, and outputs a logical sum of the result and the result of the data zero detection unit.
  • the second modification in addition to the first modified example, when the data is zero, access to the coefficient storage memory itself can be stopped to further reduce power consumption. For data with many zeros, the second modification is advantageous.
  • the coefficient when there are many zeros in the coefficient, the coefficient is read first, and only the IBUF corresponding to the part where the value of the coefficient is not zero is accessed. That is, the data read access itself corresponding to the portion where the coefficient value is zero is stopped.
  • FIG. 16 is a diagram showing a connection of the IBUF management unit 5, the WBUF management unit 6, and the calculation unit 7 according to the calculation processing device of this modification.
  • the WBUF reading unit 61 of the WBUF (coefficient storage memory) management unit 6 accesses M WBUFs (0 to M-1) to obtain N ⁇ M coefficients.
  • the data is read and transmitted to the calculation unit 7 via the delay circuit 63 and simultaneously transmitted to the coefficient zero detection unit 53 of the IBUF (data storage memory) management unit 5.
  • the WBUF reading unit 61 transmits a status signal to the SRAM reading control unit 51 of the IBUF (data storage memory) management unit 5.
  • the status signal is a signal that informs the IBUF management unit 5 of the coefficient information that the WBUF management unit 6 takes out.
  • the coefficient zero detection unit 53 transmits the coefficient zero detection signal cz * to the SRAM read control unit 51 and the calculation unit 7 of the IBUF management unit 5.
  • the SRAM read control unit 51 reads out N pieces of FM data from N pieces of IBUF (0 to N ⁇ 1) and transmits them to the calculation unit 7.
  • FIG. 17 is a diagram illustrating an internal configuration of the calculation unit 7 in the present modification.
  • the calculation execution determination unit 78 of the calculation unit 7 detects a portion where the FM data (data_0, data_1,%) Transmitted from the IBUF management unit 5 is zero, and the coefficient zero transmitted from the result and the coefficient zero detection unit 53.
  • a logical sum with the detection signals (cz_0, cz_1,...) Is used as an operation through signal (vz0, vz1,).
  • FM data may be input even if the coefficient is zero.
  • the calculation execution determination unit 78 can confirm that the coefficient zero detection signals (cz_0, cz_1,...) Are zero.
  • the filter processing unit 72 does not operate after all.
  • FIG. 18 is a diagram showing a timing chart at the time of calculation in this modification.
  • the values (W) of all the M parallel coefficients in WBUF (coefficient storage memory) are zero, the value of the coefficient zero detection signal (cz_0, cz_1,...) Becomes zero, and FM data is read from the corresponding IBUF. (" ⁇ " in the figure).
  • a calculation through signal (vz0, vz0) based on the zero detection result in the data value (D) in the IBUF (data storage memory) and the zero detection result in the coefficient value (W) in the WBUF (coefficient storage memory).
  • vz1,...) is zero, the calculation in the multiplier 73 of the filter processing unit 72 is passed through (“ ⁇ ” in the figure).
  • the final result obtained is the same as that of the first modification.
  • the coefficient zero detection unit 53 of the M BUFFER IBUF management unit 5 performs all the M parallel coefficients among the N ⁇ M coefficients stored in the WBUF (coefficient storage memory). It is detected whether (M coefficients) is zero or not, and a coefficient zero detection signal (cz *) is output. Then, the SRAM read control unit 51 of the IBUF management unit 5 extracts FM data only from the IBUF corresponding to the coefficient whose coefficient zero detection signal (cz *) is not zero in the IBUF (data storage memory). The operation execution determination unit 78 detects a zero portion of the FM data and outputs a logical sum of the result and the result of the coefficient zero detection unit 53.
  • the third modified example in addition to the first modified example, when all the M parallel coefficients are zero, access to the SRAM itself is stopped. Thereby, power consumption can be further reduced.
  • the third modification is advantageous when there are many zero coefficients.
  • Each component is for explaining functions and processes related to each component.
  • One configuration may simultaneously realize functions and processes related to a plurality of components.
  • Each component may be realized by a computer including one or a plurality of processors, a logic circuit, a memory, an input / output interface, a computer-readable recording medium, and the like.
  • processors including one or a plurality of processors, a logic circuit, a memory, an input / output interface, a computer-readable recording medium, and the like.
  • various functions and processes are realized by recording a program for realizing each component or the entire function on a recording medium, and reading and executing the recorded program in a computer system. May be.
  • the processor is at least one of a CPU, a DSP (Digital Signal Processor), and a GPU (Graphics Processing Unit).
  • the logic circuit is at least one of ASIC (Application Specific Integrated Circuit) and FPGA (Field-Programmable Gate Array).
  • the “computer system” referred to here may include an OS and hardware such as peripheral devices. Further, the “computer system” includes a homepage providing environment (or display environment) if a WWW system is used.
  • the “computer-readable recording medium” refers to a writable nonvolatile memory such as a flexible disk, a magneto-optical disk, a ROM, and a flash memory, a portable medium such as a CD-ROM, a hard disk built in a computer system, and the like. The storage device.
  • the “computer-readable recording medium” refers to a volatile memory (for example, DRAM (Dynamic) in a computer system serving as a server or a client when a program is transmitted via a network such as the Internet or a communication line such as a telephone line. Random Access Memory)), etc. that hold a program for a certain period of time.
  • DRAM Dynamic RAM
  • the program may be transmitted from a computer system storing the program in a storage device or the like to another computer system via a transmission medium or by a transmission wave in the transmission medium.
  • the “transmission medium” for transmitting the program refers to a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line.
  • the program may be for realizing a part of the functions described above.
  • achieves the function mentioned above in combination with the program already recorded on the computer system what is called a difference file (difference program) may be sufficient.
  • the present invention can be widely applied to arithmetic processing devices that perform deep learning using a convolutional neural network, and the Convolution process and the FullConnect process can be performed by a common circuit.

Landscapes

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

Abstract

演算処理装置の演算部は、乗算器および第1加算器を有し前記フィルタ処理を行うフィルタ処理部と、N並列で実行される前記フィルタ処理の結果を全て累積加算する前記累積加算処理を行う第2加算器と、前記累積加算処理の結果に対し前記非線形演算処理を行う非線形変換部と、前記非線形演算処理の結果に対し前記プーリング処理を行うプーリング処理部と、前記フィルタ処理部、前記第2加算器、前記非線形変換部、および前記プーリング処理部を制御する演算制御部と、を有する。

Description

演算処理装置
 本発明は、演算処理装置、より詳しくは、畳み込みニューラルネットワークを用いたディープラーニングを行う演算処理装置の回路構成に関する。
 従来、複数の処理層が階層的に接続されたニューラルネットワークを用いて演算を実行する演算処理装置がある。特に画像認識を行う演算処理装置では、畳み込みニューラルネットワーク(Convolutional Neural Network、以下CNNという)を用いたディープラーニングが広く行われている。
 図19は、CNNを用いたディープラーニングの処理の流れを示す図である。CNNを用いたディープラーニングによる画像認識では、入力される画像データ(ピクセルデータ)に対して、CNNの複数の処理層における処理が順次施されることにより、画像に含まれる対象物が認識された最終的な演算結果データが得られる。CNNを用いたディープラーニングによる画像認識は、高い認識率を実現できる。
 具体的には、まず、画像データに対して、ある領域を抽出して係数(係数)の異なる複数のフィルタを乗じて特徴量マップ(FeatureMap、FM)を作成する畳み込み演算処理(Convolution処理)と、特徴量マップから一部領域を抽出する縮小処理(プーリング処理)の組合せ(1つの処理層)を複数回(複数の処理層において)行う。これらの処理が、畳み込み層(Convolution層)の処理である。
 Convolution処理が進み、FMをある程度まで小さくしたところで、画像データを1次元のデータ列と読み変える。1次元のデータ列の各データに対して各々異なる係数を乗じて累積加算を行うFullConnect処理を複数回(複数の処理層において)行う。これらの処理が、全結合層(FullConnect層)の処理である。
 そして、FullConnect処理の後、最終的な演算結果である被写体推定結果として、画像に含まれる対象物が検出された確率(被写体検出の確率)が出力される。図19の例では、最終的な演算結果データとして、犬が検出された確率は0.01(1%)、猫が検出された確率は0.04(4%)、ボートが検出された確率は0.94(94%)、鳥が検出された確率は0.02(2%)である。
 このように、CNNの処理層は、畳み込み演算処理、非線形処理、縮小処理(プーリング処理)等を含むConvolution処理を行うConvolution層(畳み込み層)と、全ての入力(ピクセルデータ)に係数を乗じて累積加算するFullConnect処理を行うFullConnect層(全結合層)とに大きく分類される。ただし、FullConnect層がない畳み込みニューラルネットワークも存在する。
 図20は、Convolution処理の流れを示す図である。まず、入力された画像データの1画素を抽出して、係数の異なるフィルタ処理を行い、累積加算することにより、1画素に対応するデータができる。これを画像データの全画素に対して行い、全画素に対応するデータを作成する。次に、作成されたデータに対し、非線形変換および縮小処理(プーリング処理)を行い、出力特徴量マップ(oFM)が生成される。
 さらに、出力特徴量マップ(oFM)を入力特徴量マップ(iFM)として、さらに係数の異なるフィルタ処理を行うことにより、上述のConvolution処理を繰り返す。このようにして複数回のConvolution処理を行い、出力特徴量マップ(oFM)を得る。
 図21は、FullConnect処理の流れを示す図である。複数の入力データに対して同じ数の係数を用意して乗算し、乗算されたものを累積加算し、非線形演算を経て、1個の出力データができる。この処理を、係数を変えて複数回繰り返すことにより、複数の出力データができる。
 CNNを用いたディープラーニングによる画像認識の処理において、CNNの処理層ごとに扱うデータ単位が異なるため、処理単位やメモリの最適化が難しい。そのため、CNNを用いたディープラーニングによる画像認識は、高性能PC(ハードウェア)やGPU(Graphics Processing Unit)を用いたソフトウエア処理、もしくはFPGA(Field Programmable Gate Array)などのコンフィギュラブル・デバイス(回路)で実装されるのが一般的である。
 特許文献1および特許文献2は、高速化のため2次元アレイ状に積和演算群を配置することにより、Convolution処理を行う畳み込み演算処理部を構成し、この畳み込み演算処理部をFullConnect処理でも使用(共有)することにより、FullConnect処理のための回路を減らす構成を開示している。
特開2016-99707号公報 特開2017-27314号公報
 特許文献1および特許文献2は、Convolution処理(フィルタ演算処理)とFullConnect処理(行列演算処理)は処理内容が違っているという前提のもとで、回路の一部(畳み込み演算処理部)を制御的に切り替えることにより、Convolution処理とFullConnect処理で共有している。すなわち、回路の一部を制御的に切り替えることにより、演算過程を変更して、Convolution処理およびFullConnect処理を実現する。しかし、Convolution処理とFullConnect処理で共有されているのは、回路の一部のみである。
 そのため、畳み込み演算におけるフィルタカーネルサイズが回路的に固定化される。特許文献1ではシストリックアレイにより構成された多並列演算で高速に演算を行うが、フィルタサイズはシストリックアレイのサイズで定まってしまう。特許文献2についても同様である。また、特許文献1ではFullConnect処理を実行する時に、フィルタカーネルサイズに対して端数を持つ特徴量マップの場合は、無効画素処理をしなければならない。
 上述の事情を鑑み、本発明は、CNNを用いたディープラーニングによる画像認識において、Convolution処理とFullConnect処理で、回路全体を共有することができる演算処理装置を提供することを目的とする。
 本発明の第一の態様は、Convolution処理とFullConnect処理を行うディープラーニング用の演算処理装置であって、入力特徴量マップデータを格納するデータ格納メモリ、および前記データ格納メモリを制御するデータ格納メモリ制御回路を有するデータ格納メモリ管理部と、係数を格納する係数格納メモリ、および前記係数格納メモリを制御する係数格納メモリ制御回路を有する係数格納メモリ管理部と、格納用外部メモリから、前記入力特徴量マップデータを取得するデータ入力部と、格納用外部メモリから、前記係数を取得する係数入力部と、前記格納用外部メモリに、出力特徴量マップデータを書き出すデータ出力部と、入力N並列、出力M並列の構成(N、M≧1)で、前記データ格納メモリから前記入力特徴量マップデータを取得し、前記係数格納メモリから前記係数を取得して、フィルタ処理、累積加算処理、非線形演算処理およびプーリング処理を行う演算部と、前記データ格納メモリ管理部、前記係数格納メモリ管理部、前記データ入力部、前記データ出力部、および前記演算部を制御するコントローラと、を有し、前記データ格納メモリ管理部は、前記入力特徴量マップデータを前記データ格納メモリから取り出し、前記係数格納メモリ管理部は、前記データ格納メモリ管理部のステータスを参照して、前記データ格納メモリ管理部から取り出すデータに対応する係数を前記係数格納メモリから取り出し、前記データ出力部は、前記演算部から出力されるM並列のデータを連結して前記格納用外部メモリに出力し、前記演算部は、乗算器および第1加算器を有し前記フィルタ処理を行うフィルタ処理部と、N並列で実行される前記フィルタ処理の結果を全て累積加算する前記累積加算処理を行う第2加算器と、前記累積加算処理の結果に対し前記非線形演算処理を行う非線形変換部と、前記非線形演算処理の結果に対し前記プーリング処理を行うプーリング処理部と、前記フィルタ処理部、前記第2加算器、前記非線形変換部、および前記プーリング処理部を制御する演算制御部と、を有する演算処理装置である。
 前記データ格納メモリは、プーリング処理後の1データを算出するために必要なデータセットを格納するバッファを備え、前記バッファは前記データ格納メモリから読み出したデータを蓄積してもよい。
 前記演算部の処理を制御する演算制御部をさらに有し、前記演算制御部は、FullConnect処理時は、入力の1次元データ列(要素数n)を所定サイズ(Fx×Fy)のデータ列N面分に換算する処理を行うように演算部を制御し(ただし、n≦Fx×Fy×N、FxとFyの少なくとも1つが2以上)、フィルタサイズを前記所定サイズ(Fx×Fy)に設定し、出力の1次元データ列(要素数m)として、出力特徴量マップデータのサイズが1×1、要素数がmとなるように演算部を制御してもよい。
 Convolution処理時はFMサイズとフィルタサイズは異なっていて良く、サイズの関係は採用するネットワークによって決まっている(変更するのはもちろん構わない)。上記はFullConnect処理時の具体的な設定方法の事を言っており、FullConnectの場合は、iFMサイズ=フィルタサイズでoFMがサイズ1×1である事が必要で、iFMサイズ=フィルタサイズ=1×1でも勿論良いが、等号が成り立ってさえいれば良いので、P×Q(P≧2またはQ≧2)でもよい、ということである。
 演算実行判定部は、入力された前記入力特徴量マップデータおよび前記係数の少なくとも一方がゼロの場合、前記フィルタ処理部に演算スルーを通知し、前記演算実行判定部から演算スルーが通知された場合、前記フィルタ処理部は演算処理を停止してもよい。
 前記係数格納メモリ管理部は、前記データ格納メモリから読み出した前記入力特徴量マップデータがゼロか否かを検出するデータゼロ検出部を有し、前記係数格納メモリのうち、対応するデータ格納メモリから読み出した前記入力特徴量マップデータがゼロでない係数格納メモリにのみにアクセスして前記係数を取り出し、前記演算実行判定部は、係数がゼロの部分を検出し、その結果と前記データゼロ検出部の結果との論理和がゼロの場合、前記フィルタ処理部に演算スルーを通知してもよい。
 N並列である前記データ格納メモリ管理部は、前記係数格納メモリに格納されたN×M個の係数のうち、N並列全ての係数がゼロか否かを検出して、係数ゼロ検出信号を出力する係数ゼロ検出部と、前記データ格納メモリのうち、前記係数ゼロ検出信号がゼロでない係数に対応するデータ格納メモリからのみ前記入力特徴量マップデータを取り出すSRAM読み出し制御部と、を備え、前記演算実行判定部は、入力特徴量マップデータがゼロの部分を検出し、その結果と前記係数ゼロ検出部の結果との論理和がゼロの場合、前記フィルタ処理部に演算スルーを通知してもよい。
 演算部の回路構成を入力がN並列、出力がM並列とすると、データ格納メモリ管理部はN並列となる。
 本発明の各態様に係る演算処理装置によれば、CNNを用いたディープラーニングによる画像認識において、Convolution処理とFullConnect処理で回路の一部のみを共有するのではなく、回路の全体を共有することができる。
本発明の実施形態に係る演算処理装置における、FullConnect層におけるデータの解釈を示すための図である。 本発明の実施形態に係る演算処理装置における、CNNを用いたディープラーニングを行う演算処理装置の構成を示すブロック図である。 本発明の実施形態に係る演算処理装置における、演算部の構成を示す図である。 本発明の実施形態に係る演算処理装置における、iFM(入力特徴量マップ)のデータ配置およびこのデータに対応する係数を示す図である。 本発明の実施形態に係る演算処理装置における、Convolution処理時のタイミングチャートを示す図である。 本発明の実施形態に係る演算処理装置における、各セットにおけるiFM(入力特徴量マップ)のデータ配置およびこのデータに対応する係数を示す図である。 本発明の実施形態に係る演算処理装置における、FullConnect処理時のタイミングチャートを示す図である。 本発明の実施形態に係る演算処理装置における、FFアレイ搭載時における、Convolution時のIBUF制御のコードの例を示す図である。 本発明の実施形態の第1変形例に係る演算処理装置における、IBUF管理部、WBUF管理部、および演算部の接続を示す図である。 本発明の実施形態の第1変形例に係る演算処理装置における、演算部の内部構成を示す図である。 本発明の実施形態の第1変形例に係る演算処理装置における、クロックゲーティングによる演算スルーの例を示す図である。 本発明の実施形態の第1変形例に係る演算処理装置における、演算時のタイミングチャートを示す図である。 本発明の実施形態の第2変形例に係る演算処理装置における、IBUF管理部、WBUF管理部、および演算部の接続を示す図である。 本発明の実施形態の第2変形例に係る演算処理装置における、演算部の内部構成を示す図である。 本発明の実施形態の第2変形例に係る演算処理装置における、演算時のタイミングチャートを示す図である。 本発明の実施形態の第3変形例に係る演算処理装置における、IBUF管理部、WBUF管理部、および演算部の接続を示す図である。 本発明の実施形態の第3変形例に係る演算処理装置における、演算部の内部構成を示す図である。 本発明の実施形態の第3変形例に係る演算処理装置における、演算時のタイミングチャートを示す図である。 CNNを用いたディープラーニングの処理の流れを示す図である。 従来技術に係るConvolution処理の流れを示す図である。 従来技術に係るFullConnect処理の流れを示す図である。
 まず、本発明のベースとなる考え方について説明する。本発明では、FullConnect層の処理は、入力特徴量マップ(iFM)のサイズがフィルタサイズと等しく、出力特徴量マップ(oFM)のサイズが1×1で、プーリング処理を行わない、特殊なConvolution処理であると考える。この考えに基づき、Convolution処理とFullConnect処理を全く同じ回路で行う。すなわち、従来技術のように、Convolution処理とFullConnect処理で回路の一部のみを共有するのではなく、回路の全体を共有する。
 FullConnect層の入力(入力特徴量マップのデータ列)をiFM[j](要素数n、0≦j<n)、出力(出力特徴量マップのデータ列)をoFM[i](要素数m、0≦i<m)、oFM[i]を計算するための係数群をk[i][j]とすると、以下の式が満たされる。
Figure JPOXMLDOC01-appb-M000001
 ここで、入力の1次元データ列(要素数n)を所定サイズ(Fx×Fy)のデータ列N面分に換算し直す処理(n≦Fx×Fy×N)を行う。Fxはデータ列のx方向(横方向)のサイズであり、Fyはデータ列のy方向(縦方向)のサイズであり、FxとFyの少なくとも1つが2以上である。
 これにより、FullConnect層における1次元のデータ列を1次元以上のデータ列と考えることができる。例えば、FullConnect層の入力iFM[j]を、iFM[z][x][y](0≦x<Fx、0≦y<Fy、0≦j<n、j=Fy×(z×Fx+x)+y)という3次元のデータ列と解釈する。また、係数群k[i][j]を、k[i][z][x][y](0≦i<m、0≦x<Fx、0≦y<Fy、0≦j<n、j=Fy×(z×Fx+x)+y)という4次元のデータ列と解釈する。
 図1は、本発明の実施形態に係る、FullConnect層におけるデータの解釈を示すための図である。図20に示すConvolution層における処理と比較すると、入力特徴量マップ(iFM)のサイズがフィルタサイズと等しい点と、出力特徴量マップ(oFM)データのサイズが1×1であるため、プーリング処理を行わない点が異なっている。このようなFullConnect層におけるデータの解釈を実現するためには、Convolution処理時とFullConnect処理時でフィルタサイズを変更できる、すなわちフィルタサイズが可変である必要がある。
 図2は、上述のFullConnect層におけるデータの解釈を実現するための、本発明の実施形態に係る、CNNを用いたディープラーニングを行う演算処理装置の構成を示すブロック図である。
 演算処理装置1は、コントローラ2と、データ入力部3と、係数入力部4と、IBUF(データ格納メモリ)管理部5と、WBUF(係数格納メモリ)管理部6と、演算部7と、データ出力部8を備える。データ入力部3と、係数入力部4と、データ出力部8は、バス10を介して、DRAM(格納用外部メモリ)9と接続されている。
 IBUF管理部5は、入力特徴量マップ(iFM)データ格納用のメモリ(データ格納メモリ、IBUF)と、データ格納メモリの管理・制御回路(データ格納メモリ制御回路)を有する。IBUF管理部5は、入力データ中の有効データ数をカウントして座標に変換し、さらにそれをIBUFアドレスに変換したデータ(iFMデータ)をデータ格納メモリに格納するとともに、所定の方法でiFMデータをデータ格納メモリから取り出す。
 WBUF管理部6は、係数格納用のメモリ(係数格納メモリ、WBUF)と、係数格納メモリの管理・制御回路(係数格納メモリ制御回路)を有する。WBUF管理部6は、IBUF管理部5のステータスを参照して、IBUF管理部5から取り出すデータに対応する係数を係数格納メモリから取り出す。
 DRAM9は、iFMデータ、oFMデータおよび係数を格納する。データ入力部3は、DRAM9から所定の方法で、入力特徴量マップ(iFM)を取得し、IBUF(データ格納メモリ)管理部5に渡す。データ出力部8は、DRAM9に所定の方法で、出力特徴量マップ(oFM)データを書き出す。具体的には、データ出力部8は、演算部7から出力されるM並列のデータを連結してDRAM9に出力する。係数入力部4は、DRAM9から所定の方法で、係数を取得し、WBUF(係数格納メモリ)管理部6に渡す。
 演算部7は、IBUF(データ格納メモリ)管理部5からデータ、WBUF(係数格納メモリ)管理部6から係数を取得して、フィルタ処理・累積加算・非線形演算・プーリング処理等のデータ処理を行う。コントローラ2は、回路全体の制御を行う。
 CNNでは、図19に示すように、何層も類似の処理を実施する。本発明の実施形態に係る演算処理装置1を用いる場合、演算部7は、1層分の処理に必要なデータおよび係数だけを有して1層分の処理を行い、データおよび係数はDRAM9に逐一置かれる。そして、必要な層数分の処理が繰り返し実行される。演算処理装置1は最終出力データとして被写体推定結果を出力し、この最終出力データを、プロセッサ(回路でもよい)を用いて処理することにより被写体推定結果を得る。
 図3は、本発明の実施形態に係る、演算処理装置の演算部の構成を示す図である。演算部7の入力チャネル数はN(N≧1)、すなわち入力データはN次元であり、N次元の入力データが並列して処理される(入力N並列)。演算部7の出力チャネル数はM(M≧1)、すなわち出力データはM次元であり、M次元の入力データが並列して出力される(出力M並列)。図3に示すように、1つの層において、各チャネル(ich_0~ich_N-1)ごとに、iFMデータ(d_0~d_N-1)と係数(k_0~k_N-1)が入力され、1個のデータを出力する。この処理がM層、並行して行われ、M個のデータoch_0~och_M-1が出力される。
 プーリングを実施する場合は「フィルタサイズ×4」セットのデータが入って初めて1個のデータが出る。プーリングをしない場合は「フィルタサイズ」セット分のデータで1個のデータが出る。
 このように、演算部7は、入力チャネル数をN、出力チャネル数をMとして、並列度がN×Mとなる構成を取る。入力チャネル数Nおよび出力チャネル数Mの大きさは、CNNの大きさに応じて設定(変更)することができるので、処理性能や回路規模を勘案して適切に設定する。
 演算部7は、演算部内各部の制御を行う演算制御部71を備える。また、演算部7は、各層ごとに、N個のフィルタ処理部72と、第2加算器75と、非線形変換部76と、プーリング処理部77を備える。そして、このような層がM個ある。すなわち、フィルタ処理部72はN×M個ある。
 演算制御部71が、演算部7の前段に対してリクエストを発行することにより、所定のデータがフィルタ処理部72に入力される。フィルタ処理部72は、乗算器73と第1加算器74から構成され、入力データのフィルタ処理を行う。乗算器73は、外部から入力されるFMデータ(特徴量マップデータ)d_0~d_N-1と、FMデータとタイミングを合わせて入力される係数k_0~k_N-1との乗算を行う。そして、第1加算器74が乗算の結果をフィルタサイズ分累積加算し、フィルタ処理部72におけるフィルタ処理が完了する。すなわち、累積加算の回数に応じて、フィルタサイズを変える。N個のフィルタ処理部72は、異なるFMデータに対して、同時に(並列して)上述の処理を行う。
 第2加算器75は、N並列で実行されるN個のフィルタ処理部72におけるフィルタ処理の結果を累積加算する。非線形変換部76は、第2加算器75での累積加算の結果に対して、Activate関数などによる非線形演算処理を行う。具体的な実装は特に規定しないが、例えば折れ線近似により非線形演算処理を行う。
 プーリング処理部77は、非線形変換部76から入力された複数のデータの中から最大値を選択出力(Max Pooling)する、平均値を算出(Average Pooling)する、などのプーリング処理を行う。なお、非線形変換部76とプーリング処理部77は、ネットワークによっては動作しない事があるので、演算制御部71によりスルーさせることができる。FullConnect処理の時はプーリング処理を行わないので、プーリング処理部77をスルーさせる。
 演算制御部71は、演算部7内の各部において行われる上述の処理の制御を行う。このような構成により、演算部7において、入力チャネル数Nおよび出力チャネル数Mの大きさは、CNNの大きさに応じて設定(変更)することができるので、処理性能や回路規模を勘案して適切に設定する。
 (Convolution処理時)
 Convolution処理時には、FMサイズとフィルタサイズは異なっていてもよく、変更も可能である。また出力は2次元データである。
 演算部7におけるConvolution処理時の動作について説明する。ここでは、1つの入力チャネルに着目して、Convolution処理することを考える。以下、フィルタサイズが3×3である場合について説明する。
 図4(a)は、iFM(入力特徴量マップ)のデータ配置を示す図であり、図4(b)は、このデータに対応する係数を示す図である。図4(a)中のa~pは、データの値を示す(図3のd_0~d_N-1に対応する)。図4(b)中のw1~w9は、係数の値を示す(図3のk_0~k_N-1に対応する)。すなわち、d*はデータライン、k*は係数ラインを示している。
 図5は、Convolution処理時のタイミングチャートを示す図である。図の左から右へと時間が流れていくものとする。まず、図4(a)に示すiFMのデータ中のフィルタサイズ分(3×3の9個)のデータ(a、b、c、e、f、g、i、j、k)の各々に対し、乗算器73において係数w1~w9が乗算される。第1加算器74は、乗算器73による乗算結果をフィルタサイズ分(3×3の9個)累積加算する(図5のΣ)。第1加算器74による累積加算の結果(Σ)は、フィルタ処理部72におけるフィルタ処理結果となる。
 第2加算器75は、N並列に並んだ第1加算器74の結果(Σ)の総和を取る(図5のA)。Aは出力の1画素に対応する。第2加算器75において、この総和を取る処理は、第1加算器74からフィルタ処理結果が出力されるタイミングで行われる。そして、非線形変換部76が、第2加算器75によって算出された総和(A)に対して、非線形変換部を行う(図5のf(A))。
 以上で、1つのフィルタのフィルタサイズ分(3×3の9個)のデータの処理は完了する。そして、次のフィルタのフィルタサイズ分(3×3の9個)のデータの処理へと進む。データの入力順は図5に示すように、「a、b、c、e、f、g、i、j、k」の次は、「e、f、g、i、j、k、m、n、o」であり、その次は「b、c、d、f、g、h、j、k、l」である。このように、フィルタの重心位置が図4(a)に示すデータで「f→j→g→k」の順に動いていく。非線形変換部76以降にはこの順で入り、プーリング処理部77が複数のデータに対してプーリング処理を行う。
 (FullConnect処理時)
 FullConnect処理時には、Convolution処理時のFMサイズとフィルタサイズのサイズの条件に一定の条件を加える。FullConnect処理時には、演算部7が、入力の1次元データ列(要素数n)を、Fx×Fyの2次元データ列N面分(N並列)に換算し直す処理を行う(n≦Fx×Fy×N)。すなわち、演算部7が、フィルタサイズを所定サイズ(Fx×Fy)に設定するとともに、出力の2次元データ列(要素数i×j)として、oFMのサイズが1×n、oFMの数がmとなるように設定する。Convolution処理時のフィルタサイズと同じである必要はない。Nは回路の入力並列度で、実装により固定されるので、大きなnを扱うために通常はFx、Fyを(対応可能な範囲で)極力大きめに設定する。
 演算部7におけるFullConnect処理時の動作について説明する。Convolution処理の説明と同様に、フィルタサイズが3×3である場合について説明する。この場合、入力チャネル数がN(N並列)なので、入力データ列は9Nである。iFMデータのサイズはフィルタサイズと同じなので3×3である。すなわち、上述のFx、Fyは、Fx=Fy=3を満たす。したがって、FullConnect層の入力(入力特徴量マップのデータ列)iFM[j](要素数n、0≦j<n)を、iFM[z][x][y](0≦x<3、0≦y<3、0≦j<n、j=3×(z×3+x)+y)という3次元のデータ列と解釈する。また、FullConnect層の出力(出力特徴量マップのデータ列)oFM[i](要素数m、0≦i<m)を計算するための係数群k[i][j]を、k[i][z][x][y](0≦i<m、0≦x<3、0≦y<3、0≦j<n、j=3×(z×3+x)+y)という4次元のデータ列と解釈する。
 図6(a)は、第1セットにおけるiFM(入力特徴量マップ)のデータ配置を示す図であり、図6(b)は、このデータに対応する係数を示す図である。図6(a)中のa1~i1はデータの値を示し、図6(c)中のw11~w19は係数の値を示す。同様に、図6(c)は、第2セットにおけるiFM(入力特徴量マップ)のデータ配置を示す図であり、図6(d)は、このデータに対応する係数を示す図である。図6(b)中のa2~i2はデータの値を示し、図6(d)中のw21~w29は係数の値を示す。第3セット以降も同様であり、必要なだけセット数を増やせばよい。
 図7は、FullConnect処理時のタイミングチャートを示す図である。入力データが図4と図6で異なる点を考慮すれば、図7に示すFullConnect処理時のタイミングチャートは、図5に示すConvolution処理時のタイミングチャートと全く同じ処理となる。したがって、図7の説明は省略する。ただし、このタイミングチャート以降の処理において、図5に示すConvolution処理時の非線形変換出力はoFMを形成する1画素のデータ(正確には、oFMを形成する1画素のデータを作成するためのプーリング処理前のデータ)でしかないのに対し、図7に示すFullConnect処理時の非線形変換出力はそのまま1面分のoFMデータである。
 ここで、入力データ列がフィルタサイズでちょうど割り切れない場合は、フィルタサイズで割り切れる(フィルタサイズと等しくなる)ように、値がゼロのデータを追加することにより、累積加算結果に誤差を生じることなく演算ができる。
 上述のように、発明は、設定パラメータの変更だけで任意のフィルタサイズに対応でき、フィルタサイズ方向でなく、フィルタの種類方向にアレイ状に並列化することにより高速化を実現し、かつフィルタサイズを設定(変更)することができる構成を実現している。これにより完全同一回路でConvolution処理およびFullConnect処理の両方に対応でき、専用制御を必要とせず、規模削減(電力削減)効果がある。加えて、フィルタサイズが可変であるため、利便性が高い。また、Convolution処理の回路リソースをFullConnect処理でフル活用できる設定なので、FullConnect処理も高速実行できる。
 Convolution処理時には、図5のタイミングチャートに示すように、データ格納メモリ(IBUF)から同じデータを複数回、読み出している。具体的には、図4(a)に示すデータにおいて、「f」を中心とする9個のデータを読み出して1つの出力データを算出し、「j」を中心とする9個のデータを読み出して1つの出力データを算出し、「g」を中心とする9個のデータを読み出して1つの出力データを算出し、「k」を中心とする9個のデータを読み出して1つの出力データを算出する。そして、4つ(2×2)のデータからプーリング処理により1つのデータを算出する。すなわち、フィルタサイズが3×3でプーリング処理の実施単位のサイズが2×2の場合、データ格納メモリから読み出すデータの種類は16であるのに対し、読み出し回数は3×3×4=36となる。
 そこで、データ格納メモリのSRAMへのアクセスの消費電力を削減するため、図4(a)に示す4×4の単位でデータ格納メモリからデータを取り出して保存するFFアレイ(バッファ)を、データ格納メモリの内部に備えてもよい。すなわち、データ格納メモリは、プーリング処理後の1データを算出するために必要なデータセット(4×4=16個のデータ)を格納できるFFアレイを備え、このFFアレイはIBUFから読み出したデータを蓄積する。このような構成により、SRAMから何度も同じデータを読み出す必要がなく、メモリアクセスを減らして消費電力を低減できる。
 図8は、FFアレイ搭載時における、Convolution時のIBUF制御のコードの例を示す図である。なお、同等の機能を回路で実装してもよい。
 (変形例)
 上述の実施形態の変形例について説明する。本発明では、図3のように、フィルタ演算は、データと係数をピクセル単位で乗算し、累積加算器で乗算結果を累積加算することにより実現している。このとき、係数とデータの少なくともどちらか一方がゼロの場合、乗算結果はゼロとなり、累積加算の結果は更新されないので、演算が無駄となる。特に、DeepLearningにおいては係数の多くがゼロになる場合があり、この問題は顕著である。
 そこで、第1変形例では、係数とデータのどちらか一方がゼロの場合、乗算と累積加算を実行しない事で消費電力を削減する。図9は、本変形例の演算処理装置に係る、IBUF管理部5、WBUF管理部6、および演算部7の接続を示す図である。
 演算部7からリクエスト(req)を受けると、IBUF(データ格納メモリ)管理部5のSRAM読み出し制御部51は、N個のIBUF(0~N-1)からN個のFMデータを読み出し、演算部7に送信する。また、これと同じタイミングで、WBUF(係数格納メモリ)管理部6のWBUF読み出し部61は、M個のWBUF(0~M-1)からN×M個の係数を読み出し、演算部7に送信する。本変形例では、IBUF管理部5のSRAM読み出し制御部51から、WBUF管理部6のWBUF読み出し部61へと、ステータス信号が送信される。ここで、ステータス信号とは、IBUF管理部5が取り出すFMデータの情報をWBUF管理部6に伝える信号である。
 図10は、図9における演算部7の内部構成を示す図である。本変形例では、演算部7において、フィルタ処理部72の前段に演算実行判定部78が設けられている。演算実行判定部78は、IBUFから入力されたデータ(data_0、data_1、…)およびWBUFから入力された係数(coef_0、coef_1、…)のどちらかがゼロか否かを示す演算スルー信号(vz_0、vz_1、…)をフィルタ処理部72に通知する。
 IBUFから入力されたデータ(data_0、data_1、…)およびWBUFから入力された係数(coef_0、coef_1、…)のどちらかがゼロの場合、演算スルー信号(vz_0、vz_1、…)の値はゼロである。IBUFから入力されたデータ(data_0、data_1、…)およびWBUFから入力された係数(coef_0、coef_1、…)のどちらもゼロでない場合、演算スルー信号(vz_0、vz_1、…)の値は1である。
 フィルタ処理部72は、演算実行判定部78から入力された演算スルー信号(vz_0、vz_1、…)の値がゼロの場合、乗算および累積加算の実行をOFF(演算スルー)する。「演算スルー」とは、フィルタ処理部72における処理を停止する、または演算処理を行わないことを意味する。
 演算スルー信号(vz_0、vz_1、…)は、イネーブル信号でも良いし、フィルタ処理部72に入力されるクロックをゲーティングする(止める)ために使用するのでも良い。図11は、クロックゲーティングによる演算スルーの例を示す図である。図中の「CG」はクロックゲーティングセルを示す。演算実行判定部78のゼロ検出部がデータ(data)または係数(coef)のゼロを検出すると、演算スルー信号(vz_0、vz_1、…)の値をゼロとして、クロックゲーティングセルに通知される。演算スルー信号(vz_0、vz_1、…)の値がゼロの場合、クロックゲーティングセルは、クロックを止める信号を送信し、フィルタ処理部72における演算がストップする。
 図12は、入力の並列度をN=n+1=2、出力の並列度をM=m+1=2とした場合のタイミングチャートを示す図である。WBUF(係数格納メモリ)における係数の値(W)またはIBUF(データ格納メモリ)におけるデータの値(D)がゼロの場合、演算スルー信号(vz_0、vz_1、…)の値がゼロとなり、乗算器における演算がスルーされ、第1加算器による演算がスルーされる。
 このように、演算実行判定部78は、入力された入力特徴量マップデータおよび係数の少なくとも一方がゼロの場合、フィルタ処理部72に演算スルーを通知する。演算実行判定部78から演算スルーが通知された場合、フィルタ処理部72は演算をスルーする。このような構成により、第1変形例では、係数かデータのどちらかがゼロの場合、乗算と累積加算を実行しない事で消費電力を削減することができる。
 次に、本発明の実施形態の第2変形例について説明する。第2変形例では、データにゼロが多いとき、先にデータを読んで、データがゼロの場合、係数記憶メモリへのアクセス(SRAMリードアクセス)自体を停止する。これにより、さらに消費電力を削減する。
 図13は、本変形例の演算処理装置に係る、IBUF管理部5、WBUF管理部6、および演算部7の接続を示す図である。演算部7からリクエスト(req)を受けると、IBUF(データ格納メモリ)管理部5のSRAM読み出し制御部51は、N個のIBUF(0~N-1)からN個のFMデータを読み出し、delay回路52を介して演算部7に送信すると同時に、WBUF(係数格納メモリ)管理部6のデータゼロ検出部62へと送信する。
 データゼロ検出部62は、IBUF管理部5から送信されたN個のFMデータの各々がゼロか否かを検出し、データがゼロの場合は、そのデータの検出信号iz*=0(*=0~N-1)とする。例えば、IBUF0から読み出したFMデータがゼロの場合は、iz0=0とする。そして、データゼロ検出部62は、検出信号iz*を、WBUF(係数格納メモリ)管理部6のWBUF読み出し部61および演算部7に送信する。
 WBUF(係数格納メモリ)管理部6のWBUF読み出し部61は、検出信号iz*に基づいて、M個のWBUF(0~M-1)のうち、対応するデータがゼロでないWBUFにのみアクセスして係数を読み出し、演算部7に送信する。WBUFにアクセスしていない(WBUFから読み出していない)係数はゼロとして、演算部7に送信する。
 図14は、本変形例における、演算部7の内部構成を示す図である。演算部7の演算実行判定部78は、WBUF読み出し部61から送信された係数(coef_0、coef_1、…)がゼロの部分を検出し、その結果とデータゼロ検出部62から送信された検出信号(iz_0、iz_1、…)との論理和を演算スルー信号(vz0、vz1、…)とする。
 図15は、本変形例における、演算時のタイミングチャートを示す図である。IBUF(データ格納メモリ)におけるデータの値(D)がゼロの場合、検出信号(iz_0、iz_1、…)の値がゼロとなり、対応するWBUFからの係数の読み出しが行われない(図の「←」)。そして、IBUF(データ格納メモリ)におけるデータの値(D)におけるゼロの検出結果と、WBUF(係数格納メモリ)における係数の値(W)におけるゼロの検出結果とに基づいた演算スルー信号(vz0、vz1、…)がゼロの場合、フィルタ処理部72の乗算器73における演算がスルーされる(図の「←」)。得られる最終結果は、第1変形例のものと同じとなる。
 上述のように、本変形例では、WBUF管理部6が、IBUF(データ格納メモリ)から読み出したFMデータがゼロか否かを検出するデータゼロ検出部62を有する。そして、WBUF(係数格納メモリ)管理部6のWBUF読み出し部61は、WBUF(係数格納メモリ)のうち、対応するIBUF(データ格納メモリ)から読み出したFMデータがゼロでないWBUFにのみにアクセスして係数を取り出す。さらに、演算部7の演算実行判定部78は、係数がゼロの部分を検出し、その結果とデータゼロ検出部の結果との論理和を出力する。
 このような構成により、第2変形例では、第1変形例に加えて、データがゼロの場合、係数格納メモリへのアクセス自体を停止して、さらに消費電力を削減することができる。ゼロが多いデータの時は第2変形例が有利となる。
 次に、本発明の実施形態の第3変形例について説明する。第3変形例では、係数にゼロが多いときに、先に係数を読んで、係数の値がゼロでなかった部分に対応するIBUFにのみアクセスする。すなわち、係数の値がゼロの部分に対応するデータリードアクセス自体を停止する。
 図16は、本変形例の演算処理装置に係る、IBUF管理部5、WBUF管理部6、および演算部7の接続を示す図である。演算部7からリクエスト(req)を受けると、WBUF(係数格納メモリ)管理部6のWBUF読み出し部61は、M個のWBUF(0~M-1)にアクセスしてN×M個の係数を読み出し、delay回路63を介して、演算部7に送信すると同時に、IBUF(データ格納メモリ)管理部5の係数ゼロ検出部53に送信する。さらに、WBUF読み出し部61は、ステータス信号をIBUF(データ格納メモリ)管理部5のSRAM読み出し制御部51に送信する。ここで、ステータス信号とは、WBUF管理部6が取り出す係数の情報をIBUF管理部5に伝える信号である。
 係数ゼロ検出部53は、WBUF管理部6から送信されたN×M個の係数の各々がゼロか否かを検出し、M並列全ての係数(M個の係数)がゼロの場合は、係数ゼロ検出信号cz*=0(*=0~N~1)とする。例えば、M並列全てのWBUF0から読み出した係数がゼロの場合は、cz0=0とする。このように、IBUF管理部5はM並列でIBUFの出力を共有しているので、M並列全ての係数(M個の係数)がゼロか否かを検出しなければならない。
 そして、係数ゼロ検出部53は、係数ゼロ検出信号cz*を、IBUF管理部5のSRAM読み出し制御部51および演算部7に送信する。SRAM読み出し制御部51は、N個のIBUF(0~N-1)からN個のFMデータを読み出し、演算部7に送信する。
 図17は、本変形例における、演算部7の内部構成を示す図である。演算部7の演算実行判定部78は、IBUF管理部5から送信されたFMデータ(data_0、data_1、…)がゼロの部分を検出し、その結果と係数ゼロ検出部53から送信された係数ゼロ検出信号(cz_0、cz_1、…)との論理和を演算スルー信号(vz0、vz1、…)とする。本変形例の場合、係数がゼロであってもFMデータが入力される事があるが、演算実行判定部78で係数ゼロ検出信号(cz_0、cz_1、…)がゼロであることを確認できるので、フィルタ処理部72は結局動作しない。
 図18は、本変形例における、演算時のタイミングチャートを示す図である。WBUF(係数格納メモリ)におけるM並列全ての係数の値(W)がゼロの場合、係数ゼロ検出信号(cz_0、cz_1、…)の値がゼロとなり、対応するIBUFからのFMデータの読み出しが行われない(図の「←」)。そして、IBUF(データ格納メモリ)におけるデータの値(D)におけるゼロの検出結果と、WBUF(係数格納メモリ)における係数の値(W)におけるゼロの検出結果とに基づいた演算スルー信号(vz0、vz1、…)がゼロの場合、フィルタ処理部72の乗算器73における演算がスルーされる(図の「←」)。得られる最終結果は、第1変形例のものと同じとなる。
 上述のように、本変形例では、M並列であるIBUF管理部5の係数ゼロ検出部53が、WBUF(係数格納メモリ)に格納されたN×M個の係数のうち、M並列全ての係数(M個の係数)がゼロか否かを検出して、係数ゼロ検出信号(cz*)を出力する。そして、IBUF管理部5のSRAM読み出し制御部51が、IBUF(データ格納メモリ)のうち、係数ゼロ検出信号(cz*)がゼロでない係数に対応するIBUFからのみFMデータを取り出す。演算実行判定部78は、FMデータのうちゼロの部分を検出し、その結果と係数ゼロ検出部53の結果との論理和を出力する。
 このような構成により、第3変形例では、第1変形例に加えて、M並列全ての係数がゼロの場合、SRAMへのアクセス自体を停止する。これにより、さらに消費電力を削減することができる。第3変形例は係数にゼロが多い場合に有利となる。
 以上、本発明の一実施形態について説明したが、本発明の技術範囲は上記実施形態に限定されるものではなく、本発明の趣旨を逸脱しない範囲において構成要素の組み合わせを変えたり、各構成要素に種々の変更を加えたり、削除したりすることができる。
 各構成要素は、それぞれの構成要素に係る機能や処理を説明するためのものである。複数の構成要素に係る機能や処理を、1つの構成(回路)が同時に実現してもよい。
 各構成要素は、それぞれもしくは全体として、1個又は複数のプロセッサ、論理回路、メモリ、入出力インタフェース及びコンピュータ読み取り可能な記録媒体などからなるコンピュータで実現するようにしてもよい。その場合、各構成要素もしくは全体の機能を実現するためのプログラムを記録媒体に記録しておき、記録されたプログラムをコンピュータシステムに読み込ませ、実行することによって、上述した種々の機能や処理を実現してもよい。
 この場合、例えば、プロセッサは、CPU、DSP(Digital Signal Processor)、およびGPU(Graphics Processing Unit)の少なくとも1つである。例えば、論理回路は、ASIC(Application Specific Integrated Circuit)およびFPGA(Field-Programmable Gate Array)の少なくとも1つである。
 また、ここでいう「コンピュータシステム」とは、OSや周辺機器などのハードウェアを含むものであってもよい。また、「コンピュータシステム」は、WWWシステムを利用している場合であれば、ホームページ提供環境(あるいは表示環境)も含むものとする。また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、フラッシュメモリなどの書き込み可能な不揮発性メモリ、CD-ROMなどの可搬媒体、コンピュータシステムに内蔵されるハードディスクなどの記憶装置をいう。
 さらに「コンピュータ読み取り可能な記録媒体」とは、インターネットなどのネットワークや電話回線などの通信回線を介してプログラムが送信された場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリ(例えばDRAM(Dynamic Random Access Memory))のように、一定時間プログラムを保持しているものも含むものとする。
 また、上記プログラムは、このプログラムを記憶装置などに格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネットなどのネットワーク(通信網)や電話回線などの通信回線(通信線)のように情報を伝送する機能を有する媒体をいう。また、上記プログラムは、前述した機能の一部を実現するためのものであってもよい。さらに、前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現するもの、いわゆる差分ファイル(差分プログラム)であってもよい。
 本発明は、畳み込みニューラルネットワークを用いたディープラーニングを行う演算処理装置に広く適用でき、Convolution処理とFullConnect処理を共通の回路で行うことができる。
 1 演算処理装置
 2 コントローラ
 3 データ入力部
 4 係数入力部
 5 IBUF(データ格納メモリ)管理部
 6 WBUF(係数格納メモリ)管理部
 7 演算部
 8 データ出力部
 9 DRAM
 51 SRAM読み出し制御部
 52 delay回路
 53 係数ゼロ検出部
 61 WBUF読み出し部
 62 データゼロ検出部
 63 delay回路
 71 演算制御部
 72 フィルタ処理部
 73 乗算器
 74 第1加算器
 75 第2加算器
 76 非線形変換部
 77 プーリング処理部
 78 演算実行判定部
 79 ゼロ検出部

Claims (6)

  1.  Convolution処理とFullConnect処理を行うディープラーニング用の演算処理装置であって、
     入力特徴量マップデータを格納するデータ格納メモリ、および前記データ格納メモリを制御するデータ格納メモリ制御回路を有するデータ格納メモリ管理部と、
     係数を格納する係数格納メモリ、および前記係数格納メモリを制御する係数格納メモリ制御回路を有する係数格納メモリ管理部と、
     格納用外部メモリから、前記入力特徴量マップデータを取得するデータ入力部と、
     格納用外部メモリから、前記係数を取得する係数入力部と、
     前記格納用外部メモリに、出力特徴量マップデータを書き出すデータ出力部と、
     入力N並列、出力M並列の構成(N、M≧1)で、前記データ格納メモリから前記入力特徴量マップデータを取得し、前記係数格納メモリから前記係数を取得して、フィルタ処理、累積加算処理、非線形演算処理およびプーリング処理を行う演算部と、
     前記データ格納メモリ管理部、前記係数格納メモリ管理部、前記データ入力部、前記データ出力部、および前記演算部を制御するコントローラと、
    を有し、
     前記データ格納メモリ管理部は、前記入力特徴量マップデータを前記データ格納メモリから取り出し、
     前記係数格納メモリ管理部は、前記データ格納メモリ管理部のステータスを参照して、前記データ格納メモリ管理部から取り出すデータに対応する係数を前記係数格納メモリから取り出し、
     前記データ出力部は、前記演算部から出力されるM並列のデータを連結して前記格納用外部メモリに出力し、
     前記演算部は、
      乗算器および第1加算器を有し前記フィルタ処理を行うフィルタ処理部と、
      N並列で実行される前記フィルタ処理の結果を全て累積加算する前記累積加算処理を行う第2加算器と、
      前記累積加算処理の結果に対し前記非線形演算処理を行う非線形変換部と、
      前記非線形演算処理の結果に対し前記プーリング処理を行うプーリング処理部と、
      前記フィルタ処理部、前記第2加算器、前記非線形変換部、および前記プーリング処理部を制御する演算制御部と、
    を有する演算処理装置。
  2.  前記演算部の処理を制御する演算制御部をさらに有し、前記演算制御部は、FullConnect処理時は、
     入力の1次元データ列(要素数n)を所定サイズ(Fx×Fy)のデータ列N面分に換算する処理を行うように演算部を制御し(ただし、n≦Fx×Fy×N、FxとFyの少なくとも1つが2以上)、
     フィルタサイズを前記所定サイズ(Fx×Fy)に設定し、
     出力の1次元データ列(要素数m)として、出力特徴量マップデータのサイズが1×1、要素数がmとなるように演算部を制御する
    請求項1に記載の演算処理装置。
  3.  前記データ格納メモリは、プーリング処理後の1データを算出するために必要なデータセットを格納するバッファを備え、前記バッファは前記データ格納メモリから読み出したデータを蓄積する、請求項1または2に記載の演算処理装置。
  4.  演算実行判定部は、入力された前記入力特徴量マップデータおよび前記係数の少なくとも一方がゼロの場合、前記フィルタ処理部に演算スルーを通知し、
     前記演算実行判定部から演算スルーが通知された場合、前記フィルタ処理部は演算処理を停止する
    請求項1から3のいずれか1項に記載の演算処理装置。
  5.  前記係数格納メモリ管理部は、前記データ格納メモリから読み出した前記入力特徴量マップデータがゼロか否かを検出するデータゼロ検出部を有し、
     前記係数格納メモリのうち、対応するデータ格納メモリから読み出した前記入力特徴量マップデータがゼロでない係数格納メモリにのみにアクセスして前記係数を取り出し、
     前記演算実行判定部は、係数がゼロの部分を検出し、その結果と前記データゼロ検出部の結果との論理和がゼロの場合、前記フィルタ処理部に演算スルーを通知する
    請求項4に記載の演算処理装置。
  6.  N並列である前記データ格納メモリ管理部は、
      前記係数格納メモリに格納されたN×M個の係数のうち、N並列全ての係数がゼロか否かを検出して、係数ゼロ検出信号を出力する係数ゼロ検出部と、
      前記データ格納メモリのうち、前記係数ゼロ検出信号がゼロでない係数に対応するデータ格納メモリからのみ前記入力特徴量マップデータを取り出すSRAM読み出し制御部と、
    を備え、
     前記演算実行判定部は、入力特徴量マップデータがゼロの部分を検出し、その結果と前記係数ゼロ検出部の結果との論理和がゼロの場合、前記フィルタ処理部に演算スルーを通知する
    請求項4または5に記載の演算処理装置。
PCT/JP2018/018306 2018-05-11 2018-05-11 演算処理装置 WO2019215907A1 (ja)

Priority Applications (5)

Application Number Priority Date Filing Date Title
PCT/JP2018/018306 WO2019215907A1 (ja) 2018-05-11 2018-05-11 演算処理装置
JP2020518334A JP7261226B2 (ja) 2018-05-11 2019-05-09 演算処理装置
CN201980027100.4A CN112005251A (zh) 2018-05-11 2019-05-09 运算处理装置
PCT/JP2019/018565 WO2019216376A1 (ja) 2018-05-11 2019-05-09 演算処理装置
US17/081,006 US20210042616A1 (en) 2018-05-11 2020-10-27 Arithmetic processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2018/018306 WO2019215907A1 (ja) 2018-05-11 2018-05-11 演算処理装置

Publications (1)

Publication Number Publication Date
WO2019215907A1 true WO2019215907A1 (ja) 2019-11-14

Family

ID=68466793

Family Applications (2)

Application Number Title Priority Date Filing Date
PCT/JP2018/018306 WO2019215907A1 (ja) 2018-05-11 2018-05-11 演算処理装置
PCT/JP2019/018565 WO2019216376A1 (ja) 2018-05-11 2019-05-09 演算処理装置

Family Applications After (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/018565 WO2019216376A1 (ja) 2018-05-11 2019-05-09 演算処理装置

Country Status (4)

Country Link
US (1) US20210042616A1 (ja)
JP (1) JP7261226B2 (ja)
CN (1) CN112005251A (ja)
WO (2) WO2019215907A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111158790A (zh) * 2019-12-31 2020-05-15 清华大学 面向云端深度学习推理的fpga虚拟化方法
WO2022123687A1 (ja) * 2020-12-09 2022-06-16 日本電信電話株式会社 演算回路、演算方法、及びプログラム

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI692939B (zh) * 2018-08-14 2020-05-01 鈺創科技股份有限公司 過濾訊號的數位濾波器
JP7402623B2 (ja) * 2019-06-17 2023-12-21 キヤノン株式会社 フィルタ処理装置及びその制御方法
JP2023056644A (ja) * 2021-10-08 2023-04-20 LeapMind株式会社 ニューラルネットワーク回路およびニューラルネットワーク回路の制御方法

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017021483A (ja) * 2015-07-08 2017-01-26 株式会社デンソー 演算処理装置
JP2018028908A (ja) * 2016-08-11 2018-02-22 ビバンテ コーポレーション ゼロ係数スキップ畳み込みニューラルネットワークエンジン

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4337911B2 (ja) * 2007-05-24 2009-09-30 ソニー株式会社 撮像装置、撮像回路、および撮像方法
CN202385063U (zh) * 2011-09-27 2012-08-15 深圳市蓝韵实业有限公司 基于fpga实现的数字滤波器
WO2014068747A1 (ja) * 2012-11-01 2014-05-08 三菱電機株式会社 変換装置、周辺装置およびプログラマブルコントローラ
CN104579240B (zh) * 2013-10-21 2017-12-01 京微雅格(北京)科技有限公司 一种基于fpga的可配置系数的滤波器、电子设备及滤波方法
JP6314628B2 (ja) * 2014-04-28 2018-04-25 株式会社デンソー 演算処理装置
JP6090286B2 (ja) * 2014-10-31 2017-03-08 カシオ計算機株式会社 機械学習装置、機械学習方法、分類装置、分類方法、プログラム
US10019234B2 (en) * 2015-10-05 2018-07-10 Altera Corporation Methods and apparatus for sequencing multiply-accumulate operations
JP2017191501A (ja) * 2016-04-14 2017-10-19 キヤノン株式会社 情報処理装置、情報処理方法及びプログラム
JP6800656B2 (ja) * 2016-08-24 2020-12-16 キヤノン株式会社 演算回路、その制御方法及びプログラム
JP6864224B2 (ja) * 2017-01-27 2021-04-28 富士通株式会社 プロセッサ、情報処理装置及びプロセッサの動作方法
CN106940815B (zh) * 2017-02-13 2020-07-28 西安交通大学 一种可编程卷积神经网络协处理器ip核
JP7272670B2 (ja) * 2018-05-31 2023-05-12 i-PRO株式会社 カメラ装置、画像処理方法およびカメラシステム
JP2020086479A (ja) * 2018-11-15 2020-06-04 株式会社日立製作所 計算機、ニューラルネットワークの構築方法、および計算機システム

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017021483A (ja) * 2015-07-08 2017-01-26 株式会社デンソー 演算処理装置
JP2018028908A (ja) * 2016-08-11 2018-02-22 ビバンテ コーポレーション ゼロ係数スキップ畳み込みニューラルネットワークエンジン

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LI, HUIMIN ET AL.: "A High Performance FPGA-based Accelerator for Large-Scale Convolutional Neural Networks", PROCEEDINGS OF 2016 26TH INTERNATIONAL CONFERENCE ON FIELD PROGRAMMABLE LOGIC AND APPLICATIONS(FPL), 2 September 2016 (2016-09-02), pages 1 - 9, XP032971527 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111158790A (zh) * 2019-12-31 2020-05-15 清华大学 面向云端深度学习推理的fpga虚拟化方法
WO2022123687A1 (ja) * 2020-12-09 2022-06-16 日本電信電話株式会社 演算回路、演算方法、及びプログラム

Also Published As

Publication number Publication date
CN112005251A (zh) 2020-11-27
JPWO2019216376A1 (ja) 2021-05-13
JP7261226B2 (ja) 2023-04-19
WO2019216376A1 (ja) 2019-11-14
US20210042616A1 (en) 2021-02-11

Similar Documents

Publication Publication Date Title
WO2019215907A1 (ja) 演算処理装置
US11157592B2 (en) Hardware implementation of convolutional layer of deep neural network
JP6857286B2 (ja) ニューラルネットワークアレイの性能の改善
CN108229654B (zh) 神经网络卷积运算装置及方法
CN112214726B (zh) 运算加速器
WO2019109795A1 (zh) 卷积运算处理方法及相关产品
KR102252137B1 (ko) 계산 장치 및 방법
WO2020199476A1 (zh) 基于脉动阵列的神经网络加速方法、装置、计算机设备及存储介质
US20190243790A1 (en) Direct memory access engine and method thereof
CN112528219A (zh) 存储器装置及其运算方法、计算设备
CN111124995A (zh) 通过人工智能处理器处理一维复数数组的方法和设备
US11494326B1 (en) Programmable computations in direct memory access engine
CN111178513B (zh) 神经网络的卷积实现方法、卷积实现装置及终端设备
CN114764615A (zh) 卷积运算的实现方法、数据处理方法及装置
WO2020155044A1 (zh) 卷积计算的装置、方法、处理器和可移动设备
CN111143766A (zh) 人工智能处理器处理二维复数矩阵的方法和设备
CN110929854B (zh) 一种数据处理方法、装置及硬件加速器
Bevara et al. VLSI implementation of high throughput parallel pipeline median finder for IoT applications
US11263517B1 (en) Flexible weight expansion
US20210182656A1 (en) Arithmetic processing device
Mao et al. A Unified Acceleration Solution Based on Deformable Network for Image Pixel Processing
WO2022246617A1 (zh) 卷积运算方法、图像处理方法、装置和存储介质
US20220318604A1 (en) Sparse machine learning acceleration
TWI834729B (zh) 神經網路處理器及其卷積操作方法
EP3968238A1 (en) Operation method of host processor and accelerator, and electronic device including the same

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18917775

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP