Cluster training node allocation method and electronic device
By dynamically adjusting node allocation and prioritizing ordering according to historical operating status, the problem of improper resource allocation in the existing technology is solved, resource utilization and user experience are improved, and the error rate of task training is reduced.
Patent Information
- Application Number
- CN202110185105.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-10
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-02-10
AI Technical Summary
In the existing technology, the allocation of node computers is one-way and static, making it difficult to achieve dynamic optimization of computing resources, resulting in improper resource allocation, overloading, frequent error reports, and poor user experience.
By setting training allocation parameters, the available node set is obtained, prioritized according to preset rules, and dynamically adjusted node allocation to ensure that nodes that have historically performed well are allocated first, achieving dynamic optimization of resources.
The node allocation method is optimized, reducing the overall error rate and failure rate of task training, and improving resource utilization and user experience.
Smart Images

Figure CN112925640B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of node allocation, and in particular to a cluster training node allocation method and electronic equipment. Background Art
[0002] With the development of AI technology, many complex AI program models need to be trained on computing clusters. Since multiple users use cluster node resources at the same time, during the training process, for a single or multi-machine training task, the resources of the node computers need to be allocated.
[0003] In the prior art, the allocation of node computers is unidirectional and static. Either the user directly selects the training group training node computer, or the system directly allocates it according to the remaining node resources. And unless the user actively disables a node with a high number of errors, the node allocation is generally not adjusted according to the operating status. This unidirectional and static allocation method makes it difficult to achieve dynamic optimization of computing resource allocation and allow resources in good condition to be fully returned and utilized. This can easily lead to improper resource allocation, resource overload, high number of errors, and poor user experience. Summary of the invention
[0004] In order to overcome the above-mentioned deficiencies, the present invention aims to provide a cluster training node allocation method and electronic device to dynamically adjust node allocation, optimize resource configuration, and improve user experience.
[0005] The present invention achieves the above-mentioned purpose through the following scheme: A cluster training node allocation method comprises the following steps:
[0006] (1) Setting training allocation parameters and submitting cluster training tasks; the training allocation parameters include group name, requested node number, and also designated node number;
[0007] (2) Obtain the available node set M, obtain the list of all grouping information and the node list corresponding to the selected request group name, and obtain the request node set Y;
[0008] (3) Obtain the pre-allocated available node set Z, and take the intersection of the available node set M and the requested node set Y to obtain the pre-allocated available node set Z = M∩Y;
[0009] (4) Check whether the number of nodes in the pre-allocated available node set Z meets the number of requested nodes. If not, return to step (1); if yes, establish an allocation execution node set with a capacity equal to the number of requested nodes;
[0010] (5) Put the specified node into the assigned execution node set;
[0011] (6) The nodes in the pre-allocated available node set Z are prioritized according to a preset rule and are sequentially placed in the allocation execution node set until the allocation execution node set is full;
[0012] (7) Lock the nodes in the assigned execution node set, distribute the training tasks to the assigned execution nodes, start task training, and monitor the node operation status during the training process.
[0013] Preferably, the step (1) further comprises selecting a training environment component option, wherein the training environment component option comprises: an image file name, startup parameters, external environment variables, configuration parameters and a configuration file name, wherein the configuration parameters comprise system resource allocation parameters.
[0014] Preferably, the set of available nodes is the nodes in all cluster nodes that are in normal operation, not locked, not disabled, and not executing tasks;
[0015] Preferably, after selecting the node list corresponding to the request group name, it is necessary to check whether the group name and the list node number are legal.
[0016] Preferably, the preset rule is: the running status score corresponding to each node is sorted from high to low priority.
[0017] Preferably, the method for obtaining the running status score is as follows: in the initial stage, each node is assigned an initial running status score, and during the training operation, the error information of each node is collected, and each time an error message is received, the node is deducted one point.
[0018] Preferably, the locked state node in step (7) will be released when one of the following conditions is met: 1. Task distribution is completed and the training task starts running; 2. It is released after a 5-minute timeout.
[0019] An electronic device comprises: a storage module, a processor, a communication bus, and an interface; the storage module comprises a memory and a non-volatile memory, and the interface comprises a network interface and other peripheral interfaces; the storage module, the processor, the network interface, and other peripheral interfaces are connected via the communication bus.
[0020] The beneficial effects of the present invention are as follows: the priority of assigning nodes to the same group is adjusted according to the feedback of historical operation status; the historical operation status of the node will affect the priority sorting of the node when a new task is assigned, and the node allocation method is optimized, which can not only meet the needs of user-specified groups and nodes, but also realize a more dynamic, efficient and flexible configuration of other node computers, so that the equipment resources in good operating status can be fully utilized, thus optimizing the resource allocation as a whole and reducing the overall error rate and failure rate of task training. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic flow diagram of the method of the present invention;
[0022] Figure 2 is a schematic diagram of an electronic device for implementing the method of the present invention. DETAILED DESCRIPTION
[0023] The present invention is further described below in conjunction with specific implementation examples, but the protection scope of the present invention is not limited thereto:
[0024] Example: Figure 1 As shown, a cluster training allocation method comprises the following steps:
[0025] (101) Setting training allocation parameters and submitting cluster training tasks; the training allocation parameters include a group name, a requested number of nodes n, and may also include a specified node number.
[0026] The training task can be a machine learning algorithm model training program, such as a neural network model training program, or other deep learning model training programs. Users develop and debug training tasks through the client development module to ensure that the training tasks can be initially run. After the development is completed, the training tasks can be uploaded to the cluster training task queue and wait for task assignment.
[0027] The cluster in this embodiment includes multiple nodes, which refer to computer servers, including one or more GPUs. Most of the operations involved in deep learning are vectorized matrix operations. GPU can realize large-scale parallel computing, so GPU is usually used to run training tasks in practice. The GPU is used to receive and distribute training task messages, load the corresponding algorithm model into the GPU memory according to the training task message, and execute the training task.
[0028] Nodes are pre-grouped according to different computing power. Nodes with the same number and type of GPU graphics cards are grouped into the same group to ensure that the computing power of the same group of nodes is basically the same. Each group has its own group name. Each group of nodes will specify a master node during initialization to schedule queue task information during task distribution and distribute tasks of this group to other ordinary nodes in the group. After the task distribution is completed, the master node and ordinary nodes complete the task execution training together.
[0029] A node group can be composed of a front-end router connected to multiple tree-structured nodes. The training task is received by the router front-end port and transmitted to the group node. The router implements service scheduling operations through a certain load balancing mechanism, such as polling mechanism and LRU scheduling mechanism, which can meet high concurrent computing requirements.
[0030] (102) Obtain the available node set M, obtain the list of all grouping information and the list of nodes corresponding to the requested group name.
[0031] The available node set M is the nodes in all cluster nodes that are in normal operation, not locked, not disabled, and not executing tasks. Among all cluster nodes, some nodes can be manually disabled, and some nodes are executing tasks. There will be a certain delay from determining the allocation of execution nodes to the completion of the training task and the start of the operation. During this delay, the allocation of execution nodes will be locked.
[0032] (103) Check whether the names of all group information lists and node lists corresponding to the requested group names are legal. If not, return to step (101).
[0033] Nodes are pre-grouped by computing power. To obtain the grouped node list information, you also need to check whether the names of each group are legal, and whether the requested group name in the training allocation parameter is legal and the group is not disabled. When the API accesses the training task, sometimes the input group name is illegal. Illegal group names will cause acquisition failure.
[0034] In an embodiment, if the group name is legal, a node list is obtained according to the requested group name. If there is an illegal naming situation, an error is reported and the training allocation parameter submission interface is returned.
[0035] Get the node list corresponding to the selected request group name, and check whether the node number in the list is legal. If it is legal, proceed to step (104). If it is illegal, prompt illegal naming and return to the page for submitting training allocation parameters.
[0036] In an embodiment, it is necessary to obtain the training allocation parameters submitted together with the cluster training task, including the request group name, the request node number n, and the specified node number. According to the request group name and all grouping information lists, the node list corresponding to the selected group name is obtained to obtain the request node set Y. After obtaining the request node set Y, check whether the node list number of Y is legal.
[0037] If the node list number of the requested node set Y is legal, the pre-allocated available node set is obtained. If there is an illegal node number, an error is reported and the training allocation parameter submission interface is returned.
[0038] If the group name is illegal and the node list number is illegal, the node computer cannot be called correctly, and the user is prompted that there is an illegal naming situation, and returns to the submission training allocation parameter interface.
[0039] (104) Obtain a pre-allocated available node set Z, and take the intersection of the available node set M and the requested node set Y to obtain a pre-allocated available node set Z = M∩Y.
[0040] (105) Check whether the number of nodes in the pre-allocated available node set Z meets the requested node number n. If not, return to step (101); if yes, establish an allocation execution node set with a capacity equal to the requested node number n.
[0041] For the requested number of nodes n, pre-allocate the available node set Z, and check whether the number of elements in the pre-allocated available node set Z is less than or equal to the requested number of nodes n, that is, n≤card(Z). If the pre-allocated available node set Z meets the requested number of nodes n, then establish an allocation execution node set with an element capacity of n, and the nodes in the set are empty; if the number of pre-allocated available node set Z is insufficient and does not meet the requested number of nodes n, then it will prompt that the number of available nodes is insufficient, and return to the submit training allocation parameter interface, and need to resubmit the training allocation parameters.
[0042] (106) Putting the designated node into the allocation execution node set: According to the designated node number, obtaining the designated node set X. When the training allocation parameter is selected, the designated node number is selected, and when the node is allocated, the designated node is preferentially put into the allocation execution node set.
[0043] When selecting the training allocation parameters, the specified node number may not be selected, the specified node set X is empty, and the allocation execution node set remains an empty set.
[0044] (107) The nodes in the pre-allocated available node set Z are prioritized according to a preset rule and are sequentially placed in the allocation execution node set until the allocation execution node set is full.
[0045] Specifically, the nodes are prioritized from high to low according to the historical operating status scores. Each node corresponds to an operating status score according to the historical operating status. In the initial stage, each node is assigned an initial operating status score and stored in a storage structure, which can be a redis database. During the operation of the training task, the error information of each node is collected, and the node is deducted one point for each error message received. After multiple runs, each node has an operating status score related to the historical operating status, and this counting process is completed by the monitoring module. In this way, the historical operating status of the node computer server will affect the priority sorting of the nodes when new tasks are assigned, ensuring that machines with fewer errors can be assigned first, optimizing resource allocation as a whole, and reducing the overall error rate of task training. Then, the nodes in the pre-allocated available node set are placed in the allocation execution node set according to the priority order until the allocation execution node set capacity is full.
[0046] (108) Lock the nodes in the assigned execution node set, distribute the training tasks to the assigned execution nodes, start task training, and monitor the node operation status during the training process.
[0047] Among all the nodes in the cluster training, there will be a certain delay from determining the assigned execution node to the training task starting to run the training task. Therefore, in order to prevent repeated allocation caused by different task training requests, the nodes in the assigned execution node set will be locked.
[0048] In an embodiment, the locked state node will be released when one of the following conditions is met: 1. Task distribution is completed and the training task starts to run; 2. It is released after a 5-minute timeout.
[0049] Furthermore, in order to ensure that the training environment of each node is the same, the training environment component is deployed on the distribution execution node before the training task is distributed. When setting the training distribution parameters, the training environment component option must also be selected. The training environment component deployment is achieved by creating a training environment container. Each computer server is a node in the machine training cluster, and the Docker technology is used to achieve unified management of the node environment and overall planning of resources. An image file of the training environment container is established, including an operating system, an underlying driver, a training basic framework, etc. Multiple training environment component options are created in advance, and each training environment component option includes a pre-configured packaged image file name, startup parameters, external environment variables, configuration parameters, and a configuration file name. The configuration parameters are system resource allocation parameters, such as memory allocation, CPU occupancy, user name and password, etc. According to the underlying driver image file name, startup parameters, external environment variables, configuration parameters, and configuration file name in the training environment component option, a configuration function file is automatically generated, and the configuration function starts the corresponding driver, configures the corresponding parameters, and loads the corresponding training framework in turn to complete the node environment deployment. After the user has completed the development of the training task, the user needs to select the training environment component option when publishing the training task on the client to complete the deployment of the training environment component on the distribution execution node.
[0050] The training task distribution adopts synchronous distribution, loading the training task to each assigned execution node, and executing the same training task on each node. The training environment component deployment is completed by establishing a mirror synchronization through the container tool to ensure that the training environment on each node is the same. The nodes that have completed the environment deployment can communicate data based on the communication between containers to achieve multi-machine parallel training.
[0051] The monitoring module monitors the running status of the nodes during the running of the training task, including cluster status monitoring, training task management, and training process control. Specifically, the node running data can be obtained in real time by relying on the container component. Cluster status monitoring includes real-time collection and display of the configuration and running status of each node, GPU, CPU, memory space and resource occupancy curve, and unified management and monitoring of node resources. Training task management includes summary display of grouping status, real-time collection of sequence task logs for each training batch, monitoring and management of task allocation training process, task completion status, and display of summary indicators and detailed lists. Training task process control includes control of the training process, including overall task start, pause, stop, result viewing, node retrieval, single node disabling, etc.
[0052] Figure 2 An electronic device includes: a storage module, a processor, a communication bus, and an interface; the storage module includes a memory and a non-volatile memory, and the interface includes a network interface and other peripheral interfaces; the storage module, the processor, the network interface, and other peripheral interfaces are connected via a communication bus, which is represented by only one bidirectional arrow in the figure, but does not mean that there is only one bus or one type of bus.
[0053] The above description is a specific embodiment of the present invention and the technical principles used. If the changes made according to the concept of the present invention do not exceed the spirit covered by the description and drawings, they should still fall within the scope of protection of the present invention.
Claims
1. A cluster training node allocation method, characterized in that: The following steps are involved: (1) Setting training allocation parameters and submitting cluster training tasks; the training allocation parameters include group name, number of requested nodes, and designated node number; a node group is composed of a front-end router connected to multiple tree-structured nodes; nodes are pre-grouped according to different computing power, and nodes with the same number and type of GPU graphics cards are grouped into the same group to ensure that the computing power of nodes in the same group is basically the same, and each group has its own group name; (2) Obtain the available node set M, and according to the requested group name and the list of all grouping information, obtain the node list corresponding to the selected group name to obtain the requested node set Y; (3) Obtain the pre-allocated available node set Z, take the intersection of the available node set M and the requested node set Y to obtain the pre-allocated available node set Z = M∩Y; (4) Check whether the number of nodes in the pre-allocated available node set Z meets the number of requested nodes. If not, return to step (1); if yes, establish an allocation execution node set with a capacity equal to the number of requested nodes; (5) Place the specified node into the set of allocated execution nodes; (6) The nodes in the pre-allocated available node set Z are prioritized according to a preset rule, and are sequentially placed in the allocation execution node set until the allocation execution node set is full; the preset rule is: the operation status score corresponding to each node is prioritized from high to low; The method for obtaining the running status score is as follows: in the initial stage, each node is assigned an initial running status score. During the training process, the error information of each node is collected. For each error information received, the node is deducted one point. (7) Lock the nodes in the assigned execution node set, distribute the training tasks to the assigned execution nodes, start task training, and monitor the node operation status during the training process.
2. A cluster training node allocation method according to claim 1, characterized in that The step (1) also includes selecting training environment component options, the training environment component options including: image file name, startup parameters, external environment variables, configuration parameters and configuration file name, the configuration parameters including system resource allocation parameters.
3. A cluster training node allocation method according to claim 1, characterized in that: The available node set is the nodes in all cluster nodes that are in normal running state, not locked, not disabled, and not executing tasks.
4. A cluster training node allocation method according to any one of claims 1 to 3, characterized in that: After obtaining the node list corresponding to the selected request group name, you need to check whether the group name and list node number are legal.
5. A cluster training node allocation method according to claim 4, characterized in that The nodes in the locked state in step (7) will be released when one of the following conditions is met:
1. The task distribution is completed and the training task starts to run; 2. The node is released after a 5-minute timeout.
Citation Information
Patent Citations
Method and device for determining running node of machine learning task
CN108304250A
Job scheduling management method, scheduling center and system
CN110795241A
Node scheduling method and device, node pre-selection processing method and device, equipment and medium
CN111464659A
Scheduling method and device based on data set and node cache
CN112202837A
Computing power scheduling method and device based on Kubernetes
CN112241321A
