WO2021140643A1 - ニューラルネットワークシステム、ニューラルネットワークの学習方法及びニューラルネットワークの学習プログラム - Google Patents

ニューラルネットワークシステム、ニューラルネットワークの学習方法及びニューラルネットワークの学習プログラム Download PDF

Info

Publication number
WO2021140643A1
WO2021140643A1 PCT/JP2020/000644 JP2020000644W WO2021140643A1 WO 2021140643 A1 WO2021140643 A1 WO 2021140643A1 JP 2020000644 W JP2020000644 W JP 2020000644W WO 2021140643 A1 WO2021140643 A1 WO 2021140643A1
Authority
WO
WIPO (PCT)
Prior art keywords
update
neural network
processors
accumulation
gradient
Prior art date
Application number
PCT/JP2020/000644
Other languages
English (en)
French (fr)
Inventor
檀上匠
Original Assignee
富士通株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 富士通株式会社 filed Critical 富士通株式会社
Priority to PCT/JP2020/000644 priority Critical patent/WO2021140643A1/ja
Priority to CN202080092251.0A priority patent/CN114930350A/zh
Priority to EP20912017.9A priority patent/EP4089586A4/en
Priority to JP2021569687A priority patent/JP7453563B2/ja
Publication of WO2021140643A1 publication Critical patent/WO2021140643A1/ja
Priority to US17/832,733 priority patent/US20220300790A1/en

Links

Images

