Neural network model training method and device, data processing method and device

By synchronously transmitting gradient data and making real-time parameter adjustments in distributed parallel training, the problem of idle time of computing nodes is solved, thereby improving the training efficiency and performance of neural network models.

CN117501245BActive Publication Date: 2026-11-27HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202180099427.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-25
Publication Date
2026-11-27
Estimated Expiration
2041-06-25

AI Technical Summary

Technical Problem

In the process of training a distributed parallel neural network model, the idle time of computing nodes leads to low overall training efficiency.

Method used

By synchronously transmitting gradient data between computing nodes and using the backpropagation algorithm to calculate the gradient data, each node adjusts its parameters in real time, reducing idle time and using a gradient pruning algorithm to avoid gradient vanishing and exploding.

Benefits of technology

It improves the efficiency and performance of neural network model training, reduces idle time, and mitigates the impact of training time differences on overall training time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117501245B_ABST
    Figure CN117501245B_ABST
Patent Text Reader

Abstract

The application discloses a neural network model training method and device and data processing method and device in the field of artificial intelligence. The neural network model training method comprises the following steps: in the process that a first computing node performs gradient calculation on the parameters of an initial neural network model by using a back propagation (BP) algorithm, the first computing node acquires the gradient of the parameters of a part of layers of the initial neural network model which have been calculated by a second computing node, so that after the gradient calculation is completed, the parameters of the part of layers can be adjusted according to the acquired gradient of the parameters of the part of layers, the idle time of the first computing node after the gradient calculation is shortened, the training efficiency is improved, and the training performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and more specifically, to a method and apparatus for training a neural network model, and a method and apparatus for processing data. Background Technology

[0002] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making capabilities. Research in the field of AI includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, and fundamental AI theories.

[0003] Training neural network models using a distributed parallel approach, where multiple computing nodes train the model in parallel, can shorten training time and improve training efficiency. However, during the training process on each computing node, there are idle times, which contribute to lower overall training efficiency. Summary of the Invention

[0004] This application provides a neural network model training method and apparatus, and a data processing method and apparatus, which shorten the idle time of computing nodes after the back propagation (BP) algorithm is completed during the neural network model training process, thereby improving training efficiency and performance.

[0005] A first aspect provides a method for training a neural network model based on a computing system, the computing system including a first computing node and a second computing node. The method includes: the first computing node acquiring a training data set, the training data set including multiple training data and corresponding annotation information for each training data; the first computing node processing the training data using an initial neural network model to obtain training information corresponding to the training data; and the first computing node using a backpropagation (BP) algorithm to process the difference between the training information corresponding to the training data and the corresponding annotation information to determine a first gradient data set, the first gradient data set including first gradient data and second gradient data, the first gradient data indicating the gradient of parameters in a first layer set, the first layer set including one or more layers in the initial neural network model, and the second gradient data indicating the parameters in a second layer set. The gradient of the first computing node is obtained by the second computing node, wherein the second layer set includes the input layer of the initial neural network model; the first computing node obtains the second gradient data set calculated by the second computing node, the second gradient data set is used to indicate the gradient of the parameters of the initial neural network model, the second gradient data set includes third gradient data, the third gradient data is used to indicate the gradient of the parameters in the first layer set, the first computing node obtains the third gradient data during the process of the first computing node processing the difference using the BP algorithm; the first computing node adjusts the parameters of the initial neural network model according to the first gradient data set and the second gradient data set to obtain the trained neural network model, wherein the adjustment of the parameters of the first layer set and the second layer set by the first computing node is performed after the first computing node determines the first gradient data set.

[0006] In a parallel neural network model computation system, each computing node, while using the backpropagation (BP) algorithm to determine the parameter gradients of the initial neural network model, sends the gradients of the parameters of some layers of the initial neural network model that have already been calculated to other computing nodes. Thus, after calculating the gradients in the initial neural network model using the BP algorithm, other computing nodes can adjust the parameters of those layers based on the received gradients, shortening the idle time of computing nodes after the BP algorithm calculations are completed during neural network model training, thereby improving training efficiency and performance.

[0007] It should be understood that the first computing node can adjust the parameters of the second-level set after adjusting the parameters of the first-level set.

[0008] In conjunction with the first aspect, in some possible implementations, the second data set includes fourth gradient data, which is used to indicate the gradient of the parameters in the second layer set. The first computing node obtains the second gradient data set calculated by the second computing node, including: the first computing node obtains the fourth gradient data during the process of the first computing node adjusting the parameters of the first layer set.

[0009] For the fourth gradient data obtained by the second computing node during the calculation using the BP algorithm, the first computing node can obtain it while adjusting the parameters of the first layer set. Thus, the first computing node can immediately start adjusting the parameters of the second layer set after adjusting the parameters of the first layer set. This can eliminate the idle time of the first computing node after the calculation using the BP algorithm is completed during the training of the neural network model, further improving training efficiency and performance.

[0010] In conjunction with the first aspect, in some possible implementations, the training information is obtained by processing an initial neural network model that has been adjusted j times, and the second gradient data set is obtained by the second computing node using the initial neural network model that has been adjusted j times, where j is a positive integer.

[0011] Since the acquisition of gradient data sets from other computing nodes by the first computing node occurs during the first computing node's computation, there is no need to allocate separate time for the transmission of gradient data sets. Therefore, even if the computation time required for each computing node to compute the gradient data sets differs, as long as the first computing node receives partial computation results from other computing nodes for the second gradient data sets before completing its computation for the first gradient data set, the parameters corresponding to those partial computation results in the initial neural network model can be adjusted immediately. Therefore, by using synchronous gradient data transmission, the impact of differences in the time required for each computing node to process different training data and their annotation information on the training time can be reduced.

[0012] In conjunction with the first aspect, in some possible implementations, the first computing node adjusts the parameters of the initial neural network model based on the first gradient data set and the second gradient data set, including: the first computing node adjusts the parameters of the initial neural network model using a gradient pruning algorithm.

[0013] Gradient trimming can prevent gradient vanishing and / or gradient explosion.

[0014] In conjunction with the first aspect, in some possible implementations, the first computing node adjusts the parameters of the initial neural network model based on the first gradient data set and the second gradient data set, including: after the first computing node determines the first gradient data set, the first computing node adjusts the parameters of the initial neural network model.

[0015] Therefore, without needing to determine the time required for the first computing node to acquire the fourth data, the idle time of the first computing node during the neural network model training process can be minimized, which is relatively simple.

[0016] Secondly, a data processing method is provided, comprising: acquiring data to be processed; processing the data to be processed using a neural network model, wherein the neural network model is obtained by a first computing node adjusting the parameters of an initial neural network model based on a first gradient data set and a second gradient data set, wherein the adjustment of the parameters of the first layer set and the second layer set is performed after the first computing node determines the first gradient data set, the first layer set includes one or more layers in the initial neural network model, the second layer set includes the input layer of the neural network model, and the first gradient data set is obtained by the first computing node processing the difference between the training information corresponding to the training data and the labeled information corresponding to the training data using the backpropagation (BP) algorithm, wherein the training data... The corresponding training information is obtained by the first computing node processing the training data using the initial neural network model. The first gradient data set includes first gradient data and second gradient data. The first gradient data is used to indicate the gradient of the parameters in the first layer set, and the second gradient data is used to indicate the gradient of the parameters in the second layer set. The second gradient data set is calculated by the second computing node and is used to indicate the gradient of the parameters of the initial neural network model. The second gradient data set includes third gradient data, which is used to indicate the gradient of the parameters in the first layer set. The first computing node obtains the third gradient data during the process of the first computing node processing the differences using the BP algorithm.

[0017] In conjunction with the second aspect, in some possible implementations, the second data set includes fourth gradient data, which is used to indicate the gradient of the parameters in the second layer set, and the first computing node acquires the fourth gradient data during the process of the first computing node adjusting the parameters of the first layer set.

[0018] In conjunction with the second aspect, in some possible implementations, the training information is obtained by processing an initial neural network model that has been adjusted j times, and the second gradient data set is obtained by the second computing node using the initial neural network model that has been adjusted j times, where j is a positive integer.

[0019] In conjunction with the second aspect, in some possible implementations, the first computing node adjusts the parameters of the initial neural network model using a gradient pruning algorithm.

[0020] In conjunction with the second aspect, in some possible implementations, the adjustment of the parameters of the initial neural network model by the first computing node is performed after the first computing node determines the first gradient data set.

[0021] Thirdly, a neural network model training apparatus is provided, the apparatus comprising: an acquisition module and a processing module. The acquisition module is used to acquire a training data set, the training data set including multiple training data and corresponding annotation information for each training data; the processing module is used to process the training data using an initial neural network model to obtain training information corresponding to the training data; the processing module is further used to process the difference between the training information corresponding to the training data and the corresponding annotation information using a backpropagation (BP) algorithm to determine a first gradient data set, the first gradient data set including first gradient data and second gradient data, the first gradient data indicating the gradient of parameters in a first layer set, the first layer set including one or more layers in the initial neural network model, and the second gradient data indicating the gradient of parameters in a second layer set, the second layer set including the gradient of parameters in the initial neural network model. The input layer; the acquisition module is further configured to acquire a second gradient data set calculated by the second computing node, the second gradient data set being used to indicate the gradient of the parameters of the initial neural network model, the second gradient data set including third gradient data, the third gradient data being used to indicate the gradient of the parameters in the first layer set, the acquisition module being specifically configured to acquire the third gradient data during the process of the processing module processing the differences using the BP algorithm; the processing module is further configured to adjust the parameters of the initial neural network model according to the first gradient data set and the second gradient data set to obtain a trained neural network model, the processing module being specifically configured to adjust the parameters of the first layer set and the second layer set after the processing module determines the first gradient data set.

