A distributed model training system and method
The distributed model training system allocates tasks among multiple computing nodes and uses fitness functions and evolutionary operations to perform tasks, solving the problem of high and low efficiency in training resources for large tree-structured models, and achieving efficient computing resource utilization and automation. optimization.
Patent Information
- Application Number
- CN202410849948.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-06-27
AI Technical Summary
During the training process of large tree structure models, as the complexity of the model increases, the demand for computing resources is extremely high, especially CPU time and memory usage, resulting in low model training efficiency and difficulty in adapting to common computing platforms.
Using a distributed model training system, by allocating training tasks among multiple computing nodes, using fitness functions and evolutionary operations to perform tasks, parallel training and optimization of tree-structured models are achieved, and incremental fitness evaluation methods and efficient memory are adopted Library strategy to optimize computing resource utilization.
It achieves efficient training of large tree-structured models, reduces computing resource requirements, improves training efficiency, and promotes automated software and hardware collaborative optimization.
Smart Images

Figure CN118396140B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a distributed model training system and method. Background Art
[0002] Tree structure models, such as decision trees and Adaboost, are widely used in the field of industrial control due to their excellent interpretability. They support operations such as manual model analysis and model behavior intervention to achieve controllable artificial intelligence automated control. With the continuous improvement of industrial automation, industrial control issues are becoming increasingly complex, so large tree structure models with higher model complexity are needed to model the above industrial control.
[0003] Currently, genetic algorithms can be used to train large tree structure models. By simulating natural selection and genetic mechanisms, extensive searches can be conducted in the solution space, which helps to escape from local optimal solutions and find global or near-global optimal tree structures.
[0004] However, during the model training process, as the tree structure becomes more complex, the complexity of evolutionary operations such as crossover and mutation also increases accordingly, which consumes a lot of computing resources. Therefore, the training of ultra-large-scale tree-structured models has extremely high requirements for computing resources, including CPU time and memory usage, which puts higher requirements on the adaptability of model training and computing platforms.
[0005] Based on this, this specification provides a distributed model training system. Summary of the invention
[0006] This specification provides a distributed model training system and method to partially solve the above-mentioned problems existing in the prior art.
[0007] This manual adopts the following technical solutions:
[0008] The present specification provides a distributed model training system, the system comprising: a first computing node and second computing nodes; wherein the second computing nodes store a plurality of tree structure models, and the model to be trained is constructed according to the tree structure models respectively stored in the second computing nodes;
[0009] The first computing node is used to determine the fitness function according to the model training task; send the fitness function to the second computing nodes respectively; receive the target tree structure models sent by the second computing nodes; select several reference tree structure models from the historical tree structure models stored in the memory bank; generate each evolution operation execution task according to the target tree structure models and the reference tree structure models, and assign the evolution operation execution task to each second computing node; receive each updated tree structure model sent by the second computing node, use the incremental fitness evaluation method to determine the updated fitness corresponding to each updated tree structure model, determine each selected tree structure model from the updated tree structure models according to each updated fitness, and construct the current model to be trained according to each selected tree structure model, assign each tree structure model contained in the current model to be trained to each second computing node, and re-execute selection and evolution until the current model to be trained meets the first preset condition to obtain the trained target model;
[0010] The second computing node is used to receive the fitness function sent by the first computing node, determine the current fitness corresponding to each tree structure model stored in itself according to the fitness function, training samples and the annotations of the training samples, and select a target tree structure model from the tree structure models according to the current fitness corresponding to each tree structure model, and send the target tree structure model to the first computing node; receive the evolutionary operation execution task assigned by the first computing node, perform evolutionary operation according to the tree structure model parsed from the evolutionary operation execution task, obtain an updated tree structure model, and send the updated tree structure model to the first computing node.
[0011] This specification provides a distributed model training method, which is applied to a first computing node and includes:
[0012] Determine the fitness function based on the model training task;
[0013] Sending the fitness function to each second computing node respectively, so that each second computing node determines the current fitness corresponding to each tree structure model stored in itself according to the fitness function, the training sample and the annotation of the training sample, and selects a target tree structure model from the tree structure models according to the current fitness corresponding to each tree structure model, so as to return the target tree structure model to the first computing node;
[0014] Receiving each target tree structure model sent by each second computing node;
[0015] Selecting a number of reference tree structure models from various historical tree structure models stored in the memory bank;
[0016] Generate each evolution operation execution task according to each target tree structure model and the reference tree structure model, and assign each evolution operation execution task to each second computing node, so that each second computing node performs an evolution operation according to the tree structure model parsed from the evolution operation execution task, and obtains and returns an updated tree structure model;
[0017] Receiving each updated tree structure model sent by each second computing node, and using an incremental fitness evaluation method to determine the updated fitness corresponding to each updated tree structure model;
[0018] Determining each selected tree structure model from each updated tree structure model according to each updated fitness, and constructing the current to-be-trained model according to each selected tree structure model;
[0019] The tree structure models included in the current model to be trained are assigned to the second computing nodes, and the selection and evolution are re-executed until the current model to be trained meets the first preset condition, thereby obtaining a trained target model.
[0020] Optionally, the evolution operation includes a crossover operation and / or a mutation operation;
[0021] The step of generating each evolution operation execution task according to each target tree structure model and the reference tree structure model specifically includes:
[0022] Acquire a current crossover rate, determine each tree structure model to be crossed according to the current crossover rate, each target tree structure model and the reference tree structure model, and generate each crossover operation execution task according to each tree structure model to be crossed;
[0023] and / or
[0024] The current mutation rate is obtained, and the tree structure models to be mutated are determined according to the current mutation rate, the target tree structure models and the reference tree structure model, and the mutation operation execution tasks are generated according to the tree structure models to be mutated.
[0025] Optionally, the selecting of several reference tree structure models from each historical tree structure model stored in the memory library specifically includes:
[0026] Query the fitness, historical reuse frequency and diversity evaluation results of each historical tree structure model from the memory library;
[0027] For each historical tree structure model, the fitness, historical reuse frequency and diversity evaluation result of the historical tree structure model are substituted into a predefined selection function to obtain a screening index corresponding to the historical tree structure model;
[0028] According to the screening indicators respectively corresponding to the historical tree structure models, several reference tree structure models are selected from the historical tree structure models.
[0029] Optionally, the incremental fitness evaluation method is used to determine the updated fitness corresponding to each updated tree structure model, specifically including:
[0030] For each updated tree structure model, according to a predefined change detection function, determine the original tree structure model and the changed tree structure model included in the updated tree structure model;
[0031] Searching the cached fitness corresponding to the original tree structure model contained in the updated tree structure model from the pre-built fitness cache table;
[0032] Determine the change fitness of the change tree structure model included in the updated tree structure model according to the fitness function;
[0033] According to the cache fitness and the change fitness, an updated fitness corresponding to the updated tree structure model is determined.
[0034] Optionally, before re-executing the selection and evolution, the method further comprises:
[0035] Update the fitness function, update the crossover rate, and update the mutation rate.
[0036] Optionally, updating the fitness function, updating the crossover rate, and updating the mutation rate specifically includes:
[0037] Determine the fitness distribution corresponding to the current model to be trained according to the fitness corresponding to each tree structure model included in the current model to be trained;
[0038] Determine a population diversity evaluation result corresponding to the current model to be trained according to the differences between the tree structure models included in the current model to be trained;
[0039] Determining whether the current model to be trained meets a second preset condition according to the fitness distribution and the population diversity evaluation result;
[0040] When the current model to be trained meets the second preset condition, the fitness function, the crossover rate and the mutation rate are updated.
[0041] Optionally, allocating the evolution operation execution tasks to the second computing nodes specifically includes:
[0042] According to each tree structure model included in each evolution operation execution task, a dependency graph is constructed with each evolution operation execution task as a node and dependency relationships between the evolution operation execution tasks as an edge;
[0043] According to a predefined task partitioning function, the dependency graph is divided into a plurality of subgraphs;
[0044] Taking the acquired computing resource amounts corresponding to the respective second computing nodes, the current load of the respective second computing nodes executing the tasks, and the respective subgraphs included in the dependency graph as inputs, and inputting them into a predefined task allocation function, and determining the subgraphs corresponding to the respective second computing nodes;
[0045] According to the evolutionary operation execution tasks corresponding to the nodes contained in the subgraphs corresponding to the second computing nodes, the evolutionary operation execution tasks corresponding to the second computing nodes are determined, and the evolutionary operation execution tasks corresponding to the second computing nodes are respectively allocated to the second computing nodes.
[0046] Optionally, the method further comprises:
[0047] When updating the evolution operation execution tasks, determining the changed evolution operation execution tasks according to the evolution operation execution tasks after the update and the evolution operation execution tasks before the update;
[0048] Determine an adjusted dependency graph according to the changed evolution operation execution task and the dependency graph;
[0049] According to the adjusted dependency graph, each updated evolution operation is assigned to perform tasks.
[0050] Optionally, the method further comprises:
[0051] determining a plurality of preset communication schemes and a plurality of preset synchronization schemes;
[0052] For each second computing node, according to any one of the plurality of preset communication schemes and any one of the plurality of preset synchronization schemes, determine a plurality of communication synchronization schemes to be adopted when the second computing node executes each evolution operation execution task corresponding to the second computing node;
[0053] According to each tree structure model included in each evolutionary operation execution task corresponding to the second computing node and multiple communication synchronization schemes adopted by the second computing node, the communication overheads corresponding to the multiple communication synchronization schemes adopted by the second computing node are determined by a predefined communication overhead function;
[0054] According to the communication overheads corresponding to the multiple communication synchronization schemes adopted by the second computing node, the target communication synchronization scheme adopted by the second computing node when executing each evolutionary operation execution task corresponding to the second computing node is determined, and the target communication synchronization method used by the second computing node is sent to the second computing node.
[0055] Optionally, the method further comprises:
[0056] Obtaining the current load of each second computing node when executing each evolution operation execution task;
[0057] For each second computing node, when the current load of the second computing node is higher than a preset load threshold, at least part of the evolution operation execution tasks executed by the second computing node are allocated to other second computing nodes.
[0058] Optionally, the method further comprises:
[0059] Determine the task execution time of each second computing node respectively according to each evolution operation execution task corresponding to each second computing node;
[0060] Determine a first target duration according to the task execution duration of each second computing node;
[0061] According to the original number of the second computing nodes, determining the expanded number of the second computing nodes through a predefined scalability function, and determining a second target duration for each second computing node of the expanded number to perform each evolution operation execution task;
[0062] If the difference between the first target duration and the second target duration meets a third preset condition, the second computing node is deployed according to the expansion quantity.
[0063] Optionally, the method further comprises:
[0064] In each round of iterative training, determine the current model difference between the current model to be trained obtained by the current iterative training and the model to be trained obtained by the previous iterative training, and record the current model difference in the incremental update log;
[0065] In response to an update request, the incremental update log is searched, and the current model to be trained obtained by the current iterative training is determined based on the current model difference recorded in the incremental update log and the model to be trained obtained by the previous iterative training, and the current model to be trained is stored in the first computing node.
[0066] Optionally, the method further comprises:
[0067] In response to the trained target model, determining each tree node and each decision edge in each tree structure model included in the target model;
[0068] Determine each node code of each tree node, and determine each edge code of each decision edge;
[0069] According to a predefined mapping function, each node code is mapped to a first short code, and each edge code is mapped to a second short code; wherein the length of the first short code is smaller than that of the node code, and the length of the second short code is smaller than that of the edge code;
[0070] Establishing a first correspondence between each of the first short codes and each of the node codes, and establishing a second correspondence between each of the second short codes and each of the edge codes, constructing a mapping dictionary according to the first correspondence and the second correspondence, and storing the mapping dictionary;
[0071] According to the first corresponding relationship stored in the mapping dictionary, each node code corresponding to each tree node in each tree structure model included in the target model is replaced with each first short code;
[0072] According to the second corresponding relationship stored in the mapping dictionary, each edge code corresponding to each decision edge in each tree structure model included in the target model is replaced with each second short code;
[0073] A compressed first compression model is constructed according to the first short code and the second short code, and the first compression model is stored.
[0074] Optionally, the method further comprises:
[0075] Taking the first short codes corresponding to the tree nodes in the tree structure models included in the first compression model and the second short codes corresponding to the decision edges as input, and inputting them into a predefined counting function, to obtain the number of consecutive repetitions corresponding to the tree nodes in the tree structure models included in the first compression model and the number of consecutive repetitions corresponding to the decision edges;
[0076] According to the number of consecutive repetitions corresponding to each tree node and the number of consecutive repetitions corresponding to each decision edge, the first compression model is compressed by a run-length encoding method to obtain a second compression model.
[0077] This specification provides a distributed model training method, which is applied to a second computing node and includes:
[0078] Receiving a fitness function sent by a first computing node; wherein the fitness function is determined by the first computing node according to a model training task;
[0079] Determine the current fitness corresponding to each tree structure model stored in the system according to the fitness function, the training samples and the annotations of the training samples;
[0080] According to the current fitness corresponding to each of the tree structure models, a target tree structure model is selected from the tree structure models, and the target tree structure model is sent to the first computing node, so that the first computing node selects a number of reference tree structure models from the historical tree structure models stored in the memory bank, generates each evolution operation execution task according to the target tree structure model and the reference tree structure model, and allocates each evolution operation execution task;
[0081] Receive the evolutionary operation execution task assigned by the first computing node, perform the evolutionary operation according to the tree structure model parsed from the evolutionary operation execution task, obtain the updated tree structure model, and send the updated tree structure model to the first computing node, so that the first computing node adopts the incremental fitness evaluation method to determine the updated fitness corresponding to each updated tree structure model, determine each selected tree structure model from the updated tree structure models according to each updated fitness, and construct the current model to be trained according to each selected tree structure model.
[0082] This specification provides a distributed model training device, which is applied to a first computing node and includes:
[0083] A fitness function determination module is used to determine the fitness function according to the model training task;
[0084] A sending module, used to send the fitness function to each second computing node respectively, so that each second computing node determines the current fitness corresponding to each tree structure model stored in itself according to the fitness function, training samples and annotations of the training samples, and selects a target tree structure model from the tree structure models according to the current fitness corresponding to each tree structure model, so as to return the target tree structure model to the first computing node;
[0085] A first receiving module, used for receiving each target tree structure model sent by each second computing node;
[0086] A selection module, used for selecting a number of reference tree structure models from various historical tree structure models stored in the memory bank;
[0087] A task assignment module, used to generate each evolution operation execution task according to each target tree structure model and the reference tree structure model, and assign each evolution operation execution task to each second computing node, so that each second computing node performs an evolution operation according to the tree structure model parsed from the evolution operation execution task, and obtains and returns an updated tree structure model;
[0088] A fitness updating module, used to receive each updated tree structure model sent by each second computing node, and use an incremental fitness evaluation method to determine the updated fitness corresponding to each updated tree structure model;
[0089] A current model to be trained determination module, used to determine each selected tree structure model from each updated tree structure model according to each updated fitness, and construct the current model to be trained according to each selected tree structure model;
[0090] The target model determination module is used to assign each tree structure model included in the current model to be trained to each second computing node, and re-execute selection and evolution until the current model to be trained meets the first preset condition to obtain a trained target model.
[0091] This specification provides a distributed model training device, which is applied to a second computing node and includes:
[0092] A second receiving module is used to receive the fitness function sent by the first computing node; wherein the fitness function is determined by the first computing node according to the model training task;
[0093] A current fitness determination module is used to determine the current fitness corresponding to each tree structure model stored in the module according to the fitness function, the training samples and the annotations of the training samples;
[0094] A target tree structure model determination module is used to select a target tree structure model from the tree structure models according to the current fitness corresponding to each of the tree structure models, and send the target tree structure model to the first computing node, so that the first computing node selects a number of reference tree structure models from the historical tree structure models stored in the memory bank, and generates each evolution operation execution task according to the target tree structure model and the reference tree structure model, and allocates each evolution operation execution task;
[0095] A task execution module is used to receive the evolutionary operation execution task assigned by the first computing node, perform an evolutionary operation according to the tree structure model parsed from the evolutionary operation execution task, obtain an updated tree structure model, and send the updated tree structure model to the first computing node, so that the first computing node adopts an incremental fitness evaluation method to determine the updated fitness corresponding to each updated tree structure model, determine each selected tree structure model from the updated tree structure models according to each updated fitness, and construct the current model to be trained according to each selected tree structure model.
[0096] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned distributed model training method is implemented.
[0097] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned distributed model training method when executing the program.
[0098] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0099] In the distributed model training system provided in this specification, the system includes a first computing node and each second computing node, the first computing node sends the fitness function determined according to the model training task to each second computing node, each second computing node determines the current fitness corresponding to each tree structure model stored in itself based on the fitness function, thereby selecting the target tree structure model, and sending the target tree structure model to the first computing node, the first computing node selects a reference tree structure model from the memory library, generates an evolution operation execution task according to the reference tree structure model and the target tree structure model, and assigns it to each second computing node, each second computing node executes each evolution operation execution task respectively, obtains an updated tree structure model, the first computing node determines each selected tree structure model from each updated tree structure model, and constructs the current model to be trained, iterates multiple times until the first preset condition is met, and obtains the trained target model. It can be seen that through the above scheme, distributed computing adaptation based on a large computing cluster system is realized, automatic soft and hard collaborative optimization for large tree model construction is promoted, the problem of high computing resource occupation of large tree models is solved, and the training efficiency of large tree models is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0101] Figure 1 This is a schematic diagram of the structure of a distributed model training system in this specification;
[0102] Figure 2 A schematic diagram of the interactive process of a distributed model training method in this specification;
[0103] Figure 3 A flowchart of a distributed model training method in this specification;
[0104] Figure 4 A flowchart of a distributed model training method in this specification;
[0105] Figure 5 A flowchart of a distributed model training method in this specification;
[0106] Figure 6 A flowchart of a distributed model training method in this specification;
[0107] Figure 7 A schematic diagram of a distributed model training device provided in this specification;
[0108] Figure 8 A schematic diagram of a distributed model training device provided in this specification;
[0109] Fig. 9 The corresponding Figure 2 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0110] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0111] In addition, it should be noted that all actions of acquiring signals, information or data in this manual are performed in compliance with the relevant local data protection laws and policies and with the authorization given by the owner of the corresponding device.
[0112] It should be noted that, in the absence of conflict, the features in the following embodiments and implementations may be combined with each other.
[0113] With the development of information technology, machine learning models are used to automatically learn effective feature representations from data and improve the accuracy of prediction models. They have been widely used in speech recognition, image recognition, target detection and other fields. Among them, large tree structure models are widely used in many different industrial control fields. Large tree structure models can be constructed using models such as decision trees, random forests, gradient boosting trees (GBT), XGBoost, etc., and gradually subdivide the data space by creating a series of rules based on feature value splitting, ultimately achieving the purpose of prediction or classification. In addition, each tree structure model contained in the large tree structure model can complete the calculation independently. Compared with machine learning models of other structures, it also has the advantage of parallel computing, which greatly improves the prediction efficiency.
[0114] However, in practical applications, due to the complex model structure of large tree-structured models, not only will they occupy more storage resources, but they will also consume more computing resources during training and prediction. The hardware resources provided by a single machine are obviously difficult to support the storage and operation of a complete large tree-structured model. Therefore, it is necessary to split the large tree-structured model and use the hardware resources of different machines to perform distributed training, storage, and reasoning on multiple machines, thereby improving the operation efficiency of the large tree-structured model.
[0115] Based on this, this specification provides a distributed model training system, such as Figure 1 As shown, the system includes multiple computing nodes, including a first computing node and multiple second computing nodes. By deploying a large tree structure model with huge computing volume and data volume on multiple computing nodes to perform training and reasoning tasks in parallel, the computing efficiency of the large tree structure model is improved and the problem of tight hardware resources on a single machine is alleviated.
[0116] In this specification, the first computing node is the master node, which is used to generate and schedule computing tasks, and summarize the task execution status and results of each second computing node, so as to flexibly schedule each second computing node to execute computing tasks in parallel. Each second computing node is a slave node, which is used to receive and execute computing tasks assigned by the first computing node, and feed back the task execution results to the first computing node.
[0117] It should be noted that the distributed model training system provided in this specification can only execute the training process of the large tree structure model, or it can store the trained large tree structure model on the basis of executing the training, and execute the reasoning task of the model. This can be flexibly adjusted according to the specific application scenarios and task requirements, and this specification does not limit this.
[0118] In addition, in addition to being able to serve as the master node to undertake the generation and scheduling of computing tasks, as well as the aggregation of task execution results, the first computing node can also serve as a node for executing computing tasks, that is, after the first computing node generates multiple computing tasks, in addition to being able to assign each computing task to each second computing node, it can also retain a number of computing tasks for the first computing node itself to execute, so as to make full use of the hardware resources of the first computing node and reduce the communication overhead of task allocation and task result feedback. When the first computing node undertakes the execution of computing tasks, the first computing node executes steps similar to those executed by the second computing node disclosed in this specification, and will not be repeated.
[0119] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0120] Figure 2 A schematic diagram of an interactive process of a distributed model training method provided in this specification. The interactive parties of the distributed model training method can be Figure 1 The first computing node and the second computing node in the distributed model training system are shown.
[0121] S100: The first computing node determines a fitness function according to a model training task.
[0122] The distributed model training method disclosed in this specification is suitable for the training process of the model to be trained for the construction of large-scale tree-structured models. It adopts automated soft-hard collaborative optimization technology and performs distributed computing adaptation on the crossover, mutation, efficient memory and reuse methods, and dynamic hierarchical optimization involved in the training of large-scale tree-structured models to improve the utilization rate of computing resources.
[0123] In this specification, a genetic algorithm is used to train and optimize a model to be trained that includes multiple tree structure models. During the training process, each tree structure model included in the model to be trained can be stored in each second computing node (or in the first computing node) in a dispersed manner.
[0124] Among them, the fitness function in the genetic algorithm is an evaluation function used to quantify the excellence of each individual in the population for a specific problem. In short, the fitness function assigns a numerical value to each solution, which reflects the degree to which the solution (individual) is close to the optimal solution to the problem. The higher the fitness value, the better the solution is, and the more likely it is to be retained and further propagated during the evolution of the genetic algorithm. Specifically in the scenarios applicable to this specification, the population is the tree structure models contained in the model to be trained, and the individual is each tree structure model.
[0125] In general, the specific form of the fitness function depends on the problem to be solved and is directly related to the optimization goal. Specifically in this specification, the fitness function is determined according to the model training task of the model to be trained. The fitness function can be one or more of any existing evaluation indicators such as the accuracy, recall rate, F1 score, AUC, mean square error, mean absolute error, etc. of the model to be trained, and this specification does not limit this.
[0126] For example, the training goal of the model to be trained is to minimize the difference between the output result of the model to be trained and the sample annotation. The loss function is determined based on the difference between the output result of the model to be trained and the sample annotation, that is, the model training task is to minimize the loss function. The corresponding fitness function can be determined based on the similarity between the output result of the model to be trained and the sample annotation. Minimizing the loss function is to maximize the fitness function. In other words, the greater the fitness of an individual (tree structure model), the higher the similarity between the output result of the individual and the sample annotation, and the higher the probability of being retained and further propagated during the training process. Conversely, the smaller the fitness of an individual (tree structure model), the lower the similarity between the output result of the individual and the sample annotation, and the lower the probability of being retained and further propagated during the training process.
[0127] In addition, it should be noted that this specification does not limit the machine learning tasks performed by the untrained model to be trained and the trained target model, which can be machine learning tasks of any existing scenarios such as image classification, target recognition, anomaly detection, etc. For the convenience of explanation, the following takes the image classification model as an example to explain the specific technical solution.
[0128] Taking the image classification model as an example, its training goal is usually to minimize the difference between the predicted image category output by the image classification model and the corresponding labeled image category. Therefore, when the image classification model is trained using a genetic algorithm, the fitness function can be set to the similarity between the predicted image category output by the image classification model and the corresponding labeled image category. In this way, the fitness of each tree structure model contained in the image classification model represents the accuracy of each tree structure model in classifying sample images.
[0129] In addition, in this specification, the training samples and the annotations of the training samples used in the training process can be obtained by the following scheme:
[0130] Step 1: The input module needs to have a remote communication port to obtain real-time operating data from the production line status.
[0131] Specifically, in the industrialization scenario of artificial intelligence, in order to make the trained second model better adapt to the actual industrialization scenario and put it into practical application as soon as possible, the operation data from the production line status can be used as training samples during training. For example, in the face recognition scenario, the model to be trained is a face recognition model, and the training samples can be images containing faces taken from actual scenes, as well as face annotations contained in the images.
[0132] Optionally, runtime data is obtained from multiple production lines. Still taking the face recognition scenario as an example, the training samples of the face recognition model can be sample images containing faces taken in indoor scenes, or sample images containing faces taken in outdoor scenes.
[0133] Step 2: Store the received data in the computing node for storing training samples in the distributed model training system, and perform data cleaning on the computing node, that is, detect abnormal values and default values in the collected data, delete the data with the above conditions, and format the data after data cleaning, that is, use a unified data type to convert and standardize the data set, and perform data consistency check and data integrity verification again through the above-generated data. The computing node used to store training samples can be the first computing node, or it can be one or more second computing nodes among the second computing nodes. The annotation of training samples can come from manual annotation, automatic annotation from other credible machine learning models, or it can be obtained through any existing type of annotation method, which is not limited in this specification.
[0134] S102: Send the fitness function to each of the second computing nodes respectively.
[0135] S104: The second computing node receives the fitness function sent by the first computing node, and determines the current fitness corresponding to each tree structure model stored in the second computing node according to the fitness function, the training samples and the annotations of the training samples.
[0136] Specifically, each second computing node respectively stores one or more tree structure models among all the tree structure models contained in the model to be trained. Each tree structure model is actually a complete tree structure. The number of tree nodes, the number of decision edges and the tree structure contained in different tree structure models may be the same or different, and this specification does not limit this.
[0137] The fitness function is distributed to each second computing node. Each second computing node can evaluate each tree structure model stored in itself based on the fitness function to obtain the current fitness of each tree structure model. The current fitness is used to evaluate the ability of the tree structure model stored in the second computing node to solve the target task in the current population (model to be trained), where the target task is the task to be solved by the model to be trained. For example, when the model to be trained is an image classification model, the target task is to accurately classify the input image samples.
[0138] The current fitness of the tree structure model stored in the second computing node can be obtained by the following scheme:
[0139] The second computing node inputs the training sample into the tree structure model to obtain the prediction result output by the tree structure model, substitutes the prediction result and the annotation of the training sample into the fitness function, and obtains the current fitness of the tree structure model output by the fitness function. For example, taking the fitness function as an accuracy function, 10 sample images are respectively input into the tree structure model, and the tree structure model outputs the prediction image categories corresponding to the 10 sample images respectively, and the prediction image categories corresponding to the 10 sample images and the annotation image categories corresponding to the 10 sample images are respectively input into the accuracy function. If the number of sample images correctly classified by the tree structure model is 8, the accuracy can be determined to be 0.8, that is, the current fitness of the tree structure model is 0.8.
[0140] S106: Selecting a target tree structure model from the tree structure models according to the current fitness corresponding to each of the tree structure models.
[0141] In a genetic algorithm, the steps of obtaining new individuals based on individuals in the current population are generally selection and evolution. Since the model to be trained in this specification belongs to a large tree structure model, it contains a large number of tree structure models. Directly using the crossover rate and mutation rate to select the tree structure model for performing the evolution operation may still have the problem of too many selected tree structure models. For this reason, individuals with better performance in the current population can be selected first based on the current fitness of each tree structure model, and subsequent steps are performed based on these individuals with better performance.
[0142] Based on this, for each second computing node, after the second computing node determines the current fitness corresponding to each tree structure model stored in itself, it can sort the tree structure models stored in itself in order from large to small according to the current fitness, and select several tree structure models with larger current fitness as target tree structure models. The specific number of target tree structure models selected by each second computing node is not limited in this specification.
[0143] For example, the second computing node stores 100 tree structure models, and the 100 tree structure models can be sorted in descending order according to the current fitness, and the top 10 tree structure models are selected as the selected target tree structure models.
[0144] S108: Send the target tree structure model to the first computing node.
[0145] S110: The first computing node receives each target tree structure model sent by each second computing node.
[0146] S112: Selecting a number of reference tree structure models from the historical tree structure models stored in the memory library, and generating various evolution operation execution tasks according to the target tree structure models and the reference tree structure models.
[0147] In this manual, an efficient memory and reuse method is also adopted. By storing individuals with excellent performance in the historical training process (i.e., the historical tree structure model) in the memory bank, individuals with higher fitness in the history are introduced into the current iterative training, thereby expanding the potential solution space.
[0148] Specifically, the memory library M is a dynamically updated data structure that continuously absorbs new excellent individuals (historical tree structure model) according to the evolution process of the algorithm. i There is a corresponding historical fitness F(T i), and the historical fitness is a key indicator for evaluating its historical performance. After each round of iterative training performs the evolution operation, after the first computing node receives each updated tree structure model after evolution, it can select several tree structure models with relatively excellent performance from each updated tree structure model based on a predefined retention function and store them in the memory bank, so that in the subsequent iterative training process, they can be introduced into the subsequent population as individuals with excellent historical performance. An optional implementation of the retention function is as follows:
[0149]
[0150] The memory bank M can be expressed as M={T1,T2,...,T n}, where n is the number of individuals in the memory bank, and the memory bank also stores the historical fitness corresponding to each historical tree structure model, so that in each round of iterative training, it is determined whether to extract the corresponding historical tree structure model from the memory bank according to the historical fitness. For example, in each round of iterative training, one or more historical tree structure models with the largest historical fitness among the historical tree structure models stored in the memory bank can be used as the selected reference tree structure model. Of course, the selected reference tree structure model can also be determined by combining multiple indicators, such as individual diversity, reuse history records, etc., which is not limited in this specification.
[0151] The dynamic management mechanism of the memory bank method ensures that the historical tree structure model stored in the memory bank always reflects the latest trend of the current optimal solution, that is, the memory bank needs to be dynamically updated and timely eliminate old individuals that do not meet current needs. Specifically, the memory bank M regularly receives excellent individuals from the current population and eliminates some individuals with low fitness or outdated individuals. The update function upd(M) can be defined, which can be expressed as , where T new is a newly added individual, T old The eliminated individuals can be individuals whose storage time in the memory bank exceeds the preset time threshold, or individuals with lower fitness ranking after the introduction of new individuals.
[0152] The content of the memory bank is updated not only based on fitness, but also takes into account the adaptability of individuals to the current search requirements. Specifically, the adaptability evaluation function adapt(T i ,M), which evaluates the individual T i Relative to the fitness of other individuals in the memory pool M, individuals with higher fitness are more likely to be retained in the upd(M) process.
[0153] The efficient use of the memory bank involves how to effectively integrate individuals in the memory bank into the current population and how to accelerate the evolution process through these individuals. Individuals in the memory bank can be reused in many ways, including directly introducing them into the population as new individuals or as part of crossover and mutation operations. Specifically, define the reuse function reuse(T i ), which is based on the individual T i The reuse strategy and frequency are determined by the characteristics of the memory and the needs of the current population. The use effect of the memory is evaluated through performance monitoring, and the feedback mechanism is used to adjust the selection and update strategy of the memory. Specifically, a performance monitoring function mon(M) is defined, which monitors the reuse effect of individuals in the memory and provides feedback to adjust the selection function sel(M) and the update function upd(M).
[0154] Further, in one or more embodiments of the present specification, when a genetic algorithm is used to optimize the model to be trained, an evolutionary operation can be performed on the individuals in the population, and by simulating natural selection and genetic mechanisms, the optimal solution can be effectively searched in a high-dimensional and multimodal structural space. Among them, the evolutionary operation generally includes a crossover operation and a mutation operation. Specifically, in the distributed model training method provided in the present specification, in the application of a genetic algorithm to train the model to be trained, the population corresponds to each tree structure model stored in each second computing node in each round of iterative training, the individual corresponds to each tree structure model, and the evolutionary operation is applied to each target tree structure model and the reference tree structure model selected in S106. Moreover, in actual applications, for each target tree structure model or reference tree structure model, the evolutionary operation performed based on the target tree structure model or reference tree structure model can be a crossover operation or a mutation operation. Of course, a crossover operation and a mutation operation can also be performed. Therefore, in step S112, the first computing node generates each evolutionary operation execution task, which can be specifically implemented by the following implementation method:
[0155] Specifically, for each target tree structure model or reference tree structure model, the probability of the target tree structure model or reference tree structure model participating in a crossover operation can be determined based on the current crossover rate; and / or the probability of the target tree structure model or reference tree structure model participating in a mutation operation can be determined based on the current mutation rate.
[0156] That is to say, for generating cross-operation execution tasks, the current cross-rate is obtained, and the tree structure models to be crossed are determined according to the current cross-rate, the target tree structure models and the reference tree structure models, and the cross-operation execution tasks are generated according to the tree structure models to be crossed. Specifically, the current cross-rate is first obtained, and the tree structure models to be crossed are selected from the target tree structure models and the reference tree structure models according to the current cross-rate, and the cross-operation tasks are generated according to any two tree structure models to be crossed among the tree structure models to be crossed. Among them, the current cross-rate is used to indicate the proportion of the tree structure models to be crossed selected for cross-operation in the current round of iterative training to the target tree structure models and the reference tree structure models. Assuming that there are 100 target tree structure models and the reference tree structure models in total, and the current cross-rate is 0.9, 90 tree structure models to be crossed are selected from the 100 target tree structure models and the reference tree structure models, and each cross-operation execution task is generated based on these 90 tree structure models to be crossed. The current crossover rate may be a fixed value preset according to expert experience, or a variable value flexibly adjusted during training. The specific value of the current crossover rate is not limited in this specification.
[0157] For generating mutation operation execution tasks, the current mutation rate is obtained, and the tree structure models to be mutated are determined according to the current mutation rate, the target tree structure models and the reference tree structure models, and the mutation operation execution tasks are generated according to the tree structure models to be mutated. Specifically, similar to the aforementioned generation of crossover operation execution tasks, the current mutation rate is first obtained, and the current mutation rate is used to indicate the proportion of the tree structure models to be mutated selected for mutation operation in the current round of iterative training to the target tree structure models and the reference tree structure models. The tree structure models to be mutated are selected from the target tree structure models and the reference tree structure models according to the current mutation rate, and the mutation operation tasks are generated according to any two tree structure models to be mutated among the tree structure models to be mutated. For example, there are 100 target tree structure models and reference tree structure models in total, and the current mutation rate is 0.1, then 10 tree structure models to be crossed are selected from the 100 target tree structure models and the reference tree structure models, and each crossover operation execution task is generated based on the 10 tree structure models to be crossed. This specification also does not limit the specific value and adjustment of the current mutation rate.
[0158] It is understandable that when each evolution operation execution task is generated based on the above scheme, there may be a target tree structure model, or a reference target tree structure model is selected to perform the crossover operation and the mutation operation at the same time. In other words, although the mutation operation and the crossover operation can be performed independently, the mutation operation and the crossover operation can act on the same individual (target tree structure model or reference target tree structure model) or different individuals at the same time, and this specification does not limit this.
[0159] S114: Allocate each evolution operation execution task to each second computing node.
[0160] When the first computing node generates each evolution operation execution task, it packages each tree structure model corresponding to each evolution operation execution task, and sends the packaged tree structure models to the corresponding second computing node.
[0161] S116: The second computing node receives the evolution operation execution task assigned by the first computing node, performs an evolution operation according to the tree structure model parsed from the evolution operation execution task, and obtains an updated tree structure model.
[0162] Specifically, the evolutionary operation execution task may be a crossover operation execution task, or a mutation operation execution task. In the evolutionary operation performed according to each tree structure model parsed from the evolutionary operation execution task, when the evolutionary operation is a crossover operation, different subtrees in two tree structure models may be exchanged. Specifically, the tree nodes for cutting the subtrees may be first determined in the two tree structure models, respectively, and then the subtree after the cut tree node in one tree structure model may be replaced with the subtree at the corresponding position in the other tree structure model. It may also be a multi-point exchange, that is, multiple cutting and exchange at different depths of the tree structure model. Of course, it may also be any existing type of crossover operation mode. This specification does not limit the specific type of crossover operation.
[0163] When the evolution operation is a mutation operation, it can be the replacement of one or more tree nodes in the tree structure model included in the mutation operation execution task, for example, replacing the original tree node in the tree structure model with a new tree node, or replacing the original subtree after a tree node in the tree structure model with a new subtree. The mutation operation can also be to change the structure of the tree, such as inserting a new subtree at a certain tree node, or deleting a subtree, etc. The mutation operation can also be to directly change the feature test condition corresponding to the tree node, such as changing the tree node "determine whether there is a circular object in the input image" to "determine whether there is a rectangular object in the input image". Of course, it can also be any existing type of mutation operation method, and this specification does not limit the specific mutation operation type.
[0164] After the second computing node completes the evolutionary operation execution task, an updated tree structure model can be obtained. The updated tree structure model may be different from the tree structure model included in the evolutionary operation execution task in terms of tree structure, tree nodes, and decision edges. The updated tree structure model represents the new individuals formed during this round of iterative training, which is used to explore the current optimal solution.
[0165] S118: Send the updated tree structure model to the first computing node.
[0166] S120: The first computing node receives the updated tree structure models sent by the second computing nodes, and uses an incremental fitness evaluation method to determine the updated fitness corresponding to each of the updated tree structure models.
[0167] Furthermore, after completing the corresponding evolutionary operation execution task, each second computing node can send the obtained updated tree structure model to the first computing node. After the first computing node summarizes the updated tree structure models sent by each second computing node, other tasks will be assigned to each second computing node again. Specifically, a result synchronization function Sync(M) can be defined. This function is responsible for synchronizing the evolutionary operation results of each second computing node to the global population (that is, aggregating them to the first computing node), ensuring the global impact of the evolutionary operation, and assisting the first computing node to reasonably allocate the computing resources of each second computing node.
[0168] Afterwards, in a large-scale tree structure model, the fitness evaluation of each individual needs to traverse the entire tree, which makes the evaluation process abnormally slow, seriously affects the iteration speed of the algorithm, and reduces the effective utilization of computing resources for large-scale tree structure model training. In this manual, the incremental fitness evaluation method is adopted to determine the updated fitness corresponding to each updated tree structure model. By performing evaluation on demand, the computing resource cost in the training process is significantly reduced, and the effective utilization of computing resources is improved.
[0169] Specifically, for each updated tree structure model, first, the tree structure model corresponding to the updated tree structure model without evolution operation can be found from the target tree structure models and the reference tree structure model stored in the first computing node, and the changed tree structure model corresponding to the updated tree structure model can be determined according to the difference between the updated tree structure model and the corresponding tree structure model without evolution operation, and the updated fitness corresponding to the updated tree structure model can be converted into two parts: determining the fitness of the corresponding tree structure model without evolution operation and determining the fitness of the changed tree structure model, thereby avoiding the problem of traversing the entire tree structure of the updated tree structure model to determine the updated fitness.
[0170] S122: Determine each selected tree structure model from each updated tree structure model according to each updated fitness, and construct the current model to be trained according to each selected tree structure model.
[0171] Each updated tree structure model corresponds to an updated fitness, which is used to characterize the performance of the corresponding updated tree structure model in the evolved population. The larger the updated fitness, the better the performance of the corresponding updated tree structure model in the evolved population. Conversely, the smaller the updated fitness, the worse the performance of the corresponding updated tree structure model in the evolved population. Therefore, according to each updated fitness, multiple updated tree structure models with larger updated fitness can be used as selected tree structure models. These selected tree structure models are individuals with relatively excellent performance in the current population obtained by the current iterative training. Thus, the current model to be trained is constructed based on each selected tree structure model with relatively excellent performance.
[0172] S124: Allocate each tree structure model included in the current model to be trained to each second computing node, and re-execute selection and evolution until the current model to be trained meets the first preset condition, thereby obtaining a trained target model.
[0173] Afterwards, each tree structure model used to construct the current model to be trained is distributed and sent to each second computing node, and the process returns to step S100 or S104 to perform the next round of iterative training until the current model to be trained obtained by training meets the first preset condition, which is used to determine whether the training should be stopped. The first preset condition may be that the number of rounds of iterative training exceeds a preset round threshold, or the first preset condition may be that the performance index of the current model to be trained is higher than a preset performance threshold, which is not limited in this specification.
[0174] When the current model to be trained meets the first preset condition, the current model to be trained obtained by the last round of iterative training is used as the target model after training.
[0175] Optionally, before re-executing the selection and evolution, the fitness function, the crossover rate, and the mutation rate may be updated separately.
[0176] The update of the fitness function can be a method of adjusting the fitness evaluation in real time according to the actual situation of the population during the evolution process:
[0177] First, for the single-objective fitness evaluation method, only one optimization objective is considered at the same time. Specifically, a dynamically updated fitness function f:T×E is defined, where T is the model structure of the current model to be trained, and E is a dynamically changing or fixed environmental parameter. Among them, the single optimization objective can be one of any existing evaluation indicators such as the accuracy, recall rate, F1 score, AUC, mean square error, mean absolute error, etc. of the model to be trained, and this specification does not limit this.
[0178] Secondly, for the multi-objective fitness evaluation method, multiple optimization objectives are considered at the same time, which improves the comprehensiveness and robustness of the algorithm. Specifically, a dynamically updated multi-objective fitness function f:T×{O1,O2,...,O m}, where T is the model structure of the current model to be trained, {O1, O2, ..., O m} is a set of optimization objectives. The multiple optimization objectives can be any number of any existing evaluation indicators such as accuracy, recall rate, F1 score, AUC, mean square error, mean absolute error, etc. of the model to be trained. This specification does not limit the number and specific types of optimization objectives in the multi-objective fitness function.
[0179] The update of the crossover rate and mutation rate can be adjusted in real time according to the actual situation of the population:
[0180] Specifically, define the dynamic adjustment function a:P mut ×P cross ×D×F→{P mut ',P cross '}, where P mut is the mutation rate, P cross is the crossover rate, D is the population diversity evaluation result corresponding to the current model to be trained, and F is the fitness distribution. The specific determination method of D and F can refer to the following description of the training model meeting the second preset condition, which will not be repeated here. By dynamically adjusting function a, the mutation rate and crossover rate can be adjusted in real time according to the actual situation of the population, thereby improving the search efficiency and stability of the algorithm. In this specification, an optional dynamic adjustment formula for the mutation rate and crossover rate can be as follows:
[0181]
[0182]
[0183] in, is an adjustment coefficient, which can be determined according to the fitness distribution or a preset fixed value. is the diversity evaluation result of the model to be trained before the point, Represents the maximum value of the diversity evaluation results in multiple iterations of training.
[0184] Furthermore, before updating the fitness function, crossover rate and mutation rate respectively, it is possible to determine whether the current model to be trained meets the second preset condition, and when the current model to be trained meets the second preset condition, update the fitness function, crossover rate and mutation rate respectively.
[0185] The second preset condition may be that the current number of iterations exceeds a preset threshold. That is, when the number of iterations reaches a certain number, the fitness function, crossover rate and mutation rate are dynamically adjusted to improve the adaptability and efficiency of the genetic algorithm, so that the algorithm can more flexibly cope with the characteristics of different optimization problems, achieve better optimization effects, and help improve the algorithm's search efficiency and the quality of the final solution.
[0186] In addition, the training status of the current model to be trained can be dynamically monitored, and the fitness function, crossover rate, and mutation rate can be flexibly determined based on the training status, without having to wait until the current number of iterations exceeds the preset threshold. Specifically:
[0187] The first step: according to the fitness corresponding to each tree structure model included in the current model to be trained, determine the fitness distribution corresponding to the current model to be trained.
[0188] Based on the aforementioned step S122, it can be known that the current model to be trained is constructed based on each selected tree structure model determined from each updated tree structure model, and the fitness corresponding to each selected tree structure model can be directly found from each updated fitness, therefore, the fitness corresponding to each tree structure model included in the current model to be trained is obtained. The fitness distribution is determined based on each fitness obtained, and the fitness distribution can reflect the distribution of each tree structure model included in the current model to be trained as a solution to the target problem. The fitness distribution can be compared with the optimal solution of the fitness function to determine the excellence of each tree structure model as a solution to the target problem.
[0189] During the evolution of the genetic algorithm, through selection, crossover and mutation operations, the population will explore the solution space and gradually gather around the optimal solution. If the distribution of the fitness of each tree structure model is close to the optimal solution (the maximum value of the fitness function), it means that the current model to be trained has gradually explored the optimal solution in the search of the solution space, and the current evolutionary direction is correct. On the contrary, if the distribution of the fitness of each tree structure model is far away from the optimal solution, it means that the current model to be trained is gradually moving away from the optimal solution in the search of the solution space. At this time, more mutations can be introduced or more historical tree structure models with higher fitness can be introduced from the memory bank to explore more possible solution spaces.
[0190] For example, taking the fitness function as the accuracy function, 10 sample images are respectively input into the current model to be trained. The tree structure models T1, T2, and T3 contained in the current model to be trained respectively output the predicted image categories of the sample images, which are compared with the labeled image categories of the sample images. The accuracy (fitness) corresponding to T1, T2, and T3 are assumed to be 0.3, 0.2, and 0.9, respectively. Based on the fitness distribution of {0.3, 0.2, 0.9}, it can be seen that the distribution of the fitness of each tree structure model of the current model to be trained is far away from the optimal solution (the accuracy is 1), that is, the solution obtained by searching in the solution space is far away from the optimal solution. At this time, more mutations can be introduced or more historical tree structure models with higher fitness can be introduced from the memory library to improve the fitness of the tree structure model in the current model to be trained.
[0191] Step 2: According to the differences between the tree structure models included in the current model to be trained, determine the population diversity evaluation result corresponding to the current model to be trained.
[0192] In addition, the degree of diversity of the population in the genetic algorithm can also be determined by the degree of difference between individuals. It only evaluates whether the population maintains sufficient diversity during the algorithm search process to effectively search the solution space and avoid falling into the optimal solution. Specifically in this case, the tree structure models contained in the current model to be trained are the population, and each tree structure model is an individual. Therefore, the differences between the tree structure models contained in the current model to be trained can be determined by any type of existing difference measurement method, such as mapping each tree structure model to a code, and determining the differences between each tree structure model by calculation methods such as Hamming distance and Euclidean distance. In general, the greater the difference between each tree structure model, the higher the diversity indicated by the population diversity evaluation result corresponding to the current model to be trained. Conversely, the smaller the difference between each tree structure model, the lower the diversity indicated by the population diversity evaluation result corresponding to the current model to be trained.
[0193] Step 3: Determine whether the current model to be trained meets the second preset condition based on the fitness distribution and the population diversity evaluation result.
[0194] Step 4: When the current model to be trained meets the second preset condition, update the fitness function, update the crossover rate, and update the mutation rate.
[0195] The second preset condition may be that the fitness distribution corresponding to the current model to be trained indicates that the fitness of the tree structure model included in the current model to be trained is different from the optimal value (usually the maximum value) of the fitness function by more than a preset difference threshold, and / or the population diversity evaluation result corresponding to the current model to be trained is lower than the preset population diversity threshold. The aforementioned preset difference threshold and preset population diversity threshold can be determined according to the specific application scenario, and this specification does not limit this.
[0196] By real-time monitoring of population changes during the evolution process, the mutation rate and crossover rate are dynamically adjusted to ensure the efficiency and stability of the search process. Optionally, the dynamic monitoring implementation of the fitness distribution can be specifically to define a real-time adjustment function S(pmut, pcross) to dynamically adjust the selection probability of mutation and crossover by monitoring the diversity and fitness distribution of the population.
[0197] In the distributed model training method provided in the present specification, the first computing node sends the fitness function determined according to the model training task to each second computing node, and each second computing node determines the current fitness corresponding to each tree structure model stored in itself based on the fitness function, thereby selecting a target tree structure model and sending the target tree structure model to the first computing node. The first computing node selects a reference tree structure model from the memory bank, generates an evolutionary operation execution task based on the reference tree structure model and the target tree structure model, and assigns it to each second computing node. Each second computing node executes each evolutionary operation execution task to obtain an updated tree structure model. The first computing node determines each selected tree structure model from each updated tree structure model, and uses it to construct the current model to be trained, iterates multiple times until the first preset condition is met, and obtains the trained target model.
[0198] It can be seen that through the above solution, distributed computing adaptation based on large-scale computing cluster systems is realized, which promotes the automated software-hardware collaborative optimization for the construction of large tree models, solves the problem of high computing resource occupation by large tree models, and improves the training efficiency of large tree models.
[0199] In one or more embodiments of this specification, Figure 2The step S112 shown in FIG. 114 selects several reference tree structure models from the historical tree structure models stored in the memory bank, which can be implemented by the following scheme: Figure 3 As shown:
[0200] S200: querying the fitness, historical reuse frequency and diversity evaluation results corresponding to each historical tree structure model from the memory library.
[0201] This manual adopts an efficient memory library method, which reduces the consumption of computing resources during the training process of large tree structure models by adopting a strategy of replacing computing resources with storage space.
[0202] As mentioned above, the memory bank stores multiple historical tree structure models, which are all individuals with excellent performance in historical iterative training. In addition to storing the historical tree structure models and their corresponding fitness, the memory bank can also store the historical reuse frequency and diversity evaluation results corresponding to each historical tree structure model.
[0203] Among them, the historical reuse frequency is used to characterize the frequency with which the historical tree structure model is extracted from the memory bank during multiple rounds of historical iterative training. Generally, the historical tree structure model extracted from the memory bank will be used to directly introduce into the population, or as part of a crossover or mutation operation. The historical reuse probability can represent the frequency with which the historical tree structure model is extracted. The higher the historical reuse frequency, the more times the historical tree structure model is extracted, and the more consistent the historical tree structure model is with the direction of searching for the optimal solution in the solution space. Conversely, the lower the historical reuse frequency, the fewer times the historical tree structure model is extracted, and the greater the difference between the historical tree structure model and the direction of searching for the optimal solution in the solution space.
[0204] The diversity evaluation result is used to characterize the degree of difference between the historical tree structure model and other tree structure models. The greater the difference between the historical tree structure model and other tree structure models, the higher the diversity of the historical tree structure model indicated by the diversity evaluation result. Conversely, the smaller the difference between the historical tree structure model and other tree structure models, the lower the diversity of the historical tree structure model indicated by the diversity evaluation result.
[0205] S202: For each historical tree structure model, the fitness, historical reuse frequency and diversity evaluation result of the historical tree structure model are substituted into a predefined selection function to obtain a screening index corresponding to the historical tree structure model.
[0206] A selection function sel(M) may be predefined to determine which historical tree structure models are extracted from the memory bank and used in the current iterative training process. An optional implementation of the selection function is as follows:
[0207]
[0208] in, Represents the fitness of the historical tree structure model, is the weight corresponding to the fitness, Represents the diversity evaluation results of the historical tree structure model, is the weight corresponding to the diversity assessment result, Represents the historical reuse frequency of the historical tree structure model, is the weight corresponding to the historical reuse frequency. , , Can be the same or different, this manual , , There is no restriction on the value of .
[0209] S204: Selecting a number of reference tree structure models from the historical tree structure models according to the screening indicators corresponding to the historical tree structure models.
[0210] Specifically, the historical tree structure models may be arranged in order from large to small according to the screening index, and several historical tree structure models at the head of the queue may be extracted as several selected reference tree structure models.
[0211] Therefore, extracting historical tree structure models with higher fitness, higher historical reuse frequency, and higher diversity from the memory library as reference tree structure models, introducing them into the population in the current iterative training, and using them for evolutionary operations can improve the search efficiency of the genetic algorithm and increase the training speed.
[0212] In one or more embodiments of this specification, Figure 2 In step S120, an incremental fitness evaluation method is used to determine the updated fitness corresponding to each updated tree structure model, which can be achieved by the following scheme: Figure 4 As shown:
[0213] S300: For each updated tree structure model, determine the original tree structure model and the changed tree structure model included in the updated tree structure model according to a predefined change detection function.
[0214] In view of the problem that in large-scale tree structure models, the fitness evaluation of each individual needs to traverse the entire tree, which makes the evaluation process extremely slow, seriously affects the iteration speed of the algorithm, and reduces the effective utilization of computing resources for large-scale tree structure model training, this specification provides an incremental fitness evaluation method for change detection and local evaluation, and defines a change detection function ΔT=d(T old , T new ), where T old and T new They are the original tree structure model and the updated tree structure model, and ΔT represents the difference between the two. The specific application of the change detection function can be: for each updated tree structure model, obtain the model identifier corresponding to the updated tree structure model, determine the identifier of at least one tree structure model used to obtain the updated tree structure model according to the model identifier corresponding to the updated tree structure model, and use the determined identifier from each tree structure model stored in the first computing node (especially for generating the evolution operation execution task in step S112) as the original tree structure model corresponding to the updated tree structure model. The updated tree structure model and its corresponding original tree structure model are input into the change detection function defined above to obtain the difference between the two, which is the changed tree structure model contained in the updated tree structure model.
[0215] S302: Searching for the cache fitness corresponding to the original tree structure model included in the updated tree structure model from a pre-built fitness cache table.
[0216] In this specification, by storing the previously calculated fitness results, repeated calculations are avoided, further improving the evaluation efficiency. One implementation of the fitness cache mechanism is as follows:
[0217] Introducing fitness cache table F cache (T), which stores the fitness value of each tree structure model T. The cache fitness corresponding to the original tree structure model is searched from the fitness cache table that was previously built. If the cache fitness corresponding to the original tree structure model contained in the updated tree structure model can be found in the fitness cache table, the subsequent steps are directly extracted and executed. If the search is different, the fitness of the original tree structure model contained in the updated tree structure model can be determined by the fitness function and saved in the fitness cache table.
[0218] S304: Determine the change fitness of the change tree structure model included in the updated tree structure model according to the fitness function.
[0219] S306: Determine an updated fitness corresponding to the updated tree structure model according to the cache fitness and the change fitness.
[0220] Define the incremental fitness evaluation function F incremental (T,ΔT)=F base (T)+F(ΔT), where F base (T) is the cache fitness corresponding to the original tree structure model found from the fitness cache table, and F(ΔT) is the change fitness obtained in step S304.
[0221] In one or more embodiments of this specification, Figure 2 Step S114 can be implemented by the following scheme: Figure 5 As shown:
[0222] S400: Constructing a dependency graph according to the tree structure models included in the evolutionary operation execution tasks, taking the evolutionary operation execution tasks as nodes and taking the dependency relationships between the evolutionary operation execution tasks as edges.
[0223] In order to improve the utilization rate of computing resources of large tree models on large computing clusters, this invention discloses a hierarchical parallel computing method for tree structures. By performing efficient node dependency management and parallel computing scheduling in hierarchical parallel computing, the utilization rate of distributed computing resources of large tree models is greatly improved.
[0224] In this specification, the main purpose of the dependency management mechanism is to efficiently manage the dependency relationship between the second computing nodes when executing tasks. Specifically, a dependency graph is first constructed by a dependency graph construction method.
[0225] The dependency graph is used to represent the dependency relationship between the second computing nodes when executing tasks. In the dependency graph, each graph node corresponds to an evolutionary operation execution task, and the edges between the graph nodes represent the dependency relationship between the evolutionary operation execution tasks. Among them, the dependency relationship between any two evolutionary operation execution tasks can be sharing the same tree structure model, executing the subsequent task based on the task result of the previous task, etc.
[0226] By constructing a dependency graph, the order and dependencies of executing tasks of each evolutionary operation can be intuitively represented, which helps in scheduling and optimization of parallel computing.
[0227] The following steps are used to implement the dependency graph construction method, as follows:
[0228] Use a directed graph G=(V,E) to represent the dependency graph, where V is the set of graph nodes and E is the set of edges;
[0229] Each node v∈V represents an evolutionary operation execution task, and each edge e=(v i ,v j )∈E represents task v i Depends on task v j .
[0230] S402: Divide the dependency graph into a plurality of subgraphs according to a predefined task partitioning function.
[0231] In this specification, parallel computing scheduling is responsible for allocating different evolutionary operation execution tasks to different computing resources (second computing nodes) to achieve efficient parallel computing. The first step is task division, which divides each evolutionary operation execution task into several independent subtasks so that each subtask can be calculated independently.
[0232] Define the task partition function s:G→{G1,G2,...,G k}, the task partitioning function accepts the dependency graph G as input and divides it into several subgraphs {G1,G2,...,G k}; Each subgraph G i Represents an independent computing task and can be calculated in parallel. In this way, the evolution operation execution tasks contained in each independent subgraph are assigned to each second computing node. When each second computing node executes the corresponding task, it will not be coupled with the tasks executed by other second computing nodes, thereby improving the efficiency of parallel computing.
[0233] S404: Take the acquired computing resource amounts corresponding to each of the second computing nodes, the current load of each of the second computing nodes executing tasks, and each subgraph contained in the dependency graph as input, and input them into a predefined task allocation function to determine the subgraphs corresponding to each of the second computing nodes.
[0234] The next step is task allocation, which allocates the divided subtasks to different computing resources to achieve load balancing and efficient use of computing resources. Specifically, define the task allocation function p: {G1, G2, ..., G k}×R→P, where R is the set of computing resources, that is, the set of computing resources controlled by each second computing node contained in the distributed model training system, and P is the task allocation scheme. The task allocation function P accepts the subgraph set {G1,G2,...,G k} and computing resource set R as input, and output task allocation scheme P, which is to correspond each subgraph contained in the dependency graph to each second computing node, that is, to assign the evolution operation execution task contained in which subgraph to which second computing node to execute. Generally, one subgraph corresponds to one second computing node, and one second computing node can correspond to one or more subgraphs.
[0235] S406: Determine the evolutionary operation execution tasks corresponding to the nodes contained in the subgraphs corresponding to the second computing nodes, and assign the evolutionary operation execution tasks corresponding to the second computing nodes to the second computing nodes respectively.
[0236] Through the task allocation function, the execution tasks of each evolution operation can be reasonably allocated to different second computing nodes, thereby achieving efficient parallel computing.
[0237] In an optional embodiment of this specification, based on Figure 5 In the scheme shown, in each round of iterative training, the evolutionary operation execution task will change, that is, the task objectives (crossover operation or evolutionary operation) contained in the evolutionary operation execution task and the tree structure model contained in the task may be different, resulting in different allocation schemes for allocating each evolutionary operation execution task to each second computing node. However, when generating each round of allocation of evolutionary operation execution tasks, regenerating the allocation scheme wastes computing resources. Based on this, in this specification, optionally, based on the task allocation scheme of the previous round of iterative training, based on the changes in the dependency graph, the task allocation scheme of the current round of iterative training is obtained, specifically:
[0238] First, when the evolution operation execution tasks are updated, the changed evolution operation execution tasks are determined according to the evolution operation execution tasks after the update and the evolution operation execution tasks before the update.
[0239] The dynamic dependency adjustment mechanism is used to dynamically adjust the dependency between nodes according to the actual situation, thereby improving the computing efficiency. In practical applications, not only will the evolutionary operation execution tasks change in different rounds of iterative training, but also in a round of iterative training, the evolutionary operation execution tasks will be added, deleted, and changed due to the actual task execution situation. Therefore, efficient reallocation based on the changed evolutionary operation execution tasks can further improve the execution efficiency of the tasks, thereby improving the model training efficiency. To this end, in this step, in response to the update of the evolutionary operation execution tasks, the changed simplified operation execution tasks are determined based on the differences between the updated evolutionary operation execution tasks and the evolutionary operation execution tasks before the update.
[0240] Secondly, according to the changed evolution operation execution task and the dependency graph, an adjusted dependency graph is determined.
[0241] Define a dependency graph dynamic adjustment function a:G×ΔT→G', which accepts the dependency graph G and the changed evolutionary operation execution tasks as input, and outputs the adjusted dependency graph G'. The adjusted dependency graph can intuitively reflect the execution order and dependency relationship between the updated evolutionary operation execution tasks, so that the updated evolutionary operation execution tasks can be reallocated in subsequent steps.
[0242] Afterwards, the updated evolutionary operations are assigned execution tasks according to the adjusted dependency graph.
[0243] This step is similar to the aforementioned steps S404 to S406 and will not be described in detail here.
[0244] In an optional embodiment of this specification, based on Figure 5 In the scheme shown, in addition to assigning each evolution operation execution task corresponding to each second computing node to each second computing node, the first computing node can also formulate a communication and synchronization scheme for each second computing node, so that each second computing node can perform the corresponding evolution operation execution task with a smaller communication overhead and synchronization overhead, specifically:
[0245] Step 1: Determine a plurality of preset communication schemes and a plurality of preset synchronization schemes.
[0246] In order to ensure the correctness of the distributed model training process, an effective communication and synchronization mechanism is required between each second computing node and the first computing node to ensure that the first computing node can quickly allocate evolutionary operation execution tasks and ensure that the task execution results of all second computing nodes can be summarized in a timely and accurate manner.
[0247] In this specification, a variety of preset communication schemes can be obtained to implement information exchange between the first computing node and each second computing node, such as shared memory, message passing interface (MPI) or remote direct memory access (RDMA).
[0248] Multiple preset synchronization schemes can be implemented by atomic operations, mutex locks or other existing concurrency control mechanisms to ensure the consistency of operations.
[0249] Step 2: For each second computing node, based on any one of the multiple preset communication schemes and any one of the multiple preset synchronization schemes, determine the multiple communication synchronization schemes used by the second computing node when executing each evolutionary operation execution task corresponding to the second computing node.
[0250] Define multiple preset communication schemes as C={c1,c2,……,cN}, multiple preset synchronization schemes are S={s1,s2,……,s M}, any c in C i , and any s in S i The communication synchronization scheme (c i ,s i ), which is equivalent to the second computing node using the communication synchronization scheme (c i ,s i ) Communication solution c i Perform information exchange and use synchronization schemes i Perform synchronization of data.
[0251] Step 3: According to the tree structure models contained in the evolutionary operation execution tasks corresponding to the second computing node and the multiple communication synchronization schemes adopted by the second computing node, determine the communication overheads corresponding to the multiple communication synchronization schemes adopted by the second computing node through a predefined communication overhead function.
[0252] Assuming that the second computing node will respectively adopt multiple communication synchronization schemes obtained in the second step when executing the corresponding evolutionary operation execution task, the communication overhead generated by each communication synchronization scheme adopted by the second computing node when executing the corresponding evolutionary operation execution task can be predicted through a pre-defined communication overhead function.
[0253] Define the communication cost function C(T), which is calculated based on the amount of data that needs to be transmitted when executing the task, the network bandwidth and the communication protocol.
[0254] Step 4: According to the communication overheads corresponding to the multiple communication synchronization schemes adopted by the second computing node, determine the target communication synchronization scheme adopted by the second computing node when executing each evolutionary operation execution task corresponding to the second computing node, and send the target communication synchronization method used by the second computing node to the second computing node.
[0255] In order to reduce communication overhead, a communication synchronization scheme with the minimum communication overhead may be adopted as the target communication synchronization scheme adopted when the second computing node executes the task.
[0256] In an optional embodiment of this specification, based on Figure 5The scheme shown is that after each second computing node is assigned an evolutionary operation execution task, due to the different task execution speeds of different second computing nodes, some second computing nodes may complete the evolutionary operation execution task first, and some second computing nodes may complete the evolutionary operation execution task later. At this time, the computing resources of the second computing nodes that completed the task earlier become idle, and can actually share the computing tasks for other second computing nodes with heavier loads. Therefore, the first computing node can obtain the current load of each second computing node when executing the task in real time. Based on the idea of load balancing, during the process of each second computing node executing the task, the tasks are redistributed for each second computing node. The specific scheme is as follows:
[0257] First, the current load of each second computing node when executing each evolution operation execution task is obtained.
[0258] The current load is used to characterize the degree of computing resource occupation when the second computing node performs the evolutionary operation execution task. When the second computing node performs the evolutionary operation execution task, the higher the ratio between the occupied computing resources and the computing resources possessed by the second computing node, the greater the current load, indicating that the computing resources of the second computing node are more scarce. Conversely, when the second computing node performs the evolutionary operation execution task, the lower the ratio between the occupied computing resources and the computing resources possessed by the second computing node, the smaller the current load, indicating that the second computing node has more idle computing resources.
[0259] The load balancing strategy ensures that the workload of all computing nodes is as evenly distributed as possible, avoiding the situation where some nodes are overloaded while other nodes are idle. Specifically, the load balancing function L(P i ) dynamically adjusts the amount of tasks assigned to each second computing node. This function can dynamically adjust task allocation based on the current load of the second computing node, the total amount of computing resources, the number of assigned tasks, and the completion status, so as to make full use of idle computing resources and relieve the computing pressure of the second computing node with tight computing resources.
[0260] Secondly, for each second computing node, when the current load of the second computing node is higher than a preset load threshold, at least part of the evolutionary operation execution tasks executed by the second computing node are allocated to other second computing nodes.
[0261] In general, the idea of load balancing is to transfer the evolutionary operation execution tasks executed on the second computing node that occupies too many computing resources to the second computing node with more idle computing resources. In this step, the other second computing node refers to the second computing node with more idle computing resources in the distributed model training system. The current load of each second computer and the single node can be monitored by the first computing node.
[0262] Among them, the preset load threshold can be a fixed value predetermined according to the specific application scenario and prior experience, or it can be a variable value flexibly adjusted during the training process, and this manual does not limit this.
[0263] By transferring at least part of the evolutionary operation execution tasks executed on the second computing node with a higher current load to other second computing nodes for execution, the computing pressure of the high-load second computing nodes can be effectively alleviated, and idle computing resources can be fully utilized to ensure load balancing and improve computing efficiency.
[0264] In an optional embodiment of this specification, based on Figure 5 After the scheme shown allocates the evolution operation execution tasks to each second computing node, the number of second computing nodes deployed in the distributed model training system can be dynamically adjusted based on the task execution time consumed by each second computing node to improve the efficiency of task execution. The specific scheme is as follows:
[0265] Step 1: According to each evolution operation execution task corresponding to each second computing node, the task execution time of each second computing node is determined respectively.
[0266] For each second computing node P i The execution time of each evolution operation task is T(S i ). According to the actual situation, the second computing node may start timing when receiving the corresponding evolutionary operation execution tasks, and stop timing when returning the task execution results to the first computing node, so as to obtain the task execution duration adapted to the execution of each second computing node, and each second computing node shall summarize the task execution duration recorded by itself to the first computing node. Alternatively, the first computing node may start timing when allocating each evolutionary operation execution task to each second computing node, and stop timing when receiving the task results returned by each second computing node, so as to directly obtain the task execution duration of each second computing node.
[0267] Step 2: Determine the first target duration according to the task execution duration of each second computing node.
[0268] Since each second computing node executes the corresponding evolution operation execution task independently and in parallel, the first target time length T consumed by all second computing nodes to complete the task is determined. all It is defined as the maximum value of the execution time of each task consumed by all second computing nodes when executing tasks respectively, that is, T all =max(T(S1),T(S2),...,T(S k )).
[0269] That is, the longest task execution duration among the task execution durations of the second computing nodes is used as the first target duration.
[0270] Step 3: According to the original number of the second computing nodes, determine the expanded number of the second computing nodes through a predefined scalability function, and determine the second target duration for each second computing node of the expanded number to execute the task of each evolution operation.
[0271] In practical applications, there may be a situation where the computing resources of the second computing nodes currently deployed in the distributed model training system are difficult to support the efficient execution of the evolutionary operation execution task. In this case, the second computing nodes can be deployed in the distributed model training system to expand the computing resources used to execute the evolutionary operation execution task. In order to reasonably plan the deployment of the second computing nodes, the scalability can be evaluated before the deployment is increased to automatically determine the number of second computer nodes that need to be deployed according to the physical topology of the distributed environment.
[0272] Specifically, a scalability function E(k) is defined, which evaluates the improvement of algorithm performance when the number of second computing nodes in the distributed model training system increases from the original number k to the expanded number k+n, wherein the improvement of the algorithm performance involved here can be characterized by the task execution length, that is, if the number of second computing nodes increases from the original number k to the expanded number k+n, and the task execution time consumed by k+n second computing nodes to complete each evolutionary operation execution task is less than the task execution time consumed by k second computing nodes to complete each evolutionary operation execution task, then it means that adding n second computing nodes in the distributed model training system can effectively improve the task execution efficiency of the evolutionary operation execution task.
[0273] Therefore, the second target duration when each of the expanded number of second computing nodes executes each of the evolutionary operations is determined. The second target duration is determined in a manner similar to the first target duration, which is not repeated here.
[0274] Step 4: If the difference between the first target duration and the second target duration meets a third preset condition, deploying the second computing node according to the expansion quantity.
[0275] Furthermore, in practical applications, excessively increasing the number of second computing nodes will increase a large amount of communication overhead and reduce the execution efficiency of the task. Therefore, after determining the second target duration, it is also necessary to measure the difference between the first target duration and the second target duration.
[0276] If the difference between the first target duration and the second target duration is large, it means that the task execution efficiency has been greatly improved after the second computing node is increased from the original number k to the expanded number k+n. If the difference between the first target duration and the second target duration is too small, it means that the task execution efficiency has not been improved much after the second computing node is increased from the original number k to the expanded number k+n. In this case, the expanded number can be optimized, and the second target duration can be recalculated based on the optimized expanded number until the difference between the second target duration and the first target duration meets expectations.
[0277] The third preset condition involved in the fourth step may be that the difference between the second target duration and the first target duration is greater than a preset duration difference threshold. Assume that the second target duration t2 is shorter than the first target duration t1. diff , and t diff Greater than the preset duration difference threshold t th , it means that the time taken to execute the task using the expanded number of second computing nodes is significantly shorter than the time taken to execute the task using the original number of second computing nodes, reflecting that the task execution efficiency is significantly improved after the second computing nodes are increased from the original number to the expanded number.
[0278] In one or more embodiments of the present specification, since the number of tree structure models included in the model to be trained in the present specification is large, and each tree structure model often has relatively deep and wide branches, the model to be trained may occupy more storage resources. Therefore, during the training process, since each round of iterative training, each tree structure model included in the model to be trained will change. If the adjusted model to be trained is completely saved in each iterative training, it will occupy more storage resources and reduce storage efficiency. Based on this, the present specification adopts an incremental storage strategy for storage resource management, and deploys a tree structure storage module in the first computing node. When training occurs, the tree structure storage module activates change detection and records an incremental update log for any tree structure model that has changed. When the tree structure model included in the model to be trained needs to be updated, an incremental update can be performed based on the content recorded in the incremental update log to improve the utilization of storage resources and storage efficiency. The specific scheme can be as follows:
[0279] Step 1: In each round of iterative training, determine the current model difference between the current model to be trained obtained by the current iterative training and the model to be trained obtained by the previous iterative training, and record the current model difference in the incremental update log.
[0280] The current model difference may be the current model to be trained obtained by the current iterative training, which includes content added, deleted, or modified in the model structure compared to the model to be trained obtained by the previous iterative training.
[0281] Step 2: In response to an update request, search the incremental update log, determine the current model to be trained obtained by the current iterative training based on the current model difference recorded in the incremental update log and the model to be trained obtained by the previous iterative training, and store the current model to be trained in the first computing node.
[0282] In one or more embodiments of this specification, based on Figure 2 After the distributed model training method shown is completed, the obtained target model can be stored in any electronic device, such as the first computing node. The trained target model also faces the problem of occupying a large amount of storage resources. Based on this, in this specification, the following scheme is adopted to optimize the storage of the target model in the first computing node to reduce the occupied storage resources. The specific steps are as follows: Figure 6 As shown:
[0283] S500: In response to a trained target model, determine each tree node and each decision edge in each tree structure model included in the target model.
[0284] Specifically, the tree structure models included in the trained target model are determined, and each tree structure model includes a plurality of tree nodes and a plurality of decision edges.
[0285] Among them, the tree node can be the starting point of the tree structure model, that is, the root node, which represents the set of all unclassified input samples. For example, in the image classification scenario, the root node can represent the image to be classified input to the target model. The tree node can also be the terminal node of the tree structure model, that is, the leaf node, which represents the classification decision result of the input sample. For example, in the image classification scenario, the leaf node can be a specific image category, such as "cat" and "dog". The node between the root node and the leaf node is the internal node, which can represent a feature test condition. For example, in the image classification scenario, an internal node can be used to determine whether there is a circular object in the input image.
[0286] A decision edge is a directed edge connecting nodes, representing a transfer decision path from one node to another. The label on the decision edge usually indicates which feature test is performed or what conditions are met to proceed along this decision edge. For example, starting from the internal node of "Is there a circular object in the image", if a circle is detected in the image, follow one edge to the next node or leaf node; if there is no circle, proceed along another edge.
[0287] By parsing the tree structure of each tree structure model included in the target model, for each tree structure model, a plurality of tree nodes and a plurality of decision edges included in the tree structure model are determined.
[0288] S502: Determine each node code of each tree node, and determine each edge code of each decision edge.
[0289] In this specification, the tree model's demand for storage resources is reduced by using encoding, so as to achieve large-scale tree model deployment with light storage resource requirements. To this end, each tree node and each decision edge contained in each tree structure model must first be encoded. The encoding method for the tree nodes and decision edges can be any existing type of encoding method, such as one-hot encoding, Huffman encoding, path encoding, etc. This specification does not limit this.
[0290] In this specification, each tree node corresponds to each node code one by one, and each decision edge corresponds to each edge code one by one.
[0291] S504: According to a predefined mapping function, map each node code to a first short code, and map each edge code to a second short code; wherein the length of the first short code is smaller than that of the node code, and the length of the second short code is smaller than that of the edge code.
[0292] The tree structure is compressed using compression technology. A mapping function f:N∪E→C is predefined, where N is a set of node numbers, E is a set of edge numbers, and C is a set of short codes. That is, through this mapping function, each node code can be mapped to each first short code, and each edge code can be mapped to each second short code. The mapping function can be a hash function, a variable length code, etc.
[0293] Thus, for each node code n∈N of the tree node and each decision edge code e∈E, there exists f(n)=c n and f(e)=c e , where c n and c e is the corresponding short code.
[0294] Due to execution Figure 5 The scheme shown is to reduce the storage resources occupied by the target model. Therefore, the encoding length of the first short code processed by the mapping function can be smaller than the corresponding node code. Similarly, the encoding length of the second short code obtained by the mapping function can be smaller than the corresponding edge code. Therefore, the storage requirements of the target model can be greatly reduced by using the first short code to represent the tree node and the second short code to represent the decision edge.
[0295] S506: Establish a first correspondence between each first short code and each node code, and establish a second correspondence between each second short code and each edge code, construct a mapping dictionary according to the first correspondence and the second correspondence, and store the mapping dictionary.
[0296] Based on step S504, a first correspondence between the node code of each tree node and the corresponding first short code can be determined, and a second correspondence between the edge code of each decision edge and the corresponding second short code can be determined, and the first correspondence and the second correspondence are stored in a mapping dictionary.
[0297] S508: According to the first corresponding relationship stored in the mapping dictionary, each node code corresponding to each tree node in each tree structure model included in the target model is replaced with each first short code.
[0298] S510: According to the second corresponding relationship stored in the mapping dictionary, the edge codes corresponding to the decision edges in the tree structure models included in the target model are replaced with the second short codes.
[0299] S512: Construct a compressed first compression model according to the first short code and the second short code, and store the first compression model.
[0300] Therefore, the tree nodes are represented by the first short code, and the decision edges are represented by the second short code. The tree structure models Ti contained in the target model are compressed into the first compressed model Ti'. The storage resources occupied by Ti' are smaller than the storage resources occupied by Ti, thereby achieving the purpose of reducing the storage requirements of the target model.
[0301] Furthermore, in an optional embodiment of the present specification, the Run-Length encoding method may be used to further compress the compressed first compression model to further reduce the storage resources occupied by the target model. Specifically:
[0302] First, the first short codes corresponding to the tree nodes in the tree structure models included in the first compression model and the second short codes corresponding to the decision edges are taken as input and input into a predefined counting function to obtain the number of consecutive repetitions corresponding to the tree nodes in the tree structure models included in the first compression model and the number of consecutive repetitions corresponding to the decision edges.
[0303] Define a counting function g:N∪E→ℕ to record the number of consecutive repetitions of each tree node or decision edge in the tree structure model. For each tree node n∈N and decision edge e∈E, if it is repeated r times in a row, it can be expressed as g(n)=r or g(e)=r.
[0304] Thus, for each tree structure model contained in the first compression model, the first short codes corresponding to the tree nodes contained in the tree structure model and the second short codes corresponding to the decision edges are taken as input and input into the counting function. Since in the tree structure model, the tree structure constructed by each tree node and each decision edge is in the form of a directed graph, each tree node and each decision edge can be converted into an original sequence arranged in a certain order. The counting function can determine the number of consecutive repetitions of each tree node in the original sequence and the number of consecutive repetitions of each decision edge, so as to facilitate subsequent compression based on the Run-Length encoding method.
[0305] Secondly, according to the consecutive repetition times corresponding to each tree node and the consecutive repetition times corresponding to each decision edge, the first compression model is compressed by a run-length encoding method to obtain a second compression model.
[0306] For example, the original sequence is {n1,n2,……,n k}, the counting function determines n i The corresponding number of consecutive repetitions is r i , then the original sequence can be compressed into {n1,r1,n2,r2,……,n k ,r k}, where n i is the first short code corresponding to the tree node, or the second short code corresponding to the decision edge, r i is the corresponding number of consecutive repetitions.
[0307] It should also be noted that the above-mentioned Figure 6 The scheme shown in the figure obtains a first compression model, and then compresses the first compression model again based on the run-length encoding method to obtain a second compression model. The compression order is only an optional example. The run-length encoding method can also be used to compress the target model to obtain the first compression model, and then based on Figure 6 The scheme shown is to compress the first compression model again to obtain the second compression model. This specification does not limit the execution order of the above two methods.
[0308] The above is a distributed model training method provided by one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding distributed model training device, such as Figure 7 and Figure 8 shown.
[0309] Figure 7 A schematic diagram of a distributed model training device provided in this specification specifically includes:
[0310] A fitness function determination module 600 is used to determine a fitness function according to a model training task;
[0311] A sending module 602 is used to send the fitness function to each second computing node respectively, so that each second computing node determines the current fitness corresponding to each tree structure model stored in itself according to the fitness function, the training sample and the annotation of the training sample, and selects a target tree structure model from the tree structure models according to the current fitness corresponding to each tree structure model, so as to return the target tree structure model to the first computing node;
[0312] A first receiving module 604 is used to receive each target tree structure model sent by each second computing node;
[0313] A selection module 606 is used to select a number of reference tree structure models from each historical tree structure model stored in the memory bank;
[0314] The task assignment module 608 is used to generate each evolution operation execution task according to each target tree structure model and the reference tree structure model, and assign each evolution operation execution task to each second computing node, so that each second computing node performs an evolution operation according to the tree structure model parsed from the evolution operation execution task, and obtains and returns an updated tree structure model;
[0315] The fitness updating module 610 is used to receive the updated tree structure models sent by the second computing nodes, and use an incremental fitness evaluation method to determine the updated fitness corresponding to each of the updated tree structure models;
[0316] The current model to be trained determination module 612 is used to determine each selected tree structure model from each updated tree structure model according to each updated fitness, and construct the current model to be trained according to each selected tree structure model;
[0317] The target model determination module 614 is used to assign each tree structure model included in the current model to be trained to each second computing node, and re-execute selection and evolution until the current model to be trained meets the first preset condition to obtain a trained target model.
[0318] Optionally, the evolution operation includes a crossover operation and / or a mutation operation;
[0319] Optionally, the task assignment module 608 is specifically used to obtain the current crossover rate, determine each tree structure model to be crossed according to the current crossover rate, each target tree structure model and the reference tree structure model, and generate each crossover operation execution task according to each tree structure model to be crossed; and / or obtain the current mutation rate, determine each tree structure model to be mutated according to the current mutation rate, each target tree structure model and the reference tree structure model, and generate each mutation operation execution task according to each tree structure model to be mutated.
[0320] Optionally, the selection module 606 is specifically used to query the fitness, historical reuse frequency and diversity evaluation results corresponding to each historical tree structure model from the memory library; for each historical tree structure model, substitute the fitness, historical reuse frequency and diversity evaluation results of the historical tree structure model into a predefined selection function to obtain the screening index corresponding to the historical tree structure model; and select several reference tree structure models from the historical tree structure models according to the screening indexes corresponding to the historical tree structure models.
[0321] Optionally, the fitness update module 610 is specifically used to, for each updated tree structure model, determine the original tree structure model and the changed tree structure model contained in the updated tree structure model according to a predefined change detection function; search for the cache fitness corresponding to the original tree structure model contained in the updated tree structure model from a pre-built fitness cache table; determine the change fitness of the changed tree structure model contained in the updated tree structure model according to the fitness function; and determine the updated fitness corresponding to the updated tree structure model according to the cache fitness and the change fitness.
[0322] Optionally, the device further comprises:
[0323] The parameter updating module 616 is specifically used to update the fitness function, update the crossover rate and update the mutation rate.
[0324] Optionally, the parameter updating module 616 is specifically used to determine the fitness distribution corresponding to the current model to be trained according to the fitness corresponding to each tree structure model contained in the current model to be trained; determine the population diversity evaluation result corresponding to the current model to be trained according to the difference between the tree structure models contained in the current model to be trained; determine whether the current model to be trained meets the second preset condition according to the fitness distribution and the population diversity evaluation result; when the current model to be trained meets the second preset condition, update the fitness function, update the crossover rate and update the mutation rate.
[0325] Optionally, the task allocation module 608 is specifically used to construct a dependency graph according to the tree structure models contained in the evolutionary operation execution tasks, with the evolutionary operation execution tasks as nodes and the dependency relationships between the evolutionary operation execution tasks as edges; divide the dependency graph into a number of subgraphs according to a predefined task partitioning function; input the acquired computing resource amounts corresponding to the second computing nodes, the current load of the tasks executed by the second computing nodes, and the subgraphs contained in the dependency graph as inputs to a predefined task allocation function to determine the subgraphs corresponding to the second computing nodes; determine the evolutionary operation execution tasks corresponding to the second computing nodes according to the evolutionary operation execution tasks corresponding to the nodes contained in the subgraphs corresponding to the second computing nodes, and allocate the evolutionary operation execution tasks corresponding to the second computing nodes to the second computing nodes respectively.
[0326] Optionally, the device further comprises:
[0327] The dependency graph dynamic adjustment module 618 is specifically used to determine the changed evolutionary operation execution tasks according to the updated evolutionary operation execution tasks and the evolutionary operation execution tasks before the update when updating the evolutionary operation execution tasks; determine the adjusted dependency graph according to the changed evolutionary operation execution tasks and the dependency graph; and allocate the updated evolutionary operation execution tasks according to the adjusted dependency graph.
[0328] Optionally, the device further comprises:
[0329] The communication synchronization scheme determination module 620 is specifically used to determine multiple preset communication schemes and multiple preset synchronization schemes; for each second computing node, according to any one of the multiple preset communication schemes and any one of the multiple preset synchronization schemes, determine the multiple communication synchronization schemes adopted by the second computing node when executing each evolutionary operation execution task corresponding to the second computing node; according to each tree structure model contained in each evolutionary operation execution task corresponding to the second computing node, and the multiple communication synchronization schemes adopted by the second computing node, determine the communication overhead corresponding to the multiple communication synchronization schemes adopted by the second computing node through a predefined communication overhead function; according to the communication overhead corresponding to the multiple communication synchronization schemes adopted by the second computing node, determine the target communication synchronization scheme adopted by the second computing node when executing each evolutionary operation execution task corresponding to the second computing node, and send the target communication synchronization method used by the second computing node to the second computing node.
[0330] Optionally, the device further comprises:
[0331] The load balancing module 622 is specifically used to obtain the current load of each second computing node when executing each evolutionary operation execution task; for each second computing node, when the current load of the second computing node is higher than a preset load threshold, at least part of the evolutionary operation execution tasks executed by the second computing node are allocated to other second computing nodes.
[0332] Optionally, the device further comprises:
[0333] The expansion module 624 is specifically used to determine the task execution duration of each second computing node according to the evolutionary operation execution task corresponding to each second computing node; determine the first target duration according to the task execution time of each second computing node; determine the expanded number of the second computing nodes according to the original number of the second computing nodes through a predefined scalability function, and determine the second target duration when each second computing node of the expanded number executes the evolutionary operation execution task; if the difference between the first target duration and the second target duration meets the third preset condition, deploy the second computing nodes according to the expanded number.
[0334] Optionally, the device further comprises:
[0335] The incremental update module 626 is specifically used to determine, in each round of iterative training, the current model difference between the current model to be trained obtained by the current iterative training and the model to be trained obtained by the previous iterative training, and record the current model difference in the incremental update log; in response to an update request, search the incremental update log, determine the current model to be trained obtained by the current iterative training based on the current model difference recorded in the incremental update log and the model to be trained obtained by the previous iterative training, and store the current model to be trained in the first computing node.
[0336] Optionally, the device further comprises:
[0337] The first compression module 628 is specifically used to respond to the trained target model, determine each tree node and each decision edge in each tree structure model included in the target model; determine each node code of each tree node, and determine each edge code of each decision edge; according to a predefined mapping function, map each node code to each first short code, and map each edge code to each second short code; wherein the length of the first short code is smaller than the node code, and the length of the second short code is smaller than the edge code; establish a first correspondence between each first short code and each node code, and establish a first correspondence between each second short code and each node code. According to the second correspondence between the edge codes, a mapping dictionary is constructed according to the first correspondence and the second correspondence, and the mapping dictionary is stored; according to the first correspondence stored in the mapping dictionary, the node codes corresponding to the tree nodes in the tree structure models included in the target model are replaced with the first short codes; according to the second correspondence stored in the mapping dictionary, the edge codes corresponding to the decision edges in the tree structure models included in the target model are replaced with the second short codes; a compressed first compression model is constructed according to the first short code and the second short code, and the first compression model is stored.
[0338] Optionally, the device further comprises:
[0339] The second compression module 630 is specifically used to input the first short codes corresponding to the tree nodes in the tree structure models included in the first compression model, and the second short codes corresponding to the decision edges as input, and input them into a predefined counting function to obtain the number of consecutive repetitions corresponding to the tree nodes in the tree structure models included in the first compression model, and the number of consecutive repetitions corresponding to the decision edges; according to the number of consecutive repetitions corresponding to the tree nodes and the number of consecutive repetitions corresponding to the decision edges, the first compression model is compressed by a run-length coding method to obtain a second compression model.
[0340] Figure 8 A schematic diagram of a distributed model training device provided in this specification specifically includes:
[0341] The second receiving module 700 is used to receive the fitness function sent by the first computing node; wherein the fitness function is determined by the first computing node according to the model training task;
[0342] The current fitness determination module 702 is used to determine the current fitness corresponding to each tree structure model stored in the module according to the fitness function, the training samples and the annotations of the training samples;
[0343] The target tree structure model determination module 704 is used to select a target tree structure model from the tree structure models according to the current fitness corresponding to each of the tree structure models, and send the target tree structure model to the first computing node, so that the first computing node selects a number of reference tree structure models from the historical tree structure models stored in the memory bank, and generates each evolution operation execution task according to the target tree structure model and the reference tree structure model, and allocates each evolution operation execution task;
[0344] The task execution module 706 is used to receive the evolutionary operation execution task assigned by the first computing node, perform the evolutionary operation according to the tree structure model parsed from the evolutionary operation execution task, obtain the updated tree structure model, and send the updated tree structure model to the first computing node, so that the first computing node adopts the incremental fitness evaluation method to determine the updated fitness corresponding to each updated tree structure model, determine each selected tree structure model from the updated tree structure models according to each updated fitness, and construct the current model to be trained according to each selected tree structure model.
[0345] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 2 The distributed model training method shown.
[0346] This manual also provides Fig. 9 The schematic structure diagram of the electronic device shown in FIG. Fig. 9 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 2 The distributed model training method shown. Of course, in addition to the software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0347] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0348] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0349] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0350] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0351] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0352] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0353] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0354] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0355] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0356] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0357] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0358] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0359] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0360] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0361] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0362] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A distributed model training system, characterized in that: The system comprises: a first computing node and second computing nodes; wherein the second computing nodes store a plurality of tree structure models, and the model to be trained is constructed according to the tree structure models respectively stored in the second computing nodes; The first computing node is used to determine the fitness function according to the model training task; send the fitness function to the second computing nodes respectively; receive the target tree structure models sent by the second computing nodes; select several reference tree structure models from the historical tree structure models stored in the memory bank; generate each evolution operation execution task according to the target tree structure models and the reference tree structure models, and assign the evolution operation execution task to each second computing node; receive each updated tree structure model sent by the second computing node, use the incremental fitness evaluation method to determine the updated fitness corresponding to each updated tree structure model, determine each selected tree structure model from the updated tree structure models according to each updated fitness, and construct the current model to be trained according to each selected tree structure model, assign each tree structure model contained in the current model to be trained to each second computing node, and re-execute selection and evolution until the current model to be trained meets the first preset condition to obtain the trained target model; The second computing node is used to receive the fitness function sent by the first computing node, determine the current fitness corresponding to each tree structure model stored in itself according to the fitness function, training samples and the annotations of the training samples, and select a target tree structure model from each tree structure model according to the current fitness corresponding to each tree structure model, and send the target tree structure model to the first computing node; receive the evolution operation execution task assigned by the first computing node, perform an evolution operation according to the tree structure model parsed from the evolution operation execution task, obtain an updated tree structure model, and send the updated tree structure model to the first computing node; The first computing node is specifically used to determine, for each updated tree structure model, the original tree structure model and the changed tree structure model contained in the updated tree structure model according to a predefined change detection function; search the cache fitness corresponding to the original tree structure model contained in the updated tree structure model from a pre-built fitness cache table; determine the change fitness of the changed tree structure model contained in the updated tree structure model according to the fitness function; determine the updated fitness corresponding to the updated tree structure model according to the cache fitness and the change fitness; The first computing node is specifically used to construct a dependency graph based on the tree structure models contained in the evolutionary operation execution tasks, with the evolutionary operation execution tasks as nodes and the dependency relationships between the evolutionary operation execution tasks as edges; divide the dependency graph into a number of subgraphs according to a predefined task partitioning function; use the acquired computing resource amounts corresponding to the second computing nodes, the current load of the tasks executed by the second computing nodes, and the subgraphs contained in the dependency graph as inputs to a predefined task allocation function to determine the subgraphs corresponding to the second computing nodes; determine the evolutionary operation execution tasks corresponding to the second computing nodes based on the evolutionary operation execution tasks corresponding to the nodes contained in the subgraphs corresponding to the second computing nodes, and allocate the evolutionary operation execution tasks corresponding to the second computing nodes to the second computing nodes respectively.
2. A distributed model training method, characterized in that: The method is applied to a first computing node, and the method includes: Determine the fitness function based on the model training task; Sending the fitness function to each second computing node respectively, so that each second computing node determines the current fitness corresponding to each tree structure model stored in itself according to the fitness function, the training sample and the annotation of the training sample, and selects a target tree structure model from the tree structure models according to the current fitness corresponding to each tree structure model, so as to return the target tree structure model to the first computing node; Receiving each target tree structure model sent by each second computing node; Selecting a number of reference tree structure models from various historical tree structure models stored in the memory bank; Generate each evolution operation execution task according to each target tree structure model and the reference tree structure model, and assign each evolution operation execution task to each second computing node, so that each second computing node performs an evolution operation according to the tree structure model parsed from the evolution operation execution task, and obtains and returns an updated tree structure model; Receiving each updated tree structure model sent by each second computing node, and using an incremental fitness evaluation method to determine the updated fitness corresponding to each updated tree structure model; Determining each selected tree structure model from each updated tree structure model according to each updated fitness, and constructing the current to-be-trained model according to each selected tree structure model; Allocating each tree structure model included in the current model to be trained to each second computing node, and re-performing selection and evolution until the current model to be trained meets the first preset condition, thereby obtaining a trained target model; The incremental fitness evaluation method is used to determine the updated fitness corresponding to each updated tree structure model, specifically including: For each updated tree structure model, according to a predefined change detection function, determine the original tree structure model and the changed tree structure model included in the updated tree structure model; Searching the cached fitness corresponding to the original tree structure model contained in the updated tree structure model from the pre-built fitness cache table; Determine the change fitness of the change tree structure model included in the updated tree structure model according to the fitness function; Determining an updated fitness corresponding to the updated tree structure model according to the cache fitness and the change fitness; The allocating the evolution operation execution tasks to the second computing nodes specifically includes: According to each tree structure model included in each evolution operation execution task, a dependency graph is constructed with each evolution operation execution task as a node and dependency relationships between the evolution operation execution tasks as an edge; According to a predefined task partitioning function, the dependency graph is divided into a plurality of subgraphs; Taking the acquired computing resource amounts respectively corresponding to the second computing nodes, the current load of the tasks executed by the second computing nodes, and the subgraphs included in the dependency graph as inputs, and inputting them into a predefined task allocation function, and determining the subgraphs respectively corresponding to the second computing nodes; According to the evolutionary operation execution tasks corresponding to the nodes contained in the subgraphs corresponding to the second computing nodes, the evolutionary operation execution tasks corresponding to the second computing nodes are determined, and the evolutionary operation execution tasks corresponding to the second computing nodes are respectively allocated to the second computing nodes.
3. The method according to claim 2, characterized in that The evolutionary operation includes a crossover operation and / or a mutation operation; The step of generating each evolution operation execution task according to each target tree structure model and the reference tree structure model specifically includes: Acquire a current crossover rate, determine each tree structure model to be crossed according to the current crossover rate, each target tree structure model and the reference tree structure model, and generate each crossover operation execution task according to each tree structure model to be crossed; and / or The current mutation rate is obtained, and the tree structure models to be mutated are determined according to the current mutation rate, the target tree structure models and the reference tree structure model, and the mutation operation execution tasks are generated according to the tree structure models to be mutated.
4. The method according to claim 2, characterized in that The step of selecting a plurality of reference tree structure models from each historical tree structure model stored in the memory library specifically includes: Query the fitness, historical reuse frequency and diversity evaluation results of each historical tree structure model from the memory library; For each historical tree structure model, the fitness, historical reuse frequency and diversity evaluation result of the historical tree structure model are substituted into a predefined selection function to obtain a screening index corresponding to the historical tree structure model; According to the screening indicators respectively corresponding to the historical tree structure models, several reference tree structure models are selected from the historical tree structure models.
5. The method according to claim 2, characterized in that Before re-executing the selection and evolution, the method further comprises: Update the fitness function, update the crossover rate, and update the mutation rate.
6. The method according to claim 5, characterized in that Update the fitness function, update the crossover rate, and update the mutation rate, including: Determine the fitness distribution corresponding to the current model to be trained according to the fitness corresponding to each tree structure model included in the current model to be trained; Determine a population diversity evaluation result corresponding to the current model to be trained according to the differences between the tree structure models included in the current model to be trained; Determining whether the current model to be trained meets a second preset condition according to the fitness distribution and the population diversity evaluation result; When the current model to be trained meets the second preset condition, the fitness function, the crossover rate and the mutation rate are updated.
7. The method according to claim 2, characterized in that The method further comprises: When updating the evolution operation execution tasks, determining the changed evolution operation execution tasks according to the evolution operation execution tasks after the update and the evolution operation execution tasks before the update; Determine an adjusted dependency graph according to the changed evolution operation execution task and the dependency graph; According to the adjusted dependency graph, each updated evolution operation is assigned to perform tasks.
8. The method according to claim 2, characterized in that The method further comprises: determining a plurality of preset communication schemes and a plurality of preset synchronization schemes; For each second computing node, according to any one of the plurality of preset communication schemes and any one of the plurality of preset synchronization schemes, determine a plurality of communication synchronization schemes to be adopted when the second computing node executes each evolution operation execution task corresponding to the second computing node; According to each tree structure model included in each evolutionary operation execution task corresponding to the second computing node and multiple communication synchronization schemes adopted by the second computing node, the communication overheads corresponding to the multiple communication synchronization schemes adopted by the second computing node are determined by a predefined communication overhead function; According to the communication overheads corresponding to the multiple communication synchronization schemes adopted by the second computing node, the target communication synchronization scheme adopted by the second computing node when executing each evolutionary operation execution task corresponding to the second computing node is determined, and the target communication synchronization method used by the second computing node is sent to the second computing node.
9. The method according to claim 2, characterized in that The method further comprises: Obtaining the current load of each second computing node when executing each evolution operation execution task; For each second computing node, when the current load of the second computing node is higher than a preset load threshold, at least part of the evolution operation execution tasks executed by the second computing node are allocated to other second computing nodes.
10. The method according to claim 2, characterized in that The method further comprises: Determine the task execution time of each second computing node respectively according to each evolution operation execution task corresponding to each second computing node; Determine a first target duration according to the task execution duration of each second computing node; According to the original number of the second computing nodes, determining the expanded number of the second computing nodes through a predefined scalability function, and determining a second target duration for each second computing node of the expanded number to perform each evolution operation execution task; If the difference between the first target duration and the second target duration meets a third preset condition, the second computing node is deployed according to the expansion quantity.
11. The method according to claim 2, characterized in that The method further comprises: In each round of iterative training, determine the current model difference between the current model to be trained obtained by the current iterative training and the model to be trained obtained by the previous iterative training, and record the current model difference in the incremental update log; In response to an update request, the incremental update log is searched, and the current model to be trained obtained by the current iterative training is determined based on the current model difference recorded in the incremental update log and the model to be trained obtained by the previous iterative training, and the current model to be trained is stored in the first computing node.
12. The method according to claim 2, characterized in that The method further comprises: In response to the trained target model, determining each tree node and each decision edge in each tree structure model included in the target model; Determine each node code of each tree node, and determine each edge code of each decision edge; According to a predefined mapping function, each node code is mapped to a first short code, and each edge code is mapped to a second short code; wherein the length of the first short code is smaller than that of the node code, and the length of the second short code is smaller than that of the edge code; Establishing a first correspondence between each of the first short codes and each of the node codes, and establishing a second correspondence between each of the second short codes and each of the edge codes, constructing a mapping dictionary according to the first correspondence and the second correspondence, and storing the mapping dictionary; According to the first corresponding relationship stored in the mapping dictionary, each node code corresponding to each tree node in each tree structure model included in the target model is replaced with each first short code; According to the second corresponding relationship stored in the mapping dictionary, each edge code corresponding to each decision edge in each tree structure model included in the target model is replaced with each second short code; A compressed first compression model is constructed according to the first short code and the second short code, and the first compression model is stored.
13. The method according to claim 12, characterized in that The method further comprises: Taking the first short codes corresponding to the tree nodes in the tree structure models included in the first compression model and the second short codes corresponding to the decision edges as input, and inputting them into a predefined counting function, to obtain the number of consecutive repetitions corresponding to the tree nodes in the tree structure models included in the first compression model and the number of consecutive repetitions corresponding to the decision edges; According to the number of consecutive repetitions corresponding to each tree node and the number of consecutive repetitions corresponding to each decision edge, the first compression model is compressed by a run-length encoding method to obtain a second compression model.
14. A distributed model training method, characterized in that: The method is applied to a second computing node, and the method includes: Receiving a fitness function sent by a first computing node; wherein the fitness function is determined by the first computing node according to a model training task; Determine the current fitness corresponding to each tree structure model stored in the system according to the fitness function, the training samples and the annotations of the training samples; According to the current fitness corresponding to each of the tree structure models, a target tree structure model is selected from the tree structure models, and the target tree structure model is sent to the first computing node, so that the first computing node selects a number of reference tree structure models from the historical tree structure models stored in the memory bank, generates each evolution operation execution task according to the target tree structure model and the reference tree structure model, and allocates each evolution operation execution task; Receive the evolutionary operation execution task assigned by the first computing node, perform the evolutionary operation according to the tree structure model parsed from the evolutionary operation execution task, obtain an updated tree structure model, and send the updated tree structure model to the first computing node, so that the first computing node adopts an incremental fitness evaluation method to determine the updated fitness corresponding to each updated tree structure model, determine each selected tree structure model from the updated tree structure models according to each updated fitness, and construct the current model to be trained according to each selected tree structure model; Wherein, the updated fitness is determined by the first computing node for each updated tree structure model according to a predefined change detection function, the original tree structure model and the changed tree structure model contained in the updated tree structure model are determined, the cache fitness corresponding to the original tree structure model contained in the updated tree structure model is searched from a pre-built fitness cache table, the change fitness of the changed tree structure model contained in the updated tree structure model is determined according to the fitness function, and is determined according to the cache fitness and the change fitness; The evolutionary operation execution task is performed by the first computing node according to the tree structure models contained in each evolutionary operation execution task, with each evolutionary operation execution task as a node and the dependency relationship between the evolutionary operation execution tasks as an edge, to construct a dependency graph, and according to a predefined task partitioning function, the dependency graph is divided into a plurality of subgraphs, and the acquired computing resource amounts corresponding to each second computing node, the current load of the execution task of each second computing node, and the subgraphs contained in the dependency graph are input as inputs to a predefined task allocation function to determine the subgraphs corresponding to each second computing node, and according to the evolutionary operation execution tasks corresponding to the nodes contained in the subgraphs corresponding to each second computing node, the evolutionary operation execution tasks corresponding to each second computing node are determined and allocated.
