Training task scheduling method, device, electronic device and storage medium

By detecting training tasks and resource usage, and dynamically adjusting the number and status of containers, the problem of low resource utilization in the existing technology is solved, and automated resource scheduling and efficient training task execution are achieved.

CN114924851BActive Publication Date: 2024-09-24BEIJING UNISOUND INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210523878.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-14
Publication Date
2024-09-24
Estimated Expiration
2042-05-14

AI Technical Summary

Technical Problem

The resource scheduling of existing distributed training tasks requires manual adjustment by users, resulting in low utilization of cluster resources and inability to effectively meet the training needs of deep learning models.

Method used

By detecting the creation of training tasks, obtain task information and resource usage, adjust the number and status of containers, prioritize the resource requirements of inelastic containers, dynamically adjust elastic containers to release resources for use by inelastic containers, and improve resource utilization.

Benefits of technology

It realizes automated resource scheduling, improves the utilization of cluster resources, meets the training needs of deep learning models, and improves training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114924851B
    Figure CN114924851B
Patent Text Reader

Abstract

The embodiments of the present application disclose a scheduling method, device, electronic device and storage medium for training tasks. A specific implementation of the method includes: detecting whether a training task has been created; in response to detecting that a training task has been created, obtaining task information of the training task, and querying the usage of target resources and the status of containers in the current scheduling queue, the task information includes the number of containers for the task and the number of target resources required for the container to run; adjusting the number and / or status of containers in the task scheduling queue according to the task information and the usage of the queried target resources and the status of the containers. This implementation provides a mechanism for adjusting the number and / or status of containers in a task scheduling queue, thereby improving the utilization of cluster resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for scheduling training tasks. Background Art

[0002] With the emergence of larger deep learning models, a single machine can no longer meet the training needs of the model, and distributed training has become the standard way of model training in the industry. Although there are flexible training solutions in the industry, they are manual and the number of distributed training tasks requires manual adjustment by the user, resulting in low utilization of cluster resources. Summary of the invention

[0003] The embodiments of the present application provide a method, device, electronic device and storage medium for scheduling training tasks.

[0004] In a first aspect, some embodiments of the present application provide a method for scheduling training tasks, the method comprising: detecting whether a training task has been created; in response to detecting that a training task has been created, obtaining task information of the training task, and querying the usage of target resources and the status of containers in the current scheduling queue, the task information including the number of containers for the task and the number of target resources required for container operation; adjusting the number and / or status of containers in the task scheduling queue according to the task information and the queried usage of the target resources and the status of the containers.

[0005] In some embodiments, the task information also includes the type of training task; and according to the task information and the usage of the queried target resources and the status of the container, the number and / or status of the containers in the task scheduling queue are adjusted, including: determining the type of container for the training task according to the type of training task; determining the priority of the container according to the type of container; adjusting the number and / or status of the containers in the task scheduling queue according to the priority of the container, the usage of the target resources, the number of containers, and the number of target resources required for the container to run.

[0006] In some embodiments, the type of training task includes an elastic training task, the number of containers includes a maximum value and a minimum value of the number of containers; and the type of container of the training task is determined according to the type of training task, including: determining the type of container of the minimum value as a non-elastic container, and determining the type of container of the difference between the maximum value and the minimum value as an elastic container.

[0007] In some embodiments, the type of the training task includes an inelastic training task; and determining the type of the container of the training task according to the type of the training task includes: determining the type of the container of the inelastic training task as an inelastic container.

[0008] In some embodiments, the priority of a non-elastic container is higher than that of an elastic container; and according to the priority of the container, the usage of the target resources, the number of containers, and the number of target resources required for the container to run, the number and / or status of the containers in the task scheduling queue are adjusted, including: in response to the remaining target resources not satisfying the operation of the non-elastic container, determining whether the sum of the target resources occupied by the running elastic container and the remaining target resources satisfies the operation of the non-elastic container according to the situation of the queried container; in response to determining that the sum of the target resources occupied by the running elastic container and the remaining target resources satisfies the operation of the non-elastic container, stopping the running elastic container to release the target resources for the non-elastic container to run, and setting the elastic container of the training task as the container to be scheduled.

