Data processing method, system and device based on distributed cluster, and non-volatile readable storage medium

By using distributed data processing methods in distributed clusters to send and update gradient data and matrices of deep learning models, the problems of slow convergence speed and limited data transmission bandwidth of traditional algorithms are solved, and more efficient deep learning model training is achieved. .

WO2024193706A1PCT designated stage expired Publication Date: 2024-09-26LANGCHAO ELECTRONIC INFORMATION IND CO LTD

Patent Information

Application Number
PCT/CN2024/083377
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-23
Filing Date
2024-03-22
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

The traditional cross-domain distributed optimization algorithm has a slow convergence speed, and the data transmission bandwidth is limited during edge domain device collaborative model training, which affects training efficiency.

Method used

Using a data processing method based on distributed clusters, training samples are obtained through each terminal device, the gradient data of the deep learning model is determined, and the first-order momentum matrix and the second-order momentum matrix are sent to the target edge domain device for matrix compression and recovery. Use the first-order optimization algorithm to update model parameters until the end of model training.

Benefits of technology

It improves the convergence speed of the deep learning model, reduces the training time, reduces the amount of communication transmission data through matrix compression, and improves the training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083377_26092024_PF_FP
    Figure CN2024083377_26092024_PF_FP
Patent Text Reader

Abstract

Disclosed in the embodiments of the present application are a data processing method, system and device based on a distributed cluster, and a non-volatile readable storage medium, which are applied to the technical field of machine learning. The method comprises: acquiring one batch of training samples and training a deep learning model; determining first-order and second-order momentum matrices of gradient data of the deep learning model and sending same to a target edge domain device, such that the target edge domain device determines a momentum parameter ratio matrix according to received data respectively sent by n terminal devices, and performs matrix compression; receiving a compressed matrix, restoring the size of the matrix, and on the basis of a restoration result, updating parameters of the deep learning model by means of a first-order optimization algorithm, and returning to training until model training ends; and inputting into the trained deep learning model data to be subjected to identification, and obtaining an identification result of said data. By means of the solution in the embodiments of the present application, the convergence speed of distributed training of a deep learning model is increased, and the time consumed for training is also shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Data processing method, system, device and non-volatile readable storage medium based on distributed cluster

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on March 23, 2023, with application number 202310288301.8, and application name “Data processing method, system, device and storage medium based on distributed cluster”, all contents of which are incorporated by reference in this application. Technical Field

[0003] The embodiments of the present application relate to the field of data processing technology, and in particular to a data processing method, system, device, and non-volatile readable storage medium based on a distributed cluster. Background Art

[0004] At present, artificial intelligence is supporting each other with new-generation information technologies such as 5G, cloud computing, and edge computing, promoting intelligent changes in production and lifestyles and social governance methods. What comes with this is that the implementation scenarios of artificial intelligence are becoming increasingly complex, and the proportion of cross-domain distributed artificial intelligence integrating cloud, edge, and terminal devices is increasing.

[0005] Deep learning models are widely used, for example, in plant species identification and speech recognition and text conversion on mobile phones. The initial training of deep learning models deployed on terminal devices requires enormous computing power. Individual terminal devices lack sufficient computing power and training data. Therefore, a common solution is to implement distributed training across all terminal devices in the edge domain, jointly updating model parameters and ultimately completing deep learning model training.

[0006] Traditional cross-domain distributed optimization algorithms usually use the SGD (Stochastic Gradient Descent) algorithm, which is a simple but very effective method, but the algorithm converges slowly.

[0007] In addition, when using edge domain devices for collaborative model training, there are problems such as limited data transmission bandwidth and heavy communication transmission load, which is not conducive to achieving efficient training.

[0008] In summary, how to conduct distributed training of deep learning models, improve convergence speed, and increase training speed are technical problems that technical personnel in this field urgently need to solve.

[0009] Summary of the Invention

[0010] The purpose of the embodiments of the present application is to provide a data processing method, system, device and non-volatile readable storage medium based on a distributed cluster to perform distributed training of deep learning models, improve convergence speed, and increase training speed.

[0011] To solve the above technical problems, the embodiments of the present application provide the following technical solutions:

[0012] According to a first aspect, a data processing method based on a distributed cluster is provided, which is applied to each terminal device in the distributed cluster, and n terminal devices are all communicatively connected to a target edge domain device, where n is a positive integer. The data processing method based on the distributed cluster includes:

[0013] Obtain a batch of training samples and train its own deep learning model to determine the gradient data of the deep learning model;

[0014] According to the gradient data of the deep learning model, the first-order momentum matrix and the second-order momentum matrix of the gradient data are determined;

[0015] Sending the first-order momentum matrix and the second-order momentum matrix to the target edge domain device, so that the target edge domain device determines an average value of n first-order momentum matrices and an average value of n second-order momentum matrices based on the data received from each of the n terminal devices, and determines a momentum parameter ratio matrix of a preset first-order optimization algorithm based on the determined average value of the n first-order momentum matrices and the average value of the n second-order momentum matrices;

[0016] After the target edge domain device compresses the momentum parameter ratio matrix, it receives the compressed matrix sent by the target edge domain device and restores the size of the matrix. Based on the restored result, it uses a first-order optimization algorithm to update the parameters of the deep learning model and returns to execute the operation of obtaining a batch of training samples and training its own deep learning model until the model training is completed.

[0017] The data to be identified is input into the trained deep learning model to obtain the identification result of the data to be identified.

[0018] Optionally, after determining the first-order momentum matrix of the gradient data, the following steps are further included:

[0019] Determining whether a difference between a first-order momentum matrix determined based on the current batch of training samples and a first-order momentum matrix determined based on the previous batch of training samples is less than a preset first value;

[0020] When it is determined that the difference between the first-order momentum matrix determined based on the training samples of this batch and the first-order momentum matrix determined based on the training samples of the previous batch is less than a preset first value, the first-order momentum matrix determined based on the training samples of this batch is saved, and for each subsequent training batch, the saved first-order momentum matrix is ​​used as the first-order momentum matrix of the determined gradient data.

[0021] Optionally, after determining the second-order momentum matrix of the gradient data, the following is further included:

[0022] Determining whether a difference between a second-order momentum matrix determined based on the current batch of training samples and a second-order momentum matrix determined based on the previous batch of training samples is less than a preset second value;

[0023] When it is determined that the difference between the second-order momentum matrix determined based on the training samples of this batch and the second-order momentum matrix determined based on the training samples of the previous batch is less than a preset second value, the second-order momentum matrix determined based on the training samples of this batch is saved, and for each subsequent training batch, the saved second-order momentum matrix is ​​used as the second-order momentum matrix of the determined gradient data.

[0024] Optionally, after determining the first-order momentum matrix and the second-order momentum matrix of the gradient data, the method further includes:

[0025] Bias correction is performed on both the first-order momentum matrix and the second-order momentum matrix;

[0026] Accordingly, the first-order momentum matrix and the second-order momentum matrix are sent to the target edge domain device, including:

[0027] The first-order momentum matrix after bias correction and the second-order momentum matrix after bias correction are sent to the target edge domain device.

[0028] Optionally, after determining the first-order momentum matrix and the second-order momentum matrix of the gradient data, the method further includes:

[0029] Perform Cholesky decomposition on the first-order momentum matrix;

[0030] Accordingly, the first-order momentum matrix is ​​sent to the target edge domain device, including:

[0031] Put M or M T Sending the data to the target edge domain device so that the target edge domain device can recover the first-order momentum matrix according to the received data;

[0032] Among them, M represents the triangular matrix obtained after the Cholesky decomposition of the first-order momentum matrix, M TIt represents the transposed matrix of the triangular matrix M.

