WO2021070303A1 - 演算処理装置 - Google Patents

演算処理装置 Download PDF

Info

Publication number
WO2021070303A1
WO2021070303A1 PCT/JP2019/039897 JP2019039897W WO2021070303A1 WO 2021070303 A1 WO2021070303 A1 WO 2021070303A1 JP 2019039897 W JP2019039897 W JP 2019039897W WO 2021070303 A1 WO2021070303 A1 WO 2021070303A1
Authority
WO
WIPO (PCT)
Prior art keywords
processing
unit
data
pooling
storage memory
Prior art date
Application number
PCT/JP2019/039897
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 JP2021551021A priority Critical patent/JP7410961B2/ja
Priority to PCT/JP2019/039897 priority patent/WO2021070303A1/ja
Publication of WO2021070303A1 publication Critical patent/WO2021070303A1/ja
Priority to US17/558,783 priority patent/US20220113944A1/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
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/57Arithmetic logic units [ALU], i.e. arrangements or devices for performing two or more of the operations covered by groups G06F7/483 – G06F7/556 or for performing logical operations
    • 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
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/544Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices for evaluating functions by calculation
    • G06F7/5443Sum of products
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24133Distances to prototypes
    • 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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/38Indexing scheme relating to groups G06F7/38 - G06F7/575
    • G06F2207/48Indexing scheme relating to groups G06F7/48 - G06F7/575
    • G06F2207/4802Special implementations
    • G06F2207/4818Threshold devices
    • G06F2207/4824Neural networks
    • 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/048Activation functions