[0009] In some embodiments, the method further includes: in response to determining that the sum of the target resources occupied by the running elastic container and the remaining target resources does not satisfy the operation of the non-elastic container, setting the container of the training task as a container to be scheduled.

[0010] In some embodiments, the method further includes: in response to a container in the task scheduling queue terminating operation, determining whether there is a container to be scheduled that meets the scheduling conditions in the containers to be scheduled after releasing the target resources occupied by the container that has terminated operation; in response to determining that there is a container to be scheduled that meets the scheduling conditions, running the container to be scheduled that meets the scheduling conditions.

[0011] In some embodiments, the usage of the target resource is obtained by periodically querying a resource monitoring plug-in deployed on the node.

[0012] In some embodiments, the target resource includes a graphics processor GPU.

[0013] In a second aspect, some embodiments of the present application provide a scheduling device for training tasks, the device comprising: a detection unit, configured to detect whether a training task has been created; a query unit, configured to obtain task information of the training task in response to detecting that a training task has been created, and query the usage of target resources and the status of containers in the current scheduling queue, the task information including the number of containers for the task and the number of target resources required for container operation; an adjustment unit, configured to adjust the number and / or status of containers in the task scheduling queue according to the task information and the queried usage of the target resources and the status of the containers.

[0014] In some embodiments, the task information also includes the type of training task; and the adjustment unit is further configured to: determine the type of container for the training task according to the type of training task; determine the priority of the container according to the type of container; and adjust the number and / or status of containers in the task scheduling queue according to the priority of the container, the usage of target resources, the number of containers, and the number of target resources required for the container to run.

[0015] In some embodiments, the type of training task includes an elastic training task, the number of containers includes a maximum value and a minimum value of the number of containers; and the adjustment unit is further configured to: determine the type of containers of the minimum number as a non-elastic container, and determine the type of containers of the difference between the maximum value and the minimum value as an elastic container.

[0016] In some embodiments, the type of the training task includes an inelastic training task; and the adjustment unit is further configured to: determine the type of the container of the inelastic training task as an inelastic container.

[0017] In some embodiments, the priority of the non-elastic container is higher than that of the elastic container; and the adjustment unit is further configured to: in response to the remaining target resources not satisfying the operation of the non-elastic container, determine whether the sum of the target resources occupied by the running elastic container and the remaining target resources satisfies the operation of the non-elastic container according to the situation of the queried container; in response to determining that the sum of the target resources occupied by the running elastic container and the remaining target resources satisfies the operation of the non-elastic container, stop the running elastic container to release the target resources for the non-elastic container to run, and set the elastic container of the training task as the container to be scheduled.

[0018] In some embodiments, the adjustment unit is further configured to: in response to determining that the sum of the target resources occupied by the running elastic container and the remaining target resources does not meet the operation of the non-elastic container, set the container of the training task as the container to be scheduled.

[0019] In some embodiments, the adjustment unit is further configured to: in response to a container in the task scheduling queue terminating operation, determine whether there is a container to be scheduled that meets the scheduling conditions in the containers to be scheduled after releasing the target resources occupied by the container that has terminated operation; in response to determining that there is a container to be scheduled that meets the scheduling conditions, run the container to be scheduled that meets the scheduling conditions.

[0020] In some embodiments, the usage of the target resource is obtained by periodically querying a resource monitoring plug-in deployed on the node.

[0021] In some embodiments, the target resource includes a graphics processor GPU.

[0022] In a third aspect, some embodiments of the present application provide a device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above in the first aspect.

[0023] In a fourth aspect, some embodiments of the present application provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described above in the first aspect.

[0024] The training task scheduling method, device, electronic device and storage medium provided in the embodiments of the present application detect whether a training task has been created; in response to detecting that a training task has been created, obtain task information of the training task, and query the usage of target resources and the status of containers in the current scheduling queue, wherein the task information includes the number of containers for the task and the number of target resources required for the container to run; according to the task information and the usage of the queried target resources and the status of the containers, adjust the number and / or status of the containers in the task scheduling queue, thereby providing a mechanism for adjusting the number and / or status of containers in the task scheduling queue and improving the utilization rate of cluster resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0026] Figure 1 are some exemplary system architecture diagrams to which the present application may be applied;

