Model training method and device, business execution method and device and storage medium

Through the training of the data of deep learning tasks and the training model, the problem of low efficiency of artificial prediction time in existing technologies has been solved, and more efficient and accurate computing resource adjustments have been achieved.

CN119357672APending Publication Date: 2025-01-24ZHEJIANG LAB
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411611434.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the prior art, manual prediction deep learning tasks are time-consuming and difficult to effectively adjust computing resources.

Method used

By obtaining the target data set, performing clustering processing to divide the task clusters, and for each deep learning task, input the task data into the corresponding prediction model, extract the task features, predict the time consumption, and calculate the actual time consumption according to the predicted time consumption. Model training is performed using the time deviation.

Benefits of technology

It improves the accuracy and efficiency of deep learning tasks, and can better capture the characteristics of task and reduce the dependence of artificial prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357672A_ABST
    Figure CN119357672A_ABST
Patent Text Reader

Abstract

According to the model training method, the business execution method, the business execution device and the storage medium provided by the invention, the target data set can be acquired, clustering processing is performed on the task data of each deep learning task contained in the target data set so as to divide different task clusters, and for each deep learning task, the business execution efficiency is improved. Inputting the task data of the deep learning task into a to-be-trained prediction model corresponding to a task cluster where the deep learning task is located, so that the prediction model extracts task features from the task data of the deep learning task, and determines prediction time consumption for executing the deep learning task according to the task features, and determining a loss value according to the deviation between the predicted time consumption and the actual time consumption for executing the deep learning task, and training the prediction model according to the loss value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computers, and in particular to a model training method, a business execution method, a device, and a storage medium. Background Art

[0002] In recent years, with the rapid development of computer technology, deep learning has also been widely used. For example, deep learning can be applied to natural language processing, image processing, and so on.

[0003] At present, the time required to execute a deep learning task can be predicted in advance to adjust the computing resources currently allocated to the deep learning task accordingly, and then execute the deep learning task based on the adjusted computing resources. For example, when the predicted time required to execute a deep learning task is long, more computing resources can be allocated to the deep learning task based on the currently allocated computing resources, so as to shorten the time required to execute the deep learning task.

[0004] In the prior art, manual prediction is often used to predict the time required to perform deep learning tasks. However, the efficiency of manual prediction is often low. Summary of the invention

[0005] This specification provides a model training method, a business execution method, a device and a storage medium to partially solve the above-mentioned problems existing in the prior art.

[0006] This manual adopts the following technical solutions:

[0007] This specification provides a model training method, including:

[0008] Obtain a target data set, wherein the target data set includes task data of each deep learning task, and for each deep learning task, the task data of the deep learning task includes task name information and resource information of computing resources allocated to the deep learning task;

[0009] Clustering the task data of each deep learning task contained in the target data set to divide it into different task clusters, each task cluster containing task data corresponding to multiple deep learning tasks, and different task clusters corresponding to different prediction models to be trained;

[0010] For each deep learning task, the task data of the deep learning task is input into a prediction model to be trained corresponding to the task cluster where the deep learning task is located, so that the prediction model extracts task features from the task data of the deep learning task, and determines the predicted time required to execute the deep learning task according to the task features;

[0011] A loss value is determined based on the deviation between the predicted time consumption and the actual time consumption for executing the deep learning task, and the prediction model is trained based on the loss value, and there is a positive correlation between the deviation and the loss value.

[0012] Optionally, obtain the target data set, including:

[0013] Get the initial data set;

[0014] Determine a standard time-consuming interval according to the actual time-consuming corresponding to each deep learning task in the initial data set;

[0015] From the deep learning tasks corresponding to the initial data set, some deep learning tasks whose actual time consumption is not within the standard interval are screened out, and task data corresponding to the some deep learning tasks whose actual time consumption is not within the standard interval are cleared from the initial data set to obtain the target data set.

[0016] Optionally, clustering is performed on the task data of each deep learning task contained in the target data set to divide different task clusters, specifically including:

[0017] Inputting the target data set into a preset feature extraction model so that the feature extraction model extracts task features from the task data of the deep learning task for each deep learning task;

[0018] According to the similarity between the task features corresponding to each deep learning task, the task data of each deep learning task contained in the target data set is clustered to divide different task clusters.

[0019] Optionally, the method further comprises:

[0020] Based on the divided task clusters, each task cluster is displayed in a visual interface in a specified manner.

[0021] Optionally, training the prediction model according to the loss value specifically includes:

[0022] Determining, according to the loss value, a gradient value for a model parameter included in the prediction model;

[0023] Determine the amount of computing resources actually allocated when the deep learning task was actually executed in the past, as the amount of resources corresponding to the deep learning task, and determine the average amount of computing resources actually allocated to each deep learning task included in the task cluster where the deep learning task is located when it was actually executed in the past;