[0022] In conjunction with the third aspect, in some possible implementations, the second data set includes fourth gradient data, which is used to indicate the gradient of the parameters in the second layer set. Specifically, the acquisition module is used to acquire the fourth gradient data during the process of the processing module adjusting the parameters of the first layer set.

[0023] In conjunction with the third aspect, in some possible implementations, the training information is obtained by processing an initial neural network model that has been adjusted j times, and the second gradient data set is obtained by the second computing node using the initial neural network model that has been adjusted j times, where j is a positive integer.

[0024] In conjunction with the third aspect, in some possible implementations, the processing module is used to adjust the parameters of the initial neural network model using a gradient pruning algorithm.

[0025] In conjunction with the third aspect, in some possible implementations, the processing module is used to adjust the parameters of the initial neural network model after the processing module determines the first gradient data set.

[0026] Fourthly, a data processing apparatus is provided, comprising: an acquisition module and a processing module. The acquisition module is used to acquire data to be processed; the processing module is used to process the data to be processed using a neural network model. The neural network model is obtained by a first computing node adjusting the parameters of an initial neural network model based on a first gradient data set and a second gradient data set. The adjustment of the parameters of the first and second layer sets is performed after the first computing node determines the first gradient data set. The first layer set includes one or more layers in the initial neural network model, and the second layer set includes the input layer of the neural network model. The first gradient data set is obtained by the first computing node using a backpropagation (BP) algorithm to process the difference between training information corresponding to the training data and the labeled information corresponding to the training data. The corresponding training information is obtained by the first computing node processing the training data using the initial neural network model. The first gradient data set includes first gradient data and second gradient data. The first gradient data is used to indicate the gradient of the parameters in the first layer set, and the second gradient data is used to indicate the gradient of the parameters in the second layer set. The second gradient data set is calculated by the second computing node and is used to indicate the gradient of the parameters of the initial neural network model. The second gradient data set includes third gradient data, which is used to indicate the gradient of the parameters in the first layer set. The first computing node obtains the third gradient data during the process of the first computing node processing the differences using the BP algorithm.

[0027] In conjunction with the fourth aspect, in some possible implementations, the second data set includes fourth gradient data, which is used to indicate the gradient of the parameters in the second layer set, and the first computing node acquires the fourth gradient data during the process of the first computing node adjusting the parameters of the first layer set.

[0028] In conjunction with the fourth aspect, in some possible implementations, the training information is obtained by processing an initial neural network model that has been adjusted j times, and the second gradient data set is obtained by the second computing node using the initial neural network model that has been adjusted j times, where j is a positive integer.

[0029] In conjunction with the fourth aspect, in some possible implementations, the first computing node adjusts the parameters of the initial neural network model using a gradient pruning algorithm.

[0030] In conjunction with the fourth aspect, in some possible implementations, the adjustment of the parameters of the initial neural network model by the first computing node is performed after the first computing node determines the first gradient data set.

[0031] Fifthly, an electronic device is provided, including a memory and a processor, the memory being used to store program instructions; when the program instructions are executed in the processor, the processor is used to perform the method described in the first aspect or the second aspect.

[0032] The processor mentioned in the fifth aspect above can include either a central processing unit (CPU) or a combination of a CPU and a neural network processing processor.

[0033] A sixth aspect provides a computer-readable medium storing program code for execution by a device, the program code including methods for performing the first or second aspect.

[0034] In a seventh aspect, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to perform the methods described in the first or second aspect above.

[0035] Eighthly, a chip is provided, the chip including a processor and a data interface, the processor reading instructions stored in a memory through the data interface to execute the methods in the first or second aspect described above.

[0036] Optionally, as one implementation, the chip may further include a memory storing instructions, and the processor is configured to execute the instructions stored in the memory. When the instructions are executed, the processor is configured to perform the method in the first aspect or any of the implementations of the first aspect.

[0037] The aforementioned chip can be a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC).

[0038] It should be understood that, in this application, the method of the first aspect can specifically refer to the first aspect and the method in any of the various implementations of the first aspect. Attached Figure Description

[0039] Figure 1 This is a schematic diagram of a system architecture provided in an embodiment of this application.

[0040] Figure 2 This is a schematic diagram of the structure of a convolutional neural network provided in an embodiment of this application.

[0041] Figure 3 This is a schematic diagram of another convolutional neural network structure provided in an embodiment of this application.

[0042] Figure 4 This is a schematic diagram of the hardware structure of a chip provided in an embodiment of this application.

[0043] Figure 5 This is a schematic diagram of a system architecture provided in an embodiment of this application.

[0044] Figure 6 This is a schematic flowchart of a neural network model training method.

[0045] Figure 7 This is a schematic flowchart illustrating a training method for a neural network model based on a computing system, provided in an embodiment of this application.

[0046] Figure 8 This is a schematic flowchart illustrating a training method for a neural network model provided in an embodiment of this application.

[0047] Figure 9 This is a schematic structural diagram of a computing system provided in an embodiment of this application.

[0048] Figure 10 This is a schematic flowchart illustrating a data processing method provided in an implementation example of this application.

[0049] Figure 11 This is a schematic structural diagram of a neural network model training device provided in an embodiment of this application.

[0050] Figure 12 This is a schematic structural diagram of a data processing device provided in an embodiment of this application.

[0051] Figure 13 This is a schematic diagram of the hardware structure of the data processing device according to an embodiment of this application.

[0052] Figure 14 This is a schematic diagram of the hardware structure of the neural network model training device according to an embodiment of this application. Detailed Implementation

[0053] The technical solutions in this application will now be described with reference to the accompanying drawings. The technical solutions in the embodiments of this application will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0054] Since the embodiments of this application involve a large number of neural network applications, for ease of understanding, the relevant terms and concepts of neural networks that may be involved in the embodiments of this application will be introduced below.

[0055] (1) Neural Network Neural networks can be composed of neural units, which can refer to units represented by x. s The arithmetic unit that takes an intercept of 1 as input can output the following:

[0056] Where s = 1, 2, ..., n, n is a natural number greater than 1, W s For x s The weights are denoted by b, where b is the bias of the neural unit. f is the activation function of the neural unit, used to introduce non-linear characteristics into the neural network to convert the input signal into the output signal. The output signal of this activation function can be used as the input to the next convolutional layer; the activation function can be the sigmoid function. A neural network is a network formed by connecting multiple individual neural units, meaning the output of one neural unit can be the input of another. The input of each neural unit can be connected to the local receptive field of the previous layer to extract features from the local receptive field, which can be a region composed of several neural units.

[0057] (2) Deep Neural Networks A deep neural network (DNN), also known as a multilayer neural network, can be understood as a neural network with multiple hidden layers. Based on the position of the layers, the internal neural network of a DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally, the first layer is the input layer, the last layer is the output layer, and the layers in between are hidden layers. The layers are fully connected, meaning that any neuron in the i-th layer is connected to any neuron in the (i+1)-th layer.

[0058] Although DNNs seem complex, the operation of each layer is actually not complicated. Simply put, it involves the following linear relationship expression: ,in, It is the input vector. It is the output vector. It is an offset vector. W It is the weight matrix (also called coefficients). It's an activation function. Each layer simply applies the input vector... The output vector is obtained through such a simple operation. Because DNNs have many layers, the coefficients... W and offset vector The number of parameters is also quite large. These parameters are defined in DNNs as follows: [as coefficients] W For example: Suppose in a three-layer DNN, the linear coefficient from the fourth neuron in the second layer to the second neuron in the third layer is defined as... The superscript 3 represents the coefficient. W The index corresponds to the third-level index 2 in the output and the second-level index 4 in the input.

[0059] In summary, the Lth The coefficients from the k-th neuron in layer 1 to the j-th neuron in layer L are defined as follows: It's important to note that the input layer does not have... In deep neural networks, more hidden layers allow the network to better represent complex real-world situations. Theoretically, the more parameters a model has, the higher its complexity and "capacity," meaning it can perform more complex learning tasks. Training a deep neural network is essentially the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers in the trained deep neural network (composed of vectors from many layers). The resulting weight matrix.

[0060] (3) Convolutional Neural Network A convolutional neural network (CNN) is a deep neural network with a convolutional structure. A CNN contains a feature extractor consisting of convolutional layers and subsampling layers, which can be viewed as a filter. A convolutional layer is a layer of neurons in a CNN that performs convolutional processing on the input signal. In a convolutional layer of a CNN, a neuron may only be connected to some of its neighboring neurons. A convolutional layer typically contains several feature planes, each composed of rectangularly arranged neural units. Neural units on the same feature plane share weights, which are called the convolutional kernel. Shared weights can be understood as the way data information is extracted being independent of location. The convolutional kernel can be initialized as a matrix of random size, and during the training process of the CNN, the kernel can learn appropriate weights. Furthermore, the direct benefit of shared weights is that it reduces the connections between layers in the CNN, while also reducing the risk of overfitting.

[0061] (4) Loss function In training a deep neural network, to ensure the output closely approximates the desired predicted value, we compare the network's prediction with the target value. Based on the difference, we update the weight vector of each layer (usually pre-configuring parameters before the initial update). For example, if the prediction is too high, the weight vector is adjusted to predict a lower value. This adjustment continues until the deep neural network predicts the target value or a value very close to it. Therefore, we need to predefine "how to compare the difference between the predicted and target values," which is the loss function or objective function. These are important equations used to measure the difference between the predicted and target values. Taking the loss function as an example, a higher output value (loss) indicates a greater difference, and training the deep neural network becomes a process of minimizing this loss.