[0033] Optionally, after determining the first-order momentum matrix and the second-order momentum matrix of the gradient data, the method further includes:

[0034] Perform Cholesky decomposition on the second-order momentum matrix;

[0035] Accordingly, the second-order momentum matrix is ​​sent to the target edge domain device, including:

[0036] Set V or V T Sending the data to the target edge domain device so that the target edge domain device can recover the second-order momentum matrix according to the received data;

[0037] Among them, V represents the triangular matrix obtained after the Cholesky decomposition of the second-order momentum matrix, V T It represents the transposed matrix of the triangular matrix V.

[0038] Optionally, the target edge domain device performs matrix compression on the momentum parameter ratio matrix, including:

[0039] The target edge domain device performs matrix quantization compression on the momentum parameter ratio matrix.

[0040] Optionally, the target edge domain device performs matrix quantization compression on the momentum parameter ratio matrix, including:

[0041] The target edge domain device quantizes and compresses the momentum parameter ratio matrix of size a×b by taking the average value of each adjacent k data, and obtains The compressed matrix size.

[0042] Optionally, the target edge domain device determines a momentum parameter ratio matrix of a preset first-order optimization algorithm based on the determined average values ​​of the n first-order momentum matrices and the average values ​​of the n second-order momentum matrices, including:

[0043] The target edge domain device is based on the average value of the determined n first-order momentum matrices and the average value of the n second-order momentum matrices, according to The momentum parameter ratio matrix r of the preset first-order optimization algorithm is determined by t ;

[0044] in, It represents the average value of n first-order momentum matrices determined by the target edge domain device. It represents the average value of n second-order momentum matrices determined by the target edge domain device, ε is a preset third parameter and ε>0.

[0045] Optionally, based on the recovery results, the parameters of the deep learning model are updated using a first-order optimization algorithm, including:

[0046] pass Update the parameters of the deep learning model;

[0047] Among them, x t It represents the parameters of the deep learning model after the t-th training, x t+1 It represents the parameters of the deep learning model after the t+1th training, η represents the learning rate, and λ represents the decay coefficient, which is r t ′ represents the recovery result obtained after receiving the compressed matrix sent by the target edge domain device and restoring the size of the matrix.

[0048] Optionally, based on the gradient data of the deep learning model, a first-order momentum matrix of the gradient data is determined, including:

[0049] According to the gradient data of the deep learning model, through m t =β1m t-1 +(1-β1)g t Determine the first-order momentum matrix of the gradient data;

[0050] Among them, β1 represents the preset first parameter, m t It represents the first-order momentum matrix of the gradient data determined during the t-th training, m t-1 It represents the first-order momentum matrix of the gradient data determined during the t-1th training. t It represents the gradient data of the deep learning model determined during the t-th training, and t represents the number of training times.

[0051] Optionally, based on the gradient data of the deep learning model, a second-order momentum matrix of the gradient data is determined, including:

[0052] According to the gradient data of the deep learning model, through v t =β2v t-1 +(1-β2)(g t -m t ) 2 Determine the second-order momentum matrix of the gradient data;

[0053] Among them, β2 represents the preset second parameter, m t It represents the first-order momentum matrix of the gradient data determined during the t-th training, v t It represents the second-order momentum matrix of the gradient data determined during the t-th training, v t-1It represents the second-order momentum matrix of the gradient data determined during the t-1th training, g t It represents the gradient data of the deep learning model determined during the t-th training, and t represents the number of training times.

[0054] Optionally, the data to be identified is input into a trained deep learning model, and the identification results of the data to be identified are obtained, including:

[0055] The data to be identified is input into the trained deep learning model to perform computer image recognition, natural language recognition, or pattern recognition to obtain the recognition result of the data to be identified.

[0056] Optionally, the trigger condition for the end of model training is:

[0057] The deep learning model converges, and / or the number of deep learning model training times reaches the set threshold.

[0058] Optionally, also include:

[0059] When the communication connection with the target edge domain device is lost, a fault prompt message is output.

[0060] Optionally, also include:

[0061] Collect statistics on the communication time with the target edge domain device.

[0062] Optionally, the deep learning model used by the terminal device is a pre-trained deep learning model sent by the data center.

[0063] According to a second aspect, a distributed cluster-based data processing system is provided, which is applied to each terminal device in the distributed cluster, and n terminal devices are all communicatively connected to a target edge domain device, where n is a positive integer. The distributed cluster-based data processing system includes:

[0064] A gradient data determination module is configured to obtain a batch of training samples and train its own deep learning model to determine the gradient data of the deep learning model;

[0065] a momentum determination module configured to determine a first-order momentum matrix and a second-order momentum matrix of the gradient data based on the gradient data of the deep learning model;

[0066] a momentum sending module configured to send the first-order momentum matrix and the second-order momentum matrix to a target edge domain device, so that the target edge domain device determines an average value of n first-order momentum matrices and an average value of n second-order momentum matrices based on the data received from each of the n terminal devices, and determines a momentum parameter ratio matrix of a preset first-order optimization algorithm based on the determined average values ​​of the n first-order momentum matrices and the average values ​​of the n second-order momentum matrices;

[0067] The parameter update module is configured to receive the compressed matrix sent by the target edge domain device after the target edge domain device compresses the momentum parameter ratio matrix and restore the size of the matrix. Based on the restored result, the module updates the parameters of the deep learning model using a first-order optimization algorithm and triggers the gradient data determination module until the model training is completed.

[0068] The execution module is configured to input the data to be identified into the trained deep learning model and obtain the identification result of the data to be identified.

[0069] According to a third aspect, a data processing device based on a distributed cluster is provided, comprising:

[0070] a memory arranged to store a computer program;

[0071] The processor is configured to execute a computer program to implement the steps of the above-mentioned distributed cluster-based data processing method.

[0072] According to a fourth aspect, a non-volatile readable storage medium is provided, characterized in that a computer program is stored on the non-volatile readable storage medium, and when the computer program is executed by a processor, the steps of the distributed cluster-based data processing method as described above are implemented.

[0073] The technical solution provided by the embodiment of the present application is applied to each terminal device in the distributed cluster, and the n terminal devices are all connected to the target edge domain device in communication. During training, each terminal device will obtain a batch of training samples and perform deep learning model training to determine the gradient data of the deep learning model. The embodiment of the present application adopts a first-order optimization algorithm based on the first-order momentum matrix and the second-order momentum matrix, which can improve the convergence speed compared to the traditional SGD scheme. According to the gradient data of the deep learning model, the first-order momentum matrix and the second-order momentum matrix of the gradient data can be determined and sent to the target edge domain device, that is, the target edge domain device can determine the average value of the n first-order momentum matrices and the average value of the n second-order momentum matrices based on the data sent by the n terminal devices received, and determine the momentum parameter ratio matrix of the preset first-order optimization algorithm based on the determined average value of the n first-order momentum matrices and the average value of the n second-order momentum matrices.

[0074] Considering the large size of the momentum parameter ratio matrix, the target edge device compresses the momentum parameter ratio matrix before sending it to each terminal device. After receiving the compressed matrix from the target edge device, the terminal device can restore the matrix size. Based on the restored matrix, the first-order optimization algorithm is used to update the parameters of the deep learning model and continue the next round of training until the model training is completed. It can be seen that because the target edge device compresses the momentum parameter ratio matrix before sending it, the amount of data required for communication is reduced, which also helps to reduce training time.

[0075] In summary, the solution of the embodiment of the present application can perform distributed training of deep learning models, improve the convergence speed, and reduce training time. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0077] FIG1 is a flowchart of an implementation method of a distributed cluster-based data processing method in an embodiment of the present application;