[0027] Figure 2 is a flow chart of an embodiment of a method for scheduling training tasks according to the present application;

[0028] Figure 3 It is a schematic diagram of a distributed task control module in an optional implementation of the training task scheduling method of the present application;

[0029] Figure 4 It is a schematic diagram of a resource detection and control module in an optional implementation of the scheduling method of the training task of the present application;

[0030] Figure 5 is a structural schematic diagram of an embodiment of a scheduling device for training tasks according to the present application;

[0031] Figure 6 It is a structural diagram of a computer system of a server suitable for implementing some embodiments of the present application. DETAILED DESCRIPTION

[0032] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0033] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0034] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of a method for scheduling training tasks or an apparatus for scheduling training tasks of the present application can be applied.

[0035] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0036] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various client applications can be installed on terminal devices 101, 102, 103, such as cluster management applications, deep learning platform applications, model training applications, resource management applications, etc.

[0037] The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc. When the terminal devices 101, 102, 103 are software, they may be installed in the electronic devices listed above. They may be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made here.

[0038] Server 105 can be a server that provides various services, such as a background server that provides support for applications installed on terminal devices 101, 102, and 103. Server 105 can detect whether a training task is created; in response to detecting that a training task is created, obtain task information of the training task, and query the usage of target resources and the status of containers in the current scheduling queue, where the task information includes the number of containers for the task and the number of target resources required for container operation; adjust the number and / or status of containers in the task scheduling queue based on the task information and the queried usage of target resources and the status of containers.

[0039] It should be noted that the method for scheduling training tasks provided in the embodiment of the present application can be executed by the server 105 , and accordingly, the scheduling device for training tasks can be set in the server 105 .

[0040] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0041] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0042] Continue to refer Figure 2 , shows a process 200 of an embodiment of a method for scheduling training tasks according to the present application. The method for scheduling training tasks includes the following steps:

[0043] Step 201, detecting whether a training task has been created.