[0062] (5) Forward propagation algorithm The forward propagation algorithm, also known as the forward calculation algorithm, is an algorithm that performs calculations from front to back. Using the forward propagation algorithm, it starts from the input layer and calculates layer by layer backward until it reaches the output layer to obtain the output result. The forward propagation algorithm obtains the output layer result by performing calculations layer by layer from front to back.

[0063] (6) Backpropagation algorithm Neural networks can employ backpropagation (BP) to correct the parameters of the initial neural network model during training, thereby reducing the reconstruction error loss. Specifically, forward propagation of the input signal to the output generates error loss; this error loss information is then propagated back to update the parameters of the initial neural network model, leading to convergence of the error loss. The backpropagation algorithm is an error-loss-driven backpropagation process aimed at obtaining the optimal parameters of the neural network model, such as the weight matrix.

[0064] (7) Data processing Data processing typically includes methods such as data training, machine learning, deep learning, search, reasoning, and decision-making.

[0065] Among them, machine learning and deep learning can perform intelligent information modeling, extraction, preprocessing, and training on data, including symbolization and formalization. Reasoning refers to the process in which, in a computer or intelligent system, the machine thinks and solves problems by simulating human intelligent reasoning, based on reasoning control strategies and using formalized information. Typical functions include search and matching. Decision-making refers to the process of making decisions based on intelligent information after reasoning, and it typically provides functions such as classification, sorting, and prediction.

[0066] (8) Distributed parallel training Distributed parallel training, also known as data-parallel training, maintains a copy of the entire neural network model on each computing node, while each worker machine processes a different subset of the training dataset. By training the neural network model using a large number of computing nodes and processing the outputs of each node, the trained neural network model can be obtained. Each computing node can be a computer node in a large-scale computer cluster network.

[0067] Each computing node can use the same computational process to iteratively process the training dataset. This process includes the initial processing of the training data by the neural network model, backpropagation, gradient aggregation, and optimizer computation.

[0068] The initial neural network model can process the training data using forward propagation.

[0069] Backpropagation is used to determine the gradient of the parameter sizes in the initial neural network model based on the error loss of the initial neural network model. The gradient of the parameter sizes is the partial derivative of the loss function with respect to that parameter.

[0070] Gradient aggregation is used to send the data obtained by backpropagation of this computing node to other computing nodes, and to receive the data obtained by backpropagation sent by other computing nodes.

[0071] The optimizer is used to adjust the parameters of the initial neural network model based on the data obtained from backpropagation at each computing node, in order to reduce error loss.

[0072] like Figure 1 As shown, this application embodiment provides a system architecture 100. In Figure 1 In this embodiment, the data acquisition device 160 is used to acquire training data. For the data processing method of this application, the training data may include multiple training input data and a training identifier corresponding to each training input data.

[0073] After collecting the training data, the data acquisition device 160 stores the training data in the database 130, and the training device 120 trains the target model / rule 101 based on the training data maintained in the database 130.

[0074] The following describes how the training device 120 obtains the target model / rule 101 based on the training data. The training device 120 processes the input training data and compares the output result with the training label corresponding to the training input data until the difference between the output result of the training device 120 and the training label is less than a certain threshold, thereby completing the training of the target model / rule 101.

[0075] The aforementioned target model / rule 101 can be used to implement the data processing method of this application embodiment. Specifically, the target model / rule 101 in this application embodiment can be a neural network. It should be noted that in practical applications, the training data maintained in the database 130 may not all come from the data acquisition device 160; it may also be received from other devices. Furthermore, it should be noted that the training device 120 may not necessarily train the target model / rule 101 entirely based on the training data maintained in the database 130; it may also obtain training data from the cloud or other sources for model training. The above description should not be construed as limiting the embodiments of this application.

[0076] The target model / rule 101 trained using training device 120 can be applied to different systems or devices, such as... Figure 1 The execution device 110 shown can be a terminal, such as a mobile phone, tablet computer, laptop computer, augmented reality (AR) / virtual reality (VR) device, vehicle terminal, etc., or it can be a server or cloud service. Figure 1In this embodiment, the execution device 110 is configured with an input / output (I / O) interface 112 for data interaction with external devices. Users can input data to the I / O interface 112 through the client device 140. The input data may include data to be processed input by the client device.

[0077] Preprocessing module 113 and preprocessing module 114 are used to preprocess the input data (such as data to be processed) received by I / O interface 112. In this embodiment, preprocessing module 113 and preprocessing module 114 may be omitted (or only one of them may be used), and the calculation module 111 may be used directly to process the input data.

[0078] During the preprocessing of input data by the execution device 110, or during the calculation module 111 of the execution device 110 performing calculations and other related processes, the execution device 110 can call data, code, etc. in the data storage system 150 for corresponding processing, or store the data, instructions, etc. obtained from the corresponding processing into the data storage system 150.

[0079] Finally, I / O interface 112 returns the processing result, such as the data processing result obtained above, to client device 140, thereby providing it to the user.

[0080] It is worth noting that the training device 120 can generate corresponding target models / rules 101 based on different training data for different objectives or tasks. The corresponding target models / rules 101 can be used to achieve the above objectives or complete the above tasks, thereby providing the user with the required results.

[0081] exist Figure 1 In the scenario shown, the user can manually provide input data, which can be done through the interface provided by I / O interface 112. Alternatively, the client device 140 can automatically send input data to I / O interface 112. If user authorization is required for the client device 140 to automatically send input data, the user can set the corresponding permissions in the client device 140. The user can view the output results of the execution device 110 on the client device 140, which can be presented in various forms such as display, sound, or animation. The client device 140 can also act as a data acquisition terminal, collecting the input data and output results of the input I / O interface 112 as new sample data and storing them in the database 130. Alternatively, data can be collected directly from the I / O interface 112 without going through the client device 140, using the input data and output results of the input I / O interface 112 as new sample data and storing them in the database 130.

[0082] It is worth noting that, Figure 1 This is merely a schematic diagram of a system architecture provided in an embodiment of this application. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 1 In this context, the data storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 may also be placed within the execution device 110.

[0083] like Figure 1 As shown, the target model / rule 101 is obtained by training according to the training device 120. The target model / rule 101 can be the neural network in this application embodiment. Specifically, the neural network used in this application embodiment can be CNN, deep convolutional neural network (DCNN), recurrent neural network (RNN), etc.

[0084] Since CNN is a very common type of neural network, the following will combine... Figure 2 This section focuses on a detailed explanation of the structure of CNNs. As mentioned in the basic concept introduction above, a Convolutional Neural Network (CNN) is a deep neural network with a convolutional structure. It is a deep learning architecture, which refers to learning at multiple levels of abstraction through machine learning algorithms. As a deep learning architecture, CNN is a feed-forward artificial neural network, in which each neuron can respond to the input data.

[0085] The data processing method in this application embodiment specifically employs a neural network structure as follows: Figure 2 As shown. In Figure 2 In this example, the Convolutional Neural Network (CNN) 200 may include an input layer 210, convolutional / pooling layers 220 (where pooling layers are optional), and a neural network layer 230. The input layer 210 acquires the data to be processed and passes it to the convolutional / pooling layers 220 and the subsequent neural network layer 230 for processing, thus obtaining the processed data result. The following section... Figure 2 This section provides a detailed introduction to the internal layer structure of CNN 200.

[0086] Convolutional / pooling layers 220: Convolutional layers: like Figure 2The convolutional / pooling layer 220 shown may include layers as in Examples 221-226. For instance, in one implementation, layer 221 is a convolutional layer, layer 222 is a pooling layer, layer 223 is a convolutional layer, layer 224 is a pooling layer, layer 225 is a convolutional layer, and layer 226 is a pooling layer; in another implementation, layers 221 and 222 are convolutional layers, layer 223 is a pooling layer, layers 224 and 225 are convolutional layers, and layer 226 is a pooling layer. That is, the output of the convolutional layer can be used as the input to a subsequent pooling layer, or as the input to another convolutional layer to continue the convolution operation.

[0087] The following section will use convolutional layer 221 as an example to introduce the internal working principle of a convolutional layer.

[0088] Convolutional layer 221 can include many convolution operators, also known as kernels. In data processing, a convolution operator acts as a filter that extracts specific information from the input data matrix. A convolution operator can essentially be a weight matrix, which is usually predefined.

[0089] The weight values ​​in these weight matrices need to be obtained through extensive training in practical applications. The weight matrices formed by the weight values ​​obtained through training can be used to extract information from the input data, thereby enabling the convolutional neural network 200 to make correct predictions.

[0090] When a convolutional neural network 200 has multiple convolutional layers, the initial convolutional layers (e.g., 221) tend to extract more general features, which can also be called low-level features. As the depth of the convolutional neural network 200 increases, the features extracted by later convolutional layers (e.g., 226) become more and more complex, such as high-level semantic features. Features with higher semantic levels are more suitable for the problem to be solved.

[0091] Pooling layer: Because it is often necessary to reduce the number of training parameters, pooling layers are often introduced periodically after convolutional layers, such as... Figure 2 In the example of 220, layers 221-226 can be a convolutional layer followed by a pooling layer, or multiple convolutional layers followed by one or more pooling layers. The sole purpose of pooling layers in data processing is to reduce the spatial size of the data.

