(19)
(11)EP 3 686 733 A1

(12)EUROPEAN PATENT APPLICATION

(43)Date of publication:
29.07.2020 Bulletin 2020/31

(21)Application number: 19218090.9

(22)Date of filing:  19.12.2019
(51)Int. Cl.: 
G06F 7/02  (2006.01)
G06N 3/04  (2006.01)
(84)Designated Contracting States:
AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR
Designated Extension States:
BA ME
Designated Validation States:
KH MA MD TN

(30)Priority: 23.01.2019 JP 2019009395

(71)Applicant: FUJITSU LIMITED
Kanagawa 211-8588 (JP)

(72)Inventor:
  • NOTSU, Takahiro
    Kawasaki-shi, Kanagawa 211-8588 (JP)

(74)Representative: Haseltine Lake Kempner LLP 
Lincoln House, 5th Floor 300 High Holborn
London WC1V 7JH
London WC1V 7JH (GB)

  


(54)CALCULATION PROCESSING APPARATUS, PROGRAM, AND METHOD OF CONTROLLING THE CALCULATION PROCESSING APPARATUS


(57) A calculation processing apparatus includes: a first output unit configured to compare an input value with a boundary value and output a value equal to the input value when the input value exceeds the boundary value; and a second output unit configured to output, in a calculation of a rectified linear function by which a certain output value is output in a case where the input value is smaller than or equal to the boundary value, a multiple of a small value ε larger than 0 when the input value is smaller than or equal to the boundary value as an output value.




Description

FIELD



[0001] The embodiment discussed herein is related to a calculation processing apparatus, a computer-readable recording medium, and a method of controlling the calculation processing apparatus.

BACKGROUND



[0002] In a processor executing deep learning (DL) at high-speed, many calculating units are mounted to execute parallel calculations. Since all the calculating units execute the same calculations in parallel calculations, power of the entirety of many calculating units may suddenly vary depending on content of data and the types of instructions to be executed.

[0003] Since the processor operates under the same voltage conditions, the current increases as the power increases. Normally, a direct current (DC) to DC converter follows the increase in current. However, when the variation occurs suddenly, the DC to DC converter does not necessarily follow the increase in current. This may lead to the voltage drops.

[0004] When the voltage supplied to the processor drops, the switching speed of the semiconductor reduces, and the timing constraint is not necessarily satisfied. This may lead to malfunction of the processor.

[0005] Related technologies are disclosed in, for example, International Publication Pamphlet No. WO 2017/038104 and Japanese Laid-open Patent Publication No. 11-224246.

[0006] Although the malfunction of the processor due to the voltage drop may be addressed by setting the continuous voltage to a higher value, there is a problem in that setting a higher continuous voltage may increase the power consumption.

[0007] In an aspect, it is desired to suppress voltage drop of the processor without increasing power consumption.

SUMMARY



[0008] According to an aspect of the embodiments, a calculation processing apparatus includes: a first output unit configured to compare an input value with a boundary value and output a value equal to the input value when the input value exceeds the boundary value; and a second output unit configured to output, in a calculation of a rectified linear function by which a certain output value is output in a case where the input value is smaller than or equal to the boundary value, a multiple of a small value ε larger than 0 when the input value is smaller than or equal to the boundary value as an output value.

BRIEF DESCRIPTION OF DRAWINGS



[0009] 

FIG. 1 illustrates a modeling of neurons in a related example;

FIG. 2 illustrates a first example of power variation according to the types of instructions in the related example;

FIG. 3 illustrates a second example of the power variation according to the types of instructions in the related example;

FIG. 4 illustrates a third example of the power variation according to the types of instructions in the related example;

FIG. 5 illustrates the third example of the power variation according to the types of instructions in the related example;

FIG. 6 illustrates first rectified linear unit (ReLU) operation processing in an example of an embodiment;

FIG. 7 illustrates first forward propagation processing and first backward propagation processing of an ReLU in the example of the embodiment;

FIG. 8 illustrates second ReLU operation processing in the example of the embodiment;

FIG. 9 illustrates second forward propagation processing and second backward propagation processing of the ReLU in the example of the embodiment;

FIG. 10 illustrates third ReLU operation processing in the example of the embodiment;

FIG. 11 illustrates third forward propagation processing and third backward propagation processing of the ReLU in the example of the embodiment;

FIG. 12 is a block diagram schematically illustrating an example of the configuration of a multiplying unit in the example of the embodiment;

FIG. 13 is a block diagram schematically illustrating an example of the configuration of a calculation processing system in the example of the embodiment;

FIG. 14 is a block diagram illustrating deep learning (DL) processing in the calculation processing system illustrated in FIG. 13;

FIG. 15 is a flowchart illustrating the DL processing in a host machine illustrated in FIG. 13;

FIG. 16 is a block diagram schematically illustrating an example of a hardware configuration in the host machine illustrated in FIG. 13;