[0024] Determine a resource amount difference between the resource amount corresponding to the deep learning task and the average resource amount;

[0025] The gradient value is adjusted according to the resource quantity difference, and the model parameters included in the prediction model are adjusted according to the adjusted gradient value to train the prediction model.

[0026] Optionally, training the prediction model according to the loss value specifically includes:

[0027] Determining, according to the loss value, a gradient value for a model parameter included in the prediction model;

[0028] Determine a name feature vector corresponding to the task name information contained in the task data of the deep learning task as the name feature vector corresponding to the deep learning task, and determine a comprehensive feature vector corresponding to the task name information of each deep learning task contained in the task cluster where the deep learning task is located;

[0029] Determine a vector difference between the name feature vector corresponding to the deep learning task and the comprehensive feature vector;

[0030] The gradient value is adjusted according to the vector difference, and the model parameters included in the prediction model are adjusted according to the adjusted gradient value to train the prediction model.

[0031] This specification provides a service execution method, including:

[0032] Acquire task data for the deep learning task to be tested, wherein the task data includes task name information of the deep learning task to be tested and resource information of computing resources allocated to the deep learning task to be tested;

[0033] Based on the task data to be tested, determining the task cluster to which the task data to be tested belongs from each pre-divided task cluster as the target task cluster, wherein each task cluster is determined by the above-mentioned model training method;

[0034] Inputting the task data to be tested into a pre-trained prediction model corresponding to the target task cluster, so as to determine the predicted time required to execute the deep learning task to be tested according to the task data to be tested through the prediction model, wherein the prediction model is trained by the above-mentioned model training method;

[0035] According to the predicted time consumption, an adjustment operation is performed on at least a portion of the task data of the deep learning task to be tested.

[0036] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned model training method or business execution method.

[0037] 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 model training method or business execution method when executing the program.

[0038] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0039] The model training method provided in this specification can obtain a target data set, cluster the task data of each deep learning task contained in the target data set to divide it into different task clusters, and for each deep learning task, input the task data of the deep learning task into the prediction model to be trained corresponding to the task cluster where the deep learning task is located, so that the prediction model extracts task features from the task data of the deep learning task, and determines the predicted time required to execute the deep learning task based on the task features, determines the loss value based on the deviation between the predicted time and the actual time required to execute the deep learning task, and trains the prediction model based on the loss value.

[0040] It can be seen from this that in the above model training method, the task data of each deep learning task in the target data set can be clustered first to divide different task clusters, so as to train different prediction models for different task clusters, so that in the subsequent practical application process, according to the task cluster to which the task data of the deep learning task to be predicted belongs, the corresponding prediction model is selected to predict the time consumption of the deep learning task, so that the task characteristics of the deep learning task can be better captured through the prediction model, which improves the accuracy of the prediction to a certain extent. At the same time, there is no need to use manual prediction as in the existing technology, which greatly improves the prediction efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] 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:

[0042] Figure 1 A flowchart of a model training method provided in this specification;

[0043] Figure 2 A flowchart of a business execution method provided in this specification;

[0044] Figure 3 A schematic diagram of a model training device provided in this specification;

[0045] Figure 4 A schematic diagram of a service execution device provided in this specification;

[0046] Figure 5 A method corresponding to the Figure 1 or Figure 2 Schematic diagram of the structure of an electronic device. DETAILED DESCRIPTION

[0047] 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.

[0048] In recent years, with the rapid development of computer technology, deep learning has also been widely used. For example, deep learning can be applied to natural language processing, image processing, and so on.

[0049] At present, the time required to execute a deep learning task can be predicted in advance to adjust the computing resources currently allocated to the deep learning task accordingly, and then execute the deep learning task based on the adjusted computing resources. For example, when the predicted time required to execute a deep learning task is long, more computing resources can be allocated to the deep learning task based on the currently allocated computing resources to shorten the time required to execute the deep learning task. In the prior art, manual prediction is often used to predict the time required to execute a deep learning task. However, the efficiency of prediction using manual prediction is often low.

[0050] Therefore, this specification provides a model training method, which can effectively solve the problems in the prior art.

[0051] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0052] Figure 1 A flow chart of a model training method provided in this specification includes the following steps:

[0053] S101: Obtain a target data set, where the target data set includes task data of each deep learning task. For each deep learning task, the task data of the deep learning task includes task name information and computing resource information allocated to the deep learning task.

[0054] The execution subject of the model training method involved in this specification can be a terminal device such as a desktop computer, a laptop computer, or a client installed in the terminal device, or a server. The following only takes the server as the execution subject as an example to illustrate the model training method in the embodiment of this specification.