[0092] Neural network layer 230: After processing by the convolutional / pooling layers 220, the convolutional neural network 200 is still insufficient to output the required information. As mentioned earlier, the convolutional / pooling layers 220 only extract features and reduce the parameters introduced by the input data. However, to generate the final output information (the required class information or other relevant information), the convolutional neural network 200 needs to utilize neural network layer 230 to generate one or a set of required class numbers of output. Therefore, neural network layer 230 can include multiple hidden layers (such as...). Figure 2 As shown in 231, 232 to 23n) and output layer 240, the parameters contained in these multi-layer hidden layers can be pre-trained based on relevant training data for specific task types, such as recognition, classification, etc.

[0093] After the multiple hidden layers in neural network layer 230, the final layer of the entire convolutional neural network 200 is the output layer 240. This output layer 240 has a loss function similar to classification cross-entropy, specifically used to calculate the prediction error. Once the entire convolutional neural network 200 has propagated forward (e.g., ... Figure 2 Propagation from 210 to 240 degrees is considered forward propagation, while backward propagation (e.g.) is completed. Figure 2 The propagation from 240 to 210 (backpropagation) will begin to update the weight values ​​and biases of the layers mentioned above, in order to reduce the loss of the convolutional neural network 200 and the error between the output of the convolutional neural network 200 through the output layer and the ideal result.

[0094] The data processing method in this application embodiment specifically employs a neural network structure as follows: Figure 3 As shown. In Figure 3 In this example, the convolutional neural network (CNN) 200 may include an input layer 210, convolutional / pooling layers 220 (where pooling layers are optional), and neural network layers 230. Figure 2 compared to, Figure 3 Multiple convolutional / pooling layers in the convolutional / pooling layer 220 are executed in parallel, and the extracted features are input into the neural network layer 230 for processing.

[0095] It should be noted that, Figure 2 and Figure 3 The convolutional neural networks shown are merely examples of two possible convolutional neural networks for the data processing method of this application embodiment. In specific applications, the convolutional neural networks used in the data processing method of this application embodiment may also exist in the form of other network models.

[0096] Figure 4 The present application provides a hardware structure for a chip, which includes a neural network processor 50. This chip can be configured as follows: Figure 1 The execution device 110 shown is used to perform the calculations of the calculation module 111. This chip can also be placed in, for example... Figure 1 The training device 120 shown is used to complete the training work of the training device 120 and output the target model / rule 101. For example... Figure 2 and Figure 3 The algorithms for each layer in the convolutional neural network shown can all be implemented in, for example... Figure 4 This is achieved in the chip shown.

[0097] The Neural Processing Unit (NPU) 50 is mounted as a coprocessor on the main central processing unit (CPU) (host CPU), and tasks are assigned by the host CPU. The core of the NPU is the arithmetic circuit 503, and the controller 504 controls the arithmetic circuit 503 to retrieve data from the memory (weight memory or input memory) and perform calculations.

[0098] In some implementations, the arithmetic circuit 503 internally includes multiple process engines (PEs). In some implementations, the arithmetic circuit 503 is a two-dimensional pulsating array. The arithmetic circuit 503 can also be a one-dimensional pulsating array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 503 is a general-purpose matrix processor.

[0099] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 502 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 501 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is ​​stored in the accumulator 508.

[0100] The vector computation unit 507 can further process the output of the arithmetic circuit, such as vector multiplication, vector addition, exponentiation, logarithmic operations, size comparisons, etc. For example, the vector computation unit 507 can be used for network computation in non-convolutional / non-FC layers of neural networks, such as pooling, batch normalization, local response normalization, etc.

[0101] In some implementations, the vector computation unit 507 can store the processed output vector into a unified memory 506. For example, the vector computation unit 507 can apply a nonlinear function to the output of the arithmetic circuit 503, such as a vector of accumulated values, to generate activation values. In some implementations, the vector computation unit 507 generates normalized values, merged values, or both. In some implementations, the processed output vector can be used as an activation input to the arithmetic circuit 503, for example, for use in subsequent layers of a neural network.

[0102] The unified memory 506 is used to store input data and output data.

[0103] The weight data is directly transferred from the external memory to the input memory 501 and / or the unified memory 506 through the direct memory access controller 505 (DMAC), the weight data in the external memory is stored in the weight memory 502, and the data in the unified memory 506 is stored in the external memory.

[0104] The bus interface unit (BIU) 510 is used to enable interaction between the main CPU, DMAC and instruction fetch memory 509 via a bus.

[0105] The instruction fetch buffer 509, connected to the controller 504, is used to store the instructions used by the controller 504. The controller 504 is used to call the instructions cached in the instruction memory 509 to control the operation of the computing accelerator.

[0106] Generally, the unified memory 506, input memory 501, weighted memory 502, and instruction fetch memory 509 are all on-chip memories. External memory is memory outside the NPU, which can be double data rate synchronous dynamic random access memory (DDR SDRAM), high bandwidth memory (HBM), or other readable and writable memory.

[0107] in, Figure 2 and Figure 3 The operations of each layer in the convolutional neural network shown can be performed by the operation circuit 503 or the vector calculation unit 507.

[0108] The above-mentioned Figure 1The execution device 110 in the present application is capable of executing each step of the data processing method of the embodiments of the present application. Figure 2 and Figure 3 The CNN model shown and Figure 4 The chip shown can also be used to execute various steps of the data processing method of the embodiments of this application. The neural network training method and the data processing method of the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0109] like Figure 5 As shown, this application embodiment provides a system architecture 300. The system architecture includes a local device 301, a local device 302, an execution device 110, and a data storage system 150, wherein the local device 301 and the local device 302 are connected to the execution device 110 through a communication network.

[0110] The execution device 110 can be implemented by one or more servers. Optionally, the execution device 110 can be used in conjunction with other computing devices, such as data storage devices, routers, load balancers, etc. The execution device 110 can be deployed on a single physical site or distributed across multiple physical sites. The execution device 110 can use data in the data storage system 150 or call program code in the data storage system 150 to implement the data processing method of the embodiments of this application.

[0111] Users can interact with execution device 110 by operating their respective user devices (such as local device 301 and local device 302). Each local device can represent any computing device, such as a personal computer, computer workstation, smartphone, tablet, smart camera, smart car or other type of cellular phone, media consumption device, wearable device, set-top box, game console, etc.

[0112] Each user's local device can interact with the execution device 110 through a communication network of any communication mechanism / standard. The communication network can be a wide area network, a local area network, a point-to-point connection, or any combination thereof.

[0113] In one implementation, local devices 301 and 302 obtain relevant parameters of the target neural network from execution device 110, deploy the target neural network on local devices 301 and 302, and use the target neural network for data classification or recognition, etc.

[0114] In another implementation, the target neural network can be directly deployed on the execution device 110. The execution device 110 obtains the data to be processed from the local devices 301 and 302, and performs classification or other types of data processing on the data to be processed according to the target neural network.

[0115] The aforementioned execution device 110 can also be a cloud device, in which case the execution device 110 can be deployed in the cloud; or, the aforementioned execution device 110 can also be a terminal device, in which case the execution device 110 can be deployed on the user terminal side. This application embodiment does not limit this.

[0116] Currently, neural network models are widely used in various fields such as image, video, and speech processing, demonstrating capabilities that surpass traditional methods.

[0117] During the training of neural network models, as the model complexity increases, the number of samples required to process also increases. To reduce the training time of neural network models, distributed parallel training methods can be used.

[0118] Figure 6 This is a schematic flowchart of a neural network model training method.

[0119] In the process of training a neural network model using distributed parallel training, multiple computing nodes process data in parallel. Figure 6 The structure of compute node 600 is shown. It should be understood that individual compute nodes may have the same structure.

[0120] In a multi-node computing environment, each node can access a subset of the training data set. Each subset includes multiple training data points and the corresponding annotation information for each training data point.

[0121] The computing node 600 includes a computing unit and a communication unit. The computing unit includes an initial neural network model 610, a backpropagation (BP) algorithm 620, and an optimizer 640. The computing unit implements the computational functions of the computing node 600, which is the core of deep learning training. The performance of the computing unit has a significant impact on the training time of the neural network model.

[0122] The communication unit includes an all-reduce (AR) module 630. The communication unit is used to enable information transmission between the various computing nodes.

[0123] Training data is input into the initial neural network model 610 to obtain training information. The initial neural network model 610 is used to perform calculations such as forward propagation on the training data to obtain training information.

[0124] The training and labeling information are input into the BP 620. The BP 620 can then use the backpropagation algorithm to calculate the gradients of the parameters in the initial neural network model.

[0125] Specifically, the BP 620 can calculate the error generated by each layer based on the training and labeling information, as well as the parameter values ​​of each layer in the initial neural network model 610. The BP 620 can also calculate the partial derivative of the loss function with respect to the parameters of each layer based on the error generated by each layer and the output of that layer during the processing of the training data by the initial neural network model. The partial derivative of the loss function with respect to the parameters is the gradient of the parameters.

[0126] The parameters of each layer can include weights and biases. Therefore, the partial derivative of the loss function with respect to the parameters of each layer includes the partial derivatives of the weights and the partial derivatives of the biases.

[0127] AR 630 is used to transmit the gradients of the parameters in the initial neural network model calculated by each computing node after the BP 620 has completed its computation. AR 630 can send the gradient data calculated by BP 620 to the computing nodes and can receive the gradient data calculated by other computing nodes. The gradient data sent by AR 630 includes the gradients of each parameter in the initial neural network model 610.

