A task scheduling method, device, computer equipment and storage medium
By acquiring task information and determining task types to optimize resource allocation, the problem of low task scheduling efficiency in the prior art is solved, and faster task execution speed and higher resource utilization efficiency are achieved.
Patent Information
- Application Number
- CN202110586526.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-27
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2041-05-27
AI Technical Summary
In the prior art, task scheduling methods have problems of slow execution speed and low efficiency when executing deep learning tasks, mainly because resource allocation is not reasonable enough and fails to effectively match the resource requirements of the task.
By obtaining task information, determining the task type, and matching the target node server and target resources according to the task type, optimizing resource allocation and improving resource utilization efficiency. The specific steps include obtaining task information, determining task type, selecting appropriate node servers and resources, and ensuring the rationality and efficiency of resource allocation.
The speed and efficiency of task execution are improved, and the requirements of different task types are met through reasonable resource allocation, and the overall performance of the task scheduling system is improved.
Smart Images

Figure CN113238848B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a task scheduling method, apparatus, computer equipment and storage medium. Background Art
[0002] In order to meet the different resource requirements corresponding to different deep learning tasks, the task scheduling system plays an increasingly important role. In the existing technology, the task scheduling methods used in the task scheduling system are mostly based on the resource requirements of the deep learning tasks, with the goal of allocating as few node servers as possible to schedule resources for each deep learning task.
[0003] However, when using the resources scheduled by the above method to perform deep learning tasks, there are problems of slow execution speed and low efficiency. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a task scheduling method, apparatus, computer equipment and storage medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a task scheduling method, including:
[0006] Get the task information of the tasks to be processed;
[0007] Based on the task information, determining a task type of the task;
[0008] Based on the task type, determining a target node server for executing the task and a target resource on the target node server;
[0009] The target node server and the target resources on the target node server are allocated to execute the task.
[0010] Task information can reflect the resource demand and communication volume demand information of the task to be processed, so that the task type that matches the task information can be determined based on the task information. Tasks of different task types have different ways of determining the target node server and target resources. Based on the determined task type, the resource determination method that matches the task type can be determined. Then, the target resources are allocated to the task to be processed using the determined resource determination method, which can improve the rationality of the allocated target resources. Then, the speed and efficiency of task execution can be improved by using the determined target resources to execute the task to be processed.
[0011] In a possible implementation manner, determining the task type of the task according to the task information includes:
[0012] Determine the resource requirement of the task and the communication volume requirement information of the task according to the task information;
[0013] Determine the number of resources in the node server;
[0014] The task type of the task is determined based on the determined resource requirement, the communication volume requirement information of the task, and the number of resources in the node server.
[0015] In this way, the communication volume demand information can reflect the communication volume and computing volume demand information of the task, the resource demand can reflect the number of idle resources required to execute the task, and the number of resources in the node server can reflect the maximum number of idle resources in a node server. Furthermore, based on the resource demand, the communication volume demand information of the task, and the number of resources in the node server, the task type of the task to be processed can be accurately determined.
[0016] In a possible implementation manner, determining a target node server for executing the task and a target resource on the target node server based on the task type includes:
[0017] Based on the task type of the task, the resource requirement of the task and the idle resources on each node server, a target node server for executing the task and target resources on the target node server are determined.
[0018] In this way, tasks of different task types have different resource allocation priorities. For example, for tasks of a single-node multi-resource communication type with high communication volume requirements, the resource allocation priority is higher, so the target node server can be selected from the node servers whose number of idle resources is greater than the resource demand. For tasks of a single-node multi-resource computing type with a large amount of computing, the resource allocation priority is lower than that of a single-node multi-resource communication type, so the target node server can be selected from the node servers whose number of idle resources is less than the resource demand. In this way, by allocating target node servers and target resources in target node servers to tasks according to different task types, it is possible to reasonably allocate idle resources in each node server to different tasks, thereby improving the speed and efficiency of task scheduling and execution.
[0019] In a possible implementation, determining a target node server for executing the task and a target resource on the target node server based on the task type of the task, the resource requirement of the task, and the idle resources on each node server includes:
[0020] Based on the task type of the task, determining at least one initial node server matching the task type;
[0021] Based on the resource demand of the task and the idle resources on each initial node server, a target node server for executing the task and target resources on the target node server are determined from the at least one initial node server.
[0022] In this way, based on the task type, the initial node servers that can execute the tasks to be processed can be screened out first, and then the target node servers and target resources for executing the tasks to be processed can be screened out based on the resource requirements of the tasks and the idle resources on each initial node server. Thus, the screened target node servers and target resources can not only execute the tasks to be processed, but also have the fastest execution speed, thereby improving the speed and efficiency of task execution.
[0023] In one possible implementation, the task type includes a single-node multi-resource communication type;
[0024] The step of determining a target node server for executing the task from the at least one initial node server comprises:
[0025] Based on the amount of idle resources on each of the at least one initial node server, selecting an initial node server whose amount of idle resources is greater than or equal to the resource demand as a first node server;
[0026] Based on the idle resources on the first node server and the resource requirement of the task, a target node server for executing the task is determined.
[0027] In this way, the single-node multi-resource communication type has a higher demand for communication volume, so the first node server whose number of idle resources is greater than or equal to the resource demand is selected, instead of waiting for other node servers whose number of idle resources is less than the resource demand to release resources. The initial node server with a larger number of idle resources is preferentially allocated to this type of task to meet the communication volume demand of this type of task. Furthermore, the target node server that executes the task is selected from the first node server, which can effectively improve the scheduling and execution efficiency of this type of task.
[0028] In a possible implementation manner, determining a target node server for executing the task based on idle resources on the first node server and resource requirements of the task includes:
[0029] Determining at least one preset topology structure corresponding to the resource demand;
[0030] A first node server having any of the preset topological structures and the least number of idle resources is selected from the first node servers as the target node server.
[0031] In this way, resources with a preset topological structure have a higher communication quality, and the target node server with a preset topological structure can further improve the speed of executing tasks of a single-node multi-resource communication type. In addition, selecting the first node server with the least number of idle resources can reduce the splitting of the original topological structure of idle resources in the first node server with a large number of idle resources, thereby protecting the optimal topological structure and reasonably applying it to other tasks such as a single-node multi-resource communication type.
[0032] In a possible implementation manner, determining the target resource on the target node server includes:
[0033] Using the preset topology structure in the target node server as the target topology structure;
[0034] The idle resources constituting the target topology structure in the target node server are used as the target resources.
[0035] In this way, it is possible to use the target resources with the target topology structure to execute single-node multi-resource communication type tasks, thereby improving the scheduling and execution efficiency of executing this type of tasks.
[0036] In a possible implementation, the task type includes a single-node multi-resource computing type;
[0037] The step of determining a target node server for executing the task from the at least one initial node server comprises:
[0038] Based on the amount of idle resources on each of the at least one initial node server, screening a second node server whose amount of idle resources is less than or equal to the resource demand;
[0039] Based on the idle resources on the second node server and the resource requirement of the task, a target node server for executing the task is determined.
[0040] In this way, the single-node multi-resource computing type has a high demand for computing volume and a low demand for communication volume. Therefore, selecting a second node server including a number of idle resources less than the resource demand can meet the communication volume demand and computing volume demand of this type of task, and improve the scheduling and execution efficiency of this type of task to a certain extent. Further, this type of task does not occupy the initial node server whose number of idle resources is greater than the resource demand, and this type of node server can be left for the single-node multi-resource communication type task with higher resource demand, thereby improving the scheduling and execution efficiency of the single-node multi-resource computing type task while improving the scheduling and execution efficiency of the single-node multi-resource communication type task. Further, this implementation method can avoid the splitting of the original topological structure of the idle resources in the initial node server with a large number of idle resources, realize the protection of the optimal topological structure and its reasonable application to other tasks such as the single-node multi-resource communication type.
[0041] In a possible implementation manner, determining a target node server for executing the task based on idle resources on the second node server and the resource requirement of the task includes:
[0042] Determining at least one preset topology structure corresponding to the resource demand;
[0043] A second server having any of the preset topological structures is selected from the second node servers as the target node server.
[0044] In this way, resources with a preset topological structure have higher communication quality, and using a target node server with a preset topological structure can improve the scheduling and execution efficiency of single-node multi-resource computing type tasks.
[0045] In a possible implementation manner, determining a target node server for executing the task based on idle resources on the second node server and the resource requirement of the task further includes:
[0046] In the case that no second node server having any of the preset topology structures is screened out from the second node servers, after a preset period of time or a change in the idle resources on at least one node server, the number of idle resources on each node server is re-acquired, and the step of screening second node servers whose number of idle resources is less than or equal to the resource demand is returned based on the number of idle resources on each initial node server in the at least one initial node server.
[0047] In this way, by using the method of re-obtaining the number of idle resources on each node server, the idle resources required and having a preset topological structure can be allocated to the task in a timely manner, and then, the single-node multi-resource computing type task can be executed in a timely manner. In addition, it can also avoid the splitting of the original topological structure of the idle resources in the initial node server with a large number of idle resources, realize the protection of the optimal topological structure and reasonably apply it to other tasks such as the single-node multi-resource communication type.
[0048] In a possible implementation, the task type includes a multi-node type;
[0049] The step of determining a target node server for executing the task from the at least one initial node server comprises:
[0050] Based on the resource demand of the task, determining the maximum number of third node servers required to perform the task from the at least one initial node server; wherein the third node server is an unloaded initial node server;
[0051] The third node servers with the largest number are used as the target node servers.
[0052] In this way, the idle resources in the unloaded third-node servers have the optimal topological structure. Selecting the largest number of third-node servers as target node servers can ensure that the target node servers used to execute multi-node type tasks have the optimal topological structure, thereby improving the efficiency of executing multi-node type tasks.
[0053] In a possible implementation manner, determining a target node server for executing the task from the at least one initial node server further includes:
[0054] When the total amount of resources on the third node servers with the largest number is less than the required amount of resources, determining the difference between the total amount of resources and the required amount of resources;
[0055] Based on the number of idle resources on each initial node server, screening a fourth node server whose number of idle resources is less than or equal to the difference;
[0056] Based on the idle resources on the fourth node server and the difference, a target node server for executing the task is determined.
[0057] In this way, the difference between the total amount of resources and the required amount of resources can reflect that in addition to the idle resources included in the unloaded target node server, the task also needs to select target resources on other initial node servers. Then, by selecting the fourth node server based on the difference, the reasonable allocation of idle resources required for the task can be achieved, thereby improving the speed of task execution.
[0058] In a possible implementation, the task type includes a single resource type;
[0059] The step of determining a target node server for executing the task from the at least one initial node server comprises:
[0060] Based on the amount of idle resources on each of the at least one initial node server, an initial node server having the same amount of idle resources as the resource demand is selected as the target node server.
[0061] In this way, a task of a single resource type only needs one idle resource to be executed. Therefore, by using a target node server whose number of idle resources is equal to the resource demand, the task can be executed quickly and efficiently.
[0062] In a possible implementation, the step of determining a preset topology is further included:
[0063] For any idle resources in any to-be-matched node server, determine all topological structures corresponding to any number of idle resources in the to-be-matched node server;
[0064] Determining the communication waiting time of each of the topological structures based on the communication medium between the idle resources;
[0065] Based on the communication waiting time, a preset topology structure corresponding to any number of idle resources in the to-be-matched node server is determined.
[0066] In this way, the communication waiting time of each topology structure can represent the waiting time required to execute a task using the topology structure. The communication waiting time can be used to screen out the preset topology structure with the highest task execution efficiency. Thus, the task can be executed using idle resources with the preset topology structure, which can improve the task execution efficiency.
[0067] In a possible implementation, determining a preset topology structure corresponding to any number of idle resources in the to-be-matched node server based on the communication waiting time includes:
[0068] Sorting the topological structures in order of the communication waiting time from low to high;
[0069] The topological structure with a sorting order smaller than the preset order is used as the preset topological structure corresponding to the node server to be matched.
[0070] In this way, by screening the preset topology structure in a preset order, it is possible to ensure that the communication waiting time of the screened preset topology structure is relatively short. Furthermore, by performing a task using the preset topology structure, the task can be performed at a faster speed.
[0071] In a possible implementation, determining a preset topology structure corresponding to any number of idle resources in the to-be-matched node server based on the communication waiting time includes:
[0072] For any number of idle resources, the topology structure in which the communication waiting time is less than the preset waiting threshold is used as the preset topology structure corresponding to the number of idle resources in the node server to be matched.
[0073] In this way, using the preset waiting threshold to filter the preset topology structure can ensure that the communication waiting time of the filtered preset topology structure is less than the preset waiting threshold. Further, using the preset topology structure to perform a task can reasonably reduce the communication waiting time required to perform the task.
[0074] In a possible implementation manner, determining the task type of the task according to the task information includes:
[0075] Get the free resources on each node server;
[0076] Determine the resource requirement of the task and the communication volume requirement information of the task according to the task information;
[0077] Determine the target node server for executing the task and the target resources on the target node server based on the idle resources on each of the node servers, the resource requirements of the task, and the communication volume requirement information of the task;
[0078] The task type of the task is determined based on a target node server that executes the task and a target resource on the target node server.
[0079] In this way, the target node server and target resource are determined while determining the task type. Then, the target node server and target resource corresponding to the task type can be directly allocated to the task to be processed, which omits the time of selecting the initial node server, improves the speed and efficiency of resource scheduling, and thus improves the speed and efficiency of task execution.
[0080] In a possible implementation, the method further includes:
[0081] In the case where the acquired tasks to be processed include multiple tasks, determining a resource allocation priority of each task based on a task type of each task;
[0082] Based on the resource allocation priority of each of the tasks, a target node server for executing the task and target resources on the target node server are determined.
[0083] In this way, resources are allocated to different tasks based on the resource allocation priority, so that the idle resources in each node server can be reasonably allocated to different tasks.
[0084] In a possible implementation, the task types include single-node multi-resource communication type, single-node multi-resource computing type, multi-node type, and single-resource type;
[0085] The determining of the resource allocation priority of each task based on the task type of each task includes:
[0086] Setting the resource allocation priority of the task of the single-node multi-resource communication type to the first priority;
[0087] Setting the resource allocation priority of the task of the single-node multi-resource computing type to a second priority;
[0088] Setting the resource allocation priority of the multi-node type task to a third priority;
[0089] The resource allocation priority of the task of the single resource type is set to the fourth priority.
[0090] In this way, the single-node multi-resource communication type task has a higher demand for communication volume. Setting the task of this task type to the first priority can meet the required communication volume and improve the execution speed of tasks of this task type. The single-node multi-resource computing type task has a higher demand for computing volume and a lower demand for communication volume. Setting the task of this task type to the second priority can meet the required computing volume and avoid the splitting of the original topological structure of idle resources in the node server with a large number of idle resources. Multi-node type tasks require unloaded node servers and there are relatively few tasks of this task type. Setting it to the third priority can ensure timely allocation of resources for single-node multi-resource communication type tasks and single-node multi-resource computing type tasks. Single-resource type tasks only need one resource to be executed, so setting it to the fourth priority can ensure that on the basis of timely allocation of resources for single-node multi-resource communication type tasks and single-node multi-resource computing type tasks, the execution speed of tasks of this task type is not affected.
[0091] In a possible implementation manner, the task information includes the resource requirement, and the method further includes the step of obtaining the resource requirement:
[0092] Obtaining a configuration file for the task to be processed;
[0093] The resource requirement of the task to be processed is obtained from the configuration file.
[0094] In this way, the resource requirements are directly obtained from the configuration file, which improves the speed of determining the resource requirements.
[0095] In a possible implementation manner, the task information includes the communication volume demand information, and the method further includes the step of obtaining the communication volume demand information:
[0096] Obtaining the computing amount information and communication amount information of the task to be processed;
[0097] Based on the computing amount information and the communication amount information, the communication amount requirement information is determined.
[0098] In this way, the communication volume demand information is determined based on the acquired computing volume information and communication volume information, so that the accuracy of the determined communication volume demand information can be guaranteed.
[0099] In a possible implementation manner, the obtaining the computing amount information and the communication amount information of the task to be processed includes:
[0100] Based on the acquired configuration file of the task to be processed or the acquired task request to be processed, the computing amount information and the communication amount information of the task to be processed are determined; wherein the task request includes the computing amount information and the communication amount information.
[0101] In this way, the calculation amount information and the communication amount information are determined based on the analysis of the configuration file or the task request, which can improve the accuracy of the determined calculation amount information and the communication amount information.
[0102] In a possible implementation manner, the task information includes the communication volume demand information, and the method further includes the step of obtaining the communication volume demand information:
[0103] Obtaining a configuration file for the task to be processed;
[0104] The communication volume requirement information of the task to be processed is obtained from the configuration file.
[0105] In this way, the communication volume demand information is directly obtained from the configuration file, the step of calculating the information is omitted, and the speed of determining the communication volume demand information is improved.
[0106] In a possible implementation manner, determining the task type of the task based on the determined resource requirement, the communication volume requirement information of the task, and the number of resources in the node server includes:
[0107] Determining the number of target node servers corresponding to the task to be processed based on the resource demand and the number of resources in the node server;
[0108] Based on the number of target node servers corresponding to the task to be processed and the communication volume demand information, the task type of the task to be processed is determined.
[0109] In this way, based on the number of resources in the node server and the number of resources in the node server, the task type of the task can be accurately determined.
[0110] In a possible implementation, the task types include single-node multi-resource communication type, single-node multi-resource computing type, multi-node type, and single-resource type;
[0111] The determining the task type of the task to be processed based on the number of target node servers corresponding to the task to be processed and the communication volume demand information includes:
[0112] When the number of target node servers corresponding to the task to be processed is equal to 1, the number of target resources corresponding to the task to be processed is greater than 1, and the communication volume demand information indicates that the communication volume demand of the task to be processed is higher than the computing volume demand, determine that the task type of the task to be processed is a single-node multi-resource communication type;
[0113] When the number of target node servers corresponding to the task to be processed is equal to 1, the number of target resources corresponding to the task to be processed is greater than 1, and the communication volume demand information indicates that the computing volume demand of the task to be processed is higher than the communication volume demand, determine that the task type of the task to be processed is a single-node multi-resource computing type;
[0114] When the number of target node servers corresponding to the task to be processed is greater than 1, determining that the task type of the task to be processed is a multi-node type;
[0115] When the number of target resources corresponding to the task to be processed is equal to 1, it is determined that the task type of the task to be processed is a single resource type.
[0116] In this way, the task type of each task can be accurately determined.
[0117] In a second aspect, the embodiment of the present disclosure further provides a task scheduling method, which is applied to a client and includes:
[0118] Determine the task type of the task to be processed;
[0119] Based on the task type of the task, determine a target node server for executing the task and a target resource on the target node server;
[0120] The information of the target node server and the information of the target resource are sent to the scheduler, so that the scheduler allocates the target node server and the target resource to the task to be processed.
[0121] In this way, the client first determines the target node server and target resource based on the determined task type, and then sends them to the scheduler. The scheduler omits the step of determining the target node server and target resource, and can directly assign the target node server and target resource to the task, thereby improving the speed of resource scheduling and the execution speed and efficiency of tasks.
[0122] In a possible implementation manner, determining the task type of the task to be processed includes:
[0123] Determine the resource requirement of the task, the communication volume requirement information of the task and the number of resources in the node server;
[0124] The task type of the task is determined based on the determined resource requirement, the communication volume requirement information of the task, and the number of resources in the node server.
[0125] In this way, the communication volume demand information can reflect the communication volume and computing volume demand information of the task, the resource demand can reflect the number of idle resources required to execute the task, and the number of resources in the node server can reflect the maximum number of idle resources in a node server. Furthermore, based on the resource demand, the communication volume demand information of the task, and the number of resources in the node server, the task type of the task to be processed can be accurately determined.
[0126] In a possible implementation manner, determining the task type of the task to be processed includes:
[0127] Get the free resources on each node server;
[0128] Based on the idle resources on each of the node servers, the resource requirements of the task, and the communication volume requirement information of the task, determining at least one target node server for executing the task and the target resources on the target node server;
[0129] A task type of the task is determined based on the at least one target node server and a target resource on the target node server.
[0130] In this way, determining the task type based on idle resources can ensure that the currently determined target node server and target resources can be directly used to execute the task.
[0131] In a third aspect, the embodiment of the present disclosure further provides a task scheduling device, which is applied to a scheduler, and includes:
[0132] An acquisition module is used to obtain task information of tasks to be processed;
[0133] A first determining module, used to determine a task type of the task based on the task information;
[0134] A second determination module is used to determine a target node server for executing the task and a target resource on the target node server based on the task type;
[0135] An allocation module is used to allocate the target node server and the target resources on the target node server to execute the task.
[0136] In a fourth aspect, the example of the present disclosure also includes a task scheduling device, applied to a client, including:
[0137] A third determination module is used to determine the task type of the task to be processed;
[0138] A fourth determination module, configured to determine a target node server for executing the task and a target resource on the target node server based on a task type of the task;
[0139] A sending module, used to send the information of the target node server and the information of the target resource to the scheduler, so that the scheduler allocates the target node server and the target resource to the task to be processed
[0140] In a fifth aspect, an optional implementation of the present disclosure further provides a computer device, a processor, and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory, and when the machine-readable instructions are executed by the processor, the machine-readable instructions execute the steps of the above-mentioned first aspect, or any possible implementation of the first aspect, or execute the above-mentioned second aspect, or any possible implementation of the second aspect.
[0141] In a sixth aspect, an optional implementation of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run, the computer program executes the steps of the above-mentioned first aspect, or any possible implementation of the first aspect, or executes the above-mentioned second aspect, or any possible implementation of the second aspect.
[0142] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0143] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0144] Figure 1 A flowchart of a task scheduling method applied to a scheduler end provided by an embodiment of the present disclosure is shown;
[0145] Figure 2 A schematic diagram of the structure of a node server provided by an embodiment of the present disclosure is shown;
[0146] Figure 3 A flowchart of a method for determining a preset topology structure provided by an embodiment of the present disclosure is shown;
[0147] Figure 4 A schematic diagram showing a topological relationship between node servers provided in an embodiment of the present disclosure;
[0148] Figure 5 A schematic diagram of a topological structure of a multi-node type task provided by an embodiment of the present disclosure is shown;
[0149] Figure 6a A schematic diagram of a preset topology structure corresponding to 8 resources provided in an embodiment of the present disclosure is shown;
[0150] Figure 6b A schematic diagram of a preset topology structure corresponding to 7 resources provided in an embodiment of the present disclosure is shown;
[0151] Figure 6c A schematic diagram of a preset topology structure corresponding to 6 resources provided in an embodiment of the present disclosure is shown;
[0152] Figure 6d A schematic diagram of a preset topology structure corresponding to 5 resources provided in an embodiment of the present disclosure is shown;
[0153] Figure 6e A schematic diagram of a preset topology structure corresponding to four resources provided in an embodiment of the present disclosure is shown;
[0154] Figure 6f A schematic diagram of a preset topology structure corresponding to three resources provided in an embodiment of the present disclosure is shown;
[0155] Figure 6g A schematic diagram of a preset topology structure corresponding to two resources provided in an embodiment of the present disclosure is shown;
[0156] Figure 7 A schematic diagram of splitting an initial node server including different idle resources provided by an embodiment of the present disclosure is shown;
[0157] Figure 8 A flowchart of a task scheduling method applied to a client provided by an embodiment of the present disclosure is shown;
[0158] Fig. 9 A schematic diagram of a task scheduling device applied to a scheduler end provided by an embodiment of the present disclosure is shown;
[0159] Fig.10 A schematic diagram of a task scheduling device applied to a client provided by an embodiment of the present disclosure is shown;
[0160] Fig.11 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0161] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure claimed for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0162] In addition, the terms "first", "second", etc. in the description and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein.
[0163] The "multiple or several" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0164] Research has found that in order to meet the different resource requirements corresponding to different deep learning tasks, the task scheduling system plays an increasingly important role. In the prior art, the task scheduling methods used in the task scheduling system are mostly based on the resource requirements of deep learning tasks, with the goal of allocating as few node servers as possible to schedule resources for each deep learning task. However, when using the resources scheduled by the above method to execute deep learning tasks, there are problems of slow execution speed and low efficiency.
[0165] Based on the above research, the present disclosure provides a task scheduling method, apparatus, computer equipment and storage medium, in which the task information can reflect the resource demand and communication volume demand information of the task to be processed, so that, based on the task information, the task type that matches the task information can be determined. The methods of determining the target node server and the target resource corresponding to tasks of different task types are different. Based on the determined task type, the resource determination method that matches the task type can be determined, and then, the target resource is allocated to the task to be processed using the determined resource determination method, which can improve the rationality of the allocated target resource, and then, the task to be processed is executed using the determined target resource, which can improve the speed and efficiency of task execution.
[0166] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.
[0167] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0168] It should be noted that the specific terms mentioned in the embodiments of the present disclosure include:
[0169] GPU: Graphics Processing Unit, also known as display core, visual processor, display chip, is a microprocessor that specializes in image and graphics related computing on personal computers, workstations, game consoles and some mobile devices (such as tablets, smart phones, etc.);
[0170] CPU: Central Processing Unit, as the computing and control core of the computer system, is the final execution unit of information processing and program running;
[0171] NIC: Network Interface Controller, also known as network interface controller, network adapter, network card, or local area network receiver, is a piece of computer hardware designed to allow computers to communicate on a computer network;
[0172] PCIe: peripheral component interconnect express, a high-speed serial computer expansion bus standard;
[0173] QPI: Quick Path Interconnect, also known as CSI (Common System Interface), is an architecture that enables direct interconnection between chips;
[0174] NVLink is a bus and communication protocol developed and launched by NVIDIA.
[0175] To facilitate understanding of this embodiment, a task scheduling method disclosed in the embodiment of the present disclosure is first introduced in detail. The executor of the task scheduling method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities. In some possible implementation methods, the task scheduling method can be implemented by a processor calling computer-readable instructions stored in a memory.
[0176] The task scheduling method provided by the embodiment of the present disclosure is described below by taking a computer device as an example of an execution subject.
[0177] like Figure 1 As shown, it is a flowchart of a task scheduling method applied to a scheduler end provided by an embodiment of the present disclosure, which may include the following steps:
[0178] S101: Obtain task information of tasks to be processed.
[0179] Here, the task to be processed may be a deep learning task, which is a task obtained by the task scheduling system based on a predefined configuration file submitted by the user on the client. The essence of the task scheduling system may be a scheduler for resource scheduling. The task scheduling system may include several node servers, each of which includes a certain number of computing resources and a certain number of CPUs, wherein the node server may be a GPU node server, the computing resources may be a GPU in a GPU node server, the CPUs may communicate using a QPI connection, the GPU and CPU in a node server may communicate using PCIe, the CPU in a node server may communicate using a NIC and the CPUs in other node servers, and all GPUs in a node server may communicate using an NVLink connection.
[0180] like Figure 2 As shown, it is a structural diagram of a node server provided by an embodiment of the present disclosure, wherein the node server may include 2 CPU servers (CPU0 and CPU1) and 8 GPUs (V100GPU0, V100GPU1, V100GPU2, V100GPU3, V100GPU4, V100GPU5, V100GPU6, V100GPU7), and PCIe Switches indicates communication using PCIe.
[0181] When the task scheduling system obtains the task, it can also obtain the task information of the task, wherein the task information is a kind of information used to characterize the resource demand and communication volume demand information of the task to be processed.
[0182] S102: Determine the task type of the task based on the task information.
[0183] Here, the task type can reflect the number of node servers, the number of GPU resources, and the communication volume required for the task. The number of node servers selected for executing tasks of different task types is different. Different tasks can have different task types. For the same task, when the number of node servers selected is different, the task type of the task is also different.
[0184] Therefore, during specific implementation, the task type of the task may be determined based on information such as resource demand and communication volume demand represented by the acquired task information.
[0185] S103: Based on the task type, determine a target node server for executing the task and target resources on the target node server.
[0186] Here, for tasks of different task types, the methods of determining the target node server and the target resource are different.
[0187] After determining the task type, the target node server and the target resource on the target node server that can be used to execute the task can be determined according to the idle resources on each node server and the task type of the task, wherein the target resource is an idle resource.
[0188] S104: Allocate the target node server and the target resources on the target node server to execute the task.
[0189] Here, after determining the target node server for executing the task and the target resource on the target node server, the task scheduling system may allocate the target node server and the target resource on the target node server to the task to execute the task.
[0190] In this way, the task information can reflect the resource demand and communication volume demand information of the task to be processed, so that the task type that matches the task information can be determined based on the task information. The methods of determining the target node server and target resources corresponding to tasks of different task types are different. Based on the determined task type, the resource determination method that matches the task type can be determined. Then, the target resources are allocated to the task to be processed using the determined resource determination method, which can improve the rationality of the allocated target resources. Then, the speed and efficiency of task execution can be improved by using the determined target resources to execute the task to be processed.
[0191] In one embodiment, the task type of a task may be determined according to the following steps:
[0192] Step 1: Determine the resource requirements and communication traffic requirements of the task based on the task information.
[0193] Here, different tasks require different numbers of idle GPUs to execute, and the resource requirement of a task can be the number of GPUs required to execute the task. The communication volume requirement information is used to characterize the ratio between the computational workload and the communication volume corresponding to the task. After a task is determined, the number of GPUs required for it will also be determined, that is, the resource requirement of the task can be determined. At the same time, after a task is determined, the corresponding communication volume requirement information will also be determined. Therefore, after a task is determined, the task information used to characterize the resource requirement and communication volume requirement information is also determined.
[0194] Furthermore, the task scheduling system can determine the resource demand and communication volume demand information of the task represented by the task information acquired.
[0195] Step 2: Determine the number of resources in the node server.
[0196] Here, the number of resources is the number of GPUs. The number of resources in the node server is equal to the number of resources in the node server.
[0197] In specific implementation, the number of GPUs included in each node server in the task scheduling system may be different. For example, the node servers in the task scheduling system may include a node server with 8 GPUs and a node server with 4 GPUs, which is not limited here.
[0198] Step 3: Determine the task type of the task based on the determined resource demand, the communication volume demand information of the task, and the number of resources in the node server.
[0199] In specific implementation, the number of node servers required to execute the task to be processed can be determined based on the resource demand and the number of resources in the node servers, that is, the number of target node servers corresponding to the task to be processed can be determined. in, Indicates rounding up.
[0200] Furthermore, the task type of the task to be processed may be determined based on the number of target node servers corresponding to the task to be processed and the determined communication volume requirement information of the task.
[0201] In one embodiment, the task types may include a single-node multi-resource communication type, a single-node multi-resource computing type, a multi-node type, and a single-resource type.
[0202] Here, based on the resource requirements of the task, the task can be divided into single-node type tasks and multi-node type tasks, among which, the single-node type task can be completed using the resources in one target node server, and the multi-node type task requires resources in at least two target node servers to be completed; for single-node tasks, based on the resource requirements of the task, it can be divided into single-node multi-resource type tasks and single-resource type tasks, among which, the single-resource type task means that the task only needs one idle resource in one target node server to be completed, and the single-node multi-resource type task requires multiple idle resources in one target node server to be completed; in addition, according to the communication volume demand information of the task, the single-node multi-resource type task can be divided into single-node multi-resource communication type tasks and single-node multi-resource computing type tasks, among which, the single-node multi-resource communication type task means that the task has a higher demand for communication volume, and the single-node multi-resource computing type task means that the task has a higher demand for computing volume.
[0203] In specific implementation, when it is determined that the number of target node servers corresponding to the task to be processed is equal to 1, the number of target resources corresponding to the task to be processed is greater than 1, and the communication volume demand information indicates that the communication volume demand of the task to be processed is higher than the computing volume demand, the task type of the task to be processed is determined to be a single-node multi-resource communication type.
[0204] When it is determined that the number of target node servers corresponding to the task to be processed is equal to 1, the number of target resources corresponding to the task to be processed is greater than 1, and the communication volume demand information indicates that the computing volume demand of the task to be processed is higher than the communication volume demand, the task type of the task to be processed is determined to be a single-node multi-resource computing type.
[0205] When it is determined that the number of target node servers corresponding to the task to be processed is greater than 1, determining that the task type of the task to be processed is a multi-node type;
[0206] When it is determined that the number of target resources corresponding to the task to be processed is equal to 1, it is determined that the task type of the task to be processed is a single resource type.
[0207] For example, the resource requirement of the task is 7, the number of resources on the node server is 8, and the ratio between the computing amount and the communication amount is greater than 1, then it can be determined that the number of target node servers required for the task is 1. Furthermore, based on the ratio greater than 1 and the number of target node servers 1, it can be determined that the task type of the task is a single-node multi-resource computing type.
[0208] In one embodiment, S103 may be implemented according to the following steps:
[0209] Based on the task type, the resource requirement of the task, and the idle resources on each node server, a target node server for executing the task and target resources on the target node server are determined.
[0210] Here, the GPU on each node server can be used independently, and the idle GPU on each node server is a GPU that is not currently in use.
[0211] In specific implementation, each node server can be divided into different idle resource linked lists according to the number of idle GPUs on each node server, wherein each idle resource linked list is composed of node servers with only one number of idle GPUs. For example, the idle resource linked list can be a 1 idle GPU linked list, a 2 idle GPU linked list, etc., wherein the 1 idle GPU linked list indicates that the node servers in the linked list are all node servers with only one idle GPU.
[0212] After determining the task type of the task, at least one initial node server matching the task type may be determined based on the task type.
[0213] Here, the initial node server may be a node server selected from the free linked list, or may be a group of multiple node servers or a single node server that can be used to execute the task to be processed. For example, if a task is a single-node multi-resource communication type task with a resource requirement of 3, then multiple node servers with a resource quantity greater than or equal to 3 may be selected from the free linked list as the initial node server, and multiple groups of node servers, wherein the resource quantity in each group of node servers is greater than or equal to 3.
[0214] Furthermore, based on the resource demand of the task and the idle resources on each initial node server, a target node server for executing the task and target resources on the target node server may be determined from at least one initial node server.
[0215] In specific implementation, based on the resource requirements of the task and the idle resources on each initial node server, a target number of target node servers can be selected from at least one initial node server, and based on the resource requirements of the task, the target resources selected on each target node server for executing the task can be determined. The target number is the number of target servers determined in the above embodiment.
[0216] For example, when the task type of the task is determined to be a multi-node type, the resource requirement is 13, and the number of resources on the node server is 8, two target node servers can be selected from the node servers in the task scheduling system, one of which is an unloaded node server, and the number of idle resources included in one target node server is 5.
[0217] In one embodiment, when the task type includes a single-node multi-resource communication type, the target node server for executing the task may be determined from at least one initial node server according to the following steps:
[0218] Step 1: Based on the amount of idle resources on each of the at least one initial node server, select an initial node server whose amount of idle resources is greater than or equal to the resource demand as the first node server;
[0219] Step 2: Determine a target node server for executing the task based on the idle resources on the first node server and the resource demand of the task.
[0220] Here, since the single-node multi-resource communication type task has a high demand for communication volume, the first node server whose number of idle resources is greater than or equal to the resource demand of the task can be screened out based on the number of idle resources on each initial node server, so that it can be ensured that there are sufficient idle resources in the first node server to meet the communication volume demand of the task. In specific implementation, the screened first node servers may include one or more.
[0221] Furthermore, a target node server for executing the task may be selected from the screened first node servers according to the resource demand.
[0222] In specific implementation, after screening out the first node server, at least one preset topology structure corresponding to the resource demand can be determined based on the resource demand of the task, wherein the preset topology structure is a more optimal topology structure between the idle resources required to execute the task. The idle resources are connected using the preset topology structure to execute the task, which can reduce the communication waiting time and increase the speed of executing the task.
[0223] In one embodiment, the following can be done: Figure 3 The method shown determines the preset topology structure corresponding to any idle resource, such as Figure 3 As shown, it is a flowchart of a method for determining a preset topology structure provided by an embodiment of the present disclosure, which may include the following steps:
[0224] S301: for any idle resources in any to-be-matched node server, determine all topological structures corresponding to any number of idle resources in the to-be-matched node server.
[0225] S302: Determine the communication waiting time of each topology structure based on the communication medium between the idle resources.
[0226] S303: Based on the communication waiting time, determine a preset topology structure corresponding to any number of idle resources in the node server to be matched.
[0227] Here, the node server to be matched includes any number of idle resources, and the node server to be matched can be any node server. The resource demand corresponds to the idle resources. Specifically, a resource demand can correspond to the idle resources in at least one node server to be matched. For example, the resource demand is 7, and the node server to be matched can be a node server with 7 idle resources, or the node server to be matched can be a group of multiple node servers with 7 idle resources, for example, a group of node servers consisting of a node server including 3 idle resources and a node server including 4 idle resources. Therefore, this method is also a method for determining a preset topology structure corresponding to any resource demand.
[0228] The communication quality between different node servers included in the task scheduling system and the GPU and CPU in the same node server is different. Common communication methods include QPI, PCIe, NIC and NVLink4 mentioned in the above embodiment, among which the communication rate of NVLink is greater than the communication rate of QPI, and the communication rate of QPI is greater than the communication rate using PCIe, NIC and network. The communication medium can be determined according to the medium corresponding to the communication method.
[0229] For any idle resource in the node server to be matched, all topological structures corresponding to the idle resource may be determined first, and then the communication waiting time of each topological structure may be determined based on the communication medium between the idle resources in the node server to be matched.
[0230] Here, when the node server to be matched is a group of node servers, all topological structures that can be formed by the idle resources in the group of node servers can be determined, and then the communication waiting time of each topological structure can be determined based on the communication medium between the node servers and the communication medium between the idle resources.
[0231] Furthermore, all topological structures may be screened according to the communication waiting time of each topological structure, and topological structures meeting preset conditions may be screened out as preset topological structures.
[0232] In specific implementation, the communication waiting time corresponding to each number of idle resources under different topological structures can be determined by a priori method, wherein one number of idle resources can correspond to multiple topological structures, such as Figure 4 As shown, it is a schematic diagram of the topological relationship between node servers provided by an embodiment of the present disclosure, wherein NVLINK / NVSWITCH is used for communication between GPUs, and Network and NIC are used for communication between different node servers.
[0233] For each topology, GPUs with this topology are used to execute tasks with resource requirements corresponding to the number of idle resources based on the ring allreduce model. In the process of executing tasks based on the ring allreduce model, each GPU is required to communicate in turn. Therefore, the total communication waiting time will be limited by the minimum communication bandwidth between GPUs in the topology.
[0234] In specific implementation, the waiting time for allreduce communication within a single node server can be determined according to Formula 1:
[0235]
[0236] Where T represents the communication waiting time, n represents the number of GPUs required, α represents the constant delay for establishing communication, s represents the size of the ring allreduce model (i.e., the communication scale), BW represents the set of communication bandwidths between GPUs under the topology, and min(BW) represents the minimum communication bandwidth between GPUs in the topology.
[0237] In one embodiment, in the case where the task corresponding to the idle resources is a multi-node type task, the communication waiting time of an allreduce required to execute the task may include the allreduce communication waiting time within a single node server and the allreduce communication waiting time between node servers, wherein the allreduce communication waiting time within a single node server may include a reduce operation within the node server and a broadcast operation within the node server.
[0238] like Figure 5 FIG. 1 is a schematic diagram of a topological structure of a multi-node type task provided by an embodiment of the present disclosure, wherein bw0 represents the communication bandwidth between GPUs, and bw1 represents the minimum communication bandwidth between different node servers. Figure 5 The four dark-colored GPUs shown in the lower right corner may represent GPUs being used.
[0239] In specific implementation, the communication waiting time of a reduce operation in a node server and a broadcast operation in a node server can be determined according to Formula 2:
[0240]
[0241] The waiting time for allreduce communication between node servers can be determined according to formula 3:
[0242]
[0243] Here, m represents the number of node servers used.
[0244] In addition, for the ring allreduce model, when using the node server and the GPU in the node server to execute tasks, a two-layer communication method is usually adopted. Therefore, the communication waiting time of a two-layer allreduce required to execute the task can be determined as shown in Formula 4:
[0245] max i 2T(n i , s, bw0)+T(m, s, bw1) Formula 4
[0246] Among them, max i 2T(n i , s, bw0) represents the communication waiting time of the node with the highest communication time under multiple node servers when executing multi-node type tasks.
[0247] Furthermore, according to the above formulas 1 to 4, the task j corresponding to any number of idle resources as shown in formula 5 can be determined: i The communication waiting time c i :
[0248] c i =max j T(N ij , S i ,bw0)+F(M i )×(max j T(N ij , S i ,bw0)+T(M i , S i , min j BW ij )) Formula 5
[0249] Among them, N ij Represents task j i The number of GPUs required on the j-th node server, M j Indicates execution of task j i The number of node servers required, F, can be calculated based on M i Determined function, if M i >=2,F(M i )=1, if M i For other values, F(M i )=0,BW jj Represents task j i The communication bandwidth between the jth node server and other node servers, min j BW ij Represents task j i The minimum communication bandwidth between the jth node server and other node servers, bw0 represents the ... i The communication bandwidth within the j-th node server, S i Represents task j i The ratio between the communication amount and the computation amount.
[0250] For task j i , a total of ∑ j N ij GPUs, executing task j i Each GPU costs ci The communication waiting time of the task corresponding to the resource demand under the topology can be determined, and then the total communication waiting time under all topological relationships corresponding to each resource demand can be determined. Then, in order to meet the demand for improving the speed of executing tasks, the preset topology can be selected according to Formula 6:
[0251] min∑ i ∑ j (N ij c i ) Formula 6
[0252] Among them, min∑ i ∑ j (N ij c i ) indicates that the topology with the shortest communication waiting time is selected as the preset topology.
[0253] In one embodiment, based on Formula 5, the total communication waiting time of all topological relationships under each number of idle resources can be determined, and then the total communication waiting time of each topological relationship can be sorted from low to high, and then, using the preset order, the topological structure with a sorting order less than the preset order is used as the preset topological structure corresponding to the number of idle resources, that is, as the preset topological structure corresponding to the node server to be matched. Among them, the preset order can be set according to actual needs and is not limited here.
[0254] In this way, by screening the topology structure in a preset order, the communication waiting time corresponding to the preset topology structure can not only meet the time requirement of executing the task with the resource demand corresponding to the idle resources, but also achieve the purpose of minimizing the time of executing the task with the resource demand.
[0255] In another embodiment, after determining the communication waiting time of all topological relationships under each resource demand based on Formula 5, the topological structure with a communication waiting time less than a preset waiting threshold can be used as the preset topological structure corresponding to the resource demand, that is, it can be used as the preset topological structure corresponding to the node server to be matched. In this way, using the preset topological structure to perform tasks can reasonably reduce the communication waiting time required to perform tasks, wherein the preset waiting threshold can be set according to actual needs and is not limited here.
[0256] In addition, since NVLink has the highest communication rate, the communication method between resources in the optimal topology should all be NVLink.
[0257] In specific implementation, when the number of resources on the node server is 8, the following preset topological structures of tasks under different resource requirements can be determined, wherein the preset topological structures of tasks under different resource requirements refer to the preset topological structures corresponding to different resource requirements on a single node server, such as Figure 6a As shown, it is a schematic diagram of the preset topological structure corresponding to 8 resources provided in the embodiment of the present disclosure, such as Figure 6b As shown, it is a schematic diagram of the preset topological structure corresponding to the 7 resources provided in the embodiment of the present disclosure, such as Figure 6c As shown, it is a schematic diagram of the preset topological structure corresponding to the 6 resources provided in the embodiment of the present disclosure, such as Figure 6d As shown, it is a schematic diagram of the preset topological structure corresponding to the 5 resources provided in the embodiment of the present disclosure, such as Figure 6e As shown, it is a schematic diagram of the preset topological structure corresponding to the four resources provided in the embodiment of the present disclosure, such as Figure 6f As shown, it is a schematic diagram of the preset topological structure corresponding to the three resources provided in the embodiment of the present disclosure, such as Figure 6g As shown, it is a schematic diagram of the preset topological structure corresponding to the 2 resources provided in the embodiment of the present disclosure.
[0258] Furthermore, after determining at least one preset topology structure and a first node server corresponding to the resource demand based on the above method, a first node server having any preset topology structure can be screened out from the first node servers. In this way, the communication waiting time can be reduced by using the screened out first node server having any preset topology structure to perform the task. Furthermore, the first node server with the least number of idle resources is selected as the target node server from the screened out first node servers having any preset topology structure. In this way, using the first node server with the least number of idle resources as the target node server can reduce the splitting of the original topology structure of the first node server having any preset topology structure and a large number of idle resources, thereby realizing the protection of the optimal topology structure and its reasonable application to other tasks such as single-node multi-resource communication type.
[0259] In specific implementation, during the process of screening the target node server, if there is a first node server whose idle resource quantity is equal to the resource demand quantity and has any preset topology structure, the first node server can be directly used as the target node server.
[0260] If there is only a first node server with a number of idle resources greater than the resource demand and with any preset topology structure, the first node server with the smallest number of idle resources is selected as the target node server, and then the idle resources in the target node server are split to split the resources with the preset topology structure for executing the task, such as Figure 7FIG. 1 is a schematic diagram of a splitting of an initial node server including different idle resources provided by an embodiment of the present disclosure, wherein Slot may represent an initial node server, and is composed of Figure 7 It can be seen that when the number of resources included in an initial node server is 8, the optimal topology structure obtained by splitting 6 idle resources can only be 4 idle resources plus 2 idle resources mode, and the optimal topology structure obtained by splitting 5 idle resources can only be 3 idle resources plus 2 idle resources mode. Job can represent tasks, 8GPUjobs can represent tasks that require 8 idle GPUs to complete, and Empty 7GPU Slot represents a node server with 7 idle GPUs.
[0261] Here, if the screened first node servers having any preset topology structure and the smallest number of idle resources include multiple ones, any first node server can be randomly selected as the target node server.
[0262] In addition, after determining the target node server, the preset topology structure of the target node server can be used as the target topology structure, and then the idle resources constituting the target topology structure in the target node server can be used as the target resources. In specific implementation, when it is determined that the number of idle resources in the target node server is equal to the resource demand, all of the idle resources therein can be used as the target resources; when it is determined that the number of idle resources in the target node server is greater than the resource demand and the number of idle resources is the smallest, the split resources with the target topology structure can be used as the target resources for executing the task.
[0263] In another embodiment, if a first node server that can meet the resource requirement cannot be screened out, the task needs to be suspended until it is determined that there is a first node server that meets the resource requirement and has at least one preset topology structure, and then the task is executed.
[0264] In one embodiment, when the task type includes a single-node multi-resource computing type, the target node server for executing the task may be determined from at least one initial node server according to the following steps:
[0265] Step 1: based on the amount of idle resources on each of the at least one initial node server, select a second node server whose amount of idle resources is less than or equal to the resource demand amount;
[0266] Step 2: Determine the target node server for executing the task based on the idle resources on the second node server and the resource demand of the task.
[0267] Here, since the single-node multi-resource communication type task has a higher demand for computing than for communication, the second node server whose number of idle resources is less than or equal to the resource demand can be screened out based on the number of idle resources on each of the at least one initial node server. Then, at least one preset topology structure corresponding to the resource demand can be determined, and a second node server with any preset topology structure can be screened out in the second node server. If so, the second node server is used as the target node server, and the idle resources in the target node server are used as the target resources. Here, since the number of idle resources of the screened second node server is less than or equal to the resource demand, the number of idle resources included in the screened second node server with any preset topology structure must be equal to the resource demand.
[0268] If a second node server with any preset topology structure is not screened out from the second node servers, wait for the task to be executed, and then re-acquire the idle resources on each node server after a preset period of time, and then re-screen the second node servers whose number of idle resources is less than or equal to the resource demand, until a target node server capable of executing the task can be screened out from the second node servers, and then allocate resources for the task.
[0269] Alternatively, in a specific implementation, in a task scheduling system, there are a large number of tasks of a single resource type, so the resources in the node server are often used separately, and the execution speed of tasks of a single resource type is faster, so there will often be a single resource that has just been released in the node server. Therefore, when it is determined that the number of idle resources on at least one node server has changed, it can be determined whether the idle resources already on the node server and the single resource that has just been released can form any preset topology structure corresponding to the resource demand. If so, the node server is used as the target node server, and the resources in the target node server are used as target resources, and then the target resources in the target node server can be allocated to the task.
[0270] In one embodiment, when the task type includes a multi-node type, multiple node servers need to be selected to execute the task of the task type. In addition, according to Formula 1 to Formula 6, it can be concluded that for a multi-node type task, the maximum number of unloaded third node servers can be allocated to it from the initial node server according to its corresponding resource demand and the maximum number of idle resources included in the node server (i.e., the number of resources included in the node server), and the unloaded third node server is used as the target server. For example, if the resource demand is 35 and the number of resources included in the node server is 8, 4 unloaded third node servers are allocated to it first.
[0271] Furthermore, when the total amount of resources included in the maximum number of third-node servers is less than the resource demand, it means that the task cannot be completed by using only the maximum number of third-node servers, and some idle resources on an initial node server are required to perform the task. Therefore, it is necessary to first determine the difference between the total amount of resources and the resource demand, where the difference is the number of idle resources included in an additional initial node server that needs to be used.
[0272] After determining the difference, a target node server can be selected for the multi-node type task according to the method of allocating resources for a single-node multi-resource computing type task. In specific implementation, a fourth node server whose number of idle resources is less than or equal to the difference can be selected based on the number of idle resources on each initial node server, and then a target node server can be selected from the fourth node server based on the method of determining the target node server for a single-node multi-resource computing type task in the above embodiment, and then the selected unloaded target node server can be allocated together with the target node server to the multi-node type task.
[0273] In addition, if there are not enough unloaded node servers when selecting unloaded target node servers for multi-node type tasks, the task will wait until there are enough unloaded node servers, and then node servers and resources will be allocated to them.
[0274] In one embodiment, when the task type includes a single resource type, the resource requirement of the task of this task type is 1, and only a single resource is needed to complete it. Therefore, based on the number of idle resources on each initial node server, the initial node server whose number of idle resources is equal to the resource requirement can be directly selected as the target node server. If there are multiple initial node servers whose number of idle resources is equal to the resource requirement, any initial node server can be randomly selected as the target server.
[0275] In addition, if there is no initial node server whose number of idle resources is equal to the resource demand, the task will be executed in a waiting manner until there is a node server whose number of idle resources is equal to the resource demand, and then resources will be allocated to it and executed.
[0276] In one embodiment, with respect to S102, the task type of the task may also be determined according to the following steps:
[0277] Step 1: Get the free resources on each node server.
[0278] Here, after obtaining the task information of the task to be processed, the idle resources on each node server may be obtained at the same time.
[0279] Step 2: According to the task information, determine the resource requirement and communication volume requirement information of the task.
[0280] The specific implementation process of this step can refer to the step of determining the resource demand and communication volume demand information in the above embodiment, which will not be repeated here.
[0281] Step 3: Based on the idle resources on each node server, the resource requirements of the task, and the communication volume requirements of the task, determine the target node server for executing the task and the target resources on the target node server.
[0282] Here, the task scheduling system can directly determine the target node server and target resource that can meet the resource demand and the communication demand corresponding to the communication demand information based on the resource demand required by the task to be processed and the idle resources and communication demand information on each node server. The target resource in the target node server has an optimal preset topology structure.
[0283] Step 4: Determine the task type of the task based on the target node server for executing the task and the target resources on the target node server.
[0284] Here, the task type of the task may be determined based on the number of determined target node servers, the number of target resources on the target node servers, and the communication volume requirement information.
[0285] In this way, the target node server and target resource are determined while determining the task type. Then, the target node server and target resource corresponding to the task type can be directly allocated to the task to be processed, which omits the time of selecting the initial node server, improves the speed and efficiency of resource scheduling, and thus improves the speed and efficiency of task execution.
[0286] In another implementation, the user may also directly mark the task type of the task to be processed in the submitted configuration file, and then the task scheduling system may directly determine the task type of the task from the acquired configuration file and use it as the acquired task information of the task.
[0287] In one embodiment, tasks of different task types have different resource allocation priorities. When the acquired tasks to be processed include multiple tasks, the task type of each task can be determined first, and then the resource allocation priority of each task can be determined based on the task type of each task.
[0288] Furthermore, based on the resource allocation priority of each task, the target node server for executing the task and the target resources on the target node server can be determined, thereby realizing reasonable allocation of resources for each task.
[0289] During specific implementation, the resource allocation priority of single-node multi-resource communication type tasks can be set to the first priority; the resource allocation priority of single-node multi-resource computing type tasks can be set to the second priority; the resource allocation priority of multi-node type tasks can be set to the third priority; and the resource allocation priority of single-resource type tasks can be set to the fourth priority.
[0290] In this way, the single-node multi-resource communication type task has a higher demand for communication volume. Setting the task of this task type to the first priority can meet the required communication volume and improve the execution speed of tasks of this task type. The single-node multi-resource computing type task has a higher demand for computing volume and a lower demand for communication volume. Setting the task of this task type to the second priority can meet the required computing volume and avoid the splitting of the original topological structure of idle resources in the node server with a large number of idle resources. Multi-node type tasks require unloaded node servers and there are relatively few tasks of this task type. Setting it to the third priority can ensure timely allocation of resources for single-node multi-resource communication type tasks and single-node multi-resource computing type tasks. Single-resource type tasks only need one resource to be executed, so setting it to the fourth priority can ensure that on the basis of timely allocation of resources for single-node multi-resource communication type tasks and single-node multi-resource computing type tasks, the execution speed of tasks of this task type is not affected.
[0291] In one embodiment, the task information may include resource requirements, and thus the resource requirements may be obtained by following the steps below:
[0292] Step 1: Get the configuration file of the task to be processed.
[0293] Step 2: Get the resource requirements of the tasks to be processed from the configuration file.
[0294] In specific implementation, when the user submits a predefined configuration file related to the task to be processed on the client, the resource requirement information of the task to be processed can be directly determined in the configuration file. Furthermore, the task scheduling system can directly obtain the resource requirement of the task to be processed from the obtained configuration file and use it as the obtained task information of the task.
[0295] In this way, the resource requirements can be obtained without parsing the configuration file, which improves the speed of determining the resource requirements.
[0296] In one embodiment, the task information may include communication volume demand information. Therefore, the communication volume demand information may be obtained according to the following steps:
[0297] Step 1: Obtain the computing amount information and communication amount information of the task to be processed.
[0298] In specific implementation, the computing amount information and communication volume information of the task to be processed can be determined based on the analysis of the configuration file of the task to be processed, or based on the analysis of the task request to be processed; wherein the task request includes the computing amount information and the communication volume information, and the task request can be a request submitted by the user on the client to allocate resources for the task.
[0299] Step 2: Based on the computing volume information and the communication volume information, determine the communication volume demand information.
[0300] Here, the ratio between the calculation amount corresponding to the calculation amount information and the calculation amount corresponding to the communication amount information may be determined, and based on the determined ratio, the communication amount requirement information may be determined.
[0301] In another embodiment, when the task information may include communication volume demand information, the communication volume demand information may also be acquired according to the following steps:
[0302] Step 1: Get the configuration file of the task to be processed;
[0303] Step 2: Obtain the communication volume requirement information of the task to be processed from the configuration file.
[0304] Here, the configuration file submitted by the user may directly include the communication volume requirement information of the task to be processed. Furthermore, the task scheduling system may directly obtain the communication volume requirement information of the task to be processed from the obtained configuration file and use it as the obtained task information of the task.
[0305] In this way, there is no need to parse the configuration file to obtain the traffic demand information, the step of calculating the information is omitted, and the speed of determining the traffic demand information is improved.
[0306] In addition, the present disclosure provides a task scheduling method applied to a client. Figure 8 As shown, it is a flowchart of a task scheduling method applied to a client provided by an embodiment of the present disclosure, which may include the following steps:
[0307] S801: Determine the task type of the task to be processed.
[0308] Here, after the user submits a predefined configuration file related to the task to be processed on the client, the client can directly determine the task type of the task based on the configuration file.
[0309] S802: Determine a target node server for executing the task and target resources on the target node server based on the task type of the task.
[0310] Here, for tasks of different task types, the methods of determining the target node server and the target resource are different.
[0311] After determining the task type of the task, the client can determine the target node server and the target resource on the target node server that can be used to execute the task according to the idle resources on each node server and the task type of the task, wherein the target resource is an idle resource.
[0312] Regarding the specific implementation process of S802, you can refer to the task scheduling method applied to the scheduler side, and the steps of determining the target node server and target resources based on the task type, except that the execution subject is changed from the scheduler to the client corresponding to the scheduler. Therefore, it will not be repeated here.
[0313] S803: Send the information of the target node server and the information of the target resource to the scheduler, so that the scheduler allocates the target node server and the target resource to the task to be processed.
[0314] Here, the client can directly send the determined target node server information and target resource information to the scheduler, that is, to the task scheduling system. Afterwards, the scheduler can directly determine the target node server and the target resource on the target node server for executing the task to be processed based on the target node server information and the target resource information, and then, the target node server and the target resource can be allocated to the task to be processed.
[0315] In this way, the client first determines the target node server and target resource based on the determined task type, and then sends them to the scheduler. The scheduler omits the step of determining the target node server and target resource, and can directly assign the target node server and target resource to the task, thereby improving the speed of resource scheduling and the execution speed and efficiency of tasks.
[0316] In one embodiment, for S801, the task type may be determined according to the following steps:
[0317] Step 1: Determine the resource requirement of the task, the communication volume requirement information of the task, and the number of resources in the node server.
[0318] Here, the client can determine the resource requirement and communication volume requirement information of the task based on the analysis of the configuration file.
[0319] Alternatively, the resource requirement and communication volume requirement information of the task may be directly obtained from the configuration file, which is not limited here.
[0320] In addition, the client can determine the number of resources in the node server in the task scheduling system. Here, the number of resources is the number of GPUs.
[0321] Step 2: Determine the task type of the task based on the determined resource demand, the communication volume demand information of the task, and the number of resources in the node server.
[0322] In specific implementation, the number of node servers required to execute the task to be processed can be determined based on the resource demand and the number of resources in the node servers, that is, the number of target node servers corresponding to the task to be processed can be determined. in, Indicates rounding up.
[0323] Furthermore, the task type of the task to be processed may be determined based on the number of target node servers corresponding to the task to be processed and the determined communication volume requirement information of the task.
[0324] In another embodiment, with respect to S801, the task type may also be determined according to the following steps:
[0325] Step 1: Get the free resources on each node server.
[0326] Here, after obtaining the configuration file submitted by the user, the client can simultaneously obtain the idle resources on each node server.
[0327] Step 2: Based on the idle resources on each node server, the resource requirements of the task, and the communication volume requirement information of the task, determine at least one target node server for executing the task and the target resources on the target node server.
[0328] Here, the client can directly determine the target node server and target resource that can meet the resource demand and the communication demand corresponding to the communication demand information based on the resource demand required by the task to be processed and the idle resources and communication demand information on each node server. The target resource in the target node server has the optimal preset topology structure.
[0329] Step three: determine the task type of the task based on at least one target node server and the target resources on the target node server.
[0330] Here, the task type of the task may be determined based on the number of determined target node servers, the number of target resources on the target node servers, and the communication volume requirement information.
[0331] During the specific implementation, regarding the specific implementation process of the steps for determining the task type mentioned in the above embodiment, reference can be made to the steps for determining the task type in the task scheduling method applied to the scheduler side, except that the execution subject is changed from the scheduler to the client corresponding to the scheduler. Therefore, it will not be repeated here.
[0332] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0333] Based on the same inventive concept, the embodiment of the present disclosure also provides a task scheduling device corresponding to the task scheduling method applied on the scheduler side. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned task scheduling method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0334] like Fig. 9 FIG. 1 is a schematic diagram of a task scheduling device applied to a scheduler end provided by an embodiment of the present disclosure, including:
[0335] An acquisition module 901 is used to acquire task information of a task to be processed;
[0336] A first determining module 902, configured to determine a task type of the task based on the task information;
[0337] A second determination module 903 is used to determine a target node server for executing the task and a target resource on the target node server based on the task type;
[0338] The allocation module 904 is used to allocate the target node server and the target resources on the target node server to execute the task.
[0339] In a possible implementation manner, the first determining module 902 is used to determine the resource requirement of the task and the communication volume requirement information of the task according to the task information;
[0340] Determine the number of resources in the node server;
[0341] The task type of the task is determined based on the determined resource requirement, the communication volume requirement information of the task, and the number of resources in the node server.
[0342] In a possible implementation, the second determination module 903 is used to determine a target node server for executing the task and target resources on the target node server based on the task type of the task, the resource requirement of the task, and the idle resources on each node server.
[0343] In a possible implementation manner, the second determination module 903 is configured to determine, based on the task type of the task, at least one initial node server matching the task type;
[0344] Based on the resource demand of the task and the idle resources on each initial node server, a target node server for executing the task and target resources on the target node server are determined from the at least one initial node server.
[0345] In one possible implementation, the task type includes a single-node multi-resource communication type;
[0346] The second determining module 903 is used to select an initial node server whose number of idle resources is greater than or equal to the resource demand as the first node server based on the number of idle resources on each initial node server in the at least one initial node server;
[0347] Based on the idle resources on the first node server and the resource requirement of the task, a target node server for executing the task is determined.
[0348] In a possible implementation manner, the second determining module 903 is used to determine at least one preset topology structure corresponding to the resource demand;
[0349] A first node server having any of the preset topological structures and the least number of idle resources is selected from the first node servers as the target node server.
[0350] In a possible implementation manner, the second determining module 903 is configured to use a preset topology structure in the target node server as a target topology structure;
[0351] The idle resources constituting the target topology structure in the target node server are used as the target resources.
[0352] In a possible implementation, the task type includes a single-node multi-resource computing type;
[0353] The second determining module 903 is used to screen a second node server whose number of idle resources is less than or equal to the resource demand based on the number of idle resources on each initial node server of the at least one initial node server;
[0354] Based on the idle resources on the second node server and the resource requirement of the task, a target node server for executing the task is determined.
[0355] In a possible implementation manner, the second determining module 903 is used to determine at least one preset topology structure corresponding to the resource demand;
[0356] A second server having any of the preset topological structures is selected from the second node servers as the target node server.
[0357] In a possible implementation, the second determination module 903 is further used to, when no second node server having any of the preset topology structures is screened out from the second node servers, re-acquire the number of idle resources on each node server after a preset period of time or when the idle resources on at least one node server change, and return to the step of screening second node servers whose number of idle resources is less than or equal to the resource demand based on the number of idle resources on each initial node server in the at least one initial node server.
[0358] In a possible implementation, the task type includes a multi-node type;
[0359] The second determination module 903 is used to determine the maximum number of third node servers required to perform the task from the at least one initial node server based on the resource demand of the task; wherein the third node server is an unloaded initial node server;
[0360] The third node servers with the largest number are used as the target node servers.
[0361] In a possible implementation manner, the second determining module 903 is further configured to determine a difference between the total amount of resources and the resource requirement when the total amount of resources on the third node servers with the largest number is less than the resource requirement;
[0362] Based on the number of idle resources on each initial node server, screening a fourth node server whose number of idle resources is less than or equal to the difference;
[0363] Based on the idle resources on the fourth node server and the difference, a target node server for executing the task is determined.
[0364] In a possible implementation, the task type includes a single resource type;
[0365] The second determining module 903 is configured to select an initial node server having the same number of idle resources as the resource demand as the target node server based on the number of idle resources on each initial node server in the at least one initial node server.
[0366] In a possible implementation manner, the second determining module 903 is further configured to determine a preset topology structure according to the following steps:
[0367] For any idle resources in any to-be-matched node server, determine all topological structures corresponding to any number of idle resources in the to-be-matched node server;
[0368] Determining the communication waiting time of each of the topological structures based on the communication medium between the idle resources;
[0369] Based on the communication waiting time, a preset topology structure corresponding to any number of idle resources in the to-be-matched node server is determined.
[0370] In a possible implementation manner, the second determining module 903 is configured to sort the topological structures in order of the communication waiting time from low to high;
[0371] The topological structure with a sorting order smaller than the preset order is used as the preset topological structure corresponding to the node server to be matched.
[0372] In a possible implementation, the second determination module 903 is used to use, for any number of idle resources, a topology structure whose communication waiting time is less than a preset waiting threshold as a preset topology structure corresponding to the number of idle resources in the node server to be matched.
[0373] In a possible implementation manner, the first determining module 902 is used to obtain idle resources on each node server;
[0374] Determine the resource requirement of the task and the communication volume requirement information of the task according to the task information;
[0375] Determine the target node server for executing the task and the target resources on the target node server based on the idle resources on each of the node servers, the resource requirements of the task, and the communication volume requirement information of the task;
[0376] The task type of the task is determined based on a target node server that executes the task and a target resource on the target node server.
[0377] In a possible implementation manner, the second determining module 903 is further configured to determine the resource allocation priority of each task based on the task type of each task when the acquired tasks to be processed include multiple tasks;
[0378] Based on the resource allocation priority of each of the tasks, a target node server for executing the task and target resources on the target node server are determined.
[0379] In a possible implementation, the task types include single-node multi-resource communication type, single-node multi-resource computing type, multi-node type, and single-resource type;
[0380] The second determining module 903 is used to set the resource allocation priority of the task of the single-node multi-resource communication type to the first priority;
[0381] Setting the resource allocation priority of the task of the single-node multi-resource computing type to the second priority;
[0382] Setting the resource allocation priority of the multi-node type task to a third priority;
[0383] The resource allocation priority of the task of the single resource type is set to the fourth priority.
[0384] In a possible implementation manner, the task information includes the resource requirement, and the first determining module 902 is further configured to obtain the resource requirement according to the following steps:
[0385] Obtaining a configuration file for the task to be processed;
[0386] The resource requirement of the task to be processed is obtained from the configuration file.
[0387] In a possible implementation manner, the task information includes the communication volume demand information, and the first determining module 902 is further configured to obtain the communication volume demand information according to the following steps:
[0388] Obtaining the computing amount information and communication amount information of the task to be processed;
[0389] Based on the computing amount information and the communication amount information, the communication amount requirement information is determined.
[0390] In a possible implementation, the first determination module 902 is used to determine the computing amount information and communication amount information of the task to be processed based on an acquired configuration file of the task to be processed or an acquired task request to be processed; wherein the task request includes the computing amount information and communication amount information.
[0391] In a possible implementation manner, the task information includes the communication volume demand information, and the first determining module 902 is further configured to obtain the communication volume demand information according to the following steps:
[0392] Obtaining a configuration file for the task to be processed;
[0393] The communication volume requirement information of the task to be processed is obtained from the configuration file.
[0394] In a possible implementation manner, the first determining module 902 is used to determine the number of target node servers corresponding to the task to be processed based on the resource demand and the number of resources in the node server;
[0395] Based on the number of target node servers corresponding to the task to be processed and the communication volume demand information, the task type of the task to be processed is determined.
[0396] In a possible implementation, the task types include single-node multi-resource communication type, single-node multi-resource computing type, multi-node type, and single-resource type;
[0397] The first determination module 902 is used to determine that the task type of the task to be processed is a single-node multi-resource communication type when the number of target node servers corresponding to the task to be processed is equal to 1, the number of target resources corresponding to the task to be processed is greater than 1, and the communication volume demand information indicates that the communication volume demand of the task to be processed is higher than the computing volume demand;
[0398] When the number of target node servers corresponding to the task to be processed is equal to 1, the number of target resources corresponding to the task to be processed is greater than 1, and the communication volume demand information indicates that the computing volume demand of the task to be processed is higher than the communication volume demand, determining that the task type of the task to be processed is a single-node multi-resource computing type;
[0399] When the number of target node servers corresponding to the task to be processed is greater than 1, determining that the task type of the task to be processed is a multi-node type;
[0400] When the number of target resources corresponding to the task to be processed is equal to 1, it is determined that the task type of the task to be processed is a single resource type.
[0401] Based on the same inventive concept, the embodiment of the present disclosure also provides a task scheduling device corresponding to the task scheduling method applied to the client. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned task scheduling method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0402] like Fig.10 FIG. 1 is a schematic diagram of a task scheduling device applied to a client provided by an embodiment of the present disclosure, including:
[0403] The third determining module 1001 is used to determine the task type of the task to be processed;
[0404] A fourth determining module 1002 is used to determine a target node server for executing the task and a target resource on the target node server based on the task type of the task;
[0405] The sending module 1003 is used to send the information of the target node server and the information of the target resource to the scheduler, so that the scheduler allocates the target node server and the target resource to the task to be processed.
[0406] In a possible implementation manner, the third determination module 1001 is used to determine the resource requirement of the task, the communication volume requirement information of the task, and the number of resources in the node server;
[0407] The task type of the task is determined based on the determined resource requirement, the communication volume requirement information of the task, and the number of resources in the node server.
[0408] In a possible implementation manner, the third determining module 1001 is used to obtain idle resources on each node server;
[0409] Based on the idle resources on each of the node servers, the resource requirements of the task, and the communication volume requirement information of the task, determining at least one target node server for executing the task and the target resources on the target node server;
[0410] A task type of the task is determined based on the at least one target node server and a target resource on the target node server.
[0411] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0412] The present disclosure also provides a computer device, such as Fig.11FIG. 1 is a schematic diagram of a computer device structure provided by an embodiment of the present disclosure, including:
[0413] Processor 1101 and memory 1102; the memory 1102 stores machine-readable instructions executable by the processor 1101, and the processor 1101 is used to execute the machine-readable instructions stored in the memory 1102. When the machine-readable instructions are executed by the processor 1101, the processor 1101 performs the following steps: S101: Obtain task information of the task to be processed; S102: Based on the task information, determine the task type of the task; S103: Based on the task type, determine the target node server for executing the task and the target resources on the target node server; and S104: Allocate the target node server and the target resources on the target node server to execute the task.
[0414] The above-mentioned memory 1102 includes internal memory 1121 and external memory 1122; the memory 1121 here is also called internal memory, which is used to temporarily store the calculation data in the processor 1101, as well as the data exchanged with the external memory 1122 such as the hard disk. The processor 1101 exchanges data with the external memory 1122 through the internal memory 1121.
[0415] The specific execution process of the above instructions can refer to the steps of the task scheduling method described in the embodiment of the present disclosure, which will not be repeated here.
[0416] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the task scheduling method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0417] The computer program product of the task scheduling method provided in the embodiment of the present disclosure includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the steps of the task scheduling method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0418] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.
[0419] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described device can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0420] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0421] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0422] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0423] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A task scheduling method, characterized in that: Applied to the scheduler side, including: Get the task information of the tasks to be processed; Based on the task information, determine the task type of the task; the task type is used to characterize the number of node servers, the number of graphics processor resources and the communication volume demand information required for the task; the communication volume demand information is used to characterize the ratio between the computing volume and the communication volume corresponding to the task; the task type includes at least one of a single-node multi-resource communication type, a single-node multi-resource computing type, a multi-node type and a single-resource type; Based on the task type, determine the target node server for executing the task and the target resources on the target node server; wherein different task types correspond to different resource determination methods; the resource determination method corresponding to the single-node multi-resource communication type is aimed at the number of idle resources in the screened target node server being greater than or equal to the resource demand; the resource determination method corresponding to the single-node multi-resource computing type is aimed at the number of idle resources in the screened target node server being less than or equal to the resource demand; the resource determination method corresponding to the multi-node type is aimed at screening unloaded target node servers; the resource determination method corresponding to the single resource type is aimed at the number of idle resources in the screened target node server being equal to the resource demand; the number of node servers required for the task is used to indicate the number of target node servers required to be screened; the number of graphics processor resources is used to indicate the minimum number of target resources required to be included in the screened target node server; the communication volume demand information is used to indicate the relationship between the number of target resources in the screened target node servers and the resource demand; The target node server and the target resources on the target node server are allocated to execute the task.
2. The method according to claim 1, characterized in that The determining the task type of the task based on the task information includes: Determine the resource requirement of the task and the communication volume requirement information of the task according to the task information; Determine the number of resources in the node server; The task type of the task is determined based on the determined resource requirement, the communication volume requirement information of the task, and the number of resources in the node server.
3. The method according to claim 1, characterized in that The determining, based on the task type, a target node server for executing the task and a target resource on the target node server includes: Based on the task type of the task, the resource requirement of the task and the idle resources on each node server, a target node server for executing the task and target resources on the target node server are determined.
4. The method according to claim 3, characterized in that The determining, based on the task type of the task, the resource requirement of the task, and the idle resources on each node server, a target node server for executing the task and a target resource on the target node server comprises: Based on the task type of the task, determining at least one initial node server matching the task type; Based on the resource demand of the task and the idle resources on each initial node server, a target node server for executing the task and target resources on the target node server are determined from the at least one initial node server.
5. The method according to claim 4, characterized in that The task types include single-node multi-resource communication types; The step of determining a target node server for executing the task from the at least one initial node server comprises: Based on the amount of idle resources on each of the at least one initial node server, screening an initial node server whose amount of idle resources is greater than or equal to the resource demand as a first node server; Based on the idle resources on the first node server and the resource requirement of the task, a target node server for executing the task is determined.
6. The method according to claim 5, characterized in that The determining, based on the idle resources on the first node server and the resource requirement of the task, a target node server for executing the task comprises: Determining at least one preset topology structure corresponding to the resource demand; A first node server having any of the preset topological structures and the least number of idle resources is selected from the first node servers as the target node server.
7. The method according to claim 6, characterized in that Determining the target resource on the target node server includes: Using the preset topology structure in the target node server as the target topology structure; The idle resources constituting the target topology structure in the target node server are used as the target resources.
8. The method according to claim 4, characterized in that The task type includes a single-node multi-resource computing type; The step of determining a target node server for executing the task from the at least one initial node server comprises: Based on the amount of idle resources on each of the at least one initial node server, screening a second node server whose amount of idle resources is less than or equal to the resource demand; Based on the idle resources on the second node server and the resource requirement of the task, a target node server for executing the task is determined.
9. The method according to claim 8, characterized in that The determining, based on the idle resources on the second node server and the resource requirement of the task, a target node server for executing the task comprises: Determining at least one preset topology structure corresponding to the resource demand; A second server having any of the preset topological structures is selected from the second node servers as the target node server.
10. The method according to claim 9, characterized in that The determining of a target node server for executing the task based on the idle resources on the second node server and the resource requirement of the task further includes: In the case that no second node server having any of the preset topology structures is screened out from the second node servers, after a preset period of time or a change in the idle resources on at least one node server, the number of idle resources on each node server is re-acquired, and the step of screening second node servers whose number of idle resources is less than or equal to the resource demand is returned based on the number of idle resources on each initial node server in the at least one initial node server.
11. The method according to claim 4, characterized in that The task type includes a multi-node type; The step of determining a target node server for executing the task from the at least one initial node server comprises: Based on the resource demand of the task, determining the maximum number of third node servers required to perform the task from the at least one initial node server; wherein the third node server is an unloaded initial node server; The third node servers with the largest number are used as the target node servers.
12. The method according to claim 11, characterized in that The step of determining a target node server for executing the task from the at least one initial node server further comprises: When the total amount of resources on the third node servers with the largest number is less than the required amount of resources, determining the difference between the total amount of resources and the required amount of resources; Based on the number of idle resources on each initial node server, screening a fourth node server whose number of idle resources is less than or equal to the difference; Based on the idle resources on the fourth node server and the difference, a target node server for executing the task is determined.
13. The method according to claim 4, characterized in that The task type includes a single resource type; The step of determining a target node server for executing the task from the at least one initial node server comprises: Based on the amount of idle resources on each of the at least one initial node server, an initial node server having the same amount of idle resources as the resource demand is selected as the target node server.
14. The method according to claim 1, characterized in that It also includes the steps of determining the preset topology: For any idle resources in any to-be-matched node server, determine all topological structures corresponding to any number of idle resources in the to-be-matched node server; Determining the communication waiting time of each of the topological structures based on the communication medium between the idle resources; Based on the communication waiting time, a preset topology structure corresponding to any number of idle resources in the to-be-matched node server is determined.
15. The method according to claim 14, characterized in that The determining, based on the communication waiting time, a preset topology structure corresponding to any number of idle resources in the to-be-matched node server comprises: Sorting the topological structures in order of the communication waiting time from low to high; The topological structure with a sorting order smaller than the preset order is used as the preset topological structure corresponding to the node server to be matched.
16. The method according to claim 14, characterized in that The determining of a preset topology structure corresponding to any number of idle resources in the to-be-matched node server based on the communication waiting time includes: For any number of idle resources, the topology structure in which the communication waiting time is less than the preset waiting threshold is used as the preset topology structure corresponding to the number of idle resources in the node server to be matched.
17. The method according to claim 1, characterized in that The determining the task type of the task based on the task information includes: Get the free resources on each node server; Determine the resource requirement of the task and the communication volume requirement information of the task according to the task information; Determine the target node server for executing the task and the target resources on the target node server based on the idle resources on each of the node servers, the resource requirements of the task, and the communication volume requirement information of the task; The task type of the task is determined based on a target node server that executes the task and a target resource on the target node server.
18. The method according to any one of claims 1 to 17, characterized in that The method further comprises: In the case where the acquired tasks to be processed include multiple tasks, determining a resource allocation priority of each task based on a task type of each task; Based on the resource allocation priority of each of the tasks, a target node server for executing the task and target resources on the target node server are determined.
19. The method according to claim 18, characterized in that The task types include single-node multi-resource communication type, single-node multi-resource computing type, multi-node type, and single-resource type; The determining of the resource allocation priority of each task based on the task type of each task includes: Setting the resource allocation priority of the task of the single-node multi-resource communication type to the first priority; Setting the resource allocation priority of the task of the single-node multi-resource computing type to a second priority; Setting the resource allocation priority of the multi-node type task to a third priority; The resource allocation priority of the task of the single resource type is set to the fourth priority.
20. The method according to claim 2 or 17, characterized in that The task information includes the resource requirement, and the method further includes the step of obtaining the resource requirement: Obtaining a configuration file for the task to be processed; The resource requirement of the task to be processed is obtained from the configuration file.
21. The method according to claim 2 or 17, characterized in that: The task information includes the communication volume demand information, and the method further includes the step of obtaining the communication volume demand information: Obtaining the computing amount information and communication amount information of the task to be processed; Based on the computing amount information and the communication amount information, the communication amount requirement information is determined.
22. The method according to claim 21, characterized in that The obtaining of the computing amount information and the communication amount information of the task to be processed includes: Based on the acquired configuration file of the task to be processed or the acquired task request to be processed, the computing amount information and the communication amount information of the task to be processed are determined; wherein the task request includes the computing amount information and the communication amount information.
23. The method according to claim 2 or 17, characterized in that: The task information includes the communication volume demand information, and the method further includes the step of obtaining the communication volume demand information: Obtaining a configuration file for the task to be processed; The communication volume requirement information of the task to be processed is obtained from the configuration file.
24. The method according to claim 2, characterized in that The determining the task type of the task based on the determined resource demand, the communication volume demand information of the task, and the number of resources in the node server includes: Determining the number of target node servers corresponding to the task to be processed based on the resource demand and the number of resources in the node server; Based on the number of target node servers corresponding to the task to be processed and the communication volume demand information, the task type of the task to be processed is determined.
25. The method according to claim 24, characterized in that The task types include single-node multi-resource communication type, single-node multi-resource computing type, multi-node type, and single-resource type; The determining the task type of the task to be processed based on the number of target node servers corresponding to the task to be processed and the communication volume demand information includes: When the number of target node servers corresponding to the task to be processed is equal to 1, the number of target resources corresponding to the task to be processed is greater than 1, and the communication volume demand information indicates that the communication volume demand of the task to be processed is higher than the computing volume demand, determine that the task type of the task to be processed is a single-node multi-resource communication type; When the number of target node servers corresponding to the task to be processed is equal to 1, the number of target resources corresponding to the task to be processed is greater than 1, and the communication volume demand information indicates that the computing volume demand of the task to be processed is higher than the communication volume demand, determine that the task type of the task to be processed is a single-node multi-resource computing type; When the number of target node servers corresponding to the task to be processed is greater than 1, determining that the task type of the task to be processed is a multi-node type; When the number of target resources corresponding to the task to be processed is equal to 1, it is determined that the task type of the task to be processed is a single resource type.
26. A task scheduling method, characterized in that: Applied to the client, including: Determine the task type of the task to be processed; the task type is used to characterize the number of node servers, the number of graphics processor resources and the communication volume demand information required for the task; the communication volume demand information is used to characterize the ratio between the computing volume and the communication volume corresponding to the task; the task type includes at least one of a single-node multi-resource communication type, a single-node multi-resource computing type, a multi-node type and a single-resource type; Based on the task type of the task, determine the target node server for executing the task and the target resources on the target node server; wherein different task types correspond to different resource determination methods; the resource determination method corresponding to the single-node multi-resource communication type is aimed at the number of idle resources in the screened target node server being greater than or equal to the resource demand; the resource determination method corresponding to the single-node multi-resource computing type is aimed at the number of idle resources in the screened target node server being less than or equal to the resource demand; the resource determination method corresponding to the multi-node type is aimed at screening unloaded target node servers; the resource determination method corresponding to the single resource type is aimed at the number of idle resources in the screened target node server being equal to the resource demand; the number of node servers required for the task is used to indicate the number of target node servers required to be screened; the number of graphics processor resources is used to indicate the minimum number of target resources required to be included in the screened target node server; the communication volume demand information is used to indicate the relationship between the number of target resources in the screened target node servers and the resource demand; The information of the target node server and the information of the target resource are sent to the scheduler, so that the scheduler allocates the target node server and the target resource to the task to be processed.
27. The task scheduling method according to claim 26, characterized in that: The step of determining the task type of the task to be processed includes: Determine the resource requirement of the task, the communication volume requirement information of the task and the number of resources in the node server; The task type of the task is determined based on the determined resource requirement, the communication volume requirement information of the task, and the number of resources in the node server.
28. The task scheduling method according to claim 26, characterized in that: The step of determining the task type of the task to be processed includes: Get the free resources on each node server; Based on the idle resources on each of the node servers, the resource requirements of the task, and the communication volume requirement information of the task, determining at least one target node server for executing the task and the target resources on the target node server; A task type of the task is determined based on the at least one target node server and a target resource on the target node server.
29. A task scheduling device, characterized in that: include: An acquisition module is used to obtain task information of tasks to be processed; A first determining module, used to determine a task type of the task based on the task information; The task type is used to characterize the number of node servers, the number of graphics processor resources and the communication volume demand information required for the task; the communication volume demand information is used to characterize the ratio between the computing volume and the communication volume corresponding to the task; the task type includes at least one of a single-node multi-resource communication type, a single-node multi-resource computing type, a multi-node type and a single-resource type; The second determination module is used to determine the target node server for executing the task and the target resources on the target node server based on the task type; wherein different task types correspond to different resource determination methods; the resource determination method corresponding to the single-node multi-resource communication type is aimed at the number of idle resources in the screened target node server being greater than or equal to the resource demand; the resource determination method corresponding to the single-node multi-resource computing type is aimed at the number of idle resources in the screened target node server being less than or equal to the resource demand; the resource determination method corresponding to the multi-node type is aimed at screening unloaded target node servers; the resource determination method corresponding to the single resource type is aimed at the number of idle resources in the screened target node server being equal to the resource demand; the number of node servers required for the task is used to indicate the number of target node servers required to be screened; the number of graphics processor resources is used to indicate the minimum number of target resources required to be included in the screened target node server; the communication volume demand information is used to indicate the relationship between the number of target resources in the screened target node server and the resource demand; An allocation module is used to allocate the target node server and the target resources on the target node server to execute the task.
30. A task scheduling device, characterized in that: Applied to the client, including: The third determination module is used to determine the task type of the task to be processed; the task type is used to characterize the number of node servers, the number of graphics processor resources and the communication volume demand information required for the task; the communication volume demand information is used to characterize the ratio between the computing volume and the communication volume corresponding to the task; the task type includes at least one of a single-node multi-resource communication type, a single-node multi-resource computing type, a multi-node type and a single-resource type; The fourth determination module is used to determine the target node server that executes the task and the target resources on the target node server based on the task type of the task; wherein different task types correspond to different resource determination methods; the resource determination method corresponding to the single-node multi-resource communication type is aimed at the number of idle resources in the screened target node server being greater than or equal to the resource demand; the resource determination method corresponding to the single-node multi-resource computing type is aimed at the number of idle resources in the screened target node server being less than or equal to the resource demand; the resource determination method corresponding to the multi-node type is aimed at screening unloaded target node servers; the resource determination method corresponding to the single resource type is aimed at the number of idle resources in the screened target node server being equal to the resource demand; the number of node servers required for the task is used to indicate the number of target node servers that need to be screened; the number of graphics processor resources is used to indicate the minimum number of target resources that need to be included in the screened target node server; the communication volume demand information is used to indicate the relationship between the number of target resources in the screened target node server and the resource demand; The sending module is used to send the information of the target node server and the information of the target resource to the scheduler, so that the scheduler allocates the target node server and the target resource to the task to be processed.
31. A computer device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor executes the steps of the task scheduling method as described in any one of claims 1 to 25, or the processor executes the steps of the task scheduling method as described in any one of claims 26 to 28.
32. A computer-readable storage medium, characterized in that: A computer program is stored on the computer-readable storage medium. When the computer program is executed by a computer device, the computer device executes the steps of the task scheduling method as described in any one of claims 1 to 25, or the computer device executes the steps of the task scheduling method as described in any one of claims 26 to 28.
