A training method, device, equipment and storage medium for an artificial intelligence model
By managing node resources during AI model training and allocating nodes that meet needs to perform training tasks, the resource conflict problem is solved and the training efficiency and cluster throughput of the AI model are improved.
Patent Information
- Application Number
- CN202010588872.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-24
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-06-24
AI Technical Summary
Existing AI model training methods fail to effectively manage system resources, resulting in hardware resource conflicts such as CPU, memory, disk, IO, bandwidth, etc., affecting training efficiency.
By determining the resource demand information of the AI model to be trained, and allocating nodes that meet the demand as training nodes based on the resource idle information of each node, the training tasks are scheduled and executed to avoid resource conflicts.
It improves the training efficiency of the AI model, avoids resource conflicts, and optimizes the overall throughput of the cluster.
Smart Images

Figure CN111768006B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a training method, apparatus, device and storage medium for an artificial intelligence model. Background Art
[0002] With the rapid development of artificial intelligence (AI) and deep learning technology, it is particularly important to accelerate the implementation of AI solutions in actual application scenarios. In the implementation of AI solutions, the rapid training and deployment of AI models is a crucial step.
[0003] Therefore, in order to improve the training efficiency of AI models, it is necessary to meet the demand for system resources during model training. However, in the current AI model training methods, system resources are not effectively managed, which leads to conflicts in hardware resources such as CPU, memory, disk, IO, bandwidth, etc. when training different AI models, further affecting the training efficiency of AI models. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a training method, device, equipment and storage medium for an artificial intelligence model.
[0005] In a first aspect, the present disclosure provides a method for training an artificial intelligence model, the method comprising:
[0006] Determine the training task of the artificial intelligence AI model to be trained, and the resource requirement information corresponding to the training task;
[0007] Based on the current resource idle information of each node, a node that meets the resource demand information corresponding to the training task is allocated to the training task as a training node for the training task;
[0008] Schedule the training node to execute the training task to complete the training of the AI model to be trained.
[0009] In a second aspect, the present disclosure provides a training device for an artificial intelligence model, the device comprising:
[0010] A determination module, used to determine a training task corresponding to any artificial intelligence AI model; wherein the training task has corresponding resource requirement information;
[0011] An allocation module, configured to allocate nodes that can meet the resource demand information corresponding to the training task to the training task as training nodes for the training task based on the current resource idle information of each node;
[0012] A scheduling module is used to schedule the training nodes to execute the training tasks to complete the training of the AI model.
[0013] In a third aspect, the present disclosure provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a terminal device, the terminal device implements the method according to any one of claims 1 to 13.
[0014] In a fourth aspect, the present disclosure provides a device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 13 is implemented.
[0015] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0016] In the training method of the artificial intelligence model provided by the embodiment of the present disclosure, by effectively managing the resources of each node in the cluster, it is possible to allocate a node that meets its resource demand information for the training task of the AI model to be trained based on the current resource idle information of each node, and the training node is scheduled to execute the training task of the AI model to be trained to complete the training of the AI model. Since a node that can meet its training requirements has been allocated to the AI model before training, resource conflicts can be avoided during the training process of the AI model, thereby improving the training efficiency of the AI model. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 A flow chart of a training method for an artificial intelligence model provided in an embodiment of the present disclosure;
[0020] Figure 2 A flow chart of a training method for an artificial intelligence model provided in an embodiment of the present disclosure;
[0021] Figure 3 A flow chart of a training method for an artificial intelligence model provided in an embodiment of the present disclosure;
[0022] Figure 4 A schematic diagram of the structure of a training device for an artificial intelligence model provided in an embodiment of the present disclosure;
[0023] Figure 5 A schematic diagram of the structure of a training device for an artificial intelligence model provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0025] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0026] Since the training efficiency of artificial intelligence (AI) models affects the implementation efficiency of AI solutions in actual application scenarios, how to improve the training efficiency of AI models is an urgent problem that needs to be solved.
[0027] In the actual AI model training process, being able to provide sufficient system resource support is the basis for ensuring the efficiency of AI model training. However, there is currently no effective management of system resources, which leads to conflicts in hardware resources such as CPU, memory, disk, IO, and bandwidth when using the same node to train different AI models, affecting the training efficiency of AI models.
[0028] To this end, the present disclosure provides a training method for an artificial intelligence model, which can effectively manage the resources of the system, and can allocate nodes that meet the resource demand information for the training task of the AI model to be trained based on the current resource idle information of each node, as a training node, and complete the training of the AI model by scheduling the training node to execute the training task of the AI model to be trained. Because nodes that can meet its training needs have been allocated to the AI model before training it, resource conflicts can be avoided during the training process of the AI model, thereby improving the training efficiency of the AI model.
[0029] The following embodiment of the present disclosure provides a method for training an artificial intelligence model, referring to Figure 1 , is a flow chart of a training method for an artificial intelligence model provided in an embodiment of the present disclosure, the method comprising:
[0030] S101: Determine the training task of the artificial intelligence AI model to be trained, and the resource requirement information corresponding to the training task.
[0031] In the embodiments of the present disclosure, the AI model to be trained may be any AI model, including a neural network model, a support vector machine model, etc. from an algorithmic perspective, and an image recognition model, a natural language recognition model, etc. from a functional perspective. It is worth noting that the embodiments of the present disclosure do not limit the type of the AI model to be trained.
[0032] After determining the AI model to be trained, the task of training the AI model to be trained is determined as the training task in the embodiment of the present disclosure.
[0033] In addition, in order to ensure that sufficient system resource support can be provided for the training task, after determining the training task, the embodiment of the present disclosure also needs to determine the resource requirement information corresponding to the training task. Specifically, the resource requirement information corresponding to the training task may include information on hardware resources such as CPU, GPU, memory, disk, bandwidth, etc. required to complete the training task. For example, the resource requirement information corresponding to the training task can be in the form of the following Table 1:
[0034] CPU 8 cores GPU 1 card Memory 16G disk 120G
[0035] Table 1
[0036] S102: Based on the current resource idle information of each node, a node that meets the resource demand information corresponding to the training task is allocated to the training task as a training node for the training task.
[0037] In actual applications, each node may belong to a cluster, and the master node in the cluster may be used to obtain the current resource idle information of each node to manage the system resources of each node in the cluster.
[0038] In an optional implementation, after determining the resource demand information corresponding to the training task, the master node in the cluster can obtain the current resource idle information from each node by traversing the resource demand information so as to allocate training nodes for the training task. In addition, the master node in the cluster can also periodically obtain the current resource idle information of each node to understand the resource status of each node in real time and realize effective management of system resources.
[0039] In practical applications, before allocating training nodes to training tasks, the current resource idle information of each node is compared with the resource demand information corresponding to the training task to determine the node that can meet the resource demand information corresponding to the training task.
[0040] In actual applications, after determining the current resource idle information of each node, determine whether there is a node that meets the resource demand information corresponding to the training task. If there is a node that can meet the resource demand information corresponding to the training task, the training node of the training task can be determined from the nodes that can meet the resource demand information corresponding to the training task. The situation where there is no node that can meet the resource demand information corresponding to the training task will be introduced in subsequent embodiments.
[0041] In an optional implementation, a node can be randomly selected from nodes that can meet the resource requirement information corresponding to the training task as the training node of the training task. Since the selected node can meet the resource requirement information corresponding to the training task, the possibility of resource conflict during the execution of the training task is low.
[0042] In another optional implementation, the training node of the training task can be determined based on the difference information between the current resource idle information of the node that can meet the resource requirement information corresponding to the training task and the resource requirement information corresponding to the training task. The difference information may include the difference information of various types of resources. For example, Table 2 stores the current resource idle information of a node:
[0043] CPU 48 cores GPU 8 cards Memory 256G disk 2048G
[0044] Table 2
[0045] Referring to Table 1 and Table 2, the difference information between the current resource idle information of the node corresponding to Table 2 and the resource demand information corresponding to the training task in Table 1 can be determined, as shown in Table 3:
[0046] CPU 40 cores GPU 7 cards Memory 240G disk 1928G
[0047] Table 3
[0048] It can be understood that the difference information in Table 3 refers to the remaining resource situation of the execution node corresponding to the node corresponding to Table 2 as the execution node of the training task, that is, the resource idle information corresponding to the execution node running the training task.
[0049] In practical applications, the nodes used to determine whether the resource demand information corresponding to the training task can be met usually belong to the same cluster. The fewer the remaining resources of the execution node in the cluster, the higher the resource utilization of the execution node. Correspondingly, the more overall free resources of the cluster to which the execution node belongs, the more resources can be allocated to other training tasks, so that the cluster can process more training tasks, thereby improving the overall throughput of the cluster.
[0050] In order to facilitate the description of the difference information between the current resource idle information of the node and the resource demand information corresponding to the training task, the embodiment of the present disclosure determines the resource difference corresponding to each node based on the difference information between the current resource idle information of the node and the resource demand information corresponding to the training task, that is, the difference information corresponding to the node is described using the resource difference. Then, the embodiment of the present disclosure can determine the training node of the training task based on the resource difference corresponding to each node.
[0051] Specifically, the smaller the resource difference, the higher the probability that the node corresponding to the resource difference is determined as a training node. The smaller the resource difference, the more likely a node is determined as a training node for a training task, which means that the training node has fewer remaining resources, so that the cluster to which the training node belongs can process more training tasks, thereby improving the overall throughput of the cluster.
[0052] In a preferred implementation, the node with the smallest resource difference is determined as the training node for the training task, so that the cluster to which the training node belongs can process the largest number of training tasks, thereby maximizing the overall throughput of the cluster.
[0053] In an optional implementation method for determining the resource difference corresponding to a node, since the orders of magnitude of various resource types vary greatly, in order to balance the role of idle resource information of various resource types in determining the training nodes of training tasks, the embodiment of the present disclosure sets a magnitude coefficient for each resource type respectively.
[0054] Specifically, in the embodiment of the present disclosure, first, based on the order of magnitude corresponding to each resource type, a magnitude coefficient is set for each resource type; secondly, based on the magnitude coefficient corresponding to each resource type, and the difference information between the current resource idle information of the node and the resource demand information, the resource difference corresponding to each node is calculated.
[0055] For example, the CPU has a two-digit magnitude, the memory has a three-digit magnitude, and the GPU has a single-digit magnitude. The difference is obvious, so it is necessary to set magnitude coefficients for each to balance their respective roles in determining the training nodes of the training task.
[0056] In actual applications, after setting magnitude coefficients for each resource type, the resource differences corresponding to each node are calculated based on the magnitude coefficients corresponding to each resource type and the difference information between the current resource idle information of each node and the resource demand information.
[0057] In an optional implementation, the resource difference corresponding to each node may be calculated using the following formula (1), where formula (1) is as follows:
[0058] scorei=w1*(Ci-C)+w2*(Gi-G)+w3*(Mi-M);
[0059] Among them, scorei represents the resource difference corresponding to a node, Ci represents the number of remaining CPU cores of the node, Gi represents the number of remaining GPU cards of the node, Mi represents the remaining memory space of the node, C, G, and M represent the CPU, GPU, and memory requirements in the resource requirement information corresponding to the training task, respectively, and w1, w2, and w3 are the magnitude coefficients corresponding to the remaining CPU cores, the remaining GPU cards, and the remaining memory space, respectively.
[0060] It is worth noting that the resource types involved in calculating the resource differences corresponding to each node are specifically the resource types in the resource requirement information corresponding to the training task.
[0061] It can be understood that among the nodes that can meet the resource demand information corresponding to the training task, the node with the smaller resource difference, after being used as the execution node of the training task, the overall remaining resources of the cluster to which the node belongs are more, and the number of training tasks that the entire cluster can process is increased, thereby improving the cluster's throughput for training tasks.
[0062] Therefore, in the embodiment of the present disclosure, the node with the smallest resource difference can be determined as the training node of the training task to maximize the throughput of the cluster for the training task.
[0063] S103: Scheduling the training node to execute the training task to complete the training of the AI model to be trained.
[0064] In the disclosed embodiment, after a training node is assigned to a training task, the training node can be scheduled to execute the corresponding training task, thereby using the execution node to complete the training of the AI model to be trained.
[0065] In the training method of the artificial intelligence model provided by the embodiment of the present disclosure, by effectively managing the resources of each node in the cluster, it is possible to allocate a node that meets its resource demand information for the training task of the AI model to be trained based on the current resource idle information of each node, and the training node is scheduled to execute the training task of the AI model to be trained to complete the training of the AI model. Since a node that can meet its training requirements has been allocated to the AI model before training, resource conflicts can be avoided during the training process of the AI model, thereby improving the training efficiency of the AI model.
[0066] In one application scenario, if there is no node that can meet the resource requirement information corresponding to the training task, the node currently executing the training task can be preempted. Figure 2, is a flow chart of another AI model training method provided in an embodiment of the present disclosure, the AI model training method comprising:
[0067] S201: Determine the training task of the artificial intelligence AI model to be trained, and the resource requirement information corresponding to the training task.
[0068] S202: Based on the current resource idle information of each node, determine whether there is a node that meets the resource demand information corresponding to the training task. If yes, execute S203; if not, execute S204.
[0069] S203: If there is a node that meets the resource requirement information corresponding to the training task, determine the training node of the training task based on the difference information between the current resource idle information of the node and the resource requirement information.
[0070] S204: If there is no node that can meet the resource requirement information corresponding to the training task, determine the training node of the training task based on the relationship between the priority of the training task and the priority of the tasks currently being executed on each node.
[0071] In the disclosed embodiment, if there is no node that can meet the resource demand information corresponding to the training task, the node currently executing the training task on each node can be preempted based on the priority relationship between the training tasks as the training node of the training task. Specifically, each training task can be pre-set with a priority to indicate the importance of the training task, etc.
[0072] Specifically, determine whether the priority of the training task is higher than the priority of the tasks currently being executed on each node. If the priority of the training task is higher than the priority of at least one task currently being executed on each node, the training node of the training task can be determined based on the node corresponding to the at least one task.
[0073] Specifically, a node that can meet the resource demand information corresponding to the training task is randomly selected from the nodes corresponding to the tasks currently being executed on the nodes having a lower priority than the training task as the training node for the training task.
[0074] In an optional implementation, if the priority of the training task is higher than the priority of at least one task currently being executed on each node, that is, there is at least one task currently being executed on each node whose priority is lower than the priority of the training task, then a sorted list can be determined based on the relationship between the priorities of the at least one task to represent the priority relationship between the tasks being executed on each node whose priority is lower than that of the training task.
[0075] Specifically, the currently executed tasks with a lower priority than the training task may be sorted based on the order of priority from high to low or from low to high to obtain a sorted list. Then, based on the sorted list, the training node of the training task is determined from the nodes corresponding to the tasks in the sorted list.
[0076] In an optional implementation, the nodes corresponding to each task can be judged in order of priority from low to high in the sorted list to see whether they can meet the resource requirement information corresponding to the training task, until a node that can meet the resource requirement information corresponding to the training task is found and used as the execution node of the training task. If a node that can meet the resource requirement information corresponding to the training task is not found based on the sorted list, the training task can be set to a waiting state until a node that can meet the resource requirement information corresponding to the training task is found.
[0077] In actual applications, the resources occupied by each task in the sorted list can be released in sequence based on the order of priority from low to high, until a node that can meet the resource demand information corresponding to the training task is obtained as the execution node of the training task. It is worth noting that in order to ensure that the task whose resources are preempted can continue to be executed later, the embodiment of the present disclosure saves the running status data of the task before releasing the resources occupied by the task.
[0078] It is understandable that the level of priority can indicate the importance or execution urgency of the corresponding task. Therefore, the node corresponding to the task with a low priority is more likely to be preempted.
[0079] Since the training progress of tasks with the same priority but later task submission time is less, once the corresponding node is occupied, the task needs to save less training status data, etc. To this end, the embodiment of the present disclosure can sort the tasks in the sorting list based on priority and task submission time, and preferentially allocate the nodes corresponding to tasks with the same priority but later task submission time to the training task.
[0080] In one implementation, if the priority of a training task is not higher than the priority of a currently executing task, it means that there are no other currently executing tasks with a lower priority than the training task. Therefore, the disclosed embodiment can set the training task to a waiting state until there is a node that can meet the resource requirement information corresponding to the training task.
[0081] S205: Scheduling the training node to execute the training task to complete the training of the AI model to be trained.
[0082] S201 - S203 and S205 in the embodiments of the present disclosure can be understood with reference to the above embodiments and will not be described in detail here.
[0083] In the training method of the AI model provided in the embodiment of the present disclosure, the nodes of the tasks being executed can be preempted based on the priority relationship between the tasks, so as to ensure that the training tasks with high priority can be executed in time.
[0084] In order to avoid conflicts between different training tasks running on the same training node, the present disclosure provides a method for training an artificial intelligence model. Figure 3 , is a flow chart of another training method of an artificial intelligence model provided in an embodiment of the present disclosure. The training method of the artificial intelligence model includes:
[0085] S301: Generate a training image of the AI model based on the relevant training program and operating environment of the AI model to be trained.
[0086] In order to avoid conflicts such as operating environment when different training tasks are performed on the same training node and to enable the training tasks to be executed normally, the embodiment of the present disclosure mirrors the relevant training program and operating environment of the AI model to be trained to obtain a training mirror of the AI model to be trained.
[0087] In an optional implementation, the training image may be generated based on Docker technology.
[0088] S302: Determine a training task for an artificial intelligence AI model to be trained, and resource requirement information corresponding to the training task;
[0089] S303: Based on the current resource idle information of each node, a node that meets the resource demand information corresponding to the training task is allocated to the training task as a training node for the training task;
[0090] S304: Running the training image of the AI model to be trained on the training node to execute the training task, thereby completing the training of the AI model to be trained.
[0091] In the disclosed embodiment, after determining the training node of the training task, the training image of the AI to be trained corresponding to the training task is run on the training node to execute the training task and complete the training of the AI model.
[0092] In an optional implementation, in order to conveniently implement basic operations such as adding, deleting, modifying, and checking each training task, the disclosed embodiment can use Pod to run the training image of each training task.
[0093] Specifically, Pod is the smallest deployable computing unit in a Kubernetes cluster. By managing the lifecycle of Pod, operations such as adding, deleting, modifying, and checking corresponding training tasks can be easily implemented.
[0094] In actual application, first, a corresponding Pod is created for the training task on the training node of the training task. Then, the training image of the AI model to be trained corresponding to the training task is run using the Pod to execute the training task, thereby completing the training of the AI model to be trained.
[0095] In addition, each Pod in the embodiment of the present disclosure has an independent virtual IP address. Compared with the situation where various training tasks running on the same node share the same node IP address, the embodiment of the present disclosure can avoid congestion pressure on network bandwidth and disk IO.
[0096] In addition, in the embodiment of the present disclosure, when executing a training task, the execution node may generate a training log to record the execution of the training task. The user may download the training log from the execution node to understand the execution process of the training task, so as to facilitate subsequent optimization of related training programs, etc.
[0097] In the AI model training method provided in the embodiment of the present disclosure, the training image of the AI model to be trained is generated by using mirror technology, which can avoid conflicts such as the operating environment of different training tasks on the same training node.
[0098] In addition, using Pod to run the training image corresponding to the training task makes it easier to add, delete, modify, and query the training task.
[0099] Corresponding to the above method embodiment, the present disclosure embodiment also provides a training device for an artificial intelligence model, referring to Figure 4 , is a schematic diagram of the structure of a training device for an artificial intelligence model provided in an embodiment of the present disclosure. Specifically, the training device for the artificial intelligence model includes:
[0100] Determination module 401, used to determine the training task corresponding to any artificial intelligence AI model; wherein the training task has corresponding resource requirement information;
[0101] An allocation module 402 is used to allocate nodes that can meet the resource demand information corresponding to the training task to the training task as training nodes for the training task based on the current resource idle information of each node;
[0102] The scheduling module 403 is used to schedule the training node to execute the training task to complete the training of the AI model.
[0103] In an optional implementation manner, in order to avoid conflicts such as running environments of different training tasks on the same training node, the device further includes:
[0104] A generation module, used to generate a training image of the AI model to be trained based on the relevant training program and operating environment of the AI model to be trained;
[0105] Accordingly, the scheduling module is specifically used for:
[0106] The training image of the AI model to be trained is run on the training node to execute the training task, thereby completing the training of the AI model to be trained.
[0107] In an optional implementation manner, the scheduling module specifically includes:
[0108] A submodule is created, which is used to create a corresponding Pod for the training task on the training node; wherein the Pod has an independent virtual IP address;
[0109] The running submodule is used to use the Pod to run the training image of the AI model to be trained to perform the training task, thereby completing the training of the AI model to be trained.
[0110] In an optional implementation, the allocation module includes:
[0111] A first determination submodule is used to determine whether there is a node that meets the resource demand information corresponding to the training task based on the current resource idle information of each node;
[0112] The second determination submodule is used to determine the training node of the training task based on the difference information between the current resource idle information of the node and the resource demand information when there is a node that meets the resource demand information corresponding to the training task.
[0113] Specifically, the second determination submodule includes:
[0114] A third determination submodule is used to determine the resource difference corresponding to each node based on the difference information between the current resource idle information of the node and the resource demand information;
[0115] The fourth determination submodule is used to determine the training node of the training task based on the resource difference; wherein, the smaller the resource difference is, the higher the probability that the node corresponding to the resource difference is determined as the training node.
[0116] Specifically, the third determination submodule includes:
[0117] A first setting submodule is used to set a magnitude coefficient for each resource type based on the magnitude corresponding to each resource type;
[0118] The calculation submodule is used to calculate the resource difference corresponding to each node based on the magnitude coefficient corresponding to each resource type and the difference information between the current resource idle information of the node and the resource demand information.
[0119] The fourth determination submodule is specifically used for:
[0120] The node with the smallest resource difference is determined as the training node for the training task.
[0121] In an optional implementation, the device further includes:
[0122] The fifth determination submodule is used to determine the training node of the training task based on the relationship between the priority of the training task and the priority of the task currently being executed when there is no node that meets the resource requirement information corresponding to the training task.
[0123] The fifth determination submodule includes:
[0124] A second setting submodule is used to set the training task to a waiting state when the priority of the training task is not higher than the priority of the task currently being executed, until there is a node that can meet the resource demand information corresponding to the training task;
[0125] The sixth determination submodule is used to determine the training node of the training task based on the node corresponding to the at least one task when the priority of the training task is higher than the priority of at least one task currently being executed.
[0126] The sixth determination submodule includes:
[0127] a seventh determination submodule, configured to determine a ranked list of the at least one task based on the priority of the at least one task;
[0128] An eighth determination submodule is used to determine, based on the sorted list, a training node for the training task from the nodes corresponding to the at least one task.
[0129] The seventh determination submodule is specifically used for:
[0130] Based on the priority of the at least one task and the task submission time, a ranked list of the at least one task is determined.
[0131] The eighth determination submodule includes:
[0132] A release submodule, used to release the resources occupied by each task in the at least one task in turn based on the sorted list until a node that can meet the resource demand information corresponding to the training task is obtained;
[0133] A ninth determination submodule is used to determine the node as a training node for the training task.
[0134] In an optional implementation, the device further includes:
[0135] The saving submodule is used to save the running status data of the task.
[0136] In the training device of the artificial intelligence model provided by the embodiment of the present disclosure, by effectively managing the resources of each node in the cluster, it is possible to allocate a node that meets its resource demand information for the training task of the AI model to be trained based on the current resource idle information of each node, and the training node is scheduled to execute the training task of the AI model to be trained to complete the training of the AI model. Since a node that can meet its training needs has been allocated to the AI model before training, resource conflicts can be avoided during the training process of the AI model, thereby improving the training efficiency of the AI model.
[0137] In addition, the present disclosure also provides a training device for an artificial intelligence model, see Figure 5 As shown, this may include:
[0138] Processor 501, memory 502, input device 503 and output device 504. The number of processors 501 in the training device of the artificial intelligence model can be one or more. Figure 5 In some embodiments of the present invention, the processor 501, the memory 502, the input device 503 and the output device 504 may be connected via a bus or other means, wherein: Figure 5 The example of connecting through bus is taken in the following.
[0139] The memory 502 can be used to store software programs and modules, and the processor 501 executes various functional applications and data processing of the training device of the artificial intelligence model by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application required for a function, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The input device 503 can be used to receive input digital or character information, and to generate signal input related to user settings and function control of the training device of the artificial intelligence model.
[0140] Specifically in this embodiment, the processor 501 will load the executable files corresponding to the processes of one or more applications into the memory 502 according to the following instructions, and the processor 501 will run the applications stored in the memory 502, thereby realizing the various functions of the above-mentioned artificial intelligence model training device.
[0141] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps described in the above-mentioned "Exemplary Method" section of this specification according to various embodiments of the present disclosure.
[0142] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0143] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enables the processor to execute the steps described in the above “Exemplary Method” section of this specification according to various embodiments of the present disclosure.
[0144] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0145] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0146] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A training method for an artificial intelligence model, It is characterized in that The method comprises: Determine the training task of the artificial intelligence model to be trained, and the resource requirement information corresponding to the training task; Based on the current resource idle information of each node, a node that meets the resource demand information corresponding to the training task is allocated to the training task as a training node for the training task; Scheduling the training node to execute the training task to complete the training of the artificial intelligence model to be trained; The allocating, based on the current resource idle information of each node, a node that can meet the resource demand information corresponding to the training task as a training node for the training task, includes: Based on the current resource idle information of each node, determine whether there is a node that meets the resource demand information corresponding to the training task; If there is a node that meets the resource requirement information corresponding to the training task, determining the training node of the training task based on the difference information between the current resource idle information of the node and the resource requirement information; The determining the training node of the training task based on the difference information between the current resource idle information of the node and the resource demand information includes: Determine the resource difference corresponding to each node based on the difference information between the current resource idle information of the node and the resource demand information; Based on the resource difference, determining the training node of the training task; wherein, the smaller the resource difference, the higher the probability that the node corresponding to the resource difference is determined as the training node; The determining the resource difference corresponding to each node based on the difference information between the current resource idle information of the node and the resource demand information includes: Based on the order of magnitude corresponding to each resource type, set the magnitude coefficient for each resource type; Based on the magnitude coefficient corresponding to each resource type and the difference information between the current resource idle information of the node and the resource demand information, the resource difference corresponding to each node is calculated.
2. The training method of the artificial intelligence model according to claim 1, It is characterized in that Before scheduling the training node to execute the training task to complete the training of the artificial intelligence model to be trained, the method further includes: Generate a training image of the artificial intelligence model to be trained based on the relevant training program and operating environment of the artificial intelligence model to be trained; The scheduling of the training node to execute the training task to complete the training of the artificial intelligence model to be trained includes: Run the training image of the artificial intelligence model to be trained on the training node to execute the training task and complete the training of the artificial intelligence model to be trained.
3. The training method of the artificial intelligence model according to claim 2, It is characterized in that The step of running the training image of the artificial intelligence model to be trained on the training node to perform the training task, thereby completing the training of the artificial intelligence model to be trained, includes: Creating a corresponding Pod for the training task on the training node; wherein the Pod has an independent virtual IP address; The Pod is used to run the training image of the artificial intelligence model to be trained to execute the training task and complete the training of the artificial intelligence model to be trained.
4. The training method of the artificial intelligence model according to claim 1, It is characterized in that The determining the training node of the training task based on the resource difference includes: The node with the smallest resource difference is determined as the training node for the training task.
5. The training method of the artificial intelligence model according to claim 1, It is characterized in that The determining whether there is a node that meets the resource requirement information corresponding to the training task based on the current resource idle information of each node includes: Based on the resource demand information corresponding to the training task, the current resource idle information of each node is traversed to determine whether there is a node that meets the resource demand information corresponding to the training task.
6. The training method of the artificial intelligence model according to claim 1, It is characterized in that The method further comprises: If there is no node that can meet the resource requirement information corresponding to the training task, the training node of the training task is determined based on the relationship between the priority of the training task and the priority of the tasks currently being executed on each node.
7. The training method of the artificial intelligence model according to claim 6, It is characterized in that The determining of the training node of the training task based on the relationship between the priority of the training task and the priority of the task currently being executed includes: If the priority of the training task is not higher than the priority of the currently executed task, the training task is set to a waiting state until there is a node that can meet the resource requirement information corresponding to the training task; If the priority of the training task is higher than the priority of at least one task currently being executed, a training node of the training task is determined based on the node corresponding to the at least one task.
8. The training method of the artificial intelligence model according to claim 7, It is characterized in that The determining, based on the node corresponding to the at least one task, a training node of the training task includes: determining a ranked list of the at least one task based on a priority of the at least one task; Based on the sorted list, a training node for the training task is determined from the nodes corresponding to the at least one task.
9. The training method of the artificial intelligence model according to claim 8, It is characterized in that The determining, based on the priority of the at least one task, a ranked list of the at least one task comprises: Based on the priority of the at least one task and the task submission time, a ranked list of the at least one task is determined.
10. The training method of the artificial intelligence model according to claim 8, It is characterized in that The determining, based on the sorted list, a training node of the training task from the nodes corresponding to the at least one task comprises: Based on the sorted list, releasing the resources occupied by each task in the at least one task in turn until a node that can meet the resource requirement information corresponding to the training task is obtained; The node is determined as a training node for the training task.
11. The training method of the artificial intelligence model according to claim 10, It is characterized in that Before releasing the resources occupied by each task in the at least one task, the method further includes: The running status data of the task is saved.
12. A training device for an artificial intelligence model, It is characterized in that The device comprises: A determination module, used to determine a training task corresponding to any artificial intelligence model; wherein the training task has corresponding resource requirement information; An allocation module, configured to allocate nodes that can meet the resource demand information corresponding to the training task to the training task as training nodes for the training task based on the current resource idle information of each node; A scheduling module, used to schedule the training nodes to execute the training tasks to complete the training of the artificial intelligence model; The allocation module comprises: A first determination submodule is used to determine whether there is a node that meets the resource demand information corresponding to the training task based on the current resource idle information of each node; A second determination submodule is used to determine the training node of the training task based on the difference information between the current resource idle information of the node and the resource demand information when there is a node that meets the resource demand information corresponding to the training task; The second determining submodule includes: A third determination submodule is used to determine the resource difference corresponding to each node based on the difference information between the current resource idle information of the node and the resource demand information; A fourth determination submodule is used to determine the training node of the training task based on the resource difference; wherein, the smaller the resource difference is, the higher the probability that the node corresponding to the resource difference is determined as the training node; The third determining submodule includes: A first setting submodule is used to set a magnitude coefficient for each resource type based on the magnitude corresponding to each resource type; The calculation submodule is used to calculate the resource difference corresponding to each node based on the magnitude coefficient corresponding to each resource type and the difference information between the current resource idle information of the node and the resource demand information.
13. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the method according to any one of claims 1 to 11.
14. A device, It is characterized in that include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
A method and an apparatus for creating containers for in-depth learning jobs
CN108958892A
Cluster resource scheduling method, device and equipment and computer readable storage medium
CN109634748A
Resource scheduling method and device
CN110688218A
GPU resource using method and device and storage medium
CN110888743A
Efficient neural network training scheduling method based on heterogeneous distributed system
CN111079921A