[0128] The optimizer 640 is used to adjust the parameters in the initial neural network model 610 based on the gradient data determined by the multiple computing units after the AR 630 receives gradient data sent by each of the other computing units besides the computing device 600, so as to obtain an adjusted neural network model.

[0129] The adjusted neural network model can be used as an initial neural network model to process other training data.

[0130] By iteratively processing each training data and its corresponding annotation information at each of the multiple computing nodes, the trained neural network model can be obtained.

[0131] When the communication unit transmits the computation results of the computing unit between various computing nodes, the computing unit is in an idle state, resulting in low overall efficiency of the training process.

[0132] To address the aforementioned issues, this application provides a method for training a neural network model.

[0133] Figure 7 This is a schematic flowchart illustrating a training method for a neural network model based on a computing system, provided in an embodiment of this application.

[0134] Training method 700 can be executed by training device 120. Training method 700 includes steps S710 to S750.

[0135] The computing system includes a first computing node and at least one second computing node.

[0136] In S710, the first computing node acquires a training data set, which includes multiple training data and annotation information corresponding to each training data.

[0137] By performing parallel computations across the computing nodes, the training time of the neural network model can be shortened, and the training efficiency can be improved. Therefore, each of the first computing node and at least one second computing node can obtain a training dataset. The training dataset obtained by each computing node can be different.

[0138] In S720, the first computing node processes the training data using an initial neural network model to obtain training information corresponding to the training data.

[0139] The initial neural network model in each computing node can have the same parameters.

[0140] In S730, the first computing node uses the backpropagation (BP) algorithm to process the difference between the training information corresponding to the training data and the labeling information corresponding to the training data to determine a first gradient data set. The first gradient data set includes first gradient data and second gradient data. The first gradient data is used to indicate the gradient of the parameters in the first layer set, which includes one or more layers in the initial neural network model. The second gradient data is used to indicate the gradient of the parameters in the second layer set, which includes the input layer of the initial neural network model.

[0141] The difference between the training information and the labeled information corresponding to the training data can be represented by the loss value.

[0142] Different sets of layers can include different layers of the initial neural network model. That is, the first set of layers does not include the input layer of the initial neural network model.

[0143] According to the operational principle of the BP algorithm, the gradients of the parameters of each layer are calculated in the reverse order of the initial neural network model calculation. In the first gradient data set obtained through the backpropagation BP algorithm, the second gradient data is used to indicate the gradients of the parameters in the second layer set, which includes the input layer of the neural network model. The second layer set may also include a predetermined number of layers following the input layer. Therefore, among the gradient data in the first gradient data set, the second gradient data is the last to be calculated.

[0144] In S740, the first computing node acquires a second gradient data set calculated by the second computing node. The second gradient data set is used to indicate the gradient of the parameters of the initial neural network model. The second gradient data set includes third gradient data, which is used to indicate the gradient of the parameters in the first layer set. The acquisition of the third gradient data by the first computing node is performed during the process of the first computing node processing the differences using the BP algorithm.

[0145] In other words, in S740, during the process of the first computing node processing the difference using the BP algorithm, the first computing node acquires the third gradient data. This can be understood as the first computing node starting to acquire the third gradient data during the processing of the difference using the BP algorithm, and acquiring the third gradient data before the processing of the difference using the BP algorithm ends.

[0146] The first computing node can receive the second gradient data set sent by the second computing node, and can also send the first gradient data set to the second computing node for the second computing node to adjust the initial neural network model.

[0147] Specifically, during the process of the first computing node processing the difference using the BP algorithm, the first computing node can receive the third gradient data sent by the second computing node, or send the first gradient data to the second computing node.

[0148] In S750, the first computing node adjusts the parameters of the initial neural network model based on the first gradient data set and the second gradient data set to obtain the trained neural network model. The adjustment of the parameters of the first layer set and the second layer set by the first computing node is performed after the first computing node determines the first gradient data set.

[0149] In other words, in S750, after the first computing node determines the first gradient data set, the first computing node adjusts the parameters of the first layer set and the second layer set.

[0150] It should be understood that when the computing system includes multiple second computing nodes, in S740, the first computing node can obtain the second gradient data set of each second computing node, and in S750, the first computing node can adjust the parameters of the initial neural network model according to the first gradient data set and each second gradient data set.

[0151] The gradient data for the same layer set in each of the second gradient data sets can be acquired by the first computing node within the same time period.

[0152] Each computing node in the computing system can serve as the first computing node, meaning that each computing node can execute method 700.

[0153] Through S710-S750, in a parallel neural network model computation system, each computing node, while using the BP algorithm to determine the parameter gradients of the initial neural network model, sends the gradients of the parameters of some layers of the initial neural network model that have already been calculated to other computing nodes. Thus, after calculating the gradients in the initial neural network model using the BP algorithm, other computing nodes can adjust the parameters of those layers based on the received gradients, shortening the idle time of computing nodes after the BP algorithm calculations are completed during neural network model training, thereby improving training efficiency and performance.

[0154] Furthermore, the second data set may include fourth gradient data. The fourth gradient data is used to indicate the gradient of the parameters in the second layer set. The first computing node acquiring the second gradient data set computed by the second computing node may include: the first computing node acquiring the fourth gradient data during the process of adjusting the parameters of the first layer set.

[0155] In other words, the acquisition of the fourth gradient data of each computing node by the first computing node is carried out during the process of the first computing node adjusting the parameters of the first layer set.

[0156] For the fourth gradient data obtained by the second computing node during the calculation using the BP algorithm, the first computing node can obtain it while adjusting the parameters of the first layer set. Thus, the first computing node can immediately start adjusting the parameters of the second layer set after adjusting the parameters of the first layer set. This can eliminate the idle time of the first computing node after the calculation using the BP algorithm is completed during the training of the neural network model, further improving training efficiency and performance.

[0157] The first gradient data set may include multiple gradient data points, each of which can be used to indicate the gradient of parameters in a set of layers, each set of layers including one or more layers in the initial neural network model. That is, the first gradient data set may also include other gradient data besides the first gradient data and the second gradient data.

[0158] The first gradient data set and the second gradient data set can be correlated one-to-one. The corresponding gradient data in the first gradient data set and the second gradient data set are used to indicate the same set of layers in the initial neural network model.

[0159] The first layer set can be set according to the time required for the first computing node to obtain the fourth data, so that the time required for the first computing node to adjust the parameters of the first layer set is greater than or equal to the time required for the first computing node to obtain the fourth data.

[0160] Based on the operational principle of the backpropagation (BP) algorithm, the parameter gradients of each layer are calculated in the reverse order of the initial neural network model's computation. Neural network models typically have a large number of layers. The second layer set can be set to include layers with a smaller number of layers, such as 1 / 2, 1 / 3, 1 / 5, 1 / 10, 1 / 20, 1 / 50, or even less of the total number of layers in the neural network model. This avoids the first computing node needing a significant amount of time to obtain the fourth layer set, and prevents a situation where the time required for the first computing node to adjust the parameters of the initial neural network model's layer sets (excluding the second layer set) is less than the time required for the first computing node to obtain the fourth layer set.

[0161] In some embodiments, after the first computing node determines the first gradient data set, the first computing node adjusts the parameters of the initial neural network model.

[0162] Therefore, without needing to determine the time required for the first computing node to acquire the fourth data, the idle time of the first computing node during the neural network model training process can be minimized, which is relatively simple.

[0163] In general, the differences in computing power between various computing nodes in a computing system are relatively small. Each computing node can serve as the first computing node, and method 700 is used to train the initial neural network model.

[0164] After performing S710 to S750, the adjusted initial neural network model can be used as the initial neural network model, and S720 to S750 can be performed again to process other training data, thereby completing the adjustment of the parameters of the initial neural network model and obtaining the trained neural network model.

[0165] For example, S720-S750 can be stopped when the number of iterations (i.e., the number of iterations) reaches a preset value, or when the difference between the training information obtained by the initial neural network model from processing the training data and the corresponding labeled information gradually converges.

[0166] It should be understood that each computing node can use the same adjustment method to adjust the parameters of the initial neural network model.

[0167] During multiple iterations, each computing node can transmit gradient data synchronously or asynchronously.

[0168] In an asynchronous manner, during the (j+1)th iteration, the first computing node processes the initial neural network model, which has been adjusted j times, to obtain training information. The second gradient data set obtained by the first computing node from the second computing node is the latest gradient data set calculated by the second computing node using the backpropagation (BP) algorithm.

[0169] The synchronous method means that the training information is obtained by processing the initial neural network model after j adjustments, and each second gradient data set is obtained by processing the initial neural network model after j adjustments, where j is a positive integer. In other words, during the (j+1)th iteration of the first computing node, the second gradient data sets of each second computing node are obtained by processing the training data using the initial neural network model after j adjustments, which is obtained from j iterations of the second computing node.

[0170] Using a synchronous approach to train the initial neural network model in parallel can improve training efficiency and shorten training time.

[0171] Since the acquisition of gradient data sets from other computing nodes by the first computing node occurs during the computation of the first computing node, there is no need to allocate separate time for the transmission of gradient data sets. Therefore, even if the computation time required for each computing node to compute the gradient data sets differs, as long as partial computation results of the second gradient data sets from other computing nodes are received before the first computing node completes the computation of the first gradient data set in S730, S740 can proceed immediately.

[0172] Therefore, by using S710-S750 to transmit gradient data synchronously, the impact of the difference in the time required for each computing node to process different training data and their annotation information on the training time can be reduced.

[0173] In some embodiments, the first computing node may use a gradient pruning algorithm to adjust the parameters of the initial neural network model.