[0055] At present, in order to efficiently complete deep learning tasks, computing clusters can usually be used to perform deep learning tasks. In this manual, for different categories of deep learning tasks, multiple different prediction models can be trained separately to predict the execution time of different categories of deep learning tasks (the time required from the start to the completion of the deep learning task), and then the computing resources currently allocated to the deep learning task can be adjusted accordingly based on the predicted time.

[0056] Specifically, the server may first obtain a target data set to use the obtained target data set in the subsequent training of the prediction model. Among them, the target data set may include task data of each deep learning task. For each deep learning task, the task data of the deep learning task includes task name information and resource information of the computing resources allocated to the deep learning task (such as: the number of CPUs, GPUs, computing nodes, etc. allocated to the deep learning task).

[0057] Task name information refers to the name that users usually give to deep learning tasks according to some common naming rules (such as: reference task category naming). For example, user A can usually name the object detection deep learning task as object detection-A and the text classification deep learning task as text classification-A. For another example, user B can usually name the object detection deep learning task as object detection-B and the image classification deep learning task as imag classification-B.

[0058] Of course, in order to ensure the prediction effect of the subsequent trained prediction model, it is often necessary to take into account the factors of abnormal data in the training data set used for training. For this reason, in this manual, it is often possible to first obtain an initial data set, and then clear the abnormal data in the initial data set. The data set after clearing the abnormal data is used as the target data set, so that the target data set can be used in the subsequent model training process.

[0059] Specifically, the server may first obtain an initial data set, which includes task data of multiple deep learning tasks, and then determine a standard time-consuming interval according to the actual time-consuming time corresponding to each deep learning task in the initial data set.

[0060] For example, the interquartile range method can be used to determine the standard time interval, wherein, first, each deep learning task can be sorted in order from small to large according to the actual time corresponding to each deep learning task, to obtain a sorted task sequence, and the actual time corresponding to the deep learning task at the 25% position of the task sequence is used as the left endpoint of the standard time interval, and the actual time corresponding to the deep learning task at the 75% position of the task sequence is used as the right endpoint of the standard time interval. Of course, in addition to the interquartile range method, other methods such as the standard deviation method and the box plot method can also be used to determine the standard time interval, which is not limited in this specification.

[0061] Furthermore, some deep learning tasks (such as task a and task b) whose actual time consumption is not within the standard range can be screened out from the deep learning tasks corresponding to the initial data set, and the task data corresponding to the screened out deep learning tasks whose actual time consumption is not within the standard range (such as task data of task a and task data of task b) can be cleared from the initial data set to obtain the target data set.

[0062] Of course, in addition to using the above method to remove abnormal data in the initial data set, it is also possible to filter out the deep learning tasks with abnormal resource information of the allocated computing resources from the initial data set for each deep learning task in the initial data set according to the resource information of the computing resources allocated to the deep learning task, and remove the corresponding task data from the initial data set to obtain the target data set. For example, if there is a deep learning task with abnormally few computing resources allocated to it compared with other deep learning tasks of the same category, its task data can be removed from the initial data set.

[0063] S102: Clustering the task data of each deep learning task contained in the target data set to divide it into different task clusters, each task cluster containing task data corresponding to multiple deep learning tasks, and different task clusters corresponding to different prediction models to be trained.

[0064] After obtaining the target data set, the task data of each deep learning task contained in the target data set can be clustered to divide different task clusters, wherein each task cluster can contain task data corresponding to multiple deep learning tasks.

[0065] Specifically, the target data set can be input into a preset feature extraction model, so that the feature extraction model can extract task features from the task data of the deep learning task for each deep learning task in the target data set. Furthermore, the task data of each deep learning task contained in the target data set can be clustered (such as: a k-means clustering algorithm can be used) according to the similarity between the task features corresponding to each deep learning task to divide different task clusters. That is, each deep learning task with a high similarity between task features can be divided into the same task cluster. For example, a target detection deep learning task with a task name of object detection-A and a corresponding number of allocated CPUs of 3 can be divided into the same task cluster with a task name of object detection-B and a corresponding number of allocated CPUs of 3.

[0066] Among them, for each deep learning task, in the process of extracting task features, the task name information contained in the task data of the deep learning task can be firstly segmented, so that the first task feature can be extracted. Then, the second task feature can be extracted from the resource information of the computing resources allocated to the deep learning task. Therefore, the first task feature and the second task feature can be spliced ​​to obtain the spliced ​​feature, so that the spliced ​​feature can be used as the task feature extracted from the task data of the deep learning task.

