WO2021214863A1 - 分散処理システムおよび分散処理方法 - Google Patents

分散処理システムおよび分散処理方法 Download PDF

Info

Publication number
WO2021214863A1
WO2021214863A1 PCT/JP2020/017173 JP2020017173W WO2021214863A1 WO 2021214863 A1 WO2021214863 A1 WO 2021214863A1 JP 2020017173 W JP2020017173 W JP 2020017173W WO 2021214863 A1 WO2021214863 A1 WO 2021214863A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
distributed
aggregation
processing
processing node
Prior art date
Application number
PCT/JP2020/017173
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/017173 priority Critical patent/WO2021214863A1/ja
Priority to JP2022516509A priority patent/JP7420228B2/ja
Publication of WO2021214863A1 publication Critical patent/WO2021214863A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • 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

Definitions

  • the present invention relates to a distributed processing system and a distributed processing method that perform high-load operations such as learning of a neural network by linking an aggregation processing node and a plurality of distributed processing nodes.
  • inference accuracy is improved by updating the weight of each neuron model (coefficient to be multiplied by the value output by the neuron model in the previous stage) based on the input sample data for the learning target consisting of multi-layered neuron models. do.
  • the mini-batch method is used as a method for improving inference accuracy.
  • a gradient calculation process for calculating a gradient with respect to the weight for each sample data an aggregation process for aggregating the gradients for a plurality of different sample data (summing the gradients obtained for each sample data by weight), and an aggregation process.
  • the weight update process of updating each weight based on the aggregated gradient is repeated.
  • the distributed processing method is used to speed up the gradient calculation processing. Specifically, a plurality of distributed processing nodes are provided, and each node performs gradient calculation processing on different sample data. As a result, the number of sample data that can be processed in a unit time can be increased in proportion to the number of nodes, so that the gradient calculation process can be speeded up (see Non-Patent Document 1).
  • communication from each distributed processing node to the aggregation processing node for aggregating the data (distributed data) obtained for each distributed processing node to the aggregation processing node (communication from each distributed processing node to the aggregation processing node ( Communication (distribution) from the aggregation processing node to the distribution processing node for transferring the aggregation processing (aggregation communication), the aggregation processing of all nodes in the aggregation processing node, and the data (aggregation data) aggregated by the aggregation processing node to each distribution processing node. Communication) and is required.
  • FIG. 18 shows a sequence of distributed processing of deep learning by the prior art.
  • the aggregation processing node 401 performs all-node aggregation processing in which the gradients obtained from each node are added up by weight, and in the period IV, the aggregation data is transmitted to each distributed processing node 400 [n].
  • each distributed processing node 400 [n] performs weight update processing. By performing the distributed processing in this way, each processing time of the aggregate communication (II), the all-node aggregation process (III), and the distributed communication (IV) is added to the deep learning.
  • Such processing time is unnecessary in a system in which deep learning is performed by a single node, and is a factor that reduces the processing speed in performing distributed processing of deep learning.
  • deep learning has been applied to more complex problems, and the total number of weights tends to increase. Therefore, the amount of distributed data and aggregated data has increased, and the aggregated communication time and the distributed communication time have increased.
  • the data processing load on the aggregation processing node and the distributed processing node is also increasing due to the increase in the aggregation communication time and the distribution communication time.
  • FIG. 19 shows the relationship between the number of distributed processing nodes and the processing performance of deep learning in the conventional distributed processing system
  • 500 shows the ideal relationship between the number of distributed processing nodes and the processing performance (performance ⁇ number of nodes).
  • 501 show the actual relationship between the number of distributed processing nodes and processing performance.
  • Non-Patent Document 2 a method of reducing the data processing load on the aggregation processing node and the distributed processing node when the total number of weights increases.
  • the calculation model used in deep learning is divided into a plurality of calculation devices such as GPUs (graphics processing units) to reduce the processing load per single calculation device.
  • communication processing for arithmetic data and communication processing for distributed deep learning compete between the divided arithmetic devices in the node, resulting in a decrease in processing speed.
  • the present invention has been made in consideration of the above circumstances, and an object of the present invention is an enormous model such as a neural network in a distributed processing system including an aggregation processing node and a plurality of distributed processing nodes. It is an object of the present invention to provide a distributed processing system and a distributed processing method that can improve the learning efficiency of a model when an arithmetic method for dividing a node is adopted, reduce the processing load of a node, and operate efficiently and stably. ..
  • the distributed processing system of the present invention includes an aggregation processing node and N (N is an integer of 2 or more) distributed processing nodes, and each distributed processing node is divided into L L (L is 2) of the model to be calculated.
  • the aggregation processing node includes L arithmetic communication elements configured to perform operations on blocks (the above integers), and the aggregation processing node includes L aggregation processing function units configured to perform operations for each block.
  • the i-th arithmetic communication element of each distributed processing node receives the packet transmitted from the i-th aggregation processing function unit of the aggregation processing node, and the aggregated data R i [m i ] a fifth step of acquiring the sequence numbers m i, i-th of said operational communication device of each distributed processing nodes, the aggregated data R i [parameters of the i-th of said block based on m i] w
  • the sixth step of updating i [ mi ] and the i-th arithmetic communication element of each distributed processing node are connected to the i-th aggregate processing function unit of the aggregation processing node with the distributed data D i [mi
  • the dispersion data in the period n] from the start transmission until you get the M i pieces of the aggregate data R i [m i], have obtained the data amount of the transmitted distributed data D i [m i, n] monitoring the unreceived data amount which is the difference between the data amount of the aggregate data R i [m i], the unreceived data amount not less than the threshold value Ma i (Ma i is M i is smaller than a positive integer) becomes In some cases, the dispersion data according to the first step.
  • the process of transmitting distributed data from each distributed processing node to each distributed processing node and the process of transmitting aggregated data from each distributed processing node to each distributed processing node can be performed at the same time, and effective distribution can be performed. Since the processing can be performed, the learning efficiency of the model can be improved.
  • each processing a communication element in each distributed processing node monitors the unreceived data amount, If this unreceived data amount is equal to or greater than the threshold value Ma i, data not receive the transmission of the distributed data by stopping until the amount is less than the threshold value Mb i, can be distributed transient processing load on aggregation processing node by suppressing transient distributed data concentration on aggregation processing node, effective and more stable dispersion Since the processing can be performed, the learning efficiency and stability when the arithmetic method for dividing the model is adopted can be improved.
  • FIG. 1 is a block diagram showing a configuration example of a distributed processing system for deep learning according to the first embodiment of the present invention.
  • FIG. 2 is a block diagram showing a configuration example of an aggregation processing node and a distributed processing node of the distributed processing system for deep learning according to the first embodiment of the present invention.
  • FIG. 3 is a flowchart illustrating sample data input processing, gradient calculation processing, and in-node aggregation processing in the first arithmetic communication element of the distributed processing node according to the first embodiment of the present invention.
  • FIG. 1 is a block diagram showing a configuration example of a distributed processing system for deep learning according to the first embodiment of the present invention.
  • FIG. 2 is a block diagram showing a configuration example of an aggregation processing node and a distributed processing node of the distributed processing system for deep learning according to the first embodiment of the present invention.
  • FIG. 3 is a flowchart illustrating sample data input processing, gradient calculation processing, and in-node aggregati
  • FIG. 4 is a flowchart illustrating sample data input processing, gradient calculation processing, and in-node aggregation processing in arithmetic communication elements other than the first of the distributed processing nodes according to the first embodiment of the present invention.
  • FIG. 5 is a flowchart illustrating the aggregated communication process of the distributed processing node according to the first embodiment of the present invention.
  • FIG. 6 is a flowchart illustrating the aggregated communication process of the aggregated processing node according to the first embodiment of the present invention.
  • FIG. 7 is a flowchart illustrating all node aggregation processing of the aggregation processing node according to the first embodiment of the present invention.
  • FIG. 8 is a flowchart illustrating the distribution communication processing of the aggregation processing node according to the first embodiment of the present invention.
  • FIG. 9 is a flowchart illustrating the distributed communication process of the distributed processing node according to the first embodiment of the present invention.
  • FIG. 10 is a diagram showing a transition of the amount of unreceived data of the distributed processing node according to the first embodiment of the present invention.
  • FIG. 11 is a flowchart illustrating the operation of the transmission control unit of the distributed processing node according to the first embodiment of the present invention.
  • FIG. 12 is a flowchart illustrating the weight update process of the distributed processing node according to the first embodiment of the present invention.
  • FIG. 13 is a diagram showing a processing sequence of the aggregation processing node and the distributed processing node according to the first embodiment of the present invention.
  • FIG. 14 is a diagram illustrating the effect of transmission control of the distributed processing node in the first embodiment of the present invention.
  • FIG. 15 is a diagram showing a sequence of overall processing of a plurality of aggregation processing function units of the aggregation processing node and a plurality of arithmetic communication elements of the distributed processing node according to the first embodiment of the present invention.
  • FIG. 16 is a block diagram showing a configuration example of an aggregation processing node according to a second embodiment of the present invention.
  • FIG. 17 is a block diagram showing a configuration example of a computer that realizes an aggregation processing node and a distributed processing node according to the first and second embodiments of the present invention.
  • FIG. 18 is a diagram showing a sequence of conventional deep learning distributed processing.
  • FIG. 19 is a diagram showing the relationship between the number of distributed processing nodes and the processing performance of deep learning in a conventional distributed processing system.
  • FIG. 1 is a block diagram showing a configuration example of a distributed processing system for deep learning according to the first embodiment of the present invention.
  • Each distributed processing node 200 [n] is connected to the aggregation processing node 100 by a network 300 capable of bidirectional communication.
  • the "node” means a device such as a server, an arithmetic element, or a communication card distributed on a network.
  • the network 300 is depicted as a one-to-many connection configuration in which the aggregation processing node 100 is at the apex and the distributed processing nodes 200 [n] are connected in a tree shape, but the network 300 is not particularly limited to the tree structure. Needless to say, the network may have any configuration as long as the aggregation processing node 100 and the distributed processing node 200 [n] can directly and indirectly communicate in both directions.
  • the network 300 may be a part of an in-node bus communication network composed of a plurality of node function units in the node. That is, the node function unit corresponding to the aggregation processing node 100 and the node function unit corresponding to the distributed processing node 200 [n] may coexist in the node.
  • a neural network composed of a plurality of layers from an input layer to an output layer is divided into L blocks (L is an integer of 2 or more) in units of one layer or a plurality of layers. That is, each block consists of one or more layers. The number of layers contained in each block may be different.
  • FIG. 2 is a block diagram showing a configuration example of the aggregation processing node 100 and the distributed processing node 200 [n].
  • Each distributed processing node 200 [n] is composed of L arithmetic communication elements 201 [i] assigned to L blocks of the model to be calculated.
  • the arithmetic communication element 201 [1] assigned to the first block counting from the input side of the model to be calculated receives sample data for learning from a data collection node (not shown) for the distributed processing node 200 [n].
  • the sample input unit 202 and the gradient calculation processing unit 203 [1] that calculates the parameter gradient of the loss function of the model for each of the weights (parameters) of the first block when the sample data is input.
  • In-node aggregation processing unit 204 [1] that generates and holds distributed data that is a numerical value that aggregates the parameter gradients for each sample data, and the aggregation processing function of the aggregation processing node 100 that packets the distributed data.
  • the update processing unit 207 [1] that updates the parameters of the first block based on the aggregated data, the first block 208 [1] that constitutes the model constructed by software, and the transmission unit 205 [1].
  • the amount of unreceived data which is the difference between the reception counting unit 210 [1] that counts the data amount (number) of the acquired aggregated data, and the data amount of the distributed distributed data that has been transmitted and the data amount of the acquired aggregated data.
  • the amount of unreceived data exceeds the threshold Ma 1 , the transmission of distributed data is stopped until the amount of unreceived data falls below the threshold Mb 1 (Mb 1 ⁇ Ma 1). It has [1].
  • the gradient calculation processing unit 203 [h] that calculates the parameter gradient of the loss function of the model for each sample data, and the distribution data that is a numerical value that aggregates the parameter gradients for each sample data are generated for each parameter.
  • the receiving unit 206 [h] that receives the packet transmitted from the aggregation processing function unit 101 [h] and acquires the aggregated data, and the update processing unit 207 [h] that updates the parameters of the hth block based on the aggregated data.
  • the h-th block 208 [h] that constitutes the model constructed by software, and the data amount (number) of the distributed data that has been transmitted by the transmission unit 205 [h] and is included in the transmission unit 205 [h].
  • the reception count unit 210 [h] which is included in the reception unit 206 [h] and counts the amount (number) of the acquired aggregated data of the reception unit 206 [h].
  • the unreceived data amount which is the difference between the data amount of the transmitted distributed data amount and the acquired data compiled data
  • the unreceived data amount is equal to or greater than the threshold value Ma h
  • dispersion the transmission of data to the non-received data amount is less than the threshold value Mb h (Mb h ⁇ Ma h ) and a transmission control unit 211 [h] to stop.
  • the calculation result of the first arithmetic communication element 201 [1] for the input sample data is sent to the second arithmetic communication element 201 [2] via the bus 212, and the calculation is performed.
  • the calculation result of the arithmetic communication element 201 [2] that inputs the calculation result received from the communication element 201 [1] is sent to the third arithmetic communication element 201 [3] via the bus 212, and so on.
  • the output value of the neural network is obtained by sending the calculation results in order from 201 [1] to the arithmetic communication element 201 [L]. In the process of obtaining this output value, since the calculation is performed in order from the block on the input side of the neural network to the block on the output side, this process is called forward propagation.
  • the gradient of the loss function which is an index of how much the output value of the neural network deviates from the correct answer (teacher data), is obtained for each of the constituent parameters (weights) of the neural network.
  • the calculation result of the L-th arithmetic communication element 201 [L] is sent to the (L-1) th arithmetic communication element 201 [L-1] via the bus 212, and is sent from the arithmetic communication element 201 [L].
  • Computational communication such that the calculation result of the arithmetic communication element 201 [L-1] that receives the received calculation result as an input is sent to the (L-2) th arithmetic communication element 201 [L-2] via the bus 212.
  • the gradient of the loss function of the entire neural network is calculated.
  • the gradient is calculated in order from the output side block to the input side block of the neural network, so this process is called back propagation.
  • FIG. 3 is a flowchart illustrating sample data input processing, gradient calculation processing, and in-node aggregation processing in the first arithmetic communication element 201 [1] of the distributed processing node 200 [n]
  • the present invention is not limited to a method of collecting sample data by a data collection node and a method of distributing the collected sample data into N sets and distributing them to each distributed processing node 200 [n]. It can be applied regardless of the method of.
  • M 1 is an integer of 2 or more
  • M 1 1, ⁇ , M 1
  • the gradient G [m 1 , n, s] of the loss function is calculated for each sample data x [n, s].
  • M h is an integer of 2 or more
  • the gradient calculation processing unit 203 [1] of the arithmetic communication element 201 [1] calculates the output value of the block 208 [1] of the neural network for each sample data x [n, s] (FIG. 3 steps S101). Subsequently, the gradient calculation processing unit 203 [1] transmits the calculation result to the adjacent second arithmetic communication element 201 [2] (step S102 in FIG. 3).
  • the gradient calculation processing unit 203 [h] of the arithmetic communication element 201 [h] receives the calculation result of the output value from the adjacent (h-1) th arithmetic communication element 201 [h-1] (FIG. 4, step S200). ).
  • the gradient calculation processing unit 203 [h] takes the received calculation result as an input and calculates the output value of the block 208 [h] of the neural network for each sample data x [n, s] (step S201 in FIG. 4). Subsequently, the gradient calculation processing unit 203 [h] transmits the calculation result to the adjacent (h + 1) th arithmetic communication element 201 [h + 1] (step S202 in FIG. 4).
  • the process of step S202 is not performed because the arithmetic communication element having the next number does not exist.
  • the gradient calculation processing unit 203 [h] of the arithmetic communication element 201 [h] starts with the gradient calculation result G [m h + 1 , n, s] from the adjacent (h + 1) th arithmetic communication element 201 [h + 1]. ] Is received (FIG. 4, step S203).
  • the gradient calculation unit 203 [h] using the received gradient G [m h + 1, n , s], the layers in the block 208 [h] of the neural network M h number of weights w h [ For each of m h ], the gradient G [m h , n, s] of the loss function is calculated for each sample data x [n, s] (step S204 in FIG. 4).
  • the process of step S203 is not performed because the arithmetic communication element having the next number does not exist.
  • the gradient calculation unit 203 [L] is the calculation result with the correct output values of the block 208 [L] of the neural network by using the (teacher data), the layers in the block 208 [L] M L-number of weights w
  • the gradient G [ mL , n, s] of the loss function is calculated for each sample data x [n, s].
  • the gradient calculation processing unit 203 [1] of the arithmetic communication element 201 [1] receives the gradient calculation result G [m 2 , n, s] from the second adjacent arithmetic communication element 201 [2]. (FIG. 3 step S103). Then, the gradient calculation processing unit 203 [1] uses the received gradient G [m 2 , n, s] to weight w 1 [m 1 ] of M 1 layers in the block 208 [1] of the neural network. ], The gradient G [m 1 , n, s] of the loss function is calculated for each sample data x [n, s] (step S104 in FIG. 3).
  • the distributed data D i [ mi , n] which is the aggregated numerical value of i, n, s], is generated and held for each weight w i [ mi ] (step S105 in FIG. 3 and step S205 in FIG. 4).
  • the gradient calculation process by the gradient calculation processing unit 203 [i] and the in-node aggregation process by the in-node aggregation processing unit 204 [i] are pipelined in sample data units (gradient calculation processing for a certain sample data). At the same time, the in-node aggregation process that aggregates the gradient obtained from the previous sample data can be executed at the same time).
  • the aggregation communication packet transmission until an aggregation communication packet transmission complete, distributed data D i [m i, n] after sorting is complete, transmitted distributed data D i from the start of transmission [m i, The number Mt i of [ n] (Mt i is a positive integer less than or equal to M i) is counted.
  • Pg i th aggregation communication packet SP i [Pg i, n] for, after (M i -Lg i ⁇ (Pg i -1)) pieces of distributed data D i [u, n], ⁇ Lg i - (M i- Lg i x (Pg i -1)) ⁇ may be added so that all aggregated communication packets store Lg i data equally.
  • the transmission count unit 209 [i] in the transmission unit 205 [i] has all Pg i aggregate communication packet SPs from the start of transmission of the first aggregate communication packet SP i [1, n]. i [p i, n] until completion of transmission of (in step S303 YES), the transmitted distributed data D i [m i, n] to count the number Mt i (Fig. 5 step S303).
  • the timing of starting the processing shown in the chart of FIG. 5 is performed in the order of the arithmetic communication element 201 [L] to 201 [L-1], 201 [L-2], ..., And the arithmetic communication element. It is the last time that the process of FIG. 5 is started in 201 [1].
  • the distributed data DL [ mL , n] is calculated first by the arithmetic communication element 201 [L], and finally distributed by the arithmetic communication element 201 [1]. This is because the data D 1 [m 1 , n] is calculated.
  • FIG. 6 is a flowchart illustrating the aggregated communication process of the aggregated processing node 100.
  • the processing start timing shown in the chart of FIG. 6 is performed in the order of aggregation processing function unit 101 [L] to 101 [L-1], 101 [L-2], ..., And aggregation processing. It is the last time that the processing of FIG. 6 is started by the functional unit 101 [1]. The reason is the same as in the case of FIG.
  • Distributed data D i [ mi , n] (YES in step S402 of FIG. 7), and then distributed data D of the arithmetic communication element 201 [i] of all the acquired distributed processing nodes 200 [n].
  • aggregation process is a process of calculating the variance data D i [m i, n] obtained in the order of number m i based on the aggregate data R i [m i]. Therefore, aggregation processing function unit 101 of the aggregation processing node 100 [i] can generate the aggregate data R i [mi] to the order of the numbers m i.
  • FIG. 8 is a flowchart illustrating the distribution communication processing of the aggregation processing node 100.
  • the distributed communication packet DP i [ps i , n] transmitted to the ps i th (ps i 1, ..., Ps i ) toward the arithmetic communication element 201 [i] of the distributed processing node 200 [n].
  • the receiving unit 206 [i] of each distributed processing node 200 [n] is generated by the aggregation processing function unit 101 [i] of the aggregation processing node 100 from the received distribution communication packet DP i [ pi, n].
  • the reception count unit 210 of the receiving unit 206 [i] [i] is between the first distribution communication packet DP i [1, n] of the reception start to the acquisition completion of M i pieces all aggregated data ( 9 step S503 YES), the number Mr i (Mr i of acquired data compiled R i [m i] counts the following positive integer) M i (FIG. 9 step S502).
  • FIG. 10 is a diagram showing a transition of the amount of unreceived data of the distributed processing node 200 [n]
  • FIG. 11 is a flowchart illustrating the operation of the transmission control unit 211 [i].
  • the vertical axis of FIG. 10 is unreceived data amount Md i, the horizontal axis is the monitor time t.
  • the amount of unreceived data Md i is an amount equivalent to the difference between the count values of the transmission count unit 209 [i] and the reception count unit 210 [i] (Mt i- Mr i ) or (Mt i- Mr i). Is.
  • the transmission stop threshold Ma i the unreceived data amount Md i is a predetermined (Ma i is M i is smaller than a positive integer) becomes equal to or larger than (YES in FIG. 11 step S504 ),
  • the transmission control unit 211 [i] of the arithmetic communication element 201 [i] of the distributed processing node 200 [n] issues a transmission stop instruction to the transmission unit 205 [i] of the arithmetic communication element 201 [i]. (FIG. 11 step S505).
  • the transmission of the aggregated communication packet SP i [ pi , n] from the arithmetic communication element 201 [i] (step S301 in FIG. 5) is stopped.
  • the unreceived data amount Md i is a transmission stop threshold Ma i or the monitor time tb, aggregation communication packet SP i [p i, n] transmission is stopped.
  • the transmission of the aggregated communication packet SP i [ pi , n] from the arithmetic communication element 201 [i] (step S301 in FIG. 5) is restarted.
  • the unreceived data amount Md i becomes less transmission restart threshold Mb i in the monitor time tc, aggregation communication packet SP i [p i, n] transmission is resumed.
  • transient data concentration on the aggregation processing node 100 has been described. However, to give more detailed examples, it is within the distributed processing node 200 [n] or the distributed processing node 200.
  • Processing delays occur due to various factors such as delays due to packet accumulation in a packet buffer that absorbs clock speed differences, or processing delays due to memory band rate-determining when acquiring data from memory.
  • the configuration of this embodiment can be adapted to any range of such processing delays.
  • a processing delay occurs to the extent that aggregated communication packets cannot be accumulated in the packet buffer of the aggregation processing node 100, frame loss occurs due to buffer overflow, and the missing frame is the cause. May stop processing or give incorrect results.
  • the transmission control in the calculation communication device 201 [i] of the distributed processing nodes 200 [n] in accordance with the size of the unreceived data amount Md i, of the aggregation processing node 100 The transmission of the arithmetic communication element 201 [i] can be stopped before the packet loss in the packet buffer occurs. As a result, packet loss can be eliminated, processing delays due to unstable operations such as processing stoppage of the aggregation processing node 100 and incorrect results can be avoided, and efficient and stable processing operations can be performed. Become.
  • Weight in the update process indicated by the aggregation data R i [m i], the weights w i as the loss function is minimized based on the slope of the loss function [m i] may be updated for each number m i. Since updating the weight w i [ mi ] is a well-known technique, detailed description thereof will be omitted.
  • the weight updating process is a process based on a weight w i [m i] of number m i aggregated data R i obtained in the order of [m i], and updates the weights w i [m i] .. Therefore, calculation communication devices 201 of each distributed processing nodes 200 [n] [i] is the weight update processing for the weights w i [m i], can be performed in the order of number m i.
  • each distributed processing node 200 [n] receives sample data for the next mini-batch learning from a data collection node (not shown), and repeats the mini-batch learning process described above to divide the blocks 208 [i]. Improves the inference accuracy of a neural network consisting of.
  • FIG. 13 From here, using FIG. 13, first, a sequence composed of aggregate communication processing, all-node aggregation processing, distributed communication processing, and weight update processing and its effect will be described, and then, using FIG. 14, FIG. 14 will be used to describe the present embodiment. A new effect of transmission control (transmission stop, transmission restart) of the distributed processing node 200 [n] will be described.
  • aggregation processing function unit 101 [i] packetizes the weight w i [m i] M i pieces generated in the order of number m i of the aggregate data R i [m i] in the order of number m i transmitted to the corresponding arithmetic communication device 201 [i] in the distributed processing node 200 [n], calculating the communication device 201 [i] is, M i pieces of aggregate data R i [m i] a number m i
  • the distributed communication process of acquiring in order is performed.
  • aggregate communication processing, all-node aggregation processing, distribution communication processing, and weight update processing can be performed in parallel at almost the same time (in a pipeline) until each communication or each process is completed.
  • the processing time can be significantly reduced.
  • the aggregation processing function unit 101 [i] is when performing all the nodes aggregation process, the weights w i [m i] than even number m i of small weights w i in all nodes aggregation process [m i] Regarding the aggregated data R i [ mi ] that has been aggregated, the aggregation processing function unit 101 [i] and the receiving unit 206 [i] of the arithmetic communication element 201 [i] of each distributed processing node 200 [n] are shown in FIG. The distributed communication process described with reference to FIG. 9 is performed.
  • the distributed communication processing is in progress.
  • the update processing unit 207 [i] of i] performs the weight update process described with reference to FIG.
  • the time of T + ⁇ is sufficient.
  • the update of the weight w i [ mi ] is completed from the time when the arbitrary distributed processing node 200 [n] transmits the arbitrary distributed data Di [ mi , n] to the aggregation processing node 100. It is the delay time until it is done.
  • the time ⁇ is sufficiently small time when compared to T. Therefore, in the present embodiment, it is possible to reduce the time required for the aggregate communication process, the all-node aggregation process, the distribution communication process, and the weight update process to about 1/4 as compared with the conventional technique.
  • FIG. 14 shows an arithmetic communication element when a processing delay occurs in the aggregation processing function unit 101 [i] of the aggregation processing node 100 and the arithmetic communication element 201 [i] of each distributed processing node 200 [n] performs transmission control.
  • the communication between 201 [i] and the aggregate processing function unit 101 [i] is shown.
  • Each distributed communication packet indicated by each of the arrows 131 from [i] to the arithmetic communication element 201 [i] includes aggregated data having a data amount of 1.
  • aggregated communication packets are continuously transmitted from the arithmetic communication element 201 [i] of each distributed processing node 200 [n], and the second aggregated communication packet is received by the aggregated processing function unit 101 [i].
  • the first distributed communication packet is transmitted from the aggregation processing function unit 101 [i] to the arithmetic communication element 201 [i], and then the second distributed communication packet is transmitted.
  • the load on the aggregated processing function unit 101 [i] becomes high, so that the transmission of the third distributed communication packet is delayed.
  • the 10th aggregate communication packet is continuously transmitted from the arithmetic communication element 201 [i]. There is.
  • the eighth aggregated communication packet is transmitted from the arithmetic communication element 201 [i]
  • the aggregation processing function unit 101 [i] continuously transmits up to the second distributed communication packet, but the transmission of the third distributed communication packet is a processing delay indicated by the arrow 132 in FIG. I was late.
  • the ninth aggregation communication packet from the arithmetic communication device 201 [i] is sent, although the unreceived data amount Md i remain 7, tA i timing calculation communication devices 201 in FIG. 14
  • the 10th aggregated communication packet is transmitted from [i]
  • the amount of unreceived data Md i is counted up by 1 because the 3rd distributed communication packet from the aggregated processing function unit 101 [i] has not arrived.
  • Md i 8.
  • transmission stop instruction is issued to the transmitting unit 205 [i] from the transmission control unit 211 of the operation the communication device 201 [i] [i], The aggregated communication packet transmission of the arithmetic communication element 201 [i] is stopped.
  • the third distributed communication packet transmitted from the aggregate processing function unit 101 [i] is delayed and the third distributed communication packet is transferred to the arithmetic communication element 201 [i].
  • the non-received data amount Md i 7.
  • the aggregation communication packet does not reach the aggregation processing function unit 101 [i] due to the transmission stop of the arithmetic communication element 201 [i], and the aggregation is performed.
  • the processing by the processing function unit 101 [i] is lighter.
  • the distribution communication packet is continuously transmitted from the aggregation processing function unit 101 [i].
  • the transmission control unit 211 [i] of the arithmetic communication element 201 [i] issues a transmission resumption instruction to the transmission unit 205 [i].
  • the aggregated communication packet arriving at the aggregated processing function unit 101 [i] it is the 11th to 19th after resuming the aggregated communication packet transmission from the arithmetic communication element 201 [i] of the distributed processing node 200 [N].
  • the aggregated communication packet continuously arrives at the aggregated processing function unit 101 [i].
  • the distributed communication packet is transmitted from the aggregated processing function unit 101 [i].
  • the load of the aggregation processing function unit 101 [i] becomes heavy again, and the distribution communication packet transmission is delayed. That is, after the 13th distributed communication packet is transmitted from the aggregation processing function unit 101 [i], the transmission of the next 14th distributed communication packet is delayed by the processing delay indicated by the arrow 133 in FIG.
  • the distributed communication packet from the aggregation processing function unit 101 [i] does not arrive due to the delay at the timing when the 20th aggregate communication packet is transmitted from the arithmetic communication element 201 [i].
  • an M i 20
  • the difference between the transmission data amount and the reception data amount, i.e., monitoring the unreceived data amount Md i, transmission By controlling the above, the transient load on the aggregation processing function unit 101 [i] of the aggregation processing node 100 can be reduced, and stable processing becomes possible.
  • the load on the aggregation processing node 100 becomes heavy, for example, when software intervenes in the processing of the aggregation processing node 100, the CPU (Central Processing Unit) becomes tight due to a large amount of processing. This causes a processing delay.
  • the depth of the FIFO when temporarily storing the packets in a memory such as a receive buffer, so-called FIFO (First In, First Out), before hardware processing. Since the (memory size) is finite, the buffer overflows and the packets to be processed are lost, and the load on the aggregation processing node 100 becomes heavy.
  • the transmission from the arithmetic communication device 201 [i] of the distributed processing nodes 200 [n] Stable processing can be realized by stopping and preventing packet loss due to an increase in the CPU load of the aggregation processing node 100 and a buffer overflow of the FIFO.
  • bottleneck for all parts that become bottlenecks such as internal buses such as PCIe (PCI Express), and various parts such as FIFA, memory, and DMA (Direct Memory Access) transfer installed in other packet processing circuits. It provides a distributed processing method that eliminates the problem.
  • the entire distributed processing around one mini-batch that is, the aggregation processing function units 101 [1] to 101 [L] of the aggregation processing node 100 and the distributed processing node 200 [n] are used with reference to FIG. ], The entire processing of the arithmetic communication elements 201 [1] to 201 [L] will be described again.
  • the i-th aggregation processing function unit 101 [i] in the aggregation processing node 100 and the i-th arithmetic communication element 201 [i] in the distributed processing node 200 [n] are taken as examples. The operation was explained.
  • One mini-batch learning starts from the sample data input process in the first arithmetic communication element 201 [1]. Then, in FIG. 15, from the L-th arithmetic communication element 201 [L] to the first arithmetic communication element 201 [1], the back propagation gradient calculation processing, the aggregation communication processing, the distribution communication processing, and the weight update processing of the neural network are performed. Shows how the pipeline is done in parallel. In this way, the order of processing as a whole is controlled and executed by using software such as a framework that executes the calculation model, a device driver that follows it, and middleware, and high speed is realized in the entire system.
  • FIG. 16 is a block diagram showing a configuration example of the aggregation processing node 100.
  • a receiving unit 10 i [n] for receiving the aggregated communication packet SP i [ pi , n] from is provided for each distributed processing node 200 [n].
  • Each receiving unit 10 i [n] performs the aggregated communication process described with reference to FIG. Specifically, each receiving unit 10 i [n] receives the aggregated communication packet SP i [ pi , n] transmitted by the arithmetic communication element 201 [i] of the corresponding distributed processing node 200 [n].
  • Aggregation communication packet SP i [p i, n] by receiving the distributed data D i [j, n] of the accumulation is performed Pg i times, M i pieces of distributed data D i [m i, n] is It is stored in each receive FIFO buffer 11 i [n].
  • the aggregation processing unit 12 i stores the aggregation data R i [ mi ] generated based on the read distributed data D i [ mi , n] in the distributed communication packet.
  • the distributed communication packet is transmitted from the transmission unit 13 i [n].
  • the aggregation processing unit 12 i distributes the reading of the next distributed data D i [ mi, n]. Holds the communication packet until it can be sent.
  • each transmission unit 13i [n] provided separately for the distributed processing node 200 [n] indicates a transmission permission signal V indicating that the distribution communication packet can be transmitted when the distribution communication packet can be transmitted.
  • i [n] is output to the total processing unit 12 i.
  • Aggregating part 12 i receives the accumulated existence signal U i [n] from the receive FIFO buffer 11 i [n], and a transmission permission signal V i [n] from the transmission unit 13 i [n] , It is determined whether or not to read the distributed data from each received FIFO buffer 11 i [n].
  • the accumulation presence / absence signal U i [n] indicates that the distributed data Di [ mi , n] to be read next is accumulated, and the transmission permission signal V i [n] is indicated. but when showing the read already distributed data D i [m i, n] are generated from the aggregate data R i [m i] deliverable distribution communication packet containing, distributed data D i [m i, n ] Is read from each received FIFA buffer 11 i [n].
  • the aggregating part 12 i is distributed data D i [m i, n] read in the order of the numbers m i from the receive FIFO buffer 11 i [n] based on the aggregate data R i [m i] a number generated in the order of m i, and passes in the aggregation data R i [m i] a number m i transmitting unit 13 i order downstream of the [n].
  • the same aggregated data is passed to each transmission unit 13 i [n].
  • the calculation formula of the aggregated data R i [ mi ] is as shown in the formula (2).
  • a transmission unit 13 i [n] for transmitting a distributed communication packet to each distributed processing node 200 [n] (n 1, ..., N) is provided for each distributed processing node 200 [n].
  • the transmission unit 13 i [n] performs the distribution communication process described with reference to FIG.
  • each transmission unit 13 i [n] sends a transmission permission signal V i [n] to the aggregation processing unit 12 i when the distribution communication packet DP i [ps i, n] can be transmitted. Is output.
  • Each transmitting unit 13i [n] is, Ps i-th distributed communication packet DP i [Ps i, n] for, (M i -Ls i ⁇ ( Ps i -1)) pieces of aggregate data R i [us after], ⁇ Ls i - (M i -Ls i ⁇ (Ps i -1)) ⁇ and add the value of the number of dummy, as all of the distributing communication packet storing equally Ls i pieces of data May be good.
  • the distributed data D i [m i, n] is read from the receive FIFO buffer 11 i [n] in sequence number m i, the read distributed data D i [m i, n] to generate the aggregate data R i [m i] based on. Furthermore, the transmission unit 13 i of the aggregation processing function unit 101 [i] [n] is stored in the distribution communication packets generated aggregation data R i a [m i] in the order of the numbers m i, each distributed processing nodes It is sent to the arithmetic communication element 201 [i] of 200 [n].
  • each distributed processing node 200 [ n] from the distributed data D i [m i, after receiving n], distributed data D i [m i for all nodes, n] aggregation was aggregated data R i [m i] a, each distributed processing node 200 [ The time required to return to n] can be significantly shortened as compared with the conventional technique.
  • calculation communication devices 201 of each distributed processing nodes 200 [n] [i] monitors the unreceived data amount Md i, unreceived data amount Md i is transmitted stops sending aggregation communication packet to be transmitted in the case of more than stop threshold value Ma i to counting processing node 100, non-received data amount Md i after the transmission stop resumes transmission if: transmission resumption threshold Mb i.
  • the aggregation processing node 100 described in the first and second embodiments can be realized by a computer having a CPU, a storage device, and an interface, and a program that controls these hardware resources.
  • a configuration example of this computer is shown in FIG.
  • the computer includes a CPU 600, a storage device 601 and an interface device (I / F) 602.
  • a network 300 or the like is connected to the I / F 602.
  • the CPU 600 executes the processes described in the first and second embodiments according to the program stored in the storage device 601 to realize the distributed processing system and the distributed processing method of the present invention.
  • each of the distributed processing nodes 200 [n] can be realized by a computer.
  • the present invention can be applied to a technique for performing high-load arithmetic such as machine learning of a neural network.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Neurology (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

各分散処理ノード(200[n])の演算通信素子(201[i])は、演算対象のモデルの分割されたブロック(208[i])の重み毎の分散データを集計処理ノード(100)の集約処理機能部(101[i])に送信し、集計データを取得してブロック(208[i])の重みを更新する。集約処理機能部(101[i])は、全分散処理ノードの分散データを重み毎に集計した集計データを各分散処理ノード(200[n])の演算通信素子(201[i])に送信する。演算通信素子(201[i])は、送信済みの分散データと取得済みの集計データのデータ量の差である未受信データ量が閾値(Mai)以上となった場合に、分散データの送信を未受信データ量が閾値(Mbi)以下となるまで停止する。

Description

分散処理システムおよび分散処理方法
 本発明は、集計処理ノードと複数の分散処理ノードとを連携させてニューラルネットワークの学習などの高負荷な演算を行う分散処理システムおよび分散処理方法に関するものである。
 深層学習では、多層のニューロンモデルからなる学習対象について、各ニューロンモデルの重み(前段のニューロンモデルが出力した値に乗じる係数)を、入力したサンプルデータに基づいて更新することにより、推論精度を改善する。
 通常、推論精度を改善する手法には、ミニバッチ法が用いられている。ミニバッチ法では、サンプルデータ毎に前記重みに対する勾配を計算する勾配計算処理と、複数の異なるサンプルデータについて前記勾配を集計する(サンプルデータ毎に得られた勾配を重み別に合算する)集計処理と、各重みを前記集計された勾配に基づいて更新する重み更新処理と、を繰り返す。
 これらの処理、特に勾配計算処理は、多数回の演算を必要とするが、推論精度を向上させるために、重みの個数や入力するサンプルデータの個数が増加すると、深層学習に要する時間が増大するという、課題がある。
 勾配計算処理を高速化するため、分散処理の手法が用いられている。具体的には、複数の分散処理ノードを設け、各ノードは、各々異なるサンプルデータについて勾配計算処理を行う。これにより、ノード数に比例して単位時間に処理できるサンプルデータ数を増加させることが可能となるため、勾配計算処理を高速化できる(非特許文献1参照)。
 深層学習の分散処理において、集計処理を行うためには、分散処理ノード毎に得られたデータ(分散データ)を集計処理ノードに集約するための、各分散処理ノードから集計処理ノードへの通信(集約通信)と、集計処理ノードでの全ノード集計処理と、集計処理ノードが集計したデータ(集計データ)を各分散処理ノードに転送するための、集計処理ノードから分散処理ノードへの通信(分配通信)と、が必要となる。
 図18に、従来技術による、深層学習の分散処理のシーケンスを示す。分散処理ノード400[n](n=1,・・・,N)は、Iの期間においてサンプルデータ入力と勾配計算処理とノード内集計処理とを行い、分散データを集計処理ノード401に送信する。IIの期間では、このような各ノードからの送信が行われるが、各ノードが同時に分散データを送信するとは限らない。
 IIIの期間では、集計処理ノード401が各ノードから得られた勾配を重み別に合算する全ノード集計処理を行い、IVの期間において集計データを各分散処理ノード400[n]に送信する。Vの期間では、各分散処理ノード400[n]が重み更新処理を行う。
 こうして、分散処理が行われることにより、深層学習には、集約通信(II)と全ノード集計処理(III)と分配通信(IV)の各処理時間が加わる。
 このような処理時間は、深層学習を単一ノードで実施するシステムでは不要であり、深層学習の分散処理を行う上で、処理速度を低下させる要因となっている。
 近年、深層学習がより複雑な問題に適用されるようになってきており、重みの総数が増加する傾向にある。このため、分散データや集計データのデータ量が増大し、集約通信時間と分配通信時間が増大している。また、集約通信時間と分配通信時間の増大によって集計処理ノードと分散処理ノードでのデータ処理負荷も増大している。
 図19は、従来の分散処理システムにおける分散処理ノード数と深層学習の処理性能との関係を示しており、500は分散処理ノード数と処理性能の理想的な関係(性能∝ノード数)を示し、501は分散処理ノード数と処理性能の実際の関係を示している。このように、深層学習の分散システムは、集約通信時間と分配通信時間の増大および集計処理ノードと分散処理ノードでのデータ処理負荷の増大によって、各分散処理ノード数を増加させることにより、深層学習の高速化の効果が低下するという問題があった。
 また、重みの総数が増加した際に、集計処理ノードと分散処理ノードでのデータ処理負荷を低減する方法として、モデル分割という方法が知られている(非特許文献2参照)。この方法は、深層学習で用いられる演算モデルを複数のGPU(graphics processing units)などの演算デバイスに分割して、単一の演算デバイス当たりの処理負荷を低減するものである。しかし、本手法を用いると、分割した演算デバイス間で演算データのための通信処理と分散深層学習のための通信処理とがノード内で競合し、処理速度の低下を招いていた。
Takuya Akiba,Shuji Suzuki,Keisuke Fukuda,"Extremely Large Minibatch SGD:Training ResNet-50 on ImageNet in 15 Minutes",米国コーネル大学ライブラリー,arXiv:1711.04325,2017,インターネット<https://arxiv.org/abs/1711.04325> Zhihao Jia,Matei Zaharia,Alex Aiken,"Beyond Data and Model Parallelism for Deep Neural Networks",米国コーネル大学ライブラリー,arXiv: 1807.05358,2018,インターネット<https://arxiv.org/pdf/1807.05358>
 本発明は、上記のような事情を考慮してなされたものであり、その目的は、集計処理ノードと複数の分散処理ノードとを備える分散処理システムおいて、ニューラルネットワークのような巨大化したモデルを分割する演算手法を採用した場合のモデルの学習効率を向上させ、なおかつノードの処理負荷を軽減し、効率的かつ安定に動作することができる分散処理システムおよび分散処理方法を提供することにある。
 本発明の分散処理システムは、集計処理ノードとN個(Nは2以上の整数)の分散処理ノードとを備え、各分散処理ノードは、演算対象のモデルの分割されたL個(Lは2以上の整数)のブロックの演算を行うように構成されたL個の演算通信素子を備え、前記集計処理ノードは、前記ブロック毎の演算を行うように構成されたL個の集約処理機能部を備え、各分散処理ノードのi番目(i=1,・・・,L)の前記演算通信素子は、演算対象のi番目の前記ブロックのMi個(Miは2以上の整数)のパラメータwi[mi]毎(mi=1,・・・,Mi)の分散データDi[mi,n](n=1,・・・,N)をパラメータwi[mi]の番号miの順番にパケット化して前記集計処理ノードのi番目の前記集約処理機能部に送信し、i番目の前記集約処理機能部から送信されたパケットを受信して集計データRi[mi]を番号miの順番に取得して、この集計データRi[mi]に基づいてi番目の前記ブロックのパラメータwi[mi]を更新し、前記集計処理ノードのi番目の前記集約処理機能部は、各分散処理ノードのi番目の前記演算通信素子から送信されたパケットを受信して分散データDi[mi,n]を番号miの順番に取得し、全分散処理ノードのi番目の前記演算通信素子の分散データDi[mi,n]をパラメータwi[mi]毎に集計した前記集計データRi[mi]を生成して、この集計データRi[mi]を番号miの順番にパケット化して各分散処理ノードのi番目の前記演算通信素子に送信し、各分散処理ノードのi番目の前記演算通信素子は、前記集計処理ノードに前記分散データDi[mi,n]を送信開始してからMi個の前記集計データRi[mi]を取得し終えるまでの期間において、送信済みの分散データDi[mi,n]のデータ量と取得済みの集計データRi[mi]のデータ量との差である未受信データ量を監視し、この未受信データ量が閾値Mai以上(MaiはMiより小さい正の整数)となった場合に、前記分散データDi[mi,n]の送信を前記未受信データ量が閾値Mbi(MbiはMaiより小さい正の整数)以下となるまで停止することを特徴とするものである。
 また、本発明の分散処理方法は、N個(Nは2以上の整数)の分散処理ノードの各々に、演算対象のモデルの分割されたL個(Lは2以上の整数)のブロック毎に設けられたL個の演算通信素子の各々が、演算対象のi番目(i=1,・・・,L)の前記ブロックのMi個(Miは2以上の整数)のパラメータwi[mi]毎(mi=1,・・・,Mi)の分散データDi[mi,n](n=1,・・・,N)を重みwi[mi]の番号miの順番にパケット化して集計処理ノードに設けられたi番目の集約処理機能部に送信する第1のステップと、前記集計処理ノードのi番目の前記集約処理機能部が、各分散処理ノードのi番目の前記演算通信素子から送信されたパケットを受信して前記分散データDi[mi,n]を番号miの順番に取得する第2のステップと、前記集計処理ノードのi番目の前記集約処理機能部が、全分散処理ノードの分散データDi[mi,n]をパラメータwi[mi]毎に集計した集計データRi[mi]を生成する第3のステップと、前記集計処理ノードのi番目の前記集約処理機能部が、前記集計データRi[mi]を番号miの順番にパケット化して各分散処理ノードのi番目の前記演算通信素子に送信する第4のステップと、各分散処理ノードのi番目の前記演算通信素子が、前記集計処理ノードのi番目の前記集約処理機能部から送信されたパケットを受信して前記集計データRi[mi]を番号miの順番に取得する第5のステップと、各分散処理ノードのi番目の前記演算通信素子が、前記集計データRi[mi]に基づいてi番目の前記ブロックのパラメータwi[mi]を更新する第6のステップと、各分散処理ノードのi番目の前記演算通信素子が、前記集計処理ノードのi番目の前記集約処理機能部に前記分散データDi[mi,n]を送信開始してからMi個の前記集計データRi[mi]を取得し終えるまでの期間において、送信済みの分散データDi[mi,n]のデータ量と取得済みの集計データRi[mi]のデータ量との差である未受信データ量を監視し、この未受信データ量が閾値Mai以上(MaiはMiより小さい正の整数)となった場合に、前記第1のステップによる前記分散データDi[mi,n]の送信を、前記未受信データ量が閾値Mbi(MbiはMaiより小さい正の整数)以下となるまで停止する第7のステップとを含むことを特徴とするものである。
 本発明によれば、各分散処理ノードから集計処理ノードに分散データを送信する処理と、集計処理ノードから各分散処理ノードに集計データを送信する処理とを同時に行うことができ、効果的な分散処理を行うことができるので、モデルの学習効率を向上させることができる。さらに、本発明では、各分散処理ノード内の各演算通信素子が、未受信データ量を監視し、この未受信データ量が閾値Mai以上となった場合に、分散データの送信を未受信データ量が閾値Mbi以下となるまで停止することにより、集計処理ノードへの過渡的な分散データ集中を抑制することで集計処理ノードに対する過渡的な処理負荷を分散でき、効果的でさらに安定な分散処理を行うことができるので、モデルを分割する演算手法を採用した場合の学習効率および安定度を向上させることができる。
図1は、本発明の第1の実施例に係る深層学習用分散処理システムの構成例を示すブロック図である。 図2は、本発明の第1の実施例に係る深層学習用分散処理システムの集計処理ノードと分散処理ノードの構成例を示すブロック図である。 図3は、本発明の第1の実施例に係る分散処理ノードの1番目の演算通信素子におけるサンプルデータ入力処理と勾配計算処理とノード内集計処理を説明するフローチャートである。 図4は、本発明の第1の実施例に係る分散処理ノードの1番目以外の演算通信素子におけるサンプルデータ入力処理と勾配計算処理とノード内集計処理を説明するフローチャートである。 図5は、本発明の第1の実施例に係る分散処理ノードの集約通信処理を説明するフローチャートである。 図6は、本発明の第1の実施例に係る集計処理ノードの集約通信処理を説明するフローチャートである。 図7は、本発明の第1の実施例に係る集計処理ノードの全ノード集計処理を説明するフローチャートである。 図8は、本発明の第1の実施例に係る集計処理ノードの分配通信処理を説明するフローチャートである。 図9は、本発明の第1の実施例に係る分散処理ノードの分配通信処理を説明するフローチャートである。 図10は、本発明の第1の実施例に係る分散処理ノードの未受信データ量の推移を示す図である。 図11は、本発明の第1の実施例に係る分散処理ノードの送信制御部の動作を説明するフローチャートである。 図12は、本発明の第1の実施例に係る分散処理ノードの重み更新処理を説明するフローチャートである。 図13は、本発明の第1の実施例に係る集計処理ノードと分散処理ノードの処理のシーケンスを示す図である。 図14は、本発明の第1の実施例における分散処理ノードの送信制御の効果を説明する図である。 図15は、本発明の第1の実施例に係る集計処理ノードの複数の集約処理機能部と分散処理ノードの複数の演算通信素子の全体処理のシーケンスを示す図である。 図16は、本発明の第2の実施例に係る集計処理ノードの構成例を示すブロック図である。 図17は、本発明の第1、第2の実施例に係る集計処理ノードと分散処理ノードを実現するコンピュータの構成例を示すブロック図である。 図18は、従来の深層学習の分散処理のシーケンスを示す図である。 図19は、従来の分散処理システムにおける分散処理ノード数と深層学習の処理性能との関係を示す図である。
[第1の実施例]
 以下、本発明の実施例について図面を参照して説明する。図1は本発明の第1の実施例に係る深層学習用分散処理システムの構成例を示すブロック図である。図1の分散処理システムは、1個の集計処理ノード100と、ニューラルネットワークのサンプルデータ(学習データ)の集合毎に設けられたN個(Nは2以上の整数)の分散処理ノード200[n](n=1,・・・,N)とを備える。各分散処理ノード200[n]は、双方向の通信が可能なネットワーク300により、集計処理ノード100と接続されている。
 なお、本発明において、「ノード」とは、ネットワーク上に分散配置されているサーバ、演算素子、通信カード等の機器を意味する。また、ネットワーク300は、集計処理ノード100を頂点に、分散処理ノード200[n]がツリー状に接続された1対多の接続構成として描かれているが、特にツリー構造に限定されるものではなく、集計処理ノード100と分散処理ノード200[n]とが直接、間接を問わず双方向の通信が可能であれば、どのような構成のネットワークであってもよいことは言うまでもない。また、ネットワーク300は、ノード内の複数のノード機能部で構成されるノード内バス通信ネットワークの一部であってもよい。すなわち、ノード内に、集計処理ノード100に相当するノード機能部と分散処理ノード200[n]に相当するノード機能部とが混在する構成でもよい。
 本発明では、入力層から出力層まで複数の層からなるニューラルネットワークを、1層乃至複数層の単位でL個(Lは2以上の整数)のブロックに分割する。すなわち、各ブロックは、1乃至複数の層からなる。各ブロックに含まれる層数は異なっていて構わない。
 図2は集計処理ノード100と分散処理ノード200[n]の構成例を示すブロック図である。集計処理ノード100は、演算対象のモデル(ニューラルネットワーク)のL個のブロックにそれぞれ割り当てられたL個の集約処理機能部101[i](i=1,・・・,L)から構成される。
 各分散処理ノード200[n]は、演算対象のモデルのL個のブロックにそれぞれ割り当てられたL個の演算通信素子201[i]から構成される。
 例えば演算対象のモデルの入力側から数えて1番目のブロックに割り当てられた演算通信素子201[1]は、分散処理ノード200[n]用に図示しないデータ収集ノードから学習用のサンプルデータを受け取るサンプル入力部202と、サンプルデータが入力されたときに、1番目のブロックの重み(パラメータ)の各々について、モデルの損失関数のパラメータ勾配をサンプルデータ毎に計算する勾配計算処理部203[1]と、サンプルデータ毎のパラメータ勾配を集計した数値である分散データをパラメータ毎に生成して保持するノード内集計処理部204[1]と、分散データをパケット化して集計処理ノード100の集約処理機能部101[1]に送信する送信部205[1]と、集計処理ノード100の集約処理機能部101[1]から送信されたパケットを受信して集計データを取得する受信部206[1]と、集計データに基づいて1番目のブロックのパラメータを更新する更新処理部207[1]と、ソフトウェア的に構築されたモデルを構成する1番目のブロック208[1]と、送信部205[1]に内包され、送信部205[1]の送信済みの分散データのデータ量(個数)をカウントする送信カウント部209[1]と、受信部206[1]に内包され、受信部206[1]の取得済みの集計データのデータ量(個数)をカウントする受信カウント部210[1]と、送信済みの分散データのデータ量と取得済みの集計データのデータ量との差である未受信データ量を監視し、この未受信データ量が閾値Ma1以上となった場合に、分散データの送信を未受信データ量が閾値Mb1(Mb1<Ma1)以下となるまで停止する送信制御部211[1]とを備えている。
 演算対象のモデルの入力側から数えてh番目(h=2,・・・,L)のブロックに割り当てられた演算通信素子201[h]は、サンプルデータが入力されたときに、h番目のブロックのパラメータの各々について、モデルの損失関数のパラメータ勾配をサンプルデータ毎に計算する勾配計算処理部203[h]と、サンプルデータ毎のパラメータ勾配を集計した数値である分散データをパラメータ毎に生成して保持するノード内集計処理部204[h]と、分散データをパケット化して集計処理ノード100の集約処理機能部101[h]に送信する送信部205[h]と、集計処理ノード100の集約処理機能部101[h]から送信されたパケットを受信して集計データを取得する受信部206[h]と、集計データに基づいてh番目のブロックのパラメータを更新する更新処理部207[h]と、ソフトウェア的に構築されたモデルを構成するh番目のブロック208[h]と、送信部205[h]に内包され、送信部205[h]の送信済みの分散データのデータ量(個数)をカウントする送信カウント部209[h]と、受信部206[h]に内包され、受信部206[h]の取得済みの集計データのデータ量(個数)をカウントする受信カウント部210[h]と、送信済みの分散データのデータ量と取得済みの集計データのデータ量との差である未受信データ量を監視し、この未受信データ量が閾値Mah以上となった場合に、分散データの送信を未受信データ量が閾値Mbh(Mbh<Mah)以下となるまで停止する送信制御部211[h]とを備えている。
 本実施例のニューラルネットワークでの演算は、入力されたサンプルデータに対する1番目の演算通信素子201[1]の計算結果をバス212を介して2番目の演算通信素子201[2]に送り、演算通信素子201[1]から受信した計算結果を入力とする演算通信素子201[2]の計算結果をバス212を介して3番目の演算通信素子201[3]に送るというように、演算通信素子201[1]から演算通信素子201[L]へと順に計算結果を送ることにより、ニューラルネットワークの出力値を得る。この出力値を求める工程では、ニューラルネットワークの入力側のブロックから出力側のブロックに向かって順番に演算していくことから、この工程を順伝搬(forward propagation)と呼ぶ。
 次に、ニューラルネットワークの出力値が正解(教師データ)からどれだけ乖離しているかの指標となる損失関数の勾配を、ニューラルネットワークの構成パラメータ(重み)の各々について求める。この工程では、L番目の演算通信素子201[L]の計算結果をバス212を介して(L-1)番目の演算通信素子201[L-1]に送り、演算通信素子201[L]から受信した計算結果を入力とする演算通信素子201[L-1]の計算結果をバス212を介して(L-2)番目の演算通信素子201[L-2]に送るというように、演算通信素子201[L]から演算通信素子201[1]へと順に計算結果を送ることにより、ニューラルネットワーク全体の損失関数の勾配の計算を行う。この勾配を求める工程では、ニューラルネットワークの出力側のブロックから入力側のブロックに向かって順番に勾配を計算していくことから、この工程を逆伝搬(back propagation)と呼ぶ。
 図3は分散処理ノード200[n]の1番目の演算通信素子201[1]におけるサンプルデータ入力処理と勾配計算処理とノード内集計処理を説明するフローチャート、図4は分散処理ノード200[n]のh番目(h=2,・・・,L)の演算通信素子201[h]におけるサンプルデータ入力処理と勾配計算処理とノード内集計処理を説明するフローチャートである。
 各分散処理ノード200[n](n=1,・・・,N)の演算通信素子201[1]のサンプル入力部202は、図示しないデータ収集ノードから異なるS個(Sは2以上の整数)のサンプルデータx[n,s](s=1,・・・,S)をミニバッチ毎に入力する(図3ステップS100)。
 なお、本発明は、データ収集ノードによるサンプルデータの収集方法、および収集したサンプルデータをN個の集合に振り分けて各分散処理ノード200[n]へ分配する方法に限定されるものではなく、これらの方法の如何を問わず適用が可能である。
 各分散処理ノード200[n](n=1,・・・,N)の演算通信素子201[1]の勾配計算処理部203[1]は、サンプルデータx[n,s]が入力されたとき、ニューラルネットワークのブロック208[1]内の層のM1個(M1は2以上の整数)の重みw1[m1](m1=1,・・・,M1)の各々について、損失関数の勾配G[m1,n,s]をサンプルデータx[n,s]毎に計算する。
 一方、各分散処理ノード200[n]の演算通信素子201[h](h=2,・・・,L)の勾配計算処理部203[h]は、ニューラルネットワークのブロック208[h]内の層のMh個(Mhは2以上の整数)の重みwh[mh](mh=1,・・・,Mh)の各々について、損失関数の勾配G[mh,n,s]をサンプルデータx[n,s]毎に計算する。
 勾配計算処理では、まず演算通信素子201[1]の勾配計算処理部203[1]は、ニューラルネットワークのブロック208[1]の出力値をサンプルデータx[n,s]毎に計算する(図3ステップS101)。続いて、勾配計算処理部203[1]は、計算結果を隣接する2番目の演算通信素子201[2]に送信する(図3ステップS102)。
 演算通信素子201[h]の勾配計算処理部203[h]は、隣接する(h-1)番目の演算通信素子201[h-1]から出力値の計算結果を受信する(図4ステップS200)。勾配計算処理部203[h]は、受信した計算結果を入力として、ニューラルネットワークのブロック208[h]の出力値をサンプルデータx[n,s]毎に計算する(図4ステップS201)。続いて、勾配計算処理部203[h]は、計算結果を隣接する(h+1)番目の演算通信素子201[h+1]に送信する(図4ステップS202)。なお、演算通信素子201[L]については、次の番号の演算通信素子が存在しないため、ステップS202の処理は行われない。
 次に、演算通信素子201[h]の勾配計算処理部203[h]は、隣接する(h+1)番目の演算通信素子201[h+1]から勾配の計算結果G[mh+1,n,s]を受信する(図4ステップS203)。そして、勾配計算処理部203[h]は、受信した勾配G[mh+1,n,s]を用いて、ニューラルネットワークのブロック208[h]内の層のMh個の重みwh[mh]の各々について、損失関数の勾配G[mh,n,s]をサンプルデータx[n,s]毎に計算する(図4ステップS204)。
 なお、演算通信素子201[L]については、次の番号の演算通信素子が存在しないため、ステップS203の処理は行われない。勾配計算処理部203[L]は、ニューラルネットワークのブロック208[L]の出力値の計算結果と正解(教師データ)とを用いて、ブロック208[L]内の層のML個の重みwL[mL]の各々について、損失関数の勾配G[mL,n,s]をサンプルデータx[n,s]毎に計算する。
 次に、演算通信素子201[1]の勾配計算処理部203[1]は、隣接する2番目の演算通信素子201[2]から勾配の計算結果G[m2,n,s]を受信する(図3ステップS103)。そして、勾配計算処理部203[1]は、受信した勾配G[m2,n,s]を用いて、ニューラルネットワークのブロック208[1]内の層のM1個の重みw1[m1]の各々について、損失関数の勾配G[m1,n,s]をサンプルデータx[n,s]毎に計算する(図3ステップS104)。
 なお、ニューラルネットワークを各分散処理ノード200[n]にソフトウェアで構築する方法、重みwi[mi]、損失関数、および損失関数の勾配G[mi,n,s]については周知の技術であるので、詳細な説明は省略する。
 続いて、各分散処理ノード200[n]の演算通信素子201[i](i=1,・・・,L)のノード内集計処理部204[i]は、サンプルデータ毎の勾配G[mi,n,s]を集計した数値である分散データDi[mi,n]を、重みwi[mi]毎に生成して保持する(図3ステップS105、図4ステップS205)。分散データDi[mi,n]の計算式は以下のとおりである。
 Di[mi,n]=Σs=1,…,Si[mi,n,s]     ・・・(1)
 なお、勾配計算処理部203[i]による勾配計算処理とノード内集計処理部204[i]によるノード内集計処理とは、サンプルデータ単位でパイプライン化する(あるサンプルデータに対して勾配計算処理を行うと同時にその1つ前のサンプルデータから得た勾配を集計するノード内集計処理とを同時に実行する)ことができる。
 図5は分散処理ノード200[n](n=1,・・・,N)の集約通信処理を説明するフローチャートである。各分散処理ノード200[n]の演算通信素子201[i]の送信部205[i](i=1,・・・,L)は、重みwi[mi]毎の分散データDi[mi,n](mi=1,・・・,Mi)を、重みwi[mi]の番号miの順番にパケット化して、集計処理ノード100の中の対応する集約処理機能部101[i]に送信する集約通信を行う。また、集約通信パケット送信では、集約通信パケット送信完までの間、分散データDi[mi,n]の振り分けが完了後、送信開始されてからの送信済みの分散データDi[mi,n]の数Mti(MtiはMi以下の正の整数)をカウントする。
 このとき、各分散処理ノード200[n]の送信部205[i]は、保持するMi個の分散データDi[mi,n](mi=1,・・・,Mi)を、Lgi(Lgiは1以上Mi未満の整数)個ずつPgi個(Pgiは2以上の整数)の集約通信パケットに振り分けて(図5ステップS300)、全ての集約通信パケットを送信し終えるまで(図5ステップS303においてYES)、Pgi個の集約通信パケットを順番に集計処理ノード100の中の対応する集約処理機能部101[i]に送信する(図5ステップS301)。すなわち、pi番目(pi=1,・・・,Pgi)に送信する集約通信パケットSPi[pi,n]には、Lgi個の分散データDi[j,n](j=Lgi×(pi-1)+li、li=1,・・・,Lgi)が格納される。
 なお、MiがLgiで割り切れない条件では、Pgi個目の集約通信パケットSPi[Pgi,n]には、(Mi-Lgi×(Pgi-1))個の分散データDi[u,n](u=Lgi×(Pgi-1)+qi、qi=1,・・・,Mi-Lgi×(Pgi-1))が格納される。
 Pgi番目の集約通信パケットSPi[Pgi,n]については、(Mi-Lgi×(Pgi-1))個の分散データDi[u,n]の後に、{Lgi-(Mi-Lgi×(Pgi-1))}個のダミーの数値を追加し、全ての集約通信パケットが等しくLgi個のデータを格納するようにしてもよい。
 また、上記のとおり、送信部205[i]内の送信カウント部209[i]は、1番目の集約通信パケットSPi[1,n]の送信開始からPgi個の全ての集約通信パケットSPi[pi,n]の送信完了までの間(ステップS303においてYES)、送信済みの分散データDi[mi,n]の数Mtiをカウントする(図5ステップS303)。
 pi番目の集約通信パケットSPi[pi,n]を送信した時点では、送信開始からpi×Lgi個の分散データDi[mi,n]を送信していることになるため、Mtiの値はpi×Lgiである。なお、送信カウント部209[i]は、Pgi個全ての集約通信パケットSPi[pi,n]を送信した時点では、pi×Lgiの値に関わらずMti=Miとする。
 なお、図5のチャートに示した処理の開始のタイミングは、演算通信素子201[L]から201[L-1]、201[L-2]・・・・の順で行われ、演算通信素子201[1]で図5の処理が開始されるのは最後である。その理由は、上記の説明から明らかなように、一番始めに演算通信素子201[L]で分散データDL[mL,n]が計算され、最後に演算通信素子201[1]で分散データD1[m1,n]が計算されるためである。
 図6は集計処理ノード100の集約通信処理を説明するフローチャートである。集約通信において、集計処理ノード100の各集約処理機能部101[i](i=1,・・・,L)は、各分散処理ノード200[n]の演算通信素子201[i]が送信した集約通信パケットSPi[pi,n](pi=1,・・・,Pgi)を受信する(図6ステップS400)。
 集計処理ノード100の各集約処理機能部101[i]は、受信した集約通信パケットSPi[pi,n]から、分散処理ノード200[n]の演算通信素子201[i]が保持していたLgi個の分散データDi[j,n](j=Lgi×(pi-1)+li、pi=1,・・・,Pgi、li=1,・・・,Lgi)を取得する(図6ステップS401)。
 このように、集計処理ノード100の各集約処理機能部101[i]は、各分散処理ノード200[n](n=1,・・・,N)が保持していた分散データDi[mi,n](mi=1,・・・,Mi)を、重みwi[mi]の番号miの順番に取得することができる。
 なお、図6のチャートに示した処理の開始のタイミングは、集約処理機能部101[L]から101[L-1]、101[L-2]・・・・の順で行われ、集約処理機能部101[1]で図6の処理が開始されるのは最後である。その理由は、図5の場合と同じである。
 図7は集計処理ノード100の集約処理機能部101[i](i=1,・・・,L)の全ノード集計処理を説明するフローチャートである。集計処理ノード100の各集約処理機能部101[i]は、各分散処理ノード200[n](n=1,・・・,N)の演算通信素子201[i]から重みwi[mi]の分散データDi[mi,n]を取得し終えた後に(図7ステップS402においてYES)、取得した全ての分散処理ノード200[n]の演算通信素子201[i]の分散データDi[mi,n]を重みwi[mi]毎に集計する全ノード集計処理を行い、集計データRi[mi]を生成する(図7ステップS403)。集計データRi[mi]の計算式は、以下のとおりである。
 Ri[mi]=Σn=1,…,Ni[mi,n]         ・・・(2)
 このように、集計処理は、番号miの順番に取得した分散データDi[mi,n]に基づいて、集計データRi[mi]を計算する処理である。このため、集計処理ノード100の集約処理機能部101[i]は、番号miの順番に集計データRi[mi]を生成することができる。
 図8は集計処理ノード100の分配通信処理を説明するフローチャートである。集計処理ノード100の集約処理機能部101[i]は、重みwi[mi]毎の集計データRi[mi](mi=1,・・・,Mi)を、重みwi[mi]の番号miの順番にパケット化して各分散処理ノード200[n](n=1,・・・,N)の中の対応する演算通信素子201[i]に送信する分配通信を行う。
 このとき、集計処理ノード100の集約処理機能部101[i]は、Mi個の集計データRi[mi](mi=1,・・・,Mi)を、Lsi個(Lsiは1以上Mi未満の整数)ずつPsi個(Psiは2以上の整数)の分配通信パケットに振り分けて(図8ステップS404)、全ての分配通信パケットを送信し終えるまで(図8ステップS406においてYES)、Psi個の分配通信パケットを順番に各分散処理ノード200[n]の中の対応する演算通信素子201[i]に送信する(図8ステップS405)。すなわち、分散処理ノード200[n]の演算通信素子201[i]に向けてpsi番目(psi=1,・・・,Psi)に送信する分配通信パケットDPi[psi,n]には、Lsi個の集計データRi[js](js=Lsi×(psi-1)+ki、ki=1,・・・,Lsi)が格納される。
 なお、MiがLsiで割り切れない条件では、Psi個目の分配通信パケットDPi[Psi,n]には、(Mi-Lsi×(Psi-1))個の集計データRi[us](us=Lsi×(Psi-1)+oi、oi=1,・・・,Mi-Lsi×(Psi-1))が格納される。
 Psi番目の分配通信パケットDPi[Psi,n]については、(Mi-Lsi×(Psi-1))個の集計データRi[us]の後に、{Lsi-(Mi-Lsi×(Psi-1))}個のダミーの数値を追加し、全ての分配通信パケットが等しくLsi個のデータを格納するようにしてもよい。
 図9は分散処理ノード200[n](n=1,・・・,N)の演算通信素子201[i](i=1,・・・,L)の分配通信処理を説明するフローチャートである。分配通信において、各分散処理ノード200[n]の演算通信素子201[i]の受信部206[i]は、集計処理ノード100が送信した分配通信パケットDPi[psi,n](psi=1,・・・,Psi)を順番に受信する(図9ステップS500)。
 そして、各分散処理ノード200[n]の受信部206[i]は、受信した分配通信パケットDPi[pi,n]から、集計処理ノード100の集約処理機能部101[i]が生成したLsi個の集計データRi[js](js=Lsi×(pi-1)+ki、ki=1,・・・,Lsi)を取得する(図9ステップS501)。また、受信部206[i]の受信カウント部210[i]は、1番目の分配通信パケットDPi[1,n]の受信開始からMi個の全ての集計データの取得完了までの間(図9ステップS503においてYES)、取得済みの集計データRi[mi]の数Mri(MriはMi以下の正の整数)をカウントする(図9ステップS502)。
 このように、各分散処理ノード200[n]の演算通信素子201[i]は、集計処理ノード100の中の対応する集約処理機能部101[i]が生成した集計データRi[mi](mi=1,・・・,Mi)を、重みwi[mi]の番号miの順番に取得することができる。
 pi番目の分配通信パケットDPi[pi,n]から集計データRi[mi]を取得した時点では、取得開始からpi×Lsi個の集計データRi[js]を受信していることになるため、Mriの値はpi×Lsiである。なお、受信カウント部210[i]は、Psi個全ての分配通信パケットDPi[pi,n]を受信した時点では、pi×Lsiの値に関わらずMri=Miとする。
 なお、集計処理ノード100の集約処理機能部101[i]がpi番目に送信する分配通信パケットDPi[pi,n]には、全ての分散処理ノード200[n]に関して同じ集計データRi[js](js=Lsi×(pi-1)+ki、ki=1,・・・,Lsi)が格納されている。したがって、分配通信パケットDPi[pi,n]の宛先を指定する必要がない場合(例えば図1のように分散処理ノード別に経路が異なる場合や、全分散処理ノード宛にマルチキャストできるネットワークを介する場合)は、全ての分散処理ノード200[n]に同じ分配通信パケットDPi[pi]を送信してもよい。
 以上説明した集計処理ノード100と各分散処理ノード200[n]との間の一連の処理において、各分散処理ノード200[n]の送信制御部211[i]の役割について説明する。図10は分散処理ノード200[n]の未受信データ量の推移を示す図、図11は送信制御部211[i]の動作を説明するフローチャートである。図10の縦軸は未受信データ量Mdi、横軸はモニタ時間tである。なお、未受信データ量Mdiは、送信カウント部209[i]と受信カウント部210[i]のカウント値の差(Mti-Mri)、あるいは(Mti-Mri)と等価な量である。
 この図10の例では、モニタ時間taの経過後、例えば複数の分散処理ノード200[n]から集計処理ノード100への過渡的なデータ集中によって集計処理ノード100で処理遅延が発生したとする。この処理遅延を契機に集計処理ノード100から各分散処理ノード200[n]への分配通信パケットDPi[pi,n]の送信速度が遅くなり、分散処理ノード200[n]の未受信データ量、すなわち、送信カウント部209[i]と受信カウント部210[i]のカウント値の差Mdi=Mti-Mriが増大する。
 このような処理遅延が引き続き発生する状況において、未受信データ量Mdiが予め定められた送信停止閾値Mai(MaiはMiより小さい正の整数)以上になると(図11ステップS504においてYES)、分散処理ノード200[n]の演算通信素子201[i]の送信制御部211[i]は、演算通信素子201[i]の送信部205[i]に対して送信停止指示を発行する(図11ステップS505)。この送信停止指示の発行により、演算通信素子201[i]からの集約通信パケットSPi[pi,n]の送信(図5のステップS301)が停止する。例えば図10の例では、モニタ時間tbにおいて未受信データ量Mdiが送信停止閾値Mai以上となり、集約通信パケットSPi[pi,n]の送信が停止する。
 集計処理ノード100からは送信が遅れていた分配通信パケットDPi[pi,n]が送られてくるので、集約通信パケットSPi[pi,n]の送信停止を契機に、未受信データ量Mdiは減少していく。未受信データ量Mdiが予め定められた送信再開閾値Mbi(MbiはMaiより小さい正の整数)以下になると(図11ステップS506においてYES)、送信制御部211[i]は、演算通信素子201[i]の送信部205[i]に対して送信再開指示を発行する(図11ステップS507)。この送信再開指示の発行により、演算通信素子201[i]からの集約通信パケットSPi[pi,n]の送信(図5のステップS301)が再開される。例えば図10の例では、モニタ時間tcにおいて未受信データ量Mdiが送信再開閾値Mbi以下となり、集約通信パケットSPi[pi,n]の送信が再開される。
 なお、処理遅延が発生するケースとして集計処理ノード100への過渡的なデータ集中を述べたが、より詳細に多くの例を挙げれば、分散処理ノード200[n]内、あるいは、分散処理ノード200[n]と集計処理ノード100間、あるいは、集計処理ノード100内のそれぞれにおいて、単一あるいは複合的な要因、すなわち、PCI Expressなどのインタフェースでの転送処理、入出力間の転送レート速度差、クロック速度差などを吸収するパケットバッファへのパケット蓄積による遅延、あるいは、メモリからデータを取得する際のメモリ帯域律速による処理遅延など、さまざまな要因で処理遅延が生じる。本実施例の構成では、このような処理遅延となるあらゆる範囲に適応できる。
 また、本実施例の構成が採用されていない場合、集計処理ノード100のパケットバッファに集約通信パケットを蓄積できなくなる程の処理遅延が生じ、バッファあふれによるフレーム欠損が生じて、欠損したフレームが原因で処理が停止したり、誤った結果が得られたりする可能性がある。しかし、本実施例の構成であれば、未受信データ量Mdiの大きさに応じて分散処理ノード200[n]の演算通信素子201[i]において送信制御を行うので、集計処理ノード100のパケットバッファでのパケット欠損が発生する前に演算通信素子201[i]の送信を停止することができる。その結果、パケット欠損をなくすことができ、集計処理ノード100の処理停止や誤った結果が出るといった不安定な動作による再計算などによる処理遅延を回避でき、効率的かつ安定な処理動作が可能となる。
 図12は分散処理ノード200[n](n=1,・・・,N)の重み更新処理を説明するフローチャートである。各分散処理ノード200[n]の演算通信素子201[i](i=1,・・・,L)の更新処理部207[i]は、集計処理ノード100の中の対応する集約処理機能部101[i]から重みwi[mi]の集計データRi[mi]を取得し終えた後に(図12ステップS508においてYES)、取得した集計データRi[mi]に基づいてニューラルネットワークのブロック208[i]内の層の重みwi[mi]を更新する重み更新処理を行う(図12ステップS509)。
 重み更新処理においては、集計データRi[mi]が示す、損失関数の勾配に基づいて損失関数が最小になるように重みwi[mi]を番号mi毎に更新すればよい。重みwi[mi]の更新は周知の技術であるので、詳細な説明は省略する。
 このように、重み更新処理は、重みwi[mi]の番号miの順番に取得した集計データRi[mi]に基づいて、重みwi[mi]を更新する処理である。このため、各分散処理ノード200[n]の演算通信素子201[i]は、重みwi[mi]に対する重み更新処理を、番号miの順番に行うことができる。
 演算通信素子201[1]での重み更新処理の終了により、1回のミニバッチ学習が終了し、各分散処理ノード200[n](n=1,・・・,N)と集計処理ノード100とは、更新された重みに基づき、次のミニバッチ学習の処理を継続して行う。すなわち、各分散処理ノード200[n]は、次のミニバッチ学習用のサンプルデータを図示しないデータ収集ノードから受け取り、上記で説明したミニバッチ学習の処理を繰り返すことにより、分割されたブロック208[i]からなるニューラルネットワークの推論精度を向上させる。
 なお、ミニバッチ学習の繰り返しの終了は、(A)ミニバッチ学習の回数が予め指定された値に到達した場合、(B)ニューラルネットワークの推論精度(例えば正答が既知の問題をニューラルネットワークに推論処理させたときの正答率)が予め指定された閾値を超過した場合、(C)ニューラルネットワークの推論精度の向上が停止した場合(予め指定されたミニバッチ学習の回数を繰り返したときに推論精度の上昇が予め指定された閾値を下回った場合)、(D)あるいは、(A)~(C)のうち少なくとも2つの場合の組み合わせが発生した場合、とする。このようなミニバッチ学習の繰り返しの終了は、各分散処理ノード200[n](n=1,・・・,N)が個別に判断してもよいし、集計処理ノード100が総合的に判断してもよい。
 ここから図13を用いて、まず集約通信処理、全ノード集計処理、分配通信処理、および重み更新処理で構成されるシーケンスとその効果を説明し、その後、図14を用いて、本実施例の分散処理ノード200[n]の送信制御(送信停止、送信再開)による新たな効果を説明する。
 図13に、集計処理ノード100と分散処理ノード200[n](n=1,・・・,N)の処理のシーケンスを示す。上記のように、各分散処理ノード200[n]の演算通信素子201[i](i=1,・・・,L)は、Mi個の分散データDi[mi,n](mi=1,・・・,Mi)を重みwi[mi]の番号miの順番にパケット化して集計処理ノード100の中の対応する集約処理機能部101[i]に送信し、集約処理機能部101[i]は、Mi個の分散データDi[mi,n](mi=1,・・・,Mi)を番号miの順番に取得する、という集約通信処理を行う。
 集約処理機能部101[i]は、重みwi[mi]の番号miの順番に取得したMi個の分散データDi[mi,n]に基づき、集計データRi[mi]を番号miの順番に生成する全ノード集計処理を行う。
 さらに、集約処理機能部101[i]は、重みwi[mi]の番号miの順番に生成したMi個の集計データRi[mi]を番号miの順番にパケット化して各分散処理ノード200[n]の中の対応する演算通信素子201[i]に送信し、演算通信素子201[i]は、Mi個の集計データRi[mi]を番号miの順番に取得する、という分配通信処理を行う。
 各分散処理ノード200[n]の演算通信素子201[i]は、番号miの順番に取得したMi個の集計データRi[mi]に基づき、ニューラルネットワークのブロック208[i]内の層のMi個の重みwi[mi]を番号miの順番に更新する重み更新処理を行う。
 本実施例では、集約通信処理と全ノード集計処理と分配通信処理と重み更新処理とを、並行してほぼ同時に(パイプラインで)行うことが可能であり、各通信や各処理が終了するまで、次の処理を開始できなかった従来技術によるシーケンス(図18)と比較したとき、処理時間の大幅な短縮が可能となる。
 すなわち、各分散処理ノード200[n]の演算通信素子201[i]の送信部205[i]と集計処理ノード100の集約処理機能部101[i]とがMi個の重みwi[mi]の内のある重みwi[mi]の分散データDi[mi,n]について図5、図6で説明した集約通信処理を行っているときに、集約通信処理中の重みwi[mi]よりも番号miの小さい重みwi[mi]の取得済みの分散データDi[mi,n]について集約処理機能部101[i]が図7で説明した全ノード集計処理を行う。
 また、集約処理機能部101[i]が全ノード集計処理を行っているときに、全ノード集計処理中の重みwi[mi]よりも番号miの小さい重みwi[mi]の集計処理済みの集計データRi[mi]について集約処理機能部101[i]と各分散処理ノード200[n]の演算通信素子201[i]の受信部206[i]とが図8、図9で説明した分配通信処理を行う。
 さらに、集約処理機能部101[i]と各分散処理ノード200[n]の演算通信素子201[i]の受信部206[i]とが分配通信処理を行っているときに、分配通信処理中の重みwi[mi]よりも番号miの小さい重みwi[mi]の取得済みの集計データRi[mi]に基づき各分散処理ノード200[n]の演算通信素子201[i]の更新処理部207[i]が図12で説明した重み更新処理を行う。
 したがって、例えば、集約通信処理と全ノード集計処理と分配通信処理と重み更新処理のそれぞれで時間Tを要する場合、従来技術では、これらの全ての処理を終えるのに4Tの時間を要したが、本実施例ではT+αの時間で済む。ここで、前記αは、任意の分散処理ノード200[n]が任意の分散データDi[mi,n]を集計処理ノード100に送信した時点から重みwi[mi]の更新が完了するまでの遅延時間である。本実施例では、重みwi[mi]の番号miの単位で処理をパイプライン化しているため、時間αはTと比較すると十分に小さい時間である。したがって、本実施例では、従来技術と比較して、集約通信処理と全ノード集計処理と分配通信処理と重み更新処理とに要する時間を、約1/4に短縮することが可能である。
 次に、本実施例の分散処理ノード200[n]の送信制御(送信停止、送信再開)による効果を説明する。図13の動作説明では、集計処理ノード100の処理遅延による影響、すなわち、分散処理ノード200[n]において未受信データが発生する際のシーケンス動作への影響を考慮していない。
 図14は、集計処理ノード100の集約処理機能部101[i]において処理遅延が生じ、各分散処理ノード200[n]の演算通信素子201[i]が送信制御を行った場合の演算通信素子201[i]と集約処理機能部101[i]間での通信を示している。この図14の例では、Mi=20、Lgi=Lsi=1、Mai=8、Mbi=6としている。すなわち、演算通信素子201[i]から集約処理機能部101[i]への矢印130の1本1本が示す各集約通信パケットにデータ量が1の分散データが含まれ、集約処理機能部101[i]から演算通信素子201[i]への矢印131の1本1本が示す各分配通信パケットにデータ量が1の集計データが含まれていることになる。
 図14の例では、各分散処理ノード200[n]の演算通信素子201[i]から集約通信パケットが連続して送信され、2番目の集約通信パケットが集約処理機能部101[i]で受信されるタイミングで、集約処理機能部101[i]から演算通信素子201[i]へ1番目の分配通信パケットが送信され、さらに続けて2番目の分配通信パケットが送信されている。しかし、3番目の集約通信パケットが集約処理機能部101[i]で受信されてからは、集約処理機能部101[i]の負荷が高くなったため、3番目の分配通信パケットの送信が遅れている。一方で、集約処理機能部101[i]での処理が遅延しているのとは対照的に、演算通信素子201[i]からは、10番目までの集約通信パケットが連続して送信されている。
 ここで、演算通信素子201[i]の送信カウント部209[i]と受信カウント部210[i]のカウント値Mti,Mriに着目する。演算通信素子201[i]から7番目の集約通信パケットを送信した直後の時点では、集約処理機能部101[i]からの分配通信パケットが到着していないため、未受信データ量Mdi=Mti-Mriは、集約通信パケットの送信毎に初期値のMdi=1(1×Lgi)からMdi=7(7×Lgi)まで増大する。演算通信素子201[i]から8番目の集約通信パケットが送信された際に、集約処理機能部101[i]から送信された分配通信パケットが到着するが、この状況では、未受信データ量はMdi=Mti-Mri=8-1で、7のままである。
 上記で説明したとおり、集約処理機能部101[i]からは2番目の分配通信パケットまでは連続的に送信されるが、3番目の分配通信パケットの送信は図14の矢印132で示す処理遅延で遅れていた。この場合、演算通信素子201[i]から9番目の集約通信パケットが送信された時点では、未受信データ量Mdiは7のままであるが、図14のtAiのタイミングで演算通信素子201[i]から10番目の集約通信パケットが送信されると、集約処理機能部101[i]から3番目の分配通信パケットが到着していないために、未受信データ量Mdiは1つカウントアップし、Mdi=8となる。
 未受信データ量Mdiが送信停止閾値Mai=8に到達したため、演算通信素子201[i]の送信制御部211[i]から送信部205[i]に対して送信停止指示が発行され、演算通信素子201[i]の集約通信パケット送信が停止する。
 演算通信素子201[i]からの集約通信パケットの送信が停止してから暫くすると、遅れて集約処理機能部101[i]から送信された3番目の分配通信パケットが演算通信素子201[i]に到達する。これにより、未受信データ量Mdi=7となる。集約処理機能部101[i]から4番目の分配通信パケットが送信されるタイミングでは、演算通信素子201[i]の送信停止によって集約通信パケットが集約処理機能部101[i]に届かず、集約処理機能部101[i]での処理が軽くなっている。このため、集約処理機能部101[i]から分配通信パケットが連続送信される。図14のtBiのタイミングで4番目の分配通信パケットを演算通信素子201[i]が受信すると、未受信データ量Mdiが1つカウントダウンされ、Mdi=6となる。
 未受信データ量Mdiが送信再開閾値Mbi=6に到達したため、演算通信素子201[i]の送信制御部211[i]から送信部205[i]に対して送信再開指示が発行され、集約通信パケットの送信が再開される。10番目の集約通信パケットを送信した時点で送信停止していたため、11番目の集約通信パケットから送信が再開される。送信再開後、集約処理機能部101[i]からの分配通信パケットが到着するので、未受信データ量はMdi=Mti-Mri=7-1で、6のままである。このような状態が19番目の集約通信パケットが送信されるまで続き、Mdi=6のままとなる。
 一方、集約処理機能部101[i]に到着する集約通信パケットに着目すると、分散処理ノード200[N]の演算通信素子201[i]からの集約通信パケット送信再開後、11番目から19番目の集約通信パケットまで連続的に集約処理機能部101[i]へ到着する。特に11番目から13番目の集約通信パケットの受信と同時に、集約処理機能部101[i]から分配通信パケットが送信されている。この状況で再び集約処理機能部101[i]の負荷が重くなり、分配通信パケット送信の遅延が発生する。すなわち、13番目の分配通信パケットが集約処理機能部101[i]から送信された後、次の14番目の分配通信パケットの送信が図14の矢印133で示す処理遅延で遅れる。
 この処理遅延によって、演算通信素子201[i]から20番目の集約通信パケットが送信されたタイミングで、集約処理機能部101[i]からの分配通信パケットが遅延により届かなくなる。図14のケースでは、Mi=20であり、tCiのタイミングで演算通信素子201[i]から20番目の集約通信パケットを送信して、送信が全て完了したため、未受信データ量Mdiに関わらず、演算通信素子201[i]からの送信は停止する。
 さらに、集約処理機能部101[i]からの14番目の分配通信パケットの送信後、図14の矢印134で示す処理遅延が発生した場合、15番目の分配通信パケットが集約処理機能部101[i]から遅れて送信される。既に演算通信素子201[i]から集約処理機能部101[i]への集約通信パケット送信が完了しているので、集約処理機能部101[i]の負荷は軽くなっており、集約処理機能部101[i]は、処理遅延の解消後に15番目から20番目まで連続的に分配通信パケットを送信する。20番目の分配通信パケットを演算通信素子201[i]が受信した時点で、未受信データ量Mdi=0となる。
 なお、集約処理機能部101[i]からPsi=20個の分配通信パケットを受信して、Mi=20個の集計データRi[mi]を取得し終えた時点で(図9ステップS503においてYES)、演算通信素子201[i]の送信カウント部209[i]と受信カウント部210[i]とは、それぞれカウント値Mti,Mriを0に初期化する。これにより、未受信データ量Mdiも0となり、送信カウント部209[i]と受信カウント部210[i]とは、次のミニバッチでのデータの集約送信開始の待機状態となる。
 以上説明したように、本実施例では、分散処理ノード200[n]の演算通信素子201[i]において、送信データ量と受信データ量の差、すなわち未受信データ量Mdiを監視し、送信を制御することによって、集計処理ノード100の集約処理機能部101[i]への過渡的な負荷を低減し、安定した処理が可能となる。
 なお、集計処理ノード100の負荷が重くなることについて、さらに詳細に説明すると、例えば、集計処理ノード100の処理にソフトウェアが介在する際には、大量の処理によってCPU(Central Processing Unit)が逼迫することによって、処理遅延が発生する。また、ハードウェア的に集約通信パケットを処理する場合、ハードウェア処理の前に一時的に受信バッファ、いわゆるFIFO(First In, First Out)のようなメモリにパケットを保存する際、FIFOの深さ(メモリサイズ)が有限のために、バッファ溢れが起きて処理すべきパケットが消失してしまい、集計処理ノード100の負荷が重くなる。
 このような集計処理ノード100の負荷が重くなる問題を解決するために、未受信データ量Mdiが増えたときに、分散処理ノード200[n]の演算通信素子201[i]からの送信を停止し、集計処理ノード100のCPUの負荷増大やFIFOのバッファ溢れによるパケット消失を防止することによって安定な処理を実現することが可能となる。
 なお、上記の説明では、集約通信パケットを受信する集計処理ノード100の受信バッファでのバッファ溢れの問題について説明しているが、本実施例は、受信バッファに限らず、ハードウェア的なパケット処理でボトルネックとなる全ての部分、例えばPCIe(PCI Express)などの内部バスや、その他のパケット処理回路に搭載されるFIFO、メモリ、DMA(Direct Memory Access)転送等の様々な部分についてボトルネックを解消する分散処理方法を提供するものである。
 なお、誤解のないように図15を用いてミニバッチ1回辺りの、分散処理の全体、すなわち、集計処理ノード100の集約処理機能部101[1]~101[L]と分散処理ノード200[n]の演算通信素子201[1]~201[L]の全体処理を改めて説明する。
 図13、図14では、集計処理ノード100の中のi番目の集約処理機能部101[i]と分散処理ノード200[n]の中のi番目の演算通信素子201[i]を例に挙げて動作を説明した。
 1回のミニバッチ学習は、1番目の演算通信素子201[1]におけるサンプルデータ入力処理から始まる。そして、図15では、L番目の演算通信素子201[L]から1番目の演算通信素子201[1]まで、ニューラルネットワークの逆伝搬の勾配計算処理、集約通信処理、分配通信処理、重み更新処理がパイプライン、並列的に行われる様子を示している。このように、全体での処理の順番は、演算モデルを実行するフレームワークや追従するデバイスドライバなどのソフトウェア、ミドルウェアを用いて、制御、実行され、システム全体で高速化が実現されている。
[第2の実施例]
 次に、本発明の第2の実施例について説明する。本実施例は、第1の実施例の深層学習用分散処理システムの構成要素である集計処理ノード100の構成例を説明するものである。図16は集計処理ノード100の構成例を示すブロック図である。
 集計処理ノード100の集約処理機能部101[i](i=1,・・・,L)は、受信部10i[n](n=1,・・・,N)と、受信FIFO(First In, First Out)バッファ11i[n]と、集計処理部12iと、送信部13i[n]とを備えている。
 第1の実施例で説明したように、集計処理ノード100は、集約通信処理において、分散処理ノード200[n](n=1,・・・,N)の各々から、Mi個の分散データDi[mi,n](mi=1,・・・,Mi)を、Lgi個ずつに振り分けられたPgi個の集約通信パケットSPi[pi,n](pi=1,・・・,Pgi)として受信する。集約通信パケットSPi[pi,n]には、Lgi個の分散データDi[j,n](j=Lgi×(pi-1)+li、li=1,・・・,Lgi)が格納されている。
 また、集計処理ノード100は、分配通信処理において、分散処理ノード200[n](n=1,・・・,N)の各々に向けて、Mi個の集計データRi[mi](mi=1,・・・,Mi)を、Lsi個ずつに振り分けてPsi個の集約通信パケットDPi[psi,n](psi=1,・・・,Psi)として送信する。
 図16に示したように、集計処理ノード100の集約処理機能部101[i]は、各分散処理ノード200[n](n=1,・・・,N)の演算通信素子201[i]から集約通信パケットSPi[pi,n]を受信するための受信部10i[n]を、分散処理ノード200[n]別に備える。
 各受信部10i[n]は、図6で説明した集約通信処理を行うものである。具体的には、各受信部10i[n]は、対応する分散処理ノード200[n]の演算通信素子201[i]が送信した集約通信パケットSPi[pi,n]を受信し、この集約通信パケットSPi[pi,n]に重みwi[mi]の番号miの順に格納されたLgi個の分散データDi[j,n](j=Lgi×(pi-1)+li、li=1,・・・,Lgi)を番号f(fは重みwi[mi]の番号miの一部)の順に取得して、後段の受信FIFOバッファ11i[n]に渡す。
 また、図16に示すように、集計処理ノード100の集約処理機能部101[i]は、受信部10i[n]別(分散処理ノード200[n]別)に、受信FIFOバッファ11i[n]を備える。さらに、集計処理ノード100の集約処理機能部101[i]は、各受信FIFOバッファ11i[n](n=1,・・・,N)に蓄積されている、番号mi(mi=1,・・・,Mi)の分散データDi[mi,n]を読み出して集計する集計処理部12iを備える。受信FIFOバッファ11i[n]と集計処理部12iとは、図7で説明した全ノード集計処理を行うものである。
 具体的には、受信FIFOバッファ11i[n]は、対応する受信部10i[n]から渡されたLgi個の分散データDi[j,n](j=Lgi×(pi-1)+li、li=1,・・・,Lgi)を、番号jの順に蓄積する。この蓄積は各受信FIFOバッファ11i[n]が空の状態から開始される。集約通信パケットSPi[pi,n]の受信と分散データDi[j,n]の蓄積とがPgi回行われることで、Mi個の分散データDi[mi,n]が各受信FIFOバッファ11i[n]に蓄積される。
 したがって、各受信FIFOバッファ11i[n]に蓄積された分散データを同じ個数ずつ読み出した場合、各受信FIFOバッファ11i[n]から読み出された分散データDi[mi,n]はmi=1,・・・,Miの順に並んでいる。
 各受信FIFOバッファ11i[n](n=1,・・・,N)は、集計処理部12iに対して、それぞれ分散データの蓄積の有無を示す蓄積有無信号Ui[n]を出力する。
 集計処理部12iは、全ての蓄積有無信号Ui[n](n=1,・・・,N)が分散データの蓄積有を示す場合に、各受信FIFOバッファ11i[n]から分散データを1個ずつ読み出す。なお、各受信FIFOバッファ11i[n]は番号miの順番で分散データを蓄積しており、集計処理部12iは各受信FIFOバッファ11i[n]から同数の分散データを読み出す。このため、各受信FIFOバッファ11i[n]から読み出された分散データの番号miは、各受信FIFOバッファ11i[n]間で同じ値となる。したがって、蓄積有無信号Ui[n]は分散データの番号miを特定する必要はなく、次に読み出すべき分散データが各受信FIFOバッファ11i[n]に蓄積されているか否かを知らせるだけでよい。
 ただし、後述するように、集計処理部12iは、読み出し済みの分散データDi[mi,n]に基づいて生成した集計データRi[mi]を分配通信パケットに格納する。分配通信パケットは、送信部13i[n]から送出される。集計処理部12iは、分配通信パケットを送出する状態にない場合(例えば別の分配通信パケットを送出中である場合)は、次の分散データDi[mi,n]の読み出しを、分配通信パケットを送出可能となるまで保留する。
 このため、分散処理ノード200[n]別に設けられた各送信部13i[n]は、分配通信パケットが送出可能になったときに、分配通信パケットが送出可能であることを示す送出許可信号Vi[n]を集計処理部12iに対して出力する。
 集計処理部12iは、各受信FIFOバッファ11i[n]からの蓄積有無信号Ui[n]と、各送信部13i[n]からの送出許可信号Vi[n]とを受けて、各受信FIFOバッファ11i[n]から分散データの読み出しを行うか否かを判定する。
 具体的には、集計処理部12iは、蓄積有無信号Ui[n]が、次に読み出すべき分散データDi[mi,n]の蓄積有りを示し、送出許可信号Vi[n]が、読み出し済みの分散データDi[mi,n]から生成された集計データRi[mi]を含む分配通信パケットの送出可能を示しているとき、分散データDi[mi,n]を各受信FIFOバッファ11i[n]から読み出す。
 さらに、集計処理部12iは、各受信FIFOバッファ11i[n]から番号miの順に読み出した分散データDi[mi,n]に基づいて、集計データRi[mi]を番号miの順に生成し、集計データRi[mi]を番号miの順に後段の送信部13i[n]に渡す。ここでは、各送信部13i[n]に同一の集計データが渡される。集計データRi[mi]の計算式は、式(2)に示したとおりである。
 各分散処理ノード200[n](n=1,・・・,N)に分配通信パケットを送信するための送信部13i[n]は、分散処理ノード200[n]別に設けられている。送信部13i[n]は、図8で説明した分配通信処理を行うものである。
 各送信部13i[n]は、集計処理部12iから番号miの順番に渡された集計データRi[mi](mi=1,・・・,Mi)を、Lsi個ずつPsi個の分配通信パケットに振り分けて送信する。すなわち、分散処理ノード200[n]の演算通信素子201[i]に向けてpsi番目(psi=1,・・・,Psi)に送信する分配通信パケットDPi[psi,n]には、Lsi個の集計データRi[j](js=Lsi×(psi-1)+ki、ki=1,・・・,Lsi)が格納される。上記のとおり、各送信部13i[n]は、分配通信パケットDPi[psi,n]が送出可能になったときに、集計処理部12iに対して送出許可信号Vi[n]を出力する。
 第1の実施例で説明したように、各送信部13i[n]は、MiがLsiで割り切れない条件では、Psi個目の分配通信パケットDPi[Psi,n]に、(Mi-Lsi×(Psi-1))個の集計データRi[us](us=Lsi×(Psi-1)+oi、oi=1,・・・,Mi-Lsi×(Psi-1))を格納する。また、各送信部13i[n]は、Psi番目の分配通信パケットDPi[Psi,n]について、(Mi-Lsi×(Psi-1))個の集計データRi[us]の後に、{Lsi-(Mi-Lsi×(Psi-1))}個のダミーの数値を追加し、全ての分配通信パケットが等しくLsi個のデータを格納するようにしてもよい。
 以上のように、集約処理機能部101[i](i=1,・・・,L)の各受信部10i[n](n=1,・・・,N)は、分散処理ノード200[n]の演算通信素子201[i]から受信した集約通信パケットから、重みwi[mi]の番号mi(mi=1,・・・,Mi)の順に分散データDi[mi,n]を取り出して、番号miの順に、分散処理ノード別の受信FIFOバッファ11i[n]に格納する。
 集約処理機能部101[i]の集計処理部12iは、分散データDi[mi,n]を番号miの順に各受信FIFOバッファ11i[n]から読み出して、読み出した分散データDi[mi,n]に基づいて集計データRi[mi]を生成する。さらに、集約処理機能部101[i]の各送信部13i[n]は、生成された集計データRi[mi]を番号miの順に分配通信パケットに格納して、各分散処理ノード200[n]の演算通信素子201[i]に送出する。
 図18で説明した従来技術では、集計処理ノード401が全ての分散データD[m,n](m=1,・・・,M)を分散処理ノード400[n]から受け、その後、分散データD[m,n]を集計して全ての集計データR[m](m=1,・・・,M)を生成し、その後、集計データR[m]を分散処理ノード400[n]に返していた。
 これに対して、本実施例では、集計処理ノード100における集約通信処理と全ノード集計処理と分配通信処理とを互いに異なる番号miについてパイプライン化することができるので、各分散処理ノード200[n]から分散データDi[mi,n]を受けてから、全ノードについて分散データDi[mi,n]を集計した集計データRi[mi]を、各分散処理ノード200[n]に返すまでの時間を、従来技術と比較して大幅に短縮することができる。
 例えば、番号miに関わる各処理に要する時間をtとすると、各分散処理ノード200[n]から分散データDi[mi,n]を受けてから、全分散処理ノード200[n]について分散データDi[mi,n]を集計した集計データRi[mi]を、各分散処理ノード200[n]に返すまでの時間は、本発明では4t(パイプライン段数=4)となる。
 一方、従来技術では、各処理にM倍の時間を要するので、各分散処理ノード400[n]から分散データD[m,n]を受けてから、集計データR[m]を各分散処理ノード400[n]に返すまでの時間が4t×Mとなる。このように、本実施例では、1/Mi(Miは重みwi[mi]の個数であり、100,000,000程度の値になり得る)に時間を短縮することができる。
 分散処理システムの他の構成要素については、第1の実施例で説明したものと同じであるため、本実施例では説明を省略する。
 また、第1の実施例で述べたように、各分散処理ノード200[n]の演算通信素子201[i]は、未受信データ量Mdiを監視して、未受信データ量Mdiが送信停止閾値Mai以上の場合に集計処理ノード100へ送信する集約通信パケットの送信を停止し、この送信停止後に未受信データ量Mdiが送信再開閾値Mbi以下の場合に送信を再開する。
 このような送信制御においては、集計処理ノード100の受信FIFOバッファ11i[n]に蓄積するフレーム数がバッファサイズを超過しないように閾値Mai,Mbiを決めることができるため、いわゆるフレーム欠損を防止することができ、安定な動作を実現することができる。また、必要以上に受信FIFOバッファ11i[n]のサイズを大きくする必要がなくなるため、メモリの効率化による回路規模の適正化にも資することができる。
 第1、第2の実施例で説明した集計処理ノード100は、CPU、記憶装置及びインタフェースを備えたコンピュータと、これらのハードウェア資源を制御するプログラムによって実現することができる。このコンピュータの構成例を図17に示す。
 コンピュータは、CPU600と、記憶装置601と、インタフェース装置(I/F)602とを備えている。I/F602には、ネットワーク300などが接続される。CPU600は、記憶装置601に格納されたプログラムに従って第1、第2の実施例で説明した処理を実行し、本発明の分散処理システムおよび分散処理方法を実現する。同様に、分散処理ノード200[n]の各々についてもコンピュータによって実現することができる。
 本発明は、ニューラルネットワークの機械学習などの高負荷な演算を行う技術に適用することができる。
 10…受信部、11…受信FIFOバッファ、12…集計処理部、13…送信部、100…集計処理ノード、101…集約処理機能部、200…分散処理ノード、201…演算通信素子、202…サンプル入力部、203…勾配計算処理部、204…ノード内集計処理部、205…送信部、206…受信部、207…更新処理部、208…ニューラルネットワークのブロック、209…送信カウント部、210…受信カウント部、211…送信制御部、212…バス。

Claims (8)

  1.  集計処理ノードとN個(Nは2以上の整数)の分散処理ノードとを備え、
     各分散処理ノードは、演算対象のモデルの分割されたL個(Lは2以上の整数)のブロックの演算を行うように構成されたL個の演算通信素子を備え、
     前記集計処理ノードは、前記ブロック毎の演算を行うように構成されたL個の集約処理機能部を備え、
     各分散処理ノードのi番目(i=1,・・・,L)の前記演算通信素子は、演算対象のi番目の前記ブロックのMi個(Miは2以上の整数)のパラメータwi[mi]毎(mi=1,・・・,Mi)の分散データDi[mi,n](n=1,・・・,N)をパラメータwi[mi]の番号miの順番にパケット化して前記集計処理ノードのi番目の前記集約処理機能部に送信し、i番目の前記集約処理機能部から送信されたパケットを受信して集計データRi[mi]を番号miの順番に取得して、この集計データRi[mi]に基づいてi番目の前記ブロックのパラメータwi[mi]を更新し、
     前記集計処理ノードのi番目の前記集約処理機能部は、各分散処理ノードのi番目の前記演算通信素子から送信されたパケットを受信して分散データDi[mi,n]を番号miの順番に取得し、全分散処理ノードのi番目の前記演算通信素子の分散データDi[mi,n]をパラメータwi[mi]毎に集計した前記集計データRi[mi]を生成して、この集計データRi[mi]を番号miの順番にパケット化して各分散処理ノードのi番目の前記演算通信素子に送信し、
     各分散処理ノードのi番目の前記演算通信素子は、前記集計処理ノードに前記分散データDi[mi,n]を送信開始してからMi個の前記集計データRi[mi]を取得し終えるまでの期間において、送信済みの分散データDi[mi,n]のデータ量と取得済みの集計データRi[mi]のデータ量との差である未受信データ量を監視し、この未受信データ量が閾値Mai以上(MaiはMiより小さい正の整数)となった場合に、前記分散データDi[mi,n]の送信を前記未受信データ量が閾値Mbi(MbiはMaiより小さい正の整数)以下となるまで停止することを特徴とする分散処理システム。
  2.  請求項1記載の分散処理システムにおいて、
     各分散処理ノードのi番目の前記演算通信素子は、
     前記分散データDi[mi,n]を番号miの順番にパケット化して前記集計処理ノードのi番目の前記集約処理機能部に送信するように構成された送信部と、
     i番目の前記集約処理機能部から送信されたパケットを受信して前記集計データRi[mi]を番号miの順番に取得するように構成された受信部と、
     前記集計データRi[mi]に基づいてi番目の前記ブロックのパラメータwi[mi]を更新するように構成された更新処理部と、
     前記集計処理ノードに前記分散データDi[mi,n]を送信開始してからMi個の前記集計データRi[mi]を取得し終えるまでの期間において、送信済みの分散データDi[mi,n]の個数Mti(MtiはMi以下の正の整数)をカウントするように構成された送信カウント部と、
     前記集計処理ノードに前記分散データDi[mi,n]を送信開始してからMi個の前記集計データRi[mi]を取得し終えるまでの期間において、取得済みの集計データRi[mi]の個数Mri(MriはMi以下の正の整数)をカウントするように構成された受信カウント部と、
     前記個数MtiとMriとの差である前記未受信データ量が前記閾値Mai以上となった場合に、前記送信部による前記分散データDi[mi,n]の送信を、前記未受信データ量が前記閾値Mbi以下となるまで停止させるように構成された送信制御部とを備えることを特徴とする分散処理システム。
  3.  請求項1または2記載の分散処理システムにおいて、
     前記集計処理ノードのi番目の前記集約処理機能部は、
     分散処理ノード別に設けられ、各分散処理ノードのi番目の前記演算通信素子から送信されたパケットを受信して前記分散データDi[mi,n]を番号miの順番に取得するように構成されたN個の受信部と、
     全分散処理ノードのi番目の前記演算通信素子の分散データDi[mi,n]をパラメータwi[mi]毎に集計した前記集計データRi[mi]を生成するように構成された集計処理部と、
     分散処理ノード別に設けられ、前記集計データRi[mi]を番号miの順番にパケット化して各分散処理ノードのi番目の前記演算通信素子に送信するように構成されたN個の送信部とを備えることを特徴とする分散処理システム。
  4.  請求項1乃至3のいずれか1項に記載の分散処理システムにおいて、
     各分散処理ノードのi番目の前記演算通信素子は、
     前記演算対象のモデルの演算用のサンプルデータが入力されたときに、i番目の前記ブロックのパラメータwi[mi]の各々について、前記モデルの損失関数のパラメータ勾配をサンプルデータ毎に計算するように構成された勾配計算処理部と、
     サンプルデータ毎の前記パラメータ勾配を集計した数値である前記分散データDi[mi,n]をパラメータwi[mi]毎に生成して保持するように構成されたノード内集計処理部とを、さらに備えることを特徴とする分散処理システム。
  5.  請求項1乃至4のいずれか1項に記載の分散処理システムにおいて、
     前記集計処理ノードのi番目の前記前記集約処理機能部と各分散処理ノードのi番目の前記演算通信素子とは、
     各分散処理ノードのi番目の前記演算通信素子が、パケット化した分散データDi[mi,n]を前記集計処理ノードのi番目の前記前記集約処理機能部に送信して、i番目の前記前記集約処理機能部が、受信したパケットから前記分散データDi[mi,n]を取得する集約通信処理と、
     i番目の前記前記集約処理機能部が、前記集計データRi[mi]を生成する全ノード集計処理と、
     i番目の前記前記集約処理機能部が、パケット化した前記集計データRi[mi]を各分散処理ノードのi番目の前記演算通信素子に送信して、各分散処理ノードのi番目の前記演算通信素子が、受信したパケットから前記集計データRi[mi]を取得する分配通信処理と、
     各分散処理ノードのi番目の前記演算通信素子が、前記パラメータwi[mi]を更新するパラメータ更新処理とを、それぞれ異なる番号miについて並行して行うことを特徴とする分散処理システム。
  6.  N個(Nは2以上の整数)の分散処理ノードの各々に、演算対象のモデルの分割されたL個(Lは2以上の整数)のブロック毎に設けられたL個の演算通信素子の各々が、演算対象のi番目(i=1,・・・,L)の前記ブロックのMi個(Miは2以上の整数)のパラメータwi[mi]毎(mi=1,・・・,Mi)の分散データDi[mi,n](n=1,・・・,N)を重みwi[mi]の番号miの順番にパケット化して集計処理ノードに設けられたi番目の集約処理機能部に送信する第1のステップと、
     前記集計処理ノードのi番目の前記集約処理機能部が、各分散処理ノードのi番目の前記演算通信素子から送信されたパケットを受信して前記分散データDi[mi,n]を番号miの順番に取得する第2のステップと、
     前記集計処理ノードのi番目の前記集約処理機能部が、全分散処理ノードの分散データDi[mi,n]をパラメータwi[mi]毎に集計した集計データRi[mi]を生成する第3のステップと、
     前記集計処理ノードのi番目の前記集約処理機能部が、前記集計データRi[mi]を番号miの順番にパケット化して各分散処理ノードのi番目の前記演算通信素子に送信する第4のステップと、
     各分散処理ノードのi番目の前記演算通信素子が、前記集計処理ノードのi番目の前記集約処理機能部から送信されたパケットを受信して前記集計データRi[mi]を番号miの順番に取得する第5のステップと、
     各分散処理ノードのi番目の前記演算通信素子が、前記集計データRi[mi]に基づいてi番目の前記ブロックのパラメータwi[mi]を更新する第6のステップと、
     各分散処理ノードのi番目の前記演算通信素子が、前記集計処理ノードのi番目の前記集約処理機能部に前記分散データDi[mi,n]を送信開始してからMi個の前記集計データRi[mi]を取得し終えるまでの期間において、送信済みの分散データDi[mi,n]のデータ量と取得済みの集計データRi[mi]のデータ量との差である未受信データ量を監視し、この未受信データ量が閾値Mai以上(MaiはMiより小さい正の整数)となった場合に、前記第1のステップによる前記分散データDi[mi,n]の送信を、前記未受信データ量が閾値Mbi(MbiはMaiより小さい正の整数)以下となるまで停止する第7のステップとを含むことを特徴とする分散処理方法。
  7.  請求項6記載の分散処理方法において、
     前記第1のステップの前に、各分散処理ノードのi番目の前記演算通信素子が、前記演算対象のモデルの演算用のサンプルデータが入力されたときに、前記モデルのパラメータwi[mi]の各々について、前記モデルの損失関数のパラメータ勾配をサンプルデータ毎に計算する第8のステップと、
     各分散処理ノードのi番目の前記演算通信素子が、サンプルデータ毎の前記パラメータ勾配を集計した数値である前記分散データDi[mi,n]をパラメータwi[mi]毎に生成して保持する第9のステップとを、さらに含むことを特徴とする分散処理方法。
  8.  請求項6または7記載の分散処理方法において、
     前記分散処理ノードの前記第1のステップおよび前記集計処理ノードの前記第2のステップと、前記集計処理ノードの前記第3のステップと、前記集計処理ノードの前記第4のステップおよび前記分散処理ノードの前記第5のステップと、前記分散処理ノードの前記第6のステップとを、それぞれ異なる番号miについて並行して行うことを特徴とする分散処理方法。
PCT/JP2020/017173 2020-04-21 2020-04-21 分散処理システムおよび分散処理方法 WO2021214863A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/JP2020/017173 WO2021214863A1 (ja) 2020-04-21 2020-04-21 分散処理システムおよび分散処理方法
JP2022516509A JP7420228B2 (ja) 2020-04-21 2020-04-21 分散処理システムおよび分散処理方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2020/017173 WO2021214863A1 (ja) 2020-04-21 2020-04-21 分散処理システムおよび分散処理方法

Publications (1)

Publication Number Publication Date
WO2021214863A1 true WO2021214863A1 (ja) 2021-10-28

Family

ID=78270465

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2020/017173 WO2021214863A1 (ja) 2020-04-21 2020-04-21 分散処理システムおよび分散処理方法

Country Status (2)

Country Link
JP (1) JP7420228B2 (ja)
WO (1) WO2021214863A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230239239A1 (en) * 2022-01-25 2023-07-27 Qualcomm Incorporated Upper analog media access control (mac-a) layer functions for analog transmission protocol stack

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019219714A (ja) * 2018-06-15 2019-12-26 日本電信電話株式会社 分散処理システムおよび分散処理方法

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019219714A (ja) * 2018-06-15 2019-12-26 日本電信電話株式会社 分散処理システムおよび分散処理方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230239239A1 (en) * 2022-01-25 2023-07-27 Qualcomm Incorporated Upper analog media access control (mac-a) layer functions for analog transmission protocol stack

Also Published As

Publication number Publication date
JP7420228B2 (ja) 2024-01-23
JPWO2021214863A1 (ja) 2021-10-28

Similar Documents

Publication Publication Date Title
US11057318B1 (en) Distributed artificial intelligence extension modules for network switches
US10679145B2 (en) System and method for balancing computation with communication in parallel learning
US11099902B1 (en) Parallelized ingress compute architecture for network switches in distributed artificial intelligence and other applications
WO2019239821A1 (ja) 分散処理システムおよび分散処理方法
EP3139314A1 (en) Systems and methods for efficient neural network deployments
US11715040B1 (en) Network switch with integrated gradient aggregation for distributed machine learning
US20180211166A1 (en) Distributed deep learning device and distributed deep learning system
US20210357760A1 (en) Distributed Deep Learning System and Data Transfer Method
US10931602B1 (en) Egress-based compute architecture for network switches in distributed artificial intelligence and other applications
CN110149282B (zh) 流量调度方法和装置
WO2021214863A1 (ja) 分散処理システムおよび分散処理方法
US20210357723A1 (en) Distributed Processing System and Distributed Processing Method
CN114205310B (zh) 一种基于时间敏感网络的数据传输方法、装置和电子设备
JP7287492B2 (ja) 分散深層学習システムおよびデータ転送方法
JP2023546761A (ja) 機械学習アクセラレータにおけるキューアロケーション
CN112256653B (zh) 一种数据采样方法和装置
JP6915562B2 (ja) 分散処理システムおよび分散処理方法
Viswanathan et al. Network-accelerated distributed machine learning using mlfabric
US20230004787A1 (en) Distributed Deep Learning System
US10795726B2 (en) Processing requests received online and dividing processing requests for batch processing
CN112948207A (zh) 信息传递方法、装置、电子设备和介质
WO2020245864A1 (ja) 分散処理システムおよび分散処理方法
CN113094155A (zh) Hadoop平台下的任务调度方法及装置
US20210209443A1 (en) Distributed Processing System and Distributed Processing Method
CN104821921B (zh) 一种基于人工势场法的异构众核任务调度的路由方法

Legal Events

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

Ref document number: 20932282

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022516509

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20932282

Country of ref document: EP

Kind code of ref document: A1