[0174] The first computing node can use a gradient pruning algorithm to prune the gradients in the first gradient dataset and obtain the second gradient dataset after gradient pruning. Alternatively, the first computing node can also use a gradient pruning algorithm to prune the gradients in both the first and second gradient datasets.

[0175] Subsequently, the initial neural network model can determine the aggregated gradient of each parameter in the initial neural network model based on the pruned first gradient data set and second gradient data set, and adjust the parameters in the initial neural network model according to the aggregated gradient.

[0176] The first computing node can also determine the aggregated gradient of each parameter based on the gradients of each parameter in the first gradient data set and the second gradient data set. Then, the aggregated gradient can be pruned using a gradient pruning algorithm, and the parameters of the initial neural network model can be adjusted using the adjusted aggregated gradient.

[0177] Gradient trimming can prevent gradient vanishing and / or gradient explosion.

[0178] Figure 8 This is a schematic flowchart illustrating a training method for a neural network model provided in an embodiment of this application.

[0179] The training of neural network models is performed by individual computing nodes in the computing system. Each computing node includes a computing unit and a communication unit. The computing unit is used for computation and processing. The communication unit is used for communication with other computing nodes to achieve information transmission between the computing nodes. Figure 8 Taking the processing system 800 used by a computing node in a computing system as an example, the training method of a neural network model will be explained.

[0180] The processing system 800 includes an initial neural network model, modules BP 821 to BP 824, modules AR 831 to AR 832, and optimizers 841 to Optimizer 842. The initial neural network model implements the functionality of the initial neural network model 610, modules BP 821 to BP 824 implement the functionality of BP 620, modules AR 831 to AR 832 implement the functionality of AR 630, and optimizers 841 to Optimizer 842 implement the functionality of optimizer 640.

[0181] Before time t0, the computing node can obtain the training data set, which includes the training data and the labeling information corresponding to each training data.

[0182] The annotation information can also be called labels. Each training data point can be manually labeled to obtain the label corresponding to each training data point.

[0183] Between time t0 and t1, the computing unit processes the training data using the initial neural network model to obtain the training information corresponding to the training data.

[0184] The initial neural network model can process the training data using the forward propagation algorithm.

[0185] An initial neural network model can include multiple sets of layers, each set containing one or more layers. Each set of layers can be understood as an FP module. Figure 8 The initial neural network model, including modules FP811 and FP812, will be used as an example for explanation.

[0186] Between time t1 and t2, the computational unit uses the backpropagation algorithm to calculate the gradients of the parameters of each layer in the initial neural network model based on the training information and annotation information corresponding to the training data.

[0187] The computational unit can utilize multiple backpropagation (BP) modules to perform inversion propagation operations. Modules BP 822 and BP 824 are used to calculate the gradients of the parameters. For example, module BP 821 can be used to calculate the errors generated by each layer in FP 812. Module BP 822 can be used to calculate the gradients of the parameters of each layer in FP 812 based on the calculation results of module BP 821. Module BP 823 can be used to calculate the errors generated by each layer in FP 811. Module BP 824 can be used to calculate the gradients of the parameters of each layer in FP 811 based on the calculation results of module BP 823.

[0188] After module BP 822 finishes its computation and obtains the gradients of the parameters of each layer in FP 812, the communication unit can send these gradients to other computing nodes. Generally, the computing capabilities of each node are similar, and the time required for each node to calculate the gradients of the parameters of each layer in FP 812 is roughly the same. After completing the calculation of the gradients of the parameters of each layer in FP 812, other computing nodes can send these gradients as well. Therefore, the communication unit in this computing node can receive the gradients of the parameters of each layer in FP 812 sent by other computing nodes during the computation of modules BP 823 and / or BP 824. The communication unit can be idle during the computation of modules BP 821 and BP 822.

[0189] The communication unit can use the AR module to receive parameter gradients sent by other computing units and send parameter gradients to other computing units. In other words, the AR module is used to aggregate the parameter gradients calculated by each computing node. The communication unit can use module AR 831 to aggregate the parameter gradients in FP 812.

[0190] In other words, from time t1 to t2, the communication unit is used to transmit the gradients of the parameters of each layer in FP-812 between the computing nodes. From time t1 to t2, the computing nodes synchronize the parameter gradients in FP-812 calculated by each computing node, and each computing node obtains the parameter gradients in FP-812 calculated by other computing nodes.

[0191] Between times t2 and t3, the computational unit adjusts the parameters of the initial neural network model.

[0192] The computing unit can use optimizer 841 to adjust the parameters of FP 812.

[0193] The optimizer can calculate the average gradient of a parameter in the initial neural network model based on the gradients obtained from each computing node. Then, it adjusts the value of that parameter in the initial neural network model based on this average gradient.

[0194] While the computing unit adjusts the parameters of FP 812 using optimizer 841, the communication unit can send the parameter gradients of FP 811 calculated by module BP 824 to other computing nodes, and can also receive the parameter gradients of FP 811 calculated by other computing nodes. The communication unit can use module AR 832 to aggregate the parameter gradients of FP 812.

[0195] Therefore, the computing unit can adjust the parameters of FP 811 using optimizer 842 after adjusting the parameters of FP 812 using optimizer 841.

[0196] It should be understood that the dependency of each optimizer on the last module BP 824 of the backpropagation operation can be increased, that is, the operation of each optimizer can be made to start after the operation of module BP 824.

[0197] From time t0 to t3, the computing unit sequentially performs various operations and processes using modules FP, BP, and the optimizer. In other words, the operations of each module are performed serially. Each computing node completes one iteration from time t0 to t3, using the adjusted initial neural network model as the initial neural network model, and repeats the processing from time t0 to t3 to complete the training of the neural network model.

[0198] In the computing system, during the backpropagation process at each computing node, the computing unit outputs the gradients of the parameters of each layer in the initial neural network model in the reverse order of the initial layers. During this backpropagation, the communication unit transmits the calculated parameter gradients to other computing nodes and receives the calculated parameter gradients from other nodes. After the computing unit completes the backpropagation, it can adjust the parameters of the neural network model based on the received parameter gradients from each computing unit, while the communication unit continues to transmit parameter gradients. This reduces or even eliminates the idle time of the computing units during each iteration, improves the utilization rate of the computing units, reduces the training time required for the neural network model, and improves training efficiency.

[0199] It should be understood that the processing time required for each module may be the same or different, depending on the actual processing time required.

[0200] Compared to the time required for one iteration of computing node 600 (the sum of the times required for the initial neural network model 610, BP 620, AR 630, and optimizer 640), training the neural network model using the method provided in this application embodiment transmits gradient data while the computing unit performs calculations, which can reduce or even eliminate the idle time of the computing unit during each iteration without increasing the amount of computation.

[0201] In some embodiments, the optimizer or BP module may perform gradient clipping.

[0202] If the gradient of the parameters is infinitely close to 0, i.e., the gradient vanishes, the initial neural network model cannot be updated effectively. If the gradient of the parameters is very large, i.e., the gradient explodes, the initial neural network model may skip the optimal solution and fail to converge.

[0203] To avoid gradient vanishing and / or gradient explosion, gradient pruning can be performed.

[0204] Gradient trimming, also known as gradient pruning, involves setting a preset range. When the gradient exceeds this range, the boundary value of the preset range is used as the gradient to adjust the parameters of the neural network model. Alternatively, the gradient can be trimmed based on its norm. A preset range for the average or variance of the gradients of multiple parameters can be set. If the gradients of these multiple parameters do not meet this preset range, the gradients of these multiple parameters are trimmed so that the trimmed gradients meet the preset range.

[0205] It should be understood that the BP module can perform gradient pruning on the gradients of the calculated parameters. The optimizer can perform gradient pruning on the gradients of the parameters calculated by each computing node, or it can take the average of the gradients of the parameters calculated by each computing node.

[0206] Figure 9 This is a schematic structural diagram of a computing system provided in an embodiment of this application.

[0207] The computing system consists of multiple computing nodes, each of which can perform... Figure 7 or Figure 8 The training method of the neural network model shown is used to achieve distributed parallel training.

[0208] These multiple computing nodes can be located in the same or different computing devices.

[0209] Each compute node can be directly connected to only a subset of compute nodes. Direct connections between compute nodes mean that information can be transmitted between them via their communication interfaces without needing to be forwarded by other compute nodes. Information between compute nodes that are not directly connected can be forwarded by other compute nodes.

[0210] For example, ring all-red (ring AR) can be used to achieve information transmission between computing nodes. Ring AR, also known as ring, involves computing nodes forming a ring, with each node directly connected to only two adjacent computing nodes. Information transmission between computing nodes is achieved through the forwarding of information by the computing nodes.

[0211] Alternatively, all computing nodes can be directly connected.

[0212] One-way or two-way information transmission can be performed through the communication interface between the two computing nodes.

[0213] Figure 10 This is a schematic flowchart of a data processing method provided in an embodiment of this application.

[0214] Data processing method 1000 includes steps S1010 to S1020.

[0215] In S1010, acquire the data to be processed.

[0216] In S1020, the data to be processed is processed using a neural network model. The neural network model is obtained by the first computing node adjusting the parameters of the initial neural network model based on the first gradient data set and the second gradient data set. The adjustment of the parameters of the first layer set and the second layer set is performed after the first computing node determines the first gradient data set. The first layer set includes one or more layers in the initial neural network model, and the second layer set includes the input layer of the neural network model.