[0067] After dividing the target data set into task clusters, a prediction model to be trained corresponding to each task cluster can be set. That is, the task data of the deep learning tasks contained in each task cluster can be used to train different prediction models respectively, so as to predict the execution time of the deep learning tasks to be tested belonging to different task clusters through each trained prediction model.

[0068] In this specification, the above-mentioned task data can be in multiple forms. For example, the task data can be in the form of text. During the training process, the task name information contained in the task data and the resource information of the computing resources allocated for the deep learning task can be input into the prediction model to be trained in the form of text for subsequent training. For another example, the task data can be in the form of audio. During the training process, the user can record audio containing the task name information of the deep learning task and the resource information of the computing resources allocated for the deep learning task. The server can convert the audio into text and input it into the prediction model to be trained for subsequent training.

[0069] For another example, the task data can also be in the form of a picture. During the training process, the user can intercept a picture containing the task name information of the deep learning task and the resource information of the computing resources allocated for the deep learning task. The server can extract the task name information of the deep learning task and the resource information of the computing resources allocated for the deep learning task from the picture and input it into the prediction model to be trained for subsequent training. Of course, the task data can also be data in a specified format (such as JSON format data). The server processes the data in the specified format and then trains the prediction model to be trained based on the processed data.

[0070] S103: For each deep learning task, the task data of the deep learning task is input into the prediction model to be trained corresponding to the task cluster where the deep learning task is located, so that the prediction model extracts task features from the task data of the deep learning task, and determines the predicted time required to execute the deep learning task based on the task features.

[0071] S104: Determine a loss value based on a deviation between the predicted time consumption and the actual time consumption for executing the deep learning task, and train the prediction model based on the loss value, wherein the deviation is positively correlated with the loss value.

[0072] In this specification, for each task cluster divided as described above, the task data of each deep learning task included in the task cluster can be used as training data to train the prediction model to be trained corresponding to the task cluster.

[0073] Specifically, for each deep learning task, the task data of the deep learning task can be input into the prediction model to be trained corresponding to the task cluster where the deep learning task is located, so that the prediction model can extract task features from the task data of the deep learning task, and the predicted time required to execute the deep learning task can be determined based on the task features.

[0074] Furthermore, the loss value can be determined based on the deviation between the predicted time and the actual time of executing the deep learning task, wherein the deviation and the loss value are positively correlated. During the training process, the corresponding prediction model can be trained by gradually reducing the deviation between the predicted time and the actual time of executing the deep learning task.

[0075] In addition, in the process of training the prediction model, in order to comprehensively consider the impact of two factors, the task name information in the task data of the deep learning task and the amount of computing resources allocated to the deep learning task, on the training results, the gradient value of the model parameters in the prediction model can be adjusted accordingly to improve the prediction effect of the trained prediction model.

[0076] Specifically, for each deep learning task in the target data set, the server can adjust the gradient value based on the difference between the amount of computing resources actually allocated when the deep learning task was actually executed historically and the average amount of computing resources actually allocated to each deep learning task contained in the task cluster where the deep learning task is located when it was actually executed historically.

[0077] Among them, the server can first determine the gradient value of the model parameters included in the prediction model according to the corresponding loss value. Then, the amount of computing resources allocated when the deep learning task was actually executed in history can be determined, and used as the amount of resources corresponding to the deep learning task. In addition, the average amount of computing resources allocated to each deep learning task contained in the task cluster where the deep learning task is located when it was actually executed in history can also be determined. The server can determine the difference in resource amount between the amount of resources corresponding to the deep learning task and the average amount of resources, and then adjust the gradient value according to the difference in resource amount, so as to make corresponding adjustments to the model parameters included in the prediction model according to the adjusted gradient value, so as to train the prediction model.

[0078] For example, when the gradient value determined based on the above loss value is high, but the resource difference between the determined resource amount corresponding to the deep learning task and the average resource amount corresponding to the task cluster to which it belongs is small, it means that during the training process, the adverse effect caused by the task name information in the task data of the deep learning task is relatively large (this adverse effect may be caused by the task name information not being consistent with the conventional name). Therefore, in order to comprehensively consider the two factors of the task name information in the task data of the deep learning task and the amount of computing resources allocated to the deep learning task, the adverse effect of the task name information on the determined loss value can be appropriately reduced, that is, the gradient value is lowered, so as to adjust the model parameters contained in the prediction model accordingly according to the lowered gradient value, so as to train the prediction model.

[0079] For another example, when the gradient value determined based on the above loss value is low, but the resource difference between the determined resource amount corresponding to the deep learning task and the average resource amount corresponding to the task cluster to which it belongs is large, it means that during the training process, the adverse effect caused by the task name information in the task data of the deep learning task is relatively large (for the same reason as above). Therefore, in order to comprehensively consider the impact of the two factors of the task name information in the task data of the deep learning task and the amount of computing resources allocated to the deep learning task on the training results, the adverse effect of the task name information on the determined loss value is reduced. However, because the resource difference is large at this time, the gradient value should be increased, so as to adjust the model parameters contained in the prediction model accordingly according to the increased gradient value, so as to train the prediction model.