[0078] FIG2 is a schematic diagram of a device architecture in an optional embodiment;

[0079] FIG3 is a schematic diagram showing the principle of matrix quantization compression in an optional implementation manner;

[0080] FIG4 is a schematic structural diagram of a momentum parameter ratio matrix to be compressed in an optional embodiment;

[0081] FIG5 is a schematic diagram of the structure of a data processing system based on a distributed cluster in an embodiment of the present application;

[0082] FIG6 is a schematic diagram of the structure of a data processing device based on a distributed cluster in an embodiment of the present application;

[0083] FIG7 is a schematic structural diagram of a non-volatile readable storage medium in an embodiment of the present application. DETAILED DESCRIPTION

[0084] The core of the embodiment of the present application is to provide a data processing method based on a distributed cluster, which can perform distributed training of deep learning models, improve the convergence speed, and reduce the training time.

[0085] In order to enable those skilled in the art to better understand the embodiments of the present application, the embodiments of the present application are described in detail below in conjunction with the accompanying drawings and optional implementation methods. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without making creative work are within the scope of protection of the embodiments of the present application.

[0086] Please refer to Figure 1, which is an implementation flow chart of a distributed cluster-based data processing method in an embodiment of the present application. The distributed cluster-based data processing method can be applied to each terminal device in the distributed cluster, and n terminal devices are all communicated with the target edge domain device, where n is a positive integer. The distributed cluster-based data processing method includes the following steps:

[0087] Step S101: Obtain one batch of training samples and train its own deep learning model to determine the gradient data of the deep learning model.

[0088] Optionally, in the embodiment of the present application, distributed training of the deep learning model is performed. Therefore, the embodiment of the present application needs to be applied to each terminal device under the target edge domain device, that is, each terminal device under the target edge domain device has its own deep learning model. The terminal devices in the distributed cluster can also be called cross-domain heterogeneous devices. Here, cross-domain refers to cross-geographic domains, and heterogeneous devices refer to terminal devices that can include various different forms, such as mobile phones, cameras, personal computers, and other terminal devices with certain computing capabilities.

[0089] In addition, it should be noted that in a distributed cluster, one or more target edge domain devices can be set up, and for any target edge domain device, the target edge domain device can be connected to one or more terminal devices. For example, Figure 2 is a schematic diagram of the device architecture in an optional embodiment, where target edge domain device 1 and target edge domain device 2 are both connected to the data center, and target edge domain device 1 and target edge domain device 2 are both connected to multiple terminal devices.

[0090] In practical applications, deep learning models can perform different tasks in different edge domains. Therefore, data exchange between different target edge domain devices is generally not necessary. Furthermore, in practical applications, deep learning models are typically trained on a given dataset using the computing power of a data center or edge domain. After a specific number of training cycles, the deep learning models are then deployed on various terminal devices. Of course, the accuracy of the deep learning models at this stage is still insufficient, and further training based on the training data collected by the terminal devices is required to achieve the required accuracy.

[0091] That is, in an optional implementation of the present application, the deep learning model used by the terminal device is a pre-trained deep learning model sent by the data center.

[0092] The training algorithm for model pre-training can be set and adjusted according to actual needs. In this implementation, since each terminal device can receive the pre-trained deep learning model sent by the data center, it is helpful to reduce the overall training time, that is, each terminal device does not need to start model training from scratch.

[0093] For any terminal device, each time step S101 is triggered, the terminal device can obtain a batch of training samples and train its own deep learning model to obtain local parameter gradients. When determining the gradient data, the loss function can be, for example, a cross entropy loss function.

[0094] The detailed training data content within a batch of training samples can be set and adjusted as needed. For example, in some cases, deep learning models are used for image recognition, and during training, a batch of training samples may be set to include several training images. When training a deep learning model, local parameter gradients can be obtained through forward and backward calculations.

[0095] In addition, it should be noted that there can be many types of deep learning models, such as deep learning models for image recognition, deep learning models for plant species recognition, deep learning models for face recognition, deep learning models for data classification and recognition, deep learning models for semantic analysis and recognition, and so on.

[0096] Step S102: Determine the first-order momentum matrix and the second-order momentum matrix of the gradient data based on the gradient data of the deep learning model.

[0097] Since the embodiment of the present application adopts a first-order optimization algorithm based on the first-order momentum matrix and the second-order momentum matrix, the embodiment of the present application needs to determine the first-order momentum matrix and the second-order momentum matrix of the gradient data based on the gradient data of the deep learning model determined in step S101, and the calculation method can be set and adjusted according to actual needs.

[0098] For example, in an optional implementation of the embodiment of the present application, determining the first-order momentum matrix of the gradient data based on the gradient data of the deep learning model includes:

[0099] According to the gradient data of the deep learning model, through m t =β1m t-1 +(1-β1)g t Determine the first-order momentum matrix of the gradient data;

[0100] Wherein, β1 represents a preset first parameter, which is usually less than 1 and greater than 0. t It represents the first-order momentum matrix of the gradient data determined during the t-th training, m t-1 It represents the first-order momentum matrix of the gradient data determined during the t-1th training. t It represents the gradient data of the deep learning model determined during the t-th training, and t represents the number of training times.

[0101] In practical applications, m0 is usually set to 0, that is, m0 is set to a matrix of all zeros. For example, during the first training, the first-order momentum matrix m1 of the gradient data can be determined by m1 = β1m0 + (1-β1)g1. That is, m1 is the first-order momentum matrix determined based on the first batch of training samples. Similarly, according to the above relationship, the corresponding first-order momentum matrix can be determined during each training.

[0102] It can be seen that in this implementation, the method of determining the first-order momentum matrix of the gradient data is relatively simple and convenient.

[0103] In an optional implementation of the embodiment of the present application, determining the second-order momentum matrix of the gradient data based on the gradient data of the deep learning model may include:

[0104] According to the gradient data of the deep learning model, through v t =β2v t-1 +(1-β2)(g t -m t ) 2 Determine the second-order momentum matrix of the gradient data;

[0105] Wherein, β2 represents a preset second parameter, which is usually less than 1 and greater than 0. t It represents the first-order momentum matrix of the gradient data determined during the t-th training, v t It represents the second-order momentum matrix of the gradient data determined during the t-th training, v t-1 It represents the second-order momentum matrix of the gradient data determined during the t-1th training, g t It represents the gradient data of the deep learning model determined during the t-th training, and t represents the number of training times.

[0106] In this embodiment, an optional method for determining the second-order momentum matrix of the gradient data is described, that is, by v t =β2v t- 1+(1-β2)(g t -mt ) 2 Determine the second-order momentum matrix of the gradient data. It should be noted that in the usual solution, the first-order momentum matrix m is not considered when determining the second-order momentum matrix. t The design of this implementation method is conducive to improving the accuracy of the determined second-order momentum matrix, and is also relatively simple and convenient in calculation, that is, it does not increase the complexity of the calculation too much.

[0107] Step S103: Send the first-order momentum matrix and the second-order momentum matrix to the target edge domain device, so that the target edge domain device determines the average value of n first-order momentum matrices and the average value of n second-order momentum matrices based on the data sent by the n terminal devices respectively received, and determines the momentum parameter ratio matrix of the preset first-order optimization algorithm based on the determined average value of the n first-order momentum matrices and the average value of the n second-order momentum matrices.

[0108] Any one of the n terminal devices will send the first-order momentum matrix and the second-order momentum matrix determined by itself to the target edge domain device. Therefore, in each round of iteration, the target edge domain device can receive the data sent by the n terminal devices, that is, it receives n first-order momentum matrices and n second-order momentum matrices.