Classifications

    • 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/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • 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/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Definitions

  • the present invention relates to a neural network system, a learning method of a neural network system, and a learning program of a neural network system.
  • the neural network has, for example, a configuration in which a plurality of inputs are multiplied by their respective weights, the value obtained by adding the plurality of multiplication values is input to the activation function of neurons in the output layer, and the output of the activation function is output. ..
  • a neural network with such a simple configuration is called a simple perceptron.
  • a neural network having a plurality of layers having the above-mentioned simple configuration and inputting the output of one layer to another layer is called a multi-layer perceptron.
  • a deep neural network has a plurality of hidden layers between an input layer and an output layer, like a multi-layer perceptron.
  • the neural network is abbreviated as NN (Neural Network).
  • NN optimizes parameters such as the above-mentioned weights by learning using a large amount of training data.
  • training data is divided by the number of arithmetic nodes, and multiple arithmetic nodes perform learning operations based on their respective training data, and the gradient of the error function of the NN output for the NN parameters. Is calculated, and the update amount of the parameter obtained by multiplying the gradient by the learning rate is calculated. After that, the arithmetic nodes obtain the average of the update amounts of each node, and all the arithmetic nodes update the parameters with the average of the update values.
  • the arithmetic time required for learning can be shortened as compared with the case where a single arithmetic node performs learning operations with a single training data.
  • the update amounts calculated by each of the plurality of arithmetic nodes are aggregated by adding them, and the aggregated added value is shared by the plurality of arithmetic nodes. There is a need to. Then, when aggregating and sharing, data communication processing is performed between a plurality of arithmetic nodes.
  • the data parallel type distributed learning shortens the calculation time required for learning by calculating the training data in parallel, but the calculation time is shortened due to the communication processing time between the calculation nodes performed in each learning process. Is suppressed.
  • an object of the first aspect of the present embodiment is to provide a neural network system, a neural network learning method, and a neural network learning program that improve the throughput of data parallel distributed learning.
  • the first aspect of the present embodiment includes a memory and a plurality of processors that access the memory, and each of the plurality of processors is subjected to a plurality of learning sessions.
  • the operation of the neural network is executed based on the input of the training data and the parameters in the neural network to calculate the output of the neural network, and the difference between the calculated output and the teacher data of the training data is relative to the parameter. Calculate the slope or the amount of renewal based on the slope, In the first case where the accumulation of the gradient or the update amount is not less than the threshold, the plurality of processors transmit the calculated accumulation of the gradient or the update amount to other processors in the plurality of processors.
  • a first update process that aggregates the accumulation of the plurality of gradients or update amounts, receives the aggregated gradient or update amount accumulation, and updates the parameter with the aggregated gradient or update amount accumulation. Run and In the second case where the accumulation of the gradient or the update amount is less than the threshold value, the plurality of processors do not aggregate the accumulation of the plurality of gradients or the update amount by the transmission, and each of the plurality of processors calculates. It is a neural network system that executes a second update process for updating each parameter with the gradient or update amount.
  • the throughput of data parallel distributed learning is improved.
  • FIG. 1 is a diagram showing a configuration example of an NN system according to the present embodiment.
  • the NN system 1 is, for example, a high-performance computer, and has a main processor (CPU: Central Processing Unit) 10, a main memory 12, a subprocessor module 13, and an interface 18 with a network NET.
  • the subprocessor module 13 has, for example, four arithmetic node modules, and each arithmetic node module has a subprocessor 14 and a memory 16 accessed by the subprocessor.
  • the NN system 1 has an auxiliary storage device 20-26 which is a large-capacity storage, and the auxiliary storage device stores the NN learning program 20, the NN program 22, the training data 24, and the parameter 26. ..
  • the NN learning program 20 is executed by the processors 10 and 14, and performs learning processing using the training data.
  • the NN program 22 is executed by the processors 10 and 14, and executes the calculation of the NN model.
  • the training data 24 is a plurality of data having labels that are input and teacher data, respectively.
  • Parameter 26 is a plurality of weights in the NN that are optimized by learning, for example.
  • the main processor 10 executes the NN learning program 20 and distributes the NN learning calculation based on the plurality of training data to the plurality of subprocessors 14 and executes them in parallel.
  • the four subprocessors 14 are arithmetic nodes composed of processor chips, and are configured to be able to communicate with each other via the bus 28.
  • the NN system 1 can provide the NN platform to the client terminals 30 and 32 via the network NET.
  • the NN system 1 may have a configuration in which a plurality of computers are arithmetic nodes and the plurality of computers can communicate with each other.
  • FIG. 2 is a diagram showing an example of learning processing in a general NN.
  • the NN in FIG. 2 has an input layer IN_L and three hidden layers, neuron layers NR_L1 to NR_L3.
  • the third neuron layer NR_L3 also serves as an output layer.
  • the outline of the NN learning process is as follows.
  • the processor 10 or 14 reads one training data having an input data and a label from the training data 24 in the storage, and inputs the input data to the input layer IN_L.
  • the processor executes the NN learning program, executes the calculation of the first neuron layer NR_L1 using the input training data, and inputs the calculation result to the second neuron layer NR_L2. Further, the processor executes the operation of the second neuron layer NR_L2 using the operation result, inputs the operation result to the third neuron layer NR_L3, and finally, regarding the operation result, the third neuron layer NR_L3. Executes the operation of and outputs the operation result. It is called forward propagation processing FW that the three neuron layers NR_L1 to NR_L3 execute their respective operations in order with respect to the input of the input layer IN_L.
  • the processor calculates the difference E3 between the label of the training data (correct answer data) and the output of the third neuron layer NR_3, and differentiates the difference E3 with the parameter w in the neuron layer NR_L3 to obtain the gradient ⁇ E3.
  • the processor calculates the difference E2 in the second neuron layer NR_L2 from the difference E3, differentiates the difference E2 with the parameter w in the neuron layer NR_L2, and obtains the gradient ⁇ E2.
  • the processor calculates the difference E1 in the first neuron layer NR_L1 from the difference E2, differentiates the difference E1 with the parameter w in the neuron layer NR_L1, and obtains the gradient ⁇ E1.
  • each arithmetic is performed by the input to each layer and a plurality of parameters w.
  • a plurality of parameters w are updated by the gradient method so that the difference between the output estimated by NN based on the input data of the training data and the label (supervised data) is minimized.
  • the parameter update amount is calculated by multiplying the gradient ⁇ E obtained by differentiating the difference E with the parameter w by the learning rate ⁇ .
  • NNs especially deep NNs (hereinafter referred to as DNNs)
  • DNNs deep NNs
  • NNs can improve the accuracy of NNs and DNNs as the number of training data increases and the number of times of learning using the training data increases.
  • the learning time by the NN system increases accordingly. Therefore, in order to shorten the learning time, data parallel type distributed learning in which the learning process is distributed among a plurality of arithmetic nodes is effective.
  • a plurality of arithmetic nodes execute forward propagation processing FW and back propagation processing BW using their respective training data, and calculate a gradient ⁇ E corresponding to the parameter w of the difference E of the NN of each of the plurality of arithmetic nodes. To do. Then, each of the gradients ⁇ E or the parameter update amount ⁇ w obtained by multiplying the gradient by the learning rate is obtained by the plurality of nodes and shared by the plurality of nodes. Further, the plurality of nodes acquire the average of the gradient ⁇ E or the average of the update amount ⁇ w, and the plurality of nodes update the parameter w of each NN with the average of the update amount ⁇ w.
  • each of the plurality of nodes uses one training data to perform forward propagation processing and back propagation processing to obtain the gradient or update amount, and the parameter w of each node is based on the average of them.
  • the process of updating is a process corresponding to the mini-batch method in which the training data of the number of nodes is set as a mini-batch unit.
  • the training data of the number obtained by multiplying the number of nodes by the number of processes of each node is called a mini-batch.
  • the mini-batch method corresponds to the mini-batch method.
  • the above-mentioned processing for obtaining the average of the gradient or the amount of update includes Reduce processing and All reduce processing included in MPI (Message Passing Interface), which is a standard for parallel computing.
  • MPI Message Passing Interface
  • the parameters of each of the plurality of arithmetic nodes are aggregated (for example, addition), and the aggregated values are acquired by all the plurality of arithmetic nodes. This process requires data communication between a plurality of arithmetic nodes.
  • FIG. 3 is a diagram showing a processing flow of a plurality of arithmetic nodes in data division type distributed learning.
  • FIG. 4 is a flowchart showing specific processing of a plurality of arithmetic nodes in the data division type distributed learning.
  • four arithmetic nodes ND_1 to ND_4 each perform learning using one training data, and a certain arithmetic node aggregates the update amount ⁇ w of the parameter w calculated by each of the four arithmetic nodes.
  • Each parameter is updated with the average value of the update amount aggregated by each arithmetic node.
  • the outline of the data division type distributed learning will be described below with reference to FIGS. 3 and 4.
  • the four arithmetic nodes correspond to, for example, the four subprocessors 14 shown in FIG. If the NN system consists of four computers, the four compute nodes correspond to the processors of the four computers.
  • the four arithmetic nodes ND_1 to ND_4 execute the NN learning program and perform the following processing.
  • each of the four arithmetic nodes ND_1 to ND_4 inputs the data corresponding to each of the training data data D1 to D4 (S10).
  • the data D1 to D4 are input to the first neuron layer NR_L1 of each arithmetic node.
  • each arithmetic node executes the feedforward processing FW and executes the arithmetic of each neuron layer (S11).
  • the data D1 and D2 are handwritten characters "6" and "2".
  • each arithmetic node calculates the difference E1 to E4 between the output OUT of each NN and the label LB which is the teacher data.
  • the output OUTs of the arithmetic nodes ND_1 and ND_2 are "5" and "3", and the labels LB are "6" and "2".
  • the differences E1 to E3 are the sum of squares of the differences between the output OUT and the label LB.
  • the NN is a model for estimating handwritten numbers
  • the third neuron layer which is an output layer, outputs the probabilities that the numbers in the input data correspond to the numbers 0 to 9, respectively.
  • the calculation node calculates the sum of squares of the differences of the respective probabilities as the difference E.
  • each calculation node propagates each difference E to each neuron layer (S13), differentiates the difference E propagated by the parameter w of each neuron layer, and calculates the gradient ⁇ E. Further, each arithmetic node multiplies the gradient ⁇ E by the learning rate ⁇ to calculate the update amount ⁇ w of the parameter w (S14).
  • the four arithmetic nodes ND_1 to ND_4 communicate their respective update amounts ⁇ w between the arithmetic nodes via the bus 28 between the arithmetic nodes, and a certain arithmetic node updates the update amounts ⁇ w1 of the parameters w1 to w4 of all the nodes. Performs reduce processing that aggregates ⁇ ⁇ w4. Aggregation is, for example, addition (or extraction of maximum value). Then, the four arithmetic nodes receive the aggregated addition value ⁇ w_ad via the bus 28 and perform an All reduce process shared by all the arithmetic nodes (S15).
  • each arithmetic node divides the aggregated addition value ⁇ w_ad by the number of arithmetic nodes 4 to calculate the average value ⁇ w_ad / 4 of the update amount ⁇ w, adds it to the existing parameters w1 to w4, and updates each parameter. (S16). As a result, one learning by the mini-batch is completed. When the training is completed, the NN parameter of each arithmetic node is updated to the same value. Then, each arithmetic node returns to the process S10 and executes the next learning.
  • FIG. 5 is a diagram showing a general example of Reduce processing and All reduce processing.
  • the four arithmetic nodes ND_1 to ND_4 own the values y1 to y4, respectively.
  • each arithmetic node communicates its respective values y1 to y4 via the bus 28.
  • one arithmetic node ND_1 receives all the values y1 to y4, and four values are set by a predetermined function f. Calculate the aggregated value f (y1, y2, y3, y4) by calculation.
  • the arithmetic node ND_1 transmits the aggregated value f (y1, y2, y3, y4) to the other arithmetic nodes ND_2 to ND_4 via the bus 28, and all the arithmetic nodes share the aggregated value. To do.
  • the arithmetic nodes ND_2 to ND_4 transmit their respective values y2 to y4 to the arithmetic node ND_1.
  • the calculation node ND_4 sends the value y4 to the calculation node ND_3
  • the calculation node ND_3 calculates the addition value y3 + y4
  • the calculation node ND_2 sends the value y2 to the calculation node ND_1
  • the calculation node ND_1 calculates the addition value y1 + y2.
  • the four arithmetic nodes ND_1 to ND_4 have array data (w1, x1, y1, z1), (w2, x2, y2, z2), (w3, x3, y3, z3), respectively. If you own (w4, x4, y4, z4), each arithmetic node has data w to arithmetic node ND_1, data x to arithmetic node ND_2, data y to arithmetic node ND_3, and data z to arithmetic node ND_1. Send to arithmetic node ND_4 respectively.
  • each arithmetic node transmits the calculated aggregated value to the other arithmetic nodes via the bus 28, and all the arithmetic nodes acquire and share the aggregated value. This process is an All reduce process.
  • FIG. 6 is a diagram showing an example of Reduce processing and All reduce processing when NN learning is performed by data division type distributed learning.
  • each arithmetic node performs the Reduce process at the stage where each arithmetic node calculates the update amounts ⁇ w1 to ⁇ w4 of the respective parameters w1 to w4
  • the update amounts ⁇ w1 to ⁇ w4 of all the arithmetic nodes are increased.
  • it is transmitted to one calculation node ND_1, and the calculation node ND_1 calculates the addition value ⁇ w_ad of the update amounts ⁇ w1 to ⁇ w4 as an aggregate value by the addition function f.
  • the calculation node ND_1 transmits the addition value ⁇ w_ad to the other calculation nodes ND_2 to ND_4, and all the calculation nodes acquire and share the addition value.
  • each calculation node ND_1 to ND_4 calculates the average value ⁇ w_av of the update amount ⁇ w by dividing the addition value ⁇ w_ad by the number of calculation nodes 4 in the average processing Average. Then, each of the arithmetic nodes ND_1 to ND_4 adds the average value ⁇ w_av of the update amount to the existing parameters w1 to w4 in the update process Update.
  • a plurality of training data of a mini-batch are distributed to a plurality of arithmetic nodes by the above data parallel distributed learning, and the plurality of arithmetic nodes perform arithmetic operations in parallel up to a parameter gradient ⁇ E or an update amount ⁇ w, and a plurality of arithmetic nodes are operated in parallel.
  • the parameter w of each operation node is updated with the average value of the plurality of update amounts ⁇ w1 to ⁇ w4 calculated from the training data.
  • the average value of a plurality of update amounts is the NN of all arithmetic nodes. Since the parameter w of is updated, the adverse effect on learning due to the exceptional amount of update can be suppressed.
  • FIG. 7 is a flowchart of data parallel type distributed learning according to the first embodiment.
  • FIG. 7 shows a flowchart of the learning process of the arithmetic node ND_1 in the flowchart of FIG. 4, and the flowchart of the learning process of the remaining arithmetic nodes ND_2 to ND_4 is omitted.
  • the flowcharts S10 to S16, S16A, and S20 to S23 of the learning process of the calculation nodes ND_1 shown in FIG. 7 are similarly executed in the remaining calculation nodes ND_2 to ND_4.
  • the flowchart of the learning process of the four arithmetic nodes can be obtained by replacing the flowchart of the learning process of each arithmetic node of FIG. 4 with the flowchart of the learning process of the arithmetic node ND_1 of FIG.
  • NN has a large number of parameters w, but first, an example of one parameter w of NN will be described, and then how to be processed for a plurality of parameters w of NN will be described.
  • Reduce processing and All reduce processing are not executed in all learning for the gradient ⁇ E or the update amount ⁇ w calculated by each of the plurality of arithmetic nodes. That is, when the gradient or update amount calculated by the plurality of arithmetic nodes is less than the threshold value, the processor does not execute the reduce process and the all reduce process, and uses the gradient or update amount calculated by each arithmetic node for each parameter w. To update. If the gradient or update amount calculated by the plurality of arithmetic nodes is not less than the threshold value, the processor executes Reduce processing and Allreduce processing, and updates each parameter w using the average value of the aggregated gradient or update amount. To do.
  • the NN system of the present embodiment sometimes skips the communication processing by the Reduce processing and the Allreduce processing while suppressing the harmful effects due to the exceptional value gradient and the update amount by the mini-batch method, and the processing time of the total learning. To shorten.
  • the gradient or update amount is simplified to the update amount ⁇ w.
  • the reduce process and the all reduce process may be performed on the gradient ⁇ E.
  • each arithmetic node will be described with reference to the flowchart of FIG. Although not shown in FIG. 7, immediately after the start of learning, the arithmetic nodes ND_1 to ND_4 reset their cumulative update amounts ⁇ wr1 to ⁇ wr4 to 0. Next, the calculation nodes ND_1 to ND_4 input the input data of the training data and execute the forward propagation process, the calculation of the difference E1, the back propagation process, and the calculation of the update amounts ⁇ w1 to ⁇ w4 of the parameter w (S10 to S14). ).
  • each arithmetic node adds the calculated update amounts ⁇ w1 to ⁇ w4 to the cumulative update amounts ⁇ wr1 to wr4 (S20).
  • the cumulative update amounts of all the arithmetic nodes are all 0, so the cumulative update amounts ⁇ wr1 to wr4 are equal to the update amounts ⁇ w1 to ⁇ w4 in the initial learning.
  • each arithmetic node determines whether or not the cumulative update amounts ⁇ wr1 to wr4 are less than the threshold value TH (S21).
  • each arithmetic node updates the parameters by adding the respective update amounts ⁇ w1 to ⁇ w4 to the respective parameters w1 to w4. (S16A).
  • each arithmetic node updates the respective parameters w1 to w4 with the calculated update amounts ⁇ w1 to ⁇ w4.
  • the arithmetic nodes ND_1 to ND_4 send and receive the calculated cumulative update amounts ⁇ wr1 to ⁇ wr4, respectively, and perform all operations. Aggregate by adding the cumulative update amounts ⁇ wr1 to ⁇ wr4 of the nodes (Reduce processing), and share the aggregated cumulative update amount ⁇ wr_ad with all nodes (All reduce processing) (S15).
  • NO in the determination S21 means that the total cumulative update amounts ⁇ wr1 to wr4 do not fall below the threshold value TH, and that at least one cumulative update amount does not fall below the threshold value TH.
  • the case of YES in the above determination S21 means that the total cumulative update amounts ⁇ wr1 to wr4 are less than the threshold value TH.
  • each arithmetic node ND_1 to ND_4 divides the aggregate cumulative update amount ⁇ wr_ad by the number of arithmetic nodes “4” to obtain the average value ⁇ wr_ad / 4 of each cumulative update amount, and obtains the update amount of each parameter w1 to w4.
  • the average value of the cumulative update amount ⁇ wr_ad / 4 is added to the values of the parameters w1 to w4 before the accumulation starts, and each parameter is updated to a common value (S16).
  • each arithmetic node resets the cumulative update amounts ⁇ wr1 to ⁇ wr4 to 0 (S22).
  • Each arithmetic node repeats the above learning process while the total number of learnings is less than N (S23).
  • the arithmetic nodes ND_1 to ND_4 perform Reduce processing and All reduce processing. Since there is no such thing, the time required for communication between the arithmetic nodes of both processes is eliminated, and the time required for all learning can be shortened.
  • each arithmetic node calculates the cumulative update amount ⁇ wr1 to ⁇ wr4. And record it.
  • each arithmetic node aggregates the cumulative update amounts ⁇ wr1 to ⁇ wr4.
  • the aggregated cumulative update amount ⁇ wr_add is shared, and the parameters w1 to w4 before accumulation are updated with the average value ⁇ wr_add / 4.
  • the cumulative update amount of all arithmetic nodes is less than the threshold value, the variation of the cumulative update amount in each arithmetic node is relatively small, and even if Reduce processing and Allreduce processing are omitted, the parameter values between each arithmetic node greatly deviate. There is nothing to do. However, if the cumulative update amount of all arithmetic nodes is not less than the threshold value and at least one cumulative update amount is equal to or greater than the threshold value, the discrepancy between the parameter values becomes large.
  • the update amount is aggregated, and the parameters before accumulation of all arithmetic nodes are updated and reset with the average value.
  • each arithmetic node optimized one parameter w in each NN.
  • the cumulative update amounts ⁇ wr1 to ⁇ wr4 of the parameters w1 to w4 of each arithmetic node were compared with the threshold values.
  • the parameter update amounts ⁇ w1 to ⁇ w4 may be positive or negative, it is desirable to compare the absolute values of the cumulative parameter update amounts ⁇ wr1 to ⁇ wr4 with a certain threshold value TH (TH is positive).
  • each arithmetic node individually compares the cumulative update amount of a plurality of parameters of each NN with the threshold value TH, and the cumulative update amount of all the parameters of each NN is the threshold value TH. It is determined whether or not it is less than, and whether or not it is less than the threshold value TH for all arithmetic nodes.
  • each arithmetic node groups a plurality of parameters of each NN into a plurality of parameters w 1 , w 2 , ... w n of each layer in the NN, and in the determination step S21, a plurality of parameters of each layer.
  • each arithmetic node determines whether or not the determination S21 of the plurality of layers of each NN is all less than the threshold value TH, and determines whether or not all the arithmetic nodes are all less than the threshold value TH. Since only the maximum value is compared with the threshold value TH, the throughput of the determination step S21 is improved.
  • each arithmetic node groups a plurality of parameters of each NN into a plurality of parameters w 1 , w 2 , ... w n of each layer in the NN, and in the determination step S21, a plurality of parameters of each layer.
  • each arithmetic node determines whether or not all the determinations of the plurality of layers of each NN are less than the threshold value TH, and also determines whether or not all the arithmetic nodes are all less than the threshold value TH.
  • the L1 norm is the sum of the absolute values of the cumulative updates of the multiple parameters w 1 , w 2 , ... w n
  • the L2 norm is the sum of the multiple parameters w 1 , w 2 , ,. ... w n is the square root of the sum of squares of the absolute values of the cumulative updates
  • the Lp norm is the sum of the absolute values of the cumulative updates of multiple parameters w 1 , w 2 , ... w n to the power of -p.
  • the throughput of the determination step S21 is improved because the value obtained by converting the cumulative update amount of each of the plurality of parameters of each layer into the L1 norm and the L2 norm is compared with the threshold value.
  • FIG. 8 is a flowchart of data parallel type distributed learning according to the second embodiment.
  • FIG. 8 shows a flowchart of the learning process of the arithmetic node ND_1 in the flowchart of FIG. 4, and the flowchart of the learning process of the remaining arithmetic nodes ND_2 to ND_4 is omitted.
  • the flowcharts S30, S10 to S16, S20 to S23, and S31 to S33 of the learning process of the calculation nodes ND_1 shown in FIG. 8 are similarly executed in the remaining calculation nodes ND_2 to ND_4.
  • the parameter gradient ⁇ E is large and the update amounts ⁇ w1 to ⁇ w4 are also large.
  • the parameter gradient ⁇ E is small and the update amounts ⁇ w1 to ⁇ w4 are also small. Therefore, in the data parallel type distributed learning of the first embodiment, immediately after the start of the learning process, in the determination process S21, it is determined that the cumulative update amount is not less than the threshold value TH, and the Reduce process and All reduce process are performed each time. May be heard. On the other hand, as the learning process is approaching the end, in the determination process S21, it is determined that the cumulative update amount is less than the threshold value TH each time, and the Reduce process and All reduce process may not be performed at all.
  • each arithmetic node does not perform Reduce processing and All reduce processing regardless of the comparison judgment with the threshold value TH.
  • D times to U-1 times U is a positive integer larger than D
  • the cumulative update amounts ⁇ wr1 to ⁇ wr4 are less than the threshold value TH as in the first embodiment, Reduce. If the processing and All reduce processing are not performed and the threshold value is not less than TH, the Reduce processing and All reduce processing are performed to update each NN parameter with the average value of the cumulative update amount.
  • each arithmetic node has the threshold value TH. Regardless of the comparison judgment, Reduce processing and All reduce processing are performed, and each NN parameter is updated with the average value of the cumulative update amount. (4) Each arithmetic node repeats the update cycle of the parameters (1) to (3) above until all learning N is reached.
  • each arithmetic node performs Reduce processing and All reduce processing. Since there is no such thing, the number of communications can be reduced. Further, at D times or more in the update cycle, the smaller the cumulative update amount is, the more times the Reduce process and All reduce process are not performed continuously, based on the comparison judgment between the cumulative update amount of the parameter and the threshold value TH. On the contrary, the larger the cumulative update amount, the smaller the number of times the Reduce process and All reduce process are not performed continuously.
  • each of the four arithmetic nodes performs learning using one training data, and each arithmetic node optimizes one parameter w in each NN.
  • each arithmetic node stores the cumulative update amounts ⁇ wr1 to ⁇ wr4 by cumulatively adding the update amounts of the parameters calculated each time learning. Then, each arithmetic node executes the processes S30, S31-S32, and S33 in addition to the processes of the flowchart of FIG. 7. These processes will be mainly described.
  • Each arithmetic node resets the learning count counter value i and the continuous non-communication counter value j to "0" and the cumulative update amounts ⁇ wr1 to ⁇ wr4 of the parameters of each arithmetic node to "0" as the initialization process.
  • each arithmetic node performs data input, forward propagation processing, and back propagation processing of training data to calculate the update amounts ⁇ w1 to ⁇ wr4 of each parameter (S10-S14).
  • each arithmetic node adds 1 to each of the counter values i and j, and adds the calculated update amounts ⁇ w1 to ⁇ wr4 to the cumulative update amounts ⁇ wr1 to ⁇ wr4 of the parameters to update the cumulative update amount (S31).
  • each arithmetic node updates each parameter w1 to w4 with their respective update amounts ⁇ w1 to ⁇ wr4 (S16A). ..
  • Each arithmetic node repeats the above processes S10-S14, S31-S32, and S16A until the continuous non-communication counter value j is less than the first reference number D.
  • the arithmetic node does not always perform Reduce processing and All reduce processing in the first learning in the update cycle of (1) to (3).
  • each arithmetic node asks whether the cumulative update amounts ⁇ wr1 to ⁇ wr4 of the parameters are all less than the threshold TH in all the arithmetic nodes. Is determined.
  • each arithmetic node sets its parameters w1 to w4. Update with each update amount ⁇ w1 to ⁇ wr4 (S16A).
  • the arithmetic nodes ND_1 to ND_4 execute Reduce processing and All reduce processing (S15), and update each parameter w1-w4 with the average value ⁇ wr_add / 4 of the cumulative update amount (S15). S16). Then, the arithmetic node resets the continuous non-communication count value j to 0 and the cumulative update amounts ⁇ wr1 to ⁇ wr4 to 0 (S22A). In this case, the update cycle of (1) to (3) is reset.
  • each arithmetic node performs Reduce processing and All reduce.
  • the process is executed (S15), the parameter is updated with the average value of the cumulative update amount (S16), and the continuous non-communication count value j and the cumulative update amount are reset to 0 (S22A). This will reset the update cycle.
  • the absolute value of the cumulative update amount of each parameter w is less than the threshold value TH in the determination step S21, as in the first embodiment. Whether or not the maximum absolute value of the cumulative update amount of multiple parameters of each layer is less than the threshold TH, and whether the L1 norm or L2 norm of the absolute value of the cumulative update amount of multiple parameters of each layer is less than the threshold TH. , Etc. may be determined.
  • FIG. 9 is a diagram showing a change example of the learning update cycle in the second embodiment.
  • FIG. 9 (1) is an example of a change in the case where the update cycle of the present embodiment is not performed.
  • One learning includes forward propagation processing FW, back propagation processing BW, Reduce processing and All reduce processing CM, and parameter update processing UP for the training data.
  • the update process UP1 in FIG. 9 (1) is a process of updating the parameters with the average value ⁇ w_ad / 4 of the update amounts of the NN parameters of all the arithmetic nodes.
  • each arithmetic node executes the Reduce process, the All reduce process CM, and the parameter update process UP1 in all learning.
  • FIG. 9 (2) is an example of a change in the learning update cycle in the second embodiment.
  • the first to fourth learnings in FIG. 9 (2) correspond to the learnings within the above-mentioned update cycle.
  • the update process UP2 in FIG. 9 (2) is a process (S16A) in which each arithmetic node updates each parameter with the update amount ⁇ w of each NN parameter.
  • the update process UP3 in FIG. 9 (2) is a process (S16) in which each arithmetic node updates each parameter with the average value ⁇ wr_ad / 4 of the cumulative update amount ⁇ wr of each NN parameter.
  • j D
  • each arithmetic node executes the Reduce process and the All reduce process CM, and executes the update process UP3.
  • the third learning and the fourth learning are the same as the first learning and the second learning, respectively.
  • the arithmetic node since the arithmetic node does not execute the Reduce process and the All reduce process CM in all learning, the arithmetic time of the entire learning can be suppressed by not executing the process. ..
  • the cumulative update amount ⁇ wr of the parameters was aggregated in the Reduce process and the All reduce process, and the parameters of each NN were updated with the average value ⁇ wr_ad / 4.
  • Reduce processing and All reduce processing may be performed on the difference gradient ⁇ E. This is because the parameter update amount ⁇ w is calculated by multiplying the difference gradient ⁇ E by the learning rate ⁇ , and therefore the cumulative update amount ⁇ wr can be calculated by multiplying the cumulative gradient by the learning rate.
  • each arithmetic node does not perform Reduce processing and Allreduce processing, the accumulation of the difference gradient ⁇ E is updated, and if Reduce processing and Allreduce processing are performed, the cumulative gradient ⁇ Er at each arithmetic node is aggregated. Then, the aggregated value (added value) of the cumulative gradient ⁇ Er is shared by all arithmetic nodes, and the average value ⁇ wr_ad of the cumulative update amount obtained by multiplying the average value ⁇ Er_ad / 4 of the aggregated value (added value) of the cumulative gradient ⁇ Er by the learning rate ⁇ . Update the parameter w before accumulation with / 4.
  • each operation node executes an NN operation on one training data in each learning.
  • each arithmetic node may execute NN arithmetic on a plurality of training data in a plurality of processes.
  • the number of training data in one batch is the number obtained by multiplying the plurality of training data of each arithmetic node by the number of arithmetic nodes (4 in the above example).
  • each arithmetic node updates the NN parameter of each arithmetic node by using the average value of the gradient ⁇ E of the plurality of differences E calculated by the plurality of processes or the update amount ⁇ w of the parameter.
  • multiple arithmetic nodes aggregate the accumulation of their respective gradients or update amounts, and the average of the aggregated values is shared by all arithmetic nodes, and the average of the aggregated values is the parameter of each NN. To update.
  • Deep NN includes, for example, a convolution NN having a plurality of convolution layers, a pooling layer, and a fully connected layer, an autoencoder NN having nodes having the same size as an input layer and an output layer, a recurrent NN, and the like.
  • NN system 10 Main processor 13: Subprocessor module 14: Subprocessor, Arithmetic node 20: Neural network learning program 22: Neural network program 24; Training data 26: Parameter w ND_1 to ND_4: Arithmetic node w1 to w4: Parameters ⁇ w1 to ⁇ w4: Parameter update amount ⁇ wr1 to ⁇ wr4: Cumulative update amount ⁇ wr_add: Cumulative update amount aggregate value ⁇ wr_add / 4: Average cumulative update amount

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Neurology (AREA)
  • Feedback Control In General (AREA)
  • Multi Processors (AREA)
  • Debugging And Monitoring (AREA)