[0080] Of course, for each deep learning task in the target data set, in addition to adjusting the gradient value based on the difference between the amount of computing resources allocated when the deep learning task was actually executed in history and the average amount of computing resources allocated to each deep learning task contained in the task cluster where the deep learning task is located when it was actually executed in history, the gradient value can also be adjusted based on the vector difference between the name feature vector corresponding to the task name information of the deep learning task and the comprehensive feature vector corresponding to the task name information of each deep learning task in the task cluster where it is located.

[0081] Among them, the server can first determine the gradient value of the model parameters contained in the prediction model according to the corresponding loss value. Then, the name feature vector corresponding to the task name information of the deep learning task can be determined as the name feature vector corresponding to the deep learning task. In addition, the comprehensive feature vector corresponding to the task name information of each deep learning task contained in the task cluster where the deep learning task is located can be determined (which can be understood as the average value of each name feature vector), and then, the vector difference between the name feature vector corresponding to the deep learning task and the comprehensive feature vector can be determined, and then the gradient value can be adjusted according to the vector difference, and the model parameters contained in the prediction model can be adjusted according to the adjusted gradient value, so as to train the prediction model.

[0082] For example, when the gradient value determined according to the above loss value is low, but the vector difference between the name feature vector corresponding to the deep learning task and the comprehensive feature vector corresponding to the task cluster to which it belongs is large, it means that during the training process, the task name information in the task data of the deep learning task has a small influence on the final result output by the prediction model, while the amount of computing resources allocated to the deep learning task in the task data of the deep learning task has a large influence on the final result output by the prediction model. In order to comprehensively consider the influence of the two factors of the task name information in the task data of the deep learning task and the amount of computing resources allocated to the deep learning task on the training results, the influence of the task name information in the task data of the deep learning task on the final result output by the prediction model can be appropriately enhanced during the training process, that is, the gradient value is increased, so as to adjust the model parameters contained in the prediction model accordingly according to the increased gradient value, so as to train the prediction model. In other words, it is not desired that the prediction model only pays attention to the amount of resources to output the prediction result, but it is necessary to comprehensively consider the two aspects of the task name information and the amount of resources, that is, the importance of the task name information is not ignored.

[0083] For another example, when the gradient value determined based on the above loss value is high, but the vector difference between the name feature vector corresponding to the deep learning task and the comprehensive feature vector corresponding to the task cluster to which it belongs is small, it means that during the training process, the task name information in the task data of the deep learning task has a relatively small impact on the final result output by the prediction model, while the amount of computing resources allocated to the deep learning task in the task data of the deep learning task has a relatively large impact on the final result output by the prediction model. Similarly, in order to prevent the prediction model from ignoring the importance of the task name information, in this case, the impact of the task name information in the task data of the deep learning task on the final result output by the prediction model during the training process can also be enhanced, except that, contrary to the above example, because the vector difference is small here, the gradient value needs to be lowered, so that the model parameters contained in the prediction model can be adjusted accordingly according to the lowered gradient value, so as to train the prediction model.

[0084] Of course, in this specification, in order to facilitate viewing of the task clusters, for each divided task cluster, each task cluster can also be displayed in a visual interface in a specified manner. For example, PCA (principal component analysis) technology can be used to analyze the task data of the deep learning tasks contained in each task cluster, and the task data of the deep learning tasks contained in each task cluster can be displayed in the form of a two-dimensional PCA graph in the visual interface.

[0085] In addition, in order to ensure the prediction effect of the prediction model, the prediction model can also be verified by a verification data set in this manual. For example, k-fold cross-validation, stratified cross-validation, etc. can be used for verification, thereby preventing the prediction model from overfitting and ensuring the prediction effect of the prediction model.

[0086] It can be seen from this that in the above model training method, the task data of each deep learning task in the target data set can be clustered first to divide different task clusters, so as to train different prediction models for different task clusters, so that in the subsequent practical application process, according to the task cluster to which the task data of the deep learning task to be predicted belongs, the corresponding prediction model is selected to predict the time consumption of the deep learning task, so that the task characteristics of the deep learning task can be better captured through the prediction model, which improves the accuracy of the prediction to a certain extent. At the same time, there is no need to use manual prediction as in the existing technology, which greatly improves the prediction efficiency.