[0217] The first gradient data set is obtained by the first computing node using the backpropagation (BP) algorithm to process the difference between the training information corresponding to the training data and the labeling information corresponding to the training data. The training information corresponding to the training data is obtained by the first computing node using the initial neural network model to process the training data. The first gradient data set includes first gradient data and second gradient data. The first gradient data is used to indicate the gradient of the parameters in the first layer set, and the second gradient data is used to indicate the gradient of the parameters in the second layer set.

[0218] The second gradient data set is calculated by the second computing node. The second gradient data set is used to indicate the gradient of the parameters of the initial neural network model. The second gradient data set includes third gradient data, which is used to indicate the gradient of the parameters in the first layer set. The first computing node obtains the third gradient data during the process of the first computing node processing the differences using the BP algorithm.

[0219] Optionally, the second data set includes fourth gradient data, which is used to indicate the gradient of the parameters in the second layer set. The first computing node acquires the fourth gradient data during the process of adjusting the parameters of the first layer set.

[0220] Optionally, the training information is obtained by processing an initial neural network model after j adjustments, and the second gradient data set is obtained by the second computing node using the initial neural network model after j adjustments, where j is a positive integer.

[0221] Optionally, the first computing node adjusts the parameters of the initial neural network model using a gradient pruning algorithm.

[0222] Optionally, the adjustment of the parameters of the initial neural network model by the first computing node is performed after the first computing node determines the first gradient data set.

[0223] In other words, the neural network model used to process the data to be processed can be through... Figure 7 or Figure 8 The neural network model shown was trained using the training method described.

[0224] The above text combined Figures 1 to 9 The data processing system, neural network model training method, and data processing method provided in the embodiments of this application are described below. Figures 11 to 1 5. Description of the apparatus embodiments of this application. It should be understood that the description of the neural network model training method and the data processing method corresponds to the description of the apparatus embodiments; therefore, any parts not described in detail can be referred to the above description.

[0225] Figure 11 This is a schematic structural diagram of a neural network model training device provided in an embodiment of this application. The neural network model training device 3000 can be located in Figure 1 The training device 120 or other device shown. The neural network model training device 3000 includes an acquisition module 3010 and a processing module 3020.

[0226] The acquisition module 3010 is used to acquire a training data set, which includes multiple training data and annotation information corresponding to each training data.

[0227] The processing module 3020 is used to process the training data using the initial neural network model to obtain the training information corresponding to the training data.

[0228] The processing module 3020 is used to process the difference between the training information corresponding to the training data and the labeling information corresponding to the training data using the backpropagation (BP) algorithm to determine a first gradient data set. The first gradient data set includes first gradient data and second gradient data. The first gradient data is used to indicate the gradient of the parameters in the first layer set, which includes one or more layers in the initial neural network model. The second gradient data is used to indicate the gradient of the parameters in the second layer set, which includes the input layer of the initial neural network model.

[0229] The acquisition module 3010 is used to acquire a second gradient data set calculated by the second computing node. The second gradient data set is used to indicate the gradient of the parameters of the initial neural network model. The second gradient data set includes third gradient data, which is used to indicate the gradient of the parameters in the first layer set.

[0230] The acquisition module 3010 is specifically used to acquire the third gradient data during the process of the processing module processing the difference using the BP algorithm.

[0231] The processing module 3020 is used to adjust the parameters of the initial neural network model according to the first gradient data set and the second gradient data set to obtain the trained neural network model.

[0232] The processing module 3020 is specifically used to adjust the parameters of the first layer set and the second layer set after the processing module determines the first gradient data set.

[0233] Optionally, each second data set includes fourth gradient data, which is used to indicate the gradient of the parameters in the second layer set.

[0234] The acquisition module 3010 is specifically used to acquire the fourth gradient data during the process of the processing module adjusting the parameters of the first layer set.

[0235] Optionally, the training information is obtained by processing an initial neural network model that has been adjusted j times, and the second gradient data set is obtained by the second computing node using the initial neural network model that has been adjusted j times, where j is a positive integer.

[0236] Optionally, the processing module 3020 is used to adjust the parameters of the initial neural network model using a gradient pruning algorithm.

[0237] Optionally, the processing module 3020 is used to adjust the parameters of the initial neural network model after the processing module determines the first gradient data set.

[0238] Figure 12 This is a schematic structural diagram of a data processing apparatus provided in an embodiment of this application. The data processing apparatus 2000 may be located in Figure 1 The execution device 110 or other device shown. The data processing apparatus 2000 includes an acquisition module 2010 and a processing module 2020.

[0239] The acquisition module 2010 is used to acquire data to be processed.

[0240] The processing module 2020 is used to process the data to be processed using a neural network model. The neural network model is obtained by the first computing node adjusting the parameters of the initial neural network model based on the first gradient data set and the second gradient data set. The adjustment of the parameters of the first layer set and the second layer set is performed after the first computing node determines the first gradient data set. The first layer set includes one or more layers in the initial neural network model, and the second layer set includes the input layer of the neural network model.

[0241] The first gradient data set is obtained by the first computing node using the backpropagation (BP) algorithm to process the difference between the training information corresponding to the training data and the labeling information corresponding to the training data. The training information corresponding to the training data is obtained by the first computing node using the initial neural network model to process the training data. The first gradient data set includes first gradient data and second gradient data. The first gradient data is used to indicate the gradient of the parameters in the first layer set, and the second gradient data is used to indicate the gradient of the parameters in the second layer set.

[0242] The second gradient data set is calculated by the second computing node. The second gradient data set is used to indicate the gradient of the parameters of the initial neural network model. The second gradient data set includes third gradient data, which is used to indicate the gradient of the parameters in the first layer set. The first computing node obtains the third gradient data during the process of the first computing node processing the differences using the BP algorithm.

[0243] Optionally, the second data set includes fourth gradient data, which is used to indicate the gradient of the parameters in the second layer set. The first computing node acquires the fourth gradient data during the process of adjusting the parameters of the first layer set.

[0244] Optionally, the training information is obtained by processing an initial neural network model after j adjustments, and the second gradient data set is obtained by the second computing node using the initial neural network model after j adjustments, where j is a positive integer.

[0245] Optionally, the first computing node adjusts the parameters of the initial neural network model using a gradient pruning algorithm.

[0246] Optionally, the adjustment of the parameters of the initial neural network model by the first computing node is performed after the first computing node determines the first gradient data set.

[0247] Figure 13 This is a schematic diagram of the hardware structure of the data processing device according to an embodiment of this application. Figure 13 The data processing device 4000 shown includes a memory 4001, a processor 4002, a communication interface 4003, and a bus 4004. The memory 4001, processor 4002, and communication interface 4003 are interconnected via the bus 4004.

[0248] The memory 4001 can be a ROM, a static storage device, or RAM. The memory 4001 can store a program, and when the program stored in the memory 4001 is executed by the processor 4002, the processor 4002 and the communication interface 4003 are used to execute the various steps of the data processing method of the embodiments of this application.

[0249] The processor 4002 may be a general-purpose CPU, microprocessor, ASIC, GPU, or one or more integrated circuits, used to execute relevant programs to achieve the functions required by the units in the data processing apparatus of this application embodiment, or to execute the data processing method of this application method embodiment.

[0250] The processor 4002 can also be an integrated circuit chip with signal processing capabilities; for example, it could be... Figure 4 The chip shown. In implementation, each step of the data processing method in this embodiment can be completed by the integrated logic circuitry in the processor 4002 or by software instructions.

[0251] The processor 4002 described above can also be a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 4001. The processor 4002 reads the information in memory 4001 and, in conjunction with its hardware, completes the functions required by the units included in the data processing apparatus of the embodiments of this application, or executes the data processing method of the method embodiments of this application.

[0252] The communication interface 4003 uses a transceiver device, such as, but not limited to, a transceiver, to enable communication between the device 4000 and other devices or communication networks. For example, an image to be processed can be acquired through the communication interface 4003.

[0253] Bus 4004 may include a pathway for transmitting information between various components of device 4000 (e.g., memory 4001, processor 4002, communication interface 4003).

[0254] Figure 14 This is a schematic diagram of the hardware structure of a neural network model training device according to an embodiment of this application. Similar to the device 4000 described above, Figure 14 The neural network model training device 5000 shown includes a memory 5001, a processor 5002, a communication interface 5003, and a bus 5004. The memory 5001, processor 5002, and communication interface 5003 are interconnected via the bus 5004.

[0255] It can be done Figure 14 The neural network model training device 5000 shown trains the initial neural network model, and the trained neural network model can then be used to execute the data processing method of the embodiments of this application.

[0256] Specifically, Figure 14 The device shown can obtain the training dataset and initial neural network model required for training from the outside through the communication interface 5003, and then the processor trains the neural network model based on the training dataset and the initial neural network model.

[0257] It should be noted that although only a memory, processor, and communication interface are shown in the above-described devices 4000 and 5000, those skilled in the art should understand that in specific implementations, devices 4000 and 5000 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that devices 4000 and 5000 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that devices 4000 and 5000 may only include the devices necessary for implementing the embodiments of this application, and may not necessarily include... Figure 13 and Figure 14 All the devices shown.