Abstract

データ並列型分散学習のスループットを向上させる。メモリと、メモリにアクセスする複数のプロセッサとを有するニューラルネットワークシステムであって、複数のプロセッサそれぞれは、複数回の学習それぞれにおいて、訓練データの入力とニューラルネットワーク内のパラメータとに基づいてニューラルネットワークの演算を実行してニューラルネットワークの出力を算出し、算出した出力と訓練データの教師データとの差分のパラメータに対する勾配または勾配に基づく更新量を算出し、(1)勾配または更新量の累積が閾値未満でない第1の場合、複数のプロセッサが、それぞれ算出した複数の勾配または更新量の累積を、複数のプロセッサ内の他のプロセッサに送信して複数の勾配または更新量の累積を集約し、集約された勾配または更新量の累積を受信し、集約された勾配または更新量の累積でパラメータを更新する第1の更新処理を実行し、(2)勾配または更新量の累積が閾値未満である第2の場合、複数のプロセッサが、送信による複数の勾配または更新量の累積の集約を行わず、複数のプロセッサそれぞれが算出した勾配または更新量でそれぞれのパラメータを更新する第2の更新処理を実行する。

Description

ニューラルネットワークシステム、ニューラルネットワークの学習方法及びニューラルネットワークの学習プログラム
 本発明は、ニューラルネットワークシステム、ニューラルネットワークシステムの学習方法及びニューラルネットワークシステムの学習プログラムに関する。
 ニューラルネットワークは、例えば、複数の入力にそれぞれの重みを乗算し、その複数の乗算値を加算した値を出力層のニューロンの活性化関数に入力し、活性化関数の出力を出力する構成を有する。このような単純な構成のニューラルネットワークは、単純パーセプトロンと称される。さらに、上記の単純な構成を複数層有し、ある層の出力を他の層に入力するニューラルネットワークは、多層パーセプトロンと称される。また、ディープニューラルネットワークは、多層パーセプトロンのように、入力層と出力層との間に複数の隠れ層を有する。以下、ニューラルネットワークは略してNN(Neural Network)と称する。
 NNは、大量の訓練データを用いて学習することで、前述の重みなどのパラメータを最適化する。訓練データの数が多いほどモデルの精度を高めることができるが、一方で、学習回数が増大し学習に要する演算時間が長くなるという問題がある。
 NNの学習に要する演算時間を短くする方法として、訓練データを分割し、複数の演算ノードで並列に学習の演算を実行するデータ並列型分散学習が提案されている。データ並列型分散学習については、例えば、以下の特許文献に記載されている。