[0087] In addition, during the above-mentioned model training process, the gradient value can also be adjusted based on the difference between the amount of computing resources actually allocated when the deep learning task was actually executed in history and the average amount of computing resources allocated to each deep learning task contained in the task cluster where the deep learning task is located when it was actually executed in history, or based on the vector difference between the name feature vector corresponding to the deep learning task name information and the comprehensive feature vector corresponding to the task name information of each deep learning task in the task cluster where it is located. In this way, the influence of these two factors, namely the task name information in the task data of the deep learning task and the amount of computing resources allocated to the deep learning task, on the training results can be comprehensively considered during the training process, thereby greatly improving the prediction effect of the trained prediction model.

[0088] The above mainly introduces the model training method. After the model training is completed, it can be deployed for business execution. Next, a business execution method provided in this specification will be described.

[0089] Figure 2 A flowchart of a business execution method provided in this specification includes the following steps:

[0090] S201: Acquire task data for a deep learning task to be tested, wherein the task data includes task name information of the deep learning task to be tested and resource information of computing resources allocated to the deep learning task to be tested.

[0091] For the service execution method provided in this specification, the execution subject can be a server or a terminal device such as a desktop computer or a laptop computer. The following only takes the server as an example to explain the subsequent content in detail.

[0092] In this specification, after the prediction model is trained, the trained prediction model can be deployed in the server to determine the predicted time required to execute the deep learning task to be tested according to the task data of the deep learning task to be tested. Furthermore, the task data of the deep learning task to be tested can be adjusted accordingly according to the determined predicted time required to execute the deep learning task based on the adjusted task data.

[0093] S202: Based on the task data to be tested, determine the task cluster to which the task data to be tested belongs from the pre-divided task clusters as the target task cluster, wherein the task clusters are determined by the above-mentioned model training method.

[0094] To this end, the server can determine the task cluster to which the task data to be tested belongs from the task clusters pre-divided by the above-mentioned model training method based on the task data to be tested, as the target task cluster. For example, the task features corresponding to the deep learning tasks contained in each task cluster can be matched with the task features corresponding to the deep learning task to be tested, and the task cluster where the deep learning tasks with high similarity to the task features corresponding to the deep learning task to be tested are located is the target task cluster.

[0095] S203: Input the task data to be tested into a pre-trained prediction model corresponding to the target task cluster, so as to determine the predicted time required to execute the deep learning task to be tested according to the task data to be tested through the prediction model, wherein the prediction model is trained using the above-mentioned model training method.

[0096] S204: Performing an adjustment operation on at least part of the task data of the deep learning task to be tested according to the predicted time consumption.

[0097] After determining the target task cluster, the task data to be tested can be input into a pre-trained prediction model corresponding to the target task cluster, and then the prediction model can be used to determine the predicted time required to execute the deep learning task to be tested based on the task data to be tested.

[0098] Then, based on the above-mentioned predicted time consumption, at least part of the task data of the deep learning task to be tested can be adjusted. For example, when the predicted time consumption corresponding to the deep learning task to be tested is long, the number of CPUs allocated to the deep learning task to be tested can be increased to execute the deep learning task to be tested based on the adjusted computing resources, thereby shortening the time consumption for executing the deep learning task. For another example, when the predicted time consumption corresponding to the deep learning task to be tested is short and the number of CPUs currently allocated to it is abnormally large, in order to more reasonably allocate computing resources in the computing cluster, the number of CPUs allocated to it can be appropriately reduced to allocate these CPUs to other deep learning tasks.

[0099] It can be seen from this that in the actual application process, the task cluster to which the task data of the deep learning task to be tested belongs can be used to select the corresponding prediction model to predict the time consumption of the deep learning task, so that the task characteristics of the deep learning task can be better captured through the prediction model, which improves the accuracy of the prediction to a certain extent. At the same time, there is no need to use manual prediction like the existing technology, which greatly improves the prediction efficiency.

[0100] The above are one or more implementation methods of this specification. Based on the same idea, this specification also provides corresponding model training devices and business execution devices, such as Figure 3 , Figure 4 shown.

[0101] Figure 3 A schematic diagram of a model training device provided in this specification includes:

[0102] Acquisition module 301: used to acquire a target data set, wherein the target data set includes task data of each deep learning task, and for each deep learning task, the task data of the deep learning task includes task name information and resource information of computing resources allocated to the deep learning task;

[0103] Processing module 302: used to perform clustering processing on the task data of each deep learning task contained in the target data set to divide it into different task clusters, each task cluster contains task data corresponding to multiple deep learning tasks, and different task clusters correspond to different prediction models to be trained;

[0104] Prediction module 303: for each deep learning task, inputting the task data of the deep learning task into the prediction model to be trained corresponding to the task cluster where the deep learning task is located, so that the prediction model extracts task features from the task data of the deep learning task, and determines the predicted time consumption of executing the deep learning task according to the task features;