[0044] In this embodiment, the scheduling method execution body of the training task (for example Figure 1 The server shown in the figure can first detect whether a training task has been created. In the field of deep learning, the training tasks of algorithm models are generally implemented based on deep learning frameworks. Currently popular deep learning frameworks include artificial intelligence learning system (Tensorflow), parallel distributed deep learning open source platform (PaddlePaddle), convolutional structure for fast feature embedding (Caffe), etc. Many deep learning frameworks have their own characteristics, and developers choose different frameworks to implement models when facing specific scenarios. However, no matter which framework is used to train the model, the process of running training tasks is inseparable from resource management and task scheduling, that is, unified management of the CPU, memory, GPU and other computing resources of the server cluster, and allocation of resource containers according to the resource requirements of the training tasks; at the same time, as the training tasks are run and terminated, the occupied computing resources are allocated and recycled in real time.

[0045] Take the Kubernetes platform as an example. On the Kubernetes platform, when developers run a model training task, they need to intervene in the resource management of the Kubernetes platform, apply for the expected computing resource container from the platform, and then apply for different network policies to cooperate with the operation of the training task. Figure 3, the command parameters submitted by the user can be parsed and stored in the etcd data set by the API-Server service of the Kubernetes platform. The distributed task control module can monitor (watch) the resource creation events of the API-Server. For example, when the user executes the creation, the control module will see this event and then schedule the resource creation function. The resource creation function will call the elastic resource scheduling model to schedule reasonable resources for the distributed task. After the elastic resource scheduling module selects the appropriate node for the distributed task, the nodes that have been assigned to the master node (worker) are started in sequence. When starting each training container, the distributed task control module can also set up the mutual SSH (Secure Shell Protocol) access environment and the corresponding IP and port for all distributed task containers to facilitate subsequent multi-machine communication. The control module will tune the entire cluster so that its tasks meet the user's expected state.

[0046] Step 202, in response to detecting that a training task is created, obtain task information of the training task, and query the usage of target resources and the status of containers in the current scheduling queue.

[0047] In this embodiment, the execution subject can obtain the task information of the training task in response to detecting that the training task is created, and query the usage of the target resources and the status of the containers in the current scheduling queue. The task information includes the number of containers for the task and the number of target resources required for the container to run.

[0048] In some optional implementations of this embodiment, the usage of the target resource can be obtained by regularly querying the resource monitoring plug-in deployed on the node. In addition, it can also be obtained through third-party software deployment. As an example, refer to Figure 4 ,The resource detection and control module can periodically query the remaining allocatable GPU resources of the cluster through the resource monitoring plug-in deployed on each node in the cluster, and store the data in the scheduling queue field in the database for scheduling by the scheduling model.

[0049] In some optional implementations of this embodiment, the target resource includes a graphics processor GPU. Each task submitted by a user can be assigned to a scheduling queue, which contains a limited number of GPUs, currently running containers and containers to be scheduled (when the user submits a training task and there are insufficient resources, it will become a container to be scheduled, and after scheduling is successful, it will become a running container). The resource monitoring module can check the usage of the GPU of each node and the status of the pod (container group) in each scheduling queue, and calculate the number of GPU resources available in the scheduling queue.

[0050] Step 203: Adjust the number and / or status of containers in the task scheduling queue according to the task information and the usage of the queried target resources and the status of the containers.

[0051] In this embodiment, the execution subject can adjust the number and / or state of containers in the task scheduling queue according to the task information and the usage of the queried target resources and the status of the container. Adjusting the number and / or state of containers in the task scheduling queue can be achieved by running containers, adding containers to be scheduled, killing containers, and other operations.

[0052] In some optional implementations of this embodiment, the task information also includes the type of training task; and according to the task information and the usage of the queried target resources and the situation of the container, the number and / or status of the containers in the task scheduling queue are adjusted, including: determining the type of container of the training task according to the type of training task; determining the priority of the container according to the type of container; adjusting the number and / or status of the containers in the task scheduling queue according to the priority of the container, the usage of the target resources, the number of containers, and the number of target resources required for the container to run. The priority of the container can be set according to the type of container or other user needs. As an example, containers can be divided into elastic containers and non-elastic containers, and it can be stipulated that the priority of non-elastic containers is higher than that of elastic containers; the user's elastic distributed task will set the number of [min, max] containers, and stipulate that the priority of containers of min and below is set to level I, and the priority of containers exceeding min but not reaching max is set to level II.

[0053] In some optional implementations of this embodiment, the type of training task includes elastic training task, the number of containers includes the maximum and minimum number of containers; and the type of container of the training task is determined according to the type of training task, including: determining the type of container of the minimum number as a non-elastic container, and determining the type of container of the difference between the maximum and minimum values ​​as an elastic container. When creating a distributed task, the user can specify the minimum and maximum number of containers, and the user specifies the deep learning framework and mirror environment to be used to submit the training task. The elastic resource scheduling module can make scheduling decisions on distributed task resources according to the scheduling algorithm by querying the resource monitoring module and the user's distributed task status. The elastic scheduling module can maintain a desired field and pass it to the distributed task control module, and the distributed task control module can maintain the desired number of containers. When the user's event is first passed to the elastic resource scheduling module through the distributed task control module, the resource scheduling module can query the usage of resources in the current scheduling queue and make correct settings for it.

[0054] In some optional implementations of this embodiment, the type of training task includes an inelastic training task; and determining the type of container of the training task according to the type of training task includes: determining the type of container of the inelastic training task as an inelastic container.

[0055] In some optional implementations of this embodiment, the priority of the non-elastic container is higher than that of the elastic container; and according to the priority of the container, the usage of the target resource, the number of containers, and the number of target resources required for the container to run, the number and / or state of the containers in the task scheduling queue are adjusted, including: in response to the remaining target resources not meeting the operation of the non-elastic container, determining whether the sum of the target resources occupied by the running elastic container and the remaining target resources meets the operation of the non-elastic container according to the queried container; in response to determining that the sum of the target resources occupied by the running elastic container and the remaining target resources meets the operation of the non-elastic container, the running elastic container is stopped to release the target resources for the non-elastic container to run, and the elastic container of the training task is set as a container to be scheduled. When the current resources of the scheduling queue are insufficient, the minimum value is met, and the elastic training task is submitted. At this time, the task can be scheduled, and the unsatisfied part will be set as an elastic task to be scheduled; if the minimum value is not met, the elastic training task is submitted. At this time, the task can be set to be scheduled (elastic to be scheduled and non-elastic task to be scheduled). In the case of submitting a non-elastic task, there is a running elastic container and the resources of the elastic container meet the resource requirements of the non-elastic task just submitted. At this time, the running elastic container can be killed. If there is a running elastic container and the resources of the running elastic container do not meet the resource requirements of the non-elastic task just submitted, the submitted non-elastic task can be set as a waiting-to-be-scheduled task.

[0056] In some optional implementations of this embodiment, the method further includes: in response to determining that the sum of the target resources occupied by the running elastic container and the remaining target resources does not meet the operation of the non-elastic container, setting the container of the training task as a container to be scheduled.

[0057] In some optional implementations of this embodiment, the method further includes: in response to a container in the task scheduling queue terminating operation, determining whether there is a container to be scheduled that meets the scheduling condition in the containers to be scheduled after releasing the target resources occupied by the container that has terminated operation; in response to determining that there is a container to be scheduled that meets the scheduling condition, running the container to be scheduled that meets the scheduling condition.

[0058] As an example, the GPU limit set by the scheduling queue is 60. Currently, there are two running non-elastic containers p1 (10*GPU) and p2 (5*GPU). At this time, the user submits an elastic task with a minimum container value of 2 and a maximum container value of 5. Each node uses 10 GPUs, which means that at least 2 10-card GPUs and a maximum of 5 10-card GPUs are used. According to the current resource usage, the schedulable GPUs are: 60-1×10-1×5=45, 45 divided by 10 is rounded to 4. There will be two non-elastic task containers non-elstic-p1 and non-elstic-p2 with priority I, and two elastic containers elstic-p3 and elstic-p4 with priority II. At the same time, there is an elastic container elstic-p5 to be scheduled. At this time, the desired field will be set to 4. If p2 ends, 5 GPUs will be released, and there will be 10 GPUs left in the scheduling queue. Elstic-p5 will start if it meets the scheduling conditions, and the desired field will be set to 5. If other users submit a 25-card non-elastic resource non-elstic-p6 in the scheduling queue, the scheduling module will kill elstic-p3, elstic-p4, and elstic-p5, and set the desired field to 2. Non-elstic-p6 will start successfully. If the user submits a 35-card non-elastic resource non-elstic-p6, then even if the 3 elastic tasks are killed in time, the scheduling conditions will not be met. At this time, the 3 elastic tasks will not be killed, and the non-elastic resource non-elstic-p6 will be set as a container to be scheduled.

[0059] The method provided by the above-mentioned embodiments of the present application detects whether a training task has been created; in response to detecting that a training task has been created, obtains task information of the training task, and queries the usage of target resources and the status of containers in the current scheduling queue, wherein the task information includes the number of containers for the task and the number of target resources required for the container to run; and adjusts the number and / or status of containers in the task scheduling queue according to the task information and the usage of the queried target resources and the status of the containers, thereby providing a mechanism for adjusting the number and / or status of containers in the task scheduling queue and improving the utilization rate of cluster resources.

[0060] Further references Figure 5 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a scheduling device for training tasks. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0061] like Figure 5As shown, the scheduling device 500 for training tasks in this embodiment includes: a detection unit 501, a query unit 502, and an adjustment unit 503. The detection unit is configured to detect whether a training task is created; the query unit is configured to obtain task information of the training task in response to detecting that a training task is created, and query the usage of target resources and the status of containers in the current scheduling queue, wherein the task information includes the number of containers of the task and the number of target resources required for the container to run; the adjustment unit is configured to adjust the number and / or status of containers in the task scheduling queue according to the task information and the usage of the queried target resources and the status of the containers.

