# US 2021/0287044 A1 · Method for updating parameter of model, distributed training system and electric device

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

- Number: US 2021/0287044 A1
- Document ID: US20210287044A1
- Status: Published application
- Kind: A1
- Application number: 17/104,165
- Filed: 2020-11-25
- Published: 2021-09-16
- Earliest claimed: 2020-03-11
- Assignees: Beijing Baidu Netcom Science Technology Co., Ltd.
- Applicants: Beijing Baidu Netcom Science and Technology Co., Ltd.
- Inventors: Long LI; Haifeng WANG; Weibao GONG
- Web page: https://patentgrep.com/patent/US20210287044A1

## CPC

- G06N 20/00: Machine learning
- G06F 9/5038: {considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration (scheduling strategies G06F9/4881 and subgroups)}
- G06F 18/2148: {characterised by the process organisation or structure, e.g. boosting cascade}
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method for updating a parameter of a model, a distributed training system, and an electric device are related to a field of deep learning technologies. The method includes: obtaining a batch training period of batch training data to be trained for a model; increasing priorities of tasks ranked at the bottom in a sequence of gradient communication tasks for parameters of the model when the batch training period is greater than or equal to a preset period threshold; and performing a communication of gradients of the parameters and updating the parameters based on priorities of the gradient communication tasks for the parameters in the model.

## Claims

### Claim 1

A method for updating a parameter of a model, comprising:
obtaining a batch training period of batch training data to be trained for a model on a training node in a distributed training system;
increasing priorities of tasks ranked at the bottom in a sequence of gradient communication tasks for parameters of the model when the batch training period is greater than or equal to a preset period threshold; and
distributing gradients of the parameters of the model to other training nodes in the distributed training system based on priorities of the gradient communication tasks for the parameters, and updating the parameters of the model in combination with gradients of the parameters distributed by other training nodes.

### Claim 2 (depends on 1)

The method of claim 1, wherein the preset period threshold is a sum of a preset minimum batch training period and a preset coefficient.

### Claim 3 (depends on 2)

The method of claim 2, further comprising:
determining the batch training period as an updated minimum batch training period and adding one to a preset count value to obtain an updated count value, when the batch training period is lower than the preset minimum batch training period, an initial value of the preset count value being 0; and
adding one to the preset count value to obtain an updated count value when the batch training period is greater than or equal to the preset minimum batch training period and less than the preset period threshold.

### Claim 4 (depends on 3)

The method of claim 3, wherein the method further comprises:
obtaining the preset count value;
judging whether the preset count value is greater than a preset count threshold; and
when the preset count value is greater than the preset count threshold, decreasing the priorities of the tasks ranked at the bottom in the sequence of gradient communication tasks for the parameters, and clearing the preset count value.

### Claim 5 (depends on 1)

The method of claim 1, wherein increasing the priorities of the tasks ranked at the bottom in the sequence of gradient communication tasks for the parameters of the model when the batch training period is greater than or equal to the preset period threshold comprises:
when the batch training period is greater than or equal to the preset period threshold, selecting a task to be adjusted and an adjusted priority corresponding to the task to be adjusted from the tasks ranked at the bottom in the sequence of gradient communication tasks of the parameters based on a preset priority adjustment strategy; and
performing priority adjustment on the task to be adjusted based on the task to be adjusted and the adjusted priority corresponding to the task to be adjusted.

### Claim 6 (depends on 1)

The method of claim 1, wherein the sequence of gradient communication tasks for the parameters of the model is obtained by means of:
sequencing gradient communication tasks for the parameters of each layer in the model based on a back propagation direction to obtain the sequence of gradient communication tasks for the parameters; and
performing priority setting on each task in the sequence of gradient communication tasks for the parameters, such that the priorities of the gradient communication tasks are sequenced in an ascending order.

### Claim 7 (depends on 1)

The method of claim 1, wherein the batch training data to be trained is untrained batch training data in training data of the model, or batch training data whose training round is lower than a preset round threshold.

### Claim 8

A distributed training system, comprising: a plurality of training nodes,
wherein any two training nodes in the plurality of training nodes are coupled with each other; and each training mode in the plurality of training nodes is configured to execute the method for updating a parameter of a model, comprising:
obtaining a batch training period of batch training data to be trained for a model on a training node in a distributed training system;
increasing priorities of tasks ranked at the bottom in a sequence of gradient communication tasks for parameters of the model when the batch training period is greater than or equal to a preset period threshold; and
distributing gradients of the parameters of the model to other training nodes in the distributed training system based on priorities of the gradient communication tasks for the parameters, and updating the parameters of the model in combination with gradients of the parameters distributed by other training nodes.

### Claim 9 (depends on 8)

