WO2022137696A1 - 情報処理装置、情報処理方法 - Google Patents
情報処理装置、情報処理方法 Download PDFInfo
- Publication number
- WO2022137696A1 WO2022137696A1 PCT/JP2021/035696 JP2021035696W WO2022137696A1 WO 2022137696 A1 WO2022137696 A1 WO 2022137696A1 JP 2021035696 W JP2021035696 W JP 2021035696W WO 2022137696 A1 WO2022137696 A1 WO 2022137696A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- feature map
- dnn
- information
- calculation unit
- calculation
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/15—Correlation function computation including computation of convolution operations
- G06F17/153—Multidimensional correlation or convolution
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
Definitions
- the present invention relates to an information processing apparatus and an information processing method.
- FPGA Field Programmable Gate Array
- GPU Graphics Processing Unit
- AI accelerators have been increasingly used in place of FPGAs and GPUs.
- the AI accelerator is a kind of arithmetic unit specialized in AI processing, which has a plurality of arithmetic cores and is good at vector-type arithmetic.
- the AI accelerator is specialized for vector-type operations in DNN operations, but it cannot execute all the processes required for DNN operations, and it is difficult to execute some processes. .. Therefore, in the DNN calculation using the conventional AI accelerator, a calculation processing unit different from the AI accelerator is connected to the AI accelerator, and the DNN calculation is performed by coordinating these. In this case, it is necessary to transfer data for each layer in order for the AI accelerator and the arithmetic processing unit to pass the respective arithmetic results for each layer of the DNN. Therefore, the amount of data communication between the AI accelerator and the arithmetic processing unit increases, which requires a wide bus bandwidth, and the arithmetic processing unit uses a large amount of memory resources.
- various problems occur due to the increase in the amount of data communication between the two arithmetic units. Occurs.
- the arithmetic processing unit various devices capable of arithmetic processing such as a general-purpose microcomputer, a programmable integrated circuit, a programmable logic device, and a system-on-chip can be used.
- the 0 padding is a process of inserting 0 data around the feature map in order to enable convolution of the data at the end portion of the feature map that is the target of the DNN operation. That is, since the convolution operation is a product-sum operation between vectors in the DNN operation, it can be executed using the AI accelerator, but the 0 padding required as the preprocessing of the convolution operation is not an operation using vectors. Therefore, it is difficult to execute at the AI accelerator.
- Patent Document 1 discloses a system that includes a global memory that stores a feature map, a local memory that stores weight data, and an arithmetic processing circuit, and performs convolution operations using these.
- a global memory that stores a feature map
- a local memory that stores weight data
- an arithmetic processing circuit performs convolution operations using these.
- the data transmission speed to the arithmetic processing circuit is faster in the local memory than in the global memory
- multiple convolution operations are performed on the same reception part of the input feature map received by the arithmetic processing circuit. , I try to reduce the movement of data back and forth in the memory network.
- Patent Document 1 is a technique for reducing the movement of data in a convolution operation, and does not reduce the amount of data transfer when a process that is difficult to execute with an AI accelerator, such as 0 padding process, is executed by an arithmetic processing circuit. do not have. Therefore, it is not possible to reduce the amount of data communication between the AI accelerator and two arithmetic units such as the arithmetic processing unit, and it is difficult to solve the above-mentioned problems.
- the information processing apparatus executes a DNN calculation on a feature map, and includes a first calculation unit, a second calculation unit connected to the first calculation unit via a bus, and a second calculation unit.
- the position information representing the position of is transmitted to the second calculation unit, the second calculation unit acquires the weight information from the storage unit, and the partial feature is transmitted from the first calculation unit.
- the map and the position information are received, a predetermined preprocessing based on the position information is executed, and the DNN operation is executed using the execution result of the preprocessing and the partial feature map.
- the information processing method includes a first calculation unit, a second calculation unit connected to the first calculation unit via a bus, and a storage unit for storing weight information used in the DNN calculation.
- a DNN operation is executed on the feature map by using an information processing apparatus including the above, and the partial feature map which is a part of the feature map and the partial feature map by the first calculation unit.
- the position information representing the position in the feature map is transmitted to the second calculation unit, the weight information is acquired from the storage unit by the second calculation unit, and is transmitted from the first calculation unit.
- the partial feature map and the position information are received, a predetermined preprocessing based on the position information is executed, and the DNN operation is executed using the execution result of the preprocessing and the partial feature map.
- an information processing apparatus that performs a DNN calculation using two calculation units, it is possible to reduce the amount of data communication between the two calculation units.
- FIG. 1 is a diagram showing a configuration of an information processing apparatus according to an embodiment of the present invention.
- the information processing device 1 of the present embodiment executes a DNN calculation on a feature map input from the outside, and includes an AI accelerator 10, a calculation processing unit 20, and a storage unit 30 as shown in FIG. It is composed of.
- the arithmetic processing unit 20 is configured by using, for example, a microcomputer, and executes a predetermined arithmetic processing.
- a feature map to be executed by the DNN calculation is input to the calculation processing unit 20 from an external device (not shown). For example, an image taken by a camera mounted on a vehicle, LiDAR (Light Detection and Ringing) mounted on the vehicle, distance information acquired by a radar, etc. can be used as a feature map for recognizing an object around the vehicle. It is input to the arithmetic processing unit 20.
- the feature map stored in the storage unit 30 may be input to the arithmetic processing unit 20.
- the storage unit 30 is configured by using a non-volatile recording medium such as an HDD (Hard Disk Drive) or SSD (Solid State Drive), and stores information used in the DNN calculation performed by the information processing device 1. ing.
- the information stored in the storage unit 30 includes, for example, weight information used for the convolution operation in the DNN operation.
- the AI accelerator 10 is a kind of arithmetic unit specialized in AI processing, which is good at vector type arithmetic, and is connected to the arithmetic processing unit 20 via a bus. A part of the feature map input to the arithmetic processing unit 20 is transmitted from the arithmetic processing unit 20 to the AI accelerator 10 via the bus.
- the feature map input to the arithmetic processing unit 20 will be referred to as an "overall feature map”
- a part of the feature map transmitted from the arithmetic processing unit 20 to the AI accelerator 10 will be referred to as a "partial feature map".
- the position information indicating the position in the overall feature map of the partial feature map is also transmitted from the arithmetic processing unit 20 together with the partial feature map via the bus.
- the AI accelerator 10 has N DNN calculation units 11 corresponding to each layer of the DNN.
- Each DNN calculation unit 11 is connected in order from the first layer to the Nth layer in the AI accelerator 10, and has a kernel 13 (see FIG. 3) that performs a DNN calculation for each layer.
- the partial feature map and position information transmitted from the arithmetic processing unit 20 to the AI accelerator 10 are input to the DNN calculation unit 11 of the first layer, and weight information is input from the storage unit 30.
- the DNN calculation unit 11 of the first layer executes the DNN calculation of the first layer based on these input data, and outputs the calculation result to the DNN calculation unit 11 of the next layer (second layer).
- the DNN calculation unit 11 of the second layer executes the DNN calculation of the second layer based on the calculation result of the DNN calculation unit 11 of the previous layer (first layer) and the weight information input from the storage unit 30. ,
- the calculation result is output to the DNN calculation unit 11 of the next layer.
- the same arithmetic processing is performed in the DNN arithmetic unit 11 of each subsequent layer.
- the calculation result of the DNN calculation unit 11 of the final layer (Nth layer) is output to the calculation processing unit 20 as a result of the final DNN calculation by the AI accelerator 10.
- the DNN calculation unit 11 of each layer performs the DNN calculation of the corresponding layer, so that the DNN calculation is executed in the AI accelerator 10.
- FIG. 2 is a diagram showing a flow of information transmitted / received between the AI accelerator 10, the arithmetic processing unit 20, and the storage unit 30, which are components of the information processing device 1.
- the solid arrow represents the transmission of data from the start point to the end point of the arrow.
- the broken line arrow represents a stream transfer of data from the start point to the end point of the arrow, that is, a continuous flow of data from the transmitting side to the receiving side.
- the weight information is first transmitted from the storage unit 30 to the AI accelerator 10. Subsequently, transmission of the feature map is started from the arithmetic processing unit 20 to the AI accelerator 10. At this time, the arithmetic processing unit 20 generates a plurality of partial feature maps by dividing the overall feature map into predetermined data sizes, and sequentially transmits them to the AI accelerator 10. Further, at this time, each time the arithmetic processing unit 20 transmits each partial feature map to the AI accelerator 10, the arithmetic processing unit 20 calculates the position information indicating the position of the partial feature map in the overall feature map and transmits the position information to the AI accelerator 10. ..
- the AI accelerator 10 When the AI accelerator 10 receives the partial feature map and the position information transmitted from the arithmetic processing unit 20, the AI accelerator 10 performs a DNN operation based on these input data by using the weight information received from the storage unit 30 in advance. It is executed sequentially in the part 11. When the execution of the DNN calculation for all layers is completed, the calculation result is output to the calculation processing unit 20.
- FIG. 3 is a diagram showing a functional configuration of the DNN calculation unit 11 in the AI accelerator 10.
- the DNN calculation unit 11 corresponding to each layer of the DNN is configured to include a local storage area 12 and a kernel 13, respectively.
- the local storage area 12 has a function of temporarily storing the information input to the DNN calculation unit 11 and passing it to the kernel 13.
- the local storage area 12 stores position information 121, arithmetic layer information 122, weight information 123, and partial feature map 124.
- the position information 121 is information indicating the position of the partial feature map 124 in the original overall feature map, and is input from the arithmetic processing unit 20 or the DNN arithmetic unit 11 of the previous layer.
- the calculation layer information 122 is information representing the characteristics of the DNN calculation performed by the DNN calculation unit 11, and is stored in advance in the local storage area 12.
- the weight information 123 is information used in the convolution operation of the DNN operation executed by the DNN calculation unit 11, and is input from the storage unit 30.
- the partial feature map 124 is the calculation target data of the DNN calculation unit 11, and is input from the calculation processing unit 20 or the DNN calculation unit 11 of the previous layer.
- the kernel 13 includes a 0 padding control unit 131, a next kernel position information generation unit 132, and a convolution calculation unit 133.
- the convolution calculation unit 133 includes a weight register 301, an input register 302, a product-sum calculation unit 303, and an output register 304.
- the 0 padding control unit 131 performs processing equivalent to 0 padding based on the position information 121 for the weight information 123 loaded from the local storage area 12 and stored in the weight register 301.
- the processing equivalent to 0 padding performed here is to enable the convolution operation for the end portion of the partial feature map 124 to be executed when the partial feature map 124 includes the end portion at the position represented by the position information 121.
- This is a process of masking the portion of the weight information 123 corresponding to the position information 121 with 0 data. That is, when the 0 padding control unit 131 performs a process equivalent to 0 padding on the weight register 301, a part of the weight information 123 stored in the weight register 301 is replaced with 0 data, and masked weight information is generated. Will be done.
- the convolution calculation unit 133 loads the weight information 123 and the partial feature map 124 from the local storage area 12 into the weight register 301 and the input register 302, respectively.
- the product-sum calculation unit 303 uses the masked weight information stored in the weight register 301 and processed by the 0 padding control unit 131 to be equivalent to 0 padding, and the partial feature map stored in the input register 302. Performs a convolution operation (multiply-accumulate operation) for each data value in the partial feature map.
- the calculation result of the product-sum calculation unit 303 is stored in the output register 304, and is output from the output register 304 to the DNN calculation unit 11 or the calculation processing unit 20 of the next layer.
- the DNN calculation unit 11 of the next layer stores the calculation result as the partial feature map 124 in the local storage area 12. Then, using this partial feature map 124 as the calculation target data, the convolution calculation unit 133 executes the convolution calculation.
- the next kernel position information generation unit 132 convolves the output register 304 as a partial feature map 124 in the DNN calculation unit 11 of the next layer based on the position information 121 and the calculation layer information 122 stored in the local storage area 12. Determine where the calculation result is in the original overall feature map. Then, the position information is generated based on the determination result and output to the DNN calculation unit 11 of the next layer.
- FIG. 4 is an explanatory diagram of the process executed by the 0 padding control unit 131.
- the partial feature map 124 located at the upper right end portion of the overall feature map 401 is calculated.
- An example is shown in the case where the DNN calculation unit 11 is to perform processing equivalent to 0 padding by the 0 padding control unit 131.
- the convolution calculation is performed by stride for each data using the weight information 123 composed of 3 ⁇ 3 weight data for the partial feature map 124.
- the convolution calculation area 402 is the upper and lower sides of the overall feature map 401. It is divided into nine types of areas depending on which part of the left and right ends is included. Specifically, the convolution calculation area 402 includes a first region including the upper left corner portion, a second region including the upper end portion, a third region including the upper right corner portion, and a fourth region including the left end portion. A fifth region that does not include the end portion, a sixth region that includes the right end portion, a seventh region that includes the lower left corner portion, an eighth region that includes the lower end portion, and a ninth region that includes the lower right corner portion. Divided.
- the DNN calculation unit 11 performs this partial feature.
- the convolution calculation is performed at each position while moving the 3 ⁇ 3 weight data from the left to the right for each movement distance according to the stride with respect to the map 124. Then, when the weight data reaches the right end of the partial feature map 124 and the convolution operation at that position is completed, the weight data is shifted downward by the movement distance for the stride, and then the convolution operation is performed again from left to right. To start. In this way, the convolution operation is performed for all the positions of the partial feature map 124, so that the operation corresponding to a specific layer of the DNN operation is executed in the DNN calculation unit 11.
- the 0 padding control unit 131 has a range of the convolution calculation in the above-mentioned first to ninth regions for each position of the partial feature map 124 in which the convolution calculation is performed based on the position information 121. Determine if it belongs to a region. For example, in the partial feature map 124, it is determined that the upper left portion where the convolution operation is first performed belongs to the second region, and the upper right portion belongs to the third region. Similarly, by performing the area determination for each position of the partial feature map 124, the area determination result as shown by the reference numeral 403 can be obtained. In this region determination result 403, which region of the first to ninth regions each position of the partial feature map 124 belongs to is represented by a circled number.
- the 0 padding control unit 131 sets the masked portion for the weight information 123 stored in the weight register 301 based on the area determination result. decide.
- the convolution operation result of the partial feature map 124 and the weight information 123 after masking is weighted after performing 0 padding processing for adding 0 data for 1 row and 1 column to the end portion of the partial feature map 124.
- the masked portion is determined so as to match the calculation result when the convolution calculation is performed with the information 123.
- the mask processing as the processing equivalent to 0 padding is executed for the weight register 301.
- the masked weight information in the weight register 301 after the mask processing is executed in this way is generated.
- FIG. 5 is a diagram showing an example of arithmetic layer information 122 stored in the local storage area 12 in each DNN arithmetic unit 11.
- the calculation layer information 122 has, for example, a size change rate 501, a weight size 502, a stride 503, a padding width 504, an input feature map width 505, an input feature map height 506, an input feature map channel number 507, and an output feature map channel number 508. It is composed of each data. Each value of these data is set according to the content of the calculation performed by the DNN calculation unit 11.
- the size change rate 501 represents the change rate of the size of the partial feature map before and after the calculation.
- the weight size 502 represents the size of one side of the weight data
- the stride 503 represents the interval at which the weighting operation is performed on the partial feature map
- the padding width 504 is the width per side of the 0 data added to the partial feature map at the time of 0 padding.
- the input feature map width 505 and the input feature map height 506 represent the number of data in the horizontal direction and the vertical direction of the partial feature map to be calculated, respectively.
- the number of input feature map channels 507 and the number of output feature map channels 508 represent the number of data in the depth direction of the partial feature map before and after the calculation, respectively.
- FIG. 6 is a diagram showing an example of position information 121 stored in the local storage area 12 in each DNN calculation unit 11.
- the position information 121 is, for example, a division ID 601, an overall feature map width 602, an overall feature map height 603, an arithmetic layer 604, a start x coordinate 605, a start y coordinate 606, an end point x coordinate 607, an end point y coordinate 608, and a number of horizontal convolutions 609. , It is composed of each data of the number of vertical convolutions 610. Each value of these data is set according to the feature of the partial feature map that is input to the DNN calculation unit 11 and is the calculation target.
- the division ID 601 is information representing an ID assigned to identify each division partial feature map when the partial feature map is further divided into a plurality of parts and processed by the DNN calculation unit 11. The case where the partial feature map is divided into a plurality of parts and processed will be described in detail later as a second embodiment.
- the overall feature map width 602 and the overall feature map height 603 represent the number of data in the horizontal and vertical directions of the original overall feature map before being divided into partial feature maps, respectively.
- the calculation layer 604 is information representing the layer of the DNN to which the calculation executed in the DNN calculation unit 11 corresponds.
- the start x coordinate 605 and the start y coordinate 606 represent the coordinate values on the overall feature map of the upper left point where the convolution operation is started in the partial feature map, respectively.
- the end point x coordinate 607 and the end point y coordinate 608 represent the coordinate values on the overall feature map of the lower right point where the convolution operation is finally performed in the partial feature map.
- the number of horizontal convolutions 609 and the number of vertical convolutions 610 represent the number of horizontal and vertical convolution operations performed on the partial feature map, respectively.
- FIG. 7 is a flowchart showing the processing flow of the DNN calculation unit 11. The process shown in the flowchart of FIG. 7 is executed by each DNN calculation unit 11 included in the AI accelerator 10.
- the partial feature map to be calculated is the overall feature map based on the position information 121 and the partial feature map 124 input from the arithmetic processing unit 20 or the DNN arithmetic unit 11 of the previous layer and stored in the local storage area 12.
- Judge whether or not the upper end portion is included When the upper end portion is included, the upper end process shown in FIG. 8A is performed in step S702, and then the process proceeds to step S703. If the upper end portion is not included, the process proceeds to step S703 without executing the upper end process of step S702.
- step S703 the process of step S704 is repeatedly executed as many times as the number of vertical convolution operations for the partial feature map to be calculated, and then the process proceeds to step S705.
- step S704 the central processing shown in FIG. 8B is performed.
- step S705 it is determined whether or not the partial feature map to be calculated includes the lower end portion of the overall feature map based on the position information 121 and the partial feature map 124.
- the process proceeds to step S707 after performing the lower end processing shown in FIG. 8C in step S706. If the lower end portion is not included, the process proceeds to step S707 without executing the lower end processing of step S706.
- step S707 the next kernel position information generation unit 132 performs the position information recalculation process shown in FIG.
- the position information recalculation process in step S707 is completed, the process shown in the flowchart of FIG. 7 is completed.
- FIG. 8 is a flowchart showing the flow of the upper end processing, the central processing, and the lower end processing executed in steps S702, S704, and S706 of FIG. 7, respectively.
- step S711 it is determined whether or not the partial feature map to be calculated includes the left end portion of the overall feature map based on the position information 121 and the partial feature map 124.
- the process proceeds to step S713 after the processing for the first region is performed in step S712. If the left end portion is not included, the process proceeds to step S713 without executing the process of step S712.
- step S713 the process of step S714 is repeatedly executed as many times as the number of horizontal convolution operations for the partial feature map to be calculated, and then the process proceeds to step S715.
- step S714 processing is performed on the second region.
- step S715 it is determined whether or not the partial feature map to be calculated includes the right end portion of the overall feature map based on the position information 121 and the partial feature map 124.
- the processing for the third region is performed in step S716, and then the upper end processing shown in the flowchart of FIG. 8A is completed. If the right end portion is not included, the upper end process is terminated without executing the process of step S716.
- step S721 it is determined whether or not the partial feature map to be calculated includes the left end portion of the overall feature map based on the position information 121 and the partial feature map 124.
- the process for the fourth region is performed in step S722, and then the process proceeds to step S723. If the left end portion is not included, the process proceeds to step S723 without executing the process of step S722.
- step S723 the process of step S724 is repeatedly executed as many times as the number of horizontal convolution operations for the partial feature map to be calculated, and then the process proceeds to step S725.
- step S724 processing is performed for the fifth region.
- step S725 it is determined whether or not the partial feature map to be calculated includes the right end portion of the overall feature map based on the position information 121 and the partial feature map 124.
- the processing for the sixth region is performed in step S726, and then the central processing shown in the flowchart of FIG. 8B is completed. If the right end portion is not included, the central processing is terminated without executing the processing of step S726.
- step S731 it is determined whether or not the partial feature map to be calculated includes the left end portion of the overall feature map based on the position information 121 and the partial feature map 124.
- the process for the seventh region is performed in step S732, and then the process proceeds to step S733. If the left end portion is not included, the process proceeds to step S733 without executing the process of step S732.
- step S733 the process of step S734 is repeatedly executed as many times as the number of horizontal convolution operations for the partial feature map to be calculated, and then the process proceeds to step S735.
- step S734 processing is performed on the eighth region.
- step S735 it is determined whether or not the partial feature map to be calculated includes the right end portion of the overall feature map based on the position information 121 and the partial feature map 124.
- the processing for the ninth region is performed in step S736, and then the lower end processing shown in the flowchart of FIG. 8C is completed. If the right end portion is not included, the lower end process is terminated without executing the process of step S736.
- FIG. 9 is a flowchart showing the flow of processing for the first to ninth regions executed in steps S712, S714, S716, S722, S724, S726, S732, S734, and S736 of FIG. 8, respectively.
- step S801 the convolution calculation unit 133 reads out the weight information 123 and the partial feature map 124 stored in the local storage area 12, and stores them in the weight register 301 and the input register 302, respectively. ..
- step S802 the 0 padding control unit 131 performs a mask position determination process for determining a mask position according to the type of region.
- the mask position determination process is executed according to the procedure shown in the flowchart of FIG. 9B.
- step S803 the convolution calculation unit 133 performs mask processing on the weight register 301 according to the mask position determined by the mask position determination processing in step S802.
- mask processing is performed as processing equivalent to 0 padding.
- the mask position is not set for the fifth region, which does not require 0 padding processing, as will be described later. Therefore, in the processing of the fifth region of step S724, the mask position is not output in step S802, and therefore the mask processing is not performed in step S803.
- step S804 the convolution calculation unit 133 uses the product-sum calculation unit 303 to generate masked weight information generated by the mask processing in step S803, that is, the weight information 123 of the weight register 301 after the mask processing, and the input register 302. Performs a product-sum operation (convolution operation) with the partial feature map 124 stored in. After that, the calculation result is output from the output register 304, and the process shown in the flowchart of FIG. 9A ends.
- step S811 the area to which the partial feature map to be calculated belongs is acquired.
- the steps S712, S714, S716, S722, S724, S726, S732, S734, and S736 of FIG. Determine if it belongs.
- the 0 padding control unit 131 inquires about the mask position in the area acquired in step S811.
- the mask position corresponding to the region acquired in step S811 is queried to determine the mask position in the region. ..
- the convolution calculation result of the partial feature map 124 and the weight information 123 after masking for each region of the first to ninth regions is the end of the partial feature map 124 corresponding to each region. It is assumed that the mask position is set in advance so as to match the calculation result when the convolution calculation is performed with the weight information 123 after the 0 padding process is performed. However, the mask position is not set for the fifth region, which does not require 0 padding processing.
- the 0-padding control unit 131 can determine the mask position corresponding to the 0-padding process for each area by inquiring and using the information of the mask position preset as described above. can. Thereby, the part to be masked in the weight information 123 can be correctly determined according to the position of the end portion of the overall feature map in each area.
- step S813 the mask position determined in step S812 is output from the 0 padding control unit 131 to the convolution calculation unit 133.
- step S813 the mask position determination process shown in the flowchart of FIG. 9B is completed.
- FIG. 10 is a flowchart showing the flow of the position information recalculation process executed in step S707 of FIG.
- step S901 a partial feature is performed by a convolution operation (multiply-accumulate operation) performed by the convolution calculation unit 133 based on the value of the size change rate 501 included in the calculation layer information 122. Determine if the size of the map changes. If the value of the size change rate 501 is a value other than 1, it is determined that at least one of the horizontal and vertical sizes of the partial feature map changes, and the process proceeds to step S902. If the value of the size change rate 501 is 1, it is determined that the size of the partial feature map does not change, and the process proceeds to step S903 without executing the process of step S902.
- step S902 the next kernel position information generation unit 132 recalculates the position information 121 based on the calculation layer information 122.
- each data value included in the position information 121 is recalculated based on each data value included in the calculation layer information 122.
- each data value of the position information 121 is recalculated by each of the calculation formulas (1) to (7) shown in FIG. 10 (b).
- WW and WH represent the values of the overall feature map width 602 and the overall feature map height 603, respectively.
- x and y represent the values of the start x coordinate 605 and the start y coordinate 606, respectively
- endx and endy represent the values of the end point x coordinate 607 and the end point y coordinate 608, respectively.
- OW and OH represent values of the number of horizontal convolutions 609 and the number of vertical convolutions 610, respectively.
- IW and IH represent the values of the input feature map width 505 and the input feature map height 506 of the calculation layer information 122, respectively, and k and k + 1 represent the values of the current calculation layer and the next calculation layer in the entire DNN operation.
- the position (number of layers) is represented, respectively, and KS and stride represent the values of the weight size 502 and stride 503 of the arithmetic layer information 122, respectively.
- WW, WH, x, and y are obtained by multiplying these values in the current position information 121 by the value of the size change rate 501 of the arithmetic layer information 122, respectively, and the values after the decimal point. It is calculated by rounding up.
- endx and endy are calculated by adding IW and IH to x and y of the next layer, respectively.
- OW and OH are calculated by dividing the values obtained by subtracting KS from IW and IH by strides and adding 1 to the rounded down values.
- step S903 the next kernel position information generation unit 132 creates position information for the DNN calculation unit 11 of the next layer.
- the value of the calculation layer 604 is incremented and the DNN calculation unit 11 of the next layer is used.
- the position information of the next layer is created.
- step S904 the position information created in step S903 is transmitted from the next kernel position information generation unit 132 to the DNN calculation unit 11 of the next layer.
- step S904 the position information recalculation process shown in the flowchart of FIG. 10 is completed.
- each DNN calculation unit 11 executes the above processing, so that each position of the partial feature map input from the calculation processing unit 20 is set in the convolution calculation area of the overall feature map. Processing is performed according to the type of each area. As a result, the AI accelerator 10 can perform processing equivalent to 0 padding to generate masked weight information, and use this masked weight information to execute a convolution operation corresponding to each layer of DNN.
- FIG. 11 is a diagram showing an example of data arrangement and mask locations of the weight register 301 and the input register 302.
- the weight register 301 stores the values of the three horizontal data in the 32 weight data.
- the data values of the portions with numbers 0 to 95 are stored in the weight register 301, respectively. These numbers correspond to the numbers assigned to each storage location of the weight register 301. It should be noted that the weight data value is not contained in the storage location in which the numbers 96 to 127 are attached in the weight register 301.
- the data values of the portions of the partial feature maps 124 for 4 channels loaded from the local storage area 12 to which the numbers 0 to 27 are attached are respectively. Stored. Similar to the weight register 301, these numbers also correspond to the numbers assigned to each storage location of the input register 302. It should be noted that any data value such as the same data value as any of the other storage locations can be stored in the first four storage locations marked with "x" in the input register 302.
- the information processing apparatus 1 executes a DNN calculation on a feature map, and is a calculation processing unit 20, an AI accelerator 10 connected to the calculation processing unit 20 via a bus, and a DNN calculation.
- a storage unit 30 for storing weight information to be used is provided.
- the arithmetic processing unit 20 transmits the partial feature map 124, which is a part of the feature map, and the position information 121 indicating the position of the partial feature map 124 in the feature map to the AI accelerator 10.
- the AI accelerator 10 acquires the weight information 123 from the storage unit 30, and receives the partial feature map 124 and the position information 121 transmitted from the arithmetic processing unit 20.
- a predetermined preprocessing based on the position information 121 is executed (steps S811 to S813, S803), and a DNN operation is executed using the execution result of the preprocessing and the partial feature map 124 (step S804). Since this is done, in the information processing apparatus 1 that performs DNN calculation using the two calculation units of the AI accelerator 10 and the calculation processing unit 20, the AI accelerator 10 can perform preprocessing corresponding to 0 padding processing. , The amount of data communication between these two arithmetic units can be reduced.
- the pre-processing executed by the AI accelerator 10 is a process of masking the portion corresponding to the position information 121 in the weight information 123.
- the AI accelerator 10 executes a product-sum operation as a DNN operation in step S804 using the masked weight information generated by performing the preprocessing and the partial feature map 124. Since this is done, pre-processing corresponding to 0 padding processing can be realized as the processing that can be executed in the AI accelerator 10.
- the AI accelerator 10 determines to which region the partial feature map 124 belongs among the plurality of regions set in the feature map based on the position information 121 (steps S701 to S707, S711 to S716, S721). ⁇ S726, S731 ⁇ S736), the process of masking the portion corresponding to the area is executed as a preprocess in steps S811 to S813, S803.
- the plurality of regions set in the feature map include a first region including the upper left corner portion of the feature map 401 and a second region including the upper end portion of the feature map 401.
- the AI accelerator 10 masks the portion to be masked in the weight information 123 in steps S811 and S812 according to the position of the end portion of the feature map in the region.
- the masking process is not executed in step S803. Since this is done, preprocessing corresponding to 0 padding processing can be reliably performed.
- the AI accelerator 10 has a plurality of calculation cores specialized for vector calculation, and executes a DNN calculation by AI processing using the plurality of calculation cores. Since this is done, the DNN operation can be executed at high speed.
- the AI accelerator 10 has a plurality of kernels 13 corresponding to each layer of the DNN.
- the kernel 13 recalculates the position information 121.
- Step S902 Sends to the kernel 13 corresponding to the next layer (step S904). Therefore, in the DNN operation using the DNN composed of a plurality of layers, the preprocessing corresponding to the 0 padding process by the AI accelerator 10 can be applied.
- the partial feature map 124 is vertically divided into a plurality of parts, and the calculation for one layer is executed by the plurality of kernels 13 possessed by the DNN calculation unit 11. An example of doing so will be described.
- the DNN calculation unit 11 performs the calculation for one layer of the DNN for any one of the DNN calculation units 11.
- the kernel 13 will be possessed by the number of divisions of the partial feature map 124 at the time of performing.
- the configuration of the information processing apparatus 1 in the present embodiment, the configuration of the AI accelerator 10, the configuration of the DNN calculation unit 11 other than the number of kernels 13, and the configuration of the kernel 13 are shown in FIGS. 1 and 3 in the first embodiment. It is similar to the one described. Therefore, these explanations will be omitted below.
- FIG. 12 is an explanatory diagram of arithmetic processing according to the second embodiment of the present invention.
- FIG. 12 shows an example in which the partial feature map 124 is divided into three and the calculation is performed in the middle layer of the second layer among the operations for the three layers.
- the DNN calculation unit 11 for three layers has the divided kernel 1201 of the first layer DNN calculation unit 11 and the three intermediate kernels 1202 of the second layer DNN calculation unit 11.
- Each of these kernels has the same configuration as the kernel 13 in the first embodiment shown in FIG.
- the divided kernel 1201 generates three divided partial feature maps 1204 by dividing the partial feature map 124 into three after performing the processing of the first layer, and sends the divided kernel 1201 to the DNN calculation unit 11 of the next layer.
- the intermediate kernel 1202 processes each of the divided partial feature maps 1204 sent from the divided kernel 1201 and sends them to the DNN calculation unit 11 of the next layer.
- the merge kernel 1203 merges the divided partial feature maps 1204 processed by the three intermediate kernels 1202, and then performs the processing of the third layer.
- the split kernel 1201 When the split kernel 1201 generates the three split partial feature maps 1204, the split kernel 1201 creates the position information 121 corresponding to each split partial feature map 1204. At that time, the value of the division ID 601 of the data of the position information 121 shown in FIG. 6 is set in the order of 0, 1, 2 from the one with the smallest start x coordinate. Further, the values of the end point x coordinate 607 and the end point y coordinate 608 are changed to the values corresponding to each divided partial feature map 1204. The position information 121 created in this way is transmitted to each division kernel 1201 together with the division partial feature map 1204.
- the intermediate kernel 1202 performs the same processing as in the first embodiment for each divided partial feature map 1204.
- the merge kernel 1203 receives the position information 121 together with the processed divided partial feature map 1204 from each intermediate kernel 1202, the merged partial feature map 1204 is merged and returned to one partial feature map 124.
- the values of the start x coordinate 605 and the start y coordinate 606 of the position information 121 having the smallest value of the division ID 601 and the values of the end point x coordinate 607 and the end point y coordinate 608 of the position information 121 having the largest value of the division ID 601 Is used to update the position information 121 with respect to the merged partial feature map 124.
- a convolution operation corresponding to the third layer is performed.
- the partial feature map 124 is continuously input a plurality of times in the DNN calculation unit 11 of any of the AI accelerators 10, and the calculation result of the plurality of partial feature maps 124 is input to the DNN calculation unit 11 of the next layer.
- An example of sending all at once will be described.
- the configuration of the information processing apparatus 1, the configuration of the AI accelerator 10, the configuration of the DNN calculation unit 11, and the configuration of the kernel 13 in the present embodiment are the same as those described with reference to FIGS. 1 and 3 in the first embodiment, respectively. Is. Therefore, these explanations will be omitted below.
- FIG. 13 is an explanatory diagram of arithmetic processing according to the third embodiment of the present invention.
- kernel 13 of each DNN calculation unit 11 that performs operations for three layers is shown by kernel 0, kernel 1, and kernel 2, respectively.
- the kernel 0 transfers the arithmetically processed partial feature map 124 and the position information 121 of the partial feature map 124 to the kernel 1 as in the first embodiment.
- the kernel 1 processes the partial feature map 124 in the same manner as in the first embodiment, but if the data necessary for the calculation of the kernel 2 in the next layer is not available, the calculation result of the partial feature map 124 and its partial features are not available.
- the position information 121 corresponding to the map 124 is not transmitted to the kernel 2.
- Kernel 0 sends data to kernel 1 for the second time, and the partial feature map 124 processed by kernel 1 using the data and the partial feature map 124 processed for the first time are used for the calculation in kernel 2.
- the kernel 1 transmits the partial feature map 124 and the position information 121 to the kernel 2.
- kernel 13 kernel 0 to kernel 2 of each layer of AI accelerator 10
- the number of kernel executions indicating the number of operation executions in the kernel and the data from the kernel to the kernel of the next layer It holds the number of outputs that represent the number of operations required for output. Then, by executing the process shown in the flowchart of FIG. 13A based on these information, the output timing control of the partial feature map 124 and the position information 121 is performed in each kernel.
- step S1301 1 is added to the number of executions held.
- the initial value of the number of executions is 0.
- step S1302 the remainder when the number of executions held is divided by the number of outputs is obtained, and it is determined whether or not the remainder is 0. If the remainder is 0, the process proceeds to step S1303, and if it is not 0, the process shown in the flowchart of FIG. 13A is terminated without executing the process of step S1303.
- step S1303 the position information 121 is updated, and the updated position information 121 and the partial feature map 124 are output to the kernel of the next layer.
- step S1303 the number of executions is reset to the initial value of 0, and then the process shown in the flowchart of FIG. 13A ends.
- the configuration of the information processing apparatus 1, the configuration of the AI accelerator 10, the configuration of the DNN calculation unit 11, and the configuration of the kernel 13 in the present embodiment are the same as those described with reference to FIGS. 1 and 3 in the first embodiment, respectively. Is. Therefore, these explanations will be omitted below.
- FIG. 14 is a diagram showing an example of data arrangement of the weight register 301 and the input register 302 when the mask processing according to the fourth embodiment of the present invention is not required.
- the weight information 123 is composed of 3 ⁇ 3 weight data
- a total of 32 weight data for 4 input channels and 8 output channels are stored in the weight register 301 at one time.
- the stored example is shown.
- the mask processing is performed on the range indicated by reference numeral 1401 at the time of processing the first line of the 3 ⁇ 3 weight data. That is, the mask processing is performed on all the storage locations where the weight data is stored in the weight register 301.
- the mask processing when the mask processing is performed on all the weight data stored in the weight register 301, the mask processing may be omitted and the calculation result may be simply set to 0 data without performing the convolution operation itself. The same result as the convolution operation after masking is obtained. By doing so, it is possible to eliminate unnecessary arithmetic processing and achieve high speed.
- the example of the convolution operation at the position belonging to the first area is described here, the mask processing is performed on all the weight data stored in the weight register 301 at the positions belonging to the other areas as well. If so, the masking process and the convolution operation can be omitted.
- the AI accelerator 10 has described an example in which a process of masking a portion corresponding to the position information 121 in the weight information 123 is performed as a preprocessing corresponding to the 0 padding process.
- the 0 padding process may be performed at 10 and the DNN operation may be executed using the partial feature map 124 that has undergone the 0 padding process. Even in this way, the same effect as described in the first embodiment can be obtained.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Pure & Applied Mathematics (AREA)
- Mathematical Optimization (AREA)
- Mathematical Analysis (AREA)
- Computational Mathematics (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Algebra (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Complex Calculations (AREA)
- Image Processing (AREA)
Abstract
情報処理装置は、第1の演算部と、前記第1の演算部とバスを介して接続された第2の演算部と、DNN演算で利用される重み情報を格納する記憶部と、を備え、前記第1の演算部は、特徴マップの一部である部分特徴マップと、前記部分特徴マップの前記特徴マップ中の位置を表す位置情報とを前記第2の演算部へ送信し、前記第2の演算部は、前記記憶部から前記重み情報を取得し、前記第1の演算部から送信される前記部分特徴マップおよび前記位置情報を受信し、前記位置情報に基づく所定の前処理を実行し、前記前処理の実行結果と前記部分特徴マップとを用いて、前記DNN演算を実行する。
Description
本発明は、情報処理装置および情報処理方法に関する。
従来、カメラの撮影画像や各種センサの情報から車両の周囲状況を認識し、その認識結果に基づいて様々な運転支援を行う技術が広く利用されている。こうした車両の運転支援技術において、近年では複雑な周囲状況に対して高精度な認識結果を得るために、人間の大脳における神経細胞の働きをモデル化したディープニューラルネットワーク(DNN)を利用した演算を行うことが提案されている。
従来のDNN演算では、多数の演算を並列で高速に実行するために、FPGA(Field Programmable Gate Array)やGPU(Graphics Processing Unit)が広く利用されている。近年では、こうしたFPGAやGPUの代わりに、AIアクセラレータと呼ばれるデバイスの利用が進んでいる。AIアクセラレータとは、複数の演算コアを有しており、ベクトル型演算を得意とするAI処理に特化した演算装置の一種である。
AIアクセラレータは、上記のようにDNN演算におけるベクトル型演算に特化したものであるが、DNN演算に必要な処理の全てを実行することはできず、一部の処理については実行が困難である。そのため、従来のAIアクセラレータを用いたDNN演算では、AIアクセラレータとは別の演算処理部をAIアクセラレータに接続し、これらを協調動作させることでDNN演算を行っていた。この場合、DNNの各層についてAIアクセラレータと演算処理部がそれぞれの演算結果を受け渡すために、層ごとにデータ転送を行う必要がある。したがって、AIアクセラレータと演算処理部の間でのデータ通信量が増大し、そのために広いバス帯域幅が必要となり、さらに演算処理部ではメモリリソースの使用率が大きくなってしまう。このように、AIアクセラレータと演算処理部のような2つの演算部を用いてDNN演算を実行する従来の情報処理装置では、2つの演算部の間でのデータ通信量の増大によって様々な問題が生じる。なお、演算処理部には、例えば汎用のマイクロコンピュータ、プログラマブル集積回路、プログラマブル論理デバイス、システムオンチップなど、演算処理が可能な様々なデバイスを利用することが可能である。
AIアクセラレータでは実行困難なDNN演算における処理の一つに、0パディングと呼ばれる処理がある。0パディングとは、DNN演算の対象とされる特徴マップの端部分のデータの畳み込みを可能とするために、特徴マップの周囲に0データを挿入する処理のことである。すなわち、DNN演算において畳み込み演算はベクトル同士の積和演算であるため、AIアクセラレータを用いて実行することが可能であるが、畳み込み演算の前処理として必要な0パディングはベクトルを用いた演算ではないため、AIアクセラレータでの実行が困難である。
DNN演算での処理負荷の軽減に関して、特許文献1の技術が知られている。特許文献1には、特徴マップを格納したグローバルメモリと、重みデータを格納したローカルメモリと、演算処理回路とを備え、これらを用いて畳み込み演算を行うシステムが開示されている。このシステムでは、演算処理回路へのデータ送信速度がグローバルメモリよりもローカルメモリの方が速い場合に、演算処理回路で受信した入力特徴マップの同じ受信部分に対して複数の畳み込み演算を行うことで、メモリ回路網を往復するデータの移動を減らすようにしている。
特許文献1の技術は、畳み込み演算におけるデータの移動を低減する技術であり、0パディング処理のようにAIアクセラレータでは実行困難な処理を演算処理回路で実行する際のデータ転送量を削減するものではない。したがって、AIアクセラレータと演算処理部のような2つの演算部の間でのデータ通信量を削減することはできず、前述のような問題を解消するのは困難である。
本発明による情報処理装置は、特徴マップに対してDNN演算を実行するものであって、第1の演算部と、前記第1の演算部とバスを介して接続された第2の演算部と、前記DNN演算で利用される重み情報を格納する記憶部と、を備え、前記第1の演算部は、前記特徴マップの一部である部分特徴マップと、前記部分特徴マップの前記特徴マップ中の位置を表す位置情報とを前記第2の演算部へ送信し、前記第2の演算部は、前記記憶部から前記重み情報を取得し、前記第1の演算部から送信される前記部分特徴マップおよび前記位置情報を受信し、前記位置情報に基づく所定の前処理を実行し、前記前処理の実行結果と前記部分特徴マップとを用いて、前記DNN演算を実行する。
本発明による情報処理方法は、第1の演算部と、前記第1の演算部とバスを介して接続された第2の演算部と、DNN演算で利用される重み情報を格納する記憶部と、を備える情報処理装置を用いて、特徴マップに対してDNN演算を実行するものであって、前記第1の演算部により、前記特徴マップの一部である部分特徴マップと、前記部分特徴マップの前記特徴マップ中の位置を表す位置情報を前記第2の演算部へ送信し、前記第2の演算部により、前記記憶部から前記重み情報を取得し、前記第1の演算部から送信される前記部分特徴マップおよび前記位置情報を受信し、前記位置情報に基づく所定の前処理を実行し、前記前処理の実行結果と前記部分特徴マップとを用いて、前記DNN演算を実行する。
本発明による情報処理方法は、第1の演算部と、前記第1の演算部とバスを介して接続された第2の演算部と、DNN演算で利用される重み情報を格納する記憶部と、を備える情報処理装置を用いて、特徴マップに対してDNN演算を実行するものであって、前記第1の演算部により、前記特徴マップの一部である部分特徴マップと、前記部分特徴マップの前記特徴マップ中の位置を表す位置情報を前記第2の演算部へ送信し、前記第2の演算部により、前記記憶部から前記重み情報を取得し、前記第1の演算部から送信される前記部分特徴マップおよび前記位置情報を受信し、前記位置情報に基づく所定の前処理を実行し、前記前処理の実行結果と前記部分特徴マップとを用いて、前記DNN演算を実行する。
本発明によれば、2つの演算部を用いてDNN演算を行う情報処理装置において、2つの演算部の間でのデータ通信量を削減することができる。
(第1の実施形態)
図1は、本発明の一実施形態に係る情報処理装置の構成を示す図である。本実施形態の情報処理装置1は、外部から入力される特徴マップに対してDNN演算を実行するものであり、図1に示すように、AIアクセラレータ10、演算処理部20および記憶部30を備えて構成される。
図1は、本発明の一実施形態に係る情報処理装置の構成を示す図である。本実施形態の情報処理装置1は、外部から入力される特徴マップに対してDNN演算を実行するものであり、図1に示すように、AIアクセラレータ10、演算処理部20および記憶部30を備えて構成される。
演算処理部20は、例えばマイクロコンピュータを用いて構成されており、所定の演算処理を実行する。演算処理部20には、不図示の外部装置から、DNN演算の実行対象である特徴マップが入力される。例えば、車両に搭載されたカメラによって撮影された画像や、車両に搭載されたLiDAR(Light Detection and Ranging)やレーダによって取得された距離情報などが、車両周辺の物体認識を行うための特徴マップとして演算処理部20に入力される。なお、記憶部30に記憶された特徴マップを演算処理部20に入力してもよい。
記憶部30は、例えばHDD(Hard Disk Drive)やSSD(Solid State Drive)等の不揮発性の記録媒体を用いて構成されており、情報処理装置1が行うDNN演算において利用される情報が格納されている。記憶部30に格納されている情報には、例えばDNN演算における畳み込み演算に使用される重み情報などが含まれる。
AIアクセラレータ10は、ベクトル型演算を得意とするAI処理に特化した演算装置の一種であり、演算処理部20とバスを介して接続されている。AIアクセラレータ10には、演算処理部20に入力された特徴マップの一部が演算処理部20からバスを介して送信される。以下では、演算処理部20に入力される特徴マップを「全体特徴マップ」、演算処理部20からAIアクセラレータ10へ送信される特徴マップの一部を「部分特徴マップ」とそれぞれ称することで、これらを互いに区別する。また、部分特徴マップの全体特徴マップ中の位置を表す位置情報も、部分特徴マップとともに演算処理部20からバスを介して送信される。
AIアクセラレータ10は、DNNの各層に対応してN個のDNN演算部11を有している。各DNN演算部11は、AIアクセラレータ10において第1層から第N層まで順に接続されており、各層のDNN演算を行うカーネル13(図3参照)を有している。
第1層のDNN演算部11には、演算処理部20からAIアクセラレータ10へ送信される部分特徴マップおよび位置情報が入力されるとともに、記憶部30から重み情報が入力される。第1層のDNN演算部11は、これらの入力データに基づいて第1層のDNN演算を実行し、その演算結果を次層(第2層)のDNN演算部11へ出力する。第2層のDNN演算部11は、前層(第1層)のDNN演算部11の演算結果と、記憶部30から入力される重み情報とに基づいて、第2層のDNN演算を実行し、その演算結果を次層のDNN演算部11へ出力する。これ以降の各層のDNN演算部11でも、同様の演算処理が行われる。なお、最終層(第N層)のDNN演算部11の演算結果は、AIアクセラレータ10による最終的なDNN演算の結果として、演算処理部20へ出力される。このようにして、各層のDNN演算部11が対応する層のDNN演算をそれぞれ行うことにより、AIアクセラレータ10においてDNN演算が実行される。
図2は、情報処理装置1の構成要素であるAIアクセラレータ10、演算処理部20および記憶部30の間で送受信される情報の流れを示す図である。図2において、実線の矢印は、矢印の起点から終点に向けたデータの送信を表している。また、破線の矢印は、矢印の起点から終点に向けたデータのストリーム転送、すなわち送信側から受信側への連続したデータの流れを表している。
情報処理装置1においてDNN演算の実行が開始されると、まず記憶部30からAIアクセラレータ10に向けて重み情報が送信される。続いて、演算処理部20からAIアクセラレータ10へ特徴マップの送信が開始される。このとき演算処理部20は、全体特徴マップを所定のデータサイズごとに分割することで複数の部分特徴マップを生成し、順次AIアクセラレータ10へ送信する。さらにこのとき、演算処理部20は、各部分特徴マップをAIアクセラレータ10へ送信するごとに、当該部分特徴マップの全体特徴マップ中での位置を表す位置情報を算出し、AIアクセラレータ10へ送信する。
AIアクセラレータ10は、演算処理部20から送信された部分特徴マップおよび位置情報を受信すると、事前に記憶部30から受信した重み情報を用いて、これらの入力データに基づくDNN演算を各層のDNN演算部11において順次実行する。全ての層についてDNN演算の実行を終えたら、その演算結果を演算処理部20に出力する。
図3は、AIアクセラレータ10におけるDNN演算部11の機能構成を示す図である。AIアクセラレータ10において、DNNの各層に対応するDNN演算部11は、ローカル記憶領域12およびカーネル13をそれぞれ備えて構成される。
ローカル記憶領域12は、DNN演算部11に入力された情報を一時的に記憶してカーネル13に受け渡す機能を有する。ローカル記憶領域12には、位置情報121、演算層情報122、重み情報123および部分特徴マップ124が格納される。位置情報121は、部分特徴マップ124が元の全体特徴マップにおいてどの位置にあるかを表す情報であり、演算処理部20または前層のDNN演算部11から入力される。演算層情報122は、当該DNN演算部11が実行するDNN演算の特徴を表す情報であり、ローカル記憶領域12において予め格納される。重み情報123は、当該DNN演算部11が実行するDNN演算の畳み込み演算において用いられる情報であり、記憶部30から入力される。部分特徴マップ124は、当該DNN演算部11の演算対象データであり、演算処理部20または前層のDNN演算部11から入力される。
カーネル13は、0パディング制御部131、次カーネル位置情報生成部132および畳み込み演算部133を備える。畳み込み演算部133は、重みレジスタ301、入力レジスタ302、積和演算部303および出力レジスタ304を備える。
0パディング制御部131は、ローカル記憶領域12からロードされて重みレジスタ301に格納された重み情報123に対して、位置情報121に基づく0パディング相当の処理を行う。ここで行われる0パディング相当の処理とは、位置情報121により表される位置において部分特徴マップ124が全体特徴マップの端部を含む場合に、その端部に対する畳み込み演算を実行可能とするため、重み情報123において位置情報121に対応する箇所を0データでマスクする処理のことである。すなわち、0パディング制御部131が重みレジスタ301に対して0パディング相当の処理を行うことにより、重みレジスタ301に格納された重み情報123の一部が0データに置き換えられ、マスク済み重み情報が生成される。
畳み込み演算部133は、ローカル記憶領域12から、重み情報123と部分特徴マップ124を重みレジスタ301と入力レジスタ302にそれぞれロードする。積和演算部303は、重みレジスタ301に格納されて0パディング制御部131により0パディング相当の処理が行われたマスク済み重み情報と、入力レジスタ302に格納された部分特徴マップとを用いて、部分特徴マップの各データ値に対する畳み込み演算(積和演算)を実行する。積和演算部303の演算結果は出力レジスタ304に格納され、出力レジスタ304から次層のDNN演算部11または演算処理部20に出力される。
出力レジスタ304より出力された演算結果が次層のDNN演算部11に入力されると、次層のDNN演算部11は、その演算結果を部分特徴マップ124としてローカル記憶領域12に格納する。そして、この部分特徴マップ124を演算対象データとして、畳み込み演算部133により畳み込み演算を実行する。
次カーネル位置情報生成部132は、ローカル記憶領域12に格納された位置情報121および演算層情報122に基づいて、次層のDNN演算部11における部分特徴マップ124として出力レジスタ304から送信される畳み込み演算結果が、元の全体特徴マップにおいてどの位置にあるかを判別する。そして、この判別結果に基づいて位置情報を生成し、次層のDNN演算部11へ出力する。
図4は、0パディング制御部131により実行される処理の説明図である。図4では、演算処理部20において全体特徴マップ401が縦方向と横方向にそれぞれ5分割された各部分特徴マップのうち、全体特徴マップ401の右上端部分に位置する部分特徴マップ124を演算対象とするDNN演算部11において、0パディング制御部131によって0パディング相当の処理を行う場合の例を示している。なお、図4の例では、部分特徴マップ124に対して3×3の重みデータで構成される重み情報123を用いて、1データごとのストライドにより畳み込み演算を行うものとしている。
図4に示すように、畳み込み演算時に3×3の重みデータが全体特徴マップ401上を移動する範囲の領域を畳み込み演算領域402とすると、この畳み込み演算領域402は、全体特徴マップ401が有する上下左右の端部のうちどの部分が含まれるかにより、9種類の領域に分けられる。具体的には、畳み込み演算領域402は、左上角部を含む第1領域と、上端部を含む第2領域と、右上角部を含む第3領域と、左端部を含む第4領域と、いずれの端部も含まない第5領域と、右端部を含む第6領域と、左下角部を含む第7領域と、下端部を含む第8領域と、右下角部を含む第9領域と、に分けられる。
ここで、全体特徴マップ401を分割した各部分特徴マップのうち、例えば前述のように全体特徴マップ401の右上に位置する部分特徴マップ124が入力された場合、DNN演算部11は、この部分特徴マップ124に対して、3×3の重みデータを左から右に向かってストライドに応じた移動距離ずつ移動させながら、各位置での畳み込み演算を行う。そして、重みデータが部分特徴マップ124の右端まで到達してその位置での畳み込み演算が終了すると、重みデータをストライド分の移動距離だけ下方向にずらした後、再び左から右に向かって畳み込み演算を開始する。このようにして、部分特徴マップ124の全ての位置に対して畳み込み演算が行われることにより、DNN演算の特定の層に対応する演算がDNN演算部11において実行される。
DNN演算部11において0パディング制御部131は、位置情報121に基づいて、畳み込み演算が行われる部分特徴マップ124の位置ごとに、その畳み込み演算の範囲が前述の第1~第9領域のうちどの領域に属するかを判定する。例えば、部分特徴マップ124において最初に畳み込み演算が行われる左上の部分は第2領域に属し、右上の部分は第3領域に属すると判定される。同様にして、部分特徴マップ124の各位置について領域判定が行われることにより、符号403に示すような領域判定結果が得られる。この領域判定結果403では、部分特徴マップ124の各位置が第1~第9領域のうちどの領域に属するかを丸数字で表している。
上記のようにして部分特徴マップ124の各位置に対する領域判定結果が得られたら、0パディング制御部131は、この領域判定結果に基づいて、重みレジスタ301に格納された重み情報123に対するマスク箇所を決定する。ここでは、部分特徴マップ124とマスク後の重み情報123との畳み込み演算結果が、部分特徴マップ124の端部分に対して1行1列分の0データを付加する0パディング処理を行った後に重み情報123で畳み込み演算を行ったときの演算結果と一致するように、マスク箇所を決定する。そして、重みレジスタ301において決定したマスク箇所の重み情報123の値を0とすることにより、重みレジスタ301に対して、0パディング相当の処理としてのマスク処理を実行する。こうしてマスク処理が実行された後の重みレジスタ301におけるマスク済み重み情報を生成する。
なお、第5領域に属する位置では0パディング処理が不要である。そのため、第5領域に属する位置において畳み込み演算が行われるときには、0パディング制御部131によるマスク処理を実行する必要がない。
図5は、各DNN演算部11においてローカル記憶領域12に格納される演算層情報122の例を示す図である。演算層情報122は、例えばサイズ変化率501、重みサイズ502、ストライド503、パディング幅504、入力特徴マップ幅505、入力特徴マップ高さ506、入力特徴マップチャンネル数507、出力特徴マップチャンネル数508の各データにより構成される。これらのデータは、当該DNN演算部11が行う演算の内容に対応して、それぞれの値が設定される。
サイズ変化率501は、演算前後での部分特徴マップのサイズの変化率を表している。重みサイズ502は重みデータの一辺のサイズを表し、ストライド503は部分特徴マップに対して重み付け演算を行う間隔を表し、パディング幅504は0パディング時に部分特徴マップに付加する0データの一辺あたりの幅を表している。入力特徴マップ幅505および入力特徴マップ高さ506は、演算対象とする部分特徴マップの水平方向と垂直方向のデータ数をそれぞれ表している。入力特徴マップチャンネル数507および出力特徴マップチャンネル数508は、演算前後での部分特徴マップの深さ方向のデータ数をそれぞれ表している。
図6は、各DNN演算部11においてローカル記憶領域12に格納される位置情報121の例を示す図である。位置情報121は、例えば分割ID601、全体特徴マップ幅602、全体特徴マップ高さ603、演算層604、開始x座標605、開始y座標606、終点x座標607、終点y座標608、横畳み込み数609、縦畳み込み数610の各データにより構成される。これらのデータは、当該DNN演算部11に入力されて演算対象とされる部分特徴マップの特徴に対応して、それぞれの値が設定される。
分割ID601は、当該DNN演算部11において部分特徴マップをさらに複数に分割して処理する場合に、各分割部分特徴マップをそれぞれ識別するために付与されるIDを表す情報である。なお、部分特徴マップを複数に分割して処理する場合については、後で第2の実施形態として詳しく説明する。
全体特徴マップ幅602および全体特徴マップ高さ603は、部分特徴マップに分割される前の元の全体特徴マップの水平方向と垂直方向のデータ数をそれぞれ表している。
演算層604は、当該DNN演算部11において実行される演算が対応するDNNの層を表す情報である。
開始x座標605および開始y座標606は、部分特徴マップにおいて畳み込み演算が開始される左上の点の全体特徴マップ上での座標値をそれぞれ表している。終点x座標607および終点y座標608は、部分特徴マップにおいて畳み込み演算が最後に行われる右下の点の全体特徴マップ上での座標値をそれぞれ表している。横畳み込み数609および縦畳み込み数610は、部分特徴マップに対して行われる畳み込み演算の横方向と縦方向での回数をそれぞれ表している。
次に、AIアクセラレータ10におけるDNN演算部11の処理の流れについて説明する。図7は、DNN演算部11の処理の流れを示すフローチャートである。図7のフローチャートに示す処理は、AIアクセラレータ10が有する各DNN演算部11において実行される。
ステップS701では、演算処理部20または前層のDNN演算部11から入力されてローカル記憶領域12に格納された位置情報121および部分特徴マップ124に基づき、演算対象の部分特徴マップが全体特徴マップの上端部分を含むか否かを判定する。上端部分を含む場合は、ステップS702で図8(a)に示す上端処理を行った後にステップS703へ進む。上端部分を含まない場合は、ステップS702の上端処理を実行せずにステップS703へ進む。
ステップS703では、演算対象の部分特徴マップに対する垂直方向の畳み込み演算の回数分だけステップS704の処理を繰り返し実行し、その後にステップS705へ進む。ステップS704では、図8(b)に示す中央処理を行う。
ステップS705では、位置情報121および部分特徴マップ124に基づき、演算対象の部分特徴マップが全体特徴マップの下端部分を含むか否かを判定する。下端部分を含む場合は、ステップS706で図8(c)に示す下端処理を行った後にステップS707へ進む。下端部分を含まない場合は、ステップS706の下端処理を実行せずにステップS707へ進む。
ステップS707では、次カーネル位置情報生成部132により、図10に示す位置情報再演算処理を行う。ステップS707の位置情報再演算処理を終えたら、図7のフローチャートに示す処理を終了する。
図8は、図7のステップS702、S704、S706でそれぞれ実行される上端処理、中央処理および下端処理の流れを示すフローチャートである。
図8(a)に示す上端処理において、ステップS711では、位置情報121および部分特徴マップ124に基づき、演算対象の部分特徴マップが全体特徴マップの左端部分を含むか否かを判定する。左端部分を含む場合は、ステップS712で第1領域に対する処理を行った後にステップS713へ進む。左端部分を含まない場合は、ステップS712の処理を実行せずにステップS713へ進む。
ステップS713では、演算対象の部分特徴マップに対する水平方向の畳み込み演算の回数分だけステップS714の処理を繰り返し実行し、その後にステップS715へ進む。ステップS714では、第2領域に対する処理を行う。
ステップS715では、位置情報121および部分特徴マップ124に基づき、演算対象の部分特徴マップが全体特徴マップの右端部分を含むか否かを判定する。右端部分を含む場合は、ステップS716で第3領域に対する処理を行った後に、図8(a)のフローチャートに示す上端処理を終了する。右端部分を含まない場合は、ステップS716の処理を実行せずに上端処理を終了する。
図8(b)に示す中央処理において、ステップS721では、位置情報121および部分特徴マップ124に基づき、演算対象の部分特徴マップが全体特徴マップの左端部分を含むか否かを判定する。左端部分を含む場合は、ステップS722で第4領域に対する処理を行った後にステップS723へ進む。左端部分を含まない場合は、ステップS722の処理を実行せずにステップS723へ進む。
ステップS723では、演算対象の部分特徴マップに対する水平方向の畳み込み演算の回数分だけステップS724の処理を繰り返し実行し、その後にステップS725へ進む。ステップS724では、第5領域に対する処理を行う。
ステップS725では、位置情報121および部分特徴マップ124に基づき、演算対象の部分特徴マップが全体特徴マップの右端部分を含むか否かを判定する。右端部分を含む場合は、ステップS726で第6領域に対する処理を行った後に、図8(b)のフローチャートに示す中央処理を終了する。右端部分を含まない場合は、ステップS726の処理を実行せずに中央処理を終了する。
図8(c)に示す下端処理において、ステップS731では、位置情報121および部分特徴マップ124に基づき、演算対象の部分特徴マップが全体特徴マップの左端部分を含むか否かを判定する。左端部分を含む場合は、ステップS732で第7領域に対する処理を行った後にステップS733へ進む。左端部分を含まない場合は、ステップS732の処理を実行せずにステップS733へ進む。
ステップS733では、演算対象の部分特徴マップに対する水平方向の畳み込み演算の回数分だけステップS734の処理を繰り返し実行し、その後にステップS735へ進む。ステップS734では、第8領域に対する処理を行う。
ステップS735では、位置情報121および部分特徴マップ124に基づき、演算対象の部分特徴マップが全体特徴マップの右端部分を含むか否かを判定する。右端部分を含む場合は、ステップS736で第9領域に対する処理を行った後に、図8(c)のフローチャートに示す下端処理を終了する。右端部分を含まない場合は、ステップS736の処理を実行せずに下端処理を終了する。
図9は、図8のステップS712、S714、S716、S722、S724、S726、S732、S734、S736においてそれぞれ実行される第1~第9領域に対する処理の流れを示すフローチャートである。
図9(a)のフローチャートにおいて、ステップS801では、畳み込み演算部133により、ローカル記憶領域12に格納されている重み情報123と部分特徴マップ124を読み出し、重みレジスタ301と入力レジスタ302にそれぞれ格納する。
ステップS802では、0パディング制御部131により、領域の種類に応じたマスク位置を決定するマスク位置決定処理を行う。ここでは、図9(b)のフローチャートに示す手順に従ってマスク位置決定処理が実行される。
ステップS803では、畳み込み演算部133により、ステップS802のマスク位置決定処理で決定されたマスク位置に従って、重みレジスタ301に対するマスク処理を行う。ここでは前述のように、重みレジスタ301に格納された重み情報123においてマスク位置の値を0データでマスクすることにより、0パディング相当の処理としてマスク処理を行う。ただし、0パディング処理が不要な第5領域については、後述するようにマスク位置が設定されていない。そのため、ステップS724の第5領域の処理では、ステップS802でマスク位置が出力されず、そのためステップS803においてマスク処理が行われない。
ステップS804では、畳み込み演算部133により、積和演算部303を用いて、ステップS803のマスク処理によって生成されたマスク済み重み情報、すなわちマスク処理後の重みレジスタ301の重み情報123と、入力レジスタ302に格納された部分特徴マップ124との積和演算(畳み込み演算)を行う。その後、出力レジスタ304から演算結果を出力し、図9(a)のフローチャートに示す処理を終了する。
図9(b)に示すマスク位置決定処理において、ステップS811では、演算対象の部分特徴マップが属する領域を取得する。ここでは、図8のステップS712、S714、S716、S722、S724、S726、S732、S734、S736のどの処理でマスク位置決定処理が実行されているかにより、第1~第9領域のうちどの領域に属するかを判定する。
ステップS812では、0パディング制御部131により、ステップS811で取得した領域でのマスク位置を照会する。ここでは、第1~第9領域の各領域に対して予め設定されたマスク位置のうち、ステップS811で取得した領域に対応するマスク位置を照会することで、当該領域でのマスク位置を決定する。なお、0パディング制御部131では、第1~第9領域の各領域について、部分特徴マップ124とマスク後の重み情報123との畳み込み演算結果が、各領域に応じた部分特徴マップ124の端部に対して0パディング処理を行った後に重み情報123で畳み込み演算を行ったときの演算結果と一致するように、マスク位置が予め設定されているものとする。ただし、0パディング処理が不要な第5領域については、マスク位置が設定されていない。
0パディング制御部131は、ステップS812の処理において、上記のように予め設定されたマスク位置の情報を照会して利用することで、0パディング処理に相当するマスク位置を領域ごとに決定することができる。これにより、各領域における全体特徴マップの端部の位置に応じて、重み情報123においてマスクする箇所を正しく決定することができる。
ステップS813では、ステップS812で決定したマスク位置を0パディング制御部131から畳み込み演算部133へ出力する。ステップS813の処理を終えたら、図9(b)のフローチャートに示すマスク位置決定処理を終了する。
図10は、図7のステップS707で実行される位置情報再演算処理の流れを示すフローチャートである。
図10(a)に示す位置情報再演算処理において、ステップS901では、演算層情報122に含まれるサイズ変化率501の値に基づき、畳み込み演算部133が行う畳み込み演算(積和演算)によって部分特徴マップの大きさが変化するか否かを判定する。サイズ変化率501の値が1以外の値であれば、部分特徴マップの水平方向および垂直方向の少なくとも一方の大きさが変化すると判定し、ステップS902へ進む。サイズ変化率501の値が1であれば、部分特徴マップの大きさが変化しないと判定し、ステップS902の処理を実行せずにステップS903へ進む。
ステップS902では、次カーネル位置情報生成部132により、演算層情報122に基づいて位置情報121を再計算する。ここでは、演算層情報122に含まれる各データ値に基づいて、位置情報121に含まれる各データ値を再計算する。
ステップS902では、例えば図10(b)に示す(1)~(7)の各計算式により、位置情報121の各データ値が再計算される。式(1)~(7)において、WW、WHは全体特徴マップ幅602、全体特徴マップ高さ603の値をそれぞれ表す。また、x、yは開始x座標605、開始y座標606の値をそれぞれ表し、endx、endyは終点x座標607、終点y座標608の値をそれぞれ表す。また、OW、OHは横畳み込み数609、縦畳み込み数610の値をそれぞれ表す。さらに、IW、IHは演算層情報122の入力特徴マップ幅505、入力特徴マップ高さ506の値をそれぞれ表し、k、k+1はDNN演算の全体における現在の演算層と次の演算層の位置(何層目か)をそれぞれ表し、KS、strideは演算層情報122の重みサイズ502、ストライド503の値をそれぞれ表す。
式(1)~(7)により、WW、WH、x、yは、現在の位置情報121におけるこれらの値に、演算層情報122のサイズ変化率501の値をそれぞれ乗算し、小数点以下の値を切り上げることで算出される。また、endx、endyは、次層のx、yにIW、IHをそれぞれ加えて算出される。また、OW、OHは、IW、IHからKSをそれぞれ減算した値をストライドで除算し、その切り捨て値に1を加えて算出される。
ステップS903では、次カーネル位置情報生成部132により、次層のDNN演算部11に対する位置情報を作成する。ここでは、ローカル記憶領域12に格納された位置情報121、またはこれにステップS902で再計算された値が反映された位置情報において、演算層604の値をインクリメントして次層のDNN演算部11に対応する値とすることで、次層の位置情報を作成する。
ステップS904では、ステップS903で作成した位置情報を次カーネル位置情報生成部132から次層のDNN演算部11へ送信する。ステップS904の処理を終えたら、図10のフローチャートに示す位置情報再演算処理を終了する。
AIアクセラレータ10では、各DNN演算部11において上記の処理がそれぞれ実行されることにより、演算処理部20から入力された部分特徴マップの各位置に対して、全体特徴マップの畳み込み演算領域内に設定された各領域の種類に応じた処理がそれぞれ行われる。これにより、AIアクセラレータ10において0パディング相当の処理を行ってマスク済み重み情報を生成し、このマスク済み重み情報を用いてDNNの各層に対応する畳み込み演算を実行することができる。
図11は、重みレジスタ301と入力レジスタ302のデータ配置およびマスク箇所の一例を示す図である。図11では、前述のように重み情報123が3×3の重みデータで構成されているときに、重みレジスタ301に一度に入力4チャンネル分、出力8チャンネル分の合計32個の重みデータが格納されている例を示している。この場合、図11に示すように、例えば重みレジスタ301には、32個の重みデータにおける横3データ分の値がそれぞれ格納される。図11では、重み情報123を構成する32個の重みデータにおける3×3のデータ値のうち、0~95の数字が付された箇所のデータ値が重みレジスタ301にそれぞれ格納されている。これらの数字は、重みレジスタ301の各格納箇所に付された数字と対応している。なお、重みレジスタ301中で96~127の数字が付された格納箇所には、重みのデータ値が入っていない。
また、図11に示すように、例えば入力レジスタ302には、ローカル記憶領域12からロードされた4チャンネル分の部分特徴マップ124のうち、0~27の数字が付された部分のデータ値がそれぞれ格納される。これらの数字も重みレジスタ301と同様に、入力レジスタ302の各格納箇所に付された数字と対応している。なお、入力レジスタ302において「x」が付された先頭の4つの格納箇所には、例えば他の格納箇所のうちいずれかと同じデータ値など、任意のデータ値を格納することができる。
図11に示した重みレジスタ301の各データ値と入力レジスタ302の各データ値との畳み込み演算を行う場合に、例えば第4領域に属する位置での畳み込み演算時には、符号1101に示す範囲、すなわち「set0」の行に対応する0~31の数字が付された各格納箇所のデータ値に対してマスク処理が行われる。これにより、重み情報123に対して0パディング相当の重みデータを設定することが可能となる。
以上説明した本発明の第1の実施形態によれば、以下の作用効果を奏する。
(1)情報処理装置1は、特徴マップに対してDNN演算を実行するものであって、演算処理部20と、演算処理部20とバスを介して接続されたAIアクセラレータ10と、DNN演算で利用される重み情報を格納する記憶部30とを備える。演算処理部20は、特徴マップの一部である部分特徴マップ124と、部分特徴マップ124の特徴マップ中の位置を表す位置情報121とをAIアクセラレータ10へ送信する。AIアクセラレータ10は、記憶部30から重み情報123を取得し、演算処理部20から送信される部分特徴マップ124および位置情報121を受信する。そして、位置情報121に基づく所定の前処理を実行し(ステップS811~S813、S803)、その前処理の実行結果と部分特徴マップ124とを用いて、DNN演算を実行する(ステップS804)。このようにしたので、AIアクセラレータ10および演算処理部20の2つの演算部を用いてDNN演算を行う情報処理装置1において、AIアクセラレータ10により0パディング処理に相当する前処理を行うことができるため、これら2つの演算部の間でのデータ通信量を削減することができる。
(2)AIアクセラレータ10が実行する前処理は、重み情報123において位置情報121に対応する箇所をマスクする処理である。AIアクセラレータ10は、前処理を行うことで生成したマスク済み重み情報と部分特徴マップ124とを用いて、DNN演算としての積和演算をステップS804において実行する。このようにしたので、AIアクセラレータ10において実行可能な処理として、0パディング処理に相当する前処理を実現できる。
(3)AIアクセラレータ10は、位置情報121に基づいて、特徴マップに設定された複数の領域のうちどの領域に部分特徴マップ124が属するかを判定し(ステップS701~S707、S711~S716、S721~S726、S731~S736)、当該領域に対応する箇所をマスクする処理を、ステップS811~S813、S803において前処理として実行する。具体的には、特徴マップに設定された複数の領域は、図4において示すように、特徴マップ401の左上角部を含む第1領域と、特徴マップ401の上端部を含む第2領域と、特徴マップ401の右上角部を含む第3領域と、特徴マップ401の左端部を含む第4領域と、特徴マップ401のいずれの端部も含まない第5領域と、特徴マップ401の右端部を含む第6領域と、特徴マップ401の左下角部を含む第7領域と、特徴マップ401の下端部を含む第8領域と、特徴マップ401の右下角部を含む第9領域と、を有する。AIアクセラレータ10は、部分特徴マップ124が第5領域以外の各領域に属する場合は、ステップS811、S812において、当該領域における特徴マップの端部の位置に応じて、重み情報123においてマスクする箇所を決定し、部分特徴マップ124が第5領域に属する場合は、ステップS803においてマスクする処理を実行しない。このようにしたので、0パディング処理に相当する前処理を確実に行うことができる。
(4)AIアクセラレータ10は、ベクトル演算に特化した複数の演算コアを有しており、これら複数の演算コアを用いたAI処理によってDNN演算を実行する。このようにしたので、DNN演算を高速に実行することができる。
(5)AIアクセラレータ10は、DNNの各層に対応する複数のカーネル13を有している。DNN演算において複数のカーネル13のいずれかで部分特徴マップ124の水平方向および垂直方向の少なくとも一方の大きさが変化する場合(ステップS901:Yes)、当該カーネル13は、位置情報121を再計算して(ステップS902)次層に対応するカーネル13へ送信する(ステップS904)。このようにしたので、複数の層によって構成されるDNNを利用したDNN演算において、AIアクセラレータ10による0パディング処理に相当する前処理を適用することができる。
(第2の実施形態)
次に、本発明の第2の実施形態について説明する。本実施形態では、AIアクセラレータ10のいずれかのDNN演算部11において、部分特徴マップ124を垂直方向に複数に分割し、当該DNN演算部11が有する複数のカーネル13で1層分の演算を実行する例を説明する。
次に、本発明の第2の実施形態について説明する。本実施形態では、AIアクセラレータ10のいずれかのDNN演算部11において、部分特徴マップ124を垂直方向に複数に分割し、当該DNN演算部11が有する複数のカーネル13で1層分の演算を実行する例を説明する。
ここで、本実施形態のAIアクセラレータ10では、いずれか少なくとも1つのDNN演算部11について、第1の実施形態で説明した構成とは異なり、当該DNN演算部11がDNNの1層分の演算を行う際の部分特徴マップ124の分割数だけ、カーネル13を持つこととなる。なお、本実施形態における情報処理装置1の構成、AIアクセラレータ10の構成、カーネル13の個数以外のDNN演算部11の構成およびカーネル13の構成は、第1の実施形態において図1、図3で説明したものとそれぞれ同様である。そのため以下では、これらの説明を省略する。
図12は、本発明の第2の実施形態に係る演算処理の説明図である。図12では、3層分の演算のうち2層目の中間層において、部分特徴マップ124が3つに分割されて演算が行われる例を示している。この場合、3層分のDNN演算部11は、図12に示すように、1層目のDNN演算部11が有する分割カーネル1201と、2層目のDNN演算部11が有する3つの中間カーネル1202と、3層目のDNN演算部11が有するマージカーネル1203とを含んで構成される。これらのカーネルは、いずれも図3に示した第1の実施形態におけるカーネル13と同様の構成を有している。
図12において、分割カーネル1201は、1層目の処理を行った後、部分特徴マップ124を3分割することで3つの分割部分特徴マップ1204を生成し、次層のDNN演算部11に送る。中間カーネル1202は、分割カーネル1201から送られた分割部分特徴マップ1204をそれぞれ処理して次層のDNN演算部11に送る。マージカーネル1203は、3つの中間カーネル1202でそれぞれ処理された分割部分特徴マップ1204をマージしたのち、3層目の処理を行う。
分割カーネル1201は、3つの分割部分特徴マップ1204を生成する際に、それぞれの分割部分特徴マップ1204に対応する位置情報121を作成する。その際には、図6に示した位置情報121の各データのうち分割ID601の値を、開始x座標が小さい方から0,1,2と順に設定する。また、終点x座標607、終点y座標608の値を、各分割部分特徴マップ1204に対応する値へとそれぞれ変更する。こうして作成した位置情報121は、分割部分特徴マップ1204とともに各分割カーネル1201へ送信される。
中間カーネル1202は、各分割部分特徴マップ1204に対して、第1の実施形態と同様の処理をそれぞれ行う。
マージカーネル1203は、各中間カーネル1202から処理済みの分割部分特徴マップ1204とともに位置情報121を受け取ると、分割部分特徴マップ1204をマージして1つの部分特徴マップ124に戻す。このとき、分割ID601の値が最も小さい位置情報121の開始x座標605および開始y座標606の値と、分割ID601の値が最も大きい位置情報121の終点x座標607および終点y座標608の値とを用いて、マージ後の部分特徴マップ124に対する位置情報121を更新する。そして、マージ後の部分特徴マップ124と更新後の位置情報121を用いて、3層目に対応する畳み込み演算を行う。
(第3の実施形態)
次に、本発明の第3の実施形態について説明する。本実施形態では、AIアクセラレータ10のいずれかのDNN演算部11において、部分特徴マップ124を続けて複数回入力し、次層のDNN演算部11に対して、複数の部分特徴マップ124の演算結果をまとめて一度に送信する例を説明する。
次に、本発明の第3の実施形態について説明する。本実施形態では、AIアクセラレータ10のいずれかのDNN演算部11において、部分特徴マップ124を続けて複数回入力し、次層のDNN演算部11に対して、複数の部分特徴マップ124の演算結果をまとめて一度に送信する例を説明する。
なお、本実施形態における情報処理装置1の構成、AIアクセラレータ10の構成、DNN演算部11の構成およびカーネル13の構成は、第1の実施形態において図1、図3で説明したものとそれぞれ同様である。そのため以下では、これらの説明を省略する。
図13は、本発明の第3の実施形態に係る演算処理の説明図である。図13の例では、3層分の演算を行う各DNN演算部11のカーネル13を、カーネル0、カーネル1、カーネル2でそれぞれ示している。この場合、図13(b)に示すように、カーネル0は第1の実施形態と同様に、演算処理済みの部分特徴マップ124と、その部分特徴マップ124の位置情報121とを、カーネル1に送信する。カーネル1は、第1の実施形態と同様に部分特徴マップ124の処理を行うが、次層のカーネル2の演算に必要なデータが揃わない場合は、部分特徴マップ124の演算結果とその部分特徴マップ124に対応する位置情報121とを、カーネル2へは送信しない。カーネル0がカーネル1に対して2回目のデータ送信を行い、そのデータを用いてカーネル1が処理した部分特徴マップ124と、1度目に処理した部分特徴マップ124とにより、カーネル2での演算に必要なデータが揃ったときに、カーネル1はカーネル2に対して、部分特徴マップ124と位置情報121の送信を行う。
上記の演算手順を実現するため、AIアクセラレータ10の各層のカーネル13(カーネル0~カーネル2)では、当該カーネルでの演算実行回数を表すカーネル実行回数と、当該カーネルから次層のカーネルへのデータ出力に必要な動作回数を表す出力数とを保持している。そして、これらの情報に基づいて図13(a)のフローチャートに示す処理を実行することで、各カーネルにおいて部分特徴マップ124と位置情報121の出力タイミング制御を行うようにしている。
図13(a)のフローチャートにおいて、ステップS1301では、保持している実行回数に1を加算する。なお、実行回数の初期値は0である。
ステップS1302では、保持している実行回数を出力数で除算したときの剰余を求め、その剰余が0であるか否かを判定する。剰余が0であればステップS1303へ進み、0でなければ、ステップS1303の処理を実行せずに図13(a)のフローチャートに示す処理を終了する。
ステップS1303では、位置情報121を更新し、更新後の位置情報121と部分特徴マップ124を次層のカーネルへと出力する。ステップS1303の処理を実行したら、実行回数を初期値の0にリセットした後、図13(a)のフローチャートに示す処理を終了する。
(第4の実施形態)
次に、本発明の第4の実施形態について説明する。本実施形態では、処理対象の部分特徴マップ124や重み情報123における各データの並びによっては、必ずしもマスク処理が必要ではない場合について説明する。
次に、本発明の第4の実施形態について説明する。本実施形態では、処理対象の部分特徴マップ124や重み情報123における各データの並びによっては、必ずしもマスク処理が必要ではない場合について説明する。
なお、本実施形態における情報処理装置1の構成、AIアクセラレータ10の構成、DNN演算部11の構成およびカーネル13の構成は、第1の実施形態において図1、図3で説明したものとそれぞれ同様である。そのため以下では、これらの説明を省略する。
図14は、本発明の第4の実施形態に係るマスク処理が必要でない場合の重みレジスタ301と入力レジスタ302のデータ配置の一例を示す図である。図14では図11と同様に、重み情報123が3×3の重みデータで構成されているときに、重みレジスタ301に一度に入力4チャンネル分、出力8チャンネル分の合計32個の重みデータが格納されている例を示している。この場合に、第1領域に属する位置での畳み込み演算時には、3×3の重みデータの最初の1行目の処理の際に、符号1401に示す範囲に対してマスク処理が行われる。すなわち、重みレジスタ301において重みデータが格納されている全ての格納箇所に対して、マスク処理が行われることになる。
上記のように、重みレジスタ301に格納された全ての重みデータに対してマスク処理が行われる場合は、マスク処理を省略し、畳み込み演算自体を行わずに単に計算結果を0のデータとしても、マスク処理後の畳み込み演算と同じ結果が得られる。このようにすれば、不要な演算処理を省略して高速化を図ることが可能となる。なお、ここでは第1領域に属する位置での畳み込み演算時の例を述べたが、他の領域に属する位置でも同様に、重みレジスタ301に格納された全ての重みデータに対してマスク処理が行われる場合には、マスク処理と畳み込み演算を省略することができる。
以上説明した本発明の第2~第4の各実施形態によれば、第1の実施形態と同様の作用効果をそれぞれ奏する。
なお、以上説明した各実施形態では、AIアクセラレータ10において、0パディング処理に相当する前処理として、重み情報123において位置情報121に対応する箇所をマスクする処理を行う例を説明したが、AIアクセラレータ10において0パディング処理を行い、0パディング処理済みの部分特徴マップ124を用いてDNN演算を実行するようにしてもよい。このようにしても、第1の実施形態で説明したのと同様の効果を奏することができる。
以上説明した実施形態や各種変形例はあくまで一例であり、発明の特徴が損なわれない限り、本発明はこれらの内容に限定されるものではない。また、各実施形態や各種変形例は、単独で採用してもよいし、任意に組み合わせてもよい。さらに、上記では種々の実施形態や変形例を説明したが、本発明はこれらの内容に限定されるものではない。本発明の技術的思想の範囲内で考えられるその他の態様も本発明の範囲内に含まれる。
1:情報処理装置、10:AIアクセラレータ、11:DNN演算部、12:ローカル記憶領域、13:カーネル、20:演算処理部、30:記憶部、121:位置情報、122:演算層情報、123:重み情報、124:部分特徴マップ、131:0パディング制御部、132:次カーネル位置情報生成部、133:畳み込み演算部、301:重みレジスタ、302:入力レジスタ、303:積和演算部、304:出力レジスタ
Claims (8)
- 特徴マップに対してDNN演算を実行する情報処理装置であって、
第1の演算部と、
前記第1の演算部とバスを介して接続された第2の演算部と、
前記DNN演算で利用される重み情報を格納する記憶部と、を備え、
前記第1の演算部は、前記特徴マップの一部である部分特徴マップと、前記部分特徴マップの前記特徴マップ中の位置を表す位置情報とを前記第2の演算部へ送信し、
前記第2の演算部は、
前記記憶部から前記重み情報を取得し、
前記第1の演算部から送信される前記部分特徴マップおよび前記位置情報を受信し、
前記位置情報に基づく所定の前処理を実行し、
前記前処理の実行結果と前記部分特徴マップとを用いて、前記DNN演算を実行する情報処理装置。 - 請求項1に記載の情報処理装置において、
前記前処理は、前記重み情報において前記位置情報に対応する箇所をマスクする処理であり、
前記第2の演算部は、前記前処理を行うことで生成したマスク済み重み情報と前記部分特徴マップとを用いて、前記DNN演算を実行する情報処理装置。 - 請求項2に記載の情報処理装置において、
前記第2の演算部は、前記位置情報に基づいて、前記特徴マップに設定された複数の領域のうちどの領域に前記部分特徴マップが属するかを判定し、当該領域に対応する箇所をマスクする処理を前記前処理として実行する情報処理装置。 - 請求項3に記載の情報処理装置において、
前記複数の領域は、前記特徴マップの左上角部を含む第1領域と、前記特徴マップの上端部を含む第2領域と、前記特徴マップの右上角部を含む第3領域と、前記特徴マップの左端部を含む第4領域と、前記特徴マップのいずれの端部も含まない第5領域と、前記特徴マップの右端部を含む第6領域と、前記特徴マップの左下角部を含む第7領域と、前記特徴マップの下端部を含む第8領域と、前記特徴マップの右下角部を含む第9領域と、を有し、
前記第2の演算部は、
前記部分特徴マップが前記第5領域以外の各領域に属する場合は、当該領域における前記特徴マップの端部の位置に応じて、前記重み情報においてマスクする前記箇所を決定し、
前記部分特徴マップが前記第5領域に属する場合は、前記マスクする処理を実行しない情報処理装置。 - 請求項1に記載の情報処理装置において、
前記前処理は、前記部分特徴マップに0を挿入する0パディングであり、
前記第2の演算部は、前記前処理を行うことで生成した0パディング済みの前記部分特徴マップを用いて、前記DNN演算を実行する情報処理装置。 - 請求項1に記載の情報処理装置において、
前記第2の演算部は、ベクトル演算に特化した複数の演算コアを有しており、前記複数の演算コアを用いたAI処理によって前記DNN演算を実行する情報処理装置。 - 請求項1に記載の情報処理装置において、
前記第2の演算部は、DNNの各層に対応する複数のカーネルを有しており、
前記DNN演算において前記複数のカーネルのいずれかで前記部分特徴マップの水平方向および垂直方向の少なくとも一方の大きさが変化する場合、当該カーネルは前記位置情報を再計算して次層に対応するカーネルへ送信する情報処理装置。 - 第1の演算部と、前記第1の演算部とバスを介して接続された第2の演算部と、DNN演算で利用される重み情報を格納する記憶部と、を備える情報処理装置を用いて、特徴マップに対してDNN演算を実行する情報処理方法であって、
前記第1の演算部により、前記特徴マップの一部である部分特徴マップと、前記部分特徴マップの前記特徴マップ中の位置を表す位置情報を前記第2の演算部へ送信し、
前記第2の演算部により、
前記記憶部から前記重み情報を取得し、
前記第1の演算部から送信される前記部分特徴マップおよび前記位置情報を受信し、
前記位置情報に基づく所定の前処理を実行し、
前記前処理の実行結果と前記部分特徴マップとを用いて、前記DNN演算を実行する情報処理方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| DE112021005568.2T DE112021005568T5 (de) | 2020-12-25 | 2021-09-28 | Datenverarbeitungsvorrichtung und Datenverarbeitungsverfahren |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2020218058A JP7413249B2 (ja) | 2020-12-25 | 2020-12-25 | 情報処理装置、情報処理方法 |
| JP2020-218058 | 2020-12-25 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022137696A1 true WO2022137696A1 (ja) | 2022-06-30 |
Family
ID=82157475
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/JP2021/035696 Ceased WO2022137696A1 (ja) | 2020-12-25 | 2021-09-28 | 情報処理装置、情報処理方法 |
Country Status (3)
| Country | Link |
|---|---|
| JP (1) | JP7413249B2 (ja) |
| DE (1) | DE112021005568T5 (ja) |
| WO (1) | WO2022137696A1 (ja) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| GB2619918A (en) * | 2022-06-17 | 2023-12-27 | Imagination Tech Ltd | Hardware implementation of an attention-based neural network |
| GB2619919A (en) * | 2022-06-17 | 2023-12-27 | Imagination Tech Ltd | Hardware implementation of an attention-based neural network |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2019537139A (ja) * | 2016-11-10 | 2019-12-19 | グーグル エルエルシー | ハードウェアにおけるカーネルストライドの実行 |
| US20200184002A1 (en) * | 2018-12-10 | 2020-06-11 | Advanced Micro Devices, Inc. | Hardware accelerated convolution |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9779786B1 (en) | 2016-10-26 | 2017-10-03 | Xilinx, Inc. | Tensor operations and acceleration |
-
2020
- 2020-12-25 JP JP2020218058A patent/JP7413249B2/ja active Active
-
2021
- 2021-09-28 WO PCT/JP2021/035696 patent/WO2022137696A1/ja not_active Ceased
- 2021-09-28 DE DE112021005568.2T patent/DE112021005568T5/de active Pending
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2019537139A (ja) * | 2016-11-10 | 2019-12-19 | グーグル エルエルシー | ハードウェアにおけるカーネルストライドの実行 |
| US20200184002A1 (en) * | 2018-12-10 | 2020-06-11 | Advanced Micro Devices, Inc. | Hardware accelerated convolution |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| GB2619918A (en) * | 2022-06-17 | 2023-12-27 | Imagination Tech Ltd | Hardware implementation of an attention-based neural network |
| GB2619919A (en) * | 2022-06-17 | 2023-12-27 | Imagination Tech Ltd | Hardware implementation of an attention-based neural network |
| GB2619918B (en) * | 2022-06-17 | 2024-12-04 | Imagination Tech Ltd | Hardware implementation of an attention-based neural network |
| GB2619919B (en) * | 2022-06-17 | 2024-12-04 | Imagination Tech Ltd | Hardware implementation of an attention-based neural network |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2022102966A (ja) | 2022-07-07 |
| JP7413249B2 (ja) | 2024-01-15 |
| DE112021005568T5 (de) | 2023-08-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112673383B (zh) | 神经网络核中动态精度的数据表示 | |
| CN108073983B (zh) | 在硬件中执行核心跨越 | |
| CN114450699B (zh) | 由处理单元实现的方法、可读存储介质和处理单元 | |
| US20260105307A1 (en) | Pruning neural networks that include element-wise operations | |
| CN108241890A (zh) | 一种可重构神经网络加速方法及架构 | |
| CN108985449B (zh) | 一种对卷积神经网络处理器的控制方法及装置 | |
| US20220405561A1 (en) | Electronic device and controlling method of electronic device | |
| CN118569342A (zh) | 用于以降低精度进行深度神经网络训练的损失缩放 | |
| CN114547972A (zh) | 动力学模型构建方法、装置、存储介质及电子设备 | |
| JP7413249B2 (ja) | 情報処理装置、情報処理方法 | |
| JP2020123338A (ja) | ディープラーニング基盤装置の学習に使用されるバーチャル世界シミュレータの物理エンジンをキャリブレーションする方法及び装置、そしてそのためのリアル状態ネットワークを学習する方法及びそれを利用した学習装置 | |
| JP7671754B2 (ja) | ニューラルネットワーク生成装置 | |
| CN116206212B (zh) | 一种基于点特征的sar图像目标检测方法及系统 | |
| EP4052188B1 (en) | Neural network instruction streaming | |
| CN120542559A (zh) | 逆约束推断方法、装置、设备和介质 | |
| WO2022230906A1 (ja) | ニューラルネットワーク生成装置、ニューラルネットワーク演算装置、エッジデバイス、ニューラルネットワーク制御方法およびソフトウェア生成プログラム | |
| CN120385361A (zh) | 基于深度学习与可变形扫描的机器人路径规划方法及系统 | |
| CN118426989B (zh) | 基于处理器存储空间的人工智能模型的优化方法 | |
| WO2022163861A1 (ja) | ニューラルネットワーク生成装置、ニューラルネットワーク演算装置、エッジデバイス、ニューラルネットワーク制御方法およびソフトウェア生成プログラム | |
| JP2025065487A (ja) | 制御装置および制御方法 | |
| CN118839740A (zh) | 神经网络的剪枝方法、数据处理方法及装置 | |
| CN116820733A (zh) | 一种数据处理装置和方法 | |
| JP6994572B2 (ja) | データ処理システムおよびデータ処理方法 | |
| KR20220160391A (ko) | Rnn 기반 멀티에이전트 심층강화학습을 활용한 충돌없는 경로 생성 방법 | |
| CN119940680B (zh) | 自动驾驶运动规划方法、装置、设备及介质 |
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: 21909854 Country of ref document: EP Kind code of ref document: A1 |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 21909854 Country of ref document: EP Kind code of ref document: A1 |