特開2018-120470号公報 特開2012-79080号公報
 データ並列型分散学習では、訓練データを演算ノードの数で分割し、複数の演算ノードがそれぞれの訓練データに基づいて学習の演算を実行して、NNのパラメータについてNNの出力の誤差関数の勾配を算出し、勾配に学習率を乗じたパラメータの更新量を算出する。その後、演算ノードは、各ノードの更新量の平均を求め、全演算ノードが、更新値の平均でパラメータを更新する。複数の演算ノードがそれぞれの訓練データで並列に学習演算を行うことで、単一の演算ノードが単一の訓練データで学習演算するよりも学習に要する演算時間を短くできる。
 しかしながら、複数の演算ノードそれぞれが算出した更新量の平均を求めるためには、複数の演算ノードそれぞれが算出した更新量を加算するなどして集約し、集約した加算値を複数の演算ノードで共有する必要がある。そして、集約するときと共有するときに、複数の演算ノード間でデータの通信処理が行われる。
 その結果、データ並列型分散学習は、訓練データを並列に演算することで学習に要する演算時間を短縮するが、学習工程毎に行われる演算ノード間の通信処理の時間により、演算時間の短縮効果が抑制される。
 そこで、本実施の形態の第1の側面の目的は、データ並列型分散学習のスループットを向上させるニューラルネットワークシステム、ニューラルネットワークの学習方法及びニューラルネットワークの学習プログラムを提供することにある。
 本実施の形態の第1の側面は、メモリと、前記メモリにアクセスする複数のプロセッサとを有し、前記複数のプロセッサそれぞれは、複数回の学習それぞれにおいて、
 訓練データの入力とニューラルネットワーク内のパラメータとに基づいて前記ニューラルネットワークの演算を実行して前記ニューラルネットワークの出力を算出し、前記算出した出力と前記訓練データの教師データとの差分の前記パラメータに対する勾配または前記勾配に基づく更新量を算出し、
 前記勾配または前記更新量の累積が閾値未満でない第1の場合、前記複数のプロセッサが、それぞれ算出した複数の前記勾配または前記更新量の累積を、前記複数のプロセッサ内の他のプロセッサに送信して前記複数の勾配または更新量の累積を集約し、前記集約された勾配または更新量の累積を受信し、前記集約された勾配または更新量の累積で前記パラメータを更新する第1の更新処理を実行し、
 前記勾配または前記更新量の累積が前記閾値未満である第2の場合、前記複数のプロセッサが、前記送信による前記複数の勾配または更新量の累積の集約を行わず、前記複数のプロセッサそれぞれが算出した前記勾配または更新量でそれぞれのパラメータを更新する第2の更新処理を実行する、ニューラルネットワークシステムである。
 第1の側面によれば、データ並列型分散学習のスループットが向上する。