[0258] It should be understood that the processor in the embodiments of this application can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0259] It should also be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0260] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0261] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0262] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0263] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0264] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0265] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0266] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0267] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0268] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0269] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0270] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for training a neural network model based on a computing system, characterized in that, The computing system includes a first computing node and a second computing node. The first computing node includes a computing unit and a communication unit. The first computing node and the second computing node are computer devices. The method includes: The computing unit acquires a training data set, which includes multiple training data and annotation information corresponding to each training data. The multiple training data include at least one of image data, video data, or audio data. The computing unit processes the training data using an initial neural network model to obtain training information corresponding to the training data. The computing unit uses the backpropagation (BP) algorithm to process the difference between the training information corresponding to the training data and the labeling information corresponding to the training data, so as to determine the first gradient data set. The first gradient data set includes first gradient data and second gradient data. The first gradient data is used to indicate the gradient of the parameters in the first layer set. The first layer set includes one or more layers in the initial neural network model. The second gradient data is used to indicate the gradient of the parameters in the second layer set. The second layer set includes the input layer of the initial neural network model. The communication unit uses an aggregation operation to obtain a second gradient data set from the second computing node. The second gradient data set is calculated by the second computing node and is used to indicate the gradient of the parameters of the initial neural network model. The second gradient data set includes third gradient data, which is used to indicate the gradient of the parameters in the first layer set. The communication unit obtains the third gradient data during the process of the computing unit processing the differences using the BP algorithm. The computing unit adjusts the parameters of the initial neural network model based on the first gradient data set and the second gradient data set to obtain the trained neural network model. The adjustment of the parameters of the first layer set and the second layer set by the computing unit is performed after the computing unit determines the first gradient data set.

2. The method according to claim 1, characterized in that, The second gradient data set includes fourth gradient data, which is used to indicate the gradient of the parameters in the second layer set. The communication unit uses an aggregation operation to obtain a second gradient data set from the second computing node, including: during the process of the computing unit adjusting the parameters of the first layer set, the communication unit uses an aggregation operation to obtain the fourth gradient data.

3. The method according to claim 1 or 2, characterized in that, The training information is obtained by processing the initial neural network model after j adjustments, and the second gradient data set is obtained by the second computing node using the initial neural network model after j adjustments, where j is a positive integer.

4. The method according to claim 1 or 2, characterized in that, The computing unit adjusts the parameters of the initial neural network model based on the first gradient data set and the second gradient data set, including: The computing unit uses a gradient pruning algorithm to adjust the parameters of the initial neural network model.

5. The method according to claim 1 or 2, characterized in that, The computing unit adjusts the parameters of the initial neural network model based on the first gradient data set and the second gradient data set, including: After the computing unit determines the first gradient data set, the computing unit adjusts the parameters of the initial neural network model.

6. A data processing method, characterized in that, The method includes: Acquire data to be processed, wherein the data to be processed includes at least one of image data, video data, or audio data; The data to be processed is processed using a neural network model. This neural network model is obtained by adjusting the parameters of an initial neural network model using a computing unit of a first computing node based on a first gradient data set and a second gradient data set obtained by the communication unit of the first computing node through aggregation operations. The first computing node is a computer device. The parameter adjustments for the first and second layer sets are performed after the computational unit determines the first gradient data set. The first layer set includes one or more layers in the initial neural network model, and the second layer set includes the input layer of the neural network model. The first gradient data set is obtained by the computing unit using the backpropagation (BP) algorithm to process the difference between the training information corresponding to the training data and the labeled information corresponding to the training data. The training information corresponding to the training data is obtained by the computing unit using the initial neural network model to process the training data. The first gradient data set includes first gradient data and second gradient data. The first gradient data is used to indicate the gradient of the parameters in the first layer set, and the second gradient data is used to indicate the gradient of the parameters in the second layer set. The training data includes at least one of image data, video data, or audio data. The second gradient data set is calculated by the second computing node, which is a computer device. The second gradient data set is used to indicate the gradient of the parameters of the initial neural network model. The second gradient data set includes third gradient data, which is used to indicate the gradient of the parameters in the first layer set. The communication unit acquires the third gradient data during the process of the computing unit processing the differences using the BP algorithm.

7. The method according to claim 6, characterized in that, The second gradient data set includes fourth gradient data, which is used to indicate the gradient of the parameters in the second layer set. The communication unit acquires the fourth gradient data during the process of the calculation unit adjusting the parameters of the first layer set.

8. The method according to claim 6 or 7, characterized in that, The training information is obtained by processing the initial neural network model after j adjustments, and the second gradient data set is obtained by the second computing node using the initial neural network model after j adjustments, where j is a positive integer.

9. The method according to claim 6 or 7, characterized in that, The computational unit adjusts the parameters of the initial neural network model using a gradient pruning algorithm.

10. The method according to claim 6 or 7, characterized in that, The adjustment of the parameters of the initial neural network model by the computing unit is performed after the computing unit determines the first gradient data set.

11. A neural network model training device, characterized in that, The device is used as a first computing node in a computing system including a first computing node and a second computing node, wherein the first computing node and the second computing node are computer devices, and the device includes an acquisition module and a processing module. The acquisition module is used to acquire the training dataset and send the training dataset to the processing module. The training dataset includes multiple training data and annotation information corresponding to each training data. The multiple training data includes at least one of image data, video data, or audio data. The processing module is used to process the training data using an initial neural network model to obtain training information corresponding to the training data. The processing module is further configured to process the difference between the training information corresponding to the training data and the labeling information corresponding to the training data using the backpropagation (BP) algorithm, so as to determine a first gradient data set. The first gradient data set includes first gradient data and second gradient data. The first gradient data is used to indicate the gradient of the parameters in the first layer set, which includes one or more layers in the initial neural network model. The second gradient data is used to indicate the gradient of the parameters in the second layer set, which includes the input layer of the initial neural network model. The acquisition module is further configured to acquire a second gradient data set from the second computing node using an aggregation operation. The second gradient data set is calculated by the second computing node and is used to indicate the gradients of the parameters of the initial neural network model. The second gradient data set includes third gradient data, which is used to indicate the gradients of the parameters in the first layer set. The acquisition module is specifically used to acquire the third gradient data by using an aggregation operation during the process of the processing module processing the differences using the BP algorithm. The processing module is further configured to adjust the parameters of the initial neural network model based on the first gradient data set and the second gradient data set to obtain the trained neural network model. The processing module is specifically used to adjust the parameters of the first layer set and the second layer set after the processing module determines the first gradient data set.

12. The apparatus according to claim 11, characterized in that, The second gradient data set includes fourth gradient data, which is used to indicate the gradient of the parameters in the second layer set. The acquisition module is specifically used to acquire the fourth gradient data by using aggregation operations during the process of the processing module adjusting the parameters of the first layer set.

13. The apparatus according to claim 11 or 12, characterized in that, The training information is obtained by processing the initial neural network model after j adjustments, and the second gradient data set is obtained by the second computing node using the initial neural network model after j adjustments, where j is a positive integer.

14. The apparatus according to claim 11 or 12, characterized in that, The processing module is used to adjust the parameters of the initial neural network model using a gradient pruning algorithm.

15. The apparatus according to claim 11 or 12, characterized in that, The processing module is used to adjust the parameters of the initial neural network model after the processing module determines the first gradient data set.

16. A data processing apparatus, characterized in that, The device includes an acquisition module and a processing module; The acquisition module is used to acquire data to be processed, which includes at least one of image data, video data, or audio data. The processing module is used to process the data to be processed using a neural network model. The neural network model is obtained by adjusting the parameters of an initial neural network model using a computing unit of a first computing node based on a first gradient data set and a second gradient data set obtained by the communication unit of the first computing node through aggregation operations. The first computing node is a computer device. The parameter adjustments for the first and second layer sets are performed after the computational unit determines the first gradient data set. The first layer set includes one or more layers in the initial neural network model, and the second layer set includes the input layer of the neural network model. The first gradient data set is obtained by the computing unit using the backpropagation (BP) algorithm to process the differences between the training information corresponding to the training data and the labeled information corresponding to the training data. The training information corresponding to the training data is obtained by the computing unit using the initial neural network model to process the training data. The first gradient data set includes first gradient data and second gradient data. The first gradient data is used to indicate the gradient of the parameters in the first layer set, and the second gradient data is used to indicate the gradient of the parameters in the second layer set. The second gradient data set is calculated by the second computing node, which is a computer device. The second gradient data set is used to indicate the gradient of the parameters of the initial neural network model. The second gradient data set includes third gradient data, which is used to indicate the gradient of the parameters in the first layer set. The communication unit acquires the third gradient data during the process of the computing unit processing the differences using the BP algorithm.

17. The apparatus according to claim 16, characterized in that, The second gradient data set includes fourth gradient data, which is used to indicate the gradient of the parameters in the second layer set. The communication unit acquires the fourth gradient data during the process of the calculation unit adjusting the parameters of the first layer set.

18. The apparatus according to claim 16 or 17, characterized in that, The training information is obtained by processing the initial neural network model after j adjustments, and the second gradient data set is obtained by the second computing node using the initial neural network model after j adjustments, where j is a positive integer.

19. The apparatus according to claim 16 or 17, characterized in that, The computational unit adjusts the parameters of the initial neural network model using a gradient pruning algorithm.

20. The apparatus according to claim 16 or 17, characterized in that, The adjustment of the parameters of the initial neural network model by the computing unit is performed after the computing unit determines the first gradient data set.

21. An electronic device, characterized in that, It includes a memory and a processor, the memory being used to store a program, and when the program is executed in the processor, the processor being used to perform the method of any one of claims 1 to 10.

22. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code for execution by the device, which, when executed by the device, enables the device to perform the method as described in any one of claims 1 to 10.

23. A chip, characterized in that, The chip includes a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to execute the method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Multiple GPUs-based BPNN training method and apparatus

    CN103996069A

  • Model training method and device, electronic equipment and computer readable storage medium

    CN112631775A