[0062] In this embodiment, the specific processing of the detection unit 501, the query unit 502, and the adjustment unit 503 of the scheduling device 500 for the training task can be referred to. Figure 2 This corresponds to step 201, step 202 and step 203 in the embodiment.

[0063] In some optional implementations of this embodiment, the task information also includes the type of training task; and the adjustment unit is further configured to: determine the type of container for the training task according to the type of training task; determine the priority of the container according to the type of container; adjust the number and / or status of containers in the task scheduling queue according to the priority of the container, the usage of target resources, the number of containers, and the target number of resources required for container operation.

[0064] In some optional implementations of this embodiment, the type of training task includes an elastic training task, the number of containers includes a maximum value and a minimum value of the number of containers; and the adjustment unit is further configured to: determine the type of containers of the minimum number as non-elastic containers, and determine the type of containers of the difference between the maximum value and the minimum value as elastic containers.

[0065] In some optional implementations of this embodiment, the type of the training task includes an inelastic training task; and the adjustment unit is further configured to: determine the type of the container of the inelastic training task as an inelastic container.

[0066] In some optional implementations of this embodiment, the priority of the non-elastic container is higher than that of the elastic container; and the adjustment unit is further configured to: in response to the remaining target resources not satisfying the operation of the non-elastic container, determine whether the sum of the target resources occupied by the running elastic container and the remaining target resources satisfy the operation of the non-elastic container according to the situation of the queried container; in response to determining that the sum of the target resources occupied by the running elastic container and the remaining target resources satisfy the operation of the non-elastic container, stop the running elastic container to release the target resources for the non-elastic container to run, and set the elastic container of the training task as the container to be scheduled.