本実施の形態におけるNNシステムの構成例を示す図である。 一般的なNNにおける学習の処理例を示す図である。 データ分割型分散学習における複数の演算ノードの処理のフローを示す図である。 データ分割型分散学習における複数の演算ノードの具体的処理を示すフローチャート図である。 Reduce処理とAllreduce処理の一般的な例を示す図である。 NNの学習をデータ分割型分散学習で行った場合のReduce処理とAllreduce処理の例を示す図である。 第1の実施の形態によるデータ並列型分散学習のフローチャート図である。 第2の実施の形態によるデータ並列型分散学習のフローチャート図である。 第2の実施の形態における学習の更新サイクルの変化例を示す図である。
 [本実施の形態のニューラルネットワークシステム]
 図1は、本実施の形態におけるNNシステムの構成例を示す図である。NNシステム1は、例えば、ハイパフォーマンスコンピュータであり、メインプロセッサ(CPU:Central Processing Unit)10と、メインメモリ12と、サブプロセッサモジュール13と、ネットワークNETとのインタフェース18とを有する。サブプロセッサモジュール13は、例えば、4つの演算ノードモジュールを有し、各演算ノードモジュールは、サブプロセッサ14とサブプロセッサがアクセスするメモリ16とを有する。
 更に、NNシステム1は、大容量ストレージである補助記憶装置20-26を有し、補助記憶装置には、NN学習プログラム20と、NNプログラム22と、訓練データ24と、パラメータ26が記憶される。NN学習プログラム20は、プロセッサ10、14により実行され、訓練データを利用した学習の処理を行う。また、NNプログラム22は、プロセッサ10、14により実行され、NNモデルの演算を実行する。訓練データ24は、それぞれ入力と教師データであるラベルを有する複数のデータである。パラメータ26は、例えば学習により最適化されるNN内の複数の重みである。
 メインプロセッサ10は、NN学習プログラム20を実行し、複数の訓練データによるNN学習の演算を、複数のサブプロセッサ14に分散して並列に実行させる。4つのサブプロセッサ14は、プロセッサチップからなる演算ノードであり、バス28を介して互いに通信可能に構成される。
 NNシステム1は、ネットワークNETを介して、NNのプラットフォームをクライアント端末30、32に提供することができる。NNシステム1は、図1の構成以外に、複数のコンピュータを演算ノードとし、複数のコンピュータが互いに通信可能な構成であってもよい。
 [NNの学習]
 図2は、一般的なNNにおける学習の処理例を示す図である。図2のNNは、入力層IN_Lと、3つの隠れ層であるニューロン層NR_L1~NR_L3を有する。第3のニューロン層NR_L3は出力層を兼ねる。
 NNの学習の処理の概略は次の通りである。プロセッサ10又は14は、ストレージ内の訓練データ24から、入力データとラベルを有する一つの訓練データを読み出し、入力層IN_Lに入力データを入力する。プロセッサは、NN学習プログラムを実行し、入力された訓練データを使用して第1のニューロン層NR_L1の演算を実行し、その演算結果を第2のニューロン層NR_L2に入力する。更に、プロセッサは、演算結果を使用して第2のニューロン層NR_L2の演算を実行し、その演算結果を第3のニューロン層NR_L3に入力し、最後に、その演算結果について第3のニューロン層NR_L3の演算を実行し、演算結果を出力する。入力層IN_Lの入力に対して3つのニューロン層NR_L1~NR_L3が順番にそれぞれの演算を実行することは、順伝播処理FWと称される。
 一方、プロセッサは、訓練データのラベル(正解データ)と第3のニューロン層NR_3の出力との差分E3を演算し、差分E3をニューロン層NR_L3内のパラメータwで微分して勾配ΔE3を求める。プロセッサは、差分E3から第2のニューロン層NR_L2での差分E2を算出し、差分E2をニューロン層NR_L2内のパラメータwで微分して勾配ΔE2を求める。そして、プロセッサは、差分E2から第1のニューロン層NR_L1での差分E1を算出し、差分E1をニューロン層NR_L1内のパラメータwで微分して勾配ΔE1を求める。更に、出力層である第3のニューロン層NR_L3の出力と正解値のラベルとの差分E3を第2、第1のニューロン層に伝播しながら、各層NR_L3、NR_L2、 NR_L1で勾配ΔE3、ΔE2、ΔE1を順番に演算することは、逆伝播処理BWと称される。
 一般に、各ニューロン層の演算処理では、各層への入力と複数のパラメータwとでそれぞれの演算が行われる。教師あり学習では、各学習で、訓練データの入力データに基づいてNNが推定した出力とラベル(教師データ)との差分が最小になるよう、勾配法により、複数のパラメータwを更新する。パラメータの更新量は、差分Eをパラメータwで微分して求めた勾配ΔEに学習率ηを乗じて算出される。
 [データ分割型分散学習]
 NN、とりわけディープNN(以下DNNと称する)は、訓練データの数が多いほど、そして、訓練データを使用した学習の回数が多いほど、NNやDNNの精度を向上させることができる。しかし、訓練データの数が膨大になると、それに対応してNNシステムによる学習時間が長くなる。そこで、学習時間を短縮するためには、複数の演算ノードで学習処理を分散して行うデータ並列型分散学習が有効になる。
 データ並列型分散学習では、複数の訓練データそれぞれによる学習を複数の演算ノードに分散して実行させる。すなわち、複数の演算ノードが、それぞれの訓練データを使用して順伝播処理FWと逆伝播処理BWを実行して、複数の演算ノードそれぞれのNNの差分Eのパラメータwに対応する勾配ΔEを算出する。そして、複数のノードでそれぞれの勾配ΔEまたは勾配に学習率を乗じたパラメータの更新量Δwを求め、複数のノードで共有する。更に、複数のノードが、勾配ΔEの平均または更新量Δwの平均を取得し、複数のノードがそれぞれのNNのパラメータwを更新量Δwの平均で更新する。
 上記の学習方法のように、複数のノードそれぞれが1つの訓練データを使用して順伝播処理と逆伝播処理を実行して勾配または更新量を求め、それらの平均に基づいて各ノードのパラメータwを更新する処理は、ノード数の訓練データをミニバッチ単位とするミニバッチ法に対応した処理である。複数のノードそれぞれが複数のプロセスでプロセスの数の訓練データを使用して順伝播処理と逆伝播処理を実行する場合は、ノード数と各ノードのプロセス数を乗算した数の訓練データをミニバッチとするミニバッチ法に対応する。
 上記の勾配または更新量の平均を求める処理は、並列コンピューティングの標準規格であるMPI(Message Passing Interface)に含まれるReduce処理とAllreduce処理を含む。このReduce処理とAllreduce処理では、複数の演算ノードそれぞれのパラメータを集約(例えば加算)し、集約した値を全ての複数の演算ノードが取得する。この処理には、複数の演算ノード間でのデータの通信が必要となる。
 図3は、データ分割型分散学習における複数の演算ノードの処理のフローを示す図である。また、図4は、データ分割型分散学習における複数の演算ノードの具体的処理を示すフローチャート図である。これらの例では、4つの演算ノードND_1~ND_4が、それぞれ、1つの訓練データを使用して学習を行い、ある演算ノードが4つの演算ノードがそれぞれ算出したパラメータwの更新量Δwを集約し、各演算ノードが集約した更新量の平均値でそれぞれのパラメータを更新する。図3、図4を参照して、データ分割型分散学習の概略を以下説明する。
 4つの演算ノードは、例えば、図1の4つのサブプロセッサ14に対応する。NNシステムが4つのコンピュータにより構成される場合は、4つの演算ノードは、4つのコンピュータのプロセッサに対応する。
 4つの演算ノードND_1~ND_4は、NN学習プログラムを実行して、以下の処理を行う。最初に、4つの演算ノードND_1~ND_4それぞれは、訓練データのデータD1~D4のうちそれぞれに対応するデータを入力する(S10)。データD1~D4は、各演算ノードの第1のニューロン層NR_L1に入力される。そして、各演算ノードは、順伝播処理FWを実行し、各ニューロン層の演算を実行する(S11)。図3中、データD1、D2は、手書き文字「6」「2」である。
 次に、各演算ノードは、それぞれのNNの出力OUTと教師データであるラベルLBの差分E1~E4を算出する。演算ノードND_1、ND_2の出力OUTは「5」「3」であり、ラベルLBは「6」「2」である。ここで、差分E1~E3は、出力OUTとラベルLBの差分の二乗和である。より具体的には、NNは、手書きの数字を推定するモデルであり、出力層である第3のニューロン層は、入力データの数字が数字0~9に該当する確率をそれぞれ出力する。この10個の確率の出力に対し、数字0~9の確率の教師データは、ラベルLBが示す数字の確率が「1」、ラベルLBと異なる数字の確率が「0」とする。そして、演算ノードは、それぞれの確率の差分の二乗和を差分Eとして算出する。
 そして、各演算ノードは、それぞれの差分Eを各ニューロン層に伝播し(S13)、各ニューロン層のパラメータwで伝播された差分Eを微分して勾配ΔEを演算する。更に、各演算ノードは、勾配ΔEに学習率ηを乗じてパラメータwの更新量Δwを算出する(S14)。
 ここで、4つの演算ノードND_1~ND_4は、それぞれの更新量Δwを演算ノード間のバス28を介して演算ノード間で通信し、ある演算ノードが、全ノードのパラメータw1~w4の更新量Δw1~Δw4を集約するreduce処理を行う。集約は、例えば加算(または最大値の抽出)である。そして、4つの演算ノードが、集約した加算値Δw_adをバス28を介して受信し、全演算ノードで共有するAllreduce処理を行う(S15)。
 次に、各演算ノードは、集約した加算値Δw_adを演算ノード数4で除算して更新量Δwの平均値Δw_ad/4を算出し、既存のパラメータw1~w4に加算してそれぞれのパラメータを更新する(S16)。これにより、ミニバッチによる1回の学習が終了する。学習が終了すると、各演算ノードのNNのパラメータは同じ値に更新される。そして、各演算ノードは、処理S10に戻り、次の学習を実行する。
 次に、Reduce処理とAllreduce処理について説明する。
 図5は、Reduce処理とAllreduce処理の一般的な例を示す図である。図5の例では、4つの演算ノードND_1~ND_4がそれぞれ値y1~y4を所有している。Reduce処理では、各演算ノードがそれぞれの値y1~y4をバス28を介して通信し、例えば、一つの演算ノードND_1が全ての値y1~y4を受信し、所定の関数fで4つの値を演算して集約値f(y1,y2,y3,y4)を算出する。
 次に、Allreduce処理では、演算ノードND_1が集約値f(y1,y2,y3,y4)を、他の演算ノードND_2~ND_4にバス28を介してそれぞれ送信し、全演算ノードで集約値を共有する。
 図5の例では、演算ノードND_2~ND_4がそれぞれの値y2~y4を演算ノードND_1に送信している。但し、演算ノードND_4が演算ノードND_3に値y4を送信し演算ノードND_3が加算値y3+y4を算出し、更に、演算ノードND_2が演算ノードND_1に値y2を送信し演算ノードND_1が加算値y1+y2を算出し、そして、演算ノードND_3が加算値y3+y4を演算ノードND_1に送信し、演算ノードND_1が集約値f(y1,y2,y3,y4)=y1+y2+y3+y4を算出してもよい。
 また、別の処理方法としては、4つの演算ノードND_1~ND_4がそれぞれ配列データ(w1,x1,y1,z1)、(w2,x2,y2,z2)、(w3,x3,y3,z3)、(w4,x4,y4,z4)を所有している場合、各演算ノードが、データwは演算ノードND_1に、データxは演算ノードND_2に、データyは演算ノードND_3に、そして、データzは演算ノードND_4にそれぞれ送信する。そして、