FIG. 17 is a block diagram schematically illustrating an example of a hardware configuration of the DL execution hardware illustrated in FIG. 13;

FIG. 18 is a block diagram schematically illustrating an example of a functional configuration of the host machine illustrated in FIG. 13;

FIG. 19 is a flowchart illustrating processing for generating programs in the host machine illustrated in FIG. 13;

FIG. 20 is a flowchart illustrating the details of processing for generating forward propagation and backward propagation programs in the host machine illustrated in FIG. 13;

FIG. 21 is a flowchart illustrating the details of the forward propagation processing of the second ReLU operation in the host machine illustrated in FIG. 13;

FIG. 22 is a flowchart illustrating the details of the backward propagation processing of the second ReLU operation in the host machine illustrated in FIG. 13;

FIG. 23 is a flowchart illustrating the details of the forward propagation processing of the third ReLU operation in the host machine illustrated in FIG. 13; and

FIG. 24 is a flowchart illustrating the details of the backward propagation processing of the third ReLU operation in the host machine illustrated in FIG. 13.


DESCRIPTION OF EMBODIMENTS



[0010] Hereinafter, an embodiment will be described with reference to the drawings. However, the embodiment described hereinafter is merely exemplary and is not intended to exclude various modifications and technical applications that are not explicitly described in the embodiment. For example, the present embodiment is able to be carried out with various modifications without departing from the gist of the present embodiment.

[0011] The drawings are not intended to illustrate that only the drawn elements are provided, but the embodiments may include other functions and so on.

[0012] Hereinafter, in the drawings, like portions are denoted by the same reference signs and redundant description thereof is omitted.

[A] Related Example



[0013] FIG. 1 illustrates a modeling of neurons in a related example.

[0014] It has been found that a deep neural network in which a neural network is expanded to multiple layers is applicable to problems that have been difficult to solve in existing manners. It is expected that the deep neural network is applied to various fields.

[0015] As illustrated in FIG. 1, neuronal cells (for example, "neurons") of the brain include cell bodies 61, synapses 62, dendrites 63, and axons 64. The neural network is generated by mechanically modeling the neural cells.

[0016] Although calculations in deep neural network learning processing are simple, such as inner product calculations, but executed in a large volume in some cases. Accordingly, in a processor that executes these calculations at high speed, many calculating units are operated in parallel so as to improve performance.

[0017] In the calculating units that execute the learning processing of the deep neural network, power in all the calculating units may steeply vary depending on the types of instructions to be executed or the content of data.

[0018] For example, an integer add instruction (for example, an "add arithmetic instruction") consumes a smaller amount of the power than that consumed by a floating-point multiply-add instruction (for example, "fused multiply-add (FMA) arithmetic instruction"). The reason for this is that resources used in the processor are different depending on the types of instructions. Although only a single adding unit is used for the integer add instruction, a plurality of adding units for executing multiplication or an adding unit having a larger bit width are used for the floating-point multiply-add instruction.

[0019] Since what instructions are executed is known in advance, the power variation in power depending on the types of instructions is able to be addressed. For example, when the integer add instruction is executed in a subset of sections of a program in which the floating-point multiply-add instruction is dominant, the integer add instruction and the floating-point multiply-add instruction are alternately executed. As a result, the power variation is able to be generally suppressed.

[0020] FIG. 2 illustrates a first example of the power variation according to the types of instructions in the related example.

[0021] In an example illustrated in FIG. 2, after ten (10) FMA arithmetic instructions have been executed, ten (10) ADD arithmetic instructions are executed. In such an instruction sequence, when the FMA arithmetic instruction is switched to the ADD arithmetic instruction, a reduction in power occurs.

[0022] FIG. 3 illustrates a second example of the power variation according to the types of instructions in the related example.

[0023] In an example illustrated in FIG. 3, after five (5) FMA arithmetic instructions have been executed, the ADD arithmetic instruction and the FMA arithmetic instruction are alternately executed. When the FMA arithmetic instruction and the ADD arithmetic instruction are executed in an interlaced manner as described above, a sudden reduction of the power is able to be suppressed.

[0024] Even when the same floating-point multiply-add instruction is executed, continuous input of 0 as content of data reduces the power. The input data is, in many cases, changed to 0 or 1 in a certain ratio. However, when the same value is continuously input, a state of a logic element is fixed, and the power reduces. For example, with a 0 value, in multiplication, the same result, 0, is returned for any value input to the other operand. Thus, there is a strong tendency that the number of times of switching is reduced.

[0025] Since it is unclear in advance that what kind of data is input, it is not easy to address the power variation in accordance with the content of the data.

[0026] FIGs. 4 and 5 illustrate a third example of the power variation according to the types of instructions in the related example.