[0067] In some optional implementations of this embodiment, the adjustment unit is further configured to: in response to determining that the sum of the target resources occupied by the running elastic container and the remaining target resources does not meet the operation of the non-elastic container, set the container of the training task as the container to be scheduled.

[0068] In some optional implementations of this embodiment, the adjustment unit is further configured to: in response to a container in the task scheduling queue terminating operation, determine whether there is a container to be scheduled that meets the scheduling condition in the containers to be scheduled after releasing the target resources occupied by the container that has terminated operation; in response to determining that there is a container to be scheduled that meets the scheduling condition, run the container to be scheduled that meets the scheduling condition.

[0069] In some optional implementations of this embodiment, the usage of the target resource is obtained by periodically querying a resource monitoring plug-in deployed on the node.

[0070] In some optional implementations of this embodiment, the target resource includes a graphics processor GPU.

[0071] The device provided by the above-mentioned embodiments of the present application detects whether a training task has been created; in response to detecting that a training task has been created, obtains task information of the training task, and queries the usage of target resources and the status of containers in the current scheduling queue, wherein the task information includes the number of containers for the task and the number of target resources required for container operation; adjusts the number and / or status of containers in the task scheduling queue according to the task information and the usage of the queried target resources and the status of the containers, thereby providing a mechanism for adjusting the number and / or status of containers in the task scheduling queue and improving the utilization of cluster resources.

[0072] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 suitable for implementing a server of an embodiment of the present application. Figure 6 The server shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0073] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0074] The following components can be connected to the I / O interface 605: an input section 606 including such as a keyboard, a mouse, etc.; an output section 607 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0075] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above functions defined in the method of the present application are executed. It should be noted that the computer-readable medium described in the present application can be a computer-readable signal medium or a computer-readable medium or any combination of the above two. The computer-readable medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer 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. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus or a device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus or a device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0076] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as C or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0077] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0078] The units involved in the embodiments described in the present application may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor includes a detection unit, a query unit, and an adjustment unit. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances. For example, the detection unit may also be described as a "unit for detecting whether a training task has been created".

[0079] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the device: detects whether a training task is created; in response to detecting that a training task is created, obtains the task information of the training task, and queries the usage of the target resources and the status of the container in the current scheduling queue, the task information includes the number of containers of the task and the number of target resources required for the container to run; according to the task information and the usage of the queried target resources and the status of the container, adjust the number and / or status of the containers in the task scheduling queue.