演算ノードND_1が集約値f(w1,w2,w3,w4)=w1+w2+w3+w4を算出し、
演算ノードND_2が集約値f(x1,x2,x3,x4)=x1+x2+x3+x4を算出し、
演算ノードND_3が集約値f(y1,y2,y3,y4)=y1+y2+y3+y4を算出し、
演算ノードND_4が集約値f(z1,z2,z3,z4)=z1+z2+z3+z4を算出する。
 ここまではReduce処理である。次に、各演算ノードが、それぞれ算出した集約値を他の演算ノードにバス28を介してそれぞれ送信し、集約値を全演算ノードで取得し共有する。この処理はAllreduce処理である。
 図6は、NNの学習をデータ分割型分散学習で行った場合のReduce処理とAllreduce処理の例を示す図である。図4で説明したとおり、各演算ノードがそれぞれのパラメータw1~w4の更新量Δw1~Δw4を算出した段階で、各演算ノードがReduce処理を行うと、全演算ノードの更新量Δw1~Δw4が、例えば一つの演算ノードND_1に送信され、演算ノードND_1が加算関数fにより更新量Δw1~Δw4の加算値Δw_adを集約値として算出する。そして、演算ノードND_1が加算値Δw_adを他の演算ノードND_2~ND_4に送信して、全演算ノードが加算値を取得し共有する。
 次に、データ分割型分散学習では、各演算ノードND_1~ND_4それぞれが、平均化処理Averageで、加算値Δw_adを演算ノード数4で除算して更新量Δwの平均値Δw_avを算出する。そして、各演算ノードND_1~ND_4それぞれが、更新処理Updateで、更新量の平均値Δw_avを既存のパラメータw1~w4に加算する。
 ミニバッチ法では、上記のデータ並列型分散学習により、ミニバッチの複数の訓練データを複数の演算ノードに分散し、複数の演算ノードがパラメータの勾配ΔEまたは更新量Δwまで並列に演算を行い、複数の訓練データでそれぞれ算出した複数の更新量Δw1~Δw4の平均値で各演算ノードのパラメータwを更新する。したがって、ある訓練データで算出された更新量Δwが、他の訓練データで算出された更新量から大きく乖離した例外的な値であっても、複数の更新量の平均値で全演算ノードのNNのパラメータwを更新するので、例外的な更新量による学習への悪影響を抑制することができる。
 その一方で、各学習で演算ノード間の通信処理を含むReduce処理とAllreduce処理が実行されることにより、通信処理による学習の処理時間が長くなるという問題が生じる。
 [第1の実施の形態によるデータ並列型分散学習]
 図7は、第1の実施の形態によるデータ並列型分散学習のフローチャート図である。図7には、図4のフローチャートにおける、演算ノードND_1の学習処理のフローチャートが示され、残りの演算ノードND_2~ND_4の学習処理のフローチャートは省略されている。本分散学習では、図7に示した演算ノードND_1の学習処理のフローチャートS10~S16、S16A、S20~S23が、残りの演算ノードND_2~ND_4でも同様に実行される。そして、4つの演算ノードの学習処理のフローチャートは、図4の各演算ノードの学習処理のフローチャートを、図7の演算ノードND_1の学習処理のフローチャートに置き換えることで得られる。
 ここでも前提として、4つの演算ノードそれぞれが、1つの訓練データを使用して学習を行い、各演算ノードは、それぞれのNN内の1つのパラメータwを最適化するものとする。一般に、NNは多数のパラメータwを有するが、まず、NNの1つのパラメータwの例で説明し、その後、NNが有する複数のパラメータwに対してどのように処理されるかを説明する。
 本分散学習では、複数の演算ノードそれぞれが算出した勾配ΔEまたは更新量Δwについて、全学習でReduce処理とAllreduce処理を実行することはない。つまり、プロセッサは、複数の演算ノードが算出した勾配または更新量が閾値未満の場合、Reduce処理とAllreduce処理を実行せず、各演算ノードで算出した勾配または更新量を使用してそれぞれのパラメータwを更新する。また、プロセッサは、複数の演算ノードが算出した勾配または更新量が閾値未満でない場合、Reduce処理とAllreduce処理を実行し、集約した勾配または更新量の平均値を使用してそれぞれのパラメータwを更新する。
 これにより、本実施の形態のNNシステムは、ミニバッチ法による例外的な値の勾配や更新量による弊害を抑制しつつ、Reduce処理とAllreduce処理による通信処理を時々スキップして、全学習の処理時間を短縮する。
 但し、Reduce処理とAllreduce処理が実行されない学習が連続して行われた後、Reduce処理とAllreduce処理を行って更新量の平均値で複数の演算ノードのNNのパラメータwを更新するとき、全演算ノードのパラメータwを同じ値にリセットする必要がある。そこで、各演算ノードが、Reduce処理及びAllreduce処理を実行しない学習での勾配または更新量をそれぞれ累積しておき、Reduce処理及びAllreduce処理が行われたときに、その更新量の累積値で各演算ノードのパラメータを更新する。そのため、各演算ノードは、学習したときに算出した勾配Eまたは更新量Δwの累積ErまたはΔwrを記憶しておく。
 以下の説明では、勾配または更新量は、簡単化して更新量Δwとする。但し、更新量Δwに代えて、勾配ΔEについてReduce処理とAllreduce処理を行ってもよい。
 図7のフローチャートに沿って、各演算ノードの学習処理を説明する。図7には示していないが、学習の開始直後に、演算ノードND_1~ND_4は、それぞれの累積更新量Δwr1~Δwr4を0にリセットする。次に、演算ノードND_1~ND_4は、訓練データの入力データを入力し、順伝播処理、差分E1の算出、逆伝播処理、及びパラメータwの更新量Δw1~Δw4の算出を実行する(S10~S14)。そして、各演算ノードは、累積更新量Δwr1~wr4に算出した更新量Δw1~Δw4をそれぞれ加算する(S20)。学習開始直後は、全演算ノードの累積更新量は全て0であるので、累積更新量Δwr1~wr4は初回学習での更新量Δw1~Δw4と等しい。
 次に、各演算ノードは、それぞれの累積更新量Δwr1~wr4が閾値TH未満か否かを判定する(S21)。全演算ノードでそれぞれの累積更新量Δwr1~wr4が閾値TH未満の場合(S21のYES)、各演算ノードは、それぞれのパラメータw1~w4にそれぞれの更新量Δw1~Δw4を加算してパラメータを更新する(S16A)。その結果、各演算ノードは、それぞれ算出した更新量Δw1~Δw4でそれぞれのパラメータw1~w4を更新する。
 一方、全演算ノードでそれぞれの累積更新量Δwr1~wr4が閾値TH未満とはならない場合(S21のNO)、演算ノードND_1~ND_4が、それぞれ算出した累積更新量Δwr1~Δwr4を送受信し、全演算ノードの累積更新量Δwr1~Δwr4を加算するなどして集約し(Reduce処理)、その集約した累積更新量Δwr_adを全ノードで共有する(Allreduce処理)(S15)。具体的には、演算ノードND_1~ND_4のうち一つの演算ノード、例えば演算ノードND_1が、他の演算ノードND_2~ND_4から累積更新量Δwr2~Δwr4を受信し、加算し、その加算した集約累積更新量Δwr_adを他の演算ノードND_2~ND_4に送信する。上記判定S21のNOの場合とは、全累積更新量Δwr1~wr4が閾値TH未満にならないこと、少なくとも1つの累積更新量が閾値TH未満ではないことを意味する。上記判定S21のYESの場合とは、全累積更新量Δwr1~wr4が閾値TH未満になることを意味する。
 そして、各演算ノードND_1~ND_4が、集約累積更新量Δwr_adを演算ノードの数「4」で除算して各累積更新量の平均値Δwr_ad/4を求め、それぞれのパラメータw1~w4の更新量を累積し始める前のパラメータw1~w4の値に、累積更新量の平均値Δwr_ad/4を加算して、各パラメータを共通の値に更新する(S16)。それと共に、各演算ノードが、それぞれの累積更新量Δwr1~Δwr4を0にリセットする(S22)。
 各演算ノードは、全体の学習回数がN未満の間、上記の学習処理を繰返す(S23)。
 上記の学習処理によれば、各演算ノードND_1~ND_4が算出したパラメータの累積更新量Δwr1~Δwr4が全て閾値未満の場合(S21のYES)、演算ノードND_1~ND_4はReduce処理とAllreduce処理を行わないので、両処理の演算ノード間の通信に要する時間がなくなり、全学習に要する時間を短くできる。そして、各演算ノードがReduce処理とAllreduce処理を行わず、それぞれのパラメータw1~w4をそれぞれの更新量Δw1~Δw4で更新することが連続する場合、各演算ノードが累積更新量Δwr1~Δwr4を算出して記録しておく。
 それにより、各演算ノードND_1~ND_4が算出したパラメータの累積更新量Δwr1~Δwr4が全て閾値未満とはならない場合(S21のNO)、各演算ノードが、それぞれの累積更新量Δwr1~Δwr4を集約し、集約した累積更新量Δwr_addを共有し、その平均値Δwr_add/4で累積前のパラメータw1~w4を更新する。全演算ノードの累積更新量が閾値未満の場合、各演算ノードでの累積更新量のばらつきが比較的小さく、Reduce処理とAllreduce処理を省略しても、各演算ノード間のパラメータの値が大きく乖離することはない。しかし、全演算ノードの累積更新量が閾値未満ではなく少なくとも一つの累積更新量が閾値以上の場合、パラメータの値の乖離が大きくなるので、Reduce処理とAllreduce処理を行って、各演算ノードの累積更新量を集約しその平均値で全演算ノードの累積前のパラメータを更新してリセットする。
 上記の学習では、前提として、各演算ノードが、それぞれのNN内の1つのパラメータwを最適化した。この場合、各演算ノードのパラメータw1~w4の累積更新量Δwr1~Δwr4をそれぞれ閾値と比較した。しかし、パラメータの更新量Δw1~Δw4は正の場合と負の場合があるので、望ましくは、パラメータの累積更新量Δwr1~Δwr4の絶対値をある閾値TH(THは正)と比較する。
 次に、NNが有する複数のパラメータwの最適化がどのように処理されるかを説明する。第1の方法としては、判定工程S21で、各演算ノードがそれぞれのNNの複数のパラメータの累積更新量を個別に閾値THと比較し、それぞれのNNの全てのパラメータの累積更新量が閾値TH未満か否かを判断すると共に、全演算ノードで全て閾値TH未満か否かを判断する。
 第2の方法として、各演算ノードが、それぞれのNNの複数のパラメータを、NN内の各層の複数パラメータw1, w2, ...wnにグループ化し、判定工程S21で、各層の複数パラメータw1, w2, ...wnの累積更新量の絶対値の最大値が閾値TH未満か否かを判断する。そして、各演算ノードが、それぞれのNNの複数の層の判定S21が全て閾値TH未満か否かを判断すると共に、全演算ノードで全て閾値TH未満か否かを判断する。最大値のみ閾値THと比較するので、判定工程S21のスループットが向上する。
 第3の方法として、各演算ノードが、それぞれのNNの複数のパラメータを、NN内の各層の複数パラメータw1, w2, ...wnにグループ化し、判定工程S21で、各層の複数パラメータw1, w2, ...wnの累積更新量の絶対値のLpノルム(pは正の整数)が閾値TH未満か否かを判断する。そして、各演算ノードが、それぞれのNNの複数の層の判断が全て閾値TH未満か否かを判断すると共に、全演算ノードで全て閾値TH未満か否かを判断する。
 例えば、以下の数式に示すとおり、L1ノルムは、複数パラメータw1, w2, ...wnの累積更新量の絶対値の和であり、L2ノルムは、複数パラメータw1, w2, ...wnの累積更新量の絶対値の二乗和の平方根である。Lpノルムは、複数パラメータw1, w2, ...wnの累積更新量の絶対値のp乗和の-p乗である。
Figure JPOXMLDOC01-appb-M000001
 第3の方法では、各層の複数のパラメータそれぞれの累積更新量をそのL1ノルムやL2ノルムに変換した値を閾値と比較するので、判定工程S21のスループットが向上する。
 [第2の実施の形態によるデータ並列型分散学習]
 図8は、第2の実施の形態によるデータ並列型分散学習のフローチャート図である。図8には、図4のフローチャートにおける、演算ノードND_1の学習処理のフローチャートが示され、残りの演算ノードND_2~ND_4の学習処理のフローチャートは省略されている。本分散学習では、図8に示した演算ノードND_1の学習処理のフローチャートS30、S10~S16、S20~S23、S31~S33が、残りの演算ノードND_2~ND_4でも同様に実行される。
 一般に、学習工程の開始直後は、パラメータの勾配ΔEが大きく更新量Δw1~Δw4も大きい。一方、学習工程の終了近くでは、パラメータの勾配ΔEが小さく更新量Δw1~Δw4も小さい。そのため、第1の実施の形態のデータ並列型分散学習では、学習工程の開始直後は、判定工程S21で、毎回、累積更新量が閾値TH未満でないという判断となり、毎回Reduce処理とAllreduce処理が行われる場合がある。一方、学習工程の終了に近づくにつれて、判定工程S21で、毎回、累積更新量が閾値TH未満という判断となり、Reduce処理とAllreduce処理が全く行われないという場合がある。
 上記のような問題点を緩和するために、第2の実施の形態では、次の処理を行う。即ち、