[0027] As indicated by a reference sign A1 in FIG. 4, 0s are stored as an instruction sequence from 40th ("% fr40" in the illustrated example) to 45th ("%fr45" in the illustrated example) flag registers. As illustrated in FIG. 5, when a calculation using 0 is executed, the power reduces in this period.

[0028] As described above, the power variation of the processor is caused in accordance with the types of instructions or in accordance with the data read by the instructions. For example, the power consumption of the integer add instruction is low and the power consumption of the floating-point multiply-add instruction is high. Furthermore, the power consumption of the same floating-point multiply-add instruction reduces when 0 is input.

[0029] Since the instructions to be executed are known when a program is written, the power variation caused by the difference in the types of instructions is avoidable by combination of the instructions.

[0030] In contrast, since the content of operands is unknown when a program is written, the power variation caused in accordance with the data for the instructions is not easily addressed. For example, when 0 is continuously input, most of the values in the calculating unit are fixed to 0, thereby the power suddenly reduces.

[B] An Example of the Embodiment


[B-1] An Example of A System Configuration



[0031] In deep learning (DL), most of processing is dedicated to executing the multiply-add instruction and obtaining inner products. In so doing, when 0 continuously appears in the input, the input at the time of execution of the multiply-add instruction suddenly reduces. This may cause malfunction.

[0032] FIG. 6 illustrates processing for a first rectified linear unit (ReLU) operation.

[0033] Processing called an ReLU operation explicitly generates 0 in learning processing of the DL. The ReLU operation receives a single input and generates a single output. As illustrated in FIG. 6 and represented by Expression 1 below, when a given input value is positive, the input value is output as it is. When the input value is 0 or negative, 0 is output.



[0034] FIG. 7 illustrates first forward propagation processing and first backward propagation processing of the ReLU in an example of the embodiment.

[0035] As illustrated in FIG. 7, an input x (see reference sign B1) of forward propagation is converted into an output z (see reference sign B3) by modified ReLU forward propagation processing (see reference sign B2). The relationship between the input x and the output z is expressed by Expression 2 below.



[0036] The input x of the forward propagation is stored in a temporary storage region until the backward propagation (see reference sign B4) is performed.

[0037] An input dz (see reference sign B5) of the backward propagation is converted into an output dx (see reference sign B7) by modified ReLU backward propagation processing (see reference sign B6) that refers to the input x in the temporary storage region. Here, the relationship between the input dz and the output dx is expressed by Expression 3 below.



[0038] However, with the ReLU (x) illustrated in Expression 1, when the input x is a negative value, the output is normally 0. Thus, the likelihood of the output being 0 is high.

[0039] Accordingly, for the example of the present embodiment, when the input x is a negative value, a negative slope having an inclination of a small positive number (ε) may be set. When the input x is a negative value, any one of a small negative number (-ε), a 0 value (0), and a small positive number (+ε) may be randomly output.

[0040] A small positive number (ε) may have a small absolute value, and a bit of 1 may be set to a certain extent (for example, in half or more of digits). For example, two of "0x00FFFFFF" and "0x00CCCCCC" may be used as candidates. "0x00FFFFFF" is a number which is close to a value FLT_MIN larger than 0 and the mantissa of which is entirely 1. "0x00CCCCCC" is a number which is close to the value FLT_MIN larger than 0 and in which 0 and 1 are alternately appear in the mantissa.

[0041] With either of the method in which a negative slope is set or the method in which a value is randomly output, a non-zero value may be used instead of 0. Thus, operation results may be different from the example illustrated in FIG. 6. However, in DL processing, as long as the forward propagation processing (for example, "forward processing") and the backward propagation processing (for example, "backward processing") are consistent with each other, learning is possible even when processing different from that of the original calculation is executed.

[0042] FIG. 8 illustrates a second ReLU operation processing in the example of the embodiment.

[0043] As illustrated in FIG. 8, the negative slope indicates an inclination in a negative region. When the negative slope is 0, the processing is similar to that of the ReLU processing illustrated in FIG. 6.

[0044] In the example illustrated in FIG. 8, the negative value is set to ε for the ReLU processing illustrated in FIG. 6, thereby generation of continuous 0s is suppressed.

[0045] The ReLU processing illustrated in FIG. 8 may be referred to as leaky ReLU processing.

[0046] As represented by Expressions 4 and 5 below, the input value is output as it is in a region where a value of the input x is positive, and a value obtained by multiplying the input value by ε is output in a region where the input value x is negative.





[0047] FIG. 9 illustrates second forward propagation processing and second backward propagation processing of the ReLU in the example of the embodiment.

[0048] The forward propagation processing and the backward propagation processing illustrated in FIG. 9 are similar to the forward propagation processing and the backward propagation processing illustrated in FIG. 7.

[0049] However, modified ReLU forward propagation processing illustrated in FIG. 9 (see reference sign B21) is executed with Expression 6 below.