[0105] Training module 304: used to determine a loss value according to the deviation between the predicted time and the actual time of executing the deep learning task, and train the prediction model according to the loss value, and there is a positive correlation between the deviation and the loss value.

[0106] Optionally, the acquisition module 301 is specifically used to: acquire an initial data set; determine a standard time consumption interval based on the actual time consumption corresponding to each deep learning task in the initial data set; filter out some deep learning tasks whose actual time consumption is not within the standard interval from the deep learning tasks corresponding to the initial data set, and clear the task data corresponding to the some deep learning tasks whose actual time consumption is not within the standard interval from the initial data set to obtain the target data set.

[0107] Optionally, the processing module 302 is specifically used to: input the target data set into a preset feature extraction model so that the feature extraction model extracts task features from the task data of the deep learning task for each deep learning task; cluster the task data of each deep learning task contained in the target data set according to the similarity between the task features corresponding to each deep learning task, so as to divide different task clusters.

[0108] Optionally, the method further includes: a display module 305;

[0109] The display module 305 is specifically used to display each task cluster in a visual interface in a specified manner based on each divided task cluster.

[0110] Optionally, the training module 304 is specifically used to: determine the gradient value of the model parameters included in the prediction model according to the loss value; determine the resource amount of the computing resources allocated when the deep learning task was actually executed in history as the resource amount corresponding to the deep learning task, and determine the average resource amount of the computing resources allocated to each deep learning task included in the task cluster where the deep learning task is located when it was actually executed in history; determine the resource amount difference between the resource amount corresponding to the deep learning task and the average resource amount; adjust the gradient value according to the resource amount difference, and adjust the model parameters included in the prediction model according to the adjusted gradient value to train the prediction model.

[0111] Optionally, the training module 304 is specifically used to: determine the gradient value of the model parameters contained in the prediction model according to the loss value; determine the name feature vector corresponding to the task name information contained in the task data of the deep learning task as the name feature vector corresponding to the deep learning task, and determine the comprehensive feature vector corresponding to the task name information of each deep learning task contained in the task cluster where the deep learning task is located; determine the vector difference between the name feature vector corresponding to the deep learning task and the comprehensive feature vector; adjust the gradient value according to the vector difference, and adjust the model parameters contained in the prediction model according to the adjusted gradient value to train the prediction model.

[0112] Figure 4 A schematic diagram of a service execution device provided in this specification includes:

[0113] Acquisition module 401: used to acquire task data for the deep learning task to be tested, wherein the task data includes task name information of the deep learning task to be tested and resource information of computing resources allocated to the deep learning task to be tested;

[0114] Determining module 402: used to determine, based on the task data to be tested, the task cluster to which the task data to be tested belongs from the pre-divided task clusters as the target task cluster, wherein the task clusters are determined by the above-mentioned model training method;

[0115] Prediction module 403: used to input the task data to be tested into a pre-trained prediction model corresponding to the target task cluster, so as to determine the predicted time consumption of executing the deep learning task to be tested according to the task data to be tested through the prediction model, wherein the prediction model is trained by the above-mentioned model training method;

[0116] Execution module 404: used to perform adjustment operations on at least part of the task data of the deep learning task to be tested according to the predicted time consumption.

[0117] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 The model training method shown or Figure 2 The business execution method shown.

[0118] This manual also provides Figure 5 The one shown corresponds to Figure 1 or Figure 2 A schematic diagram of the electronic device. Figure 5As shown, 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 1 The model training method shown or Figure 2 The business execution method shown.

[0119] Of course, in addition to 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 executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0120] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to 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 an improvement in a method flow cannot be implemented using a hardware entity module. 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 a chip manufacturer to design and produce a dedicated integrated circuit chip. 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 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.

[0121] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed 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 controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can 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, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0122] 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.

[0123] 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.

[0124] 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.) that contain computer-usable program code.

[0125] 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 box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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.

[0126] 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 including 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.

[0127] 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.

[0128] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0129] 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.

[0130] 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.

[0131] 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.

[0132] 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.

[0133] 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.

[0134] 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.

[0135] 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 model training method, characterized in that: include: Obtain a target data set, wherein the target data set includes task data of each deep learning task, and for each deep learning task, the task data of the deep learning task includes task name information and resource information of computing resources allocated to the deep learning task; Clustering the task data of each deep learning task contained in the target data set to divide it into different task clusters, each task cluster containing task data corresponding to multiple deep learning tasks, and different task clusters corresponding to different prediction models to be trained; For each deep learning task, the task data of the deep learning task is input into a prediction model to be trained corresponding to the task cluster where the deep learning task is located, so that the prediction model extracts task features from the task data of the deep learning task, and determines the predicted time required to execute the deep learning task according to the task features; A loss value is determined based on the deviation between the predicted time consumption and the actual time consumption for executing the deep learning task, and the prediction model is trained based on the loss value, and there is a positive correlation between the deviation and the loss value.