(1)全部でN回の学習のうち初めからD-1回(Dは正の整数)は、各演算ノードは、閾値THとの比較判定にかかわらず、Reduce処理及びAllreduce処理を行わず、それぞれのNNのパラメータをそれぞれの更新量で更新する。
(2)そして、D回からU-1回(UはDより大きい正の整数)までの間は、第1の実施の形態のように累積更新量Δwr1~Δwr4が閾値TH未満の場合、Reduce処理及びAllreduce処理を行わず、閾値TH未満でない場合、Reduce処理及びAllreduce処理を行って、それぞれのNNパラメータを累積更新量の平均値で更新する。
(3)さらに、U回になるまで累積更新量Δwr1~Δwr4が閾値TH未満であるためReduce処理及びAllreduce処理が連続して行われなかったら、U回目で、各演算ノードは、閾値THとの比較判定にかかわらず、Reduce処理及びAllreduce処理を行い、それぞれのNNパラメータを累積更新量の平均値で更新する。
(4)上記の(1)~(3)のパラメータの更新サイクルを、全学習Nに達するまで、各演算ノードが繰返す。
 上記の処理によれば、第1に、学習工程の開始直後でも、(1)~(3)の更新サイクル内の最初のD-1回では、各演算ノードは、Reduce処理及びAllreduce処理を行わないので、通信回数を減らすことができる。また、更新サイクル内のD回以上では、パラメータの累積更新量と閾値THとの比較判定に基づいて、累積更新量が小さいほどReduce処理及びAllreduce処理が連続して行われない回数が多くなり、逆に累積更新量が大きいほどReduce処理及びAllreduce処理が連続して行われない回数が少なくなる。
 一方、第2に、学習工程の終了に近づいたとき、(1)~(3)の更新サイクル内で、Reduce処理及びAllreduce処理が連続して行われない学習回数がU回に達すると、各演算ノードは、ある意味、強制的にReduce処理とAllreduce処理が行われて、全演算ノードの全NNの対応するパラメータが同じ累積更新量の平均値で同じ値に更新される。
 図8のフローチャートについて具体的に説明する。図8でも前提として、4つの演算ノードそれぞれが、1つの訓練データを使用して学習を行い、各演算ノードは、それぞれのNN内の1つのパラメータwを最適化するものとする。
 そして、第2の実施の形態では、全演算ノードが、共通の学習回数カウンタ値iと連続非通信カウンタ値jをカウントする。また、第1の実施の形態と同様に、各演算ノードが、学習のたびに算出した各パラメータの更新量を累積加算して累積更新量Δwr1~Δwr4を記憶する。そして、各演算ノードは、図7のフローチャートの処理に加えて、処理S30、S31-S32、S33を実行する。これらの処理を主に説明する。
 各演算ノードは、初期化処理として、学習回数カウンタ値iと連続非通信カウンタ値jを「0」に、各演算ノードのパラメータの累積更新量Δwr1~Δwr4を「0」に、それぞれリセットする。次に、各演算ノードは、訓練データのデータ入力、順伝播処理、逆伝播処理を行ってそれぞれのパラメータの更新量Δw1~Δwr4を算出する(S10-S14)。そして、各演算ノードは、カウンタ値i,jをそれぞれ1加算し、パラメータの累積更新量Δwr1~Δwr4に算出した更新量Δw1~Δwr4をそれぞれ加算して累積更新量を更新する(S31)。
 (1)連続非通信カウンタ値jが第1の基準回数D未満の場合(S32のYES)、各演算ノードは、それぞれのパラメータw1~w4をそれぞれの更新量Δw1~Δwr4で更新する(S16A)。各演算ノードは、連続非通信カウンタ値jが第1の基準回数D未満でなくなるまで、上記処理S10-S14、S31-S32及びS16Aを繰返す。第1の基準回数Dが、例えば、D=2の場合、(1)~(3)の更新サイクル内の一回目の学習では、必ず、演算ノードはReduce処理とAllreduce処理を行わない。
 (2)連続非通信カウンタ値jが第1の基準回数D未満でなくなると(S32のNO)、各演算ノードは、全演算ノードでパラメータの累積更新量Δwr1~Δwr4が全て閾値TH未満か否か判定する。
 閾値TH未満の場合(S21のYES)、連続非通信カウンタ値jが第2の基準回数U(>D)未満であれば(S33のYES)、各演算ノードは、それぞれのパラメータw1~w4をそれぞれの更新量Δw1~Δwr4で更新する(S16A)。
 閾値TH未満でない場合(S21のNO)、演算ノードND_1~ND_4が、Reduce処理とAllreduce処理を実行し(S15)、それぞれのパラメータw1-w4を累積更新量の平均値Δwr_add/4で更新する(S16)。そして、演算ノードが、連続非通信カウント値jを0に、累積更新量Δwr1~Δwr4を0にそれぞれリセットする(S22A)。この場合、(1)~(3)の更新サイクルがリセットされる。
 (3)閾値TH未満の場合(S21のYES)、連続非通信カウンタ値jが第2の基準回数U(>D)未満でなくなると(S33のNO)、各演算ノードは、Reduce処理とAllreduce処理を実行し(S15)、パラメータを累積更新量の平均値で更新し(S16)、連続非通信カウント値jと累積更新量を0にリセットする(S22A)。これで更新サイクルがリセットされる。
 各演算ノードのNNの複数のパラメータwを更新する場合については、第1の実施の形態と同様に、判定工程S21では、演算ノードは、各パラメータwの累積更新量の絶対値が閾値TH未満か否か、各層の複数パラメータの累積更新量の絶対値の最大値が閾値TH未満か否か、各層の複数パラメータの累積更新量の絶対値のL1ノルムやL2ノルムが閾値TH未満か否か、などの判定を行っても良い。
 図9は、第2の実施の形態における学習の更新サイクルの変化例を示す図である。図9(1)は、本実施の形態の更新サイクルを行わない場合の変化例である。1回の学習は、訓練データのデータに対する順伝播処理FW、逆伝播処理BW、Reduce処理及びAllreduce処理CM、パラメータの更新処理UPを含む。図9(1)での更新処理UP1は、全演算ノードのNNのパラメータの更新量の平均値Δw_ad/4でパラメータを更新する処理である。図9(1)の場合、各演算ノードは、全学習で、Reduce処理及びAllreduce処理CMとパラメータの更新処理UP1を実行する。
 図9(2)は、第2の実施の形態における学習の更新サイクルの変化例である。図9(2)の1回目~4回目の学習は、前述の更新サイクル内の学習に該当する。
 図9(2)での更新処理UP2は、各演算ノードがそれぞれのNNのパラメータの更新量Δwでそれぞれのパラメータを更新する処理(S16A)である。
 図9(2)での更新処理UP3は、各演算ノードがそれぞれのNNのパラメータの累積更新量Δwrの平均値Δwr_ad/4でそれぞれのパラメータを更新する処理(S16)である。
 図9(2)の例では、D=2の例であり、各演算ノードは、1回目の学習では、Reduce処理及びAllreduce処理CMを実行せず、更新処理UP2を実行する。2回目の学習では、j=Dとなり、各演算ノードは、Reduce処理及びAllreduce処理CMを実行し、更新処理UP3を実行する。3回目の学習と4回目の学習は、それぞれ1回目の学習と2回目の学習と同じである。
 第2の実施の形態によれば、演算ノードが全ての学習でReduce処理及びAllreduce処理CMを実行することはないので、同処理を実行しないことにより、学習全体の演算時間を抑制することができる。
 上記の実施の形態では、Reduce処理とAllreduce処理でパラメータの累積更新量Δwrを集約し、その平均値Δwr_ad/4で各NNのパラメータを更新した。しかし、パラメータの更新量に代えて、差分の勾配ΔEについてReduce処理とAllreduce処理を行っても良い。パラメータの更新量Δwは、差分の勾配ΔEに学習率ηを乗算して算出され、従って、累積更新量Δwrは累積した勾配に学習率を乗算して算出できるからである。その場合、各演算ノードが、Reduce処理とAllreduce処理を行わない場合、差分の勾配ΔEの累積を更新しておき、Reduce処理とAllreduce処理を行った場合、各演算ノードでの累積勾配ΔErを集約し、累積勾配ΔErの集約値(加算値)を全演算ノードで共有し、累積勾配ΔErの集約値(加算値)の平均値ΔEr_ad/4に学習率ηを乗じた累積更新量の平均値Δwr_ad/4で累積前のパラメータwを更新する。
 上記の実施の形態では、各学習で、各演算ノードが1つの訓練データについてNNの演算を実行する例を説明した。しかし、各学習で、各演算ノードが複数の訓練データについてNNの演算を複数のプロセスで実行しても良い。その場合、1バッチの訓練データの数は、各演算ノードの複数の訓練データに演算ノードの数(上記例では4)を乗じた数になる。そして、各演算ノードは、複数のプロセスでそれぞれ算出した複数の差分Eの勾配ΔEまたはパラメータの更新量Δwの平均値を使用して、各演算ノードのNNのパラメータを更新する。また、Reduce処理とAllreduce処理では、複数の演算ノードがそれぞれの勾配または更新量の累積を集約し、集約した値の平均を全演算ノードで共有し、集約した値の平均でそれぞれのNNのパラメータを更新する。
 上記の実施の形態は、単純パーセプトロンや多層パーセプトロン等のNN、階層が深いNNであるディープNNなどの学習に適用できる。ディープNNには、例えば、複数の畳込み層とプーリング層及び全結合層を有するコンボリュージョンNN、入力層と出力層が同じサイズのノードを持つオートエンコーダNN、リカレントNNなどが含まれる。
1:ニューラルネットワークシステム、NNシステム
10:メインプロセッサ
13:サブプロセッサモジュール
14:サブプロセッサ、演算ノード
20:ニューラルネットワーク学習プログラム
22:ニューラルネットワークプログラム
24;訓練データ
26:パラメータw
ND_1~ND_4:演算ノード
w1~w4:パラメータ
Δw1~Δw4:パラメータの更新量
Δwr1~Δwr4:累積更新量
Δwr_add:累積更新量の集約値
Δwr_add/4:累積更新量の平均値