[0050] Modified ReLU backward propagation processing illustrated in FIG. 9 (see reference sign B61) is executed with Expression 7 below.



[0051] FIG. 10 illustrates third ReLU operation processing in the example of the embodiment.

[0052] Although the ReLU processing illustrated in FIG. 10 is similar to the ReLU processing illustrated in FIG. 6 in the positive region, the output value is, in the negative region, randomly selected from among three values of -ε, 0, and +ε (see shaded part in FIG. 10).

[0053] For example, the output value is represented by Expressions 8 and 9 below.





[0054] FIG. 11 illustrates third forward propagation processing and third backward propagation processing of the ReLU in the example of the embodiment.

[0055] The forward propagation processing and the backward propagation processing illustrated in FIG. 11 are similar to the forward propagation processing and the backward propagation processing illustrated in FIG. 7.

[0056] However, modified ReLU forward propagation processing illustrated in FIG. 11 (see reference sign B22) is performed with the following Expression 10.



[0057] Modified ReLU backward propagation processing illustrated in FIG. 11 (see reference sign B62) is executed with Expression 11 below.



[0058] FIG. 12 is a block diagram schematically illustrating an example of the configuration of a multiplying unit 1000 in the example of the embodiment.

[0059] Although the operation result of the ReLU(1) is able to be one of various values, the operation result of the ReLU(2) is one of only three values, -ε, 0 and +ε. For this reason, in the example of the embodiment, input to the multiplying unit 1000 is also considered.

[0060] The multiplying unit 1000 of a digital computer obtains partial products of the multiplicand and each of bits of the multiplier in a manner of calculation by writing and obtains the sum of the partial products.

[0061] The multiplying unit 1000 generates a single output 105 for two inputs of a multiplier 101 and a multiplicand 102. The multiplying unit 1000 includes a plurality of selectors 103 and an adding unit 104. The selectors 103 may perform selection between a 0-bit string or a shift-side input and may be implemented by an AND gate.

[0062] Regarding the content of the multiplication, the bit string of the multiplicand 102 is shifted by single-bit and input to the adding unit 104. In so doing, whether a bit string of 0 is input or a bit string of the multiplicand 102 is input is determined depending on the content of each bit of the multiplier 101. Then, the sum of the input bit strings is obtained, thereby a product is obtained.

[0063] The small positive number and the small negative number may be input to the multiplicand 102 side of the multiplying unit 1000. The reason for this is that a large amount of 0s are generated in the multiplying unit 1000 and power is reduced more than required when the small positive number and the small negative number are specified values (for example, in the form of continuous bits of 1) and the multiplying unit 1000 has a specific internal configuration (for example, the multiplying unit 1000 using a Booth algorithm).

[0064] FIG. 13 is a block diagram schematically illustrating an example of the configuration of a calculation processing system 100 in the example of the embodiment.

[0065] The calculation processing system 100 includes a host machine 1 and DL execution hardware 2. The host machine 1 and the DL execution hardware 2 are operated by a user 3.

[0066] The user 3 couples to the host machine 1, operates the DL execution hardware 2, and causes deep learning to be executed in the DL execution hardware 2.

[0067] The host machine 1, which is an example of a calculation processing unit, generates a program to be executed by the DL execution hardware 2 in accordance with an instruction from the user 3 and transmits the generated program to the DL execution hardware 2.

[0068] The DL execution hardware 2 executes the program transmitted from the host machine 1 and generates data of an execution result.

[0069] FIG. 14 is block diagram illustrating DL processing in the calculation processing system 100 illustrated in FIG. 13.

[0070] The user 3 inputs DL design information to a program 110 in the host machine 1. The host machine 1 inputs the program 110 to which the DL design information has been input to the DL execution hardware 2 as a DL execution program. The user 3 inputs learning data to the DL execution hardware 2. The DL execution hardware 2 presents the execution result to the user 3 based on the DL execution program and the learning data.

[0071] FIG. 15 is a flowchart illustrating the DL processing in the host machine 1 illustrated in FIG. 13.

[0072] As indicated by a reference sign C1, a user interface with the user 3 is implemented in an application. The application accepts input of the DL design information from the user 3 and displays an input result. The function of DL execution in the application is implemented by using the function of a library in a lower layer.

[0073] As indicated by reference sign C2, the implementation of the application in the host machine 1 is assisted in the library. The function relating to the DL execution is provided at the library.

[0074] As indicated by reference sign C3, a driver of a user mode is usually called from the library. The driver of the user mode may be directly read from the application. The driver of the user mode functions as a compiler to create program code for the DL execution hardware 2.

[0075] As indicated by reference sign C4, a driver of a kernel mode is called from the driver of the user mode and communicates with the DL execution hardware 2. For direct access to hardware, this driver is implemented as the driver of the kernel mode.