[0080] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. A method for scheduling a training task, comprising: Check whether a training task has been created; In response to detecting that a training task is created, obtaining task information of the training task, and querying the usage of target resources and the status of containers in the current task scheduling queue, wherein the task information includes the number of containers of the task and the number of target resources required for the container to run; Adjust the number and / or status of containers in the task scheduling queue according to the task information and the usage of the queried target resources and the status of the containers; The task information also includes the type of the training task; and The adjusting the number and / or state of the containers in the task scheduling queue according to the task information and the usage of the queried target resource and the state of the container includes: Determining a type of a container for the training task according to the type of the training task; Determining the priority of the container according to the type of the container; Adjusting the number and / or state of containers in the task scheduling queue according to the priority of the container, the usage of the target resource, the number of containers, and the number of target resources required for container operation; The types of the training tasks include elastic training tasks and inelastic training tasks, and the number of containers includes a maximum value and a minimum value of the number of containers; and The determining the type of the container of the training task according to the type of the training task includes: Determine the type of the container of the minimum value as a non-elastic container, and determine the type of the container of the difference between the maximum value and the minimum value as an elastic container; Determining the type of the container of the inelastic training task as an inelastic container; The non-elastic container has a higher priority than the elastic container; and The adjusting the number and / or state of containers in the task scheduling queue according to the priority of the container, the usage of the target resource, the number of containers, and the number of target resources required for container operation includes: In response to the remaining target resources not satisfying the operation of the non-elastic container, determining, according to the queried container, whether the sum of the target resources occupied by the running elastic container and the remaining target resources satisfies the operation of the non-elastic container; In response to determining that the sum of the target resources occupied by the running elastic container and the remaining target resources satisfies the operation of the non-elastic container, the running elastic container is stopped to release the target resources for the non-elastic container to run, and the elastic container of the training task is set as the container to be scheduled.

2. The method according to claim 1, wherein: The method further comprises: In response to determining that the sum of the target resources occupied by the running elastic container and the remaining target resources does not satisfy the operation of the non-elastic container, the container of the training task is set as a container to be scheduled.

3. The method according to claim 2, wherein: The method further comprises: In response to a container in the task scheduling queue finishing running, determining whether there is a container to be scheduled that meets the scheduling condition in the containers to be scheduled after releasing the target resources occupied by the container that has finished running; In response to determining that there is a container to be scheduled that meets the scheduling condition, the container to be scheduled that meets the scheduling condition is run.

4. The method according to claim 1, wherein: The usage of the target resource is obtained by periodically querying the resource monitoring plug-in deployed on the node.

5. The method according to any one of claims 1 to 4, wherein: The target resource includes a graphics processor GPU.

6. A training task scheduling device, comprising: A detection unit, configured to detect whether a training task is created; A query unit is configured to, in response to detecting that a training task is created, obtain task information of the training task, and query the usage of target resources and the status of containers in the current task scheduling queue, wherein the task information includes the number of containers of the task and the number of target resources required for the container to run; An adjusting unit, configured to adjust the number and / or state of containers in the task scheduling queue according to the task information and the usage of the queried target resource and the state of the container; The task information also includes the type of the training task; and The adjusting the number and / or state of the containers in the task scheduling queue according to the task information and the usage of the queried target resource and the state of the container includes: Determining a type of a container for the training task according to the type of the training task; Determining the priority of the container according to the type of the container; Adjusting the number and / or state of containers in the task scheduling queue according to the priority of the container, the usage of the target resource, the number of containers, and the number of target resources required for container operation; The types of the training tasks include elastic training tasks and inelastic training tasks, and the number of containers includes a maximum value and a minimum value of the number of containers; and The determining the type of the container of the training task according to the type of the training task includes: Determine the type of the container of the minimum value as a non-elastic container, and determine the type of the container of the difference between the maximum value and the minimum value as an elastic container; Determining the type of the container of the inelastic training task as an inelastic container; The non-elastic container has a higher priority than the elastic container; and The adjusting the number and / or state of containers in the task scheduling queue according to the priority of the container, the usage of the target resource, the number of containers, and the number of target resources required for container operation includes: In response to the remaining target resources not satisfying the operation of the non-elastic container, determining, according to the queried container, whether the sum of the target resources occupied by the running elastic container and the remaining target resources satisfies the operation of the non-elastic container; In response to determining that the sum of the target resources occupied by the running elastic container and the remaining target resources satisfies the operation of the non-elastic container, the running elastic container is stopped to release the target resources for the non-elastic container to run, and the elastic container of the training task is set as the container to be scheduled.

7. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 5.

8. A computer readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.