Definitions

  • the present invention relates to an arithmetic processing unit, more specifically, a circuit configuration of an arithmetic processing unit that performs deep learning using a convolutional neural network.
  • an arithmetic processing unit that executes an arithmetic using a neural network in which a plurality of processing layers are hierarchically connected.
  • arithmetic processing devices that perform image recognition, deep learning using a convolutional neural network (hereinafter referred to as CNN) is widely performed.
  • CNN convolutional neural network
  • FIG. 28 is a diagram showing a flow of image recognition processing by deep learning using CNN.
  • image recognition by deep learning using CNN the input image data (pixel data) is sequentially processed in a plurality of processing layers of CNN, so that an object contained in the image is recognized.
  • the final calculation result data is obtained.
  • the processing layer of CNN is a Convolution layer that performs Convolution processing including convolution processing, non-linear processing, reduction processing (pooling processing), etc., and FullConnect processing that multiplies all input data (pixel data) by a filter coefficient and cumulatively adds them. It is roughly classified into a Full Connect layer (fully connected layer) to be performed. However, there are also convolutional neural networks that do not have a FullConnect layer.
  • Image recognition by deep learning using CNN is performed as follows. First, a convolution calculation process that extracts a certain area from the image data and multiplies it by a plurality of filters having different filter coefficients to create a feature map (Fature Map, FM), and reduces a part of the feature map.
  • the combination of the reduction processing (pooling processing) to be performed is regarded as one processing layer, and this is performed a plurality of times (in a plurality of processing layers). These processes are the processes of the Convolution layer.
  • FIG. 29 is a diagram showing the flow of Convolution processing.
  • 1 pixel and pixels in the vicinity thereof (8 pixels in the vicinity in the example of FIG. 29) are extracted from the image data, filter processing with different filter coefficients is performed for each (convolution calculation processing), and all of these are cumulatively added.
  • data corresponding to one pixel can be obtained.
  • non-linear conversion and reduction processing (pooling processing) on the created data and performing the above processing on all pixels of the image data
  • oFM output feature map
  • the generated output feature map (oFM) is used as the input feature map (iFM) for the next Convolution process, and the Convolution process is repeated by further performing filter processing with different filter coefficients. In this way, the Convolution process is performed a plurality of times to obtain an output feature amount map (oFM).
  • the image data was read as a one-dimensional data string.
  • Full Connect processing is performed a plurality of times (in a plurality of processing layers) to multiply each data in the one-dimensional data string by different coefficients and perform cumulative addition. These treatments are the treatments of the fully connected layer (FullConnect layer).
  • the probability that the object included in the image is detected is output as the subject estimation result which is the final calculation result.
  • the probability that a dog was detected was 0.01 (1%)
  • the probability that a cat was detected was 0.04 (4%)
  • the probability that a boat was detected was 0.94 (94%)
  • the probability that a bird is detected is 0.02 (2%).
  • the relationship between the FM (Fature Map) size and the number of FMs (the number of FM surfaces) in the (K-1) layer and the Kth layer may be as shown in the following equation. In many cases, it is difficult to optimize when determining the memory size as a circuit.
  • FM size [K] 1/4 x FM size [K-1]
  • FM number [K] 2 x FM number [K-1]
  • Non-Patent Document 1 discloses an accelerator for deep CNN based on an FPGA (Field-Programmable Gate Array) platform.
  • the number of iFMs may be extremely smaller than the input parallelism degree N of the circuit. In this case, it is conceivable to reduce the power consumption by shutting off the power supply so that the unused circuit does not operate. However, since Deep Learning is a very heavy process, it is more effective to shorten the processing time by utilizing the mounted circuit as much as possible.
  • Non-Patent Document 1 describes an example in which the number of iFMs in the first layer is 3, while the FPGA configuration is 7. Non-Patent Document 1 does not specifically mention how to operate it, but if only 3 out of 7 configurations are used, more than half of the mounted circuits are used. It will not be working.
  • Non-Patent Document 1 describes an example in which the number of oFMs in the second layer is 20, while the configuration of the FPGA is 64. There is no specific mention of how to operate it, but if only 20 out of 64 are used, it means that more than two-thirds of the mounted circuits are not operating.
  • the present invention shortens the processing time by enabling parallel processing to execute data necessary for executing pooling processing in an arithmetic processing unit that performs deep learning using a convolutional neural network.
  • An object of the present invention is to provide an arithmetic processing unit.
  • a first aspect of the present invention is an arithmetic processing apparatus for deep learning that performs Convolution processing and FullConnect processing, which is a data storage memory for storing input feature amount map data and data for managing and controlling the data storage memory.
  • a data storage memory management unit having a storage memory control unit; a filter coefficient storage memory management unit having a filter coefficient storage memory for storing filter coefficients and a filter coefficient storage memory control unit for managing and controlling the filter coefficient storage memory.
  • an external memory for storing the input feature amount map data and the output feature amount map data; a data input unit for acquiring the input feature amount map data from the external memory; and the filter coefficient from the external memory.
  • the input feature amount map data is acquired from the data storage memory in the configuration of the input N parallel and the output M parallel (a positive number of N, M ⁇ 1), and the filter coefficient storage memory is used to obtain the input feature amount map data.
  • An arithmetic unit that acquires a filter coefficient and performs filter processing, cumulative addition processing, non-linear arithmetic processing, and pooling processing; M parallel data output from the arithmetic unit is concatenated to obtain the external feature amount map data.
  • It has a data output unit that outputs data to a memory; a controller that controls the inside of the arithmetic processing device; the arithmetic unit includes a filter arithmetic unit that executes filter processing in N parallel, and N / k of the filter arithmetic unit. K first adders that cumulatively add up the calculation results, and k first adders that are provided after the first adder and branch the output of the first adder to the first processing side and the second processing side. The selector to be switched with, the second adder that cumulatively adds the results of the cumulative addition processing of k of the first adder when the selector branches to the first processing side, and the accumulation of the second adder.
  • a second pooling in which the results of the cumulative addition processing of the k first adders, which have been nonlinearly processed by the nonlinear conversion unit and the second nonlinear conversion unit, are input, and the pooling processing is performed on the simultaneously input data.
  • a processing unit an arithmetic control unit that controls the inside of the arithmetic unit, and When the number of input feature amount map data input to the calculation unit ⁇ N / k, the data storage memory management unit writes the same data to k different data storage memories, and controls the calculation.
  • the unit is an arithmetic processing device that controls the selector to branch to the second processing side when the number of input feature amount map data ⁇ N / k.
  • the data storage memory control unit controls to write the same data to the same address of k different data storage memories when writing to the data storage memory, and N / k the data storage memory.
  • Each group may be classified into k groups, and when reading from the data storage memory, the addresses may be changed in each group to control access to addresses that are vertically and / or horizontally offset by several pixels.
  • the data storage memory control unit writes the same data to addresses shifted by several pixels vertically and / or horizontally in k different data storage memories when writing to the data storage memory. You may control and access all the data storage memories with the same address when reading from the data storage memory.
  • a first aspect of the present invention is an arithmetic processing apparatus for deep learning that performs Convolution processing and FullConnect processing, which is a data storage memory for storing input feature amount map data and data for managing and controlling the data storage memory.
  • a data storage memory management unit having a storage memory control unit; a filter coefficient storage memory management unit having a filter coefficient storage memory for storing filter coefficients and a filter coefficient storage memory control unit for managing and controlling the filter coefficient storage memory.
  • an external memory for storing the input feature amount map data and the output feature amount map data; a data input unit for acquiring the input feature amount map data from the external memory; and the filter coefficient from the external memory.
  • the input feature amount map data is acquired from the data storage memory in the configuration of the input N parallel and the output M parallel (a positive number of N, M ⁇ 1), and the filter coefficient storage memory is used to obtain the input feature amount map data.
  • An arithmetic unit that acquires a filter coefficient and performs filter processing, cumulative addition processing, non-linear arithmetic processing, and pooling processing; M parallel data output from the arithmetic unit is concatenated to obtain the external feature amount map data.
  • It has a data output unit that outputs data to a memory; a controller that controls the inside of the arithmetic processing device; the arithmetic unit includes a filter arithmetic unit that executes filter processing in N parallel, and N / k of the filter arithmetic unit. K first adders that cumulatively add up the calculation results, and k first adders that are provided after the first adder and branch the output of the first adder to the first processing side and the second processing side. The selector to be switched with, the second adder that cumulatively adds the results of the cumulative addition processing of k of the first adder when the selector branches to the first processing side, and the accumulation of the second adder.
  • a second linear that is provided after the processing unit and the second pooling processing unit and performs non-linear arithmetic processing on the result of the cumulative addition processing of the first adder that is pooled by the second pooling processing unit.
  • a conversion unit and an arithmetic control unit that controls the inside of the arithmetic unit.
  • the data storage memory management unit writes the same data to k different data storage memories when the number of input feature amount map data input to the calculation unit ⁇ N / k, and the calculation
  • the control unit is an arithmetic processing device that controls the selector to branch to the second processing side when the number of input feature amount map data ⁇ N / k.
  • the first nonlinear conversion unit and the second linear conversion unit may have the same configuration, or may be shared by the first processing side and the second processing side.
  • the second pooling processing unit performs pooling processing separately in the vertical direction and the horizontal direction with respect to the scanning direction, and a trigger signal is input to each of the vertical pooling processing and the horizontal pooling processing.
  • the operation control unit may output the trigger signal at a preset timing.
  • the processing time can be shortened by enabling the data required for executing the pooling process to be executed in parallel processing. Can be done.
  • FIG. 1 is an image diagram of obtaining an output feature amount map (oFM) from an input feature amount map (iFM) by Convolution processing.
  • oFM output feature amount map
  • iFM input feature amount map
  • Convolution processing all the input iFM data are subjected to different filter coefficients (filter process), all of them are cumulatively added, and processing such as non-linear conversion and pooling (reduction process) is performed to obtain oFM data.
  • the information (iFM data and filter coefficient) of all pixels in the vicinity of the coordinates of the iFM data corresponding to the output (1 pixel of oFM) is the information required to calculate 1 pixel (1 pixel) of the oFM data. is necessary.
  • FIG. 2 is a block diagram showing an overall configuration of the arithmetic processing unit according to the present embodiment.
  • the arithmetic processing device 1 includes a controller 2, a data input unit 3, a filter coefficient input unit 4, an IBUF (data storage memory) management unit 5, a WBUF (filter coefficient storage memory) management unit 6, and an arithmetic unit (calculation).
  • a block) 7 and a data output unit 8 are provided.
  • the data input unit 3, the filter coefficient input unit 4, and the data output unit 8 are connected to the DRAM (external memory) 9 via the bus 10.
  • the arithmetic processing unit 1 generates an output feature amount map (oFM) from the input feature amount map (iFM).
  • oFM output feature amount map
  • the IBUF management unit 5 has an input feature amount map (iFM) data storage memory (data storage memory, IBUF) and a data storage memory management / control circuit (data storage memory control unit). Each IBUF is composed of a plurality of SRAMs.
  • iFM input feature amount map
  • IBUF data storage memory
  • data storage memory management / control circuit data storage memory control unit
  • the IBUF management unit 5 counts the number of valid data in the input data (iFM data), converts it into coordinates, further converts it into an IBUF address (address in IBUF), stores the data in IBUF, and determines it.
  • the iFM data is retrieved from the IBUF by the method.
  • the WBUF management unit 6 has a memory for storing the filter coefficient (filter coefficient storage memory, WBUF) and a management / control circuit for the filter coefficient storage memory (filter coefficient storage memory control unit).
  • the WBUF management unit 6 refers to the status of the IBUF management unit 5 and extracts the filter coefficient corresponding to the data extracted from the IBUF management unit 5 from the WBUF.
  • the DRAM 9 stores iFM data, oFM data, and filter 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. Specifically, the data output unit 8 concatenates the M parallel data output from the calculation unit 7 and outputs the data to the DRAM 9.
  • the filter coefficient input unit 4 acquires the filter coefficient from the DRAM 9 by a predetermined method and passes it to the WBUF (filter coefficient storage memory) management unit 6.
  • the calculation unit 7 acquires data from the IBUF (data storage memory) management unit 5 and filter coefficients from the WBUF (filter coefficient storage memory) management unit 6, and performs data processing such as filter processing, cumulative addition, non-linear calculation, and pooling processing. I do.
  • the data (cumulative addition result) subjected to data processing by the calculation unit 7 is stored in the DRAM 9 via the data output unit 8.
  • the controller 2 controls the entire circuit.
  • processing for the required number of layers is repeatedly executed in a plurality of processing layers. Then, the arithmetic processing device 1 outputs the subject estimation result as the final output data, and obtains the subject estimation result by processing the final output data using a processor (may be a circuit).
  • FIG. 3 is a diagram showing a configuration of a calculation unit 7 of the calculation processing unit according to the present embodiment.
  • the number of input channels of the arithmetic unit 7 is N (N is a positive number of 1 or more), and N-dimensional input data is processed in parallel (input N parallel).
  • the number of output channels of the arithmetic unit 7 is M (M is a positive number of 1 or more), and M-dimensional data is output in parallel (output M parallel).
  • iFM data (d_0 to d_15) and filter coefficients (k_0 to k_15) are input, and one oFM data is output. This process is performed in parallel with the M layer (M surface), and M oFM data (oCh_0 to oCh_M-1) are output.
  • the arithmetic unit 7 has a configuration in which the number of input channels is N, the number of output channels is M, and the degree of parallelism is N ⁇ M. Since the sizes of the number of input channels N and the number of output channels M can be set (changed) according to the size of the CNN, they are appropriately set in consideration of the processing performance and the circuit scale.
  • the calculation unit 7 includes a calculation control unit 71 that controls each unit in the calculation unit. Further, the calculation unit 7 includes a filter calculation unit 72, k first adders 81, a selector 82, a second adder 83, a third adder 74, and FF (for each layer (face)). A flip-flop) 75, a first non-linear conversion unit 76, a first pooling processing unit 77, a second non-linear conversion unit 86, and a second pooling processing unit 87 are provided. The same circuit exists for each layer (face), and there are M such circuits (faces).
  • the filter calculation unit 72 is internally configured so that the multiplier and the adder can be executed in N parallel at the same time, filters the input data, and outputs the result of the filter processing in N parallel.
  • Each of the first adders 81 cumulatively adds N / k filter processing results in the filter calculation unit 72.
  • a selector 82 is provided after the first adder 81, and the output of the first adder 81 is branched and switched.
  • the switching condition depends on which of the iFM number and N / k input to the calculation unit 7 is larger. In the example of FIG. 3, there are k selectors 82 corresponding to each first adder 81, but the output of the first adder 81 may be configured to be commonly switched by one selector 82.
  • the arithmetic control unit 71 sets and controls to switch the selector 82 so as to perform normal processing (first processing). Specifically, the selector 82 is switched so that the output of the first adder 81 is input to the second adder 83.
  • the second adder 83 cumulatively adds the results of the cumulative addition processing of the k input first adders 81. That is, during normal processing, the first adder 81 divides N (16 in FIG. 3) input channels into k (4 in FIG. 3) and performs the first addition, and the second addition is performed.
  • the device 83 adds all the inputs in the second addition.
  • the third adder 74 cumulatively adds the result of the cumulative addition process of the second adder 83, which is input in a time division manner, at a later stage.
  • An FF75 for holding the result of cumulative addition is provided in the subsequent stage of the third adder 74.
  • the first non-linear conversion unit 76 performs non-linear arithmetic processing by an Activate function or the like on the result of cumulative addition in the third adder 74 and FF75.
  • the specific implementation is not specified, but for example, nonlinear arithmetic processing is performed by polygonal line approximation.
  • the first pooling processing unit 77 selectively outputs the maximum value (maximum value pooling) from a plurality of data input from the first nonlinear conversion unit 76, calculates the average value (mean value pooling), and the like. Perform processing.
  • the processing in the first nonlinear conversion unit 76 and the first pooling processing unit 77 can be omitted by the arithmetic control unit 71.
  • the arithmetic control unit 71 sets and controls to switch the selector 82 so as to perform parallel processing (second processing).
  • the parallel processing refers to a process of executing the data necessary for executing the pooling process in parallel with the normal process by utilizing the non-operating circuit. As a result, the processing time can be shortened and the arithmetic processing can be speeded up.
  • the selector 82 is switched so that the output of the first adder 81 is input to the second nonlinear conversion unit 86.
  • the second non-linear conversion unit 86 performs non-linear conversion (non-linear processing) such as an Activate function on the result of the cumulative addition processing of k first adders 81.
  • the second pooling processing unit 87 inputs the results of the cumulative addition processing of k first adders 81, which have been nonlinearly processed by the second nonlinear conversion unit 86, and performs pooling processing on the simultaneously input data. ..
  • the output of the first adder 81 is sent to the parallel processing side, individual non-linear conversion is performed, and then k (4 in FIG. 3) data simultaneous input pooling.
  • the process is executed.
  • the pooling process in the case of mean value pooling, it is added and divided by k (4 in FIG. 3) (2-bit shift), and in the case of max pooling, the maximum value is acquired.
  • FIG. 4 is a diagram showing an image of the pooling process.
  • the filter processing creates four pieces of 3 ⁇ 3 pixel data.
  • the configuration of FIG. 3 described above since there are four second nonlinear conversion units 86 (generally k), the data necessary for executing the pooling process can be executed in parallel with the normal process. Therefore, when the input channel is free, the data generation required for pooling can be executed at once in parallel with the normal processing.
  • the first non-linear conversion unit 76 can be used as the second non-linear conversion unit 86 by switching with the selector 82. It may be.
  • FIG. 5 is a diagram showing the configuration of such a calculation unit 7.
  • One of the four selectors 82 (selector 82') is connected to the input of the first nonlinear conversion unit 76 via the selector 84. Then, the output of the first nonlinear conversion unit 76 is connected to the selector 85 so that the output destination can be selected from the first pooling processing unit 77 and the second pooling processing unit 87.
  • the arithmetic control unit 71 sets and controls to switch the selector 82 so as to perform normal processing (first processing). That is, the selector 82 is switched so that the output of the first adder 81 is input to the second adder 83.
  • the second adder 83 cumulatively adds the results of the cumulative addition processing of the k first adders 81 that have been input, and the third adder 74 is the cumulative addition of the second adder 83 that is input in a time-divided manner.
  • the processing results are cumulatively added in the latter stage.
  • An FF75 for holding the result of cumulative addition is provided in the subsequent stage of the third adder 74.
  • a selector 84 is provided between the FF 75 and the first non-linear conversion unit 76, and the input of the first non-linear conversion unit 76 can be switched between the normal processing side and the parallel processing side.
  • the first nonlinear conversion unit 76 performs nonlinear arithmetic processing by an Activate function or the like on the result of cumulative addition in the third adder 74 and FF75.
  • a selector 85 is provided after the first nonlinear conversion unit 76, and the output of the first nonlinear conversion unit 76 can be switched between the normal processing side and the parallel processing side.
  • the data processed by the first nonlinear conversion unit 76 is input to the first pooling processing unit 77.
  • the first pooling processing unit 77 selectively outputs the maximum value (maximum value pooling) from a plurality of data input from the first nonlinear conversion unit 76, calculates the average value (mean value pooling), and the like. Perform processing.
  • the arithmetic control unit 71 sets and controls to switch the selector 82 so as to perform parallel processing (second processing). That is, the selector 82 is switched so that the output of the first adder 81 is input to the second nonlinear conversion unit 86.
  • one of the four selectors 82 (selector 82') is connected to the input of the first nonlinear conversion unit 76 via the selector 84. That is, the output of one of the four first adders 81 (first adder 81') is input to the first nonlinear conversion unit 76.
  • the second non-linear conversion unit 86 performs non-linear conversion (non-linear processing) such as an Activate function on the result of the cumulative addition processing of (k-1) pieces (three in FIG. 5) of the first adder 81.
  • the first non-linear conversion unit 76 performs non-linear conversion (non-linear processing) such as an Activate function on the result of the cumulative addition processing of the first adder 81'.
  • the selector 85 is switched so that the output of the first nonlinear conversion unit 76 is input to the second pooling processing unit 87.
  • the second pooling processing unit 87 includes k (4 in FIG. 5) first adders 81 (first adders 81') that have been non-linearly processed by the second non-linear conversion unit 86 and the first non-linear conversion unit 76.
  • the result of the cumulative addition process (including) is input, and the pooling process is performed on the data input at the same time.
  • the number of the second nonlinear conversion units 86 can be reduced by one, and the circuit configuration can be reduced.
  • FIG. 6 is a diagram showing the configuration of the IBUF (data storage memory) management unit 5 of the present embodiment.
  • the IBUF management unit 5 includes an IBUF storage unit 51 that stores data in an IBUF (data storage memory), an IBUF array 52 in which a plurality of IBUFs are arranged, and an IBUF reading unit 53 that reads data from the IBUF.
  • the IBUF storage unit 51 and the IBUF reading unit 53 are included in the above-mentioned data storage memory control unit.
  • the IBUF storage unit 51 When iFM data is input, the IBUF storage unit 51 counts the number of valid data in the input data and converts it into coordinates (coordinate generation), further converts it into an IBUF address (address conversion), and iFM data (iFM data (address conversion). Store in IBUF together with data).
  • the data storage memory control unit of the IBUF management unit 5 controls writing to the IBUF and reading from the IBUF, and this control has several modes. The following is the control in the case of one mode (first mode).
  • first mode When the number of iFMs ⁇ N / k, the IBUF storage unit 51 classifies the IBUFs into k groups by N / k, and when writing to the IBUF, k to the same address of k different IBUFs belonging to different groups. Write the same data.
  • the IBUF storage unit 51 divides the IBUF (IBUF0 to IBUF15) into the following four groups. ⁇ IBUF0-3 ⁇ IBUF4-7 ⁇ IBUF8-11 ⁇ IBUF12 ⁇ 15
  • FIG. 7 is a diagram showing in detail the we-generating portion of the IBUF storage unit 51 of FIG. As a result, the same data as IBUF 0 to 3 is duplicated in IBUF 4 to 7, IBUF 8 to 11, and IBUF 12 to 15.
  • the IBUF reading unit 53 reads a portion shifted by one pixel (or several pixels) vertically and / or horizontally when reading from the IBUF. This can be achieved by changing the addressing of each group during data access and accessing addresses that are offset by several pixels vertically and / or horizontally. For example, by generating one address for each of IBUF0 to 3, IBUF4 to 7, IBUF8 to 11, and IBUF12 to 15, data is generated from a position shifted by one pixel vertically and / or horizontally as shown on the left of FIG. Can be read.
  • IBUF storage unit 51 classifies IBUFs into k groups of N / k each. Then, when writing to the IBUF, the IBUF storage unit 51 writes the same data in k different IBUFs belonging to different groups to addresses shifted by several pixels (for example, one pixel) vertically and / or horizontally. That is, the data is written so that data shifted by several pixels (for example, one pixel) is stored at the same address in each group.
  • the IBUF reading unit 53 does not change the access address when reading from the IBUF, and accesses all the IBUFs with the same address. Since it can be read from the same address, reading becomes easier.
  • the we generation at the time of writing is the same as the above example, and the writing address is generated so as to be shifted by one pixel at IBUF0 to 3, IBUF4 to 7, IBUF8 to 11, and IBUF12 to 15. By doing so, the address at the time of reading can be shared.
  • FIG. 8 is a diagram showing the relationship between the input (x1 to x4) and the output (f (x1) to f (x4)) of the non-linear conversion unit when the non-linear conversion f (x) is a monotonically increasing function.
  • the non-linear transformation f is a monotonically increasing function
  • the maximum value pooling process and the non-linear transformation f can be interchanged. Therefore, if the condition that the non-linear conversion characteristic is a monotonically increasing function and the pooling process is only the maximum value pooling process is satisfied, the non-linear process may be performed on one data after the pooling process.
  • the circuit scale can be further reduced.
  • FIG. 9 and 10 are diagrams showing the configuration of the calculation unit 7 in which the order of the non-linear processing and the pooling processing is exchanged in this way.
  • the order of the pooling process (second pooling processing unit 87) of the parallel processing side path and the non-linear conversion is changed, and the parallel processing side path and the normal processing side path operate exclusively to the normal processing side.
  • the non-linear conversion unit 76 of the above is shared by the parallel processing and the normal processing. Specifically, the output of the second pooling processing unit 87 on the parallel processing side and the output of the FF75 on the normal processing side are switched by the selector 88 and input to the non-linear conversion unit 76. With such a configuration, the processing speed is quadrupled by increasing the maximum value extraction circuit by one.
  • the non-linear conversion unit 76 When the non-linear conversion unit 76 is not shared, for example, in FIG. 3, the order of the second non-linear conversion unit 86 and the second pooling processing unit 87 is changed, and as shown in FIG. 10, the second pooling processing unit 87 is placed after the second pooling processing unit 87. 2
  • the non-linear conversion unit 86 may be provided.
  • FIG. 11 is a diagram showing the configuration of the second pooling processing unit 87 when the pooling processing is performed separately in the vertical direction and the horizontal direction with respect to the scanning direction. It is assumed that the configuration of the entire calculation unit 7 is as shown in FIG.
  • the pooling process passes through the upper path in the second pooling process unit 87 shown in FIG. 11, and the same pooling process as the method described above is performed. ..
  • the pooling process passes through the lower path in the second pooling process unit 87 of FIG. That is, the pooling process is performed separately in the vertical direction and the horizontal direction with respect to the scanning direction.
  • the data to be input at the same time is only one of the vertical direction and the horizontal direction, and all the data necessary for the pooling process is input over several cycles.
  • the vertical pooling process and the horizontal pooling process are executed at the timing when the trigger signal is input, respectively.
  • the arithmetic control unit 71 outputs a trigger signal for executing the vertical pooling process and the horizontal pooling process at a preset timing.
  • the four input ports of the second pooling processing unit 87 are the addition results for FM4 surfaces, and two of them are added. Therefore, the two ports immediately before the vertical pooling processing are the addition results for FM8 surfaces. Become. By pooling in the vertical and horizontal directions with such a configuration, it is possible to execute two FMs in parallel for up to eight FM surfaces.
  • FIG. 12 is a diagram showing in detail the we generation portion of the IBUF management unit 5.
  • the maximum value is extracted by both the vertical pooling processing unit and the horizontal pooling processing unit.
  • the vertical pooling process section / horizontal pooling process section produces two addition results, but the horizontal pooling process section finally divides by 4 (2-bit shift) to obtain the average value. You can get it.
  • a second embodiment of the present invention will be described.
  • the processing time is shortened by avoiding the redundant processing that occurs in the sixth layer of Yoro_tiny_v2, which is one of the variations of the CNN.
  • the processing in the second pooling processing unit 87 is different from that in the first embodiment, and the other basic configurations are the same as those in the first embodiment. Therefore, only the processing in the second pooling processing unit 87 will be described below.
  • FIG. 13A and 13B are diagrams showing the iFM processing process when the kernel size of the filter processing is 3 ⁇ 3 and the pooling processing unit is 2 ⁇ 2.
  • iFM is processed so as not to overlap when viewed as a result after filtering. Since the pooling processing unit is 2 ⁇ 2, the iFM is output in half the vertical and horizontal sizes by the pooling processing. This is a movement on the premise that the center of gravity of the pixel during the pooling process moves in units of 2 pixels, which is the same as the unit of pooling processing.
  • stride 2.
  • FIG. 14 is a diagram showing the configuration of the second pooling processing unit 87 of the present embodiment. Separately in the vertical direction and the horizontal direction with respect to the scanning direction of the process, each of them receives an execution pulse from the arithmetic control unit and operates so as to execute the pooling process. That is, each of the vertical pooling processing unit that performs the vertical pooling processing and the horizontal pooling processing unit that performs the horizontal pooling processing performs the pooling processing at the timing when the trigger (execution pulse) is input.
  • the arithmetic control unit 71 outputs a trigger signal for executing the horizontal pooling process and the vertical pooling process at a preset timing.
  • FIG. 15 is a diagram showing a pixel image of FM after non-linear conversion (after filtering).
  • the maximum value is taken in the case of maximum value pooling, and in the case of average value pooling, it is added and divided by the number of pixels when all is completed.
  • the larger of D11 and D21 is selected in the case of maximum value pooling, and D11 + D21 is calculated in the case of mean value pooling.
  • the horizontal pooling result o1 select the larger of p1 and p2 in the case of maximum value pooling, and calculate (p1 + p2) ⁇ 4 in the case of mean value pooling.
  • the number of data to be processed at one time is reduced, so the number of FFs for waiting can be reduced, the maximum value calculation (or total addition) circuit can be reduced, and the circuit scale can be reduced. Can be made smaller.
  • a third embodiment of the present invention will be described.
  • a method of effectively utilizing the unused portion when there is an unused circuit on the input side of the arithmetic unit has been proposed, but in the third embodiment, the unused circuit on the output side of the arithmetic unit has been proposed. Regarding how to effectively utilize the unused part when there is.
  • the basic operation of the calculation unit is to generate one oFM by inputting all iFMs, but one oFM may be created by sharing it among a plurality of output channel groups.
  • FIG. 19 is an image diagram in which two output channel groups (output channel A and output channel B) are shared to create one oFM.
  • the left figure of FIG. 19 shows an example (line sharing) of sharing oFM in line units (odd line and even line), and the right figure of FIG. 19 shows an example of sharing oFM.
  • An example (region sharing) in which the oFM is divided into left and right regions and shared is shown.
  • the degree of output parallelism is M and the number of oFMs is ⁇ M / 2
  • one oFM can be divided into a plurality of regions, and each region can be shared and processed by a plurality of output channel groups.
  • one oFM data is output by combining the outputs from the two different output channel groups. Therefore, it is necessary to define a format that can integrate the outputs from two different output channel groups so that the input in the next layer becomes one FM data.
  • the odd-numbered lines and the even-numbered lines of the oFM are shared and processed by the two output channel groups as shown in the left figure of FIG.
  • the number of output channel groups sharing one oFM is not limited to two, and may be shared by three or four output channel groups.
  • FIG. 20 is a diagram showing a configuration on the output side of the IBUF (data storage memory) management unit 5 of the present embodiment.
  • IBUF data storage memory
  • a DBUF 57 (second data storage memory) for temporarily storing the data is prepared, and the data is first transferred from the IBUF to the DBUF.
  • the first control unit 56 in the previous stage of the DBUF 57 divides the oFM into a plurality of regions, extracts data necessary for processing each region, and writes the data in the DBUF 57.
  • the data for odd-numbered lines is stored in DBUFodd
  • the data for even-numbered lines is stored in DBUFeven.
  • the output channel oCh. 0-oCh. (2 / M-1) belongs to the output channel group in the first half, and the output channel oCh. (2 / M-1) -oCh. It is assumed that (M-1) belongs to the output channel group in the latter half. Then, it is assumed that the output channel group in the first half processes the odd-numbered lines of oFM, and the output channel group in the second half processes the even-numbered lines of oFM.
  • the IBUF reading unit 53 transfers the data stored in the DBUFodd to the output channel group in the first half as data (data_odd) required for odd-numbered line processing. Similarly, the IBUF reading unit 53 transfers the data stored in the DBUFeven to the output channel group in the latter half as data (data_even) required for even-numbered line processing.
  • FIG. 21 is a diagram showing a data storage image in DBUFodd and DBUFeven.
  • the iFM required to generate the first line of the oFM is the area of the first line and the second line on the iFM, and the iFM required to generate the second line of the oFM is on the iFM. This is the area of the second line and the third line. That is, since there is an overlapping region on the iFM, that portion is stored in both DBUFodd and DBUFeven.
  • each DBUF 57 the data required for generating the oFM1 pixel is sequentially read from the data stored in the DBUF 57.
  • the second control unit 58 controls to acquire data from the DBUF 57 by a predetermined method. By this read control, data_odd is supplied to the output channel group in the first half, and data_even is supplied to the output channel group in the second half.
  • FIG. 22 is a diagram showing an image of the difference in position on the iFM processed by the two output channel groups.
  • the left side of FIG. 22 shows the position to be processed by the output channel group in the first half, and the right side of FIG. 22 shows the position to be processed by the output channel group in the latter half.
  • FIG. 23A and 23B are image diagrams of oFM data output from the calculation unit.
  • FIG. 23A shows the case of normal processing, that is, the case where one oFM is processed by one output channel group.
  • one oFM consists of M FMs (oFM0, oFM1, oFM2, ...), Each from M output channels (oCh.0, oCh.1, oCh.2, ). The data at the same position of FM is output.
  • FIG. 23B shows a case where one oFM is processed by dividing the line between two output channel groups.
  • the output channels (oCh.0, oCh.1, oCh.2, ..., OCh.M / 2-1) of the output channel group in the first half output the data at the same position of each FM.
  • the output channels (oCh.M / 2, oCh.M / 2 + 1, oCh.M / 2 + 2, ..., OCh.M-1) of the output channel group in the latter half output the data at the position shifted by one line of each FM.
  • the output channel group in the first half and the output channel group in the second half output data at positions shifted by one line on the same oFM.
  • An operation selection signal (mode) is input to the unit 3 to switch the control.
  • D (k) is changed to oCh.
  • D0_16 is defined as all oCh. It is defined as concatenating the data (D (0) to D (16-1)) output from.
  • FIG. 24 is a diagram showing a flow from the processing of the k-th layer to the processing of the (k + 1) layer during the normal processing.
  • the output of the calculation unit of the k-th layer only the first half portion of D0_16 is valid, and the second half portion of D0_16 is in an unused state.
  • D0_16 in this state is input to the (k + 1) layer. If D0_16 can be acquired by one burst transfer, unused data will be input, resulting in poor transfer efficiency.
  • FIG. 25 is a diagram showing a flow from the processing of the k-th layer to the processing of the (k + 1) layer during the line sharing processing.
  • the latter half portion that was unused during normal processing also has the same iFM data (data at a position shifted one line below) as the first half portion.
  • D0_16N stored in the IBUF storage unit is divided into two data and output to the IBUF separately.
  • FIG. 26A and 26B are diagrams showing images of writing specific data to IBUF.
  • FIG. 26A shows the time of line sharing processing
  • FIG. 26B shows the time of area sharing processing.
  • the addressing is performed so as to shift downward by one pixel.
  • the addressing is also shifted by half a line.
  • FIG. 27 is a diagram showing the overall configuration of the IBUF management unit 5 of the present embodiment.
  • the IBUF storage unit 51 includes a control unit 54 that determines the mode and changes the control, and a data retention / selector unit 55.
  • the control unit 54 has a mode in which iFMs input in the same cycle are held and controlled so as to be divided into several cycles and written to the same IBUF.
  • the processing can be parallelized and the execution time can be shortened when the number of oFMs ⁇ M / 2.
  • the configuration in the IBUF storage unit 51 is the same as that in FIG.
  • the IBUF reading unit 53 uses paths (data2, req2) for directly extracting IBUF data without going through the DBUF 57 during normal processing.
  • one FM can be simultaneously processed by a plurality of output channel groups, and the data can be restored at the time of input to the next layer, and the processing time can be increased.
  • Each component is for explaining the function and processing 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 more processors, a logic circuit, a memory, an input / output interface, a computer-readable recording medium, and the like, respectively or as a whole.
  • the above-mentioned various functions and processes are realized by recording a program for realizing each component or the entire function on a recording medium, reading the recorded program into a computer system, and executing the program. You may.
  • 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 an ASIC (Application Specific Integrated Circuit) and an FPGA (Field-Programmable Gate Array).
  • the "computer system” here may include hardware such as an OS and peripheral devices. Further, the “computer system” includes a homepage providing environment (or a display environment) if a WWW system is used.
  • the "computer-readable recording medium” includes a flexible disk, a magneto-optical disk, a ROM, a writable non-volatile memory such as a flash memory, a portable medium such as a CD-ROM, a hard disk built in a computer system, and the like. Refers to the storage device of.
  • the "computer-readable recording medium” is a volatile memory inside a computer system that serves as a server or client when a program is transmitted via a network such as the Internet or a communication line such as a telephone line (for example, DRAM (Dynamic)). It also includes those that hold the program for a certain period of time, such as Random Access Memory)).
  • the above program may be transmitted from a computer system in which this program is stored 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 a program means 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 above program may be for realizing a part of the above-mentioned functions. Further, it may be a so-called difference file (difference program) that realizes the above-mentioned function in combination with a program already recorded in the computer system.
  • the present invention can be widely applied to an arithmetic processing unit that performs deep learning using a convolutional neural network.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Algebra (AREA)
  • Neurology (AREA)
  • Medical Informatics (AREA)
  • Multimedia (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Image Processing (AREA)

Abstract

演算処理装置において、演算制御部は、セレクタが第2処理側に分岐した場合に、第1加算器の累積加算処理の結果に対して非線形演算処理を行う第2非線形変換部と、前記第2非線形変換部で非線形処理された、k個の前記第1加算器の累積加算処理の結果が入力され、同時に入力されたデータに対してプーリング処理を行う第2プーリング処理部と、を有する。データ格納メモリ管理部は、演算部に入力される入力特徴量マップデータの数≦N/kの時に、k個の異なるデータ格納メモリに同じデータを書き込む。前記演算制御部は、前記入力特徴量マップデータの数≦N/kの時は、前記セレクタが前記第2処理側に分岐するよう制御する。

Description

演算処理装置
 本発明は、演算処理装置、より詳しくは、畳み込みニューラルネットワークを用いたディープラーニングを行う演算処理装置の回路構成に関する。
 従来、複数の処理層が階層的に接続されたニューラルネットワークを用いて演算を実行する演算処理装置がある。特に画像認識を行う演算処理装置では、畳み込みニューラルネットワーク(Convolutional Neural Network、以下CNNという)を用いたディープラーニングが広く行われている。
 図28は、CNNを用いたディープラーニングによる画像認識の処理の流れを示す図である。CNNを用いたディープラーニングによる画像認識では、入力された画像データ(ピクセルデータ)に対して、CNNの複数の処理層における処理が順次施されることにより、画像に含まれる対象物が認識された最終的な演算結果データが得られる。
 CNNの処理層は、畳み込み演算処理、非線形処理、縮小処理(プーリング処理)等を含むConvolution処理を行うConvolution層と、全ての入力データ(ピクセルデータ)にフィルタ係数を乗じて累積加算するFullConnect処理を行うFullConnect層(全結合層)とに大きく分類される。ただし、FullConnect層がない畳み込みニューラルネットワークも存在する。
 CNNを用いたディープラーニングによる画像認識は以下のようにして行われる。まず、画像データに対して、ある領域を抽出してフィルタ係数の異なる複数のフィルタを乗じて特徴量マップ(Feature Map、FM)を作成する畳み込み演算処理と、特徴量マップの一部領域を縮小する縮小処理(プーリング処理)の組合せを1つの処理層として、これを複数回(複数の処理層において)行う。これらの処理が、Convolution層の処理である。
 プーリング処理は、近傍4ピクセルの最大値を抽出して1/2×1/2に縮小するmax poolingの他、近傍4ピクセルの平均値を求める(抽出ではない)average poolingなどのバリエーションがある。
 図29は、Convolution処理の流れを示す図である。最初に、画像データから1ピクセルおよびその近傍のピクセル(図29の例では近傍8ピクセル)を抽出して、夫々にフィルタ係数の異なるフィルタ処理を行い(畳み込み演算処理)、これらを全て累積加算することにより、1ピクセルに対応するデータができる。作成されたデータに対し、非線形変換および縮小処理(プーリング処理)を行い、以上の処理を画像データの全ピクセルに対して行うことで、出力特徴量マップ(oFM)が1面分生成される。これを複数回繰り返すことでoFMを複数面生成する。実際の回路では上記全てがパイプライン処理される。
 生成された出力特徴量マップ(oFM)を、次のConvolution処理の入力特徴量マップ(iFM)として、さらにフィルタ係数の異なるフィルタ処理を行うことにより、Convolution処理を繰り返す。このようにして複数回のConvolution処理を行い、出力特徴量マップ(oFM)を得る。
 Convolution処理が進み、特徴量マップ(FM)をある程度まで小さくしたところで、画像データを1次元のデータ列と読み変える。この1次元のデータ列の各データに対して、各々異なる係数を乗じて累積加算を行うFullConnect処理を複数回(複数の処理層において)行う。これらの処理が、全結合層(FullConnect層)の処理である。
 そして、FullConnect処理の後、最終的な演算結果である被写体推定結果として、画像に含まれる対象物が検出された確率(被写体検出の確率)が出力される。図28の例では、最終的な演算結果データとして、犬が検出された確率は0.01(1%)、猫が検出された確率は0.04(4%)、ボートが検出された確率は0.94(94%)、鳥が検出された確率は0.02(2%)である。
 このようにして、CNNを用いたディープラーニングによる画像認識は、高い認識率を実現できる。しかし、検出する被写体の種類を増やしたり、被写体検出精度を上げるためには、ネットワークを大きくする必要がある。そうするとデータ格納バッファやフィルタ係数格納バッファが必然的に大容量になるが、ASIC(Application Specific Integrated Circuit)にはあまり大容量のメモリを搭載できない。
 また、画像認識処理におけるディープラーニングでは、(K-1)層目とK層目におけるFM(Feature Map)サイズとFM数(FMの面数)の関係は次式のような関係になる場合が多く、回路としてメモリサイズを決定する際には最適化が困難である。
 FMサイズ[K]=1/4×FMサイズ[K-1]
 FM数[K]=2×FM数[K-1]
 例えば、CNNのバリエーションの1つであるYolo_v2に対応可能な回路のメモリのサイズを考える場合、FMサイズとFM数の最大値だけで決定しようとすると1GB程度必要となる。実際には、FM数とFMサイズは反比例的関係があるため、計算上メモリは3MB程度あれば十分ではあるが、電池駆動のモバイル機器に搭載するASICとしては、できるだけ消費電力やチップコストを小さくしたいニーズがあるため、メモリを極力小さくする工夫が必要となってくる。
 このような問題があることから、CNNは一般的には高性能PCやGPU(Graphics Processing Unit)を用いたソフトウエア処理で実装される。しかし、CNNの高速処理を実現するためには処理の重い部分をハードウェアで構成する必要がある。このようなハードウェア実装の例が、非特許文献1に記載されている。非特許文献1は、FPGA(Field-Programmable Gate Array)プラットフォームをベースとしたディープCNN用のアクセラレータを開示している。
Optimizing FPGA-based Accelerator Design FOR Deep Convolutional Neural Networks, Proceedings OF the 2015 ACM/SIGDA International Symposium on Field-Programmable Gate Arrays
 CNNの浅い層では、iFM数(iFMの面数)が回路の入力並列度Nより極端に少なくなることがある。この場合、使わない回路が動作しないように電源遮断するなどで消費電力を削減することも考えられる。しかし、DeepLearningは大変重い処理であるから、搭載されている回路をできるだけ活用して処理時間を短くする方がより有効である。
 非特許文献1では、1層目のiFM数が3個であるのに対しFPGAのコンフィギュレーションは7個である例が記載されている。非特許文献1では、具体的にどのように動作させるかについての言及がないが、仮に7個のコンフィギュレーションのうちの3個しか使用していないとすると、搭載されている回路の半分以上が動作していないことになる。
 出力側についても、非特許文献1では、2層目のoFM数が20であるのに対しFPGAのコンフィギュレーションは64である例が記載されている。具体的にどのように動作させるかについての言及はないが、仮に64のうち20しか使っていないとすると、搭載されている回路の2/3以上が動作していないことになる。
 また、プーリング処理では、例えば2×2の最大値プーリング処理の場合、入力された4個のデータから最大値を1個だけ抽出する。これによりデータレートは1/4となり、処理後のFMサイズは縦・横半分のサイズになる。しかし設定によっては、同じ位置データを重複処理して、結果的にデータレートが変化せず、FMのサイズが変化しないことがある。これを他の層と同じように画一的に処理すると、演算部での処理時間が4倍に増えることになり、動画対応のような高速処理をする上で問題となる。非特許文献1では、このような速度低下への対策について言及していない。
 上述の事情を踏まえ、本発明は、畳み込みニューラルネットワークを用いたディープラーニングを行う演算処理装置において、プーリング処理の実行に必要なデータを並列処理で実行できるようにすることで、処理時間を短縮する演算処理装置を提供することを目的とする。
 本発明の第一の態様は、Convolution処理とFullConnect処理を行うディープラーニング用の演算処理装置であって、入力特徴量マップデータを格納するデータ格納メモリと、前記データ格納メモリを管理および制御するデータ格納メモリ制御部とを有するデータ格納メモリ管理部と;フィルタ係数を格納するフィルタ係数格納メモリと、前記フィルタ係数格納メモリを管理および制御するフィルタ係数格納メモリ制御部とを有するフィルタ係数格納メモリ管理部と;前記入力特徴量マップデータおよび出力特徴量マップデータを格納する外部メモリと;前記外部メモリから、前記入力特徴量マップデータを取得するデータ入力部と;前記外部メモリから、前記フィルタ係数を取得するフィルタ係数入力部と;入力N並列、出力M並列の構成(N、M≧1の正数)で、前記データ格納メモリから前記入力特徴量マップデータを取得し、前記フィルタ係数格納メモリから前記フィルタ係数を取得して、フィルタ処理、累積加算処理、非線形演算処理およびプーリング処理を行う演算部と;前記演算部から出力されるM並列のデータを連結して、出力特徴量マップデータとして前記外部メモリに出力するデータ出力部と;前記演算処理装置内を制御するコントローラと;を有し、前記演算部は、N並列でフィルタ処理を実行するフィルタ演算部と、前記フィルタ演算部のN/k個の演算結果を累積加算するk個の第1加算器と、前記第1加算器の後段に設けられ、前記第1加算器の出力を分岐して、第1処理側と第2処理側とで切り替えるセレクタと、前記セレクタが前記第1処理側に分岐した場合に、k個の前記第1加算器の累積加算処理の結果を累積加算する第2加算器と、前記第2加算器の累積加算処理の結果を後段で累積加算する第3加算器と、前記第3加算器の累積加算処理の結果に対して非線形演算処理を行う第1非線形変換部と、前記第1非線形変換部の処理結果に対してプーリング処理を行う第1プーリング処理部と、前記セレクタが前記第2処理側に分岐した場合に、前記第1加算器の累積加算処理の結果に対して非線形演算処理を行う第2非線形変換部と、前記第2非線形変換部で非線形処理された、k個の前記第1加算器の累積加算処理の結果が入力され、同時に入力されたデータに対してプーリング処理を行う第2プーリング処理部と、前記演算部内を制御する演算制御部と、を有し、前記データ格納メモリ管理部は、前記演算部に入力される前記入力特徴量マップデータの数≦N/kの時に、k個の異なるデータ格納メモリに同じデータを書き込み、前記演算制御部は、前記入力特徴量マップデータの数≦N/kの時は、前記セレクタが前記第2処理側に分岐するよう制御する演算処理装置である。
 前記データ格納メモリ制御部は、第1モードにおいて、前記データ格納メモリへの書き込み時に、k個の異なるデータ格納メモリの同一アドレスに同一のデータを書き込むよう制御し、前記データ格納メモリをN/k個ずつk個のグループに分類し、前記データ格納メモリからの読み出し時に、各グループでアドレスを変えて、互いに縦および/または横に数画素ずれたアドレスにアクセスするよう制御してもよい。
 前記データ格納メモリ制御部は、第2モードにおいて、前記データ格納メモリへの書き込み時に、k個の異なるデータ格納メモリにおいて、同一データを、縦および/または横に数画素ずれたアドレスに書き込むように制御し、前記データ格納メモリからの読み出し時に、同一アドレスで全ての前記データ格納メモリにアクセスしてもよい。
 本発明の第一の態様は、Convolution処理とFullConnect処理を行うディープラーニング用の演算処理装置であって、入力特徴量マップデータを格納するデータ格納メモリと、前記データ格納メモリを管理および制御するデータ格納メモリ制御部とを有するデータ格納メモリ管理部と;フィルタ係数を格納するフィルタ係数格納メモリと、前記フィルタ係数格納メモリを管理および制御するフィルタ係数格納メモリ制御部とを有するフィルタ係数格納メモリ管理部と;前記入力特徴量マップデータおよび出力特徴量マップデータを格納する外部メモリと;前記外部メモリから、前記入力特徴量マップデータを取得するデータ入力部と;前記外部メモリから、前記フィルタ係数を取得するフィルタ係数入力部と;入力N並列、出力M並列の構成(N、M≧1の正数)で、前記データ格納メモリから前記入力特徴量マップデータを取得し、前記フィルタ係数格納メモリから前記フィルタ係数を取得して、フィルタ処理、累積加算処理、非線形演算処理およびプーリング処理を行う演算部と;前記演算部から出力されるM並列のデータを連結して、出力特徴量マップデータとして前記外部メモリに出力するデータ出力部と;前記演算処理装置内を制御するコントローラと;を有し、前記演算部は、N並列でフィルタ処理を実行するフィルタ演算部と、前記フィルタ演算部のN/k個の演算結果を累積加算するk個の第1加算器と、前記第1加算器の後段に設けられ、前記第1加算器の出力を分岐して、第1処理側と第2処理側とで切り替えるセレクタと、前記セレクタが前記第1処理側に分岐した場合に、k個の前記第1加算器の累積加算処理の結果を累積加算する第2加算器と、前記第2加算器の累積加算処理の結果を後段で累積加算する第3加算器と、前記第3加算器の累積加算処理の結果に対して非線形演算処理を行う第1非線形変換部と、前記第1非線形変換部の処理結果に対してプーリング処理を行う第1プーリング処理部と、前記セレクタが前記第2処理側に分岐した場合に、前記第1加算器の累積加算処理の結果に対してプーリング処理を行う第2プーリング処理部と、前記第2プーリング処理部の後段に設けられ、前記第2プーリング処理部でプーリング処理された前記第1加算器の累積加算処理の結果に対して非線演算処理を行う第2線形変換部と、前記演算部内を制御する演算制御部と、を有し、前記データ格納メモリ管理部は、前記演算部に入力される前記入力特徴量マップデータの数≦N/kの時に、k個の異なるデータ格納メモリに同じデータを書き込み、前記演算制御部は、前記入力特徴量マップデータの数≦N/kの時は、前記セレクタが前記第2処理側に分岐するよう制御する演算処理装置である。
 前記第1非線形変換部と前記第2線形変換部は同一の構成であってもよく、前記第1処理側と前記第2処理側で共用されていてもよい。
 前記第2プーリング処理部は、走査方向に対して垂直方向と水平方向とで別々に、プーリング処理を行い、前記垂直方向のプーリング処理および前記水平方向のプーリング処理は、各々、トリガ信号が入力されるタイミングで実行され、前記演算制御部は、予め設定したタイミングで、前記トリガ信号を出力してもよい。
 本発明の各態様によれば、畳み込みニューラルネットワークを用いたディープラーニングを行う演算処理装置において、プーリング処理の実行に必要なデータを並列処理で実行できるようにすることで、処理時間を短縮することができる。
Convolution処理によって、入力特徴量マップ(iFM)から出力特徴量マップ(oFM)を得るイメージ図である。 本発明の実施形態に係る演算処理装置の全体構成を示すブロック図である。 本発明の第1実施形態に係る演算処理装置の演算部の構成を示す図である。 プーリング処理のイメージを示す図である。 本発明の第1実施形態の変形例に係る演算処理装置の演算部の構成を示す図である。 本発明の第1実施形態に係る演算処理装置のIBUF(データ格納メモリ)管理部の構成を示す図である。 本発明の第1実施形態に係る演算処理装置のIBUF管理部のwe生成部分を詳細に示した図である。 非線形変換が単調増加関数である場合の、非線形変換部の入力と出力の関係を示す図である。 本発明の第1実施形態の変形例に係る演算処理装置の演算部の構成を示す図である。 本発明の第1実施形態の変形例に係る演算処理装置の演算部の構成を示す図である。 本発明の第1実施形態の変形例に係る演算処理装置の演算部の第1プーリング処理部の構成を示す図である。 本発明の第1実施形態の変形例に係る演算処理装置のIBUF管理部のwe生成部分を詳細に示した図である。 通常のプーリング処理における、iFMの処理過程を示す図である。 Yolo_tiny_v2の6層目のプーリング処理における、iFMの処理過程を示す図である。 本実施形態の第2実施形態に係る演算処理装置の第1プーリング処理部の構成を示す図である。 非線形変換処理後のFMのピクセルイメージを示す図である。 通常のプーリング処理で、操作方向を水平方向とした場合の、第1プーリング処理部の実行波形を示す図である。 stride=1時の、操作方向を水平方向とした場合の、第2プーリング処理部の実行波形を示す図である。 本実施形態の第2実施形態に係る演算処理装置の、第1プーリング処理部の実行波形を示す図である。 本実施形態の第3実施形態に係る演算処理装置において、2個の出力チャネルグループで分担して、1個のoFMを作成するイメージ図である。 本実施形態の第3実施形態に係る演算処理装置のIBUF管理部の出力側の構成を示す図である。 本実施形態の第3実施形態に係る演算処理装置のIBUF管理部の、DBUFodd、DBUFevenにおけるデータの格納イメージを示す図である。 本実施形態の第3実施形態に係る演算処理装置において、2個の出力チャネルグループで処理するiFM上の位置の違いのイメージを示す図である。 通常処理時の、演算部から出力されるoFMデータのイメージ図である。 1個のoFMを2個の出力チャネルグループでライン分担して処理した場合の、演算部から出力されるoFMデータのイメージ図である。 通常処理時の、k層目の処理から(k+1)層目の処理への流れを示す図である。 ライン分担処理時の、k層目の処理から(k+1)層目の処理への流れを示す図である。 ライン分担処理時の、IBUFへの具体的なデータの書き込みイメージを示す図である。 領域分担処理時の、IBUFへの具体的なデータの書き込みイメージを示す図である。 本実施形態の第3実施形態に係る演算処理装置のIBUF管理部の全体構成を示す図である。 CNNを用いたディープラーニングによる画像認識の処理の流れを示す図である。 従来技術に係るConvolution処理の流れを示す図である。
 本発明の実施形態について、図面を用いて説明する。まず、本発明の実施形態の構成を採用する背景について説明する。
 図1は、Convolution処理によって、入力特徴量マップ(iFM)から出力特徴量マップ(oFM)を得るイメージ図である。Convolution処理は、入力される全てのiFMデータに異なるフィルタ係数をかけ(フィルタ処理)、それらを全て累積加算し、非線形変換、プーリング(縮小処理)などの処理を施すことにより、oFMデータを得る。oFMデータの1ピクセル(1画素)を計算するのに必要な情報として、出力(oFMの1ピクセル)に対応するiFMデータの座標の近傍にある全てのピクセルの情報(iFMデータおよびフィルタ係数)が必要である。
 Convolution処理は、入力N並列(Nは1以上の正数)、すなわちiFM数(iFMの面数)=Nであり、N次元の入力データが並列して処理される(入力N並列)。また、出力M並列(Mは1以上の正数)、すなわちoFM数(oFMの面数)=Mであり、M次元のデータが並列して出力される(出力M並列)。
 (第1実施形態)
 次に、本発明の第1実施形態について、図面を用いて説明する。図2は、本実施形態に係る演算処理装置の全体構成を示すブロック図である。演算処理装置1は、コントローラ2と、データ入力部3と、フィルタ係数入力部4と、IBUF(データ格納メモリ)管理部5と、WBUF(フィルタ係数格納メモリ)管理部6と、演算部(演算ブロック)7と、データ出力部8を備える。データ入力部3と、フィルタ係数入力部4と、データ出力部8は、バス10を介して、DRAM(外部メモリ)9と接続されている。演算処理装置1は、入力特徴量マップ(iFM)から出力特徴量マップ(oFM)を生成する。
 IBUF管理部5は、入力特徴量マップ(iFM)データ格納用のメモリ(データ格納メモリ、IBUF)と、データ格納メモリの管理・制御回路(データ格納メモリ制御部)を有する。IBUFは、それぞれが複数のSRAMから構成される。
 IBUF管理部5は、入力データ(iFMデータ)中の有効データ数をカウントして座標に変換し、さらにそれをIBUFアドレス(IBUFにおけるアドレス)に変換し、データをIBUFに格納するとともに、所定の方法でiFMデータをIBUFから取り出す。
 WBUF管理部6は、フィルタ係数格納用のメモリ(フィルタ係数格納メモリ、WBUF)と、フィルタ係数格納メモリの管理・制御回路(フィルタ係数格納メモリ制御部)を有する。WBUF管理部6は、IBUF管理部5のステータスを参照して、IBUF管理部5から取り出すデータに対応するフィルタ係数をWBUFから取り出す。
 DRAM9は、iFMデータ、oFMデータおよびフィルタ係数を格納する。データ入力部3は、DRAM9から所定の方法で、入力特徴量マップ(iFM)を取得し、IBUF(データ格納メモリ)管理部5に渡す。データ出力部8は、DRAM9に所定の方法で、出力特徴量マップ(oFM)データを書き出す。具体的には、データ出力部8は、演算部7から出力されたM並列のデータを連結してDRAM9に出力する。フィルタ係数入力部4は、DRAM9から所定の方法で、フィルタ係数を取得し、WBUF(フィルタ係数格納メモリ)管理部6に渡す。
 演算部7は、IBUF(データ格納メモリ)管理部5からデータ、WBUF(フィルタ係数格納メモリ)管理部6からフィルタ係数を取得して、フィルタ処理・累積加算・非線形演算・プーリング処理等のデータ処理を行う。演算部7がデータ処理を施したデータ(累積加算結果)は、データ出力部8を介して、DRAM9に格納される。コントローラ2は、回路全体の制御を行う。
 CNNでは、複数の処理層において、必要な層数分の処理が繰り返し実行される。そして、演算処理装置1は最終出力データとして被写体推定結果を出力し、この最終出力データを、プロセッサ(回路でもよい)を用いて処理することにより被写体推定結果を得る。
 図3は、本実施形態に係る演算処理装置の演算部7の構成を示す図である。演算部7の入力チャネル数はN(Nは1以上の正数)であり、N次元の入力データが並列して処理される(入力N並列)。演算部7の出力チャネル数はM(Mは1以上の正数)であり、M次元のデータが並列して出力される(出力M並列)。
 1つの層(面)において、iFMデータ(d_0~d_15)とフィルタ係数(k_0~k_15)が入力され、1個のoFMデータを出力する。この処理がM層(M面)、並行して行われ、M個のoFMデータ(oCh_0~oCh_M-1)が出力される。
 このように、演算部7は、入力チャネル数をN、出力チャネル数をMとして、並列度がN×Mとなる構成を取る。入力チャネル数Nおよび出力チャネル数Mの大きさは、CNNの大きさに応じて設定(変更)することができるので、処理性能や回路規模を勘案して適切に設定する。
 本実施形態は、演算部7が演算可能な入力チャネル数Nよりも、実際に演算部7に入力されるiFM数が少ない場合に、未稼働回路を活用することで演算処理の高速化を図ったものである。なお、分かりやすくするため、以下の条件で説明する。
 ・入力並列度N=16
 ・出力並列度M=16
 ・iFM数=3(RGBの3面)
 ・oFM数=16
 ・フィルタサイズ 3×3
 ・プーリング実行単位(プーリングサイズ) k=2×2
 この場合、1つのチャネルグループで1つのiFMを処理しようとすると、入力16チャネルのうち13チャネルが未稼働となってしまう。そこで、未稼働回路を有効活用する。
 演算部7は、演算部内各部の制御を行う演算制御部71を備える。また、演算部7は、各層(面)ごとに、フィルタ演算部72と、k個の第1加算器81と、セレクタ82と、第2加算器83と、第3加算器74と、FF(フリップフロップ)75と、第1非線形変換部76と、第1プーリング処理部77と、第2非線形変換部86と、第2プーリング処理部87とを備える。各層(面)ごとに同じ回路が存在し、このような各(面)がM個ある。
 演算制御部71が、演算部7の前段に対してリクエストを発行することにより、所定のデータがフィルタ演算部72に入力される。フィルタ演算部72は、内部で乗算器と加算器がN並列で同時に実行できるように構成されており、入力データのフィルタ処理を行い、フィルタ処理の結果をN並列で出力する。
 第1加算器81の各々は、フィルタ演算部72におけるN/k個のフィルタ処理結果を累積加算する。図3の例では、N=16、k=4なので、第1加算器81の各々は、16/4=4個のフィルタ処理結果を累積加算している。
 第1加算器81の後段にはセレクタ82が設けられ、第1加算器81の出力を分岐して切り替える。切り替えの条件は、演算部7に入力されるiFM数とN/kのどちらが大きいかによる。なお、図3の例では、セレクタ82は各第1加算器81に対応してk個あるが、第1加算器81の出力を1つのセレクタ82で共通に切り替えるように構成してもよい。
 iFM数>N/kの場合、演算制御部71は、通常処理(第1処理)を行うようにセレクタ82を切り替える設定・制御を行う。具体的には、第1加算器81の出力が、第2加算器83に入力されるようにセレクタ82が切り替えられる。第2加算器83は、入力されたk個の第1加算器81の累積加算処理の結果を累積加算する。すなわち、通常処理時には、第1加算器81が、N個(図3では16個)の入力チャネルをk個ずつ(図3では4個ずつ)に分けて1回目の加算を行い、第2加算器83が2回目の加算で全入力分の加算を行う。
 第3加算器74は、時分割で入力される第2加算器83の累積加算処理の結果を後段で累積加算する。第3加算器74の後段には、累積加算の結果を保持するためのFF75が設けられている。
 第1非線形変換部76は、第3加算器74およびFF75での累積加算の結果に対して、Activate関数などによる非線形演算処理を行う。具体的な実装は特に規定しないが、例えば折れ線近似により非線形演算処理を行う。
 第1プーリング処理部77は、第1非線形変換部76から入力された複数のデータの中から最大値を選択出力(最大値プーリング)する、平均値を算出(平均値プーリング)する、などのプーリング処理を行う。なお、第1非線形変換部76と第1プーリング処理部77における処理は、演算制御部71により省略することができる。
 iFM数≦N/kの場合、演算制御部71は、並列処理(第2処理)を行うようにセレクタ82を切り替える設定・制御を行う。ここで、並列処理とは、未稼働回路を活用することで、プーリング処理の実行に必要なデータを通常処理と並列で実行する処理のことを言う。これにより、処理時間を短縮し、演算処理の高速化を図ることができる。並列処理を行うことが選択された場合、第1加算器81の出力が、第2非線形変換部86に入力されるようにセレクタ82が切り替えられる。
 第2非線形変換部86は、k個の第1加算器81の累積加算処理の結果に対してActivate関数などの非線形変換(非線形処理)を行う。第2プーリング処理部87は、第2非線形変換部86で非線形処理された、k個の第1加算器81の累積加算処理の結果が入力され、同時に入力されたデータに対してプーリング処理を行う。
 すなわち、iFM数が少ない時は、第1加算器81の出力が並列処理側に送られて、個別に非線形変換が施された後、k個(図3では4個)のデータ同時入力のプーリング処理が実行される。プーリング処理は、平均値プーリングの場合は加算してk(図3では4)で割り(2ビットシフト)、maxプーリングの場合は最大値を取得する。
 図4は、プーリング処理のイメージを示す図である。入力データが4×4ピクセル、フィルタサイズが3×3ピクセルの場合、フィルタ処理によって、3×3ピクセルのデータが4個作られる。プーリング実行単位k=2×2の場合、フィルタ処理後の4個のデータが揃ってプーリング処理が1回実行される。従って、4個(一般的にはk個)のデータを同時に演算できれば、処理時間を短縮し、演算処理の高速化を図ることができる。上述の図3の構成によれば、第2非線形変換部86が4個(一般的にはk個)あるので、プーリング処理の実行に必要なデータを通常処理と並列で実行することができる。したがって、入力チャネルが空いている時、通常処理と並列してプーリングに必要なデータ生成を一度に実行することができる。
 (変形例)
 なお、図3の上側(並列処理側)と下側(通常処理側)は排他利用されるので、セレクタ82で切り替えることにより、第1非線形変換部76を第2非線形変換部86として利用できる構成にしてもよい。図5はこのような演算部7の構成を示す図である。
 4個あるセレクタ82のうちの1個(セレクタ82´)は、セレクタ84を介して第1非線形変換部76の入力に接続している。そして第1非線形変換部76の出力はセレクタ85に接続し、出力先を第1プーリング処理部77と第2プーリング処理部87とから選択できるようにしている。
 iFM数>N/kの場合、演算制御部71は、通常処理(第1処理)を行うようにセレクタ82を切り替える設定・制御を行う。すなわち、第1加算器81の出力が、第2加算器83に入力されるようにセレクタ82が切り替えられる。第2加算器83は、入力されたk個の第1加算器81の累積加算処理の結果を累積加算し、第3加算器74は、時分割で入力される第2加算器83の累積加算処理の結果を後段で累積加算する。第3加算器74の後段には、累積加算の結果を保持するためのFF75が設けられている。
 FF75と第1非線形変換部76の間にはセレクタ84が設けられており、第1非線形変換部76の入力を、通常処理側と並列処理側とで切り替えることができる。通常処理の場合は、第1非線形変換部76は、第3加算器74およびFF75での累積加算の結果に対して、Activate関数などによる非線形演算処理を行う。
 第1非線形変換部76の後段にはセレクタ85が設けられており、第1非線形変換部76の出力を、通常処理側と並列処理側とで切り替えることができる。通常処理の場合は、第1非線形変換部76によって処理されたデータは第1プーリング処理部77に入力される。第1プーリング処理部77は、第1非線形変換部76から入力された複数のデータの中から最大値を選択出力(最大値プーリング)する、平均値を算出(平均値プーリング)する、などのプーリング処理を行う。
 iFM数≦N/kの場合、演算制御部71は、並列処理(第2処理)を行うようにセレクタ82を切り替える設定・制御を行う。すなわち、第1加算器81の出力が、第2非線形変換部86に入力されるようにセレクタ82が切り替えられる。このとき、4個あるセレクタ82のうちの1個(セレクタ82´)は、セレクタ84を介して第1非線形変換部76の入力に接続している。すなわち4個ある第1加算器81のうちの1個(第1加算器81´)の出力は、第1非線形変換部76に入力される。
 第2非線形変換部86は、(k-1)個(図5では3個)の第1加算器81の累積加算処理の結果に対してActivate関数などの非線形変換(非線形処理)を行う。同時に、第1非線形変換部76は、第1加算器81´の累積加算処理の結果に対してActivate関数などの非線形変換(非線形処理)を行う。そして、第1非線形変換部76の出力が、第2プーリング処理部87に入力されるようにセレクタ85が切り替えられる。
 第2プーリング処理部87は、第2非線形変換部86および第1非線形変換部76で非線形処理された、k個(図5では4個)の第1加算器81(第1加算器81´を含む)の累積加算処理の結果が入力され、同時に入力されたデータに対してプーリング処理を行う。このような構成により、第2非線形変換部86の数を1個減らすことができ、回路構成を小さくすることができる。
 (IBUFへのデータの格納・読み出し方法)
 次に、本実施形態におけるIBUF(データ格納メモリ)へのデータの格納・読み出し方法について説明する。図6は、本実施形態のIBUF(データ格納メモリ)管理部5の構成を示す図である。
 IBUF管理部5は、IBUF(データ格納メモリ)にデータを格納するIBUF格納部51と、複数のIBUFが配置されているIBUFアレイ52と、IBUFからデータを読み出すIBUF読み出し部53とを備える。IBUF格納部51とIBUF読み出し部53は、前述のデータ格納メモリ制御部に含まれる。入力N並列の場合、N個のIBUFを使用する。例えば、図6に示すように、入力並列度N=16の場合、16個のIBUF(IBUF0~IBUF15)を使用する。
 IBUF格納部51は、iFMデータが入力されると、入力データ中の有効データ数をカウントして座標に変換し(座標生成)、さらにそれをIBUFアドレスに変換し(アドレス変換)、iFMデータ(data)とともにIBUFに格納する。
 IBUF管理部5のデータ格納メモリ制御部は、IBUFへの書き込みおよびIBUFからの読み出しの制御を行うが、この制御にはいくつかのモードがある。以下は、1つのモード(第1モード)の場合の制御である。IBUF格納部51は、iFM数≦N/kの場合、IBUFをN/k個ずつk個のグループに分類し、IBUFへの書き込み時に、別々のグループに属するk個の異なるIBUFの同一アドレスに同一のデータを書き込む。
 例えば、N=16、k=4の場合、IBUF格納部51は、IBUF(IBUF0~IBUF15)を以下の4グループに分ける。
・IBUF0~3
・IBUF4~7
・IBUF8~11
・IBUF12~15
 そして、IBUF格納部51は、IBUFへの書き込み時に、別々のグループに属する4個のIBUF(例えばIBUF0、IBUF4、IBUF8、IBUF12)の同一アドレスに同一のデータを書き込む。書き込みは、mode信号によりweの生成を切り替えることで実現できる。図7は、図6のIBUF格納部51のwe生成部分を詳細に示した図である。これにより、IBUF0~3と同じデータがIBUF4~7、IBUF8~11、IBUF12~15に複製される。
 IBUF読み出し部53は、IBUFからの読み出し時に、縦および/または横に1画素(または数画素)ずれた部分を読み出す。これは、データアクセスの際に、各グループでアドレッシングを変えて、互いに縦および/または横に数画素ずれたアドレスにアクセスすることで実現できる。例えば、IBUF0~3、IBUF4~7、IBUF8~11、IBUF12~15のそれぞれに1本ずつアドレスを生成することで、図4の左のように縦および/または横に1画素ずれた位置からデータを読み出すことができる。
 (IBUFへのデータの格納・読み出し方法の変形例)
 IBUFへのデータの格納・読み出し方法の別の例について説明する。本例は、上述の第1モードとは別のモード(第2モード)の場合の制御である。IBUF格納部51は、iFM数≦N/kの場合、IBUFをN/k個ずつk個のグループに分類する。そして、IBUF格納部51は、IBUFへの書き込み時に、別々のグループに属するk個の異なるIBUFにおいて、同一のデータを、縦および/または横に数画素(例えば1画素)ずれたアドレスに書き込む。すなわち、各グループの同一アドレスに数画素(例えば1画素)ずれたデータが格納されるように書き込む。
 IBUF読み出し部53は、IBUFからの読み出し時に、アクセスするアドレスを変えることはせず、全てのIBUFに同一アドレスでアクセスする。同一アドレスから読み出すことができるので、読み出しが楽になる。
 書き込み時のwe生成については上述の例と同様であり、書き込むアドレスをIBUF0~3、IBUF4~7、IBUF8~11、IBUF12~15で1画素ずれるように生成する。このようにすることで、読み出し時のアドレスは共通化できる。
 以上は入力16並列の場合で説明したが、それ以上の入力並列度である場合、例えば入力32並列で構成されていた場合は、プーリング処理を一度に実行できる3ch×4並列を2セット持つことができるので、さらに倍速で演算可能となる。あるいは、プーリングサイズが3×3になっても、3ch×9並列の構成として9並列で3×3プーリングを一度に実施するようにも構成することができる。
 (非線形処理の変形例)
 非線形処理は、通常、Sigmoid/ReLU/Tanhなどの活性化関数の処理部であるが、これらはほぼ単調増加関数である。図8は、非線形変換f(x)が単調増加関数である場合の、非線形変換部の入力(x1~x4)と出力(f(x1)~f(x4))の関係を示す図である。
 プーリング処理が最大値プーリングである場合を考える。この場合、非線形処理後の結果(f(x1)~f(x4))に対してプーリング処理する場合、f(x1)~f(x4)のうちから最大のf(x4)を出力する。一方、先にプーリング処理してから非線形処理する場合は、x1~x4のうちの最大のx4に対して非線形処理を行うのでf(x4)を出力する。すなわち、以下の式が成立し、結果は変わらない。
 max(f(x1),f(x2),f(x3),f(x4))=f(max(x1,x2,x3,x4))
 すなわち、非線形変換fが単調増加関数であれば、最大値プーリング処理と非線形変換fを入れ替え可能である。従って、非線形変換特性が単調増加関数で、かつプーリング処理が最大値プーリング処理のみである、という条件が満たされていれば、非線形処理はプーリング処理後の1つのデータに対して行えば良いので、回路規模がさらに削減できる。
 図9および図10は、このように、非線形処理とプーリング処理の順序を入れ替えた、演算部7の構成を示す図である。図9では、並列処理側パスのプーリング処理(第2プーリング処理部87)と非線形変換の順序を入れ替え、さらに並列処理側パスと通常処理側パスが排他動作することを利用して、通常処理側の非線形変換部76を、並列処理と通常処理とで共用している。具体的には、並列処理側の第2プーリング処理部87の出力と通常処理側のFF75の出力とが、セレクタ88で切り替えられて、非線形変換部76に入力される。このような構成にすることで、最大値抽出回路が1個増えるだけで、処理が4倍速となる。
 非線形変換部76を共用しない場合は、例えば図3において、第2非線形変換部86と第2プーリング処理部87の順序を入れ替え、図10に示すように、第2プーリング処理部87の後段に第2非線形変換部86が設けられるようにすればよい。
 (プーリング処理の変形例)
 以上述べてきた方法は、「入力並列度N≧iFM数×プーリングサイズ」を満たすので並列実行可能である。しかし、iFM数がもう少し増えて、「入力並列度N<iFM数×プーリングサイズ」となった場合は、対応できない。例えば、N=16、iFM数=8(プーリングサイズは2×2)の場合、16<8×2×2=32となり、以上述べてきた方法では対応できず、並列実行は不可能である。しかし、プーリング処理を1度に行うのでなく、垂直方向・水平方向に分けて数サイクルで実行することで、「入力並列度N<iFM数×プーリングサイズ」の場合も並列実行可能となる。
 図11は、走査方向に対して垂直方向・水平方向に別々にプーリング処理する場合の、第2プーリング処理部87の構成を示す図である。なお、演算部7全体の構成は図9に示すものであるとする。
 iFM数≦4(一般的にはプーリングサイズk)の場合、プーリング処理は、図11に示す第2プーリング処理部87内の上側のパスを通り、以上述べてきた方法と同じプーリング処理がなされる。
 4<iFM数≦8の場合、プーリング処理は、図11の第2プーリング処理部87内の下側のパスを通る。すなわち、走査方向に対して垂直方向・水平方向に別々にプーリング処理がなされる。なお、同時入力されるデータは垂直方向・水平方向のどちらか1方向のみであり、数サイクルかけてプーリング処理に必要なデータが全て入力される。前記垂直方向のプーリング処理および前記水平方向のプーリング処理は、各々、トリガ信号が入力されるタイミングで実行される。演算制御部71は、予め設定したタイミングで、垂直プーリング処理および水平プーリング処理を実行するトリガ信号を出力する。
 第2プーリング処理部87の4個の入力ポートはそれぞれFM4面分の加算結果であり、このうちの2本ずつを加算するので、垂直プーリング処理直前の2つのポートはFM8面分の加算結果となる。このような構成で垂直方向・水平方向にプーリング処理することで、最大8面までのFMに対して2並列で実行可能となる。
 なお、4<iFM数≦8の場合は、IBUF0~7のデータがIBUF8~15に複製されることになるので、IBUF管理部5にも少々構造の追加が必要となる。図12は、このようなIBUF管理部5のwe生成部分を詳細に示した図である。
 図11において、プーリング処理が最大値プーリングの場合は、垂直プーリング処理部/水平プーリング処理部の両方で最大値を抽出する。プーリング処理が平均値プーリングの場合は、垂直プーリング処理部/水平プーリング処理部では2つの加算結果を出すが、水平プーリング処理部は最後に4で除する(2ビットシフト)することで平均値を取得できる。
 (第2実施形態)
 本発明の第2実施形態について説明する。第1実施形態では、回路として使われない部分を有効活用することによってCNNの処理速度を上げる提案をした。第2実施形態では、CNNのバリエーションの1つであるYolo_tiny_v2の6層目で発生する冗長な処理を回避して処理時間を短縮する。第2実施形態では、第2プーリング処理部87における処理が第1実施形態と異なるだけであり、それ以外の基本構成は第1実施形態と同じである。そこで、以下、第2プーリング処理部87における処理だけを説明する。
 図13Aおよび図13Bは、フィルタ処理のカーネルサイズが3×3、プーリング処理単位が2×2の場合の、iFMの処理過程を示す図である。図13Aは通常のプーリング処理を示し、重心移動量が2(stride=2)である。図13BはYolo_tiny_v2の6層目におけるプーリング処理を示し、重心移動量が1(stride=1)である。
 通常は図13Aに示すように、iFMは、フィルタ処理後の結果で見た時に、オーバーラップしないように処理される。プーリング処理単位が2×2であるので、プーリング処理によってiFMは縦横半分のサイズとなって出力される。これは、プーリング処理時のピクセル重心が、プーリング処理単位と同じ2ピクセル単位で動く事を前提とした時の動きである。重心移動量はstrideと言うパラメータで設定され、この例の場合はstride=2である。
 問題となるのは、設定上、stride=1があり得ることで、実際、Yolo_tiny_v2では6層目でstride=1となる。stride=1時の動作は図13Bのようになり、フィルタ処理後の結果でオーバーラップが発生する。そのため、フィルタ処理自体は同じデータに対して数度実行することになり、処理時間の低下に繋がる。
 本実施形態ではこれを解決するために、プーリング処理を垂直方向・水平方向に分けて、別々に実行パルスを与える事で対応する。図14は、本実施形態の第2プーリング処理部87の構成を示す図である。処理の走査方向に対して垂直方向と水平方向とで別々に、それぞれが演算制御部からの実行パルスを受けて、プーリング処理を実行するように動作する。すなわち、垂直方向のプーリング処理を行う垂直プーリング処理部と、水平方向のプーリング処理を行う水平プーリング処理部の各々は、トリガ(実行パルス)が入力されるタイミングでプーリング処理を行う。演算制御部71は、予め設定したタイミングで、水平プーリング処理および垂直プーリング処理を実行するトリガ信号を出力する。
 具体的には、以下のようにプーリング処理が行われる。図15は、非線形変換後(フィルタ処理後)のFMのピクセルイメージを示す図である。図16は、通常のプーリング処理(stride=2)で、操作方向を水平方向とした場合の、第2プーリング処理部87の実行波形を示す図である。図15に示すiFMデータが図16に示すように第2プーリング処理部87に順次入力され、順次プーリング処理が実行される。
 プーリング処理は、最大値プーリングの場合は最大値をとっていき、平均値プーリングの場合は加算して全部終わったら画素数で割る。例えば、図16において、垂直プーリングの結果p1は、最大値プーリングの場合D11とD21のうち大きい方を選択し、平均値プーリングの場合D11+D21を計算する。水平プーリングの結果o1は、最大値プーリングの場合p1とp2のうち大きい方を選択し、平均値プーリングの場合(p1+p2)÷4を計算する
 図17は、stride=1時の、操作方向を水平方向とした場合の、第2プーリング処理部87の実行波形を示す図である。図16と比較して、水平プーリングの実行パルス間隔が半分になっている。
 このようにして、stride=1であってもパイプライン処理的にプーリングを実行することができる。また、垂直方向・水平方向のプーリング処理を分けることで一度に処理するデータ数が減るので、待ち合わせ用のFFの数が削減でき、最大値算出(もしくは全加算)回路も小さくなり、回路規模を小さくできる。
 また、このようにプーリング処理を制御するようにしておくと、例えばプーリングサイズが3×3でstride=2のような複雑な設定でも、待ち合わせのFF等を追加する必要があるが、容易に対応できる。図18は、プーリングサイズが3×3でstride=2の場合の、第2プーリング処理部87の実行波形を示す図である。
 stride=1時、縦方向のオーバーラップを避けるためにラインメモリを設置して垂直プーリング結果を保持しておくことも可能であるが、1ライン分のメモリが必要となる。ラインメモリはFMサイズの上限を規定してしまうため、本明細書では今後考案される新規ネットワークへの対応も勘案して搭載していないが、問題がなければそのような改良も可能である。この場合、ラインメモリとその制御が追加されるだけなので図示は省略する。
 (第3実施形態)
 本発明の第3実施形態について説明する。第1実施形態では、演算部の入力側に未使用の回路がある場合に、未使用部分を有効活用する方法を提案したが、第3実施形態は、演算部の出力側に未使用の回路がある場合に、未使用部分を有効活用する方法に関する。
 演算部の基本的な動きとしては、全てのiFMを入力として1個のoFMを生成するが、複数の出力チャネルグループで分担して1個のoFMを作成してもよい。出力並列度をMとして、例えば、oFM数=M/2の場合、1個のoFMを2個の出力チャネルグループで分担して作成することができる。
 図19は、2個の出力チャネルグループ(出力チャネルAと出力チャネルB)で分担して、1個のoFMを作成するイメージ図である。2個の出力チャネルグループによる分担の方法として、図19の左の図は、oFMをライン単位(奇数ラインと偶数ライン)で分担する例(ライン分担)を示し、図19の右の図は、oFMを左右の領域に分割して分担する例(領域分担)を示す。同様に、出力並列度をMとして、oFM数≦M/2の場合、1個のoFMを複数の領域に分割し、各領域を複数の出力チャネルグループで分担して処理することができる。
 このような処理を実行するには、IBUF読み出し部53でのデータの読み出しアドレスを適切に設定することで容易に対応できる。ただし、異なる2個の出力チャネルグループからの出力を合わせて1個のoFMデータが出力される。そのため、次の層での入力時には1個のFMデータとなるように、異なる2個の出力チャネルグループからの出力を統合できるフォーマットを定義する必要がある。
 以降の説明は、図19の左の図のように、2個の出力チャネルグループでoFMの奇数ラインと偶数ラインを分担して処理する場合を例に行う。ただし、1個のoFMを分担する出力チャネルグループの数は2個に限定されず、3個や4個の出力チャネルグループで分担してもよい。
 図20は、本実施形態のIBUF(データ格納メモリ)管理部5の出力側の構成を示す図である。IBUF読み出し部53において、IBUFからデータをリードする時に、奇数ライン用のデータと偶数ライン用のデータを別個に用意する必要がある。そこで、データをいったん保存するためのDBUF57(第2のデータ格納メモリ)を用意し、まずはIBUFからDBUFにデータを転送する。DBUF57の前段の第1制御部56は、oFMを複数の領域に分割し、それぞれの領域を処理するために必要なデータを取り出してDBUF57に書き込む。奇数ライン用のデータはDBUFoddに保存され、偶数ライン用のデータはDBUFevenに保存される。
 ここで、出力並列度をMとして、M個の出力チャネルoCh.0~oCh.(M-1)のうち、出力チャネルoCh.0~oCh.(2/M-1)が前半の出力チャネルグループに属し、出力チャネルoCh.(2/M-1)~oCh.(M-1)が後半の出力チャネルグループに属するとする。そして、前半の出力チャネルグループがoFMの奇数ラインを処理し、後半の出力チャネルグループがoFMの偶数ラインを処理するとする。
 IBUF読み出し部53は、DBUFoddに保存されたデータを、前半の出力チャネルグループに、奇数ライン処理に必要なデータ(data_odd)として、転送する。同様に、IBUF読み出し部53は、DBUFevenに保存されたデータを、後半の出力チャネルグループに、偶数ライン処理に必要なデータ(data_even)として、転送する。
 図21は、DBUFodd、DBUFevenにおけるデータの格納イメージを示す図である。oFMの第1ライン目を生成するために必要なiFMは、iFM上で第1ラインと第2ラインの領域であり、oFMの第2ライン目を生成するために必要なiFMは、iFM上で第2ラインと第3ラインの領域である。すなわち、iFM上にオーバーラップする領域があるので、その部分はDBUFoddとDBUFevenの両方に格納される。
 各DBUF57の後段(図20の第2制御部58)では、DBUF57に格納されたデータから、oFM1画素の生成に必要なデータを順次リードする。第2制御部58は、DBUF57から所定の方法でデータを取得する制御を行う。この読み出し制御により、前半の出力チャネルグループにはdata_oddが、後半の出力チャネルグループにはdata_evenが供給される。
 図22は、2個の出力チャネルグループで処理するiFM上の位置の違いのイメージを示す図である。図22の左側は前半の出力チャネルグループで処理する位置を示し、図22の右側は後半の出力チャネルグループで処理する位置を示す。図22に示すように、前半の出力チャネルグループと後半の出力チャネルグループで1ラインずれた領域の処理を同時に行うことができる。
 次に、上述のような処理で演算部を経由して出力されるoFMデータについて説明する。図23Aおよび図23Bは、演算部から出力されるoFMデータのイメージ図である。図23Aは、通常処理時、すなわち、1個のoFMを1個の出力チャネルグループで処理する場合を示す。出力並列度をMとして、1個のoFMはM枚のFM(oFM0、oFM1、oFM2、…)からなり、M個の出力チャネル(oCh.0、oCh.1、oCh.2、…)から各FMの同じ位置のデータが出力される。
 図23Bは、1個のoFMを2個の出力チャネルグループでライン分担して処理した場合を示す。図23Bに示すように、前半の出力チャネルグループの出力チャネル(oCh.0、oCh.1、oCh.2、…、oCh.M/2-1)は各FMの同じ位置のデータを出力し、後半の出力チャネルグループの出力チャネル(oCh.M/2、oCh.M/2+1、oCh.M/2+2、…、oCh.M-1)は各FMの1ラインずれた位置のデータを出力する。このように、ライン分担で処理した場合、前半の出力チャネルグループと後半の出力チャネルグループが、同じoFM上の1ラインずれた位置のデータを出力していることになる。
 このように異なる2個の出力チャネルグループから出力されたoFMデータのフォーマットを、次の層((k+1)層目)で1個のiFMとして入力するため、(k+1)層目処理時に、データ入力部3に動作選択信号(mode)を入力して制御を切り替える。
 以降の説明では、さらに簡単化するために、入力並列度N=16、出力並列度M=16、oFM数=M/2=8とする。また、D(k)をoCh.kから出力されるデータと定義し、D0_16を全てのoCh.から出力されるデータ(D(0)~D(16-1))を連結したものと定義する。
 最初に、通常処理、すなわち、分担処理をしない場合について説明する。図24は、通常処理時の、k層目の処理から(k+1)層目の処理への流れを示す図である。図24では、k層目の演算部の出力は、D0_16の前半部分だけが有効で、D0_16の後半部分は未使用の状態となっている。(k+1)層目に、この状態のD0_16を入力することになる。D0_16を一度のバースト転送で取得できる場合は、未使用データを入力する事になるので転送効率が悪い。
 次に、ライン分担処理時について説明する。図25は、ライン分担処理時の、k層目の処理から(k+1)層目の処理への流れを示す図である。(k+1)層目に入力されるD0_16Nでは、通常処理時に未使用であった後半部分にも前半部分と同じiFMデータ(1ライン下にずれた位置のデータ)がある。IBUF格納部に格納されたD0_16Nは、2つのデータに分けられて、別々にIBUFに出力される。
 図26Aおよび図26Bは、IBUFへの具体的なデータの書き込みイメージを示す図である。図26Aはライン分担処理時を示し、図26Bは領域分担処理時を示す。図26Aに示すように、ライン分担処理時は、1画素下方向にずれるようにアドレッシングされる。図26Bに示すように、領域分担処理時は、1ラインの半分だけずれた位置関係なので、アドレッシングも半ライン分ずれることになる。
 図27は、本実施形態のIBUF管理部5の全体構成を示す図である。上述の処理を実現するために、IBUF格納部51は、モード判定して制御を変える制御部54とデータ保持・セレクタ部55を有する。制御部54は、同一サイクルで入力されるiFMを保持し、数サイクルに分けて同一IBUFに書き込むように制御するモードを持つ。これにより、oFM数≦M/2の時に処理を並列化して実行時間を短縮することができる。それ以外のIBUF格納部51内の構成は、図6と同じである。また、IBUF読出部53において、通常処理時はDBUF57を経由せず、IBUFデータを直接取り出すパス(data2、req2)を使用する。
 このような構成により、1個のFMを複数の出力チャネルグループで同時処理し、次の層への入力時にそれらのデータを復元処理することが可能となり、処理時間が高速化できる。
 以上、本発明の実施形態について説明したが、本発明の技術範囲は上記実施形態に限定されるものではなく、本発明の趣旨を逸脱しない範囲において構成要素の組み合わせを変えたり、各構成要素に種々の変更を加えたり、削除したりすることができる。
 各構成要素は、それぞれの構成要素に係る機能や処理を説明するためのものである。複数の構成要素に係る機能や処理を、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))のように、一定時間プログラムを保持しているものも含むものとする。
 また、上記プログラムは、このプログラムを記憶装置などに格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネットなどのネットワーク(通信網)や電話回線などの通信回線(通信線)のように情報を伝送する機能を有する媒体をいう。また、上記プログラムは、前述した機能の一部を実現するためのものであってもよい。さらに、前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現するもの、いわゆる差分ファイル(差分プログラム)であってもよい。
 本発明は、畳み込みニューラルネットワークを用いたディープラーニングを行う演算処理装置に広く適用できる。
 1 演算処理装置
 2 コントローラ
 3 データ入力部
 4 フィルタ係数入力部
 5 IBUF管理部(データ格納メモリ管理部)
 6 WBUF管理部(フィルタ係数格納メモリ管理部)
 7 演算部
 8 データ出力部
 9 DRAM(外部メモリ)
 10 バス
 51 IBUF格納部(データ格納メモリ制御部)
 52 IBUFアレイ(データ格納メモリ)
 53 IBUF読み出し部(データ格納メモリ制御部)
 54 制御部
 55 データ保持・セレクタ部
 56 第1制御部
 57 DBUF(第2のデータ格納メモリ)
 58 第2制御部
 71 演算制御部
 72 フィルタ演算部
 74 第3加算器
 75 FF(フリップフロップ)
 76 第1非線形変換部
 77 第1プーリング処理部
 81、81´ 第1加算器
 82、82´ セレクタ
 83 第2加算器
 84 セレクタ
 85 セレクタ
 86 第2非線形変換部
 87 第2プーリング処理部
 88 セレクタ
 

Claims (6)

  1.  Convolution処理とFullConnect処理を行うディープラーニング用の演算処理装置であって、
     入力特徴量マップデータを格納するデータ格納メモリと、前記データ格納メモリを管理および制御するデータ格納メモリ制御部とを有するデータ格納メモリ管理部と;
     フィルタ係数を格納するフィルタ係数格納メモリと、前記フィルタ係数格納メモリを管理および制御するフィルタ係数格納メモリ制御部とを有するフィルタ係数格納メモリ管理部と;
     前記入力特徴量マップデータおよび出力特徴量マップデータを格納する外部メモリと;
     前記外部メモリから、前記入力特徴量マップデータを取得するデータ入力部と;
     前記外部メモリから、前記フィルタ係数を取得するフィルタ係数入力部と;
     入力N並列、出力M並列の構成(N、M≧1の正数)で、前記データ格納メモリから前記入力特徴量マップデータを取得し、前記フィルタ係数格納メモリから前記フィルタ係数を取得して、フィルタ処理、累積加算処理、非線形演算処理およびプーリング処理を行う演算部と;
     前記演算部から出力されるM並列のデータを連結して、出力特徴量マップデータとして前記外部メモリに出力するデータ出力部と;
     前記演算処理装置内を制御するコントローラと;
    を有し、
     前記演算部は、
      N並列でフィルタ処理を実行するフィルタ演算部と、
      前記フィルタ演算部のN/k個の演算結果を累積加算するk個の第1加算器と、
      前記第1加算器の後段に設けられ、前記第1加算器の出力を分岐して、第1処理側と第2処理側とで切り替えるセレクタと、
      前記セレクタが前記第1処理側に分岐した場合に、k個の前記第1加算器の累積加算処理の結果を累積加算する第2加算器と、
      前記第2加算器の累積加算処理の結果を後段で累積加算する第3加算器と、
      前記第3加算器の累積加算処理の結果に対して非線形演算処理を行う第1非線形変換部と、
      前記第1非線形変換部の処理結果に対してプーリング処理を行う第1プーリング処理部と、
      前記セレクタが前記第2処理側に分岐した場合に、前記第1加算器の累積加算処理の結果に対して非線形演算処理を行う第2非線形変換部と、
      前記第2非線形変換部で非線形処理された、k個の前記第1加算器の累積加算処理の結果が入力され、同時に入力されたデータに対してプーリング処理を行う第2プーリング処理部と、
      前記演算部内を制御する演算制御部と、
     を有し、
     前記データ格納メモリ管理部は、前記演算部に入力される前記入力特徴量マップデータの数≦N/kの時に、k個の異なるデータ格納メモリに同じデータを書き込み、
     前記演算制御部は、前記入力特徴量マップデータの数≦N/kの時は、前記セレクタが前記第2処理側に分岐するよう制御する演算処理装置。
  2.  前記データ格納メモリ制御部は、第1モードにおいて、
     前記データ格納メモリへの書き込み時に、k個の異なるデータ格納メモリの同一アドレスに同一のデータを書き込むよう制御し、
     前記データ格納メモリをN/k個ずつk個のグループに分類し、前記データ格納メモリからの読み出し時に、各グループでアドレスを変えて、互いに縦および/または横に数画素ずれたアドレスにアクセスするよう制御する
     請求項1に記載の演算処理装置。
  3.  前記データ格納メモリ制御部は、第2モードにおいて、
     前記データ格納メモリへの書き込み時に、k個の異なるデータ格納メモリにおいて、同一データを、縦および/または横に数画素ずれたアドレスに書き込むように制御し、
     前記データ格納メモリからの読み出し時に、同一アドレスで全ての前記データ格納メモリにアクセスする
     請求項1に記載の演算処理装置。
  4.  Convolution処理とFullConnect処理を行うディープラーニング用の演算処理装置であって、
     入力特徴量マップデータを格納するデータ格納メモリと、前記データ格納メモリを管理および制御するデータ格納メモリ制御部とを有するデータ格納メモリ管理部と;
     フィルタ係数を格納するフィルタ係数格納メモリと、前記フィルタ係数格納メモリを管理および制御するフィルタ係数格納メモリ制御部とを有するフィルタ係数格納メモリ管理部と;
     前記入力特徴量マップデータおよび出力特徴量マップデータを格納する外部メモリと;
     前記外部メモリから、前記入力特徴量マップデータを取得するデータ入力部と;
     前記外部メモリから、前記フィルタ係数を取得するフィルタ係数入力部と;
     入力N並列、出力M並列の構成(N、M≧1の正数)で、前記データ格納メモリから前記入力特徴量マップデータを取得し、前記フィルタ係数格納メモリから前記フィルタ係数を取得して、フィルタ処理、累積加算処理、非線形演算処理およびプーリング処理を行う演算部と;
     前記演算部から出力されるM並列のデータを連結して、出力特徴量マップデータとして前記外部メモリに出力するデータ出力部と;
     前記演算処理装置内を制御するコントローラと;
    を有し、
     前記演算部は、
      N並列でフィルタ処理を実行するフィルタ演算部と、
      前記フィルタ演算部のN/k個の演算結果を累積加算するk個の第1加算器と、
      前記第1加算器の後段に設けられ、前記第1加算器の出力を分岐して、第1処理側と第2処理側とで切り替えるセレクタと、
      前記セレクタが前記第1処理側に分岐した場合に、k個の前記第1加算器の累積加算処理の結果を累積加算する第2加算器と、
      前記第2加算器の累積加算処理の結果を後段で累積加算する第3加算器と、
      前記第3加算器の累積加算処理の結果に対して非線形演算処理を行う第1非線形変換部と、
      前記第1非線形変換部の処理結果に対してプーリング処理を行う第1プーリング処理部と、
      前記セレクタが前記第2処理側に分岐した場合に、前記第1加算器の累積加算処理の結果に対してプーリング処理を行う第2プーリング処理部と、
      前記第2プーリング処理部の後段に設けられ、前記第2プーリング処理部でプーリング処理された前記第1加算器の累積加算処理の結果に対して非線演算処理を行う第2線形変換部と、
      前記演算部内を制御する演算制御部と、
     を有し、
     前記データ格納メモリ管理部は、前記演算部に入力される前記入力特徴量マップデータの数≦N/kの時に、k個の異なるデータ格納メモリに同じデータを書き込み、
     前記演算制御部は、前記入力特徴量マップデータの数≦N/kの時は、前記セレクタが前記第2処理側に分岐するよう制御する演算処理装置。
  5.  前記第1非線形変換部と前記第2線形変換部は同一の構成であり、前記第1処理側と前記第2処理側で共用されている、請求項4に記載の演算処理装置。
  6.  前記第2プーリング処理部は、走査方向に対して垂直方向と水平方向とで別々に、プーリング処理を行い、
     前記垂直方向のプーリング処理および前記水平方向のプーリング処理は、各々、トリガ信号が入力されるタイミングで実行され、
     前記演算制御部は、予め設定したタイミングで、前記トリガ信号を出力する請求項1に記載の演算処理装置。
     
PCT/JP2019/039897 2019-10-09 2019-10-09 演算処理装置 WO2021070303A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2021551021A JP7410961B2 (ja) 2019-10-09 2019-10-09 演算処理装置
PCT/JP2019/039897 WO2021070303A1 (ja) 2019-10-09 2019-10-09 演算処理装置
US17/558,783 US20220113944A1 (en) 2019-10-09 2021-12-22 Arithmetic processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2019/039897 WO2021070303A1 (ja) 2019-10-09 2019-10-09 演算処理装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/558,783 Continuation US20220113944A1 (en) 2019-10-09 2021-12-22 Arithmetic processing device

Publications (1)

Publication Number Publication Date
WO2021070303A1 true WO2021070303A1 (ja) 2021-04-15

Family

ID=75438072

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/039897 WO2021070303A1 (ja) 2019-10-09 2019-10-09 演算処理装置

Country Status (3)

Country Link
US (1) US20220113944A1 (ja)
JP (1) JP7410961B2 (ja)
WO (1) WO2021070303A1 (ja)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11507831B2 (en) 2020-02-24 2022-11-22 Stmicroelectronics International N.V. Pooling unit for deep learning acceleration
DE102022116944A1 (de) * 2022-07-07 2024-01-18 Krones Aktiengesellschaft Verfahren zur automatischen Regelung einer Behältertransportvorrichtung mit einem oder mehreren Transportbändern zum Anpassen einer Behälterdichte und Behältertransportvorrichtung

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018032190A (ja) * 2016-08-24 2018-03-01 キヤノン株式会社 演算回路、その制御方法及びプログラム
JP2018067154A (ja) * 2016-10-19 2018-04-26 ソニーセミコンダクタソリューションズ株式会社 演算処理回路および認識システム

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018032190A (ja) * 2016-08-24 2018-03-01 キヤノン株式会社 演算回路、その制御方法及びプログラム
JP2018067154A (ja) * 2016-10-19 2018-04-26 ソニーセミコンダクタソリューションズ株式会社 演算処理回路および認識システム

Also Published As

Publication number Publication date
JP7410961B2 (ja) 2024-01-10
JPWO2021070303A1 (ja) 2021-04-15
US20220113944A1 (en) 2022-04-14

Similar Documents

Publication Publication Date Title
JP7358382B2 (ja) 演算を加速するための加速器及びシステム
CN112840356B (zh) 运算加速器、处理方法及相关设备
CN108388527B (zh) 直接存储器存取引擎及其方法
US20150324685A1 (en) Adaptive configuration of a neural network device
US10678479B1 (en) Registers for restricted memory
KR20170007151A (ko) 인공 신경 네트워크를 실행하는 방법 및 장치
JP7261226B2 (ja) 演算処理装置
CN111465943B (zh) 一种集成电路和用于神经网络处理的方法
US20220113944A1 (en) Arithmetic processing device
JP7008983B2 (ja) テンソルデータにアクセスするための方法および装置
US11030095B2 (en) Virtual space memory bandwidth reduction
US11455781B2 (en) Data reading/writing method and system in 3D image processing, storage medium and terminal
CN107590085A (zh) 一种具有多级缓存的动态可重构阵列数据通路及其控制方法
US11579921B2 (en) Method and system for performing parallel computations to generate multiple output feature maps
CN109472734B (zh) 一种基于fpga的目标检测网络及其实现方法
WO2019041264A1 (zh) 图像处理装置、方法及相关电路
KR20200095300A (ko) 뉴럴 네트워크의 컨볼루션 연산을 처리하는 방법 및 장치
CN111047037B (zh) 数据处理方法、装置、设备及存储介质
CN104869284A (zh) 一种双线性插值放大算法的高效率fpga实现方法和装置
CN110490312B (zh) 一种池化计算方法和电路
CN111047029A (zh) 具有存储器内运算架构的存储器及其操作方法
US11500632B2 (en) Processor device for executing SIMD instructions
CN115796236A (zh) 一种基于存内cnn中间缓存调度的存储器
CN117422608A (zh) 图像引导滤波方法及***
KR20210138954A (ko) 변형 가능한 합성곱 신경망의 설계 방법 및 이를 이용한 장치

Legal Events

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

Ref document number: 19948513

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021551021

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19948513

Country of ref document: EP

Kind code of ref document: A1