[0076] FIG. 16 is a block diagram schematically illustrating an example of a hardware configuration of the host machine 1 illustrated in FIG. 13.

[0077] The host machine 1 includes a processor 11, a random-access memory (RAM) 12, a hard disk drive (HDD) 13, an internal bus 14, a high-speed input/output interface 15, and a low-speed input/output interface 16.

[0078] The RAM 12 stores data and programs to be executed by the processor 11. The type of the RAM 12 may be, for example, a double data rate 4 synchronous dynamic random-access memory (DDR4 SDRAM).

[0079] The HDD 13 stores data and programs to be executed by the processor 11. The HDD 13 may be a solid state drive (SSD), a storage class memory (SCM), or the like.

[0080] The internal bus 14 couples the processor 11 to peripheral components slower than the processor 11 and relays communication.

[0081] The high-speed input/output interface 15 couples the processor 11 to the DL execution hardware 2 disposed externally to the host machine 1. The high-speed input/output interface 15 may be, for example, a peripheral component interconnect express (PCI Express).

[0082] The low-speed input/output interface 16 realizes coupling to the host machine 1 by the user 3. The low-speed input/output interface 16 is coupled to, for example, a keyboard and a mouse. The low-speed input/output interface 16 may be coupled to the user 3 through a network using Ethernet (registered trademark).

[0083] The processor 11 is a processing unit that exemplarily performs various types of control and various operations. The processor 11 realizes various functions when an operating system (OS) and programs stored in the RAM 12 are executed. For example, as will be described later with reference to FIG. 18, the processor 11 may function as zero generation processing modification unit 111 and a program generation unit 112.

[0084] The programs to realize the functions as the zero generation processing modification unit 111 and the program generation unit 112 may be provided in a form in which the programs are recorded in a computer readable recording medium such as, for example, a flexible disk, a compact disk (CD, such as a CD read only memory (CD-ROM), a CD readable (CD-R), or a CD rewritable (CD-RW)), a digital versatile disk (DVD, such as a digital DVD read only memory (DVD-ROM), a DVD random access memory (DVD-RAM), a DVD recordable (DVD-R, DVD+R), a DVD rewritable (DVD-RW, DVD+RW), or a high-definition DVD (HD DVD)), a Blu-ray disk, a magnetic disk, an optical disk, or a magneto-optical disk. The computer (the processor 11 according to the present embodiment) may read the programs from the above-described recording medium through a reading device (not illustrated) and transfer and store the read programs to an internal recording device or an external recording device. The programs may be recorded in a storage device (recording medium) such as, for example, a magnetic disk, an optical disk, or a magneto-optical disk and provided from the storage device to the computer via a communication path.

[0085] When the functions of the zero generation processing modification unit 111 and the program generation unit 112 are realized, the programs stored in the internal storage device (the RAM 12 according to the present embodiment) may be executed by the computer (the processor 11 according to the present embodiment). The computer may read and execute the programs recorded in the recording medium.

[0086] The processor 11 controls operation of the entire host machine 1. The processor 11 may be a multiprocessor. The processor 11 may be any one of, for example, a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a programmable logic device (PLD), or a field-programmable gate array (FPGA). The processor 11 may be a combination of two or more elements of a CPU, an MPU, a DSP, an ASIC, a PLD, and an FPGA.

[0087] FIG. 17 is a block diagram schematically illustrating an example of a hardware configuration of the DL execution hardware 2 illustrated in FIG. 13.

[0088] The DL execution hardware 2 includes a DL execution processor 21, a controller 22, a memory access controller 23, an internal RAM 24, and a high-speed input/output interface 25.

[0089] The controller 22 drives the DL execution processor 21 or transfers the programs and data to the internal RAM 24 in accordance with a command from the host machine 1.

[0090] The memory access controller 23 selects a signal from the DL execution processor 21 and the controller 22 and performs memory access in accordance with a program for memory access.

[0091] The internal RAM 24 stores the programs executed by the DL execution processor 21, data to be processed, and data of results of the processing. The internal RAM 24 may be a DDR4 SDRAM, a faster graphics double data rate 5 SDRAM (GDDR5 SDRAM), a wider band high bandwidth memory 2 (HBM2), or the like.

[0092] The high-speed input/output interface 25 couples the DL execution processor 21 to the host machine 1. The protocol of the high-speed input/output interface 25 may be, for example, PCI Express.

[0093] The DL execution processor 21 executes deep learning processing based on the programs and data supplied from the host machine 1.

[0094] The DL execution processor 21 is a processing unit that exemplarily performs various types of control and various operations. The DL execution processor 21 realizes various functions when an OS and programs stored in the internal RAM 24 are executed.

