# US 2021/0342696 A1 · Deep Learning Model Training Method and System

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0342696 A1
- Document ID: US20210342696A1
- Status: Published application
- Kind: A1
- Application number: 17/376,722
- Filed: 2021-07-15
- Published: 2021-11-04
- Earliest claimed: 2019-01-16
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Xiaolong Bai; Pengfei Li; Zhenyu Zhang
- Web page: https://patentgrep.com/patent/US20210342696A1

## CPC

- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 3/045: Combinations of networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/0499: Feedforward networks
- G06N 3/063: using electronic means
- G06N 3/09: Supervised learning
- G06N 3/098: Distributed learning, e.g. federated learning
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A deep learning model training method includes generating N first gradient sets in a back propagation (BP) calculation in a jth iteration of N deep learning models, adjusting a communication sequence of gradients included in each of the first gradient sets to obtain an adjusted communication sequence, and sending, according to the adjusted communication sequence, the gradients included in each of the N first gradient sets to the parameter storage space.

## Claims

### Claim 1

A method applied to a training system, wherein the training system comprises N deep learning models, wherein each of the N deep learning models comprises n layers of neurons, wherein a training process of each of the N deep learning models comprises a plurality of iterations, wherein each of the iterations comprises a forward propagation (FP) calculation and a back propagation (BP) calculation, wherein N is a positive integer greater than 1, wherein n is a positive integer greater than 1, and wherein the method comprises:
generating N first gradient sets in a first BP calculation in a jth iteration of the N deep learning models, wherein each of the N first gradient sets comprises a first gradient corresponding to a first parameter matrix of a first neuron at each of the n layers of one deep learning model of the N deep learning models, and wherein j is a positive integer greater than zero;
adjusting a communication sequence of gradients comprised in each of the N first gradient sets to obtain an adjusted communication sequence;
sending, according to the adjusted communication sequence, the gradients to a parameter storage space of the training system;
obtaining a second gradient set based on the N first gradient sets that are stored in the parameter storage space; and
correcting a second parameter matrix of a second neuron at each of the n layers of neurons of each of the N deep learning models based on a second gradient comprised in the second gradient set to perform a first FP calculation in a (j+1)th iteration on each of the N deep learning models.

### Claim 2 (depends on 1)

The method of claim 1, wherein adjusting the communication sequence comprises adjusting a first sequence of sending a third gradient corresponding to a third parameter matrix of a third neuron at an ath layer to the parameter storage space to be before a second sequence of sending a fourth gradient corresponding to a fourth parameter matrix of a fourth neuron at a bth layer to the parameter storage space, wherein b is less than or equal to n, wherein a is less than b, and wherein a is a positive integer greater than zero.

### Claim 3 (depends on 1)

The method of claim 1, wherein adjusting the communication sequence comprises adjusting the communication sequence according to a gradient communication policy.

### Claim 4 (depends on 3)

The method of claim 3, further comprising setting the gradient communication policy based on a communication bandwidth between the one deep learning model and the parameter storage space.

### Claim 5 (depends on 3)

The method of claim 3, further comprising setting the gradient communication policy based on a value of the first gradient.

### Claim 6 (depends on 3)

The method of claim 3, further comprising setting the gradient communication policy based on a time required by the first neuron during a second FP calculation.

### Claim 7 (depends on 1)

The method of claim 1, wherein adjusting the communication sequence comprises:
adjusting the communication sequence according to a gradient communication policy;
obtaining an iteration time of the one deep learning model, wherein the iteration time comprises a first time for a second BP calculation in an Lth iteration of the one deep learning model and a second time for a third FP calculation in an (L+1)th iteration of the one deep learning model, and wherein L is a positive integer greater than j; and
adjusting the gradient communication policy based on the iteration time.

### Claim 8

A system comprising:
a parameter storage space;
a memory configured to store:
instructions; and
N deep learning models, wherein each of the N deep learning models comprises n layers of neurons, wherein a training process of each of the N deep learning models comprises a plurality of iterations, wherein each iteration comprises a forward propagation (FP) calculation and a back propagation (BP) calculation, wherein N is a positive integer greater than 1, wherein n is a positive integer greater than 1, wherein each of the N deep learning models is configured to generate a first gradient set in a first BP calculation in a jth iteration, wherein the first gradient set comprises a first gradient corresponding to a first parameter matrix of a first neuron at each of the n layers of a corresponding deep learning model, and wherein j is a positive integer greater than zero; and
a processor coupled to the parameter storage space and the memory, wherein the instructions cause the processor to be configured to:
adjust a communication sequence of gradients comprised in each of N first gradient sets to obtain an adjusted communication sequence;
send, to the parameter storage space according to the adjusted communication sequence, the gradients;
obtain a second gradient set based on the N first gradient sets that are stored in the parameter storage space; and
correct the first parameter matrix based on a second gradient comprised in the second gradient set to perform a first FP calculation in a (j+1)th iteration of each of the N deep learning models.

### Claim 9 (depends on 8)

The system of claim 8, wherein the instructions further cause the processor to be configured to adjust a first sequence of sending a third gradient corresponding to a second parameter matrix of a second neuron at an ath layer to the parameter storage space to be before a second sequence of sending a fourth gradient corresponding to a third parameter matrix of a third neuron at a bth layer to the parameter storage space, wherein b is less than or equal to n, wherein a is less than b, and wherein a is a positive integer greater than zero.

### Claim 10 (depends on 8)

The system of claim 8, wherein the instructions further cause the processor to be configured to adjust the communication sequence according to a gradient communication policy.

### Claim 11 (depends on 10)

The system of claim 10, wherein the instructions further cause the processor to be configured to set the gradient communication policy based on a communication bandwidth between the corresponding deep learning model and the parameter storage space.

### Claim 12 (depends on 10)

The system of claim 10, wherein the instructions further cause the processor to be configured to set the gradient communication policy based on a value of the first gradient.

### Claim 13 (depends on 10)

The system of claim 10, wherein the instructions further cause the processor to be configured to set the gradient communication policy based on a time required by the first neuron during a second FP calculation.

### Claim 14 (depends on 8)

The system of claim 8, wherein the instructions further cause the processor to be configured to:
adjust the communication sequence according to a gradient communication policy;
obtain an iteration time of the corresponding deep learning model, wherein the iteration time comprises a first time for a second BP calculation in an Lth iteration of the corresponding deep learning model and a second time for a third FP calculation in an (L+1)th iteration of the corresponding deep learning model, and wherein L is a positive integer greater than j; and
adjust the gradient communication policy based on the iteration time.

### Claim 15

A computer program product comprising computer-executable instructions stored on a non-transitory computer-readable medium that, when executed by a processor, cause an apparatus to:
generate N first gradient sets in a first back propagation (BP) calculation in a jth iteration of N deep learning models, wherein the apparatus is applied to a training system, wherein the training system comprises the N deep learning models, wherein each of the N deep learning models comprises n layers of neurons, wherein a training process of each of the N deep learning models comprises a plurality of iterations, wherein each of the iterations comprises a forward propagation (FP) calculation and a BP calculation, wherein N is a positive integer greater than 1, wherein n is a positive integer greater than 1, wherein each of the N first gradient sets comprises a first gradient corresponding to a first parameter matrix of a first neuron at each of the n layers of one deep learning model of the N deep learning models, and wherein j is a positive integer greater than zero;
adjust a communication sequence of gradients comprised in each of the N first gradient sets to obtain an adjusted communication sequence;
send, according to the adjusted communication sequence, the gradients to a parameter storage space of the training system;
obtain a second gradient set based on the N first gradient sets that are stored in the parameter storage space; and
correct a second parameter matrix of a second neuron at each of the n layers of neurons of each of the N deep learning models based on a second gradient comprised in the second gradient set to perform a first FP calculation in a (j+1)th iteration on each of the N deep learning models.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein the computer-executable instructions further cause the apparatus to adjust a first sequence of sending a third gradient corresponding to a third parameter matrix of a third neuron at an ath layer to the parameter storage space to be before a second sequence of sending a fourth gradient corresponding to a fourth parameter matrix of a fourth neuron at a bth layer to the parameter storage space, wherein b is less than or equal to n, wherein a is less than b, and wherein a is a positive integer greater than zero.

### Claim 17 (depends on 15)

The computer program product of claim 15, wherein the computer-executable instructions further cause the apparatus to adjust the communication sequence according to a gradient communication policy.

### Claim 18 (depends on 17)

The computer program product of claim 17, wherein the computer-executable instructions further cause the apparatus to set the gradient communication policy based on a communication bandwidth between the one deep learning model and the parameter storage space.

### Claim 19 (depends on 17)

The computer program product of claim 17, wherein the computer-executable instructions further cause the apparatus to set the gradient communication policy based on either a value of the first gradient or a time required by the first neuron during a second FP calculation.

### Claim 20 (depends on 15)

The computer program product of claim 15, wherein the computer-executable instructions further cause the apparatus to:
adjust the communication sequence according to a gradient communication policy;
obtain an iteration time of the one deep learning model, wherein the iteration time comprises a first time for a second BP calculation in an Lth iteration of the one deep learning model and a second time for a third FP calculation in an (L+1)th iteration of the one deep learning model, and wherein L is a positive integer greater than j; and
adjust the gradient communication policy based on the iteration time.