2. The method according to claim 1, characterized in that Get the target data set, including: Get the initial data set; Determine a standard time-consuming interval according to the actual time-consuming corresponding to each deep learning task in the initial data set; From the deep learning tasks corresponding to the initial data set, some deep learning tasks whose actual time consumption is not within the standard interval are screened out, and task data corresponding to the some deep learning tasks whose actual time consumption is not within the standard interval are cleared from the initial data set to obtain the target data set.

3. The method according to claim 1, characterized in that Clustering is performed on the task data of each deep learning task contained in the target data set to divide different task clusters, specifically including: Inputting the target data set into a preset feature extraction model so that the feature extraction model extracts task features from the task data of the deep learning task for each deep learning task; According to the similarity between the task features corresponding to each deep learning task, the task data of each deep learning task contained in the target data set is clustered to divide different task clusters.

4. The method according to claim 1, characterized in that The method further comprises: Based on the divided task clusters, each task cluster is displayed in a visual interface in a specified manner.

5. The method according to claim 1, characterized in that The prediction model is trained according to the loss value, specifically including: Determining, according to the loss value, a gradient value for a model parameter included in the prediction model; Determine the amount of computing resources actually allocated when the deep learning task was actually executed in the past, as the amount of resources corresponding to the deep learning task, and determine the average amount of computing resources actually allocated to each deep learning task included in the task cluster where the deep learning task is located when it was actually executed in the past; Determine a resource amount difference between the resource amount corresponding to the deep learning task and the average resource amount; The gradient value is adjusted according to the resource quantity difference, and the model parameters included in the prediction model are adjusted according to the adjusted gradient value to train the prediction model.

6. The method according to claim 1, characterized in that The prediction model is trained according to the loss value, specifically including: Determining, according to the loss value, a gradient value for a model parameter included in the prediction model; Determine a name feature vector corresponding to the task name information contained in the task data of the deep learning task as the name feature vector corresponding to the deep learning task, and determine a comprehensive feature vector corresponding to the task name information of each deep learning task contained in the task cluster where the deep learning task is located; Determine a vector difference between the name feature vector corresponding to the deep learning task and the comprehensive feature vector; The gradient value is adjusted according to the vector difference, and the model parameters included in the prediction model are adjusted according to the adjusted gradient value to train the prediction model.

7. A service execution method, characterized in that: include: Acquire task data for the deep learning task to be tested, wherein the task data includes task name information of the deep learning task to be tested and resource information of computing resources allocated to the deep learning task to be tested; Based on the task data to be tested, determining the task cluster to which the task data to be tested belongs from the pre-divided task clusters as the target task cluster, wherein the task clusters are determined by the method according to any one of claims 1 to 6; Inputting the task data to be tested into a pre-trained prediction model corresponding to the target task cluster, so as to determine the predicted time required to execute the deep learning task to be tested according to the task data to be tested through the prediction model, wherein the prediction model is trained by the method according to any one of claims 1 to 6; According to the predicted time consumption, an adjustment operation is performed on at least a portion of the task data of the deep learning task to be tested.

8. A model training device, characterized in that: include: Acquisition module: used to acquire a target data set, wherein the target data set includes task data of each deep learning task. For each deep learning task, the task data of the deep learning task includes task name information and resource information of computing resources allocated to the deep learning task; Processing module: used to perform clustering processing on the task data of each deep learning task contained in the target data set to divide it into different task clusters, each task cluster contains task data corresponding to multiple deep learning tasks, and different task clusters correspond to different prediction models to be trained; Prediction module: for each deep learning task, inputting the task data of the deep learning task into the prediction model to be trained corresponding to the task cluster where the deep learning task is located, so that the prediction model extracts task features from the task data of the deep learning task, and determines the predicted time consumption of executing the deep learning task according to the task features; Training module: used to determine the loss value according to the deviation between the predicted time and the actual time of executing the deep learning task, and train the prediction model according to the loss value, and there is a positive correlation between the deviation and the loss value.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Deep learning model training method and device, electronic equipment and readable storage medium

    CN112508126A

  • High-performance cluster task scheduling method and device, electronic equipment and storage medium

    CN113886080A

  • Information pushing method and device

    CN115049434A

  • Deep learning model training method, text data processing method and device

    CN117436502A

  • Service execution method and device, storage medium and electronic equipment

    CN118193797A