[0109] The target edge domain device can determine the average value of n first-order momentum matrices and the average value of n second-order momentum matrices, and then determine the momentum parameter ratio matrix of the preset first-order optimization algorithm based on the determined average value of the n first-order momentum matrices and the average value of the n second-order momentum matrices.

[0110] For example, in an optional implementation of the embodiment of the present application, the target edge domain device determines a momentum parameter ratio matrix of a preset first-order optimization algorithm based on the determined average values ​​of n first-order momentum matrices and n second-order momentum matrices, including:

[0111] The target edge domain device is based on the average value of the determined n first-order momentum matrices and the average value of the n second-order momentum matrices, according to The momentum parameter ratio matrix rt of the preset first-order optimization algorithm is determined in this way;

[0112] in, It represents the average value of n first-order momentum matrices determined by the target edge domain device. It represents the average value of n second-order momentum matrices determined by the target edge domain device, ε is a preset third parameter and ε>0.

[0113] Step S104: After the target edge domain device compresses the momentum parameter ratio matrix, it receives the compressed matrix sent by the target edge domain device and restores the size of the matrix. Based on the recovery result, the parameters of the deep learning model are updated through the first-order optimization algorithm, and the operation of step S101 is returned to be executed until the model training is completed.

[0114] The target edge domain device determines the momentum parameter ratio matrix r of the preset first-order optimization algorithm t After that, instead of directly t Instead of sending it to n terminal devices, matrix compression will be performed first to reduce the amount of data that needs to be transmitted.

[0115] The implementation method of matrix compression can be set and adjusted according to actual needs. For example, in an optional implementation of the embodiment of the present application, the target edge domain device performs matrix compression on the momentum parameter ratio matrix, including:

[0116] The target edge domain device performs matrix quantization compression on the momentum parameter ratio matrix.

[0117] This implementation method takes into account that performing matrix quantization compression is computationally convenient and can effectively reduce the size of the matrix. Therefore, the target edge domain device performs matrix quantization compression on the momentum parameter ratio matrix.

[0118] Of course, there may be multiple quantization compression rules. For example, in an optional implementation of the embodiment of the present application, the target edge domain device performs matrix quantization compression on the momentum parameter ratio matrix, including:

[0119] The target edge domain device quantizes and compresses the momentum parameter ratio matrix of size a×b by taking the average value of each adjacent k data, and obtains The compressed matrix size.

[0120] Please refer to Figure 3, which is a schematic diagram of the principle of matrix quantization compression in an optional implementation. In this implementation, the momentum parameter ratio matrix of size a×b is quantized and compressed by averaging k adjacent data. The compressed matrix is ​​of a smaller size, that is, the compressed matrix size is only one kth of the original momentum parameter ratio matrix size.

[0121] In Figure 3, the momentum parameter ratio matrix before quantization compression is 4×4 in size. Of course, the size of the momentum parameter ratio matrix in actual applications can be much larger than this. Figure 3 only uses the momentum parameter ratio matrix of 4×4 size as an example for illustration. After the matrix is ​​quantized and compressed, the resulting matrix is ​​2×2 in size. It can be seen that the size of the compressed matrix is ​​only one-fourth of the size of the original momentum parameter ratio matrix, that is, in the example of Figure 3, k=4. In other optional implementations, the value of k can be adaptively adjusted according to the size of the momentum parameter ratio matrix. In Figure 3, Similarly, we can get:

[0122] In other optional implementations, there may be other quantization compression rules. For example, FIG4 is a schematic diagram of the structure of the momentum parameter ratio matrix to be compressed in an optional implementation. The average of a1, a2, a3, and a4 in FIG4 is calculated to obtain the first value of the first row of the matrix after compression, the average of a2, b1, a4, and b3 is calculated to obtain the second value of the first row of the matrix after compression, the average of b2, b1, b3, and b4 is calculated to obtain the third value of the first row of the matrix after compression, and the average of b2, e1, e2, and b4 is calculated to obtain the fourth value of the first row of the matrix after compression.

[0123] Similarly, the average of c1, c2, c3 and c4 in Figure 4 is obtained to obtain the first value of the second row of the compressed matrix, the average of d1, c2, d3 and c4 is obtained to obtain the second value of the second row of the compressed matrix, the average of d2, d1, d3 and d4 is obtained to obtain the third value of the second row of the compressed matrix, and the average of d2, e3, e4 and d4 is obtained to obtain the fourth value of the second row of the compressed matrix.

[0124] In the example of Figure 4, since the original matrix has five columns that are not divisible by 2, the column-wise data is selected using a sliding window, resulting in data reuse. However, since the number of rows is four and divisible by 2, the row-wise data does not need to be repeatedly selected. The row-wise division principle here is the same as in Figure 3.

[0125] It is also understandable that if data reuse occurs, the compression rate will be reduced, which is not conducive to reducing the size of the compressed matrix. Therefore, in practical applications, for a×b momentum parameter ratio matrix, both a and b can be In the case of integer division, the above-mentioned implementation is usually selected, and the quantization compression is The size of the compressed matrix is ​​implemented.

[0126] Since the target edge domain device sends matrix-compressed data, the terminal device needs to restore the matrix size after receiving the compressed matrix from the target edge domain device. For example, in the example shown in Figure 3, each element in the 2×2 matrix is ​​expanded into 4 parts, so that the matrix can be restored to a 4×4 size.

[0127] After the matrix is ​​restored, the parameters of the deep learning model can be updated based on the restored results through a first-order optimization algorithm. At this time, one round of training or one round of iteration is completed, and the operation of step S101 can be returned to start the next round of training until the model training is completed.

[0128] In an optional implementation of the embodiment of the present application, the parameter update of the deep learning model based on the recovery result by a first-order optimization algorithm described in step S104 includes:

[0129] pass Update the parameters of the deep learning model;

[0130] Among them, x t It represents the parameters of the deep learning model after the t-th training, x t+1 It represents the parameters of the deep learning model after the t+1th training, η represents the learning rate, and λ represents the decay coefficient, which is r t ′ represents the recovery result obtained after receiving the compressed matrix sent by the target edge domain device and restoring the size of the matrix.

[0131] In this implementation, the restored matrix r t ′, which can easily realize the parameter x of the deep learning model t Updates.

[0132] There are many ways to trigger the end of model training. For example, in an optional implementation of the embodiment of the present application, the trigger condition for the end of model training is:

[0133] The deep learning model converges, and / or the number of deep learning model training times reaches the set threshold.

[0134] In this embodiment, when the deep learning model converges, it means that the deep learning model obtained through training has achieved a good learning effect. Therefore, it can be used as a trigger condition for the end of model training, or as one of the trigger conditions for the end of model training. In addition, in some cases, when the number of times the deep learning model is trained reaches a set threshold, the training can usually be terminated regardless of whether the deep learning model converges, so as to avoid overfitting, excessive training time, and other problems. In the embodiment of the present application, t represents the number of training times, which can also be called the number of iterations.

[0135] In practical applications, the termination of deep learning training is usually triggered by either the convergence of the deep learning model or the number of times the deep learning model has been trained reaching a set threshold. Of course, in some cases, both conditions can be met simultaneously as the trigger for the termination of model training, depending on actual needs.

[0136] Step S105: Input the data to be identified into the trained deep learning model and obtain the identification result of the data to be identified.

[0137] After obtaining the trained deep learning model, the data to be identified is input into the trained deep learning model to obtain the recognition result of the data to be identified.

