A method, system, device and storage medium for deploying a training task
By using template library selection and resource scheduling algorithms, the problem of inconvenient deployment of large model training tasks is solved, achieving efficient and reliable deployment of training tasks and improving execution efficiency.
Patent Information
- Application Number
- CN202311610207.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-28
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-11-28
AI Technical Summary
In the current field of deep learning, model development platforms have limited support for task management of large models and lack mature methods for deploying training tasks, resulting in inconvenient deployment and low efficiency.
A method for deploying training tasks is provided, which selects target templates through a template library, configures parameters and schedules resources to ensure that node resources and communication efficiency meet preset rules, and uses a resource scheduling algorithm to select a set of nodes from the cluster for deployment.
It enables convenient and reliable deployment of large model training tasks, improves the execution efficiency of training tasks, and ensures the communication efficiency between nodes.
Smart Images

Figure CN117555666B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of deep learning technology, and in particular to a method, system, device, and storage medium for deploying training tasks. Background Technology
[0002] Currently, artificial intelligence technology is developing rapidly, and various industries are undergoing intelligent transformation. In particular, large-scale AIGC (Artificial Intelligence Generated Content) technology is profoundly changing people's lives and work patterns. Enterprises are actively promoting the training of large-scale models, resulting in a variety of large-scale model training frameworks, which also pose challenges to the management of large-scale model training tasks.
[0003] In the current field of deep learning, model development platforms have limited support for task management of large models, and there is no mature method yet.
[0004] In summary, how to conveniently and effectively deploy training tasks for large models is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this invention is to provide a method, system, device, and storage medium for deploying training tasks, so as to facilitate and effectively deploy training tasks using large models.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] A method for deploying a training task, comprising:
[0008] After receiving a first instruction carrying a model type representing the training task, a target template corresponding to the model type is selected from a preset template library;
[0009] Based on the received second instruction, the parameters of the target template are configured;
[0010] After configuring the parameters of the target template, it is checked whether the parameter configuration information of the target template conforms to the preset resource configuration rules for large models;
[0011] If so, based on the parameter configuration information of the target template, a set of nodes for deploying the training task is selected from the cluster through a preset resource scheduling algorithm, so that the node resources in the set of nodes meet the requirements of the parameter configuration information of the target template, and the communication efficiency between the nodes in the set of nodes meets the preset communication efficiency requirements.
[0012] Based on the parameter configuration information of the target template, the training task is deployed in the selected set of nodes.
[0013] In one specific embodiment of the present invention, after configuring the parameters of the target template, detecting whether the parameter configuration information of the target template conforms to preset resource configuration rules for large models includes:
[0014] After configuring the parameters of the target template, based on the parameter configuration information of the target template, determine whether a×t×p≥b is true;
[0015] If a×t×p≥b holds true, then the parameter configuration information of the target template is determined to conform to the preset resource configuration rules for large models.
[0016] If a×t×p≥b is not true, it is determined that the parameter configuration information of the target template does not conform to the preset resource configuration rules for large models, and an alarm message indicating a model memory error is output.
[0017] Where 'a' represents the single accelerator card memory size in the parameter configuration information of the target template, 't' represents the tensor parallelism in the parameter configuration information of the target template, 'p' represents the pipeline parallelism in the parameter configuration information of the target template, and 'b' represents the training model size in the parameter configuration information of the target template.
[0018] In one specific embodiment of the present invention, after determining that the parameter configuration information of the target template conforms to a preset resource configuration rule for a large model, the method further includes:
[0019] When it is detected that t≤c is not true, the first prompt message is output indicating that the tensor parallelism does not meet the requirements of high-speed data communication.
[0020] Where c represents the number of single-machine accelerator cards in the parameter configuration information of the target template.
[0021] In one specific embodiment of the present invention, after determining that the parameter configuration information of the target template conforms to a preset resource configuration rule for a large model, the method further includes:
[0022] When it is detected that p≤e is not true, a second prompt message is output indicating that the network in the cabinet does not meet the requirements of pipeline parallel data communication.
[0023] Where e represents the number of nodes in a single cabinet in the parameter configuration information of the target template.
[0024] In one specific embodiment of the present invention, the deployment of the training task in the selected node set based on the parameter configuration information of the target template includes:
[0025] Based on the parameter configuration information of the target template, the environmental preparation information on which the target template depends is automatically determined;
[0026] Based on the environment preparation information, the environment is automatically deployed in the selected set of nodes, and the training task is deployed in the set of nodes based on the parameter configuration information of the target template.
[0027] In one specific embodiment of the present invention, it further includes:
[0028] Determine whether the number of nodes used in the parameter configuration information of the target template is higher than a preset first threshold;
[0029] If the number of nodes used is not higher than the first threshold, a third prompt message indicating that the number of nodes used is too low will be output, and it will be determined whether a deployment confirmation instruction has been received.
[0030] If the deployment confirmation instruction is not received, the deployment process for the current training task ends.
[0031] In one specific embodiment of the present invention, the resource scheduling algorithm is a clustering algorithm. Accordingly, based on the parameter configuration information of the target template, a set of nodes for deploying the training task is selected from the cluster using a preset resource scheduling algorithm. This ensures that the node resources in the node set meet the requirements of the parameter configuration information of the target template, and that the communication efficiency between nodes in the node set meets preset communication efficiency requirements. This includes:
[0032] Select each node in the cluster that is allowed to deploy training tasks, and remove each node whose number of idle accelerator cards is lower than the tensor parallelism t in the parameter configuration information of the target template. Then, take the set of the remaining nodes as the set of nodes to be clustered.
[0033] Based on the clustering algorithm, the clustering objective is to reduce the sum of communication distances between nodes in the same subset. The set of nodes to be clustered is divided into multiple subsets, and the number of nodes in each subset is equal to the pipeline parallelism p in the parameter configuration information of the target template.
[0034] Based on the clustering algorithm, the clustering objective is to reduce the sum of communication distances between nodes within the same aggregate set. Each subset is then clustered to obtain multiple aggregate sets. Each aggregate set includes d subsets, where d is the data parallelism in the parameter configuration information of the target template.
[0035] From multiple aggregate sets, select the aggregate set with the smallest sum of communication distances between nodes within the aggregate set, and use it as the set of nodes selected from the cluster for deploying the training task.
[0036] A system for deploying training tasks, comprising:
[0037] The template selection module is used to select a target template corresponding to the model type from a preset template library after receiving a first instruction carrying a model type representing the training task.
[0038] The parameter configuration module is used to configure the parameters of the target template based on the received second instruction;
[0039] The resource configuration rule verification module is used to check whether the parameter configuration information of the target template conforms to the preset resource configuration rules for large models after the parameter configuration of the target template has been performed; if so, the clustering module is triggered.
[0040] The clustering module is used to: select a set of nodes from the cluster for deploying the training task based on the parameter configuration information of the target template and through a preset resource scheduling algorithm, so that the node resources in the set of nodes meet the requirements of the parameter configuration information of the target template, and the communication efficiency between the nodes in the set of nodes meets the preset communication efficiency requirements.
[0041] The deployment and execution module is used to deploy the training task in the selected set of nodes based on the parameter configuration information of the target template.
[0042] A deployment device for a training task, comprising:
[0043] Memory, used to store computer programs;
[0044] A processor for executing the computer program to implement the steps of the deployment method for the training task as described above.
[0045] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the deployment method for the training task as described above.
[0046] By applying the technical solution provided in this invention, for different training tasks, corresponding templates can be selected based on the different model types used. Specifically, after receiving a first instruction carrying the model type representing the training task, a target template corresponding to the model type can be selected from a preset template library. Since multiple template types are set in the preset template library to meet the needs of different model types, management efficiency is improved, and the convenience of training task deployment is also enhanced. After receiving a second instruction, the parameters of the target template can be configured. Furthermore, this application considers that compared to small models, large models have certain limitations in resource configuration. Therefore, after configuring the parameters of the target template, it checks whether the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, thus ensuring the reliability of the deployment of training tasks for large models. After detecting that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, the solution of this application takes into account that for the deployment of training tasks for small models, resource scheduling can be performed directly. However, for the deployment of training tasks for large models, it is necessary to ensure the communication efficiency between nodes. To this end, the solution of this application will select a set of nodes for deploying training tasks from the cluster based on the parameter configuration information of the target template through a preset resource scheduling algorithm. This ensures that the node resources in the node set meet the requirements of the parameter configuration information of the target template, and that the communication efficiency between nodes in the node set meets the preset communication efficiency requirements. In this way, after the training tasks are deployed in the selected node set, the execution efficiency of the training tasks can be effectively improved.
[0047] In summary, the solution proposed in this application can effectively deploy training tasks for large-scale model training tasks, ensuring the convenience and reliability of deployment, as well as the communication efficiency between the nodes used, thereby effectively improving the execution efficiency of training tasks. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 This is a flowchart illustrating the implementation of a training task deployment method according to the present invention.
[0050] Figure 2 This is a schematic diagram illustrating the parameter configuration of a target template on a UI page in a specific embodiment of the present invention;
[0051] Figure 3 This is a schematic diagram illustrating clustering in one specific embodiment of the present invention;
[0052] Figure 4 This is an architecture diagram for managing training tasks using large models in a specific context.
[0053] Figure 5 This is a schematic diagram of the structure of a training task deployment system according to the present invention;
[0054] Figure 6 This is a schematic diagram of the structure of a deployment device for a training task in this invention;
[0055] Figure 7 This is a schematic diagram of the structure of a computer-readable storage medium according to the present invention. Detailed Implementation
[0056] The core of this invention is to provide a method for deploying training tasks, which can effectively deploy training tasks for large models, ensuring the convenience and reliability of deployment, and ensuring the communication efficiency between the nodes used, thereby effectively improving the execution efficiency of training tasks.
[0057] To enable those skilled in the art to better understand the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0058] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating an implementation method for deploying a training task according to the present invention. The method for deploying a training task may include the following steps:
[0059] Step S101: After receiving the first instruction carrying the model type representing the training task, select the target template corresponding to the model type from the preset template library.
[0060] The solution of this application takes into account that different training tasks may use different model types. Different model types have different model frameworks, and the number and specific categories of parameters that need to be filled in may vary. Therefore, the solution of this application pre-sets a template library including multiple templates. Different templates in the template library correspond to different model types. Therefore, after receiving the first instruction carrying the model type representing the training task, the template corresponding to the model type can be selected from the pre-set template library, which is called the selected target template.
[0061] Please refer to Table 1 below, which is a structural diagram of the target template selected in a specific implementation. The target template specifically corresponds to the DeepSpeed type. Of course, in other cases, the model type representing the training task carried in the first instruction can be a type other than DeepSpeed, such as the Megatron type, etc.
[0062] Table 1:
[0063]
[0064]
[0065] The first column in Table 1 defines each row in the target template, the second column provides an explanation of the definition, and the third column provides examples of content that can be filled in the corresponding row.
[0066] Step S102: Configure the parameters of the target template based on the received second instruction.
[0067] After selecting the target template corresponding to the model type from the preset template library, the parameters of the target template can be configured based on the received second instruction. For practical application, please refer to [link / reference needed]. Figure 2 This allows the system to provide users with a UI page where they can interact with the user. Based on these interactions, the UI page can generate secondary commands and send them to the backend. The backend can then configure the parameters of the target template, filling in the relevant parameter information. Figure 2 The document shows user-configurable parameters such as the number of CPUs and GPUs. In other implementations, other parameters can be set according to actual needs. Figure 2 This is just an example.
[0068] Step S103: After configuring the parameters of the target template, check whether the parameter configuration information of the target template conforms to the preset resource configuration rules for large models. If so, proceed to step S104.
[0069] This application takes into account that, compared to small models, large models have certain limitations in resource configuration. Therefore, in order to effectively deploy the training task of large models, the solution in this application checks whether the parameter configuration information of the target template conforms to the preset resource configuration rules for large models after the parameter configuration of the target template is configured. Only if it conforms to the preset resource configuration rules for large models will the subsequent steps be executed; otherwise, the current training task deployment process can be paused or terminated.
[0070] The specific content of the preset resource allocation rules for large models can be set and selected according to actual needs, as long as it can effectively improve the deployment success rate of large model training tasks.
[0071] For example, in one specific embodiment of the present invention, considering the requirements of large models for accelerator card memory, step S103 may specifically include:
[0072] After configuring the parameters of the target template, based on the parameter configuration information of the target template, determine whether a×t×p≥b is true;
[0073] If a×t×p≥b holds true, then the parameter configuration information of the target template is determined to conform to the preset resource configuration rules for large models.
[0074] If a×t×p≥b is not true, it is determined that the parameter configuration information of the target template does not conform to the preset resource configuration rules for large models, and an alarm message indicating a model memory error is output.
[0075] Where 'a' represents the single accelerator card memory size in the parameter configuration information of the target template, 't' represents the tensor parallelism in the parameter configuration information of the target template, 'p' represents the pipeline parallelism in the parameter configuration information of the target template, and 'b' represents the training model size in the parameter configuration information of the target template, i.e., the size of the large model.
[0076] This implementation takes into account that when the training model is large, there are requirements for the single accelerator card memory size, tensor parallelism, and pipeline parallelism. Therefore, it verifies whether the single accelerator card memory size * tensor parallelism * pipeline parallelism is greater than or equal to the training model size. If it is true, it can be determined that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models. Otherwise, a large model memory OOM error will occur. Therefore, in this implementation, when a × t × p ≥ b is not true, it will be determined that the parameter configuration information of the target template does not conform to the preset resource configuration rules for large models, and an alarm message indicating a model memory error will be output.
[0077] Furthermore, in one specific embodiment of the present invention, after determining that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, the method may further include:
[0078] When it is detected that t≤c is not true, the first prompt message is output indicating that the tensor parallelism does not meet the requirements of high-speed data communication.
[0079] Where 'c' represents the number of single-machine accelerator cards in the parameter configuration information of the target template.
[0080] This implementation takes into account that if the parameter configuration information of the target template does not conform to the preset resource configuration rules for large models, it indicates that there is an obvious problem with the parameter configuration of the target template and the reliable deployment of the training task cannot be guaranteed. However, even if the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, there may still be room for optimization in the parameter configuration information.
[0081] In this implementation, the system checks whether the tensor parallelism is less than or equal to the number of single-machine accelerator cards based on the parameter configuration information of the target template. If it is true, it means that the configuration of these two parameters is reasonable. If it is not true, it means that the high-speed network of the local machine cannot meet the requirements of high-speed data communication in tensor parallelism. Therefore, the system outputs a first prompt message indicating that the tensor parallelism does not meet the requirements of high-speed data communication, so as to suggest that the user modify the parameter configuration in order to improve the deployment efficiency of the training task.
[0082] In one specific embodiment of the present invention, after determining that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, the method may further include:
[0083] When it is detected that p≤e is not true, a second prompt message is output indicating that the network in the cabinet does not meet the requirements of pipeline parallel data communication.
[0084] Where 'e' represents the number of nodes in a single rack in the parameter configuration information of the target template.
[0085] In this implementation, based on the parameter configuration information of the target template, it will detect whether the pipeline parallelism is less than or equal to the number of nodes in a single rack. If it is true, it means that the configuration of these two parameters is reasonable. If it is not true, it means that the network in the rack cannot meet the requirements of parallel data communication for the training pipeline of a large model. Therefore, a second prompt message indicating that the network in the rack does not meet the requirements of pipeline parallel data communication will be output to suggest that the user modify the parameter configuration in order to improve the deployment efficiency of the training task.
[0086] Step S104: Based on the parameter configuration information of the target template, a set of nodes for deploying training tasks is selected from the cluster through a preset resource scheduling algorithm, so that the node resources in the node set meet the requirements of the parameter configuration information of the target template, and the communication efficiency between nodes in the node set meets the preset communication efficiency requirements.
[0087] After detecting that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, this application takes into account the high requirements of large models for the communication efficiency between nodes. In order to improve the execution efficiency of training tasks, a set of nodes for deploying training tasks will be selected from the cluster through a preset resource scheduling algorithm. The specific rules of the resource scheduling algorithm can be set and adjusted according to actual needs. However, it is necessary not only to ensure that the node resources in the node set meet the requirements of the parameter configuration information of the target template, but also to ensure that the communication efficiency between nodes in the node set meets the preset communication efficiency requirements.
[0088] For example, in one specific embodiment of the present invention, the resource scheduling algorithm is a clustering algorithm, and correspondingly, step S104 may specifically include the following steps:
[0089] Step 1: Select the nodes in the cluster that are allowed to be deployed for training tasks, and remove the nodes whose number of idle accelerator cards is lower than the tensor parallelism t in the parameter configuration information of the target template. Then, take the set of the remaining nodes as the set of nodes to be clustered.
[0090] Step 2: Based on the clustering algorithm, with the goal of reducing the sum of communication distances between nodes in the same subset, the set of nodes to be clustered is divided into multiple subsets, and the number of nodes in each subset is equal to the pipeline parallelism p in the parameter configuration information of the target template.
[0091] Step 3: Based on the clustering algorithm, with the goal of reducing the sum of communication distances between nodes within the same aggregate set, cluster each subset to obtain multiple aggregate sets; where each aggregate set includes d subsets, and d is the data parallelism in the parameter configuration information of the target template;
[0092] Step 4: From multiple aggregate sets, select the aggregate set with the smallest sum of communication distances between nodes within the aggregate set, and use it as the set of nodes selected from the cluster for deploying training tasks.
[0093] This implementation takes into account that the communication efficiency between nodes can be reflected by the communication distance between nodes. That is, the smaller the communication distance between nodes, the lower the communication efficiency between nodes. Therefore, in this implementation, the set of nodes selected from the cluster for deploying training tasks is based on the communication distance between nodes.
[0094] Specifically, the first step is to select the nodes in the cluster that are allowed to deploy training tasks. The specific rules for whether a node is allowed to deploy training tasks can be set according to actual needs, and are usually determined based on the remaining resources of the node.
[0095] For example, in one scenario, n nodes are selected from the cluster that are allowed to be deployed for training tasks, and labeled as N1, N2, N3...Nn. Then, nodes with fewer idle accelerator cards than the tensor parallelism t need to be removed. The remaining nodes form the set of nodes to be clustered. In other words, for these n nodes, each node needs to be evaluated individually; if a node's number of idle accelerator cards is less than the tensor parallelism t, that node needs to be removed.
[0096] In this implementation, nodes are first eliminated based on tensor parallelism t. This is because tensor parallelism t, p, and d are the most important parameters and have the greatest impact on the execution efficiency of the training task. Therefore, before implementing nodes based on the communication distance between nodes, nodes with too few idle accelerator cards are eliminated.
[0097] After the removal, the set of remaining nodes is used as the set of nodes to be clustered, for example... Figure 3 In this case, there are a total of 12 remaining nodes, meaning that the set of nodes to be clustered includes 12 nodes.
[0098] Next, based on the clustering algorithm, the clustering objective is to reduce the sum of communication distances between nodes in the same subset. The set of nodes to be clustered is divided into multiple subsets, and the number of nodes in each subset is equal to the pipeline parallelism p in the parameter configuration information of the target template.
[0099] Clustering algorithms, for example, can use the KMeans clustering algorithm, for example... Figure 3 In this scenario, the pipeline parallelism p is specifically 3. Therefore, after clustering these 12 nodes in the set of nodes to be clustered using the KMeans clustering algorithm, the set of nodes to be clustered will be divided into 4 subsets. Figure 3 The four subsets are labeled Group1-A, Group1-B, Group1-C, and Group1-D, respectively. Each of these four subsets contains three nodes. However, for ease of viewing, the three nodes included in Group1-B and Group1-D are not shown.
[0100] When performing step two, based on the clustering algorithm, the clustering objective is to reduce the sum of communication distances between nodes in the same subset. In other words, the closer the communication distance between two nodes, the more likely they are to be assigned to the same subset. The principle of the clustering algorithm is to minimize the sum of communication distances between nodes in the same subset.
[0101] Furthermore, it should be noted that there are multiple ways to measure the communication distance between any two nodes. For example, a simple way is to determine the communication distance based on the communication bandwidth between the two nodes. For instance, a correspondence between communication bandwidth and communication distance can be set, and it needs to be set so that the larger the communication bandwidth, the smaller the communication distance.
[0102] After dividing the subsets, a clustering algorithm is needed again. This time, the clustering objective is to reduce the sum of communication distances between nodes in the same aggregate set. This will cluster the subsets and obtain multiple aggregate sets.
[0103] Still with Figure 3 For example, if the data parallelism d = 2, then after clustering, Figure 3 Each aggregate set in the dataset contains two subsets. Figure 3 The clustering of subsets yielded two aggregate sets, labeled Group2-A and Group2-B respectively. The clustering in step three follows the same principle as step two, but the difference lies in that the clustering objective is to reduce the sum of communication distances between nodes within the same aggregate set when performing clustering on each subset.
[0104] After obtaining multiple aggregate sets, the aggregate set with the smallest sum of communication distances between nodes within that aggregate set is the required node set.
[0105] The communication distance between nodes within an aggregate set refers to the sum of the pairwise communication distances between all nodes in that aggregate set. For example... Figure 3 In cases where the sum of communication distances between nodes in Group2-A is less than the sum of communication distances between nodes in Group2-B, then Group2-A will be selected from the cluster as the set of nodes for deploying training tasks.
[0106] It should also be noted that when using this implementation method, the set of nodes selected from the cluster for deploying training tasks is p×d. Therefore, when configuring the parameters of the target template, the number of nodes required for training is required to be equal to p×d. If the relevant parameters entered by the user do not meet this requirement, the UI page can provide a prompt.
[0107] Step S105: Based on the parameter configuration information of the target template, deploy the training task in the selected node set.
[0108] After selecting a set of nodes from the cluster to deploy training tasks, the training tasks can be deployed in the selected set of nodes based on the parameter configuration information of the target template.
[0109] In one specific embodiment of the present invention, step S105 may specifically include:
[0110] Based on the parameter configuration information of the target template, the environmental preparation information on which the target template depends is automatically determined;
[0111] Based on the environment preparation information, the system automatically deploys the environment in the selected node set and deploys the training task in the node set based on the parameter configuration information of the target template.
[0112] When deploying a training task, in addition to using the parameter configuration information of the target template, it is also necessary to configure the environment preparation information, as mentioned above. Figure 2 In the example, users can select the execution environment on the UI page, that is, select the environment preparation information on which the target template depends.
[0113] This implementation takes into account that the environmental preparation information on which the target template depends can be automatically determined based on the parameter configuration information of the target template. This eliminates the need for users to worry about the environmental preparation information on which the target template depends, as it is automatically managed by the platform's environment management module. This not only reduces the likelihood of errors and achieves unified management of environmental preparation information, but also improves the convenience for users to deploy training tasks.
[0114] In one specific embodiment of the present invention, it may further include:
[0115] Determine whether the number of nodes used in the parameter configuration information of the target template is higher than a preset first threshold;
[0116] If the number of nodes used is not higher than the first threshold, a third prompt message indicating that the number of nodes used is too low will be output, and it will be determined whether a deployment confirmation instruction has been received.
[0117] If no deployment confirmation instruction is received, the deployment process for the current training task will end.
[0118] This implementation takes into account that the solution of this application is mainly aimed at the deployment of training tasks using large models. If it is a small model, it is not necessary to adopt the solution of this application, because the small model has lower resource requirements, smaller size, and does not need to increase the complexity of small model deployment by selecting nodes through resource scheduling algorithms as described above.
[0119] Therefore, in this implementation, after configuring the parameters of the target template, it can be determined whether the number of nodes used in the parameter configuration information of the target template is higher than a preset first threshold. If it is not higher than the first threshold, it indicates that it is a small model, and a third prompt message indicating that the number of nodes used is too low can be output to remind the user to use the deployment method of the small model instead of the current deployment method of the large model. If a deployment confirmation instruction is received, it means that the user still wants to use the solution of this application for deployment, and this application also supports the deployment of the small model. If no deployment confirmation instruction is received from the user, the deployment process of the current training task can be terminated.
[0120] See also Figure 4 This is an architecture diagram for managing training tasks using large models in a specific scenario. Job creation represents the user's operation on the UI page, thus creating the training task. Scheduling management refers to the cluster resource scheduling during training task deployment based on the usage of CPU, accelerator cards, memory, and other resources of each node in the cluster. Environment management refers to the management of environment preparation information. Health management refers to the monitoring of the running status of each training task. For example, if a training task is stuck or a hardware failure is detected, the training status can be saved, the training task can be restarted, and historical status can be loaded to continue training. In the deployment and execution of training tasks, parameter configuration and resource scheduling are required. Parameter configuration, as described above, involves configuring the target template parameters, including parallelism parameters, model type, and some basic attribute parameters. Resource scheduling is also necessary.
[0121] By applying the technical solution provided in this invention, for different training tasks, corresponding templates can be selected based on the different model types used. Specifically, after receiving a first instruction carrying the model type representing the training task, a target template corresponding to the model type can be selected from a preset template library. Since multiple template types are set in the preset template library to meet the needs of different model types, management efficiency is improved, and the convenience of training task deployment is also enhanced. After receiving a second instruction, the parameters of the target template can be configured. Furthermore, this application considers that compared to small models, large models have certain limitations in resource configuration. Therefore, after configuring the parameters of the target template, it checks whether the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, thus ensuring the reliability of the deployment of training tasks for large models. After detecting that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, the solution of this application takes into account that for the deployment of training tasks for small models, resource scheduling can be performed directly. However, for the deployment of training tasks for large models, it is necessary to ensure the communication efficiency between nodes. To this end, the solution of this application will select a set of nodes for deploying training tasks from the cluster based on the parameter configuration information of the target template through a preset resource scheduling algorithm. This ensures that the node resources in the node set meet the requirements of the parameter configuration information of the target template, and that the communication efficiency between nodes in the node set meets the preset communication efficiency requirements. In this way, after the training tasks are deployed in the selected node set, the execution efficiency of the training tasks can be effectively improved.
[0122] In summary, the solution proposed in this application can effectively deploy training tasks for large-scale model training tasks, ensuring the convenience and reliability of deployment, as well as the communication efficiency between the nodes used, thereby effectively improving the execution efficiency of training tasks.
[0123] Corresponding to the above method embodiments, this invention also provides a training task deployment system, which can be referred to in conjunction with the above.
[0124] See Figure 5 The diagram shown is a structural schematic of a training task deployment system according to the present invention, comprising:
[0125] The template selection module 501 is used to select a target template corresponding to the model type from a preset template library after receiving a first instruction carrying a model type representing the training task.
[0126] The parameter configuration module 502 is used to configure the parameters of the target template based on the received second instruction;
[0127] The resource configuration rule verification module 503 is used to check whether the parameter configuration information of the target template conforms to the preset resource configuration rules for large models after the parameter configuration of the target template has been performed; if so, the clustering module 504 is triggered.
[0128] The clustering module 504 is used to: select a set of nodes for deploying training tasks from the cluster based on the parameter configuration information of the target template and through a preset resource scheduling algorithm, so that the node resources in the node set meet the requirements of the parameter configuration information of the target template, and the communication efficiency between nodes in the node set meets the preset communication efficiency requirements.
[0129] The deployment execution module 505 is used to deploy training tasks in the selected set of nodes based on the parameter configuration information of the target template.
[0130] In one specific embodiment of the present invention, the resource configuration rule verification module 503 includes:
[0131] The verification unit is used to determine whether a×t×p≥b is true based on the parameter configuration information of the target template after the parameter configuration of the target template has been performed.
[0132] If a×t×p≥b is true, the first result determination unit is triggered to determine whether the parameter configuration information of the target template conforms to the preset resource configuration rules for large models.
[0133] If a×t×p≥b is not true, the second result determination unit is triggered to determine that the parameter configuration information of the target template does not conform to the preset resource configuration rules for large models, and outputs an alarm message indicating a model memory error.
[0134] Where 'a' represents the single accelerator card memory size in the parameter configuration information of the target template, 't' represents the tensor parallelism in the parameter configuration information of the target template, 'p' represents the pipeline parallelism in the parameter configuration information of the target template, and 'b' represents the training model size in the parameter configuration information of the target template.
[0135] In one specific embodiment of the present invention, after the resource configuration rule verification module 503 determines that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, a first suggestion module is further included, used for:
[0136] When it is detected that t≤c is not true, the first prompt message is output indicating that the tensor parallelism does not meet the requirements of high-speed data communication.
[0137] Where 'c' represents the number of single-machine accelerator cards in the parameter configuration information of the target template.
[0138] In one specific embodiment of the present invention, after the resource configuration rule verification module 503 determines that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, a second suggestion module is further included, used for:
[0139] When it is detected that p≤e is not true, a second prompt message is output indicating that the network in the cabinet does not meet the requirements of pipeline parallel data communication.
[0140] Where 'e' represents the number of nodes in a single rack in the parameter configuration information of the target template.
[0141] In one specific embodiment of the present invention, the deployment execution module 505 includes:
[0142] The environment preparation information determination unit is used to automatically determine the environment preparation information on which the target template depends based on the parameter configuration information of the target template.
[0143] The deployment execution unit is used to automatically deploy the environment in the selected set of nodes based on the environment preparation information, and to deploy the training task in the set of nodes based on the parameter configuration information of the target template.
[0144] In one specific embodiment of the present invention, a third suggestion module is further included, for:
[0145] Determine whether the number of nodes used in the parameter configuration information of the target template is higher than a preset first threshold;
[0146] If the number of nodes used is not higher than the first threshold, a third prompt message indicating that the number of nodes used is too low will be output, and it will be determined whether a deployment confirmation instruction has been received.
[0147] If no deployment confirmation instruction is received, the deployment process for the current training task will end.
[0148] In one specific embodiment of the present invention, the resource scheduling algorithm is a clustering algorithm, and correspondingly, the clustering module 504 is specifically used for:
[0149] Select the nodes in the cluster that are allowed to be deployed for training tasks, and remove the nodes whose number of idle accelerator cards is lower than the tensor parallelism t in the parameter configuration information of the target template. Then, take the set of the remaining nodes as the set of nodes to be clustered.
[0150] Based on the clustering algorithm, the clustering objective is to reduce the sum of communication distances between nodes in the same subset. The set of nodes to be clustered is divided into multiple subsets, and the number of nodes in each subset is equal to the pipeline parallelism p in the parameter configuration information of the target template.
[0151] Based on a clustering algorithm, the clustering objective is to reduce the sum of communication distances between nodes within the same aggregate set. Each subset is clustered to obtain multiple aggregate sets. Each aggregate set includes d subsets, where d is the data parallelism in the parameter configuration information of the target template.
[0152] From multiple aggregate sets, select the aggregate set with the smallest sum of communication distances between nodes within the aggregate set, and use it as the set of nodes selected from the cluster for deploying training tasks.
[0153] Corresponding to the above methods and system embodiments, this invention also provides a deployment device for training tasks and a computer-readable storage medium, which can be referred to in conjunction with the above.
[0154] See Figure 6 The diagram shown is a structural schematic of a deployment device for a training task according to the present invention, comprising:
[0155] Memory 601 is used to store computer programs;
[0156] Processor 602 is configured to execute a computer program to implement the steps of a deployment method for a training task as described in any of the above embodiments.
[0157] See also Figure 7 The computer-readable storage medium 70 stores a computer program 71, which, when executed by a processor, implements the steps of the deployment method for the training task as described in any of the above embodiments. The computer-readable storage medium 70 referred to herein includes random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0158] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0159] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0160] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the technical solutions and core ideas of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the protection scope of the present invention.
Claims
1. A method for deploying a training task, characterized in that, include: After receiving a first instruction carrying a model type representing the training task, a target template corresponding to the model type is selected from a preset template library; Based on the received second instruction, the parameters of the target template are configured; After configuring the parameters of the target template, it is checked whether the parameter configuration information of the target template conforms to the preset resource configuration rules for large models; If so, based on the parameter configuration information of the target template, a set of nodes for deploying the training task is selected from the cluster through a preset resource scheduling algorithm, so that the node resources in the set of nodes meet the requirements of the parameter configuration information of the target template, and the communication efficiency between the nodes in the set of nodes meets the preset communication efficiency requirements. Based on the parameter configuration information of the target template, the training task is deployed in the selected set of nodes; After configuring the parameters of the target template, it is checked whether the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, including: After configuring the parameters of the target template, based on the parameter configuration information of the target template, it is determined whether a×t×p≥b holds true. If a×t×p≥b holds true, it is determined that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models. If a×t×p≥b does not hold true, it is determined that the parameter configuration information of the target template does not conform to the preset resource configuration rules for large models, and an alarm message indicating a model memory error is output. Here, a represents the single accelerator card memory size in the parameter configuration information of the target template, t represents the tensor parallelism in the parameter configuration information of the target template, p represents the pipeline parallelism in the parameter configuration information of the target template, and b represents the training model size in the parameter configuration information of the target template. After determining that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, the method further includes: when it is detected that t≤c is not true, outputting a first prompt message indicating that the tensor parallelism does not meet the requirements of high-speed data communication; where c represents the number of single-machine accelerator cards in the parameter configuration information of the target template. After determining that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, the method further includes: when it is detected that p≤e is not true, outputting a second prompt message indicating that the network in the rack does not meet the requirements of pipeline parallel data communication; where e represents the number of nodes in a single rack in the parameter configuration information of the target template. The resource scheduling algorithm is a clustering algorithm. Accordingly, based on the parameter configuration information of the target template, a set of nodes for deploying the training task is selected from the cluster using a preset resource scheduling algorithm. This ensures that the node resources in the node set meet the requirements of the parameter configuration information of the target template, and that the communication efficiency between nodes in the node set meets preset communication efficiency requirements. This includes: Select each node in the cluster that is allowed to deploy training tasks, and remove each node whose number of idle accelerator cards is lower than the tensor parallelism t in the parameter configuration information of the target template. Then, take the set of the remaining nodes as the set of nodes to be clustered. Based on the clustering algorithm, the clustering objective is to reduce the sum of communication distances between nodes in the same subset. The set of nodes to be clustered is divided into multiple subsets, and the number of nodes in each subset is equal to the pipeline parallelism p in the parameter configuration information of the target template. Based on the clustering algorithm, the clustering objective is to reduce the sum of communication distances between nodes within the same aggregate set. Each subset is then clustered to obtain multiple aggregate sets. Each aggregate set includes d subsets, where d is the data parallelism in the parameter configuration information of the target template. From multiple aggregate sets, select the aggregate set with the smallest sum of communication distances between nodes within the aggregate set, and use it as the set of nodes selected from the cluster for deploying the training task; Wherein, the number of nodes required for training in the parameter configuration information of the target template is equal to p×d; the sum of the communication distances between nodes in the aggregate set is the sum of the pairwise communication distances between all nodes in the aggregate set.
2. The method for deploying training tasks according to claim 1, characterized in that, Based on the parameter configuration information of the target template, the training task is deployed in the selected node set, including: Based on the parameter configuration information of the target template, the environmental preparation information on which the target template depends is automatically determined; Based on the environment preparation information, the environment is automatically deployed in the selected set of nodes, and the training task is deployed in the set of nodes based on the parameter configuration information of the target template.
3. The method for deploying training tasks according to claim 1, characterized in that, Also includes: Determine whether the number of nodes used in the parameter configuration information of the target template is higher than a preset first threshold; If the number of nodes used is not higher than the first threshold, a third prompt message indicating that the number of nodes used is too low will be output, and it will be determined whether a deployment confirmation instruction has been received. If the deployment confirmation instruction is not received, the deployment process for the current training task ends.
4. A system for deploying training tasks, characterized in that, include: The template selection module is used to select a target template corresponding to the model type from a preset template library after receiving a first instruction carrying a model type representing the training task. The parameter configuration module is used to configure the parameters of the target template based on the received second instruction; The resource configuration rule verification module is used to check whether the parameter configuration information of the target template conforms to the preset resource configuration rules for large models after the parameter configuration of the target template has been performed; if so, the clustering module is triggered. The clustering module is used to: select a set of nodes from the cluster for deploying the training task based on the parameter configuration information of the target template and through a preset resource scheduling algorithm, so that the node resources in the set of nodes meet the requirements of the parameter configuration information of the target template, and the communication efficiency between the nodes in the set of nodes meets the preset communication efficiency requirements. The deployment and execution module is used to deploy the training task in the selected set of nodes based on the parameter configuration information of the target template. The resource configuration rule verification module includes: a verification unit, used to determine whether a×t×p≥b holds true based on the parameter configuration information of the target template after the parameter configuration of the target template; if a×t×p≥b holds true, a first result determination unit is triggered to determine that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models; if a×t×p≥b does not hold true, a second result determination unit is triggered to determine that the parameter configuration information of the target template does not conform to the preset resource configuration rules for large models, and an alarm message indicating a model memory error is output; where a represents the single accelerator card memory size in the parameter configuration information of the target template, t represents the tensor parallelism in the parameter configuration information of the target template, p represents the pipeline parallelism in the parameter configuration information of the target template, and b represents the training model size in the parameter configuration information of the target template. After the resource configuration rule verification module determines that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, it also includes a first suggestion module, which is used to: when it is detected that t≤c is not true, output a first prompt message indicating that the tensor parallelism does not meet the requirements of high-speed data communication; where c represents the number of single-machine accelerator cards in the parameter configuration information of the target template. After the resource configuration rule verification module determines that the parameter configuration information of the target template conforms to the preset resource configuration rules for large models, it also includes a second suggestion module, which is used to: when it is detected that p≤e is not true, output a second prompt message indicating that the network in the rack does not meet the requirements of pipeline parallel data communication; where e represents the number of nodes in a single rack in the parameter configuration information of the target template. The resource scheduling algorithm is a clustering algorithm; correspondingly, the clustering module is specifically used for: Select the nodes in the cluster that are allowed to be deployed for training tasks, and remove the nodes whose number of idle accelerator cards is lower than the tensor parallelism t in the parameter configuration information of the target template. Then, take the set of the remaining nodes as the set of nodes to be clustered. Based on the clustering algorithm, the clustering objective is to reduce the sum of communication distances between nodes in the same subset. The set of nodes to be clustered is divided into multiple subsets, and the number of nodes in each subset is equal to the pipeline parallelism p in the parameter configuration information of the target template. Based on a clustering algorithm, the clustering objective is to reduce the sum of communication distances between nodes within the same aggregate set. Each subset is clustered to obtain multiple aggregate sets. Each aggregate set includes d subsets, where d is the data parallelism in the parameter configuration information of the target template. From multiple aggregate sets, select the aggregate set with the smallest sum of communication distances between nodes within the aggregate set, and use it as the set of nodes selected from the cluster for deploying training tasks; Wherein, the number of nodes required for training in the parameter configuration information of the target template is equal to p×d; the sum of the communication distances between nodes in the aggregate set is the sum of the pairwise communication distances between all nodes in the aggregate set.
5. A deployment device for a training task, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the deployment method for the training task as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the deployment method for the training task as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Distributed training method and device for deep learning model, equipment and storage medium
CN110969198A
Model training method, model prediction method, and model control system
CN112799850A