Claims (10)

  1.  メモリと、
     前記メモリにアクセスする複数のプロセッサとを有し、
     前記複数のプロセッサそれぞれは、複数回の学習それぞれにおいて、
     訓練データの入力とニューラルネットワーク内のパラメータとに基づいて前記ニューラルネットワークの演算を実行して前記ニューラルネットワークの出力を算出し、前記算出した出力と前記訓練データの教師データとの差分の前記パラメータに対する勾配または前記勾配に基づく更新量を算出し、
     前記勾配または前記更新量の累積が閾値未満でない第1の場合、前記複数のプロセッサが、それぞれ算出した複数の前記勾配または前記更新量の累積を、前記複数のプロセッサ内の他のプロセッサに送信して前記複数の勾配または更新量の累積を集約し、前記集約された勾配または更新量の累積を受信し、前記集約された勾配または更新量の累積で前記パラメータを更新する第1の更新処理を実行し、
     前記勾配または前記更新量の累積が前記閾値未満である第2の場合、前記複数のプロセッサが、前記送信による前記複数の勾配または更新量の累積の集約を行わず、前記複数のプロセッサそれぞれが算出した前記勾配または更新量でそれぞれのパラメータを更新する第2の更新処理を実行する、ニューラルネットワークシステム。
  2.  前記複数のプロセッサそれぞれは、更に、
     前記第1の場合、前記第2の更新処理を連続して行った学習回数が第1の基準回数未満の場合には、前記第2の更新処理を実行する、請求項1に記載のニューラルネットワークシステム。
  3.  前記複数のプロセッサそれぞれは、更に、
     前記第2の場合、前記学習回数が前記第1の基準回数より多い第2の基準回数未満でない場合には、前記第1の更新処理を実行する、請求項2に記載のニューラルネットワークシステム。
  4.  前記複数のプロセッサそれぞれは、更に、
     前記学習回数が前記第1の基準回数未満でなく且つ前記第2の基準回数未満の場合、前記第1の場合に前記第1の更新処理を実行し、前記第2の場合に前記第2の更新処理を実行する、請求項3に記載のニューラルネットワークシステム。
  5.  前記複数のプロセッサそれぞれは、更に、
     前記第2の場合、前記学習回数が前記第2の基準回数未満でない場合には、前記第1の更新処理を実行する、請求項4に記載のニューラルネットワークシステム。
  6.  前記第1の場合では、前記複数のプロセッサそれぞれが算出した複数の勾配または更新量の累積のうち少なくとも1つの勾配または更新量の累積が前記閾値未満でない、請求項1に記載のニューラルネットワークシステム。
  7.  前記複数の勾配または更新量の集約は、前記複数の勾配または更新量の累積を加算すること、前記複数の勾配または更新量の累積の最大値を求めることのいずれかである、請求項1に記載のニューラルネットワークシステム。
  8.  前記集約された勾配または更新量の累積は、前記複数の勾配または更新量を前記第2の更新処理の回数分累積し、前記複数の勾配または更新量の累積を平均化した値である、請求項1に記載のニューラルネットワークシステム。
  9.  複数のプロセッサそれぞれが、複数回の学習それぞれにおいて、
     訓練データの入力とニューラルネットワーク内のパラメータとに基づいて前記ニューラルネットワークの演算を実行して前記ニューラルネットワークの出力を算出し、前記算出した出力と前記訓練データの教師データとの差分の前記パラメータに対する勾配または前記勾配に基づく更新量を算出し、
     前記勾配または前記更新量の累積が閾値未満でない第1の場合、前記複数のプロセッサが、それぞれ算出した複数の前記勾配または前記更新量の累積を、前記複数のプロセッサ内の他のプロセッサに送信して前記複数の勾配または更新量の累積を集約し、前記集約された勾配または更新量の累積を受信し、前記集約された勾配または更新量の累積で前記パラメータを更新する第1の更新処理を実行し、
     前記勾配または前記更新量の累積が前記閾値未満である第2の場合、前記複数のプロセッサが、前記送信による前記複数の勾配または更新量の累積の集約を行わず、前記複数のプロセッサそれぞれが算出した前記勾配または更新量でそれぞれのパラメータを更新する第2の更新処理を実行する、ニューラルネットワークの学習方法。
  10.  ニューラルネットワークの学習を複数のプロセッサに実行させるニューラルネットワークの学習プログラムにおいて、
     前記学習は、
     複数のプロセッサそれぞれが、複数回の学習それぞれにおいて、
     訓練データの入力とニューラルネットワーク内のパラメータとに基づいて前記ニューラルネットワークの演算を実行して前記ニューラルネットワークの出力を算出し、前記算出した出力と前記訓練データの教師データとの差分の前記パラメータに対する勾配または前記勾配に基づく更新量を算出し、
     前記勾配または前記更新量の累積が閾値未満でない第1の場合、前記複数のプロセッサが、それぞれ算出した複数の前記勾配または前記更新量の累積を、前記複数のプロセッサ内の他のプロセッサに送信して前記複数の勾配または更新量の累積を集約し、前記集約された勾配または更新量の累積を受信し、前記集約された勾配または更新量の累積で前記パラメータを更新する第1の更新処理を実行し、
     前記勾配または前記更新量の累積が前記閾値未満である第2の場合、前記複数のプロセッサが、前記送信による前記複数の勾配または更新量の累積の集約を行わず、前記複数のプロセッサそれぞれが算出した前記勾配または更新量でそれぞれのパラメータを更新する第2の更新処理を実行する、ニューラルネットワークの学習プログラム。
PCT/JP2020/000644 2020-01-10 2020-01-10 ニューラルネットワークシステム、ニューラルネットワークの学習方法及びニューラルネットワークの学習プログラム WO2021140643A1 (ja)

Priority Applications (5)

Application Number Priority Date Filing Date Title
PCT/JP2020/000644 WO2021140643A1 (ja) 2020-01-10 2020-01-10 ニューラルネットワークシステム、ニューラルネットワークの学習方法及びニューラルネットワークの学習プログラム
CN202080092251.0A CN114930350A (zh) 2020-01-10 2020-01-10 神经网络系统、神经网络的学习方法以及神经网络的学习程序
EP20912017.9A EP4089586A4 (en) 2020-01-10 2020-01-10 NEURON NETWORK SYSTEM, NEURON NETWORK TRAINING METHOD, AND NEURON NETWORK TRAINING PROGRAM
JP2021569687A JP7453563B2 (ja) 2020-01-10 2020-01-10 ニューラルネットワークシステム、ニューラルネットワークの学習方法及びニューラルネットワークの学習プログラム
US17/832,733 US20220300790A1 (en) 2020-01-10 2022-06-06 Neural network system, neural network learning method, and neural network learning program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2020/000644 WO2021140643A1 (ja) 2020-01-10 2020-01-10 ニューラルネットワークシステム、ニューラルネットワークの学習方法及びニューラルネットワークの学習プログラム

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/832,733 Continuation US20220300790A1 (en) 2020-01-10 2022-06-06 Neural network system, neural network learning method, and neural network learning program

Publications (1)

Publication Number Publication Date
WO2021140643A1 true WO2021140643A1 (ja) 2021-07-15

Family

ID=76787793

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2020/000644 WO2021140643A1 (ja) 2020-01-10 2020-01-10 ニューラルネットワークシステム、ニューラルネットワークの学習方法及びニューラルネットワークの学習プログラム

Country Status (5)

Country Link
US (1) US20220300790A1 (ja)
EP (1) EP4089586A4 (ja)
JP (1) JP7453563B2 (ja)
CN (1) CN114930350A (ja)
WO (1) WO2021140643A1 (ja)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012079080A (ja) 2010-10-01 2012-04-19 Nippon Hoso Kyokai <Nhk> パラメタ学習装置およびそのプログラム
JP2018120470A (ja) 2017-01-26 2018-08-02 日本電気株式会社 通信システム、分散計算システム、ノード、情報共有方法及びプログラム
JP2019109875A (ja) * 2017-12-18 2019-07-04 株式会社東芝 システム、プログラム及び方法
JP2019212111A (ja) * 2018-06-06 2019-12-12 株式会社Preferred Networks 分散学習方法及び分散学習装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200004700A (ko) * 2018-07-04 2020-01-14 삼성전자주식회사 뉴럴 네트워크에서 파라미터를 처리하는 방법 및 장치

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012079080A (ja) 2010-10-01 2012-04-19 Nippon Hoso Kyokai <Nhk> パラメタ学習装置およびそのプログラム
JP2018120470A (ja) 2017-01-26 2018-08-02 日本電気株式会社 通信システム、分散計算システム、ノード、情報共有方法及びプログラム
JP2019109875A (ja) * 2017-12-18 2019-07-04 株式会社東芝 システム、プログラム及び方法
JP2019212111A (ja) * 2018-06-06 2019-12-12 株式会社Preferred Networks 分散学習方法及び分散学習装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4089586A4

Also Published As

Publication number Publication date
US20220300790A1 (en) 2022-09-22
JPWO2021140643A1 (ja) 2021-07-15
EP4089586A4 (en) 2023-02-01
EP4089586A1 (en) 2022-11-16
JP7453563B2 (ja) 2024-03-21
CN114930350A (zh) 2022-08-19

Similar Documents

Publication Publication Date Title
Zhao et al. Synchronization of Markovian complex networks with input mode delay and Markovian directed communication via distributed dynamic event-triggered control
US11481618B2 (en) Optimization apparatus and method for controlling neural network
CN107766936A (zh) 人造神经网络、人造神经元及人造神经元的控制方法
Liu et al. Using neural network function approximation for optimal design of continuous-state parallel–series systems
US5129038A (en) Neural network with selective error reduction to increase learning speed
CN111831354A (zh) 数据精度配置方法、装置、芯片、芯片阵列、设备及介质
CN109284826A (zh) 神经网络处理方法、装置、设备及计算机可读存储介质
CN111638648A (zh) 一种具有比例延迟复杂动态网络的分布式脉冲准同步方法
CN114626516A (zh) 一种基于对数块浮点量化的神经网络加速系统
WO2021140643A1 (ja) ニューラルネットワークシステム、ニューラルネットワークの学習方法及びニューラルネットワークの学習プログラム
JP2023550921A (ja) ニューラル・ネットワークにおける重みに基づく調節
Kwedlo et al. A parallel differential evolution algorithm for neural network training
Cacace et al. A new distributed protocol for consensus of discrete-time systems
CN115409217B (zh) 一种基于多专家混合网络的多任务预测性维护方法
Kumaresan et al. Software reliability modeling using increased failure interval with ANN
JPH076146A (ja) 並列データ処理システム
Dilmen et al. An intelligent hybridization of ABC and LM algorithms with constraint engineering applications
JP2021189727A (ja) 計算機システム、学習方法、および脳型コンピューティングデバイス
Yang et al. Virtual network function placement based on differentiated weight graph convolutional neural network and maximal weight matching
CN116016212B (zh) 一种带宽感知的去中心化联邦学习方法及装置
CN112532464B (zh) 一种跨多数据中心的数据分布式处理加速方法及其系统
Duato et al. GreenLightningAI: An Efficient AI System with Decoupled Structural and Quantitative Knowledge
Liu et al. Fully distributed event‐driven cooperation with unknown parameters under directed graphs
Pathak et al. Studying Data Distribution De-pendencies In Federated Learning
US20220121922A1 (en) System and method for automated optimazation of a neural network model

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

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021569687

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020912017

Country of ref document: EP

Effective date: 20220810