[0138] As described above, the recognition content of the deep learning model of the embodiment of the present application can be set as needed. In an optional implementation of the embodiment of the present application, considering that the deep learning model of the embodiment of the present application is generally a deep learning model based on a neural network, and computer image recognition, natural language processing, and data statistical analysis are application scenarios of classic neural networks, therefore, step S105 includes: inputting the data to be recognized into the trained deep learning model, performing computer image recognition, or performing natural language recognition, or performing pattern recognition, to obtain the recognition result of the data to be recognized.

[0139] Based on the deep learning model, computer image recognition can be performed, that is, identifying the content in the image; natural language recognition can be performed, that is, identifying text / voice content and converting it into text for output; pattern recognition can be performed, that is, data analysis can be performed, that is, identifying the patterns in the data.

[0140] In an optional implementation of the embodiment of the present application, after determining the first-order momentum matrix of the gradient data, the following steps may also be included:

[0141] Determining whether a difference between a first-order momentum matrix determined based on the current batch of training samples and a first-order momentum matrix determined based on the previous batch of training samples is less than a preset first value;

[0142] When it is determined that the difference between the first-order momentum matrix determined based on the training samples of this batch and the first-order momentum matrix determined based on the training samples of the previous batch is less than a preset first value, the first-order momentum matrix determined based on the training samples of this batch is saved, and for each subsequent training batch, the saved first-order momentum matrix is ​​used as the first-order momentum matrix of the determined gradient data.

[0143] This implementation method takes into account that as training continues, the first-order momentum matrix determined in step S102 may remain basically unchanged. In this case, if the first-order momentum matrix of the gradient data is still determined based on the current gradient data when step S102 is executed, it will result in a waste of computing resources.

[0144] In this implementation, the first-order momentum matrix determined based on the training samples of this batch is compared with the first-order momentum matrix determined based on the training samples of the previous batch. For example, when the t-1th round of training is performed, the first-order momentum matrix determined based on the training samples of this batch is m t-1 , and during the tth round of training, the first-order momentum matrix determined based on the training samples of this batch is m t , m t With m t- The difference △m between 1 can be expressed as: △m=|m t -m t-1 |, where | | represents the difference between the calculated matrices, that is, the 2-norm, which reflects the straight-line distance between the two vector matrices in space.

[0145] If m t With m t-1 The difference △m between them is less than the preset first value, for example, the first value is 0.001, then for each subsequent training batch, that is, when step S102 is executed again, the recorded m is directly t And the first-order momentum matrix as the determined gradient data, that is, m in this example t+1 , m t+2 , m t+3 ...are equal to m t , there is no need to calculate the first-order momentum matrix.

[0146] Of course, if m t With m t-1 If the difference △m between them is not less than the preset first value, it is necessary to continue calculating the first-order momentum matrix. For example, in the above optional implementation, by m t =β1m t-1 +(1-β1)g t To calculate the first-order momentum matrix.

[0147] In an optional implementation of the embodiment of the present application, after determining the second-order momentum matrix of the gradient data, the method further includes:

[0148] Determining whether a difference between a second-order momentum matrix determined based on the current batch of training samples and a second-order momentum matrix determined based on the previous batch of training samples is less than a preset second value;

[0149] When it is determined that the difference between the second-order momentum matrix determined based on the training samples of this batch and the second-order momentum matrix determined based on the training samples of the previous batch is less than a preset second value, the second-order momentum matrix determined based on the training samples of this batch is saved, and for each subsequent training batch, the saved second-order momentum matrix is ​​used as the second-order momentum matrix of the determined gradient data.

[0150] This embodiment takes into account that, similar to the previous embodiment, as training continues, the second-order momentum matrix determined in step S102 may remain basically unchanged. In this case, if step S102 is executed and the second-order momentum matrix of the gradient data is still determined based on the current gradient data, it will cause a waste of computing resources.

[0151] In this implementation, the second-order momentum matrix determined based on the current batch of training samples is compared with the second-order momentum matrix determined based on the previous two batches of training samples. If the difference is less than a preset second value, there is no need to calculate the second-order momentum matrix again. In subsequent iterations, the last calculated and saved second-order momentum matrix is ​​directly used. The principle is the same as above and will not be explained in detail.

[0152] In an optional implementation of the embodiment of the present application, after determining the first-order momentum matrix and the second-order momentum matrix of the gradient data, the following steps may be further included:

[0153] Bias correction is performed on both the first-order momentum matrix and the second-order momentum matrix;

[0154] Accordingly, the first-order momentum matrix and the second-order momentum matrix are sent to the target edge domain device, including:

[0155] The first-order momentum matrix after bias correction and the second-order momentum matrix after bias correction are sent to the target edge domain device.

[0156] This embodiment takes into account that bias correction can be performed on the first-order momentum matrix and the second-order momentum matrix of the determined gradient data to improve accuracy.

[0157] Of course, the bias correction algorithm can be set and selected as needed. For example, in an optional scenario, the first-order momentum matrix m t For example, you can use Perform the first-order momentum matrix m t Bias correction.

[0158] It can also be understood that, since both the first-order momentum matrix and the second-order momentum matrix are bias-corrected in this embodiment, when data is sent, the terminal device sends the first-order momentum matrix after bias correction and the second-order momentum matrix after bias correction to the target edge domain device. Similarly, the target edge domain device calculates the average value based on the first-order momentum matrices after bias correction sent by the n received terminal devices, and calculates the average value based on the second-order momentum matrices after bias correction sent by the n received terminal devices.

[0159] In an optional implementation of the embodiment of the present application, after determining the first-order momentum matrix and the second-order momentum matrix of the gradient data, the following steps may be further included:

[0160] Perform Cholesky decomposition on the first-order momentum matrix;

[0161] Accordingly, the first-order momentum matrix is ​​sent to the target edge domain device, including:

[0162] Put M or M T Sending the data to the target edge domain device so that the target edge domain device can recover the first-order momentum matrix according to the received data;

[0163] Among them, M represents the triangular matrix obtained after the Cholesky decomposition of the first-order momentum matrix, M T It represents the transposed matrix of the triangular matrix M.

[0164] This embodiment takes into account that if the first-order momentum matrix is ​​directly sent, the amount of data required to be transmitted is large. Therefore, in this embodiment, the first-order momentum matrix is ​​subjected to Cholesky decomposition.

[0165] Take the first-order momentum matrix m t For example, the Cholesky decomposition of the first-order momentum matrix can be expressed as:

[0166] Chol(m t )=MM T , where Chol is the Cholesky decomposition. Since only M or M T, which reduces the amount of data required to be transmitted by half, which is beneficial to reducing the training time and the data storage space required by the target edge domain device. The commonly used solution is to send M T .

[0167] It is understandable that in this embodiment, the first-order momentum matrix is ​​not sent directly, but the M or M obtained after the Cholesky decomposition is sent. T , so the target edge domain device receives M or M T After that, you need to receive M or M T Recover the first-order momentum matrix m t .

[0168] In an optional implementation of the embodiment of the present application, after determining the first-order momentum matrix and the second-order momentum matrix of the gradient data, the method further includes:

[0169] Perform Cholesky decomposition on the second-order momentum matrix;

[0170] Accordingly, the second-order momentum matrix is ​​sent to the target edge domain device, including:

[0171] Set V or V T Sending the data to the target edge domain device so that the target edge domain device can recover the second-order momentum matrix according to the received data;

[0172] Among them, V represents the triangular matrix obtained after the Cholesky decomposition of the second-order momentum matrix, V T It represents the transposed matrix of the triangular matrix V.