[0095] The programs to realize the various functions may be provided in a form in which the programs are recorded in a computer readable recording medium such as, for example, a flexible disk, a CD (such as a CD-ROM, a CD-R, or a CD-RW), a DVD (such as a DVD-ROM, a DVD-RAM, a DVD-R or DVD+R, a DVD-RW or DVD+RW, or an HD DVD), a Blu-ray disk, a magnetic disk, an optical disk, or a magneto-optical disk. The computer (the processor 11 according to the present embodiment) may read the programs from the above-described recording medium through a reading device (not illustrated) and transfer and store the read programs to an internal recording device or an external recording device. The programs may be recorded in a storage device (recording medium) such as, for example, a magnetic disk, an optical disk, or a magneto-optical disk and provided from the storage device to the computer via a communication path.

[0096] When the functions of the DL execution processor 21 are realized, the programs stored in the internal storage device (the internal RAM 24 according to the present embodiment) may be executed by the computer (the DL execution processor 21 according to the present embodiment). The computer may read and execute the programs recorded in the recording medium.

[0097] The DL execution processor 21 controls operation of the entire DL execution hardware 2. The DL execution processor 21 may be a multiprocessor. The DL execution processor 21 may be any one of, for example, a CPU, an MPU, a DSP, an ASIC, a PLD, and an FPGA. The DL execution processor 21 may be a combination of two or more elements of a CPU, an MPU, a DSP, an ASIC, a PLD, and an FPGA.

[0098] FIG. 18 is a block diagram schematically illustrating an example of a functional configuration of the host machine 1 illustrated in FIG. 13.

[0099] As illustrated in FIG. 18, the processor 11 of the host machine 1 functions as the zero generation processing modification unit 111 and the program generation unit 112.

[0100] The program generation unit 112 generates a neural network execution program 108 to be executed in the DL execution hardware 2 based on input of neural network description data 106 and a program generation parameter 107.

[0101] The zero generation processing modification unit 111 modifies content of the neural network description data 106, thereby modifying content of the ReLU operation. As illustrated in FIG. 18, the zero generation processing modification unit 111 functions as a first output unit 1111 and a second output unit 1112.

[0102] As illustrated in FIGs. 8 and 10, the first output unit 1111 compares an input value with a boundary value (for example, 0) and outputs a value equal to the input value when the input value exceeds the boundary value.

[0103] As illustrated in FIGs. 8 and 10, in a calculation of a rectified linear function by which a certain output value is output when an input value is smaller than or equal to a boundary value (for example, "ReLU operation"), the second output unit 1112 outputs a multiple of the small value ε larger than 0 when the input value is smaller than or equal to the boundary value.

[0104] As illustrated in, for example, FIG. 8, the second output unit 1112 may output a product of an input value and the small value ε as an output value. As has been described with reference to, for example, FIG. 12, the second output unit 1112 may output an output value by inputting to the multiplying unit 1000 the input value as a multiplier and the small value ε as a multiplicand.

[0105] As illustrated in, for example, FIG. 10, regarding the small value ε, the second output unit 1112 may output -ε, 0, or +ε as an output value.

[B-2] Example of the Operation



[0106] The processing for generating programs in the host machine 1 illustrated in FIG. 13 is described with reference to a flowchart illustrated in FIG. 19.

[0107] The program generation unit 112 reorganizes the dependency relationships between layers in the network (step S1). The program generation unit 112 rearranges the layers in the order of the forward propagation and manages the layers as Layer [0], Layer [1], ..., Layer [L - 1].

[0108] The program generation unit 112 generates forward propagation and backward propagation programs for each of Layer [0], Layer [1], ..., Layer [L - 1] (step S2). The details of the processing in step S2 will be described later with reference to FIG. 20.

[0109] The program generation unit 112 generates code for calling the forward propagation and the backward propagation of Layer [0], Layer [1], ..., Layer [L - 1] (Step S3). Then, the processing for generating the programs ends.

[0110] Next, the details of the processing for generating the programs for the forward propagation and the backward propagation in the host machine 1 illustrated in FIG. 13 (step S2 illustrated in FIG. 19) are described with reference to a flowchart illustrated in FIG. 20.

[0111] The program generation unit 112 determines whether the type of the programs to be generated is ReLU (step S11).

[0112] When the type of the program to be generated is the ReLU (see a "Yes" route in step S11), the program generation unit 112 generates programs for executing the processing for the modified ReLU in accordance with the output from the zero generation processing modification unit 111 (step S12). Then, the processing for generating the forward propagation and backward propagation programs ends. The output from the zero generation processing modification unit 111 may be realized by processing which will be described later with reference to any one of flowcharts illustrated in FIGs. 21 to 24.

[0113] In contrast, when the type of the program to be generated is not the ReLU (see a "No" route in step S11), the program generation unit 112 generates the program in normal processing (step S13). Then, the processing of generating the forward propagation and backward propagation programs ends.

[0114] Next, the details of the forward propagation processing of the second ReLU operation (step S12 illustrated in FIG. 20) in the host machine 1 illustrated in FIG. 13 are described with reference to the flowchart illustrated in FIG. 21.

