WO2018193906A1 - 情報処理方法、情報処理装置およびプログラム - Google Patents

情報処理方法、情報処理装置およびプログラム Download PDF

Info

Publication number
WO2018193906A1
WO2018193906A1 PCT/JP2018/015015 JP2018015015W WO2018193906A1 WO 2018193906 A1 WO2018193906 A1 WO 2018193906A1 JP 2018015015 W JP2018015015 W JP 2018015015W WO 2018193906 A1 WO2018193906 A1 WO 2018193906A1
Authority
WO
WIPO (PCT)
Prior art keywords
tensor
memory
input
convolution operation
stored
Prior art date
Application number
PCT/JP2018/015015
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 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ
Publication of WO2018193906A1 publication Critical patent/WO2018193906A1/ja
Priority to US16/513,666 priority Critical patent/US11055379B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • G06F17/153Multidimensional correlation or convolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present disclosure relates to an information processing method, an information processing apparatus, and a program.
  • CNN Deep Neural Networks
  • CNN Convolutional Neural Networks
  • the CNN executed by the GPU uses a floating point format that is easy to operate but has low computational efficiency.
  • Non-Patent Document 1 a CNN architecture with low computational cost and excellent power efficiency and implementation in an embedded system driven with low power consumption. Therefore, many researches and implementation efforts have been made in order to realize a CNN architecture with low computational cost and excellent power efficiency and implementation in an embedded system driven with low power consumption (for example, Non-Patent Document 1). ).
  • Non-Patent Document 1 discloses a method of using a quantized fixed point as a CNN data representation, which is more computationally efficient than the floating point format.
  • Non-Patent Document 1 discloses performing a convolution operation by converting a floating-point format into a fixed-point quantization format which is one of low-precision quantization expressions.
  • An information processing method includes an input step of inputting an input tensor indicating data into a processing unit that has a memory and is processed by a computer, and a form of a power of 2 expression for each element of the input tensor After being pre-computed to be converted into the memory and stored in the memory, it may be converted into a power-of-two representation format by a predetermined algorithm and used for the convolution operation stored in the memory.
  • the processing unit uses the weight tensor indicating the weight and each element of the input tensor stored in the memory and subjected to the pre-computation, the processing unit performs a convolution operation process only by an addition operation and a shift operation. Processing element and each element of the input tensor that has undergone the convolution operation processing by the processing step is output as an output tensor And an output step that.
  • FIG. 1 is a block diagram illustrating an example of a configuration of an information processing device according to an embodiment.
  • FIG. 2 is a block diagram illustrating an example of a detailed configuration of the processing unit illustrated in FIG.
  • FIG. 3 is a diagram conceptually showing the convolution calculation process performed by the processing unit shown in FIG.
  • FIG. 4 is a diagram conceptually showing the detailed configuration of the ShiftALU unit shown in FIG.
  • FIG. 5 is a diagram illustrating a predetermined algorithm for converting a weight tensor that may be used in a convolution operation into a power-of-two representation format.
  • FIG. 6 is a diagram conceptually showing the detailed configuration of the convolution operation unit shown in FIG. FIG.
  • FIG. 7 is a diagram illustrating an example of pseudo code in which a flow of processing of the control unit in the embodiment is described.
  • FIG. 8 is a flowchart illustrating arithmetic processing of the information processing apparatus according to the embodiment.
  • FIG. 9 is a flowchart showing details of the convolution operation processing in step S3 shown in FIG.
  • FIG. 10 is a diagram illustrating an evaluation result of evaluating a correct answer rate using ImageNet dataset in Example 1.
  • FIG. 11 is a diagram illustrating a comparison between the number of multiplication operations necessary for the convolution operation in the conventional convolution layer and the number of cycles of the shift operation necessary for the convolution operation after conversion to ShiftCNN in the three CNN models of the first embodiment.
  • FIG. 12 is a diagram illustrating a comparison of estimated power when the FPGA according to the second embodiment is used.
  • Non-Patent Document 1 can improve the calculation efficiency of convolution calculations, it can be implemented in a low-consumption embedded system such as an FPGA (Field Programmable Gate Array) or an ASIC (Application Specific Integrated Circuit). Absent. That is, it is required to further improve the calculation efficiency of the convolution operation and reduce the power consumption.
  • FPGA Field Programmable Gate Array
  • ASIC Application Specific Integrated Circuit
  • the present disclosure has been made in view of the above-described circumstances, and provides an information processing method, an information processing apparatus, and a program that can further improve the calculation efficiency of convolution calculation and reduce power consumption.
  • An information processing method includes an input step of inputting an input tensor indicating data into a processing unit that has a memory and is processed by a computer, and a form of a power of 2 expression for each element of the input tensor After being pre-computed to be converted into the memory and stored in the memory, it may be converted into a power-of-two representation format by a predetermined algorithm and used for the convolution operation stored in the memory.
  • the processing unit uses the weight tensor indicating the weight and each element of the input tensor stored in the memory and subjected to the pre-computation, the processing unit performs a convolution operation process only by an addition operation and a shift operation. Processing element and each element of the input tensor that has undergone the convolution operation processing by the processing step is output as an output tensor And an output step that.
  • the convolution operation can be performed only by the addition operation and the shift operation without requiring the multiplication operation, the calculation efficiency of the convolution operation can be further improved and the power consumption can be reduced.
  • the processing unit is caused to perform the pre-calculation, and each element of the input tensor that has been subjected to the pre-calculation is stored in the memory.
  • the processing unit may be operated on a convolution layer constituting a convolutional neural network.
  • the weight tensor is composed of 2 B ⁇ 1 combinations where a 2's complement bit value is B (an integer of 1 or more), and is stored as a codebook in the memory.
  • B an integer of 1 or more
  • an element of a weight tensor specified by N (an integer greater than or equal to 1) and B, which are the number of dimensions indicating the degree of freedom of 1-bit expression, may be obtained from the codebook and used.
  • the N may be an integer of 2 or more.
  • the convolution operation can be performed only by the addition operation and the shift operation within a range of accuracy rate decrease of less than 1%, that is, accuracy decrease.
  • An information processing apparatus includes an input unit that inputs an input tensor indicating data, and a processing unit that has a memory and is processed by a computer, and includes two elements for each element of the input tensor. After a pre-computation to be converted into a power representation format is performed and stored in the memory, it is converted into a power representation format of 2 in advance by a predetermined algorithm and used for a convolution operation stored in the memory.
  • a processing unit that performs a convolution operation process only by an addition operation and a shift operation using a weight tensor indicating a possible weight and each element of the input tensor stored in the memory and subjected to the pre-computation And an output unit that outputs each element of the input tensor subjected to the convolution operation processing by the processing unit as an output tensor.
  • FIG. 1 is a block diagram illustrating an exemplary configuration of an information processing apparatus 10 according to an embodiment.
  • the information processing apparatus 10 may be realized by a computer using a convolutional neural network. As illustrated in FIG. 1, the information processing apparatus 10 includes an input unit 11, a processing unit 12, and an output unit 13. When data to be processed such as an image or a moving image is input, the information processing apparatus 10 performs a convolution operation process and outputs a result of the convolution operation process. Note that the data to be processed is not limited to an image or a moving image.
  • the input unit 11 inputs an input tensor indicating data to be processed to the processing unit 12.
  • the data to be processed is an image or a moving image, but is not limited thereto.
  • the processing unit 12 performs an operation on one convolution layer, the data may be a convolution operation processing result by a convolution layer before the convolution layer.
  • the processing unit 12 has a memory 124 and is processed by a computer.
  • the processing unit 12 performs a pre-calculation for each element of the input tensor to be converted into a power-of-two representation format and stores it in the memory 124. Then, the processing unit 12 converts the input tensor into a power-of-two representation format in advance using a predetermined algorithm. , And a weight tensor indicating a weight that may be used for the convolution operation stored in the memory 124 and each element of the input tensor stored in the memory 124 and subjected to the pre-computation. Convolution calculation processing is performed only by calculation.
  • the processing unit 12 may perform pre-calculation and store each element of the input tensor that has been pre-calculated in the memory 124.
  • the weight tensor may be composed of 2 B ⁇ 1 combinations where the 2's complement bit value is B (an integer of 1 or more), and may be stored in the memory 124 as a codebook.
  • the processing unit 12 acquires from the code book 123 the elements of the weight tensor specified by N (an integer of 1 or more) and B corresponding to the number of dimensions indicating the degree of freedom of 1-bit expression.
  • N is preferably an integer of 2 or more.
  • the processing unit 12 converts the CNN data representation into a hardware-efficient power-of-two representation format described later, and executes a convolution operation without multiplication.
  • the processing unit 12 is a CNN architecture also called ShiftCNN that can execute a convolution operation without multiplication.
  • the processing unit 12 is not limited to performing the calculation of the convolution layer constituting the CNN, and may simply perform the convolution calculation.
  • the processing unit 12 performs an operation on one convolution layer among a plurality of convolution layers constituting the CNN. It will be described as being performed.
  • FIG. 2 is a block diagram showing an example of a detailed configuration of the processing unit 12 shown in FIG.
  • FIG. 3 is a diagram conceptually showing the convolution calculation process performed by the processing unit 12 shown in FIG.
  • the processing unit 12 includes a pre-calculation unit 121, a convolution operation unit 122, a code book 123, a memory 124, and a control unit 125, as shown in FIG. Note that the processing unit 12 may not include the pre-calculation unit 121.
  • the input to each convolutional layer of a general CNN can be represented by an input tensor X.
  • the input tensor X is an element of the set R shown in (Expression 1), where C is the number of input channels, H is the height, and W is the width.
  • the input tensor X is convolved with the weight tensor W.
  • the weight tensor W is an element of the set R shown in (Expression 2).
  • Equation 2 the number of output channels is The height of the filter kernel is H f , and the width of the filter kernel is W f .
  • bias term b indicated by the bias vector is added to the result of the convolution operation.
  • the bias term b is an element of the set R shown in (Equation 3).
  • the output tensor Y of the number of channels can be calculated using the calculation formula shown in (Formula 4).
  • the output tensor Y is an element of the set R shown in (Expression 5).
  • * indicates that a convolution operation is performed.
  • the memory 124 is configured by a hard disk, a semiconductor memory, or the like, and stores information.
  • the memory 124 stores the result of precalculation by the precalculation unit 121 and the result of the convolution operation processing performed by the convolution operation unit 122.
  • the memory 124 may store the value of the bias term used when the convolution operation unit 122 performs the convolution operation processing.
  • the memory 124 may store a code book 123 described later.
  • the pre-calculation unit 121 performs pre-calculation for converting each element of the input tensor X into a power-of-two representation format.
  • the pre-calculation unit 121 performs the pre-calculation, and stores each element of the input tensor X that has performed the pre-calculation in the memory 124.
  • the pre-calculation unit 121 includes a ShiftALU unit 1211 as shown in FIG.
  • the pre-calculation unit 121 uses a ShiftALU unit 1211 as a pre-calculation before performing the convolution operation in the convolution operation unit 122, for example, for each element of the input tensor X indicated by 11a, a tensor that is a form of power of 2 Convert to P.
  • the tensor P is indicated by 124a in FIG. 3, for example, and is all possible combinations for each element of the input tensor X.
  • the tensor P is expressed as (M + 2 (N-1) where B's complement bit value is B (integer of 1 or more) and N (an integer of 1 or more) is the number of dimensions indicating the degree of freedom of 1-bit expression. )).
  • the tensor P corresponds to a tensor obtained by converting the input tensor X into an expression format that can be shifted.
  • FIG. 4 is a diagram conceptually showing the detailed configuration of ShiftALU unit 1211 shown in FIG.
  • the ShiftALU unit 1211 is a special shift computing unit that is also referred to as ShifthmArithmetic ⁇ Unit, and includes a plurality of shifters and a plurality of flips that perform sign inversion.
  • the plurality of shifters and the plurality of flips may be realized by a logic circuit or may be realized by a program logic.
  • each of the plurality of shifters performs an operation of shifting the input tensor X, which is an input value, one by one to the right, and stores it in the memory 124.
  • each of the plurality of flips inverts the sign of the value calculated to shift to the right by the shifter and stores it in the memory 124.
  • the ShiftALU unit 1211 performs a 1-bit shift in total (1 / P) times. In this way, the tensor P can be precalculated and stored in the memory 124.
  • the pre-calculation unit 121 may not be provided in the processing unit 12 as described above. In this case, the pre-calculation unit 121 is provided outside the processing unit 12, and the tensor P that is a result of the pre-calculation performed by the pre-calculation unit 121 may be stored in the memory 124.
  • the ShiftALU unit 1211 is a program logic, the ShiftALU unit 1211 may perform a pre-calculation for converting the input tensor X to the tensor P using a predetermined algorithm shown in FIG.
  • FIG. 5 is a diagram illustrating a predetermined algorithm for converting a weight tensor that may be used in a convolution operation into a power-of-two representation format.
  • the predetermined algorithm is denoted as algorithm 1.
  • the code book 123 may be stored in the memory 124 or may be stored in a memory different from the memory 124. In the present embodiment, description will be made assuming that the data is stored in a memory different from the memory 124.
  • the code book 123 stores a combination of weight tensors W that are converted into a power-of-two representation format in advance by a predetermined algorithm and indicate weights that may be used for convolution operations.
  • the weight tensor W is composed of 2 B ⁇ 1 combinations where the 2's complement bit value is B (an integer equal to or greater than 1), and is stored as a codebook 123 in the memory.
  • the element of the weight tensor W is specified from the code book 123 by the number of dimensions N (an integer of 1 or more) indicating the degree of freedom of 1-bit expression and B. N may be an integer of 2 or more.
  • the code book 123 is like a dictionary of weight tensors in which addresses or indices that can be specified by B and N are linked.
  • the weight tensor W is a low-precision weight tensor. And stored in the code book 123.
  • the weight tensor W is a low-precision weight tensor. , It is possible to obtain a weight consisting of 2 B ⁇ 1 combinations in the form of a power of 2 expression, so that it can be stored in a table, that is, in the code book 123 in advance.
  • a low-precision weight tensor is used by using a predetermined algorithm, that is, algorithm 1 shown in FIG.
  • algorithm 1 shown in FIG.
  • Each element Is converted after being normalized by MAX (abs (W)) and stored in the code book 123.
  • the element for the maximum value of the weight tensor By using the value of as the input value r, the algorithm 1 in the third and subsequent lines is executed with a value of 0 to 1.
  • the sign of the input value r in the second line is calculated as q sgn
  • the number of digits to which the input value r in the second line is a power of 2 is calculated as q log .
  • log 2 1.5 indicating the quantization boundary is used to calculate whether the number of digits of the q log value is increased by one, for example, to be rounded off or left as it is.
  • the number of digits is recursively converted N times into a form of a power of 2 expression.
  • the convolution operation unit 122 after pre-calculation, is converted into a power-of-two representation format in advance by a predetermined algorithm and stored in the memory 124 and indicates a weight that may be used for the convolution operation.
  • the convolution operation processing is performed only by the addition operation and the shift operation, using each element of the input tensor that has been subjected to the pre-computation.
  • the convolution operation unit 122 performs the convolution operation processing only by the addition operation and the shift operation using the post-calculation tensor 124a, the weight tensor 123a, and the bias term 124b.
  • the pre-calculation tensor 124 a is each element of the input tensor that has been pre-calculated by the ShiftALU unit 1211 of the pre-calculation unit 121.
  • the weight tensor 123a is a weight tensor stored in the code book 123.
  • the weight tensor 123a is a low-precision indicating a weight that is converted into a power-of-two representation in advance by the algorithm 1 shown in FIG. 5 and may be used for a convolution operation. Obtained from the weight tensor.
  • FIG. 6 is a diagram conceptually showing the detailed configuration of the convolution operation unit 122 shown in FIG.
  • the convolution operation unit 122 includes multiplexers 1221 and 1222 and an adder 1223 as shown in FIG.
  • the multiplexer 1221 fetches (acquires) the pre-calculated tensor 124a from the memory 124 according to the address or index of the weight tensor 123a, performs a convolution operation between the weight tensor 123a and the pre-calculated tensor 124a by a shift operation, and adds Output to the device 1223. More specifically, the multiplexer 1221 selects a value indicating a power of zero (value 0) or a power of 2 as an element value of the weight tensor 123a, and a power of 2 that is an element value of the tensor 124a after pre-calculation. And a value obtained by performing a shift operation on the value indicating the power of 2 as the value of the element of the weight tensor 123a is output to the adder 1223.
  • the adder 1223 calculates a temporary output tensor 13b by adding the value output from the multiplexer 1221 and the bias term 124b.
  • the adder 1223 adds the bias term 124b and the provisional output tensor 13b previously calculated to the value output from the multiplexer 1221.
  • the temporary output tensor 13b is updated by adding the values.
  • the adder 1223 outputs the temporary output tensor 13b updated N ⁇ 1 times to the output unit 13 as the output tensor 13a. In this way, the temporary output tensor 13b is updated N-1 times and is output to the output unit 13 as the output tensor 13a.
  • the multiplexer 1222 outputs a value obtained by adding the bias term 124 b and the temporary output tensor 13 b previously calculated or updated by the adder 1223 to the adder 1223.
  • the multiplexer 1222 outputs only the bias term 124b to the adder 1223 when there is no provisional output tensor 13b previously calculated or updated by the adder 1223.
  • Control unit 125 controls the pre-calculation unit 121 and the convolution operation unit 122.
  • control unit 125 it is easy for the control unit 125 to cause the pre-calculation unit 121 to calculate the pre-calculation tensor 124a using the ShiftALU unit 1211.
  • control unit 125 in order for the control unit 125 to cause the convolution operation unit 122 to perform the convolution operation only by the shift operation and the addition operation, it is necessary to support all the potential filter kernels, and complicated scheduling and control logic are required.
  • FIG. 7 is a diagram illustrating an example of pseudo code in which a flow of processing of the control unit 125 in the embodiment is described.
  • the pseudo code is expressed as algorithm 2.
  • FIG. 7 describes that the input vector x is read as the input tensor X in the second line.
  • the third line describes that the precalculation unit 121 performs precalculation and stores it in the memory 124.
  • the 4th line describes that the calculation for the 5th to 9th lines is repeated by the number of output channels.
  • the fifth line describes that the bias term is added after the calculation of the sixth to ninth lines.
  • the sixth to eighth lines describe that the convolution operation unit 122 performs the convolution operation on the heights and widths of all the potential filter kernels by the number of times N of the pre-computed elements of P. ing.
  • the convolution operation unit 122 describes that the value obtained as a result of the convolution operation is used as an output tensor.
  • control unit 125 controls the pre-calculation unit 121 and the convolution operation unit 122 according to, for example, the pseudo code illustrated in FIG. 7 to perform the pre-calculation and the convolution operation.
  • the output unit 13 outputs each element of the input tensor subjected to the convolution operation processing by the processing unit 12 as an output tensor.
  • the output unit 13 outputs the output tensor 13a output from the convolution operation unit 122 as a result of the convolution operation processing performed by one convolution layer constituting the CNN.
  • FIG. 8 is a flowchart showing the arithmetic processing of the information processing apparatus 10 in the embodiment.
  • the information processing apparatus 10 performs input processing for inputting an input tensor indicating data to be processed to the processing unit 12 (S1). More specifically, the computer of the information processing apparatus 10 causes the input unit 11 illustrated in FIG. 1 to input an input tensor indicating data to be processed to the processing unit 12.
  • the information processing apparatus 10 performs pre-calculation for converting the input tensor into a form of power of 2 (S2). More specifically, the computer of the information processing apparatus 10 causes the pre-calculation unit 121 of the processing unit 12 to perform pre-calculation that converts each element of the input tensor into a power-of-two representation format, and stores it in the memory 124. .
  • the information processing apparatus 10 performs a convolution operation process only by addition and shift operations using the input tensor pre-calculated in step S2 (S3). More specifically, the computer of the information processing apparatus 10 is converted into a power-of-two representation format in advance by a predetermined algorithm in the convolution operation unit 122 of the processing unit 12 and stored in the code book 123 after pre-calculation. The convolution operation processing is performed only by the addition operation and the shift operation using the weight tensor indicating the weight that may be used for the convolution operation and the elements of the input tensor stored in the memory 124 and subjected to the pre-computation. To do.
  • the information processing apparatus 10 outputs the input tensor subjected to the convolution operation processing in step S3 as an output tensor (S4). More specifically, the computer of the information processing apparatus 10 causes the output unit 13 to output each element of the input tensor subjected to the convolution operation processing by the processing unit 12 in step S3 as an output tensor.
  • FIG. 9 is a flowchart showing details of the convolution operation processing in step S3 shown in FIG.
  • step S3 first, the computer of the information processing apparatus 10 causes the convolution operation unit 122 to acquire the input tensor pre-calculated in step S2 (S31).
  • the computer of the information processing apparatus 10 causes the convolution operation unit 122 to acquire the weight tensor from the code book 123 (S32).
  • the weight tensor stored in the code book 123 is a weight that is converted into a power-of-two expression format in advance by the algorithm 1 and may be used for a convolution operation.
  • the weight tensor stored in the code book 123 is converted into a power-of-two representation format as a low-precision weight tensor.
  • the convolution operation unit 122 can obtain the weight tensor necessary for the convolution operation for each element of the input tensor calculated in advance by referring to the code book 123 by the address or the index.
  • the computer of the information processing apparatus 10 convolves the convolution operation unit 122 with only the addition operation and the shift operation using the weight tensor acquired in step S32 and the pre-calculated input tensor acquired in step S31. Calculation is performed (S33).
  • the computer of the information processing device 10 adds the bias term and the temporary output tensor updated one time or calculated one time before to the result of the convolution operation performed in step S33 to the convolution operation unit 122. To update the temporary output tensor (S34).
  • the computer of the information processing apparatus 10 determines whether or not the convolution operation unit 122 has performed the convolution operation by the number of elements of the input tensor calculated in advance in step S31 (S35).
  • the computer of the information processing apparatus 10 outputs the temporary output tensor to the output unit 13 and the output tensor subjected to the convolution operation processing. (S36).
  • the computer of the information processing apparatus 10 causes the convolution operation unit 122 to perform again from the process of step S31.
  • the convolution operation can be performed only by the addition operation and the shift operation without requiring the multiplication operation, so that the calculation efficiency of the convolution operation can be further improved. Power consumption can be reduced. More specifically, according to the information processing apparatus 10 of the present embodiment, by adopting a hardware-efficient power-of-two representation format as data representation of CNN, a convolution operation can be performed without a multiplication and a multiplication operation. It can be performed only by addition operation. Thereby, the calculation cost of the convolutional layer, which is the most computationally expensive part of the CNN, can be greatly reduced. Therefore, it is possible to further improve the calculation efficiency of the convolution operation performed in the convolution layer of the CNN, and to reduce the power consumption of the device in which the CNN is mounted.
  • the weight that may be used for the convolution operation is converted into a power-of-two expression format in advance, and the code stored as the weight associated with the address or index is stored.
  • a convolution operation is performed using the book 123.
  • the codebook 123 when the 2's complement bit value B (an integer greater than or equal to 1) is used, the weight is stored as a weight converted to a power of 2 representation form of 2 B ⁇ 1 combinations. Relatively small.
  • the weight necessary for performing the convolution operation can be held in advance as a codebook in a lexicographic manner, it is possible to pre-calculate the convolution term of the convolution operation. For example, it is possible to reduce the calculation cost of the convolution operation by reducing the number of operations required for the convolution operation of the convolution layer of the general CNN model to 1/100, that is, at least two digits, so Calculation efficiency can be further improved.
  • the information processing apparatus 10 has the following three features.
  • the weight tensor W that may be used for convolution operations is replaced with a low-precision weight tensor.
  • a tensor P that is a form of power of 2 is precalculated.
  • the pre-calculation of the tensor P is performed using the ShiftALU unit 1211 or the algorithm 1 which is a special shift calculator.
  • the weight tensor selected according to the address or index And the pre-computed elements of the tensor P are stored by convolution calculation using only shift operation and addition operation.
  • the information processing apparatus 10 can significantly reduce the calculation cost of the convolutional layer, which is the portion with the largest calculation amount in the CNN.
  • the information processing apparatus 10 uses the ShiftALU unit 1211 or the algorithm 1 to convert a general CNN model into a power-of-two expression that can perform a convolution operation without multiplication. It can also be expressed as being converted to.
  • a convolution operation performed in a convolution layer of a general CNN model can be performed using only a shift operation and an addition operation without requiring re-learning of the CNN and without a decrease in accuracy.
  • the height and width of the output channel and the input channel are simply the same, ie, Assume that In this case, in the general CNN convolution layer, Thus, a convolution operation is performed.
  • the (PCHW) operation is executed as the convolution operation of the convolution layer.
  • the amount of calculation cost reduction by the number of operations is the ratio of these, that is, Can be quantified.
  • the number of operations in each convolutional layer constituting the CNN is calculated by replacing all multiplication operations with shift operations using a power of 2 expression. Can only decrease.
  • the ShiftALU unit 1211 performs (P-1) operations by [P / 2] 1-bit right shift processing and sign inversion processing. In other words, the ShiftALU unit 1211 can further reduce the number of cycles necessary to generate the pre-computed tensor P by a factor of P.
  • Example 1 The effectiveness of ShiftCNN which is the processing unit 12 of the information processing apparatus 10 has been extensively evaluated using an ImageNet dataset composed of a large number of images and tags representing the contents thereof. Will be described.
  • GoogleNet which are general CNN models used for image classification, are selected as conventional CNNs that are converted into ShiftCNN models.
  • Top-1 Accuracy means the accuracy rate at which the first candidate, that is, the top candidate in the identification result, completely matches the correct answer in the task of identifying what the input image is.
  • Top-5 Accuracy means the percentage of correct answers in the task of identifying what kind of image the input image contains in the top 5 of the identification results that exactly match the correct answer. To do.
  • FIG. 10 is a diagram illustrating an evaluation result obtained by evaluating the accuracy rate using the ImageNet dataset in Example 1.
  • FIG. 10 shows the results of evaluating Top-1 Accuracy and Top-5 Accuracy using an ImageNet dataset after converting SqueezeNet, GoogleNet, ResNet-18, and ResNet-50 to ShiftCNN models.
  • SqueezeNet base, GoogleNet base, ResNet-18 base, and ResNet-50 base are original CNN models that have not been converted to ShiftCNN models.
  • Those marked with “*” in the ResNet model indicate ShiftCNN models in which only the convolutional layer of the ResNet model is converted to a power of 2 representation.
  • B represents a bit width and corresponds to the 2's complement bit value described above.
  • N corresponds to the number of dimensions indicating the degree of freedom of 1-bit expression, and is represented as shifts in FIG.
  • the CNN model is converted into a ShiftCNN model in which the data representation is a power-of-two representation format by the algorithm 1 shown in FIG. I found that I can do it.
  • the information processing apparatus 10 can perform the convolution operation only by the addition operation and the shift operation within a range where the accuracy rate is lower than 1%, that is, the accuracy is decreased.
  • FIG. 11 is a diagram showing a comparison between the number of multiplication operations necessary for the convolution operation in the conventional convolution layer and the number of cycles of the shift operation necessary for the convolution operation after conversion to ShiftCNN in the three CNN models of the first embodiment.
  • the speedup shown in FIG. 11 is evaluated by dividing the number of shift operations by the number of multiplication operations necessary for the conventional convolution layer convolution operation.
  • SqueezeNet does not use the filter kernel H f W f > 3, so it can be seen that it has achieved only 260 times speedup.
  • GoogleNet and ResNet-18 use size 5 and size 7 filter kernels, which means they have achieved a speed increase of about 3 digits.
  • the number of operations can be reduced by two or more digits by converting the conventional CNN model to the ShiftCNN model.
  • Example 2 In Example 2, the ShiftALU unit 1211 shown in FIG. 4 and an arithmetic multiplier that performs a multiplication operation with 8 bits as a comparative example were designed using RTL (Resister Transfer Level) and compiled for the Xilinx Zynq XA7Z010 device.
  • the Xilinx Zynq XA7Z010 device is an automotive grade FPGA that operates at a 200MHz clock rate.
  • the bit width of the input tensor is 8 bits, and the ShiftALU unit 1211 and the arithmetic multiplier output a result with 16 bits.
  • FIG. 12 is a diagram showing a comparison of estimated power when the FPGA in the second embodiment is used.
  • FIG. 12 in addition to the ShiftALU unit 1211, for comparison, an arithmetic multiplier (Mult.UT) implemented using only the LUT without using the DSP block and the DSP block without using the LUT are used.
  • An arithmetic multiplier (Mult.DSP) is shown.
  • FIG. 12 also shows the number of lookup tables (LUTs), flip-flops (FFs), digital signal processing blocks (DSPs), 36 KB block RAMs (BRAMs), and dynamic power. And power consumption are shown.
  • FIG. 12 also shows “Equiv. Power” indicating the equivalent power required to have the same calculation speed. “Equiv. Power” was calculated by writing RTL code and executing power simulation.
  • Example 2 it was found that the power consumption of the convolutional layer of the ShiftCNN model mounted on the FPGA chip can be reduced by about 1/10. This shows that the conventional CNN model can be realized on an FPGA or ASIC chip by converting it to a ShiftCNN model.
  • the information processing apparatus and the information processing method according to the present disclosure it is possible to further improve the calculation efficiency of the convolution calculation and reduce the power consumption. Therefore, the information processing apparatus and the information processing method according to the present disclosure can be applied not only to a low-consumption embedded system such as being mounted on an FPGA or an ASIC, but also to a new type of DNN application.
  • the information processing apparatus and the information processing method of the present disclosure have been described in the embodiments, but the subject or apparatus that performs each process is not particularly limited. It may be processed by a processor or the like (described below) embedded in a specific device located locally. Further, it may be processed by a cloud server or the like arranged at a location different from the local device.
  • the present disclosure is not limited to the above embodiment.
  • another embodiment realized by arbitrarily combining the components described in this specification and excluding some of the components may be used as an embodiment of the present disclosure.
  • the present disclosure also includes modifications obtained by making various modifications conceivable by those skilled in the art without departing from the gist of the present disclosure, that is, the meanings of the words described in the claims. It is.
  • the present disclosure further includes the following cases.
  • the above apparatus is specifically a computer system including a microprocessor, ROM, RAM, a hard disk unit, a display unit, a keyboard, a mouse, and the like.
  • a computer program is stored in the RAM or hard disk unit. Each device achieves its function by the microprocessor operating according to the computer program.
  • the computer program is configured by combining a plurality of instruction codes indicating instructions for the computer in order to achieve a predetermined function.
  • a part or all of the constituent elements constituting the above-described apparatus may be configured by one system LSI (Large Scale Integration).
  • the system LSI is an ultra-multifunctional LSI manufactured by integrating a plurality of components on a single chip, and specifically, a computer system including a microprocessor, ROM, RAM, and the like. .
  • a computer program is stored in the RAM.
  • the system LSI achieves its functions by the microprocessor operating according to the computer program.
  • a part or all of the constituent elements constituting the above-described device may be constituted by an IC card or a single module that can be attached to and detached from each device.
  • the IC card or the module is a computer system including a microprocessor, a ROM, a RAM, and the like.
  • the IC card or the module may include the super multifunctional LSI described above.
  • the IC card or the module achieves its function by the microprocessor operating according to the computer program. This IC card or this module may have tamper resistance.
  • the present disclosure may be the method described above. Further, the present invention may be a computer program that realizes these methods by a computer, or may be a digital signal composed of the computer program.
  • the present disclosure provides a computer-readable recording medium such as a flexible disk, a hard disk, a CD-ROM, an MO, a DVD, a DVD-ROM, a DVD-RAM, a BD ( It may be recorded on a Blu-ray (registered trademark) Disc, a semiconductor memory, or the like.
  • the digital signal may be recorded on these recording media.
  • the computer program or the digital signal may be transmitted via an electric communication line, a wireless or wired communication line, a network represented by the Internet, a data broadcast, or the like.
  • the present disclosure may be a computer system including a microprocessor and a memory, and the memory may store the computer program, and the microprocessor may operate according to the computer program.
  • program or the digital signal is recorded on the recording medium and transferred, or the program or the digital signal is transferred via the network or the like and executed by another independent computer system. You may do that.
  • the present disclosure can be used for an information processing method, an information processing apparatus, and a program using CNN.
  • an information processing method, an information processing apparatus, and a program for performing a convolution operation performed in a convolution layer of CNN are mounted on an FPGA or an ASIC. It can be used for low consumption embedded systems.

Landscapes

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

Abstract

データを示す入力テンソルを、メモリを有しコンピュータにより処理される処理部に入力する入力ステップと、入力テンソルの各要素について2の累乗表現の形式に変換される事前計算が行われてメモリに格納された後において、所定のアルゴリズムにより予め2の累乗表現の形式に変換され、かつメモリに格納されている畳み込み演算に用いる可能性のある重みを示す重みテンソルと、メモリに格納された事前計算が行われた入力テンソルの各要素とを用いて、処理部に、加算演算およびシフト演算のみで畳み込み演算処理を行わせる処理ステップと、処理ステップにより畳み込み演算処理が行われた入力テンソルの各要素を、出力テンソルとして出力する出力ステップとを含む。

Description

情報処理方法、情報処理装置およびプログラム
 本開示は、情報処理方法、情報処理装置およびプログラムに関する。
 近年、画像分類、物体検出、および、画像を画素レベルで把握するセマンティックセグメンテーションなど、コンピュータビジョンを含む多くの研究分野において、深層学習アルゴリズムの成果がもたらされている。
 深層学習に用いられるディープニューラルネットワーク(DNN:Deep Neural Network)の中でも、畳み込みニューラルネットワーク(CNN:Convolutional Neural Network)は、最も広く使用されている。CNNの演算は、大量の電力を消費するグラフィック処理ユニット(GPU:Graphics Processing Unit)にのみ実行可能とされてきた。
 しかし、GPUにより実行されるCNNは、動作が容易であるものの計算効率の悪い浮動小数点形式を用いていることが知られている。
 そこで、計算コストが安くかつ電力効率に優れたCNNアーキテクチャと低消費電力で駆動する組み込みシステムへの実装とを実現させるべく、数多くの研究と実装の取り組みが行われている(例えば非特許文献1)。
 非特許文献1には、CNNのデータ表現として、浮動小数点形式よりも計算効率が良い量子化された固定小数点を用いる方法が開示されている。非特許文献1には、浮動小数点形式を低精度量子化表現の一つである固定小数点量子化形式に変換して畳み込み演算を行うことが開示されている。
Philipp Gysel, Mohammad Motamedi, and Soheil Ghiasi. Hardware-oriented approximation of convolutional neural networks. arXiv preprint arXiv:1604.03168, 2016.
 本開示の一形態に係る情報処理方法は、データを示す入力テンソルを、メモリを有しコンピュータにより処理される処理部に入力する入力ステップと、前記入力テンソルの各要素について2の累乗表現の形式に変換される事前計算が行われて前記メモリに格納された後において、所定のアルゴリズムにより予め2の累乗表現の形式に変換され、かつ前記メモリに格納されている畳み込み演算に用いる可能性のある重みを示す重みテンソルと、前記メモリに格納された前記事前計算が行われた前記入力テンソルの各要素とを用いて、前記処理部に、加算演算およびシフト演算のみで畳み込み演算処理を行わせる処理ステップと、前記処理ステップにより前記畳み込み演算処理が行われた前記入力テンソルの各要素を、出力テンソルとして出力する出力ステップとを含む。
 なお、これらの全般的または具体的な態様は、システム、方法、集積回路、コンピュータプログラムまたはコンピュータで読み取り可能なCD-ROMなどの記録媒体で実現されてもよく、システム、方法、集積回路、コンピュータプログラムおよび記録媒体の任意な組み合わせで実現されてもよい。
 本開示の情報処理方法等によれば、畳み込み演算の計算効率をより向上させて低消費電力化させることができる。
図1は、実施の形態における情報処理装置の構成の一例を示すブロック図である。 図2は、図1に示す処理部の詳細構成の一例を示すブロック図である。 図3は、図1に示す処理部が行う畳み込み演算処理を概念的に示す図である。 図4は、図3に示すShiftALU部の詳細構成を概念的に示す図である。 図5は、畳み込み演算に用いる可能性のある重みテンソルを2の累乗表現の形式に変換する所定のアルゴリズムを示す図である。 図6は、図2に示す畳み込み演算部の詳細構成を概念的に示す図である。 図7は、実施の形態における制御部の処理の流れが記述された擬似コードの一例を示す図である。 図8は、実施の形態における情報処理装置の演算処理を示すフローチャートである。 図9は、図8に示すステップS3の畳み込み演算処理の詳細を示すフローチャートである。 図10は、実施例1におけるImageNet datasetを用いて正解率を評価した評価結果を示す図である。 図11は、実施例1の3つのCNNモデルにおける従来の畳み込み層に畳み込み演算に必要な乗算演算の数とShiftCNNに変換後に畳み込み演算に必要なシフト演算のサイクル数の比較を示す図である。 図12は、実施例2におけるFPGAを利用した場合の推定電力の比較を示す図である。
 (本開示の基礎となった知見)
 非特許文献1で開示された技術では、畳み込み演算の計算効率を向上することができるものの、FPGA(Field Programmable Gate Array)またはASIC(Application Specific Integrated Circuit)など低消費の組み込みシステムに実装できる程ではない。つまり、畳み込み演算の計算効率をさらに向上させ低消費電力化することが求められる。
 本開示は、上述の事情を鑑みてなされたもので、畳み込み演算の計算効率をより向上させて低消費電力化させることができる情報処理方法、情報処理装置およびプログラムを提供する。
 本開示の一形態に係る情報処理方法は、データを示す入力テンソルを、メモリを有しコンピュータにより処理される処理部に入力する入力ステップと、前記入力テンソルの各要素について2の累乗表現の形式に変換される事前計算が行われて前記メモリに格納された後において、所定のアルゴリズムにより予め2の累乗表現の形式に変換され、かつ前記メモリに格納されている畳み込み演算に用いる可能性のある重みを示す重みテンソルと、前記メモリに格納された前記事前計算が行われた前記入力テンソルの各要素とを用いて、前記処理部に、加算演算およびシフト演算のみで畳み込み演算処理を行わせる処理ステップと、前記処理ステップにより前記畳み込み演算処理が行われた前記入力テンソルの各要素を、出力テンソルとして出力する出力ステップとを含む。
 これにより、畳み込み演算を、乗算演算を必要とせず加算演算およびシフト演算のみで行うことができるので、畳み込み演算の計算効率をより向上させて低消費電力化させることができる。
 ここで、例えば、前記処理ステップでは、前記処理部に、前記事前計算を行わせ、前記メモリに前記事前計算を行った前記入力テンソルの各要素を格納させる。
 また、例えば、前記処理ステップでは、前記処理部に、畳み込みニューラルネットワークを構成する畳み込み層の演算を行わせてもよい。
 これにより、CNNの畳み込み層で行われる畳み込み演算の計算効率をより向上させて、CNNが実装される装置の低消費電力化を図ることができる。
 また、例えば、前記重みテンソルは、2の補数のビット値がB(1以上の整数)とすると2-1個の組み合わせからなり、かつ、前記メモリにコードブックとして格納されており、前記処理ステップでは、前記コードブックから、1ビットの表現の自由度を示す次元数とするN(1以上の整数)および前記Bとにより特定される重みテンソルの要素を取得して用いてもよい。
 これにより、畳み込み演算を行う際に必要な重みを予め辞書的にコードブックとして保持できるので、畳み込み演算の計算効率をより向上させることができる。
 また、例えば、前記Nは、2以上の整数であるとしてもよい。
 これにより、1%未満の正解率低下すなわち精度低下の範囲において、畳み込み演算を、加算演算およびシフト演算のみで行うことができる。
 また、本開示の一形態に係る情報処理装置は、データを示す入力テンソルを入力する入力部と、メモリを有しコンピュータにより処理される処理部であって、前記入力テンソルの各要素について2の累乗表現の形式に変換される事前計算が行われて前記メモリに格納された後において、所定のアルゴリズムにより予め2の累乗表現の形式に変換され、かつ前記メモリに格納されている畳み込み演算に用いる可能性のある重みを示す重みテンソルと、前記メモリに格納された前記事前計算が行われた前記入力テンソルの各要素とを用いて、加算演算およびシフト演算のみで畳み込み演算処理を行う処理部と、前記処理部により前記畳み込み演算処理が行われた前記入力テンソルの各要素を、出力テンソルとして出力する出力部とを含む。
 なお、これらの包括的または具体的な態様は、システム、方法、集積回路、コンピュータプログラムまたはコンピュータで読み取り可能なCD-ROMなどの記録媒体で実現されてもよく、システム、方法、集積回路、コンピュータプログラムおよび記録媒体の任意な組み合わせで実現されてもよい。
 以下で説明する実施の形態は、いずれも本開示の一具体例を示すものである。以下の実施の形態で示される数値、形状、構成要素、ステップ、ステップの順序などは、一例であり、本開示を限定する主旨ではない。また、以下の実施の形態における構成要素のうち、最上位概念を示す独立請求項に記載されていない構成要素については、任意の構成要素として説明される。また全ての実施の形態において、各々の内容を組み合わせることもできる。
 (実施の形態)
 以下では、図面を参照しながら、実施の形態における情報処理装置10の情報処理方法等の説明を行う。
 [情報処理装置10の構成]
 図1は、実施の形態における情報処理装置10の構成の一例を示すブロック図である。
 情報処理装置10は、畳み込みニューラルネットワークを用いたコンピュータ等で実現されてもよい。情報処理装置10は、図1に示すように入力部11と処理部12と出力部13とで構成されている。情報処理装置10は、画像、動画像など処理対象のデータが入力されると、畳み込み演算処理を行い、その結果である畳み込み演算処理結果を出力する。なお、処理対象のデータは、画像または動画像である場合に限らない。
 [入力部11]
 入力部11は、処理対象のデータを示す入力テンソルを処理部12に入力する。ここで、処理対象のデータは、画像または動画像であるが、これに限らない。処理部12が、1層の畳み込み層の演算を行う場合には、データは、当該畳み込み層の前にある畳み込み層などによる畳み込み演算処理結果であってもよい。
 [処理部12]
 処理部12は、メモリ124を有しコンピュータにより処理される。処理部12は、入力テンソルの各要素について2の累乗表現の形式に変換される事前計算が行われてメモリ124に格納された後において、所定のアルゴリズムにより予め2の累乗表現の形式に変換され、かつメモリ124に格納されている畳み込み演算に用いる可能性のある重みを示す重みテンソルと、メモリ124に格納された事前計算が行われた入力テンソルの各要素とを用いて、加算演算およびシフト演算のみで畳み込み演算処理を行う。ここで、処理部12は、事前計算を行い、メモリ124に事前計算を行った入力テンソルの各要素を格納してもよい。また、重みテンソルは、2の補数のビット値がB(1以上の整数)とすると2-1個の組み合わせからなり、かつ、メモリ124にコードブックとして格納されていてもよい。処理部12は、コードブック123から、1ビットの表現の自由度を示す次元数とするN(1以上の整数)および当該Bとにより特定される重みテンソルの要素を取得して用いる。なお、Nは、2以上の整数であるとよい。
 具体的には、処理部12は、CNNのデータ表現を後述するハードウェア効率の高い2の累乗表現形式に変換して、乗算なしで畳み込み演算を実行する。換言すると、処理部12は、乗算なしで畳み込み演算が実行できるShiftCNNとも称するCNNアーキテクチャであるともいえる。なお、処理部12は、CNNを構成する畳み込み層の演算を行う場合に限らず、単に畳み込み演算を行うとしてもよい。
 以下では、図を用いて、処理部12の詳細構成について説明するが、説明を簡単にするため、処理部12は、CNNを構成する複数の畳み込み層のうちの1層の畳み込み層の演算を行うとして説明する。
 図2は、図1に示す処理部12の詳細構成の一例を示すブロック図である。図3は、図1に示す処理部12が行う畳み込み演算処理を概念的に示す図である。
 本実施の形態では、処理部12は、図2に示すように、事前計算部121と、畳み込み演算部122と、コードブック123と、メモリ124と、制御部125とを備える。なお、処理部12は、事前計算部121を備えなくてもよい。
 まず、一般的なCNNの畳み込み層の演算すなわち畳み込み演算について説明する。
 <畳み込み演算>
 一般的なCNNの各畳み込み層への入力は、入力テンソルXで表すことができる。入力テンソルXは、入力チャンネル数をC、高さをH、幅をWとすると、(式1)に示される集合Rの要素である。
Figure JPOXMLDOC01-appb-M000001
 そして、入力テンソルXは、重みテンソルWで畳み込まれる。重みテンソルWは、(式2)に示される集合Rの要素である。
Figure JPOXMLDOC01-appb-M000002
 (式2)において、出力チャンネル数を
Figure JPOXMLDOC01-appb-M000003
、フィルタカーネルの高さをHf、フィルタカーネルの幅をWfとしている。
 なお、バイアスベクトルで示されるバイアス項bが畳み込み演算の結果に加算される。バイアス項bは、(式3)に示される集合Rの要素である。
Figure JPOXMLDOC01-appb-M000004
Figure JPOXMLDOC01-appb-M000005
個のチャンネル数の出力テンソルYは、(式4)に示す計算式を用いて、算出することができる。出力テンソルYは、(式5)に示される集合Rの要素である。なお、(式4)において、*は畳み込み演算を行うことを表す。
Figure JPOXMLDOC01-appb-M000006
Figure JPOXMLDOC01-appb-M000007
 次に、処理部12を構成する各構成要素について図2、図3等を用いて説明する。
 <メモリ124>
 メモリ124は、ハードディスクまたは半導体メモリ等で構成され、情報を記憶する。
 本実施の形態では、メモリ124は、事前計算部121が事前計算した結果、および、畳み込み演算部122が行った畳み込み演算処理の結果を記憶する。
 なお、メモリ124は、畳み込み演算部122が畳み込み演算処理を行う際に用いるバイアス項の値を記憶していてもよい。また、メモリ124は、後述するコードブック123を記憶しているとしてもよい。
 <事前計算部121>
 事前計算部121は、入力テンソルXの各要素について2の累乗表現の形式に変換する事前計算を行う。事前計算部121は、当該事前計算を行い、当該事前計算を行った入力テンソルXの各要素をメモリ124に格納する。
 本実施の形態では、事前計算部121は、図3に示すように、ShiftALU部1211を備える。事前計算部121は、畳み込み演算部122で畳み込み演算を行う前に、事前計算として、ShiftALU部1211を用いて、例えば11aで示される入力テンソルXの各要素について2の累乗表現の形式であるテンソルPに変換する。ここで、テンソルPは、例えば図3において124aで示されており、入力テンソルXの各要素について有り得るすべての組み合わせとなっている。テンソルPは、2の補数のビット値をB(1以上の整数)、1ビットの表現の自由度を示す次元数をN(1以上の整数)としたとき、(M+2(N-1))の組み合わせからなる。テンソルPは、入力テンソルXをシフト演算できるような表現形式に変換したテンソルに該当する。
 ≪ShiftALU部1211≫
 図4は、図3に示すShiftALU部1211の詳細構成を概念的に示す図である。
 ShiftALU部1211は、Shift Arithmetic Unitとも称する特殊なシフト演算器であり、複数のシフタと、符号反転を行う複数のフリップとで構成されている。複数のシフタと複数のフリップとは、ロジック回路で実現されてもよいし、プログラムロジックで実現されてもよい。図4に示すように、複数のシフタそれぞれは、入力値である入力テンソルXを右に1つずつシフトする演算を行いメモリ124に格納する。また、複数のフリップのそれぞれは、シフタにより右にシフトするよう演算された値を符号反転させてメモリ124に格納する。ShiftALU部1211は、合計(1/P)回の1ビットシフトを実行する。このようにして、テンソルPを事前計算してメモリ124に格納することができる。
 なお、事前計算部121は、上述したように、処理部12に備えられなくてもよい。この場合、処理部12の外部に事前計算部121が設けられ、事前計算部121が行った事前計算の結果であるテンソルPがメモリ124に格納されていればよい。また、ShiftALU部1211がプログラムロジックである場合には、ShiftALU部1211は、後述する図5に示す所定のアルゴリズムを用いて、入力テンソルXからテンソルPに変換する事前計算を行ってもよい。
 <コードブック123>
 図5は、畳み込み演算に用いる可能性のある重みテンソルを2の累乗表現の形式に変換する所定のアルゴリズムを示す図である。図5において、所定のアルゴリズムは、アルゴリズム1と表記されている。
 コードブック123は、メモリ124に格納されているとしてもよいし、メモリ124とは異なるメモリに格納されているとしてもよい。本実施の形態では、メモリ124とは異なるメモリに格納されているとして説明する。
 コードブック123は、所定のアルゴリズムにより予め2の累乗表現の形式に変換され、かつ畳み込み演算に用いる可能性のある重みを示す重みテンソルWの組み合わせが格納されている。換言すると、重みテンソルWは、2の補数のビット値がB(1以上の整数)とすると2-1個の組み合わせからなり、かつ、メモリにコードブック123として格納されている。重みテンソルWの要素は、コードブック123から、1ビットの表現の自由度を示す次元数N(1以上の整数)および当該Bとにより特定される。なお、Nは、2以上の整数であってもよい。換言すると、コードブック123は、BとNとで特定できるアドレスまたは指標が紐づけられた重みテンソルの辞書のようなものである。
 本実施の形態では、重みテンソルWは、低精度の重みテンソル
Figure JPOXMLDOC01-appb-M000008
で近似されてコードブック123に格納されている。重みテンソルWは、低精度の重みテンソル
Figure JPOXMLDOC01-appb-M000009
で近似することで、2の累乗表現の形式にされた2-1個の組み合わせからなる重みとすることができるので、テーブル化すなわちコードブック123に予め格納できる。
 低精度の重みテンソル
Figure JPOXMLDOC01-appb-M000010
の各要素
Figure JPOXMLDOC01-appb-M000011
は、(式6)で表され、コードブック123に格納される。
Figure JPOXMLDOC01-appb-M000012
 (式6)において、
Figure JPOXMLDOC01-appb-M000013
である。つまり、Cnはコードブック123におけるアドレスまたは指標を示している。
 なお、本実施の形態では、所定のアルゴリズムすなわち、図5に示すアルゴリズム1を用いて、低精度の重みテンソル
Figure JPOXMLDOC01-appb-M000014
の各要素
Figure JPOXMLDOC01-appb-M000015
が、MAX(abs(W))で正規化した上で変換されて、コードブック123に格納されている。
 図5では、2行目において、重みテンソルの最大値に対する要素
Figure JPOXMLDOC01-appb-M000016
の値を入力値rとすることで、0~1の値で3行目以降のアルゴリズム1を実行する。
 3行目では2行目の入力値rの符号をqsgnとして算出し、4行目では2行目の入力値rが2の何乗の桁数を、qlogとして算出している。また、7行目~9行目では、量子化の境界を示すlog21.5を用いて、qlogの値の桁数を例えば四捨五入するように1つあげるかそのままかを算出している。10行目~16行目ではN回再帰的に桁数を量子化つまり2の累乗表現の形式に変換している。
 <畳み込み演算部122>
 畳み込み演算部122は、事前計算が行われた後において、所定のアルゴリズムにより予め2の累乗表現の形式に変換され、かつ畳み込み演算に用いる可能性のある重みを示す重みテンソルと、メモリ124に格納された事前計算が行われた入力テンソルの各要素とを用いて、加算演算およびシフト演算のみで畳み込み演算処理を行う。
 例えば図3に概念的に示されるように、畳み込み演算部122は、事前計算後テンソル124aと、重みテンソル123aと、バイアス項124bとを用いて、加算演算およびシフト演算のみで畳み込み演算処理を行う。事前計算後テンソル124aは、事前計算部121のShiftALU部1211により事前計算が行われた入力テンソルの各要素である。重みテンソル123aはコードブック123に格納されている重みテンソルであって、図5に示すアルゴリズム1により予め2の累乗表現の形式に変換され、かつ畳み込み演算に用いる可能性のある重みを示す低精度の重みテンソルから取得されたものである。
 図6は、図2に示す畳み込み演算部122の詳細構成を概念的に示す図である。
 本実施の形態では、畳み込み演算部122は、図6に示すように、マルチプレクサ1221、1222と、加算器1223とを備える。
 マルチプレクサ1221は、重みテンソル123aのアドレスまたは指標に従ってメモリ124から、事前計算後テンソル124aをフェッチ(取得)して、重みテンソル123aと事前計算後テンソル124aとの畳み込み演算をシフト演算にて行い、加算器1223に出力する。より具体的には、マルチプレクサ1221は、重みテンソル123aの要素の値としてゼロ(値0)または2の累乗の桁を示す値を選択し、事前計算後テンソル124aの要素の値である2の累乗の桁を示す値と、重みテンソル123aの要素の値としての2の累乗の桁を示す値とをシフト演算した結果を加算器1223に出力する。
 加算器1223は、マルチプレクサ1221が出力した値とバイアス項124bとを加算することで、仮の出力テンソル13bを算出する。なお、加算器1223は、仮の出力テンソル13bを前回算出していた場合には、マルチプレクサ1221が出力した値に対して、バイアス項124bと前回算出していた仮の出力テンソル13bとを加算した値を加算することで、仮の出力テンソル13bを更新する。そして、加算器1223は、N-1回更新された仮の出力テンソル13bを出力テンソル13aとして出力部13に出力する。このようにして、仮の出力テンソル13bはN-1回更新されて、出力テンソル13aとして出力部13に出力される。
 マルチプレクサ1222は、バイアス項124bと、加算器1223により前回算出または更新された仮の出力テンソル13bとを加算した値を、加算器1223に出力する。なお、マルチプレクサ1222は、加算器1223により前回算出または前回更新された仮の出力テンソル13bがない場合には、バイアス項124bのみを加算器1223に出力する。
 <制御部125>
 制御部125は、事前計算部121および畳み込み演算部122を制御する。
 ところで、制御部125が、事前計算部121にShiftALU部1211を用いて事前計算後テンソル124aを計算させることは簡単である。一方、制御部125が、畳み込み演算部122に、シフト演算および加算演算のみで畳み込み演算を行わせるには、潜在的なすべてのフィルタカーネルをサポートする必要があり、複雑なスケジューリングおよび制御ロジックを必要とする。
 図7は、実施の形態における制御部125の処理の流れが記述された擬似コードの一例を示す図である。図7において、擬似コードは、アルゴリズム2と表記されている。
 図7では、2行目において、入力テンソルXとして入力ベクトルxを読み込むことが記述されている。3行目には、事前計算部121に事前計算を行わせてメモリ124に格納させることが記述されている。
 4行目では、出力チャンネル数だけ繰り返して、5~9行目の計算を行わせることが記述されている。5行目では、6~9行目の計算後にバイアス項を加算演算することが記述されている。
 6~8行目では、畳み込み演算部122に、事前計算されたPの要素のNの回数分、潜在的なすべてのフィルタカーネルの高さと幅に対して、畳み込み演算を行わせることが記述されている。9行目では、畳み込み演算部122に、畳み込み演算を行った結果の値を出力テンソルとすることが記述されている。
 本実施の形態では、制御部125は、例えば図7に示す擬似コードに従って、事前計算部121および畳み込み演算部122を制御して、事前計算と畳み込み演算とを行う。
 [出力部13]
 出力部13は、処理部12により畳み込み演算処理が行われた入力テンソルの各要素を、出力テンソルとして出力する。
 本実施の形態では、出力部13は、CNNを構成する1層の畳み込み層が行う畳み込み演算処理結果として畳み込み演算部122により出力された出力テンソル13aを出力する。
 [情報処理装置10の動作]
 次に、上記のように構成された情報処理装置10の動作について説明する。
 図8は、実施の形態における情報処理装置10の演算処理を示すフローチャートである。
 まず、情報処理装置10は、処理対象のデータを示す入力テンソルを、処理部12に入力する入力処理を行う(S1)。より具体的には、情報処理装置10のコンピュータは、図1に示す入力部11に、処理対象のデータを示す入力テンソルを処理部12に入力させる。
 次に、情報処理装置10は、入力テンソルを2の累乗表現の形式に変換する事前計算を行う(S2)。より具体的には、情報処理装置10のコンピュータは、処理部12の事前計算部121に、入力テンソルの各要素について2の累乗表現の形式に変換する事前計算を行わせ、メモリ124に格納させる。
 次に、情報処理装置10は、ステップS2において事前計算された入力テンソルを用いて、加算およびシフト演算のみで畳み込み演算処理を行う(S3)。より具体的には、情報処理装置10のコンピュータは、処理部12の畳み込み演算部122に、事前計算後において、所定のアルゴリズムにより予め2の累乗表現の形式に変換され、かつコードブック123に格納されている畳み込み演算に用いる可能性のある重みを示す重みテンソルと、メモリ124に格納された事前計算が行われた入力テンソルの各要素とを用いて、加算演算およびシフト演算のみで畳み込み演算処理を行わせる。
 次に、情報処理装置10は、ステップS3において畳み込み演算処理された入力テンソルを、出力テンソルとして出力する(S4)。より具体的には、情報処理装置10のコンピュータは、出力部13に、ステップS3において処理部12により畳み込み演算処理が行われた入力テンソルの各要素を、出力テンソルとして出力させる。
 図9は、図8に示すステップS3の畳み込み演算処理の詳細を示すフローチャートである。
 ステップS3において、まず、情報処理装置10のコンピュータは、畳み込み演算部122に、ステップS2において事前計算された入力テンソルを取得させる(S31)。
 次に、情報処理装置10のコンピュータは、畳み込み演算部122に、コードブック123から重みテンソルを取得させる(S32)。コードブック123に格納されている重みテンソルは、アルゴリズム1により予め2の累乗表現の形式に変換され、かつ畳み込み演算に用いる可能性のある重みである。本実施の形態では、コードブック123に格納されている重みテンソルは、低精度の重みテンソルとして2の累乗表現の形式に変換されている。畳み込み演算部122は、アドレスまたは指標により、コードブック123を参照し、事前計算された入力テンソルの各要素に対する畳み込み演算に必要な重みテンソルを取得することができる。
 次に、情報処理装置10のコンピュータは、畳み込み演算部122に、ステップS32で取得した重みテンソルと、ステップS31で取得した事前計算された入力テンソルとを用いて、加算演算およびシフト演算のみで畳み込み演算を行わせる(S33)。
 次に、情報処理装置10のコンピュータは、畳み込み演算部122に、ステップS33で行った畳み込み演算の結果に、バイアス項と1回前に更新または1回前に算出させた仮の出力テンソルを加算させ、仮の出力テンソルを更新させる(S34)。
 次に、情報処理装置10のコンピュータは、畳み込み演算部122に、ステップS31で取得した事前計算された入力テンソルの要素の数だけ畳み込み演算を行ったか否かを判定する(S35)。事前計算された入力テンソルの要素の数だけ畳み込み演算が行われた場合(S35でYes)、情報処理装置10のコンピュータは、出力部13に、仮の出力テンソルを、畳み込み演算処理された出力テンソルとして出力させる(S36)。
 一方、事前計算された入力テンソルの要素の数だけ畳み込み演算が行われていない場合(S35でNo)、情報処理装置10のコンピュータは、畳み込み演算部122に、ステップS31の処理から再度行わせる。
 [効果等]
 以上のように、本実施の形態における情報処理装置10によれば、畳み込み演算を、乗算演算を必要とせず加算演算およびシフト演算のみで行うことができるので、畳み込み演算の計算効率をより向上させて低消費電力化させることができる。より具体的には、本実施の形態の情報処理装置10によれば、CNNのデータ表現として、ハードウェア効率の高い2の累乗表現形式を採用することで、畳み込み演算を乗算なしでシフト演算および加算演算のみで行うことができる。これにより、CNNにおいて最も計算量の多い部分である畳み込み層の計算コストを大幅に削減することができる。よって、CNNの畳み込み層で行われる畳み込み演算の計算効率をより向上させて、CNNが実装される装置の低消費電力化を図ることもできる。
 また、本実施の形態の情報処理装置10では、畳み込み演算に用いる可能性のある重みを2の累乗表現の形式に予め変換して、アドレスまたは指標が紐づけられた重みとして格納されているコードブック123を用いて、畳み込み演算を行う。コードブック123には、2の補数のビット値B(1以上の整数)とすると、重みは2-1個の組み合わせからなる2の累乗表現の形式に変換された重みが格納されるので、比較的小さい。このように畳み込み演算を行う際に必要な重みを予め辞書的にコードブックとして保持できるので、畳み込み演算の畳み込み項を事前計算することを可能にする。例えば、一般的なCNNモデルの畳み込み層の畳み込み演算で必要とする演算回数を1/100つまり少なくとも2桁現象させることができるなど、畳み込み演算の計算コストを削減することができるので、畳み込み演算の計算効率をより向上させることができる。
 より詳細には、本実施の形態の情報処理装置10では、以下の3つの特徴がある。第1に、畳み込み演算に用いる可能性のある重みテンソルWを低精度の重みテンソル
Figure JPOXMLDOC01-appb-M000017
で近似することで、M=2-1個の組み合わせからなる2の累乗表現の形式に変換された重みテンソルをコードブック123に予め用意できる。第2に、入力テンソルXの各要素のすべての組み合わせについて、2の累乗表現の形式であるテンソルPを事前計算する。テンソルPの事前計算は、特殊なシフト演算器であるShiftALU部1211またはアルゴリズム1を用いて行われる。第3に、アドレスまたは指標に従って選択した重みテンソル
Figure JPOXMLDOC01-appb-M000018
と事前計算されたテンソルPの各要素とをシフト演算および加算演算のみを用いて畳み込み演算したものを蓄積することで、畳み込み演算処理を行う。
 このようにして、本実施の形態における情報処理装置10は、CNNにおいて最も計算量の多い部分である畳み込み層の計算コストを大幅に削減することができる。
 なお、本実施の形態の情報処理装置10は、ShiftALU部1211またはアルゴリズム1を用いて、一般的なCNNモデルを、畳み込み演算を乗算なしで行うことができる、2の累乗表現に変換したShiftCNNモデルに変換しているとも表現できる。そして、ShiftCNNモデルでは、CNNの再学習が不要で、精度低下もない状態で、一般的なCNNモデルの畳み込み層で行われる畳み込み演算を、シフト演算および加算演算のみを用いて行うことができる。
 ここで、ストライド1を有するフィルタカーネルについて、簡単に、出力チャンネルと入力チャンネルとの高さおよび幅を同一、すなわち
Figure JPOXMLDOC01-appb-M000019
と仮定する。この場合、一般的なCNNの畳み込み層では、
Figure JPOXMLDOC01-appb-M000020
の乗算が実行されて畳み込み演算が行われることになる。一方、本実施の形態の情報処理装置10では、畳み込み層の畳み込み演算として、(PCHW)の演算のみを実行する。
 また、
Figure JPOXMLDOC01-appb-M000021
であるので、演算回数による計算コストの削減量は、これらの比、すなわち
Figure JPOXMLDOC01-appb-M000022
で定量化できる。つまり、CNNを構成する各畳み込み層における演算数は、すべての乗算演算を2の累乗表現によるシフト演算に置き換えて行うことにより、
Figure JPOXMLDOC01-appb-M000023
だけ減少できる。
 ShiftALU部1211は、[P/2]回の1ビットずつの右シフト処理と符号反転処理とにより(P-1)回の演算を行う。つまり、ShiftALU部1211は、事前計算されたテンソルPを生成するのに必要なサイクル数をPの因数だけさらに減らせる。
 (実施例1)
 情報処理装置10の処理部12であるShiftCNNの有効性について、大量の画像とその内容を表すタグで構成されているImageNet datasetを用いて広範な評価を行ったので、その評価結果を実施例1として説明する。
 <評価対象>
 本実施例では、ShiftCNNモデルに変換される従来のCNNとして、画像分類に用いられる一般的なCNNモデルであるGoogleNetとResNetとSqueezeNetとを選択した。
 GoogleNetとResNet-50とは、事前にトレーニングされたモデルのサブセットとして、オープンソースのディープラーニングライブラリであるCaffeからダウンロードした。SqueezeNet v1.1およびResNet-18は、インターネットで公に利用可能なソースをダウンロードした。これら全てのCNNモデルは、その著者によってImageNet datasetを用いて予め学習されたものである。
 <評価条件>
 これら全てのCNNモデルを図5に示したアルゴリズム1を用いて、浮動小数点精度を下げた2の累乗表現の形式にエミュレートすることによりShiftCNNモデルに変換した。そして、ImageNetの検証用データセットから切り取って縦横比を維持しつつ中央にさせた5万の画像を用いて、CaffeツールによりTop-1 AccuracyとTop-5 Accuracyを評価した。
 ここで、Top-1 Accuracyとは、入力された画像がどういう画像かを識別するタスクにおいて、識別結果のうちの第1候補すなわちトップ候補が正解と完全一致した正解率を意味する。Top-5 Accuracyとは、入力された画像がどういう画像かを識別するタスクにおいて、識別結果のうちの第5位までの画像の中に正解と完全一致したものが含まれている正解率を意味する。
 <評価結果>
 図10は、実施例1におけるImageNet datasetを用いて正解率を評価した評価結果を示す図である。図10には、SqueezeNet、GoogleNet、ResNet-18およびResNet-50をShiftCNNモデルに変換後に、ImageNet datasetを用いてTop-1 AccuracyとTop-5 Accuracyとを評価した結果が示されている。
 また、図10において、SqueezeNet base、GoogleNet base、ResNet-18 baseおよびResNet-50 baseは、ShiftCNNモデルに変換していない元のCNNモデルである。ResNetモデルに「*」のマークが付いているものは、ResNetモデルのうちの畳み込み層のみが2の累乗表現に変換されたShiftCNNモデルを示している。また、Bは、ビット幅を示し、上述した2の補数のビット値に該当する。また、Nは、1ビットの表現の自由度を示す次元数に該当し、図10中では、shiftsと表現されている。
 図10から、ShiftCNNモデルに変換されたCNNモデルは、B=4かつN>2の場合、正解率の低下すなわち精度低下が0.29%未満であるのがわかる。また、ShiftCNNモデルに変換されたCNNモデルは、B=4かつN=2の場合、1%以内で正解率の低下すなわち精度低下を示している。これらから、正解率と計算の複雑さとは、トレードオフの関係があるように考えられる。
 なお、ShiftCNNモデルに変換されたCNNモデルは、B>4では、有意な精度向上は認められなかった。また、図10から、ShiftCNNモデルに変換されたCNNモデルは、N=1の場合、有意に機能せず、再学習が必要であることを示唆し、従来の畳み込み層と同じ数の加算演算が必要となる。
 以上から、ShiftCNNモデルに変換されたCNNモデルは、B=4かつN>2であれば、再学習を行わなくても、元のCNNモデルと同等の正解率を得られることがわかった。
 つまり、CNNモデルは、図5に示すアルゴリズム1により、データ表現が2の累乗表現の形式であるShiftCNNモデルに変換することで、1%未満の正解率低下すなわち精度低下の範囲において、畳み込み演算を行えることがわかった。
 したがって、本開示の情報処理装置10は、1%未満の正解率低下すなわち精度低下の範囲において、畳み込み演算を、加算演算およびシフト演算のみで行うことができるのがわかった。
 図11は、実施例1の3つのCNNモデルにおける従来の畳み込み層に畳み込み演算に必要な乗算演算の数とShiftCNNに変換後に畳み込み演算に必要なシフト演算のサイクル数の比較を示す図である。なお、図11に示すスピードアップは、シフト演算の数を従来の畳み込み層の畳み込み演算に必要な乗算演算の数で割ることで評価している。
 図11からわかるように、SqueezeNetはフィルタカーネルHfWf>3を使用しないため、260倍のスピードアップしか達成していないのがわかる。一方、GoogleNetとResNet-18とはサイズ5とサイズ7のフィルタカーネルを使用しているため、約3桁のスピードアップを達成しているのがわかる。
 したがって、図11から、従来のCNNモデルをShiftCNNモデルに変換することで、演算数を2桁以上減らせることができることがわかる。
 (実施例2)
 実施例2では、図4に示すShiftALU部1211と、比較例として8ビットで乗算演算する算術乗算器とをRTL(Resister Transfer Level)を使用して設計し、Xilinx Zynq XA7Z010デバイス用にコンパイルした。Xilinx Zynq XA7Z010デバイスは、200MHzクロックレートで動作する自動車グレードのFPGAである。入力テンソルのビット幅は8ビットとし、ShiftALU部1211および算術乗算器は16ビットで結果を出力するとした。また、ShiftALU部1211で用いるビット幅を示すBは4ビットであり、畳み込み層の深さはC= 512とした。
 図12は、実施例2におけるFPGAを利用した場合の推定電力の比較を示す図である。
 図12には、ShiftALU部1211に加えて、比較のため、DSPブロックを使用せずLUTのみを使用して実装した算術乗算器(Mult.UT)と、LUTを使用せずDSPブロックを使用して実装した算術乗算器(Mult.DSP)とが示されている。また、図12には、利用しているルックアップテーブル(LUT)の数、フリップフロップ(FF)の数、デジタル信号処理ブロック(DSP)の数、36KBブロックRAM(BRAM)の数および動的電力と、消費電力とが示されている。
 図12から、ShiftALU部1211の動的電力の85%が、BRAMメモリによって消散されたことがわかる。
 また、図12には、同じ計算速度を有するために必要な等価電力を示す「Equiv. Power」が示されている。「Equiv. Power」は、RTLコードを記述し、電力シミュレーションを実行することで計算した。
 図12によれば、畳み込み層の畳み込み演算を行う際のShiftALU部1211の消費電力は、算術乗算器(Mult.LUT)と比較して、10分の1に減少していることがわかる。この結果は、乗算演算の複雑さがO(B2)であるのに対して、加算演算の複雑さがO(B)であるので、計算コストが大幅に少なくなることからもわかる。
 したがって、実施例2によれば、FPGAチップ上に実装されたShiftCNNモデルの畳み込み層の消費電力は1/10程度減少させることができるのがわかった。これにより、従来のCNNモデルをShiftCNNモデルに変換することで、FPGAまたはASICチップ上で実現可能であることがわかる。
 以上のように、本開示に係る情報処理装置および情報処理方法によれば、畳み込み演算の計算効率をより向上させて低消費電力化させることができる。したがって、本開示に係る情報処理装置および情報処理方法を、FPGAまたはASICに実装するなど低消費の組み込みシステムに適用できるだけでなく、新しいタイプのDNNのアプリケーションに適用できる。
 (他の実施態様の可能性)
 以上、実施の形態において本開示の情報処理装置および情報処理方法について説明したが、各処理が実施される主体や装置に関しては特に限定しない。ローカルに配置された特定の装置内に組み込まれたプロセッサーなど(以下に説明)によって処理されてもよい。またローカルの装置と異なる場所に配置されているクラウドサーバなどによって処理されてもよい。
 なお、本開示は、上記実施の形態に限定されるものではない。例えば、本明細書において記載した構成要素を任意に組み合わせて、また、構成要素のいくつかを除外して実現される別の実施の形態を本開示の実施の形態としてもよい。また、上記実施の形態に対して本開示の主旨、すなわち、請求の範囲に記載される文言が示す意味を逸脱しない範囲で当業者が思いつく各種変形を施して得られる変形例も本開示に含まれる。
 また、本開示は、さらに、以下のような場合も含まれる。
 (1)上記の装置は、具体的には、マイクロプロセッサ、ROM、RAM、ハードディスクユニット、ディスプレイユニット、キーボード、マウスなどから構成されるコンピュータシステムである。前記RAMまたはハードディスクユニットには、コンピュータプログラムが記憶されている。前記マイクロプロセッサが、前記コンピュータプログラムに従って動作することにより、各装置は、その機能を達成する。ここでコンピュータプログラムは、所定の機能を達成するために、コンピュータに対する指令を示す命令コードが複数個組み合わされて構成されたものである。
 (2)上記の装置を構成する構成要素の一部または全部は、1個のシステムLSI(Large Scale Integration:大規模集積回路)から構成されているとしてもよい。システムLSIは、複数の構成部を1個のチップ上に集積して製造された超多機能LSIであり、具体的には、マイクロプロセッサ、ROM、RAMなどを含んで構成されるコンピュータシステムである。前記RAMには、コンピュータプログラムが記憶されている。前記マイクロプロセッサが、前記コンピュータプログラムに従って動作することにより、システムLSIは、その機能を達成する。
 (3)上記の装置を構成する構成要素の一部または全部は、各装置に脱着可能なICカードまたは単体のモジュールから構成されているとしてもよい。前記ICカードまたは前記モジュールは、マイクロプロセッサ、ROM、RAMなどから構成されるコンピュータシステムである。前記ICカードまたは前記モジュールは、上記の超多機能LSIを含むとしてもよい。マイクロプロセッサが、コンピュータプログラムに従って動作することにより、前記ICカードまたは前記モジュールは、その機能を達成する。このICカードまたはこのモジュールは、耐タンパ性を有するとしてもよい。
 (4)また、本開示は、上記に示す方法であるとしてもよい。また、これらの方法をコンピュータにより実現するコンピュータプログラムであるとしてもよいし、前記コンピュータプログラムからなるデジタル信号であるとしてもよい。
 (5)また、本開示は、前記コンピュータプログラムまたは前記デジタル信号をコンピュータで読み取り可能な記録媒体、例えば、フレキシブルディスク、ハードディスク、CD-ROM、MO、DVD、DVD-ROM、DVD-RAM、BD(Blu-ray(登録商標) Disc)、半導体メモリなどに記録したものとしてもよい。また、これらの記録媒体に記録されている前記デジタル信号であるとしてもよい。
 また、本開示は、前記コンピュータプログラムまたは前記デジタル信号を、電気通信回線、無線または有線通信回線、インターネットを代表とするネットワーク、データ放送等を経由して伝送するものとしてもよい。
 また、本開示は、マイクロプロセッサとメモリを備えたコンピュータシステムであって、前記メモリは、上記コンピュータプログラムを記憶しており、前記マイクロプロセッサは、前記コンピュータプログラムに従って動作するとしてもよい。
 また、前記プログラムまたは前記デジタル信号を前記記録媒体に記録して移送することにより、または前記プログラムまたは前記デジタル信号を、前記ネットワーク等を経由して移送することにより、独立した他のコンピュータシステムにより実施するとしてもよい。
 本開示は、CNNを用いた情報処理方法、情報処理装置およびプログラムに利用でき、特にCNNの畳み込み層で行われる畳み込み演算を行う情報処理方法、情報処理装置およびプログラムをFPGAまたはASICに実装するなど低消費の組み込みシステムに利用できる。
 10  情報処理装置
 11  入力部
 11a  入力テンソル
 12  処理部
 13  出力部
 13a  出力テンソル
 121  事前計算部
 122  畳み込み演算部
 123  コードブック
 123a  重みテンソル
 124  メモリ
 124a  事前計算後テンソル
 124b  バイアス項
 125  制御部
 1211  ShiftALU部
 1221,1222  マルチプレクサ
 1223  加算器

Claims (7)

  1.  データを示す入力テンソルを、メモリを有しコンピュータにより処理される処理部に入力する入力ステップと、
     前記入力テンソルの各要素について2の累乗表現の形式に変換される事前計算が行われて前記メモリに格納された後において、所定のアルゴリズムにより予め2の累乗表現の形式に変換され、かつ前記メモリに格納されている畳み込み演算に用いる可能性のある重みを示す重みテンソルと、前記メモリに格納された前記事前計算が行われた前記入力テンソルの各要素とを用いて、前記処理部に、加算演算およびシフト演算のみで畳み込み演算処理を行わせる処理ステップと、
     前記処理ステップにより前記畳み込み演算処理が行われた前記入力テンソルの各要素を、出力テンソルとして出力する出力ステップとを含む、
     情報処理方法。
  2.  前記処理ステップでは、前記処理部に、前記事前計算を行わせ、前記メモリに前記事前計算を行った前記入力テンソルの各要素を格納させる、
     請求項1に記載の情報処理方法。
  3.  前記処理ステップでは、前記処理部に、畳み込みニューラルネットワークを構成する畳み込み層の演算を行わせる、
     請求項1または2に記載の情報処理方法。
  4.  前記重みテンソルは、2の補数のビット値がB(1以上の整数)とすると2-1個の組み合わせからなり、かつ、前記メモリにコードブックとして格納されており、
     前記処理ステップでは、前記コードブックから、1ビットの表現の自由度を示す次元数とするN(1以上の整数)および前記Bとにより特定される重みテンソルの要素を取得して用いる、
     請求項1~3のいずれか1項に記載の情報処理方法。
  5.  前記Nは、2以上の整数である、
     請求項4に記載の情報処理方法。
  6.  データを示す入力テンソルを入力する入力部と、
     メモリを有しコンピュータにより処理される処理部であって、前記入力テンソルの各要素について2の累乗表現の形式に変換される事前計算が行われて前記メモリに格納された後において、所定のアルゴリズムにより予め2の累乗表現の形式に変換され、かつ前記メモリに格納されている畳み込み演算に用いる可能性のある重みを示す重みテンソルと、前記メモリに格納された前記事前計算が行われた前記入力テンソルの各要素とを用いて、加算演算およびシフト演算のみで畳み込み演算処理を行う処理部と、
     前記処理部により前記畳み込み演算処理が行われた前記入力テンソルの各要素を、出力テンソルとして出力する出力部とを含む、
     情報処理装置。
  7.  データを示す入力テンソルを、メモリを有する処理部に入力する入力ステップと、
     前記入力テンソルの各要素について2の累乗表現の形式に変換される事前計算が行われてメモリに格納された後において、所定のアルゴリズムにより予め2の累乗表現の形式に変換され、かつ前記メモリに格納されている畳み込み演算に用いる可能性のある重みを示す重みテンソルと、前記メモリに格納された前記事前計算が行われた前記入力テンソルの各要素とを用いて、前記処理部に、加算演算およびシフト演算のみで畳み込み演算処理を行わせる処理ステップと、
     前記処理ステップにより前記畳み込み演算処理が行われた前記入力テンソルの各要素を、出力テンソルとして出力する出力ステップとを、
     コンピュータに実行させるプログラム。
PCT/JP2018/015015 2017-04-20 2018-04-10 情報処理方法、情報処理装置およびプログラム WO2018193906A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/513,666 US11055379B2 (en) 2017-04-20 2019-07-16 Information processing method, information processing apparatus, and computer-readable recording medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US201762487684P 2017-04-20 2017-04-20
US62/487,684 2017-04-20

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/513,666 Continuation US11055379B2 (en) 2017-04-20 2019-07-16 Information processing method, information processing apparatus, and computer-readable recording medium

Publications (1)

Publication Number Publication Date
WO2018193906A1 true WO2018193906A1 (ja) 2018-10-25

Family

ID=63856563

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2018/015015 WO2018193906A1 (ja) 2017-04-20 2018-04-10 情報処理方法、情報処理装置およびプログラム

Country Status (3)

Country Link
US (1) US11055379B2 (ja)
JP (1) JP7029321B2 (ja)
WO (1) WO2018193906A1 (ja)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109740748A (zh) * 2019-01-08 2019-05-10 西安邮电大学 一种基于fpga的卷积神经网络加速器
CN109992785A (zh) * 2019-04-09 2019-07-09 腾讯科技(深圳)有限公司 基于机器学习的内容计算方法、装置及设备
CN110059817A (zh) * 2019-04-17 2019-07-26 中山大学 一种实现低资源消耗卷积器的方法
WO2019150067A3 (en) * 2018-02-01 2019-09-19 Brendan Ruff Low precision efficient convolutional neural network inference device that avoids multiplication without loss of accuracy
WO2021046713A1 (en) * 2019-09-10 2021-03-18 Huawei Technologies Co., Ltd. Method and apparatus for generating architecture specific convolution gradient kernels
CN112766470A (zh) * 2019-10-21 2021-05-07 地平线(上海)人工智能技术有限公司 特征数据处理方法、指令序列生成方法、装置及设备
US20210349718A1 (en) * 2020-05-08 2021-11-11 Black Sesame International Holding Limited Extensible multi-precision data pipeline for computing non-linear and arithmetic functions in artificial neural networks

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11989639B2 (en) 2018-03-02 2024-05-21 Nec Corporation Inferential device, convolutional operation method, and program
FR3087558B1 (fr) * 2018-10-19 2021-08-06 Idemia Identity & Security France Procede d'extraction de caracteristiques d'une empreinte digitale representee par une image d'entree
CN109635940B (zh) * 2019-01-28 2021-04-06 深兰人工智能芯片研究院(江苏)有限公司 一种基于卷积神经网络的图像处理方法及图像处理装置
CN112926020B (zh) * 2019-12-06 2023-07-25 腾讯科技(深圳)有限公司 反卷积处理方法、图像处理方法和相应装置
CN113128673B (zh) * 2019-12-31 2023-08-11 Oppo广东移动通信有限公司 数据处理方法、存储介质、神经网络处理器及电子设备
WO2021158378A1 (en) * 2020-02-06 2021-08-12 Interdigital Patent Holdings, Inc. Systems and methods for encoding a deep neural network
CN111831429B (zh) * 2020-06-11 2024-04-02 上海交通大学 一种基于simt编程模型的张量化并行计算方法
JP2022034897A (ja) 2020-08-19 2022-03-04 富士通株式会社 情報処理装置、機械学習方法及び機械学習プログラム
US20220114413A1 (en) * 2020-10-12 2022-04-14 Black Sesame International Holding Limited Integer-based fused convolutional layer in a convolutional neural network
CN114217686A (zh) * 2021-04-26 2022-03-22 无锡江南计算技术研究所 一种稠密卷积运算核心的低功耗方法
CN113485837B (zh) * 2021-07-21 2024-05-07 瀚博半导体(上海)有限公司 一种基于并行分支和张量切分的张量处理方法和处理系统

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06259585A (ja) * 1993-03-10 1994-09-16 Toyota Central Res & Dev Lab Inc ニューラルネットワーク装置
JPH07191950A (ja) * 1993-11-09 1995-07-28 At & T Corp 計算ネットワーク

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9805303B2 (en) * 2015-05-21 2017-10-31 Google Inc. Rotating data for neural network computations
US10311342B1 (en) * 2016-04-14 2019-06-04 XNOR.ai, Inc. System and methods for efficiently implementing a convolutional neural network incorporating binarized filter and convolution operation for performing image classification

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06259585A (ja) * 1993-03-10 1994-09-16 Toyota Central Res & Dev Lab Inc ニューラルネットワーク装置
JPH07191950A (ja) * 1993-11-09 1995-07-28 At & T Corp 計算ネットワーク

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019150067A3 (en) * 2018-02-01 2019-09-19 Brendan Ruff Low precision efficient convolutional neural network inference device that avoids multiplication without loss of accuracy
CN109740748A (zh) * 2019-01-08 2019-05-10 西安邮电大学 一种基于fpga的卷积神经网络加速器
CN109992785A (zh) * 2019-04-09 2019-07-09 腾讯科技(深圳)有限公司 基于机器学习的内容计算方法、装置及设备
CN109992785B (zh) * 2019-04-09 2023-07-25 腾讯科技(深圳)有限公司 基于机器学习的内容计算方法、装置及设备
CN110059817A (zh) * 2019-04-17 2019-07-26 中山大学 一种实现低资源消耗卷积器的方法
WO2021046713A1 (en) * 2019-09-10 2021-03-18 Huawei Technologies Co., Ltd. Method and apparatus for generating architecture specific convolution gradient kernels
CN112766470A (zh) * 2019-10-21 2021-05-07 地平线(上海)人工智能技术有限公司 特征数据处理方法、指令序列生成方法、装置及设备
CN112766470B (zh) * 2019-10-21 2024-05-07 地平线(上海)人工智能技术有限公司 特征数据处理方法、指令序列生成方法、装置及设备
US20210349718A1 (en) * 2020-05-08 2021-11-11 Black Sesame International Holding Limited Extensible multi-precision data pipeline for computing non-linear and arithmetic functions in artificial neural networks
US11687336B2 (en) * 2020-05-08 2023-06-27 Black Sesame Technologies Inc. Extensible multi-precision data pipeline for computing non-linear and arithmetic functions in artificial neural networks

Also Published As

Publication number Publication date
US20190340214A1 (en) 2019-11-07
US11055379B2 (en) 2021-07-06
JP2018181313A (ja) 2018-11-15
JP7029321B2 (ja) 2022-03-03

Similar Documents

Publication Publication Date Title
WO2018193906A1 (ja) 情報処理方法、情報処理装置およびプログラム
JP7349835B2 (ja) ニューラルネットワークにおいてパラメータを処理する方法及び装置
Valueva et al. Application of the residue number system to reduce hardware costs of the convolutional neural network implementation
CN107340993B (zh) 运算装置和方法
JP6998968B2 (ja) ディープニューラルネットワークの実行方法、実行装置、学習方法、学習装置及びプログラム
WO2019168084A1 (ja) 推論装置、畳み込み演算実行方法及びプログラム
KR102153791B1 (ko) 인공 신경망을 위한 디지털 뉴런, 인공 뉴런 및 이를 포함하는 추론 엔진
JP2019200553A (ja) ニューラルネットワーク回路装置、ニューラルネットワーク、ニューラルネットワーク処理方法およびニューラルネットワークの実行プログラム
CN111095301A (zh) 神经网络电路装置、神经网络、神经网络处理方法和神经网络的执行程序
Chervyakov et al. Residue number system-based solution for reducing the hardware cost of a convolutional neural network
WO2021044244A1 (en) Machine learning hardware having reduced precision parameter components for efficient parameter update
US20210295134A1 (en) Artificial neural network activation function
JP2020507844A (ja) 入力オペランド値を処理するための装置及び方法
CN107402905B (zh) 基于神经网络的计算方法及装置
Immareddy et al. A survey paper on design and implementation of multipliers for digital system applications
CN111126557B (zh) 神经网络量化、应用方法、装置和计算设备
CN111033462A (zh) 在基于处理器的系统中使用矩阵处理器提供高效浮点运算
CN111047007B (zh) 一种针对量化后的lstm的激活函数计算单元
US11243743B2 (en) Optimization of neural networks using hardware calculation efficiency and adjustment factors
Basha et al. Design and Implementation of Radix-4 Based High Speed Multiplier for ALU's Using Minimal Partial Products
CN117063183A (zh) 激活函数的高效压缩
WO2019127480A1 (zh) 用于处理数值数据的方法、设备和计算机可读存储介质
Nezhad et al. High-speed multiplier design using multi-operand multipliers
Barik et al. An efficient redundant binary adder with revised computational rules
Nishok et al. Design and performance estimation of efficient approximate carry select adder

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18788536

Country of ref document: EP

Kind code of ref document: A1