[0173] Similar to the previous implementation, this implementation takes into account that if the second-order momentum matrix is ​​sent directly, the amount of data required to be transmitted is large. Therefore, the second-order momentum matrix is ​​Cholesky decomposed before being sent, which reduces the amount of data required to be transmitted by half, which helps to reduce training time and also helps to reduce the data storage space required by the target edge domain device. Since the principle is the same as above, it will not be repeated.

[0174] In an optional implementation of the embodiment of the present application, the method may further include:

[0175] When the communication connection with the target edge domain device is lost, a fault prompt message is output.

[0176] Since it is distributed training, the solution of the embodiment of the present application requires data interaction between the terminal device and the target edge domain device. Therefore, for a certain terminal device, when the communication connection with the target edge domain device is lost, a fault prompt message can be output so that the staff can handle the fault in time.

[0177] Optionally, in an optional implementation of the embodiment of the present application, the following may also be included:

[0178] Collect statistics on the communication time with the target edge domain device.

[0179] The solution of the embodiment of the present application can effectively reduce the training time and ensure a high convergence speed. However, in some cases, the training progress may still be slow. In this regard, this implementation method can count the communication time between the terminal device and the target edge domain device, so that if the communication time between the terminal device and the target edge domain device is abnormal, the staff can discover it in time. In addition, counting the communication time also helps the staff in subsequent communication analysis and communication optimization.

[0180] The technical solution provided by the embodiment of the present application is applied to each terminal device in the distributed cluster, and the n terminal devices are all connected to the target edge domain device in communication. During training, each terminal device will obtain a batch of training samples and train its own deep learning model to determine the gradient data of the deep learning model. The embodiment of the present application adopts a first-order optimization algorithm based on the first-order momentum matrix and the second-order momentum matrix, which can improve the convergence speed compared to the traditional SGD scheme. According to the gradient data of the deep learning model, the first-order momentum matrix and the second-order momentum matrix of the gradient data can be determined and sent to the target edge domain device, that is, the target edge domain device can determine the average value of the n first-order momentum matrices and the average value of the n second-order momentum matrices based on the data sent by the n terminal devices received, and determine the momentum parameter ratio matrix of the preset first-order optimization algorithm based on the determined average value of the n first-order momentum matrices and the average value of the n second-order momentum matrices.

[0181] Considering the large size of the momentum parameter ratio matrix, the target edge device compresses the momentum parameter ratio matrix before sending it to each terminal device. After receiving the compressed matrix from the target edge device, the terminal device can restore the matrix size. Based on the restored matrix, the first-order optimization algorithm is used to update the parameters of the deep learning model and continue the next round of training until the model training is completed. It can be seen that because the target edge device compresses the momentum parameter ratio matrix before sending it, the amount of data required for communication is reduced, which also helps to reduce training time.

[0182] In summary, the solution of the embodiment of the present application can perform distributed training of deep learning models, improve the convergence speed, and reduce training time.

[0183] Corresponding to the above method embodiment, the embodiment of the present application further provides a data processing system based on a distributed cluster, which can be referred to in correspondence with the above.

[0184] 5 is a schematic diagram showing the structure of a distributed cluster-based data processing system according to an embodiment of the present application. The system is applied to each terminal device in the distributed cluster, and n terminal devices are all in communication with the target edge domain device, where n is a positive integer. The distributed cluster-based data processing system includes:

[0185] The gradient data determination module 501 is configured to obtain a batch of training samples and train its own deep learning model to determine the gradient data of the deep learning model;

[0186] A momentum determination module 502 is configured to determine a first-order momentum matrix and a second-order momentum matrix of the gradient data based on the gradient data of the deep learning model;

[0187] The momentum sending module 503 is configured to send the first-order momentum matrix and the second-order momentum matrix to the target edge domain device, so that the target edge domain device determines an average value of n first-order momentum matrices and an average value of n second-order momentum matrices based on the data received from each of the n terminal devices, and determines a momentum parameter ratio matrix of a preset first-order optimization algorithm based on the determined average values ​​of the n first-order momentum matrices and the average values ​​of the n second-order momentum matrices.

[0188] The parameter updating module 504 is configured to receive the compressed matrix sent by the target edge domain device after the target edge domain device compresses the momentum parameter ratio matrix, restore the size of the matrix, and update the parameters of the deep learning model based on the restored result using a first-order optimization algorithm, and trigger the gradient data determining module 501 until the model training is completed;

[0189] The execution module 505 is configured to input the data to be identified into the trained deep learning model and obtain the identification result of the data to be identified.

[0190] In an optional implementation of the embodiment of the present application, after determining the first-order momentum matrix of the gradient data, the momentum determination module 502 is further configured as follows:

[0191] Determining whether a difference between a first-order momentum matrix determined based on the current batch of training samples and a first-order momentum matrix determined based on the previous batch of training samples is less than a preset first value;

[0192] When it is determined that the difference between the first-order momentum matrix determined based on the training samples of this batch and the first-order momentum matrix determined based on the training samples of the previous batch is less than a preset first value, the first-order momentum matrix determined based on the training samples of this batch is saved, and for each subsequent training batch, the saved first-order momentum matrix is ​​used as the first-order momentum matrix of the determined gradient data.

[0193] In an optional implementation of the embodiment of the present application, after determining the second-order momentum matrix of the gradient data, the momentum determination module 502 is further configured to:

[0194] Determining whether a difference between a second-order momentum matrix determined based on the current batch of training samples and a second-order momentum matrix determined based on the previous batch of training samples is less than a preset second value;

[0195] When it is determined that the difference between the second-order momentum matrix determined based on the training samples of this batch and the second-order momentum matrix determined based on the training samples of the previous batch is less than a preset second value, the second-order momentum matrix determined based on the training samples of this batch is saved, and for each subsequent training batch, the saved second-order momentum matrix is ​​used as the second-order momentum matrix of the determined gradient data.

[0196] In an optional implementation of the embodiment of the present application, after the momentum determination module 502 determines the first-order momentum matrix and the second-order momentum matrix of the gradient data, it is further set to:

[0197] Bias correction is performed on both the first-order momentum matrix and the second-order momentum matrix;

[0198] Accordingly, the momentum sending module 503 sends the first-order momentum matrix and the second-order momentum matrix to the target edge domain device, including:

[0199] The first-order momentum matrix after bias correction and the second-order momentum matrix after bias correction are sent to the target edge domain device.

[0200] In an optional implementation of the embodiment of the present application, after determining the first-order momentum matrix and the second-order momentum matrix of the gradient data, the momentum determination module 502 is further configured as follows:

[0201] Perform Cholesky decomposition on the first-order momentum matrix;

[0202] Accordingly, the momentum sending module 503 sends the first-order momentum matrix to the target edge domain device, including:

[0203] Put M or MT Sending the data to the target edge domain device so that the target edge domain device can recover the first-order momentum matrix according to the received data;

[0204] Among them, M represents the triangular matrix obtained after the Cholesky decomposition of the first-order momentum matrix, M T It represents the transposed matrix of the triangular matrix M.

[0205] In an optional implementation of the embodiment of the present application, after determining the first-order momentum matrix and the second-order momentum matrix of the gradient data, the momentum determination module 502 is further configured as follows:

[0206] Perform Cholesky decomposition on the second-order momentum matrix;

[0207] Accordingly, the momentum sending module 503 sends the second-order momentum matrix to the target edge domain device, including:

[0208] Set V or V T Sending the data to the target edge domain device so that the target edge domain device can recover the second-order momentum matrix according to the received data;

[0209] Among them, V represents the triangular matrix obtained after the Cholesky decomposition of the second-order momentum matrix, V T It represents the transposed matrix of the triangular matrix V.