[0115] The zero generation processing modification unit 111 stores the input value x to the temporary storage region (step S21).

[0116] The zero generation processing modification unit 111 determines whether the input value x is a positive number (step S22).

[0117] When the input value x is a positive number (see a "Yes" route in step S22), the first output unit 1111 of the zero generation processing modification unit 111 sets the input value x as the output value z (step S23). The processing then proceeds to step S25.

[0118] In contrast, when the input value x is not a positive number (see a "No" route in step S22), the second output unit 1112 of the zero generation processing modification unit 111 sets an input value xε as the output value z (step S24).

[0119] The zero generation processing modification unit 111 outputs the output value z (step S25). Then, the forward propagation processing of the second ReLU operation ends.

[0120] Next, the details of the backward propagation processing of the second ReLU operation (step S12 illustrated in FIG. 20) in the host machine 1 illustrated in FIG. 13 are described with reference to the flowchart illustrated in FIG. 22.

[0121] The zero generation processing modification unit 111 reads the input value x for the forward propagation from the temporary storage region (step S31).

[0122] The zero generation processing modification unit 111 determines whether the input value x is a positive number (step S32).

[0123] When the input value x is a positive number (see a "Yes" route in step S32), the first output unit 1111 of the zero generation processing modification unit 111 sets 1 as a differential coefficient D (step S33). The processing then proceeds to step S35.

[0124] In contrast, when the input value x is not a positive number (see a "No" route in step S32), the second output unit 1112 of the zero generation processing modification unit 111 sets ε as the differential coefficient D (step S34).

[0125] The zero generation processing modification unit 111 outputs a product of the differential coefficient D and an input value dz (step S35). Then, the backward propagation processing of the second ReLU operation ends.

[0126] Next, the details of the forward propagation processing of the third ReLU operation (step S12 illustrated in FIG. 20) in the host machine 1 illustrated in FIG. 13 are described with reference to the flowchart illustrated in FIG. 23.

[0127] The zero generation processing modification unit 111 stores the input value x to the temporary storage region (step S41).

[0128] The zero generation processing modification unit 111 determines whether the input value x is a positive number (step S42).

[0129] When the input value x is a positive number (see a "Yes" route in step S42), the first output unit 1111 of the zero generation processing modification unit 111 sets the input value x as the output value z (step S43). The processing then proceeds to step S50.

[0130] When the input value x is not a positive number (see a "No" route in step S42), the second output unit 1112 of the zero generation processing modification unit 111 generates a random numbers r1 in a range of 0, 1, 2, and 3 (step S44).

[0131] The second output unit 1112 determines whether the random number r1 is 0 (step S45).

[0132] When the random number r1 is 0 (see a "Yes" route in step S45), the second output unit 1112 sets the ε as the output value z (step S46). The processing then proceeds to step S50.

[0133] In contrast, when the random number r1 is not 0 (see a "No" route in step S45), the second output unit 1112 determines whether the random number r1 is 1 (step S47).

[0134] When the random number r1 is 1 (see a "Yes" route in step S47), the second output unit 1112 sets the -ε as the output value z (step S48). The processing then proceeds to step S50.

[0135] In contrast, when the random number r1 is not 1 (see a "No" route in step S47), the second output unit 1112 sets 0 as the output value z (step S49).

[0136] The zero generation processing modification unit 111 outputs the output value z (step S50). Then, the forward propagation processing of the third ReLU operation ends.

[0137] Next, the details of the backward propagation processing of the third ReLU operation (step S12 illustrated in FIG. 20) in the host machine 1 illustrated in FIG. 13 are described with reference to the flowchart illustrated in FIG. 24.

[0138] The zero generation processing modification unit 111 reads the input value x for the forward propagation from the temporary storage region (step S51).

[0139] The zero generation processing modification unit 111 determines whether the input value x is a positive number (step S52).

[0140] When the input value x is a positive number (see a "Yes" route in step S52), the first output unit 1111 of the zero generation processing modification unit 111 sets 1 as the differential coefficient D (step S53). The processing then proceeds to step S60.

[0141] When the input value x is not a positive number (see a "No" route in step S52), the second output unit 1112 of the zero generation processing modification unit 111 generates a random numbers r2 in a range of 0, 1, 2, and 3 (step S54).

[0142] The second output unit 1112 determines whether the random number r2 is 0 (step S55).

[0143] When the random number r2 is 0 (see a "Yes" route in step S55), the second output unit 1112 sets the ε as the differential coefficient D (step S56). The processing then proceeds to step S60.

[0144] In contrast, when the random number r2 is not 0 (see a No route in step S55), the second output unit 1112 determines whether the random number r2 is 1 (step S57).

[0145] When the random number r2 is 1 (see a "Yes" route in step S57), the second output unit 1112 sets the -ε as the differential coefficient D (step S58). The processing then proceeds to step S60.

[0146] In contrast, when the random number r2 is not 1 (see a "No" route in step S57), the second output unit 1112 sets 0 as the differential coefficient D (step S59).

[0147] The zero generation processing modification unit 111 outputs a product of the differential coefficient D and an input value dz (step S60). Then, the backward propagation processing of the third ReLU operation ends.

[B-3] Effects



[0148] With the host machine 1 in the example of the above-described embodiment, for example, the following effects may be obtained.

[0149] The first output unit 1111 compares the input value with the boundary value and outputs a value equal to the input value when the input value exceeds the boundary value. In the ReLU operation by which a certain output value is output when the input value is smaller than or equal to the boundary value, the second output unit 1112 outputs a multiple of the small value ε larger than 0 when the input value is smaller than or equal to the boundary value.

[0150] Thus, the voltage drop of the processor 11 may be suppressed without increasing the power consumption. For example, without changing the quality of learning, the generation of the 0 value may be suppressed and power variation may be suppressed. Although the power is increased in the ReLU operation and the subsequent calculation, the reference voltage is reduced in other calculations. Thus, the DL may be executed with low power. For example, power variation may be suppressed and setting of a high voltage is not necessarily required.

[0151] The second output unit 1112 outputs the product of the input value and the small value ε as the output value.

[0152] Thus, the likelihood of outputting of a 0 value may be reduced.

[0153] The second output unit 1112 outputs the output value by inputting to the multiplying unit 1000 the input value as a multiplier and the small value ε as a multiplicand.

[0154] Thus, the power reduction in the multiplying unit 1000 may be suppressed.

[0155] Regarding the small value ε, the second output unit 1112 outputs-ε, 0, or +ε as an output value.

[0156] Thus, the output value of the ReLU operation is able to be limited, thereby the DL execution program may be efficiently generated.

[C] Others



[0157] The disclosed technology is not limited to the aforementioned embodiment but may be carried out with various modifications without departing from the spirit and scope of the present embodiment. Each configuration and each process of the present embodiment may be selected as desired or may be combined as appropriate.


Claims

1. A calculation processing apparatus comprising:

a first output unit configured to compare an input value with a boundary value and output a value equal to the input value when the input value exceeds the boundary value; and

a second output unit configured to output, in a calculation of a rectified linear function by which a certain output value is output in a case where the input value is smaller than or equal to the boundary value, a multiple of a small value ε larger than 0 when the input value is smaller than or equal to the boundary value as an output value.


 
2. The calculation processing apparatus according to claim 1, wherein the second output unit outputs as the output value a product of the input value and the small value ε.
 
3. The calculation processing unit according to claim 1 or 2, wherein the second output unit outputs the output value by inputting to a multiplying unit the input value as a multiplier and the small value ε as a multiplicand.
 
4. The calculation processing unit according to claim 1, wherein,
the second output unit outputs -ε, 0, or +ε as the output value regarding the small value ε.
 
5. A program for causing a computer to execute a process, the process comprising:

comparing an input value with a boundary value and outputting a value equal to the input value when the input value exceeds the boundary value; and

outputting, in a calculation of a rectified linear function by which a certain output value is output in a case where the input value is smaller than or equal to the boundary value, a multiple of a small value ε larger than 0 when the input value is smaller than or equal to the boundary value as an output value.


 
6. The program according to claim 5, wherein
a product of the input value and the small value ε is output as the output value.
 
7. The program according to claim 5 or 6, wherein
the output value is output by inputting to a multiplying unit the input value as a multiplier and the small value ε as a multiplicand.
 
8. The program according to claim 5, wherein,
as the output value, -ε, 0, or +ε is output regarding the small value ε.
 
9. A method of controlling a calculation processing unit, the method comprising:

comparing an input value with a boundary value and outputting a value equal to the input value when the input value exceeds the boundary value; and

outputting, in a calculation of a rectified linear function by which a certain output value is output in a case where the input value is smaller than or equal to the boundary value, a multiple of a small value ε larger than 0 when the input value is smaller than or equal to the boundary value as an output value.


 
10. The method according to claim 9, wherein
a product of the input value and the small value ε is output as the output value.
 
11. The method according to claim 9 or 10, wherein
the output value is output by inputting to a multiplying unit the input value as a multiplier and the small value ε as a multiplicand.
 
12. The method according to claim 9, wherein,
as the output value, -ε, 0, or +ε is output regarding the small value ε.
 




Drawing
















































































REFERENCES CITED IN THE DESCRIPTION



This list of references cited by the applicant is for the reader's convenience only. It does not form part of the European patent document. Even though great care has been taken in compiling the references, errors or omissions cannot be excluded and the EPO disclaims all liability in this regard.

Patent documents cited in the description