The system of claim 8, wherein the preset period threshold is a sum of a preset minimum batch training period and a preset coefficient.

### Claim 10 (depends on 9)

The system of claim 9, wherein the method further comprises:
determining the batch training period as an updated minimum batch training period and adding one to a preset count value to obtain an updated count value, when the batch training period is lower than the preset minimum batch training period, an initial value of the preset count value being 0; and
adding one to the preset count value to obtain an updated count value when the batch training period is greater than or equal to the preset minimum batch training period and less than the preset period threshold.

### Claim 11 (depends on 10)

The system of claim 10, wherein the method further comprises:
obtaining the preset count value;
judging whether the preset count value is greater than a preset count threshold; and
when the preset count value is greater than the preset count threshold, decreasing the priorities of the tasks ranked at the bottom in the sequence of gradient communication tasks for the parameters, and clearing the preset count value.

### Claim 12 (depends on 8)

The system of claim 8, wherein increasing the priorities of the tasks ranked at the bottom in the sequence of gradient communication tasks for the parameters of the model when the batch training period is greater than or equal to the preset period threshold comprises:
when the batch training period is greater than or equal to the preset period threshold, selecting a task to be adjusted and an adjusted priority corresponding to the task to be adjusted from the tasks ranked at the bottom in the sequence of gradient communication tasks of the parameters based on a preset priority adjustment strategy; and
performing priority adjustment on the task to be adjusted based on the task to be adjusted and the adjusted priority corresponding to the task to be adjusted.

### Claim 13 (depends on 8)

The system of claim 8, wherein the sequence of gradient communication tasks for the parameters of the model is obtained by means of:
sequencing gradient communication tasks for the parameters of each layer in the model based on a back propagation direction to obtain the sequence of gradient communication tasks for the parameters; and
performing priority setting on each task in the sequence of gradient communication tasks for the parameters, such that the priorities of the gradient communication tasks are sequenced in an ascending order.

### Claim 14 (depends on 8)

The system of claim 8, wherein the batch training data to be trained is untrained batch training data in training data of the model, or batch training data whose training round is lower than a preset round threshold.

### Claim 15

An electronic device, comprising:
at least one processor; and
a memory, communicatively coupled to the at least one processor,
wherein the memory is configured to store instructions executed by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is caused to execute the method for updating a parameter of a model, comprising:
obtaining a batch training period of batch training data to be trained for a model on a training node in a distributed training system;
increasing priorities of tasks ranked at the bottom in a sequence of gradient communication tasks for parameters of the model when the batch training period is greater than or equal to a preset period threshold; and
distributing gradients of the parameters of the model to other training nodes in the distributed training system based on priorities of the gradient communication tasks for the parameters, and updating the parameters of the model in combination with gradients of the parameters distributed by other training nodes.

### Claim 16 (depends on 15)

The device of claim 15, wherein the preset period threshold is a sum of a preset minimum batch training period and a preset coefficient.

### Claim 17 (depends on 16)

The device of claim 16, wherein the method further comprises:
determining the batch training period as an updated minimum batch training period and adding one to a preset count value to obtain an updated count value, when the batch training period is lower than the preset minimum batch training period, an initial value of the preset count value being 0; and
adding one to the preset count value to obtain an updated count value when the batch training period is greater than or equal to the preset minimum batch training period and less than the preset period threshold.

### Claim 18 (depends on 17)

The device of claim 17, wherein the method further comprises:
obtaining the preset count value;
judging whether the preset count value is greater than a preset count threshold; and
when the preset count value is greater than the preset count threshold, decreasing the priorities of the tasks ranked at the bottom in the sequence of gradient communication tasks for the parameters, and clearing the preset count value.

### Claim 19 (depends on 15)

The device of claim 15, wherein increasing the priorities of the tasks ranked at the bottom in the sequence of gradient communication tasks for the parameters of the model when the batch training period is greater than or equal to the preset period threshold comprises:
when the batch training period is greater than or equal to the preset period threshold, selecting a task to be adjusted and an adjusted priority corresponding to the task to be adjusted from the tasks ranked at the bottom in the sequence of gradient communication tasks of the parameters based on a preset priority adjustment strategy; and
performing priority adjustment on the task to be adjusted based on the task to be adjusted and the adjusted priority corresponding to the task to be adjusted.

### Claim 20 (depends on 15)

The device of claim 15, wherein the sequence of gradient communication tasks for the parameters of the model is obtained by means of:
sequencing gradient communication tasks for the parameters of each layer in the model based on a back propagation direction to obtain the sequence of gradient communication tasks for the parameters; and
performing priority setting on each task in the sequence of gradient communication tasks for the parameters, such that the priorities of the gradient communication tasks are sequenced in an ascending order.