[0210] In an optional implementation of the embodiment of the present application, the target edge domain device performs matrix compression on the momentum parameter ratio matrix, including:

[0211] The target edge domain device performs matrix quantization compression on the momentum parameter ratio matrix.

[0212] In an optional implementation of the embodiment of the present application, the target edge domain device performs matrix quantization compression on the momentum parameter ratio matrix, including:

[0213] The target edge domain device quantizes and compresses the momentum parameter ratio matrix of size a×b by taking the average value of each adjacent k data, and obtains The compressed matrix size.

[0214] In an optional implementation of the embodiment of the present application, the target edge domain device determines a momentum parameter ratio matrix of a preset first-order optimization algorithm based on the determined average values ​​of the n first-order momentum matrices and the average values ​​of the n second-order momentum matrices, including:

[0215] The target edge domain device is based on the average value of the determined n first-order momentum matrices and the average value of the n second-order momentum matrices, according to The momentum parameter ratio matrix r of the preset first-order optimization algorithm is determined by t ;

[0216] in, It represents the average value of n first-order momentum matrices determined by the target edge domain device. It represents the average value of n second-order momentum matrices determined by the target edge domain device, ε is a preset third parameter and ε>0.

[0217] In an optional implementation of the embodiment of the present application, the parameter updating module 504 updates the parameters of the deep learning model based on the recovery result using a first-order optimization algorithm, including:

[0218] pass Update the parameters of the deep learning model;

[0219] Among them, x t It represents the parameters of the deep learning model after the t-th training, x t+1 It represents the parameters of the deep learning model after the t+1th training, η represents the learning rate, and λ represents the decay coefficient, which is r t ′ represents the recovery result obtained after receiving the compressed matrix sent by the target edge domain device and restoring the size of the matrix.

[0220] In an optional implementation of the embodiment of the present application, the momentum determination module 502 determines the first-order momentum matrix of the gradient data based on the gradient data of the deep learning model, including:

[0221] According to the gradient data of the deep learning model, through m t =β1m t-1 +(1-β1)g t Determine the first-order momentum matrix of the gradient data;

[0222] Among them, β1 represents the preset first parameter, m t It represents the first-order momentum matrix of the gradient data determined during the t-th training, m t-1 It represents the first-order momentum matrix of the gradient data determined during the t-1th training. t It represents the gradient data of the deep learning model determined during the t-th training, and t represents the number of training times.

[0223] In an optional implementation of the embodiment of the present application, the momentum determination module 502 determines the second-order momentum matrix of the gradient data based on the gradient data of the deep learning model, including:

[0224] According to the gradient data of the deep learning model, through v t =β2v t-1 +(1-β2)(g t -m t ) 2 Determine the second-order momentum matrix of the gradient data;

[0225] Among them, β2 represents the preset second parameter, m t It represents the first-order momentum matrix of the gradient data determined during the t-th training, v t It represents the second-order momentum matrix of the gradient data determined during the t-th training, v t-1 It represents the second-order momentum matrix of the gradient data determined during the t-1th training, g t It represents the gradient data of the deep learning model determined during the t-th training, and t represents the number of training times.

[0226] In an optional implementation of the embodiment of the present application, the execution module 505 is configured to:

[0227] The data to be identified is input into the trained deep learning model to perform computer image recognition, natural language recognition, or pattern recognition to obtain the recognition result of the data to be identified.

[0228] In an optional implementation of the embodiment of the present application, the triggering condition for the end of model training is:

[0229] The deep learning model converges, and / or the number of deep learning model training times reaches the set threshold.

[0230] In an optional implementation of the embodiment of the present application, a prompt information output module is further included, which is configured to:

[0231] When the communication connection with the target edge domain device is lost, a fault prompt message is output.

[0232] In an optional implementation of the embodiment of the present application, a statistics module is further included, which is configured to:

[0233] Collect statistics on the communication time with the target edge domain device.

[0234] In an optional implementation of an embodiment of the present application, the deep learning model used by the terminal device is a deep learning model that has undergone model pre-training and sent by the data center.

[0235] Corresponding to the above method embodiments, the embodiments of the present application further provide a data processing device based on a distributed cluster and a non-volatile readable storage medium, which can be referred to in correspondence with the above.

[0236] Referring to FIG6 , the distributed cluster-based data processing device may include:

[0237] Memory 601 is configured to store computer programs;

[0238] The processor 602 is configured to execute a computer program to implement the steps of the distributed cluster-based data processing method in any of the above embodiments.

[0239] Referring to FIG. 7 , a non-volatile readable storage medium 70 stores a computer program 71. When executed by a processor, computer program 71 implements the steps of the distributed cluster-based data processing method described in any of the above embodiments. The non-volatile readable storage medium 70 herein includes random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.

[0240] It should also be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0241] Professionals can also appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.

[0242] Optional examples are used herein to illustrate the principles and implementation methods of the embodiments of the present application. The description of the above embodiments is only intended to help understand the technical solutions and core concepts of the embodiments of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the embodiments of the present application, several improvements and modifications can be made to the embodiments of the present application, and such improvements and modifications also fall within the scope of protection of the embodiments of the present application.

Claims

1. A data processing method based on a distributed cluster, characterized in that: Applied to each terminal device in a distributed cluster, and n terminal devices are all connected to the target edge domain device for communication, n is a positive integer, and the data processing method based on the distributed cluster includes: Obtaining a batch of training samples and training its own deep learning model to determine the gradient data of the deep learning model; Determining a first-order momentum matrix and a second-order momentum matrix of the gradient data according to the gradient data of the deep learning model; Sending the first-order momentum matrix and the second-order momentum matrix to the target edge domain device, so that the target edge domain device determines an average value of n first-order momentum matrices and an average value of n second-order momentum matrices according to the data received from the n terminal devices, and determines a momentum parameter ratio matrix of a preset first-order optimization algorithm based on the determined average values ​​of the n first-order momentum matrices and the average values ​​of the n second-order momentum matrices; After the target edge domain device compresses the momentum parameter ratio matrix, the compressed matrix sent by the target edge domain device is received and the size of the matrix is ​​restored, and based on the restoration result, the parameters of the deep learning model are updated through the first-order optimization algorithm, and the operation of obtaining one batch of training samples and training its own deep learning model is returned to be executed until the model training is completed; The data to be identified is input into the trained deep learning model to obtain the identification result of the data to be identified.

2. The data processing method based on distributed cluster according to claim 1, characterized in that: After determining the first-order momentum matrix of the gradient data, the method further includes: Determine whether a difference between a first-order momentum matrix determined based on the current batch of training samples and a first-order momentum matrix determined based on the previous batch of training samples is less than a preset first value; When it is determined that the difference between a first-order momentum matrix determined based on the training samples of this batch and a first-order momentum matrix determined based on the training samples of the previous batch is less than the preset first value, the first-order momentum matrix determined based on the training samples of this batch is saved, and for each subsequent training batch, the saved first-order momentum matrix is ​​used as the first-order momentum matrix of the determined gradient data.

3. The data processing method based on distributed cluster according to claim 1, characterized in that: After determining the second-order momentum matrix of the gradient data, the method further includes: Determine whether a difference between a second-order momentum matrix determined based on the current batch of training samples and a second-order momentum matrix determined based on the previous batch of training samples is less than a preset second value; When it is determined that the difference between the second-order momentum matrix determined based on the training samples of this batch and the second-order momentum matrix determined based on the training samples of the previous batch is less than a preset second value, the second-order momentum matrix determined based on the training samples of this batch is saved, and for each subsequent training batch, the saved second-order momentum matrix is ​​used as the second-order momentum matrix of the determined gradient data.

4. The data processing method based on distributed cluster according to claim 1, characterized in that: After determining the first-order momentum matrix and the second-order momentum matrix of the gradient data, the method further includes: Bias correction is performed on both the first-order momentum matrix and the second-order momentum matrix; Accordingly, sending the first-order momentum matrix and the second-order momentum matrix to the target edge domain device includes: The first-order momentum matrix after bias correction and the second-order momentum matrix after bias correction are sent to the target edge domain device.

5. The data processing method based on distributed cluster according to claim 1, characterized in that: After determining the first-order momentum matrix and the second-order momentum matrix of the gradient data, the method further includes: Perform Cholesky decomposition on the first-order momentum matrix; Accordingly, sending the first-order momentum matrix to the target edge domain device includes: M or M T Sending to the target edge domain device so that the target edge domain device can restore the first-order momentum matrix according to the received data; Wherein, M represents the triangular matrix obtained after performing Cholesky decomposition on the first-order momentum matrix, M T represents the transposed matrix of the triangular matrix M.

6. The data processing method based on distributed cluster according to claim 1, characterized in that: After determining the first-order momentum matrix and the second-order momentum matrix of the gradient data, the method further includes: Perform Cholesky decomposition on the second-order momentum matrix; Accordingly, sending the second-order momentum matrix to the target edge domain device includes: Set V or V T Sending to the target edge domain device so that the target edge domain device can restore the second-order momentum matrix according to the received data; Wherein, V represents the triangular matrix obtained after performing Cholesky decomposition on the second-order momentum matrix, V T represents the transposed matrix of the triangular matrix V.

7. The data processing method based on distributed cluster according to claim 1, characterized in that: The target edge domain device performs matrix compression on the momentum parameter ratio matrix, including: The target edge domain device performs matrix quantization compression on the momentum parameter ratio matrix.

8. The distributed cluster-based data processing method according to claim 7, characterized in that: The target edge domain device performs matrix quantization compression on the momentum parameter ratio matrix, including: The target edge domain device quantizes and compresses the momentum parameter ratio matrix of size a×b by averaging each adjacent k data, and obtains The compressed matrix size.

9. The data processing method based on distributed cluster according to claim 1, characterized in that: The target edge domain device determines a momentum parameter ratio matrix of a preset first-order optimization algorithm based on the determined average values ​​of the n first-order momentum matrices and the average values ​​of the n second-order momentum matrices, including: The target edge domain device is based on the determined average values ​​of the n first-order momentum matrices and the n second-order momentum matrices, according to The momentum parameter ratio matrix r of the preset first-order optimization algorithm is determined by t ; in, represents the average value of n first-order momentum matrices determined by the target edge domain device, It represents the average value of n second-order momentum matrices determined by the target edge domain device, ε is a preset third parameter and ε>0.

10. The data processing method based on distributed cluster according to claim 1, characterized in that: Based on the recovery result, the parameters of the deep learning model are updated by the first-order optimization algorithm, including: pass Updating parameters of the deep learning model; Among them, x t represents the parameters of the deep learning model after the tth training, x t+1 represents the parameters of the deep learning model after the t+1th training, η represents the learning rate, λ represents the attenuation coefficient, and is r t ' represents the recovery result obtained after receiving the compressed matrix sent by the target edge domain device and restoring the size of the matrix.

11. The data processing method based on distributed cluster according to claim 1, characterized in that: Determining a first-order momentum matrix of the gradient data according to the deep learning model includes: According to the gradient data of the deep learning model, through m t =β1m t-1 +(1-β1)g t Determining a first-order momentum matrix of the gradient data; Among them, β1 represents the preset first parameter, m t It represents the first-order momentum matrix of the gradient data determined during the t-th training. t-1 It represents the first-order momentum matrix of the gradient data determined during the t-1th training. t It represents the gradient data of the deep learning model determined during the t-th training, and t represents the number of training times.

12. The data processing method based on distributed cluster according to claim 1, characterized in that: Determining a second-order momentum matrix of the gradient data according to the deep learning model includes: According to the gradient data of the deep learning model, through v t =β2v t-1 +(1-β2)(g t -m t ) 2 Determining a second-order momentum matrix of the gradient data; Among them, β2 represents the preset second parameter, m t It represents the first-order momentum matrix of the gradient data determined during the t-th training, v t It represents the second-order momentum matrix of the gradient data determined during the t-th training, v t-1 It represents the second-order momentum matrix of the gradient data determined during the t-1th training. t It represents the gradient data of the deep learning model determined during the t-th training, and t represents the number of training times.

13. The data processing method based on distributed cluster according to claim 1, characterized in that: The step of inputting the data to be identified into the trained deep learning model and obtaining the identification result of the data to be identified includes: The data to be recognized is input into the trained deep learning model to perform computer image recognition, natural language recognition, or pattern recognition to obtain the recognition result of the data to be recognized.

14. The data processing method based on distributed cluster according to claim 1, characterized in that: The triggering condition for the end of the model training is: The deep learning model converges, and / or the number of trainings of the deep learning model reaches a set threshold number of times.

15. The distributed cluster-based data processing method according to claim 1, characterized in that: Also includes: When the communication connection with the target edge domain device is lost, a fault prompt message is output.

16. The distributed cluster-based data processing method according to claim 15, characterized in that: Also includes: The communication time consumed with the target edge domain device is counted.

17. The distributed cluster-based data processing method according to any one of claims 1 to 16, characterized in that: The deep learning model used by the terminal device is a pre-trained deep learning model sent by the data center.

18. A data processing system based on a distributed cluster, characterized in that: Applied to each terminal device in a distributed cluster, and n terminal devices are all connected to the target edge domain device for communication, n is a positive integer, and the distributed cluster-based data processing system includes: A gradient data determination module is configured to obtain a batch of training samples and perform training of its own deep learning model to determine the gradient data of the deep learning model; A momentum determination module is configured to determine a first-order momentum matrix and a second-order momentum matrix of the gradient data based on the gradient data of the deep learning model; A momentum sending module is configured to send the first-order momentum matrix and the second-order momentum matrix to the target edge domain device, so that the target edge domain device determines an average value of n first-order momentum matrices and an average value of n second-order momentum matrices according to the data received from the n terminal devices, and determines a momentum parameter ratio matrix of a preset first-order optimization algorithm based on the determined average values ​​of the n first-order momentum matrices and the average values ​​of the n second-order momentum matrices; A parameter updating module is configured to receive the compressed matrix sent by the target edge domain device and restore the size of the matrix after the target edge domain device compresses the momentum parameter ratio matrix, and based on the restoration result, update the parameters of the deep learning model through the first-order optimization algorithm, and trigger the gradient data determination module until the model training is completed; The execution module is configured to input the data to be identified into the trained deep learning model and obtain the identification result of the data to be identified.

19. A data processing device based on a distributed cluster, characterized in that: include: a memory arranged to store a computer program; A processor is configured to execute the computer program to implement the steps of the distributed cluster-based data processing method as described in any one of claims 1 to 17.

20. A non-volatile readable storage medium, characterized in that: The non-volatile readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the distributed cluster-based data processing method according to any one of claims 1 to 17 are implemented.

Citation Information

Patent Citations

  • Distributed depth learning system based on momentum and pruning

    CN109299781A

  • Model training method, service processing method, device and related equipment

    CN109978177A

  • Data processing method and device, storage medium and electronic equipment

    CN113254215A

  • Data processing method, system and equipment based on distributed cluster and storage medium

    CN115994590A

  • Neural network model training method, image classification method, text translation method and apparatus, and device

    WO2021253941A1

Cited By

  • Large model data enhancement method and device

    CN120471109A