WO2022247105A1 - Task scheduling method and apparatus, computer device and storage medium - Google Patents

Task scheduling method and apparatus, computer device and storage medium Download PDF

Info

Publication number
WO2022247105A1
WO2022247105A1 PCT/CN2021/124136 CN2021124136W WO2022247105A1 WO 2022247105 A1 WO2022247105 A1 WO 2022247105A1 CN 2021124136 W CN2021124136 W CN 2021124136W WO 2022247105 A1 WO2022247105 A1 WO 2022247105A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
node server
resource
target
type
Prior art date
Application number
PCT/CN2021/124136
Other languages
French (fr)
Chinese (zh)
Inventor
叶志晟
孙鹏
吴保东
颜深根
Original Assignee
上海商汤科技开发有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海商汤科技开发有限公司 filed Critical 上海商汤科技开发有限公司
Publication of WO2022247105A1 publication Critical patent/WO2022247105A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources

Definitions

  • the present disclosure relates to the field of computer technology, in particular, to a task scheduling method, device, computer equipment and storage medium.
  • the task scheduling system In order to meet the different resource requirements corresponding to different deep learning tasks, the task scheduling system is playing an increasingly important role.
  • the task scheduling methods applied 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 deep learning tasks.
  • Embodiments of the present disclosure at least provide a task scheduling method, device, computer equipment, and storage medium.
  • an embodiment of the present disclosure provides a task scheduling method, including:
  • the task information can reflect information such as the resource demand amount and traffic demand information of the task to be processed, so that based on the task information, the task type matching the task information can be determined.
  • the methods of determining the target node server and target resources are different for different task types. Based on the determined task type, the resource determination method matching the task type can be determined, and then, the determined resource determination method can be used as the resource determination method to be processed. Assigning target resources to tasks can improve the rationality of the allocated target resources, and then, using the determined target resources to execute tasks to be processed can improve the speed and efficiency of task execution.
  • the determining the task type of the task according to the task information includes:
  • the task information determine the resource requirement of the task and the traffic requirement information of the task
  • the task type of the task is determined based on the determined resource demand, communication traffic demand information of the task, and resource quantity in the node server.
  • the traffic demand information can reflect the demand information of the task for the traffic and calculation volume
  • the resource demand can reflect the number of idle resources required to execute the task
  • the number of resources in the node server can reflect the maximum idle resources in a node server resource quantity.
  • the task type of the task to be processed can be accurately determined based on the resource demand, the communication traffic demand information of the task, and the resource quantity in the node server.
  • the determining the target node server for executing the task and the target resource on the target node server based on the task type includes:
  • a target node server for executing the task and target resources on the target node server are determined based on the task type of the task, the resource requirement of the task, and the idle resources on the node server.
  • tasks of different task types have different resource allocation priorities. For example, tasks of the single-node multi-resource communication type that require high communication traffic have higher resource allocation priorities, so the number of idle resources can be greater than that of resource allocation. Select the target node server from the node server with the required amount. For tasks of the single-node multi-resource computing type with a large amount of calculation, the resource allocation priority is lower than that of the single-node multi-resource communication type. Therefore, the number of idle resources can be Select the target node server from the node servers that are smaller than the resource requirement. In this way, assigning the target node server and the target resources in the target node server to tasks according to different task types can realize the rational allocation of idle resources in the node server to different tasks, thereby improving the speed and efficiency of task scheduling and execution. efficiency.
  • target resources including:
  • a target node server for executing the task and target resources on the target node server from the at least one initial node server.
  • the initial node server that can execute the task to be processed can be selected first, and then the final target for executing the task to be processed can be selected according to the resource demand of the task and the idle resources on the initial node server
  • the node server and the target resource thus, the selected target node server and target resource can not only execute the task to be processed, but also have a faster execution speed, thereby improving the speed and efficiency of task execution.
  • the task type includes a single-node multi-resource communication type
  • the determining the target node server for performing the task from the at least one initial node server includes:
  • the initial node server Based on the number of idle resources on the initial node server in the at least one initial node server, select the initial node server whose number of idle resources is greater than or equal to the resource demand as the first node server;
  • a target node server for executing the task is determined based on idle resources on the first node server and resource requirements of the task.
  • the single-node multi-resource communication type has a high demand for traffic, so select the first node server whose number of idle resources is greater than or equal to the resource demand, instead of waiting for other node servers whose number of idle resources is less than the resource demand Releasing resources, realizing that the initial node server with a large number of idle resources is preferentially allocated to this type of task, so as to meet the traffic demand of this type of task, and then select the target node server for executing the task from the first node server, It can effectively improve the scheduling and execution efficiency of this type of task.
  • the determining the target node server for executing the task based on the idle resources on the first node server and the resource requirement of the task includes:
  • the first node server having any one of the preset topology structures and the least number of idle resources as the target node server.
  • resources with a preset topology have higher communication quality
  • the use of the target node server with a preset topology can further increase the speed of executing single-node multi-resource communication tasks.
  • selecting the first node server with the least number of idle resources can reduce the splitting of the original topology structure of the idle resources in the first node server with a large number of idle resources, and realize the protection of the optional topology structure and Apply it reasonably to other tasks such as single-node multi-resource communication types.
  • determining the target resource on the target node server includes:
  • the task type includes a single-node multi-resource computing type
  • the determining the target node server for performing the task from the at least one initial node server includes:
  • a target node server for executing the task is determined based on idle resources on the second node server and resource requirements of the task.
  • the single-node multi-resource computing type has a high demand for calculation volume and a small demand for communication volume. Therefore, selecting a second node server with a number of idle resources smaller than the resource demand can meet the communication requirements of this type of task. It can improve the scheduling and execution efficiency of this type of task to a certain extent. Furthermore, this type of task does not occupy the initial node server whose number of idle resources is greater than the resource demand, and can reserve this type of node server for the task of single-node multi-resource communication type with high resource demand, which realizes the improvement of single-node While the scheduling and execution efficiency of multi-resource computing tasks is improved, the scheduling and execution efficiency of single-node multi-resource communication tasks is improved. Furthermore, this embodiment can reduce the splitting probability of the original topology structure of idle resources in the initial node server with a large number of idle resources, realize the protection of the optional topology structure and rationally apply it to multiple Resource communication types and other tasks.
  • the determining the target node server for executing the task based on the idle resources on the second node server and the resource requirement of the task includes:
  • resources with a preset topology have higher communication quality, and using the target node server with a preset topology can improve the scheduling and execution efficiency of single-node multi-resource computing tasks.
  • the determining the 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:
  • no second node server with any one of the preset topology structures is screened out from the second node servers, after a preset period of time or at least one idle resource on the node server changes, the node server is reacquired and returning to the step of screening the second node server whose number of idle resources is less than or equal to the resource requirement based on the number of idle resources on the initial node server among the at least one initial node server.
  • the required idle resources with a preset topology can be allocated to tasks in a timely manner, and further, tasks of the single-node multi-resource computing type can be executed in a timely manner .
  • it can also reduce the split probability of the original topology structure of idle resources in the initial node server with a large number of idle resources, realize the protection of optional topology structures and rationally apply it in single-node multi-resource communication type and other tasks.
  • the task type includes a multi-node type
  • the determining the target node server for performing the task from the at least one initial node server includes:
  • the at least one initial node server determine the maximum number of third node servers required to perform the task; wherein, the third node server is an empty initial node server;
  • the third node server with the maximum number is used as the target node server.
  • idle resources in the unloaded third node server have an optional topology structure, and selecting the third node server with the largest number as the target node server can ensure that the target node servers used to perform multi-node tasks have available
  • the selected topology can improve the efficiency of executing multi-node type tasks.
  • the determining the target node server for executing the task from the at least one initial node server further includes:
  • the difference between the total amount of resources and the resource demand 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, and then, based on the difference, select The fourth node server can realize the reasonable allocation of idle resources required by the task, thereby improving the speed of executing the task.
  • the task type includes a single resource type
  • the determining the target node server for performing the task from the at least one initial node server includes:
  • the initial node server whose idle resource quantity is equal to the resource requirement is used as the target node server.
  • a task of a single resource type can be executed only by one idle resource. Therefore, the task can be executed quickly and efficiently by using the target node server whose number of idle resources is equal to the resource demand.
  • it also includes a step of determining a preset topology:
  • a preset topology corresponding to any number of idle resources in the node server to be matched is determined.
  • the communication waiting time of the topology can represent the waiting time required to execute tasks using the topology, and the preset topology with high task execution efficiency can be screened out by using the communication waiting time, so that the idle time with the preset topology can be used Resource execution tasks can improve the efficiency of task execution.
  • the determining a preset topology corresponding to any number of idle resources in the node server to be matched based on the communication waiting time includes:
  • the topological structure whose sort order is smaller than the preset order is used as the preset topology structure corresponding to the node server to be matched.
  • using the preset order to filter the preset topology can ensure that the communication waiting time of the filtered preset topology is relatively short, and then, using the preset topology to execute tasks can realize task execution at a faster speed.
  • the determining a preset topology corresponding to any number of idle resources in the node server to be matched based on the communication waiting time includes
  • the topology structure whose communication waiting time is shorter than the preset waiting threshold is taken as the preset topology structure corresponding to the number of idle resources in the node server to be matched.
  • using the preset waiting threshold to filter the preset topology can ensure that the communication waiting time of the filtered preset topology is less than the preset waiting threshold, and then, using the preset topology to execute tasks can reasonably reduce the need for task execution. communication waiting time.
  • the determining the task type of the task according to the task information includes:
  • the task information determine the resource requirement of the task and the traffic requirement information of the task
  • the task type of the task is determined based on the target node server executing the task and the target resource on the target node server.
  • the target node server and target resource can be determined, and then, the target node server and target resource corresponding to the task type can be directly assigned to the task to be processed, omitting the time for selecting the initial node server, and improving The speed and efficiency of resource scheduling, thereby improving the speed and efficiency of task execution.
  • the method also includes:
  • the obtained tasks to be processed include multiple tasks, based on the task type of each task, determine the resource allocation priority of each task;
  • a target node server for executing the task and target resources on the target node server are determined.
  • resources are allocated to different tasks based on resource allocation priorities, so that idle resources in the node server can be reasonably allocated to different tasks.
  • the task type includes single-node multi-resource communication type, single-node multi-resource computing type, multi-node type, and single-resource type;
  • tasks of the single-node multi-resource communication type have a high demand for communication traffic.
  • Setting the task of this task type as the first priority can meet the required communication traffic and increase the speed of executing tasks of this task type.
  • Tasks of the single-node multi-resource computing type have high demands on the amount of computation and relatively small demands on communication traffic.
  • Setting this type of task as the second priority can meet the required amount of computation and reduce the need for The split probability of the original topology of idle resources in node servers with a large number of idle resources.
  • Multi-node tasks require empty node servers and there are relatively few tasks of this task type.
  • the task information includes the resource requirement
  • the method further includes the step of obtaining the resource requirement:
  • the resource requirement is obtained directly from the configuration file, which improves the speed of determining the resource requirement.
  • the task information includes the traffic demand information
  • the method further includes the step of acquiring the traffic demand information:
  • the communication amount requirement information is determined.
  • the traffic demand information is determined based on the acquired calculation traffic information and traffic traffic information, which can ensure the accuracy of the determined traffic traffic demand information.
  • the acquiring the calculation amount information and the communication amount information of the task to be processed includes:
  • the task request includes the calculation volume information and traffic information.
  • the calculation amount information and the communication amount information are determined based on the analysis of the configuration file or the task request, and the accuracy of the determined calculation amount information and the communication amount information can be improved.
  • the task information includes the traffic demand information
  • the method further includes the step of acquiring the traffic demand information:
  • the communication traffic requirement information is obtained directly from the configuration file, the step of calculating the information is omitted, and the speed of determining the communication traffic requirement information is improved.
  • the determining the task type of the task based on the determined resource demand, task traffic demand information, and resource quantity in the node server includes:
  • the task type of the task to be processed is determined based on the number of target node servers corresponding to the task to be processed and the traffic demand information.
  • the task type of the task can be accurately determined.
  • the task type includes 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 traffic demand information includes:
  • 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 traffic demand information indicates the traffic demand of the task to be processed
  • the task type of the task to be processed is a single-node multi-resource communication type
  • 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 traffic demand information indicates the calculation capacity demand of the task to be processed If it is higher than the communication traffic requirement, it is determined that the task type of the task to be processed is a single-node multi-resource computing type;
  • the task type of the task to be processed is a single resource type.
  • the task type of the task can be accurately determined.
  • the embodiment of the present disclosure also provides a task scheduling method applied to a client, including:
  • the client first determines the target node server and target resource based on the determined task type, and then sends it to the scheduler.
  • the scheduler omits the step of determining the target node server and target resource, and can directly send the target node server and target Resources are allocated to tasks, so that the speed of resource scheduling and the execution speed and efficiency of tasks can be improved.
  • the determining the task type of the task to be processed includes:
  • the task type of the task is determined based on the determined resource demand, communication traffic demand information of the task, and resource quantity in the node server.
  • the traffic demand information can reflect the demand information of the task for the traffic and calculation volume
  • the resource demand can reflect the number of idle resources required to execute the task
  • the number of resources in the node server can reflect the maximum idle resources in a node server number of resources.
  • the task type of the task to be processed can be accurately determined based on the resource demand, the communication traffic demand information of the task, and the resource quantity in the node server.
  • the determining the task type of the task to be processed includes:
  • a task type of the task is determined based on the at least one target node server and target resources on the target node server.
  • determining the task type based on the idle resources can ensure that the currently determined target node server and target resources can be directly used to execute the task.
  • the embodiment of the present disclosure also provides a task scheduling device, which is applied to the scheduler side, including:
  • An acquisition module configured to acquire task information of tasks to be processed
  • a first determining module configured to determine the task type of the task based on the task information
  • a second determining module configured to determine a target node server for executing the task and target resources on the target node server based on the task type
  • An allocating module configured to allocate the target node server and target resources on the target node server to execute the task.
  • the disclosed example also includes a task scheduling device, which is applied to the client, including:
  • the third determining module is used to determine the task type of the task to be processed
  • a fourth determining module configured 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;
  • a sending module configured to send the information of the target node server and the information of the target resource to a scheduler, so that the scheduler allocates the target node server and the target resource to the task to be processed
  • an optional implementation manner of the present disclosure further provides a computer device, a processor, and a memory, where the memory stores machine-readable instructions executable by the processor, and the processor is configured to execute the instructions stored in the memory.
  • machine-readable instructions when the machine-readable instructions are executed by the processor, when the machine-readable instructions are executed by the processor, the above-mentioned first aspect is executed, or any possible implementation of the first aspect.
  • an optional implementation manner of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the above-mentioned first aspect, or any one of the first aspects in the first aspect, may be executed. Steps in a possible implementation manner, or, performing the steps in the above second aspect, or any possible implementation manner in the second aspect.
  • an optional implementation manner of the present disclosure further provides a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium bearing computer-readable codes, when the computer-readable codes are stored in
  • the processor in the electronic device executes the above-mentioned first aspect, or the steps in any possible implementation manner of the first aspect, or executes the above-mentioned second aspect, or the second aspect A step in any possible implementation of an aspect.
  • FIG. 1 shows a flowchart of a task scheduling method applied to a scheduler provided by an embodiment of the present disclosure
  • FIG. 2 shows a schematic structural diagram of a node server provided by an embodiment of the present disclosure
  • FIG. 3 shows a flowchart of a method for determining a preset topology provided by an embodiment of the present disclosure
  • FIG. 4 shows a schematic diagram of a topology relationship between node servers provided by an embodiment of the present disclosure
  • FIG. 5 shows a schematic diagram of a topology structure of a multi-node task provided by an embodiment of the present disclosure
  • FIG. 6a shows a schematic diagram of a preset topology structure corresponding to 8 resources provided by an embodiment of the present disclosure
  • FIG. 6b shows a schematic diagram of a preset topology structure corresponding to 7 resources provided by an embodiment of the present disclosure
  • FIG. 6c shows a schematic diagram of a preset topology structure corresponding to 6 resources provided by an embodiment of the present disclosure
  • FIG. 6d shows a schematic diagram of a preset topology structure corresponding to 5 resources provided by an embodiment of the present disclosure
  • FIG. 6e shows a schematic diagram of a preset topology structure corresponding to 4 resources provided by an embodiment of the present disclosure
  • FIG. 6f shows a schematic diagram of a preset topology structure corresponding to 3 resources provided by an embodiment of the present disclosure
  • FIG. 6g shows a schematic diagram of a preset topology structure corresponding to 2 resources provided by an embodiment of the present disclosure
  • FIG. 7 shows a schematic diagram of splitting an initial node server including different idle resources provided by an embodiment of the present disclosure
  • FIG. 8 shows a flow chart of a task scheduling method applied to a client provided by an embodiment of the present disclosure
  • FIG. 9 shows a schematic diagram of a task scheduling device applied to the scheduler end provided by an embodiment of the present disclosure.
  • FIG. 10 shows a schematic diagram of a task scheduling device applied to a client provided by an embodiment of the present disclosure
  • FIG. 11 shows a schematic structural diagram of a computer device provided by an embodiment of the present disclosure.
  • the task scheduling system is playing an increasingly important role.
  • the task scheduling methods applied in the task scheduling system are mostly based on deep learning task
  • the resource demand is to allocate resources for deep learning tasks with the goal of allocating as few node servers as possible.
  • the present disclosure provides a task scheduling method, device, computer equipment, and storage medium.
  • the task information can reflect information such as the resource demand and traffic demand information of the task to be processed. Therefore, based on the task information, it is possible to determine The task type that matches the task information.
  • the methods of determining the target node server and target resources are different for different task types. Based on the determined task type, the resource determination method matching the task type can be determined, and then, the determined resource determination method can be used as the resource determination method to be processed. Assigning target resources to tasks can improve the rationality of the allocated target resources, and then, using the determined target resources to execute tasks to be processed can improve the speed and efficiency of task execution.
  • GPU Graphics Processing Unit
  • graphics processor also known as display core, visual processor, display chip
  • display core a special graphics processing unit for personal computers, workstations, game consoles and some mobile devices (such as tablets, smartphones, etc.) Microprocessors that work with graphics-related operations;
  • CPU Central Processing Unit, the central processing unit, as the computing and control core of the computer system, is the final execution unit for information processing and program operation;
  • NIC Network Interface Controller
  • network interface controller also known as network interface controller, network adapter, network card, or LAN receiver
  • network card also known as network interface controller, network adapter, network card, or LAN receiver
  • PCIe peripheral component interconnect express, is a high-speed serial computer expansion bus standard
  • QPI Quick Path Interconnect, also known as CSI (Common System Interface) public system interface, is an architecture that can realize direct interconnection between chips;
  • NVLink is a bus and its communication protocol developed and launched by Nvidia.
  • the execution subject of the task scheduling method provided in the embodiments of the present disclosure is generally a computer device with a certain computing capability.
  • the task scheduling method may be implemented by calling a computer-readable instruction stored in a memory by a processor.
  • the task scheduling method provided by the embodiments of the present disclosure will be described below by taking the execution subject as a computer device as an example.
  • a flowchart of a task scheduling method applied to the scheduler side may include the following steps:
  • the task to be processed can 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 can be a scheduler for resource scheduling.
  • the task scheduling system can include several node servers, and the node servers include a certain number of computing resources and a certain number of CPUs.
  • the node servers can be GPU node servers, and the computing resources can be GPUs in the GPU node servers.
  • Can use QPI connection to communicate, GPU and CPU in one node server can use PCIe to communicate, CPU in one node server can use NIC to communicate with CPU in other node servers, GPU in one node server can use NVLink connection to communicate.
  • FIG. 2 it is a schematic 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), PCIe Switches means using PCIe for communication.
  • CPU0 and CPU1 CPU servers
  • V100GPU1 V100GPU1, V100GPU2, V100GPU3 , V100GPU4, V100GPU5, V100GPU6, V100GPU7
  • PCIe Switches means using PCIe for communication.
  • the task scheduling system can also obtain task information of the task.
  • the task information is a kind of information used to represent the resource requirement and the traffic requirement information of the task to be processed.
  • the task type can reflect the number of node servers required by the task, the number of GPU resources, and the traffic requirements, and the number of node servers selected for executing tasks of different task types is different. Different tasks may have different task types. For the same task, if the number of selected node servers is different, the task types of the task are also different.
  • the task type of the task may be determined based on information such as resource requirements and communication traffic demand information represented by the acquired task information.
  • S103 Based on the task type, determine a target node server for executing the task and target resources on the target node server.
  • the ways of determining the target node server and the target resource are different.
  • the target node server that can be used to execute the task and the target resource on the target node server can be determined according to the idle resources on the node server and the task type of the task.
  • the target resource is an idle resource.
  • S104 Allocate the target node server and the target resource on the target node server to execute the task.
  • 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.
  • the task information can reflect information such as the resource demand amount and traffic demand information of the task to be processed, so that based on the task information, the task type matching the task information can be determined.
  • the methods of determining the target node server and target resources are different for different task types. Based on the determined task type, the resource determination method matching the task type can be determined, and then, the determined resource determination method can be used as the resource determination method to be processed. Assigning target resources to tasks can improve the rationality of the allocated target resources, and then, using the determined target resources to execute tasks to be processed can improve the speed and efficiency of task execution.
  • the task type of the task can be determined according to the following steps:
  • Step 1 According to the task information, determine the resource demand amount of the task and the traffic demand information of the task.
  • the resource requirement of a task may be the number of GPUs required to execute the task.
  • the communication volume requirement information is used to represent the ratio between the calculation volume and the communication volume corresponding to the task. After a task is determined, the number of GPUs it needs will also be determined, that is, the resource requirements of the task can be determined. At the same time, after a task is determined, its corresponding traffic demand information will also be determined. Therefore, after a task is determined, the task information used to characterize resource demand and traffic demand information is also determined.
  • the task scheduling system can determine the resource requirement and traffic requirement information of the task represented by it according to the acquired task information of the task.
  • Step 2 Determine the resource quantity in the node server.
  • 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.
  • the number of GPUs included in the node servers in the task scheduling system may be different.
  • the node servers in the task scheduling system may include 8GPU node servers and 4GPU node servers, which are not limited here.
  • Step 3 Determine the task type of the task based on the determined resource demand, the traffic demand information of the task, and the resource quantity in the node server.
  • 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 server, that is, the number of target node servers corresponding to the task to be processed can be determined. in, in, Indicates rounding up.
  • 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 traffic demand information of the task.
  • the task types may include single-node multi-resource communication type, single-node multi-resource computing type, multi-node type and single resource type.
  • the task can be divided into single-node type task and multi-node type task.
  • the single-node type task can be completed by using the resources in one target node server, and the multi-node type task needs at least two The resources in the target node server can 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, where the single-resource type task means that the task only needs one One idle resource in the target node server can be completed, and a single-node multi-resource task requires multiple idle resources in a target node server to complete; in addition, according to the traffic demand information of the task, the single-node multi-resource Type tasks are divided into single-node multi-resource communication type tasks and single-node multi-resource computing type tasks. Among them, single-node multi-resource communication type tasks indicate that the
  • the task type of the task to be processed 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 traffic demand information indicates that the traffic demand of the task to be processed is higher than the calculation In the case of high-volume demand, determine the task type of the task to be processed as a single-node multi-resource communication type.
  • the task type of the task to be processed is the single-node multi-resource computing type.
  • the resource requirement of the task is 7, the number of resources on the node server is 8, and the ratio between the calculation amount and the communication amount is greater than 1, it can be determined that the number of target node servers required by the task is 1, and then, based on If the ratio is greater than 1 and the number of target node servers is 1, it can be determined that the task type of the task is a single-node multi-resource computing type.
  • the target node server for executing the task and the target resource on the target node server are determined.
  • the GPUs on the node server can be used independently, and the idle GPUs on the node server are currently unused GPUs.
  • the node servers may be divided into different idle resource linked lists according to the number of idle GPUs on the node servers, wherein the idle resource linked list is only composed of node servers including a number of idle GPUs.
  • the idle resource linked list may be 1 idle GPU linked list, 2 idle GPU linked list, etc., wherein 1 idle GPU linked list means that all node servers in the linked list have only one idle GUP.
  • At least one initial node server matching the task type may be determined based on the task type first.
  • the initial node server may be a node server selected from the idle list, and may be a group of multiple node servers or a single node server that can be used to execute tasks to be processed. For example, if a task is a task of single-node multi-resource communication type, and the resource demand is 3, multiple node servers with multiple resources greater than or equal to 3 can be selected from the free list as the initial node server, and multiple groups of nodes server, wherein the number of resources in a group of node servers is greater than or equal to 3.
  • the target node server for executing the task and the target resource on the target node server may be determined from at least one initial node server based on the resource requirement of the task and the idle resources on the initial node server.
  • a target number of target node servers can be selected from at least one initial node server, and can be determined on the target node server based on the resource demand of the task.
  • the target resource chosen to execute the task is the number of target servers determined in the above embodiment.
  • the task type of the task is determined to be 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 targets The node server is an empty node server, and the number of idle resources included in one target node server is five.
  • the target node server for executing the task may be determined from at least one initial node server according to the following steps:
  • Step 1 Based on the number of idle resources on the initial node server in at least one initial node server, select the initial node server whose number of idle resources is greater than or equal to the resource requirement as the first node server;
  • Step 2 Determine the target node server for executing the task based on the idle resources on the first node server and the resource requirements of the task.
  • 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 , in this way, it can be ensured that there is a sufficient number of idle resources in the first node server to meet the traffic demand of the task.
  • the selected first node servers may include one or more.
  • the target node server for executing the task may be selected from the screened first node servers according to the resource requirement.
  • At least one preset topology corresponding to the resource requirement can be determined according to the resource requirement of the task, wherein the preset topology is the number of idle resources required to execute the task.
  • the preset topology is the number of idle resources required to execute the task.
  • the preset topology corresponding to any idle resource can be determined according to the method shown in FIG. 3 , as shown in FIG.
  • a flowchart of the method may include the following steps:
  • S301 For idle resources in any node server to be matched, determine a topology structure corresponding to any number of idle resources in the node server to be matched.
  • S302 Based on the communication medium between idle resources, determine the communication waiting time of the topology.
  • the node server to be matched includes any number of idle resources, and the node server to be matched may be any node server.
  • the resource requirements correspond to idle resources, specifically, one resource requirement may correspond to idle resources in at least one node server to be matched.
  • 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, It may be 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 corresponding to any resource requirement.
  • the quality of communication between different node servers included in the task scheduling system and the GPU and CPU in the same node server is different.
  • the common communication methods are as mentioned in the above-mentioned embodiments.
  • QPI, PCIe, NIC and NVLink 4 kinds wherein , the communication rate of NVLink is greater than the communication rate of QPI, and the communication rate of QPI is to be greater than the communication rate of PCIe, NIC and network.
  • the communication medium may be determined according to the medium corresponding to the communication mode.
  • the topology structure corresponding to the idle resource can be determined first, and then the communication waiting time of the topology structure can be determined based on the communication medium between the idle resources in the node server to be matched.
  • the topology structure that can be formed by the idle resources in the group of node servers can be determined, and then, based on the communication medium between the node servers and the relationship between the idle resources The communication medium, which determines the communication waiting time of the topology.
  • the topological structures may be screened according to the communication waiting time of the topological structures, and the topological structures meeting the preset conditions are screened out as the preset topology structures.
  • a priori method can be used to determine the communication waiting time corresponding to a certain amount of idle resources under different topological structures, wherein one amount of idle resources can correspond to multiple topological structures, as shown in Figure 4
  • Figure 4 It is a schematic diagram of a topology relationship between node servers provided by an embodiment of the present disclosure, wherein NVLINK/NVSWITCH is used for communication between GPUs, and Network (network) and NIC are used for communication between different node servers .
  • the GPU For the topological structure, use the GPU with the topological structure to execute the resource demand task corresponding to the number of idle resources based on the ring allreduce model.
  • the GPU In the process of executing tasks based on the ring allreduce model, the GPU needs to communicate sequentially, so , the total communication latency will be limited by the minimum communication bandwidth between GPUs in the topology.
  • the waiting time for allreduce communication in a single node server can be determined according to Formula 1:
  • T represents the waiting time for communication
  • n represents the number of GPUs required
  • represents the constant delay in establishing communication
  • s represents the size of the ring allreduce model (that is, the communication scale)
  • BW represents the communication between GPUs under the topology
  • a collection of bandwidths, min(BW) represents the minimum communication bandwidth between GPUs in the topology.
  • the waiting time for an allreduce communication required to execute the task may include the waiting time for allreduce communication in a single node server and the waiting time for allreduce communication between node servers Allreduce communication waiting time, wherein, the allreduce communication waiting time in a single node server may include a reduce operation in the node server and a broadcast operation in the node server.
  • FIG. 5 it is a schematic diagram of a topology structure of a multi-node task provided by an embodiment of the present disclosure, where bw 0 represents the communication bandwidth between GPUs, and bw 1 represents the minimum communication bandwidth between different node servers.
  • bw 0 represents the communication bandwidth between GPUs
  • bw 1 represents the minimum communication bandwidth between different node servers.
  • the four dark-colored GPUs shown in the lower right corner of FIG. 5 may represent the GPUs being used.
  • the communication waiting time between a reduce operation in the node server and a broadcast operation in the node server can be determined according to Formula 2:
  • the waiting time for allreduce communication between node servers can be determined according to Formula 3:
  • m represents the number of node servers used.
  • max i 2T(n i , s, bw 0 ) represents the communication waiting time of the node with the highest communication time consumption under multiple node servers when executing multi-node tasks.
  • the communication waiting time c i of task j i corresponding to any number of idle resources shown in formula 5 can be determined:
  • N ij represents the number of GPUs required by task j i on the jth node server
  • M i represents the number of node servers required to execute task j i
  • BW ij represents the communication bandwidth between task j i and other node servers on the jth node server
  • min j BW ij represents the minimum communication bandwidth between task j i and other node servers on the jth node server
  • bw 0 represents the communication bandwidth of task j i in the jth node server
  • S i represents the communication volume and computation of task j i The ratio information between the quantities.
  • a total of ⁇ j N ij GPUs are needed.
  • one GPU needs to spend the communication waiting time of c i .
  • the total number of tasks corresponding to the resource demand under this topology can be determined.
  • the total communication waiting time under the topology relationship corresponding to the resource demand can be determined.
  • the preset topology structure can be selected according to formula 6:
  • min ⁇ i ⁇ j (N ij c i ) indicates that the topology structure with the minimum communication waiting time is selected as the preset topology structure.
  • the total communication waiting time of the topological relationship under a certain amount of idle resources can be determined, and then the total communication waiting time of the topological relationship can be performed in order from low to high Sorting, and then using the preset order, the topological structure whose sorting order is smaller than the preset order is used as the preset topology structure corresponding to the number of idle resources, that is, as the preset topology structure corresponding to the node server to be matched.
  • the preset order can be set according to actual needs, which is not limited here.
  • the topological structures are screened using the preset order, and the communication waiting time corresponding to the preset topological structures can meet the time requirements for executing the task corresponding to the resource demand amount of the idle resources, and can also reduce the execution time of the task as much as possible.
  • the resource requirement for the time purpose of the task is not limited to the time requirements for executing the task corresponding to the resource demand amount of the idle resources.
  • the topology structure whose communication waiting time is less than the preset waiting threshold can be used as the corresponding resource demand
  • the preset topology that is, may be the preset topology corresponding to the node server to be matched. In this way, using the preset topology to execute tasks can reasonably reduce the communication waiting time required for task execution, wherein the preset waiting threshold can be set according to actual needs, and is not limited here.
  • the communication mode between resources in the optional topology should be NVLink.
  • the preset topological structure corresponding to different resource demands on the Internet is a schematic diagram of the preset topology structure corresponding to 8 resources provided by the embodiment of the present disclosure, as shown in Figure 6b, which is the schematic diagram of the preset topology structure provided by the embodiment of the present disclosure
  • a schematic diagram of a preset topology structure corresponding to 7 resources as shown in Figure 6c, which is a schematic diagram of a preset topology structure corresponding to 6 resources provided by the embodiment of the present disclosure, as shown in Figure 6d, which is a schematic diagram of a preset topology structure corresponding to 5 resources provided by an embodiment of the present disclosure
  • the schematic diagram of the corresponding preset topology structure is a schematic diagram of the preset topology structure corresponding to the
  • the first node server with any preset topology can be screened from the first node servers. In this way, using the screening The selected first node server with any preset topology performs this task, which can reduce the communication waiting time, and then, select the number of idle resources from the screened out first node servers with any preset topology
  • the least first node server is used as the target node server. In this way, using the first node server with the smallest number of idle resources as the target node server can reduce the number of first node servers with any preset topology and a large number of idle resources.
  • the splitting of the original topology realizes the protection of the optional topology and its reasonable application to other tasks such as single-node multi-resource communication.
  • the first node server in the process of screening the target node server, if there is a first node server with the number of idle resources equal to the resource demand and having any preset topology, the first node server can be directly used as the target node server.
  • FIG. 7 is a schematic diagram of splitting an initial node server including different idle resources provided by an embodiment of the present disclosure, wherein, Slot can represent the initial node server, and it can be seen from Figure 7 that when the number of resources included in an initial node server is 8, the optional topology structure obtained by splitting 6 idle resources is 4 idle resources plus 2 idle resources. The optional topology obtained by splitting 5 idle resources is the mode of 3 idle resources plus 2 idle resources.
  • Job can represent a task
  • 8GPU jobs can represent a task that requires 8 idle GPUs to complete
  • Empty 7 GPU Slot represents a node with 7 idle GPUs. server.
  • any one of the first node servers may be randomly selected as the target node server.
  • the preset topology of the target node server may be used as the target topology, and then idle resources constituting the target topology in the target node server may be used as the target resource.
  • the idle resources therein can be used as the target resource; 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 resource with the target topology can be used as the target resource to execute the task.
  • the execution of the task needs to be suspended until it is determined that there is a first node that meets the resource requirement and has at least one preset topology server, execute this task again.
  • the target node server for executing the task may be determined from at least one initial node server according to the following steps:
  • Step 1 Based on the number of idle resources on the initial node server in at least one initial node server, screen the second node server whose idle resource quantity is less than or equal to the resource demand;
  • Step 2 Determine the target node server for executing the task based on the idle resources on the second node server and the resource requirements of the task.
  • the single-node multi-resource communication task requires more computation than communication, it is possible to filter out the number of idle resources based on the number of idle resources on at least one of the initial node servers.
  • a second node server that is less than or equal to the resource requirement.
  • At least one preset topology corresponding to the resource demand can be determined, and whether there is a second node server with any preset topology in the second node server is screened, and if so, the second node server is used as the target node server, and use the idle resources in the target node server as the target resources, here, since the number of idle resources of the second node server screened is less than or equal to the resource demand, the screened ones have any preset topology The number of idle resources included in the second node server must be equal to the resource demand.
  • the second node server with any preset topology is not screened out from the second node servers, then wait for the execution of the task, and then reacquire idle resources on the node server after a preset period of time, and then re-acquire the idle resources on the node server. Screen out the second node servers whose number of idle resources is less than or equal to the resource demand, and allocate resources for the task until a target node server capable of executing the task can be selected from the second node servers.
  • the resources in the node server are often used alone, and the execution speed of single-resource-type tasks is faster, so the node server will There is often a single resource that has just been released, so when it is determined that the number of idle resources on at least one node server has changed, it can be determined whether the existing idle resources on the node server and the single resource that has just been released can form a corresponding resource requirement Any preset topology structure, if yes, 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.
  • the task type when the task type includes a multi-node type, multiple node servers need to be selected to execute the task of the task type.
  • the multi-node type According to the corresponding resource demand and the maximum number of idle resources included on the node server (that is, the number of resources included on the node server), first allocate the maximum number of empty-loaded third tasks from the initial node server node server, and use the empty third node server as the target server. For example, if the resource requirement is 35, and the number of resources included in the node server is 8, then 4 unloaded third node servers are allocated to it first.
  • the total amount of resources included in the maximum number of third node servers is less than the resource requirement, it means that the task cannot be completed by using the maximum number of third node servers, and it is necessary to use another initial node server 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 initial node server that needs to be used in addition.
  • a target node server can be selected for the task of the multi-node type according to the method of allocating resources for the task of the single-node multi-resource computing type.
  • filter the fourth node server whose number of idle resources is less than or equal to the difference based on the above-mentioned embodiment
  • the target node server is selected from the fourth node server, and then, the selected empty target node server and the target node server can be assigned to the multi-node task.
  • the resource requirement of the task type is 1, and only a single resource is required to complete it. Therefore, it can be directly based on the idle resource on the initial node server.
  • the initial node server whose number of idle resources is equal to the resource demand is taken as the target node server, if there are multiple initial node servers with the number of idle resources equal to the resource demand, any initial node server can be randomly selected as the target server.
  • the task type of the task may also be determined according to the following steps:
  • Step 1 Obtain idle resources on the node server.
  • idle resources on the node server can be obtained at the same time.
  • Step 2 According to the task information, determine the resource demand amount of the task and the traffic demand information of the task.
  • Step 3 Determine the target node server for executing the task and the target resource on the target node server based on the idle resources on the node server, the resource demand of the task, and the traffic demand information of the task.
  • the task scheduling system can directly determine the target that can meet the traffic demand corresponding to the resource demand and communication demand information based on the resource demand required by the task to be processed, the idle resources on the node server, and the traffic demand information.
  • Node server and target resource are optional preset topology.
  • Step 4 Determine the task type of the task based on the target node server executing the task and the target resource on the target node server.
  • the task type of the task may be determined based on the determined quantity of the target node server, the quantity of the target resource on the target node server, and the traffic requirement information.
  • the target node server and target resource can be determined, and then, the target node server and target resource corresponding to the task type can be directly assigned to the task to be processed, omitting the time for selecting the initial node server, and improving The speed and efficiency of resource scheduling, thereby improving the speed and efficiency of task execution.
  • the user can also directly mark the task type of the task to be processed in the submitted configuration file, and then the task scheduling system can directly determine the task type of the task from the obtained configuration file, and As the task information obtained for this task.
  • tasks of different task types have different resource allocation priorities.
  • the task type of each task can be determined first, and then based on the task type of each task Task type, which determines the resource allocation priority for each task.
  • the target node server for executing the task and the target resource on the target node server can be determined, so as to allocate resources to the task reasonably.
  • 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; multi-node The resource allocation priority of the type task is set to the third priority; the resource allocation priority of the single resource type task is set to the fourth priority.
  • tasks of the single-node multi-resource communication type have a high demand for communication traffic.
  • Setting the task of this task type as the first priority can meet the required communication traffic and increase the speed of executing tasks of this task type.
  • Tasks of the single-node multi-resource computing type have high demands on the amount of computation and relatively small demands on communication traffic.
  • Setting this type of task as the second priority can meet the required amount of computation and reduce the need for The split probability of the original topology of idle resources in node servers with a large number of idle resources.
  • Multi-node tasks require empty node servers and there are relatively few tasks of this task type.
  • the task information may include the resource requirement, therefore, the resource requirement may be obtained according to the following steps:
  • Step 1 Obtain the configuration file of the task to be processed.
  • Step 2 obtaining the resource requirement of the task to be processed from the configuration file.
  • the resource requirement information of the task to be processed can be directly determined in the configuration file.
  • the task scheduling system can directly acquire the resource requirement of the task to be processed from the acquired configuration file, and use it as the acquired task information of the task.
  • the resource demand can be obtained without parsing the configuration file, which improves the speed of determining the resource demand.
  • the task information may include traffic demand information, therefore, the traffic demand information may be obtained according to the following steps:
  • Step 1 Obtain calculation volume information and communication volume information of tasks to be processed.
  • the calculation amount information and communication amount information of the task to be processed can be determined based on the analysis of the obtained configuration file of the task to be processed, or based on the analysis of the obtained task request to be processed; wherein, the task request Including calculation amount information and communication amount information, the task request may be a request submitted by a user on the client to allocate resources for the task.
  • Step 2 Based on the calculation amount information and the communication amount information, determine the communication amount requirement information.
  • a 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 demand information may be determined.
  • the traffic demand information may also be obtained according to the following steps:
  • Step 1 Obtain the configuration file of the task to be processed
  • Step 2 Obtain the communication traffic requirement information of the task to be processed from the configuration file.
  • the configuration file submitted by the user may directly include the traffic demand information of the task to be processed.
  • the task scheduling system may directly acquire the traffic demand information of the task to be processed from the acquired configuration file, and use it as the acquired task information of the task.
  • the configuration file does not need to be parsed 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.
  • an embodiment of the present disclosure provides a task scheduling method applied to a client, as shown in FIG. 8 , which is a flow chart of a task scheduling method applied to a client provided by an embodiment of the present disclosure, which may include the following steps :
  • the client can directly determine the task type of the task based on the configuration file.
  • S802 Based on the task type of the task, determine the target node server for executing the task and the target resource on the target node server.
  • the ways of determining the target node server and the target resource are different.
  • the client After determining the task type of the task, the client can determine the target node server that can be used to execute the task and the target resource on the target node server according to the idle resources on the node server and the task type of the task.
  • the target resource is an idle resource.
  • 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.
  • the client may directly send the determined target node server information and target resource information to the scheduler, that is, to the task scheduling system.
  • 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 information of the target node server and the target resource, and then, the target node server and the target resource can be Assigned to pending tasks.
  • the client first determines the target node server and target resource based on the determined task type, and then sends it to the scheduler.
  • the scheduler omits the step of determining the target node server and target resource, and can directly send the target node server and target Resources are allocated to tasks, so that the speed of resource scheduling and the execution speed and efficiency of tasks can be improved.
  • the task type may be determined according to the following steps:
  • Step 1 Determine the resource requirement of the task, the communication traffic requirement information of the task, and the resource quantity in the node server.
  • the client can determine the resource requirement of the task and the communication traffic requirement information of the task based on the analysis of the configuration file.
  • the task's resource requirement and the task's traffic requirement information can be obtained directly from the configuration file, which is not limited here.
  • the client can determine the resource quantity in the node server in the task scheduling system.
  • the number of resources is the number of GPUs.
  • Step 2 Determine the task type of the task based on the determined resource demand, the communication traffic demand information of the task, and the resource quantity in the node server.
  • 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 server, that is, the number of target node servers corresponding to the task to be processed can be determined. in, in, Indicates rounding up.
  • 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 traffic demand information of the task.
  • the task type may also be determined according to the following steps:
  • Step 1 Obtain idle resources on the node server.
  • the client After the client obtains the configuration file submitted by the user, it can simultaneously obtain idle resources on the node server.
  • Step 2 Determine at least one target node server for executing the task and target resources on the target node server based on idle resources on the node server, resource requirements of the task, and traffic requirements of the task.
  • the client can directly determine the target node that can meet the traffic demand corresponding to the resource demand and communication demand information based on the resource demand required by the task to be processed, the idle resources on the node server, and the traffic demand information Server and target resources.
  • the target resource in the target node server has an optional preset topology.
  • Step 3 Determine the task type of the task based on at least one target node server and target resources on the target node server.
  • the task type of the task may be determined based on the determined number of target node servers, the number of target resources on the target node server, and traffic demand information.
  • the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possible
  • the inner logic is OK.
  • the embodiment of the present disclosure also provides a task scheduling device corresponding to the task scheduling method applied to the scheduler, because the problem-solving principle of 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 , so the implementation of the device can refer to the implementation of the method, and the repetition will not be repeated.
  • FIG. 9 it is a schematic diagram of a task scheduling device applied to the scheduler side provided by an embodiment of the present disclosure, including:
  • An acquisition module 901, configured to acquire task information of tasks to be processed
  • the first determining module 902 is configured to determine the task type of the task based on the task information
  • the second determination module 903 is configured to determine the target node server for executing the task and the target resource on the target node server based on the task type;
  • An allocating module 904 configured to allocate the target node server and target resources on the target node server to execute the task.
  • the first determining module 902 is configured to determine the resource requirement of the task and the traffic requirement information of the task according to the task information;
  • the task type of the task is determined based on the determined resource demand, communication traffic demand information of the task, and resource quantity in the node server.
  • the second determination module 903 is configured to determine the target node for executing the task based on the task type of the task, the resource demand of the task, and the idle resources on the node server server and the target resource on the target node server.
  • the second determining module 903 is configured to determine at least one initial node server matching the task type based on the task type of the task;
  • a target node server for executing the task and target resources on the target node server from the at least one initial node server.
  • the task type includes a single-node multi-resource communication type
  • the second determination module 903 is configured to, based on the number of idle resources on the initial node servers in the at least one initial node server, select the initial node server whose number of idle resources is greater than or equal to the resource requirement as the first node server;
  • a target node server for executing the task is determined based on idle resources on the first node server and resource requirements of the task.
  • the second determination module 903 is configured to determine at least one preset topology corresponding to the resource requirement
  • the first node server having any one of the preset topology structures and the least number of idle resources as the target node server.
  • the second determination module 903 is configured to use a preset topology in the target node server as the target topology;
  • the task type includes a single-node multi-resource computing type
  • the second determining module 903 is configured to, based on the number of idle resources on the initial node servers in the at least one initial node server, screen a second node server whose number of idle resources is less than or equal to the resource requirement;
  • a target node server for executing the task is determined based on idle resources on the second node server and resource requirements of the task.
  • the second determination module 903 is configured to determine at least one preset topology corresponding to the resource requirement
  • the second determining module 903 is further configured to, when no second node server having any one of the preset topology structures is screened out from the second node servers, After a preset period of time or at least one idle resource on the node server changes, reacquire the number of idle resources on the node server, and return based on the number of idle resources on the initial node server among the at least one initial node server, filter A step of the second node server whose number of idle resources is less than or equal to the required amount of resources.
  • the task type includes a multi-node type
  • the second determination module 903 is configured to determine, from the at least one initial node server, the maximum number of third node servers required to execute the task based on the resource requirement of the task; wherein, the third node The server is an empty initial node server;
  • the third node server with the maximum number is used as the target node server.
  • the second determination module 903 is further configured to determine the total amount of resources and the difference in resource requirements
  • the task type includes a single resource type
  • the second determining module 903 is configured to, based on the number of idle resources on the initial node servers in the at least one initial node server, use the initial node server whose number of idle resources is equal to the resource requirement as the target node server.
  • the second determination module 903 is further configured to determine a preset topology according to the following steps:
  • a preset topology corresponding to any number of idle resources in the node server to be matched is determined.
  • the second determining module 903 is configured to sort the topological structures according to the order of the communication waiting time from low to high;
  • the topological structure whose sort order is smaller than the preset order is used as the preset topology structure corresponding to the node server to be matched.
  • the second determination module 903 is configured to, for any number of idle resources, use the topology structure whose communication waiting time is less than a preset waiting threshold as the The default topology corresponding to the number of idle resources.
  • the first determining module 902 is configured to acquire idle resources on the node server
  • the task information determine the resource requirement of the task and the traffic requirement information of the task
  • the task type of the task is determined based on the target node server executing the task and the target resource on the target node server.
  • the second determination module 903 is further configured to determine the resources of each task based on the task type of each task when the obtained tasks to be processed include multiple Assign priority;
  • a target node server for executing the task and target resources on the target node server are determined.
  • the task type includes single-node multi-resource communication type, single-node multi-resource computing type, multi-node type, and single-resource type;
  • the second determination module 903 is configured to set the resource allocation priority of the task of the single-node multi-resource communication type as the first priority
  • the task information includes the resource requirement
  • the first determining module 902 is further configured to obtain the resource requirement according to the following steps:
  • the task information includes the traffic demand information
  • the first determining module 902 is further configured to acquire the traffic demand information according to the following steps:
  • the communication amount requirement information is determined.
  • the first determining module 902 is configured to determine, based on the obtained configuration file of the pending task or the obtained request of the pending task, the Calculation amount information and communication amount information; wherein, the task request includes the calculation amount information and communication amount information.
  • the task information includes the traffic demand information
  • the first determining module 902 is further configured to acquire the traffic demand information according to the following steps:
  • the first determining module 902 is configured to determine the number of target node servers corresponding to the task to be processed based on the resource requirement and the number of resources in the node server;
  • the task type of the task to be processed is determined based on the number of target node servers corresponding to the task to be processed and the traffic demand information.
  • the task type includes single-node multi-resource communication type, single-node multi-resource computing type, multi-node type, and single-resource type;
  • the first determining module 902 is configured to: 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 traffic demand information indicates When the communication volume requirement of the task to be processed is higher than the calculation volume requirement, determine that the task type of the task to be processed is a single-node multi-resource communication type;
  • 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 traffic demand information indicates the calculation capacity demand of the task to be processed If it is higher than the communication traffic requirement, it is determined that the task type of the task to be processed is a single-node multi-resource computing type;
  • the task type of the task to be processed is a single resource type.
  • the embodiment of the present disclosure also provides a task scheduling device corresponding to the task scheduling method applied to the client. Since the problem-solving principle of 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, Therefore, the implementation of the device can refer to the implementation of the method, and the repetition will not be repeated.
  • FIG. 10 it is a schematic diagram of a task scheduling device applied to a client provided by an embodiment of the present disclosure, including:
  • the third determination module 1001 is configured to determine the task type of the task to be processed
  • a fourth determining module 1002 configured 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;
  • a sending module 1003 configured to send the information of the target node server and the information of the target resource to a scheduler, so that the scheduler allocates the target node server and the target resource to the pending Task
  • the third determination module 1001 is configured to determine the resource requirement of the task, the traffic requirement information of the task, and the resource quantity in the node server;
  • the task type of the task is determined based on the determined resource demand, communication traffic demand information of the task, and resource quantity in the node server.
  • the third determination module 1001 is configured to acquire idle resources on the node server
  • a task type of the task is determined based on the at least one target node server and target resources on the target node server.
  • FIG. 11 is a schematic structural diagram of a computer device provided by an embodiment of the present disclosure, including:
  • Processor 1101 and memory 1102 stores machine-readable instructions executable by the processor 1101, the processor 1101 is used to execute the machine-readable instructions stored in the memory 1102, and the machine-readable instructions are executed by the processor 1101 During execution, the processor 1101 performs the following steps: S101: Obtain the task information of the task to be processed; S102: Determine the task type of the task based on the task information; S103: Determine the target node server and the target node for executing the task based on the task type The target resource on the server and S104: allocate the target node server and the target resource on the target node server to execute the task.
  • the above-mentioned memory 1102 includes a memory 1121 and an external memory 1122; the memory 1121 here is also called an internal memory, and is used to temporarily store the calculation data in the processor 1101 and the data exchanged with the external memory 1122 such as a hard disk.
  • the external memory 1122 performs data exchange.
  • Embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the steps of the task scheduling method described in the foregoing method embodiments are executed.
  • the storage medium may be a volatile or non-volatile computer-readable storage medium.
  • the computer program product of the task scheduling method provided by the embodiments 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 embodiments
  • program code can be used to execute the steps of the task scheduling method described in the above method embodiments
  • the computer program product can be specifically realized by means of hardware, software or a combination thereof.
  • 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 (Software Development Kit, SDK) etc. Wait.
  • a software development kit Software Development Kit, SDK
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are illustrative.
  • the division of the units is a logical function division.
  • multiple units or components can be combined, or some Features can be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • 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 may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor.
  • the technical solution of the present disclosure is essentially 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, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Computer And Data Communications (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present disclosure provides a task scheduling method and apparatus, a computer device and a storage medium. The method comprises: acquiring task information of a task to be processed; determining the task type of the task on the basis of the task information; determining a target node server for executing the task and a target resource on the target node server on the basis of the task type; and allocating the target node server and the target resource on the target node server to execute the task. Alternatively, the method comprises: determining the task type of a task to be processed; determining a target node server for executing the task and a target resource on the target node server on the basis of the task type of said task; and sending information of the target node server and information of the target resource to a scheduler, such that the scheduler allocates the target node server and the target resource to said task.

Description

一种任务调度方法、装置、计算机设备和存储介质A task scheduling method, device, computer equipment and storage medium
本申请要求2021年05月27日提交、申请号为202110586526.2,发明名称为“一种任务调度方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on May 27, 2021, with the application number 202110586526.2, and the title of the invention is "a task scheduling method, device, computer equipment, and storage medium", the entire contents of which are incorporated herein by reference. Applying.
技术领域technical field
本公开涉及计算机技术领域,具体而言,涉及一种任务调度方法、装置、计算机设备和存储介质。The present disclosure relates to the field of computer technology, in particular, to a task scheduling method, device, computer equipment and storage medium.
背景技术Background technique
为满足不同的深度学习任务对应的不同资源需求,任务调度系统发挥着越来越重要的作用,现有技术中,应用于任务调度系统中的任务调度方法,大多基于深度学习任务的资源需求量,以分配尽量少的节点服务器为目标为深度学习任务调度资源。In order to meet the different resource requirements corresponding to different deep learning tasks, the task scheduling system is playing an increasingly important role. In the prior art, the task scheduling methods applied 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 deep learning tasks.
发明内容Contents of the invention
本公开实施例至少提供一种任务调度方法、装置、计算机设备和存储介质。Embodiments of the present disclosure at least provide a task scheduling method, device, computer equipment, and storage medium.
第一方面,本公开实施例提供了一种任务调度方法,包括:In a first aspect, an embodiment of the present disclosure provides a task scheduling method, including:
获取待处理的任务的任务信息;Obtain task information of pending tasks;
基于所述任务信息,确定所述任务的任务类型;determining a task type of the task based on the task information;
基于所述任务类型,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;Based on the task type, determine a target node server for executing the task and target resources on the target node server;
将所述目标节点服务器以及所述目标节点服务器上的目标资源分配用于执行所述任务。Allocating the target node server and target resources on the target node server to perform the task.
任务信息能够反映待处理的任务的资源需求量和通讯量需求信息等信息,从而,基于任务信息,能够确定与任务信息匹配的任务类型。不同任务类型的任务对应的确定目标节点服务器和目标资源的方式不同,基于确定的任务类型,能够确定出与该任务类型相匹配的资源确定方式,进而,利用确定的资源确定方式为待处理的任务分配目标资源,能够提高分配的目标资源的合理性,进而,利用确定目标资源执行待处理的任务,能够提高任务执行的速度和效率。The task information can reflect information such as the resource demand amount and traffic demand information of the task to be processed, so that based on the task information, the task type matching the task information can be determined. The methods of determining the target node server and target resources are different for different task types. Based on the determined task type, the resource determination method matching the task type can be determined, and then, the determined resource determination method can be used as the resource determination method to be processed. Assigning target resources to tasks can improve the rationality of the allocated target resources, and then, using the determined target resources to execute tasks to be processed can improve the speed and efficiency of task execution.
在一种可能的实施方式中,所述根据所述任务信息,确定所述任务的任务类型,包括:In a possible implementation manner, the determining the task type of the task according to the task information includes:
根据所述任务信息,确定所述任务的资源需求量、所述任务的通讯量需求信息;According to the task information, determine the resource requirement of the task and the traffic requirement information of the task;
确定节点服务器中的资源数量;Determine the number of resources in the node server;
基于确定的所述资源需求量、任务的通讯量需求信息、所述节点服务器中的资源数量,确定所述任务的任务类型。The task type of the task is determined based on the determined resource demand, communication traffic demand information of the task, and resource quantity in the node server.
这样,通讯量需求信息能够反映任务对于通信量和计算量的需求信息,资源需求量能够反映执行任务所需的空闲资源的数量,节点服务器中的资源数量能够反映出一个节点服务器中的最大空闲资源数量。进而,基于资源需求量、任务的通讯量需求信息、节点服务器中的资源数量,能够准确地确定出待处理任务的任务类型。In this way, the traffic demand information can reflect the demand information of the task for the traffic and calculation volume, 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 idle resources in a node server resource quantity. Furthermore, the task type of the task to be processed can be accurately determined based on the resource demand, the communication traffic demand information of the task, and the resource quantity in the node server.
在一种可能的实施方式中,所述基于所述任务类型,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源,包括:In a possible implementation manner, the determining the target node server for executing the task and the target resource on the target node server based on the task type includes:
基于所述任务的任务类型、所述任务的资源需求量以及节点服务器上的空闲资源,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源。A target node server for executing the task and target resources on the target node server are determined based on the task type of the task, the resource requirement of the task, and the idle resources on the node server.
这样,不同的任务类型的任务具有不同的资源分配优先级,比如,对通信量要求较高的单节点多资源通讯类型的任务,资源分配优先级较高,因此可以从空闲资源的数量大于资源需求量的节点服务器中筛选目标节点服务器,对于计算量较多的单节点多资源计算类型的任务,资源分配优先级相对单节点多资源通讯类型的优先级低,因此,可以从空闲资源的数量小于资源需求量的节点服务器中筛选目标节点服务器。这样,根据不同的任务类型来为任务分配目标节点服务器和目标节点服务器中的目标资源,能够实现将节点服务器中的空闲资源合理地分配给不同的任务,从而,提高任 务调度和执行的速度和效率。In this way, tasks of different task types have different resource allocation priorities. For example, tasks of the single-node multi-resource communication type that require high communication traffic have higher resource allocation priorities, so the number of idle resources can be greater than that of resource allocation. Select the target node server from the node server with the required amount. For tasks of the single-node multi-resource computing type with a large amount of calculation, the resource allocation priority is lower than that of the single-node multi-resource communication type. Therefore, the number of idle resources can be Select the target node server from the node servers that are smaller than the resource requirement. In this way, assigning the target node server and the target resources in the target node server to tasks according to different task types can realize the rational allocation of idle resources in the node server to different tasks, thereby improving the speed and efficiency of task scheduling and execution. efficiency.
在一种可能的实施方式中,所述基于所述任务的任务类型、所述任务的资源需求量以及节点服务器上的空闲资源,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源,包括:In a possible implementation manner, based on the task type of the task, the resource demand of the task, and the idle resources on the node server, determine the target node server for executing the task and the target node server on the target node server. target resources, including:
基于所述任务的任务类型,确定与所述任务类型相匹配的至少一个初始节点服务器;determining at least one initial node server matching the task type based on the task type of the task;
基于所述任务的资源需求量以及初始节点服务器上的空闲资源,从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源。Based on the resource requirements of the task and idle resources on the initial node server, determine a target node server for executing the task and target resources on the target node server from the at least one initial node server.
这样,基于任务类型,能够先筛选出能够执行待处理的任务的初始节点服务器,再根据任务的资源需求量和初始节点服务器上的空闲资源,筛选出最终的用于执行待处理的任务的目标节点服务器和目标资源,从而,筛选出的目标节点服务器和目标资源不仅能够执行待处理的任务,还能够具有较快的执行速度,从而,提高任务执行的速度和效率。In this way, based on the task type, the initial node server that can execute the task to be processed can be selected first, and then the final target for executing the task to be processed can be selected according to the resource demand of the task and the idle resources on the initial node server The node server and the target resource, thus, the selected target node server and target resource can not only execute the task to be processed, but also have a faster execution speed, thereby improving the speed and efficiency of task execution.
在一种可能的实施方式中,所述任务类型包括单节点多资源通讯类型;In a possible implementation manner, the task type includes a single-node multi-resource communication type;
所述从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器,包括:The determining the target node server for performing the task from the at least one initial node server includes:
基于所述至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,筛选空闲资源的数量大于或等于所述资源需求量的初始节点服务器作为第一节点服务器;Based on the number of idle resources on the initial node server in the at least one initial node server, select the initial node server whose number of idle resources is greater than or equal to the resource demand as the first node server;
基于所述第一节点服务器上的空闲资源和所述任务的资源需求量,确定执行所述任务的目标节点服务器。A target node server for executing the task is determined based on idle resources on the first node server and resource requirements of the task.
这样,单节点多资源通讯类型对于通信量的需求较高,因此选取包括空闲资源的数量大于或等于资源需求量的第一节点服务器,而不是等待空闲资源的数量小于资源需求量的其他节点服务器释放资源,实现将空闲资源的数量较多的初始节点服务器优先分配给该类型的任务,以满足该类型的任务的通信量需求,进而,从第一节点服务器中选取执行任务的目标节点服务器,能够有效提高该类型的任务的调度和执行效率。In this way, the single-node multi-resource communication type has a high demand for traffic, so select the first node server whose number of idle resources is greater than or equal to the resource demand, instead of waiting for other node servers whose number of idle resources is less than the resource demand Releasing resources, realizing that the initial node server with a large number of idle resources is preferentially allocated to this type of task, so as to meet the traffic demand of this type of task, and then select the target node server for executing the task from the first node server, It can effectively improve the scheduling and execution efficiency of this type of task.
在一种可能的实施方式中,所述基于所述第一节点服务器上的空闲资源和所述任务的资源需求量,确定执行所述任务的目标节点服务器,包括:In a possible implementation manner, the determining the target node server for executing the task based on the idle resources on the first node server and the resource requirement of the task includes:
确定所述资源需求量对应的至少一个预设拓扑结构;determining at least one preset topology structure corresponding to the resource requirement;
在所述第一节点服务器中筛选具有任一个所述预设拓扑结构,并且空闲资源的数量最少的第一节点服务器作为所述目标节点服务器。Selecting, among the first node servers, the first node server having any one of the preset topology structures and the least number of idle resources as the target node server.
这样,具有预设拓扑结构的资源之间具有较高的通信质量,利用具有预设拓扑结构的目标节点服务器,能够进一步提高执行单节点多资源通讯类型的任务的速度。另外,选取空闲资源的数量最少的第一节点服务器,能够减少对空闲资源的数量多的第一节点服务器中的空闲资源的原有拓扑结构的拆分,实现对可选的拓扑结构的保护以及将其合理应用在单节点多资源通讯类型等其他任务上。In this way, resources with a preset topology have higher communication quality, and the use of the target node server with a preset topology can further increase the speed of executing single-node multi-resource communication tasks. In addition, selecting the first node server with the least number of idle resources can reduce the splitting of the original topology structure of the idle resources in the first node server with a large number of idle resources, and realize the protection of the optional topology structure and Apply it reasonably to other tasks such as single-node multi-resource communication types.
在一种可能的实施方式中,确定所述目标节点服务器上的目标资源,包括:In a possible implementation manner, determining the target resource on the target node server includes:
将所述目标节点服务器中的具有的预设拓扑结构作为目标拓扑结构;Taking the preset topology in the target node server as the target topology;
将目标节点服务器中构成所述目标拓扑结构的空闲资源作为所述目标资源。Taking idle resources constituting the target topology in the target node server as the target resources.
这样,能够实现利用具有目标拓扑结构的目标资源执行单节点多资源通讯类型的任务,提高执行该类型的任务的调度和执行效率。In this way, it is possible to use the target resources with the target topology to execute single-node multi-resource communication tasks, and improve the scheduling and execution efficiency of this type of tasks.
在一种可能的实施方式中,所述任务类型包括单节点多资源计算类型;In a possible implementation manner, the task type includes a single-node multi-resource computing type;
所述从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器,包括:The determining the target node server for performing the task from the at least one initial node server includes:
基于所述至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,筛选空闲资源的数量小于或等于所述资源需求量的第二节点服务器;Based on the number of idle resources on the initial node server in the at least one initial node server, screening the second node server whose number of idle resources is less than or equal to the resource requirement;
基于所述第二节点服务器上的空闲资源和所述任务的资源需求量,确定执行所述任务的目标节点服务器。A target node server for executing the task is determined based on idle resources on the second node server and resource requirements of the task.
这样,单节点多资源计算类型对于计算量的需求较高,对于通信量的需求较小,因此,选取包括空闲资源的数量小于资源需求量的第二节点服务器,能够满足该类型的任务的通信量需求和计算量需求,在一定程度上提高该类型的任务的调度和执行效率。进一步地,该类型的任务不占用空闲资源的数量大于资源需求量的初始节点服务器,能够将该类节点服务器留给资源需求较高的单节点多资源通讯类型的任务,实现了在提高单节点多资源计算类型的任务的调度和执行效率的同时,提高了单节点多资源通讯类型的任务的调度和执行效率。进一步地,该实施方式能够降低对空闲资源的数量多的初始节点服务器中的空闲资源的原有拓扑结构的拆分概率,实现对可选的拓扑结构的保护以及将其合理应用在单节点多资源通讯类型等其他任务上。In this way, the single-node multi-resource computing type has a high demand for calculation volume and a small demand for communication volume. Therefore, selecting a second node server with a number of idle resources smaller than the resource demand can meet the communication requirements of this type of task. It can improve the scheduling and execution efficiency of this type of task to a certain extent. Furthermore, this type of task does not occupy the initial node server whose number of idle resources is greater than the resource demand, and can reserve this type of node server for the task of single-node multi-resource communication type with high resource demand, which realizes the improvement of single-node While the scheduling and execution efficiency of multi-resource computing tasks is improved, the scheduling and execution efficiency of single-node multi-resource communication tasks is improved. Furthermore, this embodiment can reduce the splitting probability of the original topology structure of idle resources in the initial node server with a large number of idle resources, realize the protection of the optional topology structure and rationally apply it to multiple Resource communication types and other tasks.
在一种可能的实施方式中,所述基于所述第二节点服务器上的空闲资源和所述任务的资源需求 量,确定执行所述任务的目标节点服务器,包括:In a possible implementation manner, the determining the target node server for executing the task based on the idle resources on the second node server and the resource requirement of the task includes:
确定所述资源需求量对应的至少一个预设拓扑结构;determining at least one preset topology structure corresponding to the resource requirement;
在所述第二节点服务器中筛选具有任一个所述预设拓扑结构的第二服务器作为所述目标节点服务器。Selecting any second server with the preset topology among the second node servers as the target node server.
这样,具有预设拓扑结构的资源之间具有较高的通信质量,利用具有预设拓扑结构的目标节点服务器,能够提高单节点多资源计算类型的任务的调度和执行效率。In this way, resources with a preset topology have higher communication quality, and using the target node server with a preset topology can improve the scheduling and execution efficiency of single-node multi-resource computing tasks.
在一种可能的实施方式中,所述基于所述第二节点服务器上的空闲资源和所述任务的资源需求量,确定执行所述任务的目标节点服务器,还包括:In a possible implementation manner, the determining the 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 with any one of the preset topology structures is screened out from the second node servers, after a preset period of time or at least one idle resource on the node server changes, the node server is reacquired and returning to the step of screening the second node server whose number of idle resources is less than or equal to the resource requirement based on the number of idle resources on the initial node server among the at least one initial node server.
这样,利用重新获取节点服务器上的空闲资源的数量的方法,能够及时地为任务分配所需要的、且具有预设拓扑结构的空闲资源,进而,能够及时地执行单节点多资源计算类型的任务。另外,还能够降低对空闲资源的数量较多的初始节点服务器中的空闲资源的原有拓扑结构的拆分概率,实现对可选的拓扑结构的保护以及将其合理应用在单节点多资源通信类型等其他任务上。In this way, by using the method of reacquiring the number of idle resources on the node server, the required idle resources with a preset topology can be allocated to tasks in a timely manner, and further, tasks of the single-node multi-resource computing type can be executed in a timely manner . In addition, it can also reduce the split probability of the original topology structure of idle resources in the initial node server with a large number of idle resources, realize the protection of optional topology structures and rationally apply it in single-node multi-resource communication type and other tasks.
在一种可能的实施方式中,所述任务类型包括多节点类型;In a possible implementation manner, the task type includes a multi-node type;
所述从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器,包括:The determining the target node server for performing the task from the at least one initial node server includes:
基于所述任务的资源需求量,从所述至少一个初始节点服务器中,确定执行任务所需的第三节点服务器的最大数量;其中,所述第三节点服务器为空载的初始节点服务器;Based on the resource requirement of the task, from the at least one initial node server, determine the maximum number of third node servers required to perform the task; wherein, the third node server is an empty initial node server;
将所述最大数量的第三节点服务器作为所述目标节点服务器。The third node server with the maximum number is used as the target node server.
这样,空载的第三节点服务器中的空闲资源具有可选的拓扑结构,选取最大数量的第三节点服务器作为目标节点服务器,能够保证用于执行多节点类型的任务的目标节点服务器都具有可选的拓扑结构,从而能够提高执行多节点类型的任务的效率。In this way, idle resources in the unloaded third node server have an optional topology structure, and selecting the third node server with the largest number as the target node server can ensure that the target node servers used to perform multi-node tasks have available The selected topology can improve the efficiency of executing multi-node type tasks.
在一种可能的实施方式中,所述从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器,还包括:In a possible implementation manner, the determining the target node server for executing the task from the at least one initial node server further includes:
在最大数量的第三节点服务器上的资源总量小于所述资源需求量的情况下,确定所述资源总量与所述资源需求量的差值;When the total amount of resources on the largest number of third node servers is less than the resource requirement, determine the difference between the resource total and the resource requirement;
基于初始节点服务器上的空闲资源的数量,筛选空闲资源的数量小于或等于所述差值的第四节点服务器;Based on the number of idle resources on the initial node server, screening a fourth node server whose number of idle resources is less than or equal to the difference;
基于所述第四节点服务器上的空闲资源和所述差值,确定执行所述任务的目标节点服务器。Based on the free resources on the fourth node server and the difference, determine a target node server for executing the task.
这样,资源总量与资源需求量的差值能够反映任务除需要空载的目标节点服务器所包括的空闲资源之外,还需要在其他的初始节点服务器上选取目标资源,进而,基于差值选取第四节点服务器,能够实现对任务所需要的空闲资源的合理分配,从而,能够提高执行任务的速度。In this way, the difference between the total amount of resources and the resource demand 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, and then, based on the difference, select The fourth node server can realize the reasonable allocation of idle resources required by the task, thereby improving the speed of executing the task.
在一种可能的实施方式中,所述任务类型包括单资源类型;In a possible implementation manner, the task type includes a single resource type;
所述从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器,包括:The determining the target node server for performing the task from the at least one initial node server includes:
基于所述至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,将空闲资源的数量与所述资源需求量相等的初始节点服务器作为所述目标节点服务器。Based on the number of idle resources on the initial node server in the at least one initial node server, the initial node server whose idle resource quantity is equal to the resource requirement is used as the target node server.
这样,单资源类型的任务只需要一个空闲资源即可以执行,因此,利用空闲资源的数量与资源需求量相等的目标节点服务器,就能够快速高效地执行任务。In this way, a task of a single resource type can be executed only by one idle resource. Therefore, the task can be executed quickly and efficiently by using the target node server whose number of idle resources is equal to the resource demand.
在一种可能的实施方式中,还包括确定预设拓扑结构的步骤:In a possible implementation manner, it also includes a step of determining a preset topology:
针对任一待匹配节点服务器中的空闲资源,确定该待匹配节点服务器中的任一数量的空闲资源对应的拓扑结构;For the idle resources in any node server to be matched, determine the topology structure corresponding to any number of idle resources in the node server to be matched;
基于空闲资源之间的通信介质,确定所述拓扑结构的通信等待时长;Determine the communication waiting time of the topology based on the communication medium between idle resources;
基于所述通信等待时长,确定与该待匹配节点服务器中任一数量的空闲资源对应的预设拓扑结构。Based on the communication waiting time, a preset topology corresponding to any number of idle resources in the node server to be matched is determined.
这样,拓扑结构的通信等待时长能够表征利用该拓扑结构执行任务所需要的等待时间,利用通信等待时长,能够筛选出任务执行效率高的预设拓扑结构,从而,利用具有预设拓扑结构的空闲资源执行任务,能够提高任务执行效率。In this way, the communication waiting time of the topology can represent the waiting time required to execute tasks using the topology, and the preset topology with high task execution efficiency can be screened out by using the communication waiting time, so that the idle time with the preset topology can be used Resource execution tasks can improve the efficiency of task execution.
在一种可能的实施方式中,所述基于所述通信等待时长,确定与该待匹配节点服务器中任一数量的空闲资源对应的预设拓扑结构,包括:In a possible implementation manner, the determining a preset topology corresponding to any number of idle resources in the node server to be matched based on the communication waiting time includes:
按照所述通信等待时长从低到高的顺序,将所述拓扑结构进行排序;Sorting the topological structures according to the order of the communication waiting time from low to high;
将排序次序小于预设次序的拓扑结构,作为与该待匹配节点服务器对应的预设拓扑结构。The topological structure whose sort order is smaller than the preset order is used as the preset topology structure corresponding to the node server to be matched.
这样,利用预设次序筛选预设拓扑结构,能够保证筛选出的预设拓扑结构的通信等待时长相对较短,进而,利用该预设拓扑结构执行任务,能够实现以较快的速度执行任务。In this way, using the preset order to filter the preset topology can ensure that the communication waiting time of the filtered preset topology is relatively short, and then, using the preset topology to execute tasks can realize task execution at a faster speed.
在一种可能的实施方式中,所述基于所述通信等待时长,确定与该待匹配节点服务器中任一数量的空闲资源对应的预设拓扑结构,包括In a possible implementation manner, the determining a preset topology corresponding to any number of idle resources in the node server to be matched based on the communication waiting time includes
针对任一数量的空闲资源,将所述通信等待时长小于预设等待阈值的拓扑结构,作为与该待匹配节点服务器中的该数量的空闲资源对应的预设拓扑结构。For any number of idle resources, the topology structure whose communication waiting time is shorter than the preset waiting threshold is taken as the preset topology structure corresponding to the number of idle resources in the node server to be matched.
这样,利用预设等待阈值筛选预设拓扑结构,能够保证筛选出的预设拓扑结构的通信等待时长小于预设等待阈值,进而,利用该预设拓扑结构执行任务,能够合理地降低执行任务需要的通信等待时长。In this way, using the preset waiting threshold to filter the preset topology can ensure that the communication waiting time of the filtered preset topology is less than the preset waiting threshold, and then, using the preset topology to execute tasks can reasonably reduce the need for task execution. communication waiting time.
在一种可能的实施方式中,所述根据所述任务信息,确定所述任务的任务类型,包括:In a possible implementation manner, the determining the task type of the task according to the task information includes:
获取节点服务器上的空闲资源;Obtain idle resources on the node server;
根据所述任务信息,确定所述任务的资源需求量、所述任务的通讯量需求信息;According to the task information, determine the resource requirement of the task and the traffic requirement information of the task;
基于所述节点服务器上的空闲资源、所述任务的资源需求量、所述任务的通讯量需求信息,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;Determine a target node server for executing the task and target resources on the target node server based on idle resources on the node server, resource requirements of the task, and traffic demand information of the task;
基于执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源,确定所述任务的任务类型。The task type of the task is determined based on the target node server executing the task and the target resource on the target node server.
这样,在确定任务类型的同时确定目标节点服务器和目标资源,进而,可以直接根据将任务类型对应的目标节点服务器和目标资源分配给待处理的任务,省略了选取初始节点服务器的时间,提高了资源调度的速度和效率,从而,提高了任务执行的速度和效率。In this way, while determining the task type, the target node server and target resource can be determined, and then, the target node server and target resource corresponding to the task type can be directly assigned to the task to be processed, omitting the time for selecting the initial node server, and improving The speed and efficiency of resource scheduling, thereby improving the speed and efficiency of task execution.
在一种可能的实施方式中,所述方法还包括:In a possible implementation manner, the method also includes:
在获取的待处理的任务包括多个的情况下,基于每一个所述任务的任务类型,确定每个任务的资源分配优先级;When the obtained tasks to be processed include multiple tasks, based on the task type of each task, determine the resource allocation priority of each task;
基于每一个所述任务的资源分配优先级,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源。Based on the resource allocation priority of each task, a target node server for executing the task and target resources on the target node server are determined.
这样,基于资源分配优先级为不同的任务分配资源,能够实现将节点服务器中的空闲资源合理地分配给不同的任务。In this way, resources are allocated to different tasks based on resource allocation priorities, so that idle resources in the node server can be reasonably allocated to different tasks.
在一种可能的实施方式中,所述任务类型包括单节点多资源通讯类型、单节点多资源计算类型、多节点类型、单资源类型;In a possible implementation manner, the task type includes single-node multi-resource communication type, single-node multi-resource computing type, multi-node type, and single-resource type;
所述基于每一个所述任务的任务类型,确定每个任务的资源分配优先级,包括:The determining 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 the second priority;
将所述多节点类型的任务的资源分配优先级设置为第三优先级;Setting the resource allocation priority of the task of the multi-node type to the third priority;
将所述单资源类型的任务的资源分配优先级设置为第四优先级。Setting the resource allocation priority of the single-resource type task to the fourth priority.
这样,单节点多资源通讯类型的任务对于通信量的需求较高,将该任务类型的任务设置为第一优先级,能够满足其所需要的通信量,提高执行该任务类型的任务的速度,单节点多资源计算类型的任务对于计算量的需求较高,对于通信量的需求较小,将该任务类型的任务设置为第二优先级,能够满足其所需要的计算量,并能够降低对空闲资源的数量多的节点服务器中的空闲资源的原有拓扑结构的拆分概率,多节点类型的任务需要空载的节点服务器且该任务类型的任务相对较少,将其设置为第三优先级,能够保证及时地为单节点多资源通讯类型的任务和单节点多资源计算类型的任务分配资源,单资源类型的任务只需要一个资源即可以执行,因此设置为第四优先级能够保证在及时地为单节点多资源通讯类型的任务和单节点多资源计算类型的任务分配资源的基础上,不影响该任务类型的任务的执行速度。In this way, tasks of the single-node multi-resource communication type have a high demand for communication traffic. Setting the task of this task type as the first priority can meet the required communication traffic and increase the speed of executing tasks of this task type. Tasks of the single-node multi-resource computing type have high demands on the amount of computation and relatively small demands on communication traffic. Setting this type of task as the second priority can meet the required amount of computation and reduce the need for The split probability of the original topology of idle resources in node servers with a large number of idle resources. Multi-node tasks require empty node servers and there are relatively few tasks of this task type. Set it to the third priority level, which can ensure that resources are allocated for single-node multi-resource communication tasks and single-node multi-resource computing tasks in a timely manner. Single-resource type tasks only need one resource to execute, so setting it as the fourth priority can ensure On the basis of timely allocating resources to single-node multi-resource communication tasks and single-node multi-resource computing tasks, the execution speed of the task type is not affected.
在一种可能的实施方式中,所述任务信息包括所述资源需求量,所述方法还包括获取所述资源需求量的步骤:In a possible implementation manner, the task information includes the resource requirement, and the method further includes the step of obtaining the resource requirement:
获取所述待处理的任务的配置文件;Obtain the configuration file of the task to be processed;
从所述配置文件中获取所述待处理的任务的资源需求量。Obtain the resource requirement of the task to be processed from the configuration file.
这样,直接从配置文件获取资源需求量,提高了确定资源需求量的速度。In this way, the resource requirement is obtained directly from the configuration file, which improves the speed of determining the resource requirement.
在一种可能的实施方式中,所述任务信息包括所述通讯量需求信息,所述方法还包括获取所述通讯量需求信息的步骤:In a possible implementation manner, the task information includes the traffic demand information, and the method further includes the step of acquiring the traffic demand information:
获取所述待处理的任务的计算量信息和通信量信息;Acquiring calculation amount information and communication amount information of the task to be processed;
基于所述计算量信息和通信量信息,确定所述通讯量需求信息。Based on the calculation amount information and communication amount information, the communication amount requirement information is determined.
这样,基于获取的计算量信息和通信量信息确定通讯量需求信息,能够保证确定的通讯量需求信息的准确性。In this way, the traffic demand information is determined based on the acquired calculation traffic information and traffic traffic information, which can ensure the accuracy of the determined traffic traffic demand information.
在一种可能的实施方式中,所述获取所述待处理的任务的计算量信息和通信量信息,包括:In a possible implementation manner, the acquiring the calculation amount information and the communication amount information of the task to be processed includes:
基于获取的所述待处理的任务的配置文件或获取的所述待处理的任务请求,确定所述待处理的任务的计算量信息和通信量信息;其中,所述任务请求中包括所述计算量信息和通信量信息。Based on the obtained configuration file of the task to be processed or the obtained task request to be processed, determine the calculation amount information and communication amount information of the task to be processed; wherein, the task request includes the calculation volume information and traffic information.
这样,基于对配置文件或任务请求的解析,确定计算量信息和通信量信息,能够提高确定的计算量信息和通信量信息的准确性。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, and the accuracy of the determined calculation amount information and the communication amount information can be improved.
在一种可能的实施方式中,所述任务信息包括所述通讯量需求信息,所述方法还包括获取所述通讯量需求信息的步骤:In a possible implementation manner, the task information includes the traffic demand information, and the method further includes the step of acquiring the traffic demand information:
获取所述待处理的任务的配置文件;Obtain the configuration file of the task to be processed;
从所述配置文件中获取所述待处理的任务的通讯量需求信息。Acquiring traffic demand information of the task to be processed from the configuration file.
这样,直接从配置文件中获取通讯量需求信息,省略了计算该信息的步骤,提高了确定通讯量需求信息的速度。In this way, the communication traffic requirement information is obtained directly from the configuration file, the step of calculating the information is omitted, and the speed of determining the communication traffic requirement information is improved.
在一种可能的实施方式中,所述基于确定的所述资源需求量、任务的通讯量需求信息、所述节点服务器中的资源数量,确定所述任务的任务类型,包括:In a possible implementation manner, the determining the task type of the task based on the determined resource demand, task traffic demand information, and resource quantity in the node server includes:
基于所述资源需求量和所述节点服务器中的资源数量,确定所述待处理的任务对应的目标节点服务器的数量;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;
基于所述待处理的任务对应的目标节点服务器的数量和所述通讯量需求信息,确定所述待处理的任务的任务类型。The task type of the task to be processed is determined based on the number of target node servers corresponding to the task to be processed and the traffic demand information.
这样,基于节点服务器中的资源数量和节点服务器中的资源数量,能够准确地确定出任务的任务类型。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.
在一种可能的实施方式中,所述任务类型包括单节点多资源通讯类型、单节点多资源计算类型、多节点类型、单资源类型;In a possible implementation manner, the task type includes 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 traffic demand information includes:
在所述待处理的任务对应的目标节点服务器的数量等于1、所述待处理的任务对应的目标资源的数量大于1、并且所述通讯量需求信息指示所述待处理的任务的通信量需求高于计算量需求的情况下,确定所述待处理的任务的任务类型为单节点多资源通讯类型;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 traffic demand information indicates the traffic demand of the task to be processed When the amount of calculation is higher than the demand, it is determined that the task type of the task to be processed is a single-node multi-resource communication type;
在所述待处理的任务对应的目标节点服务器的数量等于1、所述待处理的任务对应的目标资源的数量大于1、并且所述通讯量需求信息指示所述待处理的任务的计算量需求高于通信量需求的情况下,确定所述待处理的任务的任务类型为单节点多资源计算类型;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 traffic demand information indicates the calculation capacity demand of the task to be processed If it is higher than the communication traffic requirement, it is determined that the task type of the task to be processed is a single-node multi-resource computing type;
在所述待处理的任务对应的目标节点服务器的数量大于1的情况下,确定所述待处理的任务的任务类型为多节点类型;When the number of target node servers corresponding to the task to be processed is greater than 1, determine that the task type of the task to be processed is a multi-node type;
在所述待处理的任务对应的目标资源的数量等于1的情况下,确定所述待处理的任务的任务类型为单资源类型。In a case where 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.
这样,能够准确地确定出任务的任务类型。In this way, the task type of the task can be accurately determined.
第二方面,本公开实施例还提供一种任务调度方法,应用于客户端,包括:In the second aspect, the embodiment of the present disclosure also provides a task scheduling method applied to a client, including:
确定待处理的任务的任务类型;Determine the task type of the pending task;
基于所述任务的任务类型,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;Based on the task type of the task, determine a target node server for executing the task and target resources on the target node server;
将所述目标节点服务器的信息以及所述目标资源的信息发送给调度器,以使所述调度器将所述目标节点服务器以及所述目标资源分配给所述待处理的任务。Sending the information of the target node server and the information of the target resource to a scheduler, so that the scheduler allocates the target node server and the target resource to the task to be processed.
这样,客户端基于确定的任务类型先确定目标节点服务器和目标资源,然后将其发送给调度器的方式,调度器省略了确定目标节点服务器和目标资源的步骤,可以直接将目标节点服务器和目标资源分配给任务,从而,能够提高资源调度的速度以及任务的执行速度和效率。In this way, the client first determines the target node server and target resource based on the determined task type, and then sends it to the scheduler. The scheduler omits the step of determining the target node server and target resource, and can directly send the target node server and target Resources are allocated to tasks, so that the speed of resource scheduling and the execution speed and efficiency of tasks can be improved.
在一种可能的实施方式中,所述确定待处理的任务的任务类型,包括:In a possible implementation manner, the determining the task type of the task to be processed includes:
确定所述任务的资源需求量、所述任务的通讯量需求信息以及所述节点服务器中的资源数量;determining the resource requirement of the task, the traffic requirement information of the task, and the resource quantity in the node server;
基于确定的所述资源需求量、任务的通讯量需求信息、所述节点服务器中的资源数量,确定所述任务的任务类型。The task type of the task is determined based on the determined resource demand, communication traffic demand information of the task, and resource quantity in the node server.
这样,通讯量需求信息能够反映任务对于通信量和计算量的需求信息,资源需求量能够反映执行任务所需的空闲资源的数量,节点服务器中的资源数量能够反映出一个节点服务器中的最大空闲资源数量。进而,基于资源需求量、任务的通讯量需求信息、节点服务器中的资源数量,能够准确地确定出待处理任务的任务类型。In this way, the traffic demand information can reflect the demand information of the task for the traffic and calculation volume, 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 idle resources in a node server number of resources. Furthermore, the task type of the task to be processed can be accurately determined based on the resource demand, the communication traffic demand information of the task, and the resource quantity in the node server.
在一种可能的实施方式中,所述确定待处理的任务的任务类型,包括:In a possible implementation manner, the determining the task type of the task to be processed includes:
获取节点服务器上的空闲资源;Obtain idle resources on the node server;
基于所述节点服务器上的空闲资源、所述任务的资源需求量、所述任务的通讯量需求信息,确定执行所述任务的至少一个目标节点服务器以及所述目标节点服务器上的目标资源;Determine at least one target node server for executing the task and target resources on the target node server based on idle resources on the node server, resource requirements of the task, and traffic demand information of the task;
基于所述至少一个目标节点服务器以及所述目标节点服务器上的目标资源,确定所述任务的任务类型。A task type of the task is determined based on the at least one target node server and target resources on the target node server.
这样,基于空闲资源确定任务类型,能够保证当前确定的目标节点服务器和目标资源能够直接用于执行任务。In this way, determining the task type based on the idle resources can ensure that the currently determined target node server and target resources can be directly used to execute the task.
第三方面,本公开实施例还提供一种任务调度装置,应用于调度器端,包括:In the third aspect, the embodiment of the present disclosure also provides a task scheduling device, which is applied to the scheduler side, including:
获取模块,用于获取待处理的任务的任务信息;An acquisition module, configured to acquire task information of tasks to be processed;
第一确定模块,用于基于所述任务信息,确定所述任务的任务类型;A first determining module, configured to determine the task type of the task based on the task information;
第二确定模块,用于基于所述任务类型,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;A second determining module, configured to determine a target node server for executing the task and target resources on the target node server based on the task type;
分配模块,用于将所述目标节点服务器以及所述目标节点服务器上的目标资源分配用于执行所述任务。An allocating module, configured to allocate the target node server and target resources on the target node server to execute the task.
第四方面,本公开实例还包括一种任务调度装置,应用于客户端,包括:In the fourth aspect, the disclosed example also includes a task scheduling device, which is applied to the client, including:
第三确定模块,用于确定待处理的任务的任务类型;The third determining module is used to determine the task type of the task to be processed;
第四确定模块,用于基于所述任务的任务类型,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;A fourth determining module, configured 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;
发送模块,用于将所述目标节点服务器的信息以及所述目标资源的信息发送给调度器,以使所述调度器将所述目标节点服务器以及所述目标资源分配给所述待处理的任务A sending module, configured to send the information of the target node server and the information of the target resource to a scheduler, so that the scheduler allocates the target node server and the target resource to the task to be processed
第五方面,本公开可选实现方式还提供一种计算机设备,处理器、存储器,所述存储器存储有所述处理器可执行的机器可读指令,所述处理器用于执行所述存储器中存储的机器可读指令,所述机器可读指令被所述处理器执行时,所述机器可读指令被所述处理器执行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤,或者,执行上述第二方面,或第二方面中任一种可能的实施方式中的步骤。In the fifth aspect, an optional implementation manner of the present disclosure further provides a computer device, a processor, and a memory, where the memory stores machine-readable instructions executable by the processor, and the processor is configured to execute the instructions stored in the memory. machine-readable instructions, when the machine-readable instructions are executed by the processor, when the machine-readable instructions are executed by the processor, the above-mentioned first aspect is executed, or any possible implementation of the first aspect The steps in the manner, or, perform the steps in the above second aspect, or any possible implementation manner of the second aspect.
第六方面,本公开可选实现方式还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被运行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤,或者,执行上述第二方面,或第二方面中任一种可能的实施方式中的步骤。In a sixth aspect, an optional implementation manner of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the above-mentioned first aspect, or any one of the first aspects in the first aspect, may be executed. Steps in a possible implementation manner, or, performing the steps in the above second aspect, or any possible implementation manner in the second aspect.
第七方面,本公开可选实现方式还提供一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤,或者,执行上述第二方面,或第二方面中任一种可能的实施方式中的步骤。In the seventh aspect, an optional implementation manner of the present disclosure further provides a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium bearing computer-readable codes, when the computer-readable codes are stored in When running in the processor of the electronic device, the processor in the electronic device executes the above-mentioned first aspect, or the steps in any possible implementation manner of the first aspect, or executes the above-mentioned second aspect, or the second aspect A step in any possible implementation of an aspect.
为使本公开的上述目的、特征和优点能更明显易懂,下文特举可选实施例,并配合所附附图,作详细说明如下。In order to make the above objects, features and advantages of the present disclosure more comprehensible, optional embodiments are given below and described in detail in conjunction with the accompanying drawings.
附图说明Description of drawings
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present disclosure more clearly, the following will briefly introduce the accompanying drawings used in the embodiments. The accompanying drawings here are incorporated into the specification and constitute a part of the specification. The drawings show the embodiments consistent with the present disclosure, and are used together with the description to explain the technical solution of the present disclosure. It should be understood that the following drawings only show some embodiments of the present disclosure, and therefore should not be regarded as limiting the scope. For those skilled in the art, they can also make From these figures are obtained other related figures.
图1示出了本公开实施例所提供的一种应用于调度器端的任务调度方法的流程图;FIG. 1 shows a flowchart of a task scheduling method applied to a scheduler provided by an embodiment of the present disclosure;
图2示出了本公开实施例所提供的一种节点服务器的结构示意图;FIG. 2 shows a schematic structural diagram of a node server provided by an embodiment of the present disclosure;
图3示出了本公开实施例所提供的一种确定预设拓扑结构的方法的流程图;FIG. 3 shows a flowchart of a method for determining a preset topology provided by an embodiment of the present disclosure;
图4示出了本公开实施例所提供的一种节点服务器之间的拓扑关系示意图;FIG. 4 shows a schematic diagram of a topology relationship between node servers provided by an embodiment of the present disclosure;
图5示出了本公开实施例所提供的一种多节点类型任务的拓扑结构示意图;FIG. 5 shows a schematic diagram of a topology structure of a multi-node task provided by an embodiment of the present disclosure;
图6a示出了本公开实施例所提供的8资源对应的预设拓扑结构示意图;FIG. 6a shows a schematic diagram of a preset topology structure corresponding to 8 resources provided by an embodiment of the present disclosure;
图6b示出了本公开实施例所提供的7资源对应的预设拓扑结构示意图;FIG. 6b shows a schematic diagram of a preset topology structure corresponding to 7 resources provided by an embodiment of the present disclosure;
图6c示出了本公开实施例所提供的6资源对应的预设拓扑结构示意图;FIG. 6c shows a schematic diagram of a preset topology structure corresponding to 6 resources provided by an embodiment of the present disclosure;
图6d示出了本公开实施例所提供的5资源对应的预设拓扑结构示意图;FIG. 6d shows a schematic diagram of a preset topology structure corresponding to 5 resources provided by an embodiment of the present disclosure;
图6e示出了本公开实施例所提供的4资源对应的预设拓扑结构示意图;FIG. 6e shows a schematic diagram of a preset topology structure corresponding to 4 resources provided by an embodiment of the present disclosure;
图6f示出了本公开实施例所提供的3资源对应的预设拓扑结构示意图;FIG. 6f shows a schematic diagram of a preset topology structure corresponding to 3 resources provided by an embodiment of the present disclosure;
图6g示出了本公开实施例所提供的2资源对应的预设拓扑结构示意图;FIG. 6g shows a schematic diagram of a preset topology structure corresponding to 2 resources provided by an embodiment of the present disclosure;
图7示出了本公开实施例所提供的一种包括不同空闲资源的初始节点服务器的拆分示意图;FIG. 7 shows a schematic diagram of splitting an initial node server including different idle resources provided by an embodiment of the present disclosure;
图8示出了本公开实施例所提供的一种应用于客户端的任务调度方法的流程图;FIG. 8 shows a flow chart of a task scheduling method applied to a client provided by an embodiment of the present disclosure;
图9示出了本公开实施例所提供的一种应用于调度器端的任务调度装置的示意图;FIG. 9 shows a schematic diagram of a task scheduling device applied to the scheduler end provided by an embodiment of the present disclosure;
图10示出了本公开实施例所提供的一种应用于客户端的任务调度装置的示意图;FIG. 10 shows a schematic diagram of a task scheduling device applied to a client provided by an embodiment of the present disclosure;
图11示出了本公开实施例所提供的一种计算机设备结构示意图。FIG. 11 shows a schematic structural diagram of a computer device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。通常在此处描述和示出的本公开实施例的组件可以以不同的配置来布置和设计。因此,以下对本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are The present disclosure discloses some embodiments, but not all embodiments. The components of the disclosed embodiments generally described and illustrated herein may be arranged and designed in different configurations. Accordingly, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the claimed disclosure, but represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, other embodiments obtained by those skilled in the art without making creative efforts all belong to the protection scope of the present disclosure.
另外,本公开实施例中的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。In addition, the terms "first", "second" and the like in the description and claims in the embodiments of the present disclosure and the above drawings are used to distinguish similar objects, and not necessarily used to describe a specific order or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments described herein can be practiced in sequences other than those illustrated or described herein.
在本文中提及的“多个或者若干个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。"Plural or several" mentioned herein means two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently. The character "/" generally indicates that the contextual objects are an "or" relationship.
经研究发现,为满足不同的深度学习任务对应的不同资源需求,任务调度系统发挥着越来越重要的作用,现有技术中,应用于任务调度系统中的任务调度方法,大多基于深度学习任务的资源需求量,以分配尽量少的节点服务器为目标为深度学习任务调度资源。但是,在利用上述方法调度的资源执行深度学习任务时,存在执行速度慢、效率低的问题。It has been found through research that in order to meet the different resource requirements corresponding to different deep learning tasks, the task scheduling system is playing an increasingly important role. In the prior art, the task scheduling methods applied in the task scheduling system are mostly based on deep learning task The resource demand is to allocate resources for deep learning tasks with the goal of allocating as few node servers as possible. 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.
基于上述研究,本公开提供了一种任务调度方法、装置、计算机设备和存储介质,任务信息能够反映待处理的任务的资源需求量和通讯量需求信息等信息,从而,基于任务信息,能够确定与任务信息匹配的任务类型。不同任务类型的任务对应的确定目标节点服务器和目标资源的方式不同,基于确定的任务类型,能够确定出与该任务类型相匹配的资源确定方式,进而,利用确定的资源确定方式为待处理的任务分配目标资源,能够提高分配的目标资源的合理性,进而,利用确定目标资源执行待处理的任务,能够提高任务执行的速度和效率。Based on the above research, the present disclosure provides a task scheduling method, device, computer equipment, and storage medium. The task information can reflect information such as the resource demand and traffic demand information of the task to be processed. Therefore, based on the task information, it is possible to determine The task type that matches the task information. The methods of determining the target node server and target resources are different for different task types. Based on the determined task type, the resource determination method matching the task type can be determined, and then, the determined resource determination method can be used as the resource determination method to be processed. Assigning target resources to tasks can improve the rationality of the allocated target resources, and then, using the determined target resources to execute tasks to be processed can improve the speed and efficiency of task execution.
针对以上方案所存在的缺陷,均是发明人在经过实践并仔细研究后得出的结果,因此,上述问题的发现过程以及下文中本公开针对上述问题所提出的解决方案,都应该是发明人在本公开过程中对本公开做出的贡献。The defects in the above solutions are all 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 below for the above problems should be the result of the inventor Contributions made to this disclosure during the course of this disclosure.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that like numerals and letters denote similar items in the following figures, therefore, once an item is defined in one figure, it does not require further definition and explanation in subsequent figures.
需要说明的是,本公开实施例中所提到的特定名词包括:It should be noted that the specific nouns mentioned in the embodiments of the present disclosure include:
GPU:Graphics Processing Unit,图形处理器,又称显示核心、视觉处理器、显示芯片,是一种专门在个人电脑、工作站、游戏机和一些移动设备(如平板电脑、智能手机等)上做图像和图形相关运算工作的微处理器;GPU: Graphics Processing Unit, graphics processor, also known as display core, visual processor, display chip, is a special graphics processing unit for personal computers, workstations, game consoles and some mobile devices (such as tablets, smartphones, etc.) Microprocessors that work with graphics-related operations;
CPU:Central Processing Unit,中央处理器,作为计算机系统的运算和控制核心,是信息处理、程序运行的最终执行单元;CPU: Central Processing Unit, the central processing unit, as the computing and control core of the computer system, is the final execution unit for information processing and program operation;
NIC:Network Interface Controller,网络接口控制器,又称网络接口控制器,网络适配器,网卡,或局域网接收器,是一块被设计用来允许计算机在计算机网络上进行通讯的计算机硬件;NIC: Network Interface Controller, network interface controller, also known as network interface controller, network adapter, network card, or LAN receiver, is a piece of computer hardware designed to allow computers to communicate on a computer network;
PCIe:peripheral component interconnect express,是一种高速串行计算机扩展总线标准;PCIe: peripheral component interconnect express, is a high-speed serial computer expansion bus standard;
QPI:Quick Path Interconnect,又名CSI(Common System Interface)公共系统接口,是一种可以实现芯片间直接互联的架构;QPI: Quick Path Interconnect, also known as CSI (Common System Interface) public system interface, is an architecture that can realize direct interconnection between chips;
NVLink,是英伟达开发并推出的一种总线及其通信协议。NVLink is a bus and its communication protocol developed and launched by Nvidia.
为便于对本实施例进行理解,首先对本公开实施例所公开的一种任务调度方法进行详细介绍,本公开实施例所提供的任务调度方法的执行主体一般为具有一定计算能力的计算机设备,在一些可能的实现方式中,该任务调度方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。In order to facilitate the understanding of this embodiment, a task scheduling method disclosed in the embodiments of the present disclosure is first introduced in detail. The execution subject of the task scheduling method provided in the embodiments of the present disclosure is generally a computer device with a certain computing capability. In some In a possible implementation manner, the task scheduling method may be implemented by calling a computer-readable instruction stored in a memory by a processor.
下面以执行主体为计算机设备为例对本公开实施例提供的任务调度方法加以说明。The task scheduling method provided by the embodiments of the present disclosure will be described below by taking the execution subject as a computer device as an example.
如图1所示,为本公开实施例提供的一种应用于调度器端的任务调度方法的流程图,可以包括以下步骤:As shown in FIG. 1, a flowchart of a task scheduling method applied to the scheduler side provided by an embodiment of the present disclosure may include the following steps:
S101:获取待处理的任务的任务信息。S101: Obtain task information of tasks to be processed.
这里,待处理的任务可以是深度学习任务,是任务调度系统基于用户在客户端提交的预定义的配置文件获取的任务,任务调度系统的本质可以是进行资源调度的调度器。任务调度系统中可以包括若干个节点服务器,节点服务器上包括一定数量的计算资源和一定数量的CPU,其中,节点服务器可以为GPU节点服务器,计算资源可以是GPU节点服务器中的GPU,CPU之间可以利用QPI连接进行通信,一个节点服务器中的GPU和CPU可以利用PCIe进行通信,一个节点服务器中的CPU可以利用NIC和其他节点服务器中的CPU进行通信,一个节点服务器中的GPU可以利用NVLink连接进行通信。Here, the task to be processed can 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 can be a scheduler for resource scheduling. The task scheduling system can include several node servers, and the node servers include a certain number of computing resources and a certain number of CPUs. Among them, the node servers can be GPU node servers, and the computing resources can be GPUs in the GPU node servers. Can use QPI connection to communicate, GPU and CPU in one node server can use PCIe to communicate, CPU in one node server can use NIC to communicate with CPU in other node servers, GPU in one node server can use NVLink connection to communicate.
如图2所示,为本公开实施例所提供的一种节点服务器的结构示意图,其中,节点服务器中可以包括2个CPU服务器(CPU0和CPU1)和8个GPU(V100GPU0,V100GPU1,V100GPU2,V100GPU3,V100GPU4,V100GPU5,V100GPU6,V100GPU7),PCIe Switches表示利用PCIe进行通信。As shown in Figure 2, it is a schematic 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), PCIe Switches means using PCIe for communication.
任务调度系统在获取任务的同时,还可以获取到该任务的任务信息。其中,任务信息为一种用于表征待处理的任务的资源需求量、通讯量需求信息的信息。While obtaining a task, the task scheduling system can also obtain task information of the task. Wherein, the task information is a kind of information used to represent the resource requirement and the traffic requirement information of the task to be processed.
S102:基于任务信息,确定任务的任务类型。S102: Based on the task information, determine a task type of the task.
这里,任务类型能够反映任务所需要的节点服务器的数量、GPU资源的数量和通讯量需求,执行不同任务类型的任务选取的节点服务器的数量不同。不同的任务可以具有不同的任务类型,针对同一任务,在选取的节点服务器的数量不同的情况下,该任务的任务类型也不同。Here, the task type can reflect the number of node servers required by the task, the number of GPU resources, and the traffic requirements, and the number of node servers selected for executing tasks of different task types is different. Different tasks may have different task types. For the same task, if the number of selected node servers is different, the task types of the task are also different.
因此,具体实施时,可以基于获取的任务信息所表征的资源需求量、通讯量需求信息等信息,确定任务的任务类型。Therefore, during specific implementation, the task type of the task may be determined based on information such as resource requirements and communication traffic demand information represented by the acquired task information.
S103:基于任务类型,确定执行任务的目标节点服务器以及目标节点服务器上的目标资源。S103: Based on the task type, determine a target node server for executing the task and target resources on the target node server.
这里,针对不同任务类型的任务,确定目标节点服务器和目标资源的方式不同。Here, for tasks of different task types, the ways of determining the target node server and the target resource are different.
在确定任务类型之后,可以根据节点服务器上的空闲资源以及该任务的任务类型,确定可以用于执行任务的目标节点服务器以及目标节点服务器上的目标资源。其中,目标资源为空闲资源。After the task type is determined, the target node server that can be used to execute the task and the target resource on the target node server can be determined according to the idle resources on the node server and the task type of the task. Wherein, the target resource is an idle resource.
S104:将目标节点服务器以及目标节点服务器上的目标资源分配用于执行任务。S104: Allocate the target node server and the target resource on the target node server to execute the task.
这里,在确定执行任务的目标节点服务器以及目标节点服务器上的目标资源之后,任务调度系统可以将目标节点服务器以及目标节点服务器上的目标资源分配给任务以执行该任务。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.
这样,任务信息能够反映待处理的任务的资源需求量和通讯量需求信息等信息,从而,基于任务信息,能够确定与任务信息匹配的任务类型。不同任务类型的任务对应的确定目标节点服务器和目标资源的方式不同,基于确定的任务类型,能够确定出与该任务类型相匹配的资源确定方式,进而,利用确定的资源确定方式为待处理的任务分配目标资源,能够提高分配的目标资源的合理性,进而,利用确定目标资源执行待处理的任务,能够提高任务执行的速度和效率。In this way, the task information can reflect information such as the resource demand amount and traffic demand information of the task to be processed, so that based on the task information, the task type matching the task information can be determined. The methods of determining the target node server and target resources are different for different task types. Based on the determined task type, the resource determination method matching the task type can be determined, and then, the determined resource determination method can be used as the resource determination method to be processed. Assigning target resources to tasks can improve the rationality of the allocated target resources, and then, using the determined target resources to execute tasks to be processed can improve the speed and efficiency of task execution.
在一种实施例中,可以按照以下步骤确定任务的任务类型:In one embodiment, the task type of the task can be determined according to the following steps:
步骤一、根据任务信息,确定任务的资源需求量、任务的通讯量需求信息。 Step 1. According to the task information, determine the resource demand amount of the task and the traffic demand information of the task.
这里,不同的任务,需要不同数量的空闲GPU执行,任务的资源需求量可以是执行任务所需要的GPU的数量。通讯量需求信息用于表征该任务所对应的计算量和通信量之间的比值。一个任务在被确定之后,其所需要的GPU的数量也将被确定,即可以确定任务的资源需求量,同时,一个任务在被确定之后,其所对应的通讯量需求信息也将被确定。因此,一个任务在被确定之后,用于表征资源需求量和通讯量需求信息的任务信息也被确定。Here, different tasks require different numbers of idle GPUs to execute, and the resource requirement of a task may be the number of GPUs required to execute the task. The communication volume requirement information is used to represent the ratio between the calculation volume and the communication volume corresponding to the task. After a task is determined, the number of GPUs it needs will also be determined, that is, the resource requirements of the task can be determined. At the same time, after a task is determined, its corresponding traffic demand information will also be determined. Therefore, after a task is determined, the task information used to characterize resource demand and traffic demand information is also determined.
进而,任务调度系统可以根据获取的任务的任务信息,确定其所表征的该任务的资源需求量和通讯量需求信息。Further, the task scheduling system can determine the resource requirement and traffic requirement information of the task represented by it according to the acquired task information of the task.
步骤二、确定节点服务器中的资源数量。Step 2: Determine the resource quantity in the node server.
这里,资源数量即GPU数量。节点服务器中的资源数量等同于节点服务器中的资源的数量。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.
具体实施时,任务调度系统中节点服务器上包括的GPU数量可以不相同,例如,任务调度系统中的节点服务器可以包括8GPU的节点服务器和4GPU的节点服务器,这里不进行限定。During specific implementation, the number of GPUs included in the node servers in the task scheduling system may be different. For example, the node servers in the task scheduling system may include 8GPU node servers and 4GPU node servers, which are not limited here.
步骤三、基于确定的资源需求量、任务的通讯量需求信息、节点服务器中的资源数量,确定任务的任务类型。Step 3: Determine the task type of the task based on the determined resource demand, the traffic demand information of the task, and the resource quantity in the node server.
具体实施时,可以基于资源需求量和节点服务器中的资源数量,确定执行该待处理的任务所需要的节点服务器的数量,也即确定该待处理的任务对应的目标节点服务器的数量。其中,
Figure PCTCN2021124136-appb-000001
Figure PCTCN2021124136-appb-000002
其中,
Figure PCTCN2021124136-appb-000003
表示向上取整。
During 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 server, that is, the number of target node servers corresponding to the task to be processed can be determined. in,
Figure PCTCN2021124136-appb-000001
Figure PCTCN2021124136-appb-000002
in,
Figure PCTCN2021124136-appb-000003
Indicates rounding up.
进而,可以基于待处理的任务对应的目标节点服务器的数量和确定的该任务的通讯量需求信息,确定该待处理的任务的任务类型。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 traffic demand information of the task.
在一种实施例中,任务类型可以包括单节点多资源通讯类型、单节点多资源计算类型、多节点类型和单资源类型。In an embodiment, the task types may include single-node multi-resource communication type, single-node multi-resource computing type, multi-node type and single resource type.
这里,基于任务的资源需求量,可以将任务划分为单节点类型任务和多节点类型任务,其中,单节点类型任务利用一个目标节点服务器中的资源即可完成,多节点类型任务需要至少两个目标节点服务器中的资源才可以完成;对于单节点任务,基于任务的资源需求量,又可以划分为单节点多资源类型任务和单资源类型任务,其中,单资源类型任务表示该任务只需要一个目标节点服务器中的一个空闲资源即可以完成,单节点多资源类型任务需要一个目标节点服务器中的多个空闲资源才可以完成;另外,根据任务的通讯量需求信息,又可以将单节点多资源类型任务划分为单节点多资源通讯类型任务、单节点多资源计算类型任务,其中,单节点多资源通讯类型任务表示该任务对于通信量的需求较高,单节点多资源计算类型任务表示该任务对于计算量的需求较高。Here, based on the resource demand of the task, the task can be divided into single-node type task and multi-node type task. Among them, the single-node type task can be completed by using the resources in one target node server, and the multi-node type task needs at least two The resources in the target node server can 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, where the single-resource type task means that the task only needs one One idle resource in the target node server can be completed, and a single-node multi-resource task requires multiple idle resources in a target node server to complete; in addition, according to the traffic demand information of the task, the single-node multi-resource Type tasks are divided into single-node multi-resource communication type tasks and single-node multi-resource computing type tasks. Among them, single-node multi-resource communication type tasks indicate that the task has a high demand for traffic, and single-node multi-resource computing type tasks indicate that the task The demand for calculation is high.
具体实施时,在确定待处理的任务对应的目标节点服务器的数量等于1、待处理的任务对应的目标资源的数量大于1、并且通讯量需求信息指示待处理的任务的通信量需求高于计算量需求的情况下,确定待处理的任务的任务类型为单节点多资源通讯类型。During 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 traffic demand information indicates that the traffic demand of the task to be processed is higher than the calculation In the case of high-volume demand, determine the task type of the task to be processed as a single-node multi-resource communication type.
在确定待处理的任务对应的目标节点服务器的数量等于1、待处理的任务对应的目标资源的数量大于1、并且通讯量需求信息指示待处理的任务的计算量需求高于通信量需求的情况下,确定待处理的任务的任务类型为单节点多资源计算类型。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 calculation volume demand of the task to be processed is higher than the communication volume demand Next, determine that the task type of the task to be processed is the single-node multi-resource computing type.
在确定待处理的任务对应的目标节点服务器的数量大于1的情况下,确定待处理的任务的任务类型为多节点类型;When it is determined that the number of target node servers corresponding to the task to be processed is greater than 1, determine that the task type of the task to be processed is a multi-node type;
在确定待处理的任务对应的目标资源的数量等于1的情况下,确定待处理的任务的任务类型为单资源类型。In a case where 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.
例如,任务的资源需求量为7,节点服务器上资源的数量为8,计算量和通信量之间的比值大于1,则可以确定该任务所需要的目标节点服务器的数量为1,进而,基于比值大于1和目标节点服务器的数量1,可以确定该任务的任务类型为单节点多资源计算类型。For example, if the resource requirement of the task is 7, the number of resources on the node server is 8, and the ratio between the calculation amount and the communication amount is greater than 1, it can be determined that the number of target node servers required by the task is 1, and then, based on If the ratio is greater than 1 and the number of target node servers is 1, it can be determined that the task type of the task is a single-node multi-resource computing type.
在一种实施例中,针对S103,可以按照以下步骤实施:In one embodiment, for S103, it can be implemented according to the following steps:
基于任务的任务类型、任务的资源需求量以及节点服务器上的空闲资源,确定执行任务的目标节点服务器以及目标节点服务器上的目标资源。Based on the task type of the task, the resource demand of the task, and the idle resources on the node server, the target node server for executing the task and the target resource on the target node server are determined.
这里,节点服务器上的GPU可以单独使用,节点服务器上的空闲GPU为当前未使用的GPU。Here, the GPUs on the node server can be used independently, and the idle GPUs on the node server are currently unused GPUs.
具体实施时,可以根据节点服务器上的空闲GPU的数量,将节点服务器划分到不同的空闲资源链表中,其中,空闲资源链表仅由包括一种空闲GPU的数量的节点服务器组成。例如,空闲资源链表可以为1空闲GPU链表,2空闲GPU链表等,其中,1空闲GPU链表表示链表中的节点服务器均为只有一个GUP空闲的节点服务器。During specific implementation, the node servers may be divided into different idle resource linked lists according to the number of idle GPUs on the node servers, wherein the idle resource linked list is only composed of node servers including a number of idle GPUs. For example, the idle resource linked list may be 1 idle GPU linked list, 2 idle GPU linked list, etc., wherein 1 idle GPU linked list means that all node servers in the linked list have only one idle GUP.
在确定任务的任务类型之后,可以根据先基于任务的任务类型,确定与任务类型相匹配的至少一个初始节点服务器。After the task type of the task is determined, at least one initial node server matching the task type may be determined based on the task type first.
这里,初始节点服务器可以为从空闲链表中选出来的节点服务器,可以为一组能够用于执行待处理的任务的多个节点服务器或单个节点服务器。例如,某一任务为单节点多资源通讯类型的任务,资源需求量为3,则可以从空闲链表中选取多个资源数量大于或等于3的多个节点服务器作为初始节点服务器,以及多组节点服务器,其中,一组节点服务器中的资源数量大于或等于3。Here, the initial node server may be a node server selected from the idle list, and may be a group of multiple node servers or a single node server that can be used to execute tasks to be processed. For example, if a task is a task of single-node multi-resource communication type, and the resource demand is 3, multiple node servers with multiple resources greater than or equal to 3 can be selected from the free list as the initial node server, and multiple groups of nodes server, wherein the number of resources in a group of node servers is greater than or equal to 3.
进而,可以基于任务的资源需求量以及初始节点服务器上的空闲资源,从至少一个初始节点服务器中,确定执行任务的目标节点服务器以及目标节点服务器上的目标资源。Furthermore, the target node server for executing the task and the target resource on the target node server may be determined from at least one initial node server based on the resource requirement of the task and the idle resources on the initial node server.
具体实施时,基于任务的资源需求量以及初始节点服务器上的空闲资源,可以至少一个初始节 点服务器中,选取目标数量的目标节点服务器,并可以基于任务的资源需求量,确定在目标节点服务器上选取的用于执行任务的目标资源。其中,目标数量为上述实施例中确定的目标服务器的数量。During specific implementation, based on the resource requirements of the task and the idle resources on the initial node server, a target number of target node servers can be selected from at least one initial node server, and can be determined on the target node server based on the resource demand of the task. The target resource chosen to execute the task. Wherein, the target number is the number of target servers determined in the above embodiment.
例如,在确定任务的任务类型为多节点类型,资源需求量为13,节点服务器上资源数量为8的情况下,可以在任务调度系统中的节点服务器中选取两个目标节点服务器,其中一个目标节点服务器为空载的节点服务器,一个目标节点服务器中包括的空闲资源的数量为5。For example, if the task type of the task is determined to be 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 targets The node server is an empty node server, and the number of idle resources included in one target node server is five.
在一种实施例中,在任务类型包括单节点多资源通讯类型的情况下,可以按照以下步骤从至少一个初始节点服务器中,确定执行任务的目标节点服务器:In an embodiment, when the task type includes 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:
步骤一、基于至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,筛选空闲资源的数量大于或等于资源需求量的初始节点服务器作为第一节点服务器; Step 1. Based on the number of idle resources on the initial node server in at least one initial node server, select the initial node server whose number of idle resources is greater than or equal to the resource requirement as the first node server;
步骤二、基于第一节点服务器上的空闲资源和任务的资源需求量,确定执行任务的目标节点服务器。Step 2: Determine the target node server for executing the task based on the idle resources on the first node server and the resource requirements of the task.
这里,由于单节点多资源通讯类型任务对于通信量的需求较高,所以可以基于初始节点服务器上的空闲资源的数量,筛选出空闲资源的数量大于或等于任务的资源需求量的第一节点服务器,这样,能够保证第一节点服务器中存在足够数量的空闲资源用于满足任务的通信量需求。具体实施时,筛选出的第一节点服务器可以包括一个或多个。Here, since single-node multi-resource communication tasks have a high demand for traffic, based on the number of idle resources on the initial node server, 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 , in this way, it can be ensured that there is a sufficient number of idle resources in the first node server to meet the traffic demand of the task. During specific implementation, the selected first node servers may include one or more.
进而,可以根据资源需求量,从筛选出的第一节点服务器中选取用于执行任务的目标节点服务器。Furthermore, the target node server for executing the task may be selected from the screened first node servers according to the resource requirement.
具体实施时,在筛选出第一节点服务器之后,可以根据任务的资源需求量,确定资源需求量对应的至少一个预设拓扑结构,其中,预设拓扑结构是执行任务所需要的空闲资源之间的较优的拓扑结构,将空闲资源利用预设拓扑结构进行连接以执行任务,可以减少通信等待时长,提高执行任务的速度。During specific implementation, after the first node server is screened out, at least one preset topology corresponding to the resource requirement can be determined according to the resource requirement of the task, wherein the preset topology is the number of idle resources required to execute the task. With a better topology structure, idle resources are connected using the preset topology structure to perform tasks, which can reduce the waiting time for communication and improve the speed of task execution.
在一种实施例中,可以按照如图3所示的方法确定任一空闲资源对应的预设拓扑结构,如图3所示,为本公开实施例所提供的一种确定预设拓扑结构的方法的流程图,可以包括以下步骤:In one embodiment, the preset topology corresponding to any idle resource can be determined according to the method shown in FIG. 3 , as shown in FIG. A flowchart of the method may include the following steps:
S301:针对任一待匹配节点服务器中的空闲资源,确定该待匹配节点服务器中的任一数量的空闲资源对应的拓扑结构。S301: For idle resources in any node server to be matched, determine a topology structure corresponding to any number of idle resources in the node server to be matched.
S302:基于空闲资源之间的通信介质,确定拓扑结构的通信等待时长。S302: Based on the communication medium between idle resources, determine the communication waiting time of the topology.
S303:基于通信等待时长,确定与该待匹配节点服务器中任一数量的空闲资源对应的预设拓扑结构。S303: Based on the communication waiting time, determine a preset topology corresponding to any number of idle resources in the node server to be matched.
这里,待匹配节点服务器中包括任一数量的空闲资源,待匹配节点服务器可以为任一节点服务器。资源需求量和空闲资源相对应,具体的,一种资源需求量可以与至少一个待匹配节点服务器中的空闲资源相对应。例如,资源需求量为7,待匹配节点服务器可以为一个空闲资源数量为7的节点服务器,或者,待匹配节点服务器可以为一组包括的空闲资源的数量为7的多个节点服务器,比如,可以为由一个包括3空闲资源的节点服务器和一个包括4空闲资源的节点服务器组成的一组节点服务器。因此,该方法也为确定任一资源需求量对应的预设拓扑结构的方法。Here, the node server to be matched includes any number of idle resources, and the node server to be matched may be any node server. The resource requirements correspond to idle resources, specifically, one resource requirement may correspond to idle resources in at least one node server to be matched. For example, if the resource requirement is 7, 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, It may be 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 corresponding to any resource requirement.
任务调度系统中所包括的不同节点服务器以及同一节点服务器中的GPU和CPU之间通信质量是不同的,常见的通信方式如上述实施例所提及的QPI、PCIe、NIC和NVLink 4种,其中,NVLink的通信速率大于QPI的通信速率,QPI的通信速率待大于利用PCIe、NIC和网络的通信速率。通信介质可以为根据通信方式对应的介质确定。The quality of communication between different node servers included in the task scheduling system and the GPU and CPU in the same node server is different. The common communication methods are as mentioned in the above-mentioned embodiments. QPI, PCIe, NIC and NVLink 4 kinds, wherein , the communication rate of NVLink is greater than the communication rate of QPI, and the communication rate of QPI is to be greater than the communication rate of PCIe, NIC and network. The communication medium may be determined according to the medium corresponding to the communication mode.
针对任一待匹配节点服务器中的空闲资源,可以先确定该空闲资源对应的拓扑结构,然后基于待匹配节点服务器中的空闲资源之间的通信介质,确定拓扑结构的通信等待时长。For any idle resource in the node server to be matched, the topology structure corresponding to the idle resource can be determined first, and then the communication waiting time of the topology structure can be determined based on the communication medium between the idle resources in the node server to be matched.
这里,在待匹配节点服务器为一组节点服务器的情况下,可以确定该一组节点服务器中的空闲资源可以组成的拓扑结构,然后,可以基于节点服务器之间的通信介质和空闲资源之间的通信介质,确定拓扑结构的通信等待时长。Here, when the node server to be matched is a group of node servers, the topology structure that can be formed by the idle resources in the group of node servers can be determined, and then, based on the communication medium between the node servers and the relationship between the idle resources The communication medium, which determines the communication waiting time of the topology.
进一步的,可以根据拓扑结构的通信等待时长,对拓扑结构进行筛选,筛选出符合预设条件的拓扑结构作为预设拓扑结构。Further, the topological structures may be screened according to the communication waiting time of the topological structures, and the topological structures meeting the preset conditions are screened out as the preset topology structures.
具体实施时,可以利用先验的方式,确定一种数量的空闲资源在不同的拓扑结构下对应的通信等待时长,其中,一种数量的空闲资源可以对应于多种拓扑结构,如图4所示,为本公开实施例所提供的一种节点服务器之间的拓扑关系示意图,其中,NVLINK/NVSWITCH用于GPU之间的通信,Network(网络)和NIC用于不同的节点服务器之间的通信。During specific implementation, a priori method can be used to determine the communication waiting time corresponding to a certain amount of idle resources under different topological structures, wherein one amount of idle resources can correspond to multiple topological structures, as shown in Figure 4 It is a schematic diagram of a topology relationship between node servers provided by an embodiment of the present disclosure, wherein NVLINK/NVSWITCH is used for communication between GPUs, and Network (network) and NIC are used for communication between different node servers .
针对拓扑结构,利用具有该拓扑结构的GPU,基于ring allreduce模型执行该数量的空闲资源对应的资源需求量的任务,其中,在基于ring allreduce模型执行任务的过程中,需要GPU依次进行通 信,因此,总的通信等待时长将受到拓扑结构中GPU之间的最小的通信带宽的限制。For the topological structure, use the GPU with the topological structure to execute the resource demand task 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, the GPU needs to communicate sequentially, so , the total communication latency will be limited by the minimum communication bandwidth between GPUs in the topology.
具体实施时,针对单一节点服务器内的allreduce通信等待时长,可以按照公式一确定:During specific implementation, the waiting time for allreduce communication in a single node server can be determined according to Formula 1:
Figure PCTCN2021124136-appb-000004
Figure PCTCN2021124136-appb-000004
其中,T表示通信等待时长,n表示需要的GPU的数量,α表示恒定的建立通信的时延,s表示ring allreduce模型的大小(即通信规模大小),BW表示拓扑结构下的GPU之间通信带宽的集合,min(BW)表示拓扑结构中GPU之间的最小的通信带宽。Among them, T represents the waiting time for communication, n represents the number of GPUs required, α represents the constant delay in establishing communication, s represents the size of the ring allreduce model (that is, the communication scale), and BW represents the communication between GPUs under the topology A collection of bandwidths, min(BW) represents the minimum communication bandwidth between GPUs in the topology.
在一种实施例中,针对空闲资源对应的任务为多节点类型任务的情况,执行任务所需要的一次allreduce的通信等待时长,可以包括单一节点服务器内的allreduce通信等待时长和节点服务器之间的allreduce通信等待时长,其中,单一节点服务器内的allreduce通信等待时长可以包括节点服务器内一次reduce操作和节点服务器内一次broadcast操作。In one embodiment, for the case where the task corresponding to the idle resource is a multi-node task, the waiting time for an allreduce communication required to execute the task may include the waiting time for allreduce communication in a single node server and the waiting time for allreduce communication between node servers Allreduce communication waiting time, wherein, the allreduce communication waiting time in a single node server may include a reduce operation in the node server and a broadcast operation in the node server.
如图5所示,为本公开实施例所提供的一种多节点类型任务的拓扑结构示意图,其中,bw 0表示GPU之间的通信带宽,bw 1表示不同节点服务器之间的最小通信带宽。其中,图5右下角的所示的4个深颜色的GPU可以表示正在被使用的GPU。 As shown in FIG. 5 , it is a schematic diagram of a topology structure of a multi-node task provided by an embodiment of the present disclosure, where bw 0 represents the communication bandwidth between GPUs, and bw 1 represents the minimum communication bandwidth between different node servers. Wherein, the four dark-colored GPUs shown in the lower right corner of FIG. 5 may represent the GPUs being used.
具体实施时,节点服务器内一次reduce操作和节点服务器内一次broadcast操作的通信等待时长可以根据公式二确定:During specific implementation, the communication waiting time between a reduce operation in the node server and a broadcast operation in the node server can be determined according to Formula 2:
Figure PCTCN2021124136-appb-000005
Figure PCTCN2021124136-appb-000005
节点服务器之间的allreduce通信等待时长可以根据公式三确定:The waiting time for allreduce communication between node servers can be determined according to Formula 3:
Figure PCTCN2021124136-appb-000006
Figure PCTCN2021124136-appb-000006
其中,m表示使用的节点服务器的数量。Among them, m represents the number of node servers used.
另外,针对ring allreduce模型,在利用节点服务器和节点服务器内的GPU执行任务时,通常采用双层通信方式,因此,可以确定执行任务所需要的一次双层allreduce的通信等待时长可以如公式四所示:In addition, for the ring allreduce model, when using the node server and the GPU in the node server to execute tasks, the two-layer communication method is usually used. Therefore, it can be determined that the communication waiting time of a two-layer allreduce required to execute the task can be as shown in Equation 4 Show:
max i2T(n i,s,bw 0)+T(m,s,bw 1)  公式四 max i 2T(n i , s, bw 0 )+T(m, s, bw 1 ) Formula 4
其中,max i2T(n i,s,bw 0)表示执行多节点类型任务时,多个节点服务器下通信耗时最高的节点的通信等待时长。 Among them, max i 2T(n i , s, bw 0 ) represents the communication waiting time of the node with the highest communication time consumption under multiple node servers when executing multi-node tasks.
进而,根据上述公式一~公式四,可以确定如公式五所示的任一数量的空闲资源对应的任务j i的通信等待时长c iFurthermore, according to the above formulas 1 to 4, the communication waiting time c i of task j i corresponding to any number of idle resources shown in formula 5 can be determined:
c i=max jT(N ij,S i,bw 0)+F(M i)×(max jT(N ij,S i,bw 0)+T(M i,S i,min jBW ij))  公式五 c i =max j T(N ij , S i , bw 0 )+F(M i )×(max j T(N ij ,S i ,bw 0 )+T(M i ,S i ,min j BW ij )) Formula five
其中,N ij表示任务j i在第j个节点服务器上所需要的GPU的数量,M i表示执行任务j i所需要的节点服务器的数量,F是可以根据M i确定的函数,如果M i>=2,F(M i)=1,如果M i为其他数值,F(M i)=0,BW ij表示任务j i在第j个节点服务器上与其他节点服务器的通信带宽,min jBW ij表示任务j i在第j个节点服务器上与其他节点服务器的最小通信带宽,bw 0表示任务j i在第j个节点服务器内的通信带宽,S i表示任务j i的通信量和计算量之间的比值信息。 Among them, N ij represents the number of GPUs required by task j i on the jth node server, M i represents the number of node servers required to execute task j i , F is a function that can be determined according to M i , if M i >=2, F(M i )=1, if Mi is other values, F(M i )=0, BW ij represents the communication bandwidth between task j i and other node servers on the jth node server, min j BW ij represents the minimum communication bandwidth between task j i and other node servers on the jth node server, bw 0 represents the communication bandwidth of task j i in the jth node server, S i represents the communication volume and computation of task j i The ratio information between the quantities.
对于任务j i,一共需要∑ jN ij个GPU,在执行任务j i时,一个GPU需要花费c i的通信等待时长,进而,可以确定该拓扑结构下执行该资源需求量对应的任务的总的通信等待时长,进而,可以确定资源需求量对应的拓扑关系下的总的通信等待时长,然后,为了满足提高执行任务的速度的需求,可以按照公式六选取预设拓扑结构: For task j i , a total of ∑ j N ij GPUs are needed. When executing task j i , one GPU needs to spend the communication waiting time of c i . Then, the total number of tasks corresponding to the resource demand under this topology can be determined. Then, the total communication waiting time under the topology relationship corresponding to the resource demand can be determined. Then, in order to meet the requirement of improving the speed of task execution, the preset topology structure can be selected according to formula 6:
min∑ ij(N ijc i)   公式六 min∑ ij (N ij c i ) Formula 6
其中,min∑ ij(N ijc i)表示选取通信等待时长最小的拓扑结构作为预设拓扑结构。 Among them, min∑ ij (N ij c i ) indicates that the topology structure with the minimum communication waiting time is selected as the preset topology structure.
在一种实施例中,基于公式五,可以确定一种数量的空闲资源下的拓扑关系的总的通信等待时长,进而,可以将拓扑关系的总的通信等待时长按照从低到高的顺序进行排序,然后,利用预设次序,将排序次序小于预设次序的拓扑结构,作为该数量的空闲资源对应的预设拓扑结构,也即,作为与该待匹配节点服务器对应的预设拓扑结构。其中,预设次序可以根据实际需要设置,这里不进行限定。In one embodiment, based on Formula 5, the total communication waiting time of the topological relationship under a certain amount of idle resources can be determined, and then the total communication waiting time of the topological relationship can be performed in order from low to high Sorting, and then using the preset order, the topological structure whose sorting order is smaller than the preset order is used as the preset topology structure corresponding to the number of idle resources, that is, as the preset topology structure corresponding to the node server to be matched. Wherein, the preset order can be set according to actual needs, which is not limited here.
这样,利用预设次序对拓扑结构进行筛选,得到的预设拓扑结构对应的通信等待时长在能够满足执行空闲资源对应的资源需求量的任务的时间要求的基础上,还能够实现尽量降低执行该资源需求量的任务的时间的目的。In this way, the topological structures are screened using the preset order, and the communication waiting time corresponding to the preset topological structures can meet the time requirements for executing the task corresponding to the resource demand amount of the idle resources, and can also reduce the execution time of the task as much as possible. The resource requirement for the time purpose of the task.
在另一个实施例中,在基于公式五,确定一种资源需求量下的拓扑关系的通信等待时长之后, 可以将通信等待时长小于预设等待阈值的拓扑结构,作为与该资源需求量对应的预设拓扑结构,也即,可以作为与该待匹配节点服务器对应的预设拓扑结构。这样,利用该预设拓扑结构执行任务,能够合理地降低执行任务需要的通信等待时长,其中,预设等待阈值可以根据实际需要设置,这里不进行限定。In another embodiment, after determining the communication waiting time of a topology relationship under a resource demand based on Formula 5, the topology structure whose communication waiting time is less than the preset waiting threshold can be used as the corresponding resource demand The preset topology, that is, may be the preset topology corresponding to the node server to be matched. In this way, using the preset topology to execute tasks can reasonably reduce the communication waiting time required for task execution, wherein the preset waiting threshold can be set according to actual needs, and is not limited here.
另外,由于NVLink的通信速率高,所以可选的拓扑结构中的资源之间的通信方式应该均为NVLink。In addition, due to the high communication rate of NVLink, the communication mode between resources in the optional topology should be NVLink.
具体实施时,针对节点服务器上资源数量为8的情况下,可以确定以下不同资源需求量下任务的预设拓扑结构,其中,不同资源需求量下的任务的预设拓扑结构是指单个节点服务器上不同资源需求量对应的预设拓扑结构,如图6a所示,为本公开实施例所提供的8资源对应的预设拓扑结构示意图,如图6b所示,为本公开实施例所提供的7资源对应的预设拓扑结构示意图,如图6c所示,为本公开实施例所提供的6资源对应的预设拓扑结构示意图,如图6d所示,为本公开实施例所提供的5资源对应的预设拓扑结构示意图,如图6e所示,为本公开实施例所提供的4资源对应的预设拓扑结构示意图,如图6f所示,为本公开实施例所提供的3资源对应的预设拓扑结构示意图,如图6g所示,为本公开实施例所提供的2资源对应的预设拓扑结构示意图。During specific implementation, when the number of resources on the node server is 8, the following preset topology structures of tasks under different resource demands can be determined, wherein, the preset topology structures of tasks under different resource demands refer to a single node server The preset topological structure corresponding to different resource demands on the Internet, as shown in Figure 6a, is a schematic diagram of the preset topology structure corresponding to 8 resources provided by the embodiment of the present disclosure, as shown in Figure 6b, which is the schematic diagram of the preset topology structure provided by the embodiment of the present disclosure A schematic diagram of a preset topology structure corresponding to 7 resources, as shown in Figure 6c, which is a schematic diagram of a preset topology structure corresponding to 6 resources provided by the embodiment of the present disclosure, as shown in Figure 6d, which is a schematic diagram of a preset topology structure corresponding to 5 resources provided by an embodiment of the present disclosure The schematic diagram of the corresponding preset topology structure, as shown in Figure 6e, is a schematic diagram of the preset topology structure corresponding to the 4 resources provided by the embodiment of the present disclosure, as shown in Figure 6f, which corresponds to the 3 resources provided by the embodiment of the present disclosure A schematic diagram of a preset topology, as shown in FIG. 6g , is a schematic diagram of a preset topology corresponding to 2 resources provided by an embodiment of the present disclosure.
进一步的,在基于上述方式确定资源需求量对应的至少一个预设拓扑结构以及第一节点服务器之后,可以从第一节点服务器中筛选具有任一个预设拓扑结构第一节点服务器,这样,利用筛选出的具有任一个预设拓扑结构的第一节点服务器执行该任务,能够减少通信等待时长,进而,在从筛选出的具有任一个预设拓扑结构的第一节点服务器中,选取空闲资源的数量最少的第一节点服务器作为目标节点服务器,这样,利用空闲资源数量最小的第一节点服务器作为目标节点服务器,能够减少对具有任一个预设拓扑结构且空闲资源数量较多的第一节点服务器的原有拓扑结构的拆分,实现对可选的拓扑结构的保护以及将其合理应用在单节点多资源通信类型等其他任务上。Further, after determining at least one preset topology corresponding to the resource demand and the first node server based on the above method, the first node server with any preset topology can be screened from the first node servers. In this way, using the screening The selected first node server with any preset topology performs this task, which can reduce the communication waiting time, and then, select the number of idle resources from the screened out first node servers with any preset topology The least first node server is used as the target node server. In this way, using the first node server with the smallest number of idle resources as the target node server can reduce the number of first node servers with any preset topology and a large number of idle resources. The splitting of the original topology realizes the protection of the optional topology and its reasonable application to other tasks such as single-node multi-resource communication.
具体实施时,在筛选目标节点服务器的过程中,如果存在空闲资源数量等于资源需求量且具有任一个预设拓扑结构的第一节点服务器,则可以直接将该第一节点服务器作为目标节点服务器。During specific implementation, in the process of screening the target node server, if there is a first node server with the number of idle resources equal to the resource demand and having any preset topology, the first node server can be directly used as the target node server.
如果只存在空闲资源数量大于资源需求量且具有任一个预设拓扑结构的第一节点服务器,则选取空闲资源数量最小的第一节点服务器作为目标节点服务器,然后将该目标节点服务器中的空闲资源进行拆分,拆分出具有预设拓扑结构的资源用于执行任务,如图7所示,为本公开实施例所提供的一种包括不同空闲资源的初始节点服务器的拆分示意图,其中,Slot可以表示初始节点服务器,并且由图7可知,在一个初始节点服务器中包括的资源数量数为8时,6空闲资源拆分得到的可选的拓扑结构是4空闲资源加2空闲资源模式,5空闲资源拆分得到的可选的拓扑结构是3空闲资源加2空闲资源模式,job可以表示任务,8GPU jobs可以表示需要8空闲GPU可以完成的任务,Empty 7 GPU Slot表示7空闲GPU的节点服务器。If there is only the first node server whose number of idle resources is greater than the resource demand and has any preset topology, select the first node server with the smallest number of idle resources as the target node server, and then use the idle resources in the target node server Splitting, splitting resources with a preset topology for performing tasks, as shown in FIG. 7 , is a schematic diagram of splitting an initial node server including different idle resources provided by an embodiment of the present disclosure, wherein, Slot can represent the initial node server, and it can be seen from Figure 7 that when the number of resources included in an initial node server is 8, the optional topology structure obtained by splitting 6 idle resources is 4 idle resources plus 2 idle resources. The optional topology obtained by splitting 5 idle resources is the mode of 3 idle resources plus 2 idle resources. Job can represent a task, 8GPU jobs can represent a task that requires 8 idle GPUs to complete, and Empty 7 GPU Slot represents a node with 7 idle GPUs. server.
这里,如果筛选出的具有任一个预设拓扑结构且空闲资源数量最小的第一节点服务器包括多个,则可以随机选取任一个第一节点服务器作为目标节点服务器。Here, if there are multiple first node servers with any preset topology and the smallest number of idle resources, any one of the first node servers may be randomly selected as the target node server.
另外,在确定目标节点服务器之后,可以将目标节点服务器具有的预设拓扑结构作为目标拓扑结构,然后,可以将目标节点服务器中构成目标拓扑结构的空闲资源作为目标资源。具体实施时,在确定目标节点服务器中的空闲资源数量等于资源需求量情况下,可以将其中的空闲资源作为目标资源;在确定目标节点服务器中的空闲资源数量大于资源需求量且空闲资源数量最小的情况下,可以将拆分出的具有目标拓扑结构的资源作为目标资源用于执行任务。In addition, after the target node server is determined, the preset topology of the target node server may be used as the target topology, and then idle resources constituting the target topology in the target node server may be used as the target resource. During specific implementation, when it is determined that the number of idle resources in the target node server is equal to the resource demand, the idle resources therein can be used as the target resource; 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 In the case of , the split resource with the target topology can be used as the target resource to execute the task.
在另一种实施例中,如果未能筛选出可以满足资源需求量的第一节点服务器,则需要暂缓执行该任务,直至确定存在满足资源需求量且具有至少一个预设拓扑结构的第一节点服务器时,再执行该任务。In another embodiment, if the first node server that can meet the resource requirement cannot be screened out, the execution of the task needs to be suspended until it is determined that there is a first node that meets the resource requirement and has at least one preset topology server, execute this task again.
在一种实施例中,在任务类型包括单节点多资源计算类型的情况下,可以按照以下步骤从至少一个初始节点服务器中,确定执行任务的目标节点服务器:In one embodiment, when the task type includes 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:
步骤一、基于至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,筛选空闲资源的数量小于或等于资源需求量的第二节点服务器; Step 1. Based on the number of idle resources on the initial node server in at least one initial node server, screen the second node server whose idle resource quantity is less than or equal to the resource demand;
步骤二、基于第二节点服务器上的空闲资源和任务的资源需求量,确定执行任务的目标节点服务器。Step 2: Determine the target node server for executing the task based on the idle resources on the second node server and the resource requirements of the task.
这里,由于单节点多资源通讯类型任务对于计算量的需求高于对于通信量的需求,所说可以基于至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,筛选出空闲资源的数量小于或等于资源需求量的第二节点服务器。然后可以确定资源需求量对应的至少一个预设拓扑结构,在第二节点服务器中筛选是否存在具有任一个预设拓扑结构的第二节点服务器,如果是,则将该第二 节点服务器作为目标节点服务器,并将该目标节点服务器中的空闲资源作为目标资源,这里,由于筛选的第二节点服务器的空闲资源的数量是小于或等于资源需求量的,所以筛选出的具有任一个预设拓扑结构的第二节点服务器中所包括的空闲资源的数量一定是等于资源需求量的。Here, since the single-node multi-resource communication task requires more computation than communication, it is possible to filter out the number of idle resources based on the number of idle resources on at least one of the initial node servers. A second node server that is less than or equal to the resource requirement. Then at least one preset topology corresponding to the resource demand can be determined, and whether there is a second node server with any preset topology in the second node server is screened, and if so, the second node server is used as the target node server, and use the idle resources in the target node server as the target resources, here, since the number of idle resources of the second node server screened is less than or equal to the resource demand, the screened ones have any preset topology The number of idle resources included in the second node server must be equal to the resource demand.
如果在从第二节点服务器中未筛选出具有任一个预设拓扑结构的第二节点服务器的情况下,则等待执行该任务,然后经过预设时长重新获取节点服务器上的空闲资源,进而,重新筛选出空闲资源的数量小于或等于资源需求量的第二节点服务器,直至可以从第二节点服务器中筛选出能够执行该任务的目标节点服务器时,为该任务分配资源。If the second node server with any preset topology is not screened out from the second node servers, then wait for the execution of the task, and then reacquire idle resources on the node server after a preset period of time, and then re-acquire the idle resources on the node server. Screen out the second node servers whose number of idle resources is less than or equal to the resource demand, and allocate resources for the task until a target node server capable of executing the task can be selected from the second node servers.
或者,在具体实施时,任务调度系统中,单资源类型的任务的数量较多,所以节点服务器中的资源经常会被单独使用,而单资源类型的任务执行速度较快,所以节点服务器中会经常存在刚刚释放的单个资源,所以可以在确定至少一个节点服务器上的空闲资源的数量发生变化时,确定该节点服务器上已有的空闲资源和刚刚释放的单个资源是否可以组成资源需求量对应的任一个预设拓扑结构,如果是,则将该节点服务器作为目标节点服务器,将该目标节点服务器中的资源作为目标资源,进而可以将该目标节点服务器中的目标资源分配给该任务。Or, in actual implementation, in the task scheduling system, there are many single-resource-type tasks, so the resources in the node server are often used alone, and the execution speed of single-resource-type tasks is faster, so the node server will There is often a single resource that has just been released, so when it is determined that the number of idle resources on at least one node server has changed, it can be determined whether the existing idle resources on the node server and the single resource that has just been released can form a corresponding resource requirement Any preset topology structure, if yes, 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.
在一种实施例中,在任务类型包括多节点类型的情况下,需要选取多个节点服务器用于执行该任务类型的任务,另外,根据公式一~公式六可以得出结论,对于多节点类型的任务,可以根据其对应的资源需求量以及节点服务器上包括的空闲资源的最大数量(即节点服务器上包括的资源数量),先从初始节点服务器中为其分配最大数量的空载的第三节点服务器,并将空载的第三节点服务器作为目标服务器。例如,资源需求量为35,节点服务器上包括的资源数量为8,则先为其分配4个空载的第三节点服务器。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 formulas 1 to 6, it can be concluded that for the multi-node type According to the corresponding resource demand and the maximum number of idle resources included on the node server (that is, the number of resources included on the node server), first allocate the maximum number of empty-loaded third tasks from the initial node server node server, and use the empty third node server as the target server. For example, if the resource requirement is 35, and the number of resources included in the node server is 8, then 4 unloaded third node servers are allocated to it first.
进一步的,在最大数量的第三节点服务器上所包括的资源总量小于资源需求量的情况下,则说明使用最大数量的第三节点服务器还不能够完成任务,还需要再使用一个初始节点服务器上的部分空闲资源以执行该任务,因此,需要先确定资源总量与资源需求量的差值,其中,该差值为另外需要使用的一个初始节点服务器上包括的空闲资源的数量。Furthermore, if the total amount of resources included in the maximum number of third node servers is less than the resource requirement, it means that the task cannot be completed by using the maximum number of third node servers, and it is necessary to use another initial node server 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 initial node server that needs to be used in addition.
在确定差值之后,可以按照为单节点多资源计算类型的任务分配资源的方法,为该多节点类型的任务选取目标节点服务器。具体实施时,可以基于初始节点服务器上的空闲资源的数量,筛选空闲资源的数量小于或等于差值的第四节点服务器,然后基于上述实施例中确定单节点多资源计算类型的任务的目标节点服务器的方法,从第四节点服务器中筛选出目标节点服务器,进而,可以将选取的空载的目标节点服务器和该目标节点服务器一起分配给该多节点类型的任务。After the difference is determined, a target node server can be selected for the task of the multi-node type according to the method of allocating resources for the task of the single-node multi-resource computing type. During specific implementation, based on the number of idle resources on the initial node server, filter the fourth node server whose number of idle resources is less than or equal to the difference, and then determine the target node of the single-node multi-resource computing task based on the above-mentioned embodiment In the server method, the target node server is selected from the fourth node server, and then, the selected empty target node server and the target node server can be assigned to the multi-node task.
另外,如果在为多节点类型的任务选取空载的目标节点服务器的过程中,不存在足够数量空载的节点服务器时,则等待执行该任务,直至存在足够数量空载的节点服务器时,为其分配节点服务器和资源。In addition, if there are not enough empty node servers in the process of selecting empty target node servers for multi-node tasks, then wait to execute the task until there are enough empty node servers. It allocates node servers and resources.
在一种实施例中,在任务类型包括单资源类型的情况下,该任务类型的任务的资源需求量为1,只需要单资源即可完成,因此可以直接基于初始节点服务器上的空闲资源的数量,将空闲资源的数量与资源需求量相等的初始节点服务器作为目标节点服务器,如果空闲资源的数量与资源需求量相等的初始节点服务器包括多个,则可以随机选取任一个初始节点服务器作为目标服务器。In one embodiment, when the task type includes a single-resource type, the resource requirement of the task type is 1, and only a single resource is required to complete it. Therefore, it can be directly based on the idle resource on the initial node server. Quantity, the initial node server whose number of idle resources is equal to the resource demand is taken as the target node server, if there are multiple initial node servers with the number of idle resources equal to the resource demand, any initial node server can be randomly selected as the target server.
另外,在不存在空闲资源的数量与资源需求量相等的初始节点服务器的情况下,则等待执行该任务,直至存在空闲资源的数量与资源需求量相等的节点服务器时,为其分配资源并执行。In addition, if there is no initial node server whose number of idle resources is equal to the resource demand, wait for the execution of the task until there is a node server whose number of idle resources is equal to the resource demand, allocate resources to it and execute .
在一种实施例中,针对S102,还可以按照以下步骤确定任务的任务类型:In one embodiment, for S102, the task type of the task may also be determined according to the following steps:
步骤一、获取节点服务器上的空闲资源。Step 1: Obtain idle resources on the node server.
这里,在获取到待处理的任务的任务信息之后,可以同时获取节点服务器上的空闲资源。Here, after obtaining the task information of the task to be processed, idle resources on the node server can be obtained at the same time.
步骤二、根据任务信息,确定任务的资源需求量、任务的通讯量需求信息。Step 2. According to the task information, determine the resource demand amount of the task and the traffic demand information of the task.
本步骤的具体实施过程可以参照上述实施例中确定资源需求量和通讯量需求信息的步骤,这里不再赘述。For the specific implementation process of this step, reference may be made to the steps of determining resource demand and communication traffic demand information in the above-mentioned embodiments, which will not be repeated here.
步骤三、基于节点服务器上的空闲资源、任务的资源需求量、任务的通讯量需求信息,确定执行任务的目标节点服务器以及目标节点服务器上的目标资源。Step 3: Determine the target node server for executing the task and the target resource on the target node server based on the idle resources on the node server, the resource demand of the task, and the traffic demand information of the task.
这里,任务调度系统可以直接基于该待处理的任务所需要的资源需求量和节点服务器上的空闲资源以及通讯量需求信息,确定能够满足资源需求量和通讯需求量信息对应的通讯量需求的目标节点服务器和目标资源。其中,目标节点服务器中的目标资源具有可选的预设拓扑结构。Here, the task scheduling system can directly determine the target that can meet the traffic demand corresponding to the resource demand and communication demand information based on the resource demand required by the task to be processed, the idle resources on the node server, and the traffic demand information. Node server and target resource. Wherein, the target resource in the target node server has an optional preset topology.
步骤四、基于执行任务的目标节点服务器以及目标节点服务器上的目标资源,确定任务的任务类型。Step 4: Determine the task type of the task based on the target node server executing the task and the target resource on the target node server.
这里,可以基于确定的目标节点服务器的数量、目标节点服务器上的目标资源的数量和通讯量 需求信息,确定该任务的任务类型。Here, the task type of the task may be determined based on the determined quantity of the target node server, the quantity of the target resource on the target node server, and the traffic requirement information.
这样,在确定任务类型的同时确定目标节点服务器和目标资源,进而,可以直接根据将任务类型对应的目标节点服务器和目标资源分配给待处理的任务,省略了选取初始节点服务器的时间,提高了资源调度的速度和效率,从而,提高了任务执行的速度和效率。In this way, while determining the task type, the target node server and target resource can be determined, and then, the target node server and target resource corresponding to the task type can be directly assigned to the task to be processed, omitting the time for selecting the initial node server, and improving The speed and efficiency of resource scheduling, thereby improving the speed and efficiency of task execution.
在另一种实施方式中,用户还可以在提交的配置文件中直接标注待处理的任务的任务类型,进而,任务调度系统可以直接从获取的配置文件中确定该任务的任务类型,并将其作为获取的该任务的任务信息。In another embodiment, the user can also directly mark the task type of the task to be processed in the submitted configuration file, and then the task scheduling system can directly determine the task type of the task from the obtained configuration file, and As the task information obtained for this task.
在一种实施例中,不同任务类型的任务具有不同的资源分配优先级,在获取的待处理的任务包括多个的情况下,可以先确定每一个任务的任务类型,然后基于每一个任务的任务类型,确定每个任务的资源分配优先级。In one embodiment, tasks of different task types have different resource allocation priorities. In the case that there are multiple tasks to be processed, the task type of each task can be determined first, and then based on the task type of each task Task type, which determines the resource allocation priority for each task.
进而,可以基于任务的资源分配优先级,确定执行该任务的目标节点服务器以及目标节点服务器上的目标资源,从而实现合理地为任务分配资源。Furthermore, based on the resource allocation priority of the task, the target node server for executing the task and the target resource on the target node server can be determined, so as to allocate resources to the task reasonably.
具体实施时,可以将单节点多资源通讯类型的任务的资源分配优先级设置为第一优先级;将单节点多资源计算类型的任务的资源分配优先级设置为第二优先级;将多节点类型的任务的资源分配优先级设置为第三优先级;将单资源类型的任务的资源分配优先级设置为第四优先级。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; multi-node The resource allocation priority of the type task is set to the third priority; the resource allocation priority of the single resource type task is set to the fourth priority.
这样,单节点多资源通讯类型的任务对于通信量的需求较高,将该任务类型的任务设置为第一优先级,能够满足其所需要的通信量,提高执行该任务类型的任务的速度,单节点多资源计算类型的任务对于计算量的需求较高,对于通信量的需求较小,将该任务类型的任务设置为第二优先级,能够满足其所需要的计算量,并能够降低对空闲资源的数量多的节点服务器中的空闲资源的原有拓扑结构的拆分概率,多节点类型的任务需要空载的节点服务器且该任务类型的任务相对较少,将其设置为第三优先级,能够保证及时地为单节点多资源通讯类型的任务和单节点多资源计算类型的任务分配资源,单资源类型的任务只需要一个资源即可以执行,因此设置为第四优先级能够保证在及时地为单节点多资源通讯类型的任务和单节点多资源计算类型的任务分配资源的基础上,不影响该任务类型的任务的执行速度。In this way, tasks of the single-node multi-resource communication type have a high demand for communication traffic. Setting the task of this task type as the first priority can meet the required communication traffic and increase the speed of executing tasks of this task type. Tasks of the single-node multi-resource computing type have high demands on the amount of computation and relatively small demands on communication traffic. Setting this type of task as the second priority can meet the required amount of computation and reduce the need for The split probability of the original topology of idle resources in node servers with a large number of idle resources. Multi-node tasks require empty node servers and there are relatively few tasks of this task type. Set it to the third priority level, which can ensure that resources are allocated for single-node multi-resource communication tasks and single-node multi-resource computing tasks in a timely manner. Single-resource type tasks only need one resource to execute, so setting it as the fourth priority can ensure On the basis of timely allocating resources to single-node multi-resource communication tasks and single-node multi-resource computing tasks, the execution speed of the task type is not affected.
在一种实施例中,任务信息可以包括资源需求量,因此,可以按照以下步骤获取资源需求量:In an embodiment, the task information may include the resource requirement, therefore, the resource requirement may be obtained according to the following steps:
步骤一、获取待处理的任务的配置文件。Step 1: Obtain the configuration file of the task to be processed.
步骤二、从配置文件中获取待处理的任务的资源需求量。Step 2, obtaining the resource requirement of the task to be processed from the configuration file.
具体实施时,用户在客户端提交与待处理的任务相关的预定义的配置文件的时候,可以直接在配置文件中确定该待处理的任务的资源需求量信息。进而,任务调度系统可以直接从获取的配置文件中获取待处理的任务的资源需求量,并将其作为获取的该任务的任务信息。During specific implementation, when the user submits a predefined configuration file related to the task to be processed at the client terminal, 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 acquire the resource requirement of the task to be processed from the acquired configuration file, and use it as the acquired task information of the task.
这样,不需要对配置文件进行解析就能够获取资源需求量,提高了确定资源需求量的速度。In this way, the resource demand can be obtained without parsing the configuration file, which improves the speed of determining the resource demand.
在一种实施例中,任务信息可以包括通讯量需求信息,因此,可以按照以下步骤获取通讯量需求信息:In an embodiment, the task information may include traffic demand information, therefore, the traffic demand information may be obtained according to the following steps:
步骤一、获取待处理的任务的计算量信息和通信量信息。 Step 1. Obtain calculation volume information and communication volume information of tasks to be processed.
具体实施时,可以基于对获取的待处理的任务的配置文件的解析,或基于对获取的待处理的任务请求的解析,确定待处理的任务的计算量信息和通信量信息;其中,任务请求中包括计算量信息和通信量信息,任务请求可以为用户在客户端提交的为任务分配资源的请求。During specific implementation, the calculation amount information and communication amount information of the task to be processed can be determined based on the analysis of the obtained configuration file of the task to be processed, or based on the analysis of the obtained task request to be processed; wherein, the task request Including calculation amount information and communication amount information, the task request may be a request submitted by a user on the client to allocate resources for the task.
步骤二、基于计算量信息和通信量信息,确定通讯量需求信息。Step 2. Based on the calculation amount information and the communication amount information, determine the communication amount requirement information.
这里,可以确定计算量信息对应的计算量和通信量信息对应的计算量之间的比值,并基于确定的比值,确定通讯量需求信息。Here, a 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 demand information may be determined.
在另一种实施例中,在任务信息可以包括通讯量需求信息的情况下,还可以按照以下步骤获取通讯量需求信息:In another embodiment, in the case that the task information may include traffic demand information, the traffic demand information may also be obtained according to the following steps:
步骤一、获取待处理的任务的配置文件; Step 1. Obtain the configuration file of the task to be processed;
步骤二、从配置文件中获取待处理的任务的通讯量需求信息。Step 2: Obtain the communication traffic requirement information of the task to be processed from the configuration file.
这里,用户提交的配置文件中可以直接包括该待处理的任务的通讯量需求信息。进而,任务调度系统可以直接从获取的配置文件中获取待处理的任务的通讯量需求信息,并将其作为获取的该任务的任务信息。Here, the configuration file submitted by the user may directly include the traffic demand information of the task to be processed. Furthermore, the task scheduling system may directly acquire the traffic demand information of the task to be processed from the acquired configuration file, and use it as the acquired task information of the task.
这样,不需要对配置文件进行解析以获取通讯量需求信息,省略了计算该信息的步骤,提高了确定通讯量需求信息的速度。In this way, the configuration file does not need to be parsed 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.
另外,本公开实施例化提供了一种应用于客户端的任务调度方法,如图8所示,为本公开实施例所提供的一种应用于客户端的任务调度方法的流程图,可以包括以下步骤:In addition, an embodiment of the present disclosure provides a task scheduling method applied to a client, as shown in FIG. 8 , which is a flow chart of a task scheduling method applied to a client provided by an embodiment of the present disclosure, which may include the following steps :
S801:确定待处理的任务的任务类型。S801: Determine the task type of the task to be processed.
这里,用户在客户端提交与待处理的任务相关的预定义的配置文件之后,客户端可以基于该配置文件,直接确定该任务的任务类型。Here, after the user submits a predefined configuration file related to the task to be processed at the client, the client can directly determine the task type of the task based on the configuration file.
S802:基于任务的任务类型,确定执行任务的目标节点服务器以及目标节点服务器上的目标资源。S802: Based on the task type of the task, determine the target node server for executing the task and the target resource on the target node server.
这里,针对不同任务类型的任务,确定目标节点服务器和目标资源的方式不同。Here, for tasks of different task types, the ways of determining the target node server and the target resource are different.
客户端在确定任务的任务类型之后,可以根据节点服务器上的空闲资源以及该任务的任务类型,确定可以用于执行任务的目标节点服务器以及目标节点服务器上的目标资源。其中,目标资源为空闲资源。After determining the task type of the task, the client can determine the target node server that can be used to execute the task and the target resource on the target node server according to the idle resources on the node server and the task type of the task. Wherein, the target resource is an idle resource.
关于S802的具体实施过程,可以参照应用于调度器端的任务调度方法中,基于任务类型确定目标节点服务器和目标资源的步骤,只是执行主体由调度器变为该调度器对应的客户端,因此,这里不再赘述。Regarding the specific implementation process of S802, you can refer to the steps of determining the target node server and target resource based on the task type in the task scheduling method applied to the scheduler, but the execution subject changes from the scheduler to the client corresponding to the scheduler. Therefore, I won't go into details here.
S803:将目标节点服务器的信息以及目标资源的信息发送给调度器,以使调度器将目标节点服务器以及目标资源分配给待处理的任务。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.
这里,客户端可以直接将确定的目标节点服务器的信息以及目标资源的信息发送给调度器,也即,发送给任务调度系统。之后,调度器可以直接基于目标节点服务器的信息和目标资源的信息,确定用于执行该待处理的任务的目标节点服务器以及目标节点服务器上的目标资源,进而,可以将目标节点服务器以及目标资源分配给待处理的任务。Here, the client may 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 information of the target node server and the target resource, and then, the target node server and the target resource can be Assigned to pending tasks.
这样,客户端基于确定的任务类型先确定目标节点服务器和目标资源,然后将其发送给调度器的方式,调度器省略了确定目标节点服务器和目标资源的步骤,可以直接将目标节点服务器和目标资源分配给任务,从而,能够提高资源调度的速度以及任务的执行速度和效率。In this way, the client first determines the target node server and target resource based on the determined task type, and then sends it to the scheduler. The scheduler omits the step of determining the target node server and target resource, and can directly send the target node server and target Resources are allocated to tasks, so that the speed of resource scheduling and the execution speed and efficiency of tasks can be improved.
在一种实施例中,针对S801,可以按照以下步骤确定任务类型:In one embodiment, for S801, the task type may be determined according to the following steps:
步骤一、确定任务的资源需求量、任务的通讯量需求信息以及节点服务器中的资源数量。 Step 1. Determine the resource requirement of the task, the communication traffic requirement information of the task, and the resource quantity in the node server.
这里,客户端可以基于对配置文件的解析,确定任务的资源需求量和任务的通讯量需求信息。Here, the client can determine the resource requirement of the task and the communication traffic requirement information of the task based on the analysis of the configuration file.
或者,可以直接从配置文件中获取任务的资源需求量和任务的通讯量需求信息,这里不进行限定。Alternatively, the task's resource requirement and the task's traffic requirement information can be obtained directly from the configuration file, which is not limited here.
并且,客户端可以确定任务调度系统中节点服务器中的资源数量。这里,资源数量即GPU数量。Also, the client can determine the resource quantity in the node server in the task scheduling system. Here, the number of resources is the number of GPUs.
步骤二、基于确定的资源需求量、任务的通讯量需求信息、节点服务器中的资源数量,确定任务的任务类型。Step 2: Determine the task type of the task based on the determined resource demand, the communication traffic demand information of the task, and the resource quantity in the node server.
具体实施时,可以基于资源需求量和节点服务器中的资源数量,确定执行该待处理的任务所需要的节点服务器的数量,也即确定该待处理的任务对应的目标节点服务器的数量。其中,
Figure PCTCN2021124136-appb-000007
Figure PCTCN2021124136-appb-000008
其中,
Figure PCTCN2021124136-appb-000009
表示向上取整。
During 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 server, that is, the number of target node servers corresponding to the task to be processed can be determined. in,
Figure PCTCN2021124136-appb-000007
Figure PCTCN2021124136-appb-000008
in,
Figure PCTCN2021124136-appb-000009
Indicates rounding up.
进而,可以基于待处理的任务对应的目标节点服务器的数量和确定的该任务的通讯量需求信息,确定该待处理的任务的任务类型。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 traffic demand information of the task.
在另一种实施例中,针对S801,还可以按照以下步骤确定任务类型:In another embodiment, for S801, the task type may also be determined according to the following steps:
步骤一、获取节点服务器上的空闲资源。Step 1: Obtain idle resources on the node server.
这里,客户端在获取到用户提交的配置文件之后,可以同时获取节点服务器上的空闲资源。Here, after the client obtains the configuration file submitted by the user, it can simultaneously obtain idle resources on the node server.
步骤二、基于节点服务器上的空闲资源、任务的资源需求量、任务的通讯量需求信息,确定执行任务的至少一个目标节点服务器以及目标节点服务器上的目标资源。Step 2: Determine at least one target node server for executing the task and target resources on the target node server based on idle resources on the node server, resource requirements of the task, and traffic requirements of the task.
这里,客户端可以直接基于该待处理的任务所需要的资源需求量和节点服务器上的空闲资源以及通讯量需求信息,确定能够满足资源需求量和通讯需求量信息对应的通讯量需求的目标节点服务器和目标资源。其中,目标节点服务器中的目标资源具有可选的预设拓扑结构。Here, the client can directly determine the target node that can meet the traffic demand corresponding to the resource demand and communication demand information based on the resource demand required by the task to be processed, the idle resources on the node server, and the traffic demand information Server and target resources. Wherein, the target resource in the target node server has an optional preset topology.
步骤三、基于至少一个目标节点服务器以及目标节点服务器上的目标资源,确定任务的任务类型。Step 3: Determine the task type of the task based on at least one target node server and target resources on the target node server.
这里,可以基于确定的目标节点服务器的数量、目标节点服务器上的目标资源的数量和通讯量需求信息,确定该任务的任务类型。Here, the task type of the task may be determined based on the determined number of target node servers, the number of target resources on the target node server, and traffic demand information.
具体实施时,关于上述实施例中提及的确定任务类型的步骤的具体实施过程,可以参照应用于调度器端的任务调度方法中确定任务类型的步骤,只是执行主体由调度器变为该调度器对应的客户端,因此,这里不再赘述。During specific implementation, regarding the specific implementation process of the step of determining the task type mentioned in the above embodiments, you can refer to the step of determining the task type in the task scheduling method applied to the scheduler side, only the execution subject changes from the scheduler to the scheduler The corresponding client, therefore, will not be repeated here.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确 定。Those skilled in the art can understand that in the above method of specific implementation, the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process. The specific execution order of each step should be based on its function and possible The inner logic is OK.
基于同一发明构思,本公开实施例中还提供了与应用于调度器端的任务调度方法对应的任务调度装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述任务调度方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。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 scheduler, because the problem-solving principle of 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 , so the implementation of the device can refer to the implementation of the method, and the repetition will not be repeated.
如图9所示,为本公开实施例提供的一种应用于调度器端的任务调度装置的示意图,包括:As shown in FIG. 9 , it is a schematic diagram of a task scheduling device applied to the scheduler side provided by an embodiment of the present disclosure, including:
获取模块901,用于获取待处理的任务的任务信息;An acquisition module 901, configured to acquire task information of tasks to be processed;
第一确定模块902,用于基于所述任务信息,确定所述任务的任务类型;The first determining module 902 is configured to determine the task type of the task based on the task information;
第二确定模块903,用于基于所述任务类型,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;The second determination module 903 is configured to determine the target node server for executing the task and the target resource on the target node server based on the task type;
分配模块904,用于将所述目标节点服务器以及所述目标节点服务器上的目标资源分配用于执行所述任务。An allocating module 904, configured to allocate the target node server and target resources on the target node server to execute the task.
在一种可能的实施方式中,所述第一确定模块902,用于根据所述任务信息,确定所述任务的资源需求量、所述任务的通讯量需求信息;In a possible implementation manner, the first determining module 902 is configured to determine the resource requirement of the task and the traffic 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 demand, communication traffic demand information of the task, and resource quantity in the node server.
在一种可能的实施方式中,所述第二确定模块903,用于基于所述任务的任务类型、所述任务的资源需求量以及节点服务器上的空闲资源,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源。In a possible implementation manner, the second determination module 903 is configured to determine the target node for executing the task based on the task type of the task, the resource demand of the task, and the idle resources on the node server server and the target resource on the target node server.
在一种可能的实施方式中,所述第二确定模块903,用于基于所述任务的任务类型,确定与所述任务类型相匹配的至少一个初始节点服务器;In a possible implementation manner, the second determining module 903 is configured to determine at least one initial node server matching the task type based on the task type of the task;
基于所述任务的资源需求量以及初始节点服务器上的空闲资源,从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源。Based on the resource requirements of the task and idle resources on the initial node server, determine a target node server for executing the task and target resources on the target node server from the at least one initial node server.
在一种可能的实施方式中,所述任务类型包括单节点多资源通讯类型;In a possible implementation manner, the task type includes a single-node multi-resource communication type;
所述第二确定模块903,用于基于所述至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,筛选空闲资源的数量大于或等于所述资源需求量的初始节点服务器作为第一节点服务器;The second determination module 903 is configured to, based on the number of idle resources on the initial node servers in the at least one initial node server, select the initial node server whose number of idle resources is greater than or equal to the resource requirement as the first node server;
基于所述第一节点服务器上的空闲资源和所述任务的资源需求量,确定执行所述任务的目标节点服务器。A target node server for executing the task is determined based on idle resources on the first node server and resource requirements of the task.
在一种可能的实施方式中,所述第二确定模块903,用于确定所述资源需求量对应的至少一个预设拓扑结构;In a possible implementation manner, the second determination module 903 is configured to determine at least one preset topology corresponding to the resource requirement;
在所述第一节点服务器中筛选具有任一个所述预设拓扑结构,并且空闲资源的数量最少的第一节点服务器作为所述目标节点服务器。Selecting, among the first node servers, the first node server having any one of the preset topology structures and the least number of idle resources as the target node server.
在一种可能的实施方式中,所述第二确定模块903,用于将所述目标节点服务器中的具有的预设拓扑结构作为目标拓扑结构;In a possible implementation manner, the second determination module 903 is configured to use a preset topology in the target node server as the target topology;
将目标节点服务器中构成所述目标拓扑结构的空闲资源作为所述目标资源。Taking idle resources constituting the target topology in the target node server as the target resources.
在一种可能的实施方式中,所述任务类型包括单节点多资源计算类型;In a possible implementation manner, the task type includes a single-node multi-resource computing type;
所述第二确定模块903,用于基于所述至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,筛选空闲资源的数量小于或等于所述资源需求量的第二节点服务器;The second determining module 903 is configured to, based on the number of idle resources on the initial node servers in the at least one initial node server, screen a second node server whose number of idle resources is less than or equal to the resource requirement;
基于所述第二节点服务器上的空闲资源和所述任务的资源需求量,确定执行所述任务的目标节点服务器。A target node server for executing the task is determined based on idle resources on the second node server and resource requirements of the task.
在一种可能的实施方式中,所述第二确定模块903,用于确定所述资源需求量对应的至少一个预设拓扑结构;In a possible implementation manner, the second determination module 903 is configured to determine at least one preset topology corresponding to the resource requirement;
在所述第二节点服务器中筛选具有任一个所述预设拓扑结构的第二服务器作为所述目标节点服务器。Selecting any second server with the preset topology among the second node servers as the target node server.
在一种可能的实施方式中,所述第二确定模块903,还用于在从所述第二节点服务器中未筛选出具有任一个所述预设拓扑结构的第二节点服务器的情况下,经过预设时长或至少一个节点服务器上的空闲资源发生变化,重新获取节点服务器上的空闲资源的数量,并返回基于所述至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,筛选空闲资源的数量小于或等于所述资源需求量的第二节点服务器的步骤。In a possible implementation manner, the second determining module 903 is further configured to, when no second node server having any one of the preset topology structures is screened out from the second node servers, After a preset period of time or at least one idle resource on the node server changes, reacquire the number of idle resources on the node server, and return based on the number of idle resources on the initial node server among the at least one initial node server, filter A step of the second node server whose number of idle resources is less than or equal to the required amount of resources.
在一种可能的实施方式中,所述任务类型包括多节点类型;In a possible implementation manner, the task type includes a multi-node type;
所述第二确定模块903,用于基于所述任务的资源需求量,从所述至少一个初始节点服务器中,确定执行任务所需的第三节点服务器的最大数量;其中,所述第三节点服务器为空载的初始节点服务器;The second determination module 903 is configured to determine, from the at least one initial node server, the maximum number of third node servers required to execute the task based on the resource requirement of the task; wherein, the third node The server is an empty initial node server;
将所述最大数量的第三节点服务器作为所述目标节点服务器。The third node server with the maximum number is used as the target node server.
在一种可能的实施方式中,所述第二确定模块903,还用于在最大数量的第三节点服务器上的资源总量小于所述资源需求量的情况下,确定所述资源总量与所述资源需求量的差值;In a possible implementation manner, the second determination module 903 is further configured to determine the total amount of resources and the difference in resource requirements;
基于初始节点服务器上的空闲资源的数量,筛选空闲资源的数量小于或等于所述差值的第四节点服务器;Based on the number of idle resources on the initial node server, screening a fourth node server whose number of idle resources is less than or equal to the difference;
基于所述第四节点服务器上的空闲资源和所述差值,确定执行所述任务的目标节点服务器。Based on the free resources on the fourth node server and the difference, determine a target node server for executing the task.
在一种可能的实施方式中,所述任务类型包括单资源类型;In a possible implementation manner, the task type includes a single resource type;
所述第二确定模块903,用于基于所述至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,将空闲资源的数量与所述资源需求量相等的初始节点服务器作为所述目标节点服务器。The second determining module 903 is configured to, based on the number of idle resources on the initial node servers in the at least one initial node server, use the initial node server whose number of idle resources is equal to the resource requirement as the target node server.
在一种可能的实施方式中,所述第二确定模块903,还用于按照以下步骤确定预设拓扑结构:In a possible implementation manner, the second determination module 903 is further configured to determine a preset topology according to the following steps:
针对任一待匹配节点服务器中的空闲资源,确定该待匹配节点服务器中的任一数量的空闲资源对应的拓扑结构;For the idle resources in any node server to be matched, determine the topology structure corresponding to any number of idle resources in the node server to be matched;
基于空闲资源之间的通信介质,确定所述拓扑结构的通信等待时长;Determine the communication waiting time of the topology based on the communication medium between idle resources;
基于所述通信等待时长,确定与该待匹配节点服务器中任一数量的空闲资源对应的预设拓扑结构。Based on the communication waiting time, a preset topology corresponding to any number of idle resources in the node server to be matched is determined.
在一种可能的实施方式中,所述第二确定模块903,用于按照所述通信等待时长从低到高的顺序,将所述拓扑结构进行排序;In a possible implementation manner, the second determining module 903 is configured to sort the topological structures according to the order of the communication waiting time from low to high;
将排序次序小于预设次序的拓扑结构,作为与该待匹配节点服务器对应的预设拓扑结构。The topological structure whose sort order is smaller than the preset order is used as the preset topology structure corresponding to the node server to be matched.
在一种可能的实施方式中,所述第二确定模块903,用于针对任一数量的空闲资源,将所述通信等待时长小于预设等待阈值的拓扑结构,作为与该待匹配节点服务器中的该数量的空闲资源对应的预设拓扑结构。In a possible implementation manner, the second determination module 903 is configured to, for any number of idle resources, use the topology structure whose communication waiting time is less than a preset waiting threshold as the The default topology corresponding to the number of idle resources.
在一种可能的实施方式中,所述第一确定模块902,用于获取节点服务器上的空闲资源;In a possible implementation manner, the first determining module 902 is configured to acquire idle resources on the node server;
根据所述任务信息,确定所述任务的资源需求量、所述任务的通讯量需求信息;According to the task information, determine the resource requirement of the task and the traffic requirement information of the task;
基于所述节点服务器上的空闲资源、所述任务的资源需求量、所述任务的通讯量需求信息,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;Determine a target node server for executing the task and target resources on the target node server based on idle resources on the node server, resource requirements of the task, and traffic demand information of the task;
基于执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源,确定所述任务的任务类型。The task type of the task is determined based on the target node server executing the task and the target resource on the target node server.
在一种可能的实施方式中,所述第二确定模块903,还用于在获取的待处理的任务包括多个的情况下,基于每一个所述任务的任务类型,确定每个任务的资源分配优先级;In a possible implementation manner, the second determination module 903 is further configured to determine the resources of each task based on the task type of each task when the obtained tasks to be processed include multiple Assign priority;
基于每一个所述任务的资源分配优先级,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源。Based on the resource allocation priority of each task, a target node server for executing the task and target resources on the target node server are determined.
在一种可能的实施方式中,所述任务类型包括单节点多资源通讯类型、单节点多资源计算类型、多节点类型、单资源类型;In a possible implementation manner, the task type includes single-node multi-resource communication type, single-node multi-resource computing type, multi-node type, and single-resource type;
所述第二确定模块903,用于将所述单节点多资源通讯类型的任务的资源分配优先级设置为第一优先级;The second determination module 903 is configured to set the resource allocation priority of the task of the single-node multi-resource communication type as the first priority;
将所述单节点多资源计算类型的任务的资源分配优先级设置为第二优先级;Setting the resource allocation priority of the task of the single-node multi-resource computing type to the second priority;
将所述多节点类型的任务的资源分配优先级设置为第三优先级;Setting the resource allocation priority of the task of the multi-node type to the third priority;
将所述单资源类型的任务的资源分配优先级设置为第四优先级。Setting the resource allocation priority of the single-resource type task to the fourth priority.
在一种可能的实施方式中,所述任务信息包括所述资源需求量,所述第一确定模块902,还用于按照以下步骤获取所述资源需求量: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:
获取所述待处理的任务的配置文件;Obtain the configuration file of the task to be processed;
从所述配置文件中获取所述待处理的任务的资源需求量。Obtain the resource requirement of the task to be processed from the configuration file.
在一种可能的实施方式中,所述任务信息包括所述通讯量需求信息,所述第一确定模块902,还用于按照以下步骤获取所述通讯量需求信息:In a possible implementation manner, the task information includes the traffic demand information, and the first determining module 902 is further configured to acquire the traffic demand information according to the following steps:
获取所述待处理的任务的计算量信息和通信量信息;Acquiring calculation amount information and communication amount information of the task to be processed;
基于所述计算量信息和通信量信息,确定所述通讯量需求信息。Based on the calculation amount information and communication amount information, the communication amount requirement information is determined.
在一种可能的实施方式中,所述第一确定模块902,用于基于获取的所述待处理的任务的配置文件或获取的所述待处理的任务请求,确定所述待处理的任务的计算量信息和通信量信息;其中, 所述任务请求中包括所述计算量信息和通信量信息。In a possible implementation manner, the first determining module 902 is configured to determine, based on the obtained configuration file of the pending task or the obtained request of the pending task, the Calculation amount information and communication amount information; wherein, the task request includes the calculation amount information and communication amount information.
在一种可能的实施方式中,所述任务信息包括所述通讯量需求信息,所述第一确定模块902,还用于按照以下步骤获取所述通讯量需求信息:In a possible implementation manner, the task information includes the traffic demand information, and the first determining module 902 is further configured to acquire the traffic demand information according to the following steps:
获取所述待处理的任务的配置文件;Obtain the configuration file of the task to be processed;
从所述配置文件中获取所述待处理的任务的通讯量需求信息。Acquiring traffic demand information of the task to be processed from the configuration file.
在一种可能的实施方式中,所述第一确定模块902,用于基于所述资源需求量和所述节点服务器中的资源数量,确定所述待处理的任务对应的目标节点服务器的数量;In a possible implementation manner, the first determining module 902 is configured to determine the number of target node servers corresponding to the task to be processed based on the resource requirement and the number of resources in the node server;
基于所述待处理的任务对应的目标节点服务器的数量和所述通讯量需求信息,确定所述待处理的任务的任务类型。The task type of the task to be processed is determined based on the number of target node servers corresponding to the task to be processed and the traffic demand information.
在一种可能的实施方式中,所述任务类型包括单节点多资源通讯类型、单节点多资源计算类型、多节点类型、单资源类型;In a possible implementation manner, the task type includes single-node multi-resource communication type, single-node multi-resource computing type, multi-node type, and single-resource type;
所述第一确定模块902,用于在所述待处理的任务对应的目标节点服务器的数量等于1、所述待处理的任务对应的目标资源的数量大于1、并且所述通讯量需求信息指示所述待处理的任务的通信量需求高于计算量需求的情况下,确定所述待处理的任务的任务类型为单节点多资源通讯类型;The first determining module 902 is configured to: 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 traffic demand information indicates When the communication volume requirement of the task to be processed is higher than the calculation volume requirement, determine that the task type of the task to be processed is a single-node multi-resource communication type;
在所述待处理的任务对应的目标节点服务器的数量等于1、所述待处理的任务对应的目标资源的数量大于1、并且所述通讯量需求信息指示所述待处理的任务的计算量需求高于通信量需求的情况下,确定所述待处理的任务的任务类型为单节点多资源计算类型;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 traffic demand information indicates the calculation capacity demand of the task to be processed If it is higher than the communication traffic requirement, it is determined that the task type of the task to be processed is a single-node multi-resource computing type;
在所述待处理的任务对应的目标节点服务器的数量大于1的情况下,确定所述待处理的任务的任务类型为多节点类型;When the number of target node servers corresponding to the task to be processed is greater than 1, determine that the task type of the task to be processed is a multi-node type;
在所述待处理的任务对应的目标资源的数量等于1的情况下,确定所述待处理的任务的任务类型为单资源类型。In a case where 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.
基于同一发明构思,本公开实施例中还提供了与应用于客户端的任务调度方法对应的任务调度装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述任务调度方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。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 problem-solving principle of 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, Therefore, the implementation of the device can refer to the implementation of the method, and the repetition will not be repeated.
如图10所示,为本公开实施例提供的一种应用于客户端的任务调度装置的示意图,包括:As shown in FIG. 10 , it is a schematic diagram of a task scheduling device applied to a client provided by an embodiment of the present disclosure, including:
第三确定模块1001,用于确定待处理的任务的任务类型;The third determination module 1001 is configured to determine the task type of the task to be processed;
第四确定模块1002,用于基于所述任务的任务类型,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;A fourth determining module 1002, configured 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;
发送模块1003,用于将所述目标节点服务器的信息以及所述目标资源的信息发送给调度器,以使所述调度器将所述目标节点服务器以及所述目标资源分配给所述待处理的任务A sending module 1003, configured to send the information of the target node server and the information of the target resource to a scheduler, so that the scheduler allocates the target node server and the target resource to the pending Task
在一种可能的实施方式中,所述第三确定模块1001,用于确定所述任务的资源需求量、所述任务的通讯量需求信息以及所述节点服务器中的资源数量;In a possible implementation manner, the third determination module 1001 is configured to determine the resource requirement of the task, the traffic requirement information of the task, and the resource quantity in the node server;
基于确定的所述资源需求量、任务的通讯量需求信息、所述节点服务器中的资源数量,确定所述任务的任务类型。The task type of the task is determined based on the determined resource demand, communication traffic demand information of the task, and resource quantity in the node server.
在一种可能的实施方式中,所述第三确定模块1001,用于获取节点服务器上的空闲资源;In a possible implementation manner, the third determination module 1001 is configured to acquire idle resources on the node server;
基于所述节点服务器上的空闲资源、所述任务的资源需求量、所述任务的通讯量需求信息,确定执行所述任务的至少一个目标节点服务器以及所述目标节点服务器上的目标资源;Determine at least one target node server for executing the task and target resources on the target node server based on idle resources on the node server, resource requirements of the task, and traffic demand information of the task;
基于所述至少一个目标节点服务器以及所述目标节点服务器上的目标资源,确定所述任务的任务类型。A task type of the task is determined based on the at least one target node server and target resources on the target node server.
关于装置中的各模块的处理流程、以及各模块之间的交互流程的描述可以参照上述方法实施例中的相关说明,这里不再详述。For the description of the processing flow of each module in the device and the interaction flow between the modules, reference may be made to the relevant description in the above method embodiment, and details will not be described here.
本公开实施例还提供了一种计算机设备,如图11所示,为本公开实施例提供的一种计算机设备结构示意图,包括:An embodiment of the present disclosure also provides a computer device, as shown in FIG. 11 , which is a schematic structural diagram of a computer device provided by an embodiment of the present disclosure, including:
处理器1101和存储器1102;所述存储器1102存储有处理器1101可执行的机器可读指令,处理器1101用于执行存储器1102中存储的机器可读指令,所述机器可读指令被处理器1101执行时,处理器1101执行下述步骤:S101:获取待处理的任务的任务信息;S102:基于任务信息,确定任务的任务类型;S103:基于任务类型,确定执行任务的目标节点服务器以及目标节点服务器上的目标资源以及S104:将目标节点服务器以及目标节点服务器上的目标资源分配用于执行任务。 Processor 1101 and memory 1102; the memory 1102 stores machine-readable instructions executable by the processor 1101, the processor 1101 is used to execute the machine-readable instructions stored in the memory 1102, and the machine-readable instructions are executed by the processor 1101 During execution, the processor 1101 performs the following steps: S101: Obtain the task information of the task to be processed; S102: Determine the task type of the task based on the task information; S103: Determine the target node server and the target node for executing the task based on the task type The target resource on the server and S104: allocate the target node server and the target resource on the target node server to execute the task.
上述存储器1102包括内存1121和外部存储器1122;这里的内存1121也称内存储器,用于暂时存放处理器1101中的运算数据,以及与硬盘等外部存储器1122交换的数据,处理器1101通过内存1121与外部存储器1122进行数据交换。The above-mentioned memory 1102 includes a memory 1121 and an external memory 1122; the memory 1121 here is also called an internal memory, and is used to temporarily store the calculation data in the processor 1101 and the data exchanged with the external memory 1122 such as a hard disk. The external memory 1122 performs data exchange.
上述指令的具体执行过程可以参考本公开实施例中所述的任务调度方法的步骤,此处不再赘述。For the specific execution process of the above instructions, reference may be made to the steps of the task scheduling method described in the embodiments of the present disclosure, which will not be repeated here.
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的任务调度方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。Embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the steps of the task scheduling method described in the foregoing method embodiments are executed. Wherein, the storage medium may be a volatile or non-volatile computer-readable storage medium.
本公开实施例所提供的任务调度方法的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行上述方法实施例中所述的任务调度方法的步骤,具体可参见上述方法实施例,在此不再赘述。The computer program product of the task scheduling method provided by the embodiments 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 embodiments For details, reference may be made to the foregoing method embodiments, and details are not repeated here.
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product can be specifically realized by means of hardware, software or a combination thereof. In an 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 (Software Development Kit, SDK) etc. Wait.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。以上所描述的装置实施例是示意性的,例如,所述单元的划分,为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the device described above can refer to the corresponding process in the foregoing method embodiment, and details are not repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods may be implemented in other ways. The device embodiments described above are illustrative. For example, the division of the units is a logical function division. In actual implementation, there may be another division method. For example, multiple units or components can be combined, or some Features can be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。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 may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on this understanding, the technical solution of the present disclosure is essentially 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, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that: the above-mentioned embodiments are only specific implementations of the present disclosure, and are used to illustrate the technical solutions of the present disclosure, rather than limit them, and the protection scope of the present disclosure is not limited thereto, although referring to the aforementioned The embodiments have described the present disclosure in detail, and those skilled in the art should understand that any person familiar with the technical field can still modify the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present disclosure Changes can be easily imagined, or equivalent replacements can be made to some of the technical features; 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 this disclosure. within the scope of protection. Therefore, the protection scope of the present disclosure should be defined by the protection scope of the claims.

Claims (33)

  1. 一种任务调度方法,其特征在于,应用于调度器端,包括:A task scheduling method, characterized in that it is applied to the scheduler side, comprising:
    获取待处理的任务的任务信息;Obtain task information of pending tasks;
    基于所述任务信息,确定所述任务的任务类型;determining a task type of the task based on the task information;
    基于所述任务类型,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;Based on the task type, determine a target node server for executing the task and target resources on the target node server;
    将所述目标节点服务器以及所述目标节点服务器上的目标资源分配用于执行所述任务。Allocating the target node server and target resources on the target node server to perform the task.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述任务信息,确定所述任务的任务类型,包括:The method according to claim 1, wherein the determining the task type of the task according to the task information comprises:
    根据所述任务信息,确定所述任务的资源需求量、所述任务的通讯量需求信息;According to the task information, determine the resource requirement of the task and the traffic requirement information of the task;
    确定节点服务器中的资源数量;Determine the number of resources in the node server;
    基于确定的所述资源需求量、任务的通讯量需求信息、所述节点服务器中的资源数量,确定所述任务的任务类型。The task type of the task is determined based on the determined resource demand, communication traffic demand information of the task, and resource quantity in the node server.
  3. 根据权利要求1所述的方法,其特征在于,所述基于所述任务类型,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源,包括:The method according to claim 1, wherein the determining the target node server for executing the task and the target resource on the target node server based on the task type includes:
    基于所述任务的任务类型、所述任务的资源需求量以及节点服务器上的空闲资源,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源。A target node server for executing the task and target resources on the target node server are determined based on the task type of the task, the resource requirement of the task, and the idle resources on the node server.
  4. 根据权利要求3所述的方法,其特征在于,所述基于所述任务的任务类型、所述任务的资源需求量以及节点服务器上的空闲资源,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源,包括:The method according to claim 3, wherein the target node server for executing the task and the Target resources on the target node server, including:
    基于所述任务的任务类型,确定与所述任务类型相匹配的至少一个初始节点服务器;determining at least one initial node server matching the task type based on the task type of the task;
    基于所述任务的资源需求量以及初始节点服务器上的空闲资源,从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源。Based on the resource requirements of the task and idle resources on the initial node server, determine a target node server for executing the task and target resources on the target node server from the at least one initial node server.
  5. 根据权利要求4所述的方法,其特征在于,所述任务类型包括单节点多资源通讯类型;The method according to claim 4, wherein the task type includes a single-node multi-resource communication type;
    所述从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器,包括:The determining the target node server for performing the task from the at least one initial node server includes:
    基于所述至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,筛选空闲资源的数量大于或等于所述资源需求量的初始节点服务器作为第一节点服务器;Based on the number of idle resources on the initial node server in the at least one initial node server, select the initial node server whose number of idle resources is greater than or equal to the resource demand as the first node server;
    基于所述第一节点服务器上的空闲资源和所述任务的资源需求量,确定执行所述任务的目标节点服务器。A target node server for executing the task is determined based on idle resources on the first node server and resource requirements of the task.
  6. 根据权利要求5所述的方法,其特征在于,所述基于所述第一节点服务器上的空闲资源和所述任务的资源需求量,确定执行所述任务的目标节点服务器,包括:The method according to claim 5, wherein the determining the target node server for executing the task based on the idle resources on the first node server and the resource demand of the task comprises:
    确定所述资源需求量对应的至少一个预设拓扑结构;determining at least one preset topology structure corresponding to the resource requirement;
    在所述第一节点服务器中筛选具有任一个所述预设拓扑结构,并且空闲资源的数量最少的第一节点服务器作为所述目标节点服务器。Selecting, among the first node servers, the first node server having any one of the preset topology structures and the least number of idle resources as the target node server.
  7. 根据权利要求6所述的方法,其特征在于,确定所述目标节点服务器上的目标资源,包括:The method according to claim 6, wherein determining the target resource on the target node server comprises:
    将所述目标节点服务器中的具有的预设拓扑结构作为目标拓扑结构;Taking the preset topology in the target node server as the target topology;
    将目标节点服务器中构成所述目标拓扑结构的空闲资源作为所述目标资源。Taking idle resources constituting the target topology in the target node server as the target resources.
  8. 根据权利要求4所述的方法,其特征在于,所述任务类型包括单节点多资源计算类型;The method according to claim 4, wherein the task type includes a single-node multi-resource computing type;
    所述从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器,包括:The determining the target node server for performing the task from the at least one initial node server includes:
    基于所述至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,筛选空闲资源的数量小于或等于所述资源需求量的第二节点服务器;Based on the number of idle resources on the initial node server in the at least one initial node server, screening the second node server whose number of idle resources is less than or equal to the resource requirement;
    基于所述第二节点服务器上的空闲资源和所述任务的资源需求量,确定执行所述任务的目标节点服务器。A target node server for executing the task is determined based on idle resources on the second node server and resource requirements of the task.
  9. 根据权利要求8所述的方法,其特征在于,所述基于所述第二节点服务器上的空闲资源和所述任务的资源需求量,确定执行所述任务的目标节点服务器,包括:The method according to claim 8, wherein the determining the target node server for executing the task based on the idle resources on the second node server and the resource requirements of the task comprises:
    确定所述资源需求量对应的至少一个预设拓扑结构;determining at least one preset topology structure corresponding to the resource requirement;
    在所述第二节点服务器中筛选具有任一个所述预设拓扑结构的第二服务器作为所述目标节点服务器。Selecting any second server with the preset topology among the second node servers as the target node server.
  10. 根据权利要求9所述的方法,其特征在于,所述基于所述第二节点服务器上的空闲资源和 所述任务的资源需求量,确定执行所述任务的目标节点服务器,还包括:The method according to claim 9, wherein, determining the target node server for performing the task based on the idle resource on the second node server and the resource requirement of the task, further comprising:
    在从所述第二节点服务器中未筛选出具有任一个所述预设拓扑结构的第二节点服务器的情况下,经过预设时长或至少一个节点服务器上的空闲资源发生变化,重新获取节点服务器上的空闲资源的数量,并返回基于所述至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,筛选空闲资源的数量小于或等于所述资源需求量的第二节点服务器的步骤。In the case that no second node server with any one of the preset topology structures is screened out from the second node servers, after a preset period of time or at least one idle resource on the node server changes, the node server is reacquired and returning to the step of screening the second node server whose number of idle resources is less than or equal to the resource requirement based on the number of idle resources on the initial node server among the at least one initial node server.
  11. 根据权利要求4所述的方法,其特征在于,所述任务类型包括多节点类型;The method according to claim 4, wherein the task type includes a multi-node type;
    所述从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器,包括:The determining the target node server for performing the task from the at least one initial node server includes:
    基于所述任务的资源需求量,从所述至少一个初始节点服务器中,确定执行任务所需的第三节点服务器的最大数量;其中,所述第三节点服务器为空载的初始节点服务器;Based on the resource requirement of the task, from the at least one initial node server, determine the maximum number of third node servers required to perform the task; wherein, the third node server is an empty initial node server;
    将所述最大数量的第三节点服务器作为所述目标节点服务器。The third node server with the maximum number is used as the target node server.
  12. 根据权利要求11所述的方法,其特征在于,所述从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器,还包括:The method according to claim 11, wherein the determining the target node server for performing the task from the at least one initial node server further comprises:
    在最大数量的第三节点服务器上的资源总量小于所述资源需求量的情况下,确定所述资源总量与所述资源需求量的差值;When the total amount of resources on the largest number of third node servers is less than the resource requirement, determine the difference between the resource total and the resource requirement;
    基于初始节点服务器上的空闲资源的数量,筛选空闲资源的数量小于或等于所述差值的第四节点服务器;Based on the number of idle resources on the initial node server, screening a fourth node server whose number of idle resources is less than or equal to the difference;
    基于所述第四节点服务器上的空闲资源和所述差值,确定执行所述任务的目标节点服务器。Based on the free resources on the fourth node server and the difference, determine a target node server for executing the task.
  13. 根据权利要求4所述的方法,其特征在于,所述任务类型包括单资源类型;The method according to claim 4, wherein the task type includes a single resource type;
    所述从所述至少一个初始节点服务器中,确定执行所述任务的目标节点服务器,包括:The determining the target node server for performing the task from the at least one initial node server includes:
    基于所述至少一个初始节点服务器中的初始节点服务器上的空闲资源的数量,将空闲资源的数量与所述资源需求量相等的初始节点服务器作为所述目标节点服务器。Based on the number of idle resources on the initial node server in the at least one initial node server, the initial node server whose idle resource quantity is equal to the resource requirement is used as the target node server.
  14. 根据权利要求1所述的方法,其特征在于,还包括确定预设拓扑结构的步骤:The method according to claim 1, further comprising the step of determining a preset topology:
    针对任一待匹配节点服务器中的空闲资源,确定该待匹配节点服务器中的任一数量的空闲资源对应的拓扑结构;For the idle resources in any node server to be matched, determine the topology structure corresponding to any number of idle resources in the node server to be matched;
    基于空闲资源之间的通信介质,确定所述拓扑结构的通信等待时长;Determine the communication waiting time of the topology based on the communication medium between idle resources;
    基于所述通信等待时长,确定与该待匹配节点服务器中任一数量的空闲资源对应的预设拓扑结构。Based on the communication waiting time, a preset topology corresponding to any number of idle resources in the node server to be matched is determined.
  15. 根据权利要求14所述的方法,其特征在于,所述基于所述通信等待时长,确定与该待匹配节点服务器中任一数量的空闲资源对应的预设拓扑结构,包括:The method according to claim 14, wherein the determining a preset topology corresponding to any number of idle resources in the node server to be matched based on the communication waiting time includes:
    按照所述通信等待时长从低到高的顺序,将所述拓扑结构进行排序;Sorting the topological structures according to the order of the communication waiting time from low to high;
    将排序次序小于预设次序的拓扑结构,作为与该待匹配节点服务器对应的预设拓扑结构。The topological structure whose sort order is smaller than the preset order is used as the preset topology structure corresponding to the node server to be matched.
  16. 根据权利要求14所述的方法,其特征在于,所述基于所述通信等待时长,确定与该待匹配节点服务器中任一数量的空闲资源对应的预设拓扑结构,包括The method according to claim 14, wherein, based on the communication waiting time, determining a preset topology corresponding to any number of idle resources in the node server to be matched includes
    针对任一数量的空闲资源,将所述通信等待时长小于预设等待阈值的拓扑结构,作为与该待匹配节点服务器中的该数量的空闲资源对应的预设拓扑结构。For any number of idle resources, the topology structure whose communication waiting time is shorter than the preset waiting threshold is taken as the preset topology structure corresponding to the number of idle resources in the node server to be matched.
  17. 根据权利要求1所述的方法,其特征在于,所述根据所述任务信息,确定所述任务的任务类型,包括:The method according to claim 1, wherein the determining the task type of the task according to the task information comprises:
    获取节点服务器上的空闲资源;Obtain idle resources on the node server;
    根据所述任务信息,确定所述任务的资源需求量、所述任务的通讯量需求信息;According to the task information, determine the resource requirement of the task and the traffic requirement information of the task;
    基于所述节点服务器上的空闲资源、所述任务的资源需求量、所述任务的通讯量需求信息,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;Determine a target node server for executing the task and target resources on the target node server based on idle resources on the node server, resource requirements of the task, and traffic demand information of the task;
    基于执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源,确定所述任务的任务类型。The task type of the task is determined based on the target node server executing the task and the target resource on the target node server.
  18. 根据权利要求1至17任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 17, further comprising:
    在获取的待处理的任务包括多个的情况下,基于每一个所述任务的任务类型,确定每个任务的资源分配优先级;When the obtained tasks to be processed include multiple tasks, based on the task type of each task, determine the resource allocation priority of each task;
    基于每一个所述任务的资源分配优先级,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源。Based on the resource allocation priority of each task, a target node server for executing the task and target resources on the target node server are determined.
  19. 根据权利要求18所述的方法,其特征在于,所述任务类型包括单节点多资源通讯类型、单节点多资源计算类型、多节点类型、单资源类型;The method according to claim 18, wherein the task type includes a single-node multi-resource communication type, a single-node multi-resource computing type, a multi-node type, and a single-resource type;
    所述基于每一个所述任务的任务类型,确定每个任务的资源分配优先级,包括:The determining 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 the second priority;
    将所述多节点类型的任务的资源分配优先级设置为第三优先级;Setting the resource allocation priority of the task of the multi-node type to the third priority;
    将所述单资源类型的任务的资源分配优先级设置为第四优先级。Setting the resource allocation priority of the single-resource type task to the fourth priority.
  20. 根据权利要求2或17所述的方法,其特征在于,所述任务信息包括所述资源需求量,所述方法还包括获取所述资源需求量的步骤:The method according to claim 2 or 17, wherein the task information includes the resource requirement, and the method further includes the step of obtaining the resource requirement:
    获取所述待处理的任务的配置文件;Obtain the configuration file of the task to be processed;
    从所述配置文件中获取所述待处理的任务的资源需求量。Obtain the resource requirement of the task to be processed from the configuration file.
  21. 根据权利要求2或17所述的方法,其特征在于,所述任务信息包括所述通讯量需求信息,所述方法还包括获取所述通讯量需求信息的步骤:The method according to claim 2 or 17, wherein the task information includes the traffic demand information, and the method further includes the step of obtaining the traffic demand information:
    获取所述待处理的任务的计算量信息和通信量信息;Acquiring calculation amount information and communication amount information of the task to be processed;
    基于所述计算量信息和通信量信息,确定所述通讯量需求信息。Based on the calculation amount information and communication amount information, the communication amount requirement information is determined.
  22. 根据权利要求21所述的方法,其特征在于,所述获取所述待处理的任务的计算量信息和通信量信息,包括:The method according to claim 21, wherein said obtaining the calculation amount information and communication amount information of the task to be processed comprises:
    基于获取的所述待处理的任务的配置文件或获取的所述待处理的任务请求,确定所述待处理的任务的计算量信息和通信量信息;其中,所述任务请求中包括所述计算量信息和通信量信息。Based on the obtained configuration file of the task to be processed or the obtained task request to be processed, determine the calculation amount information and communication amount information of the task to be processed; wherein, the task request includes the calculation volume information and traffic information.
  23. 根据权利要求2或17所述的方法,其特征在于,所述任务信息包括所述通讯量需求信息,所述方法还包括获取所述通讯量需求信息的步骤:The method according to claim 2 or 17, wherein the task information includes the traffic demand information, and the method further includes the step of obtaining the traffic demand information:
    获取所述待处理的任务的配置文件;Obtain the configuration file of the task to be processed;
    从所述配置文件中获取所述待处理的任务的通讯量需求信息。Acquiring traffic demand information of the task to be processed from the configuration file.
  24. 根据权利要求2所述的方法,其特征在于,所述基于确定的所述资源需求量、任务的通讯量需求信息、所述节点服务器中的资源数量,确定所述任务的任务类型,包括:The method according to claim 2, wherein determining the task type of the task based on the determined resource demand, task traffic demand information, and resource quantity in the node server includes:
    基于所述资源需求量和所述节点服务器中的资源数量,确定所述待处理的任务对应的目标节点服务器的数量;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;
    基于所述待处理的任务对应的目标节点服务器的数量和所述通讯量需求信息,确定所述待处理的任务的任务类型。The task type of the task to be processed is determined based on the number of target node servers corresponding to the task to be processed and the traffic demand information.
  25. 根据权利要求24所述的方法,其特征在于,所述任务类型包括单节点多资源通讯类型、单节点多资源计算类型、多节点类型、单资源类型;The method according to claim 24, wherein the task type includes a single-node multi-resource communication type, a single-node multi-resource computing type, a multi-node type, and a 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 traffic demand information includes:
    在所述待处理的任务对应的目标节点服务器的数量等于1、所述待处理的任务对应的目标资源的数量大于1、并且所述通讯量需求信息指示所述待处理的任务的通信量需求高于计算量需求的情况下,确定所述待处理的任务的任务类型为单节点多资源通讯类型;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 traffic demand information indicates the traffic demand of the task to be processed When the amount of calculation is higher than the demand, it is determined that the task type of the task to be processed is a single-node multi-resource communication type;
    在所述待处理的任务对应的目标节点服务器的数量等于1、所述待处理的任务对应的目标资源的数量大于1、并且所述通讯量需求信息指示所述待处理的任务的计算量需求高于通信量需求的情况下,确定所述待处理的任务的任务类型为单节点多资源计算类型;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 traffic demand information indicates the calculation capacity demand of the task to be processed If it is higher than the communication traffic requirement, it is determined that the task type of the task to be processed is a single-node multi-resource computing type;
    在所述待处理的任务对应的目标节点服务器的数量大于1的情况下,确定所述待处理的任务的任务类型为多节点类型;When the number of target node servers corresponding to the task to be processed is greater than 1, determine that the task type of the task to be processed is a multi-node type;
    在所述待处理的任务对应的目标资源的数量等于1的情况下,确定所述待处理的任务的任务类型为单资源类型。In a case where 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 it is applied to a client, comprising:
    确定待处理的任务的任务类型;Determine the task type of the pending task;
    基于所述任务的任务类型,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;Based on the task type of the task, determine a target node server for executing the task and target resources on the target node server;
    将所述目标节点服务器的信息以及所述目标资源的信息发送给调度器,以使所述调度器将所述目标节点服务器以及所述目标资源分配给所述待处理的任务。Sending the information of the target node server and the information of the target resource to a scheduler, so that the scheduler allocates the target node server and the target resource to the task to be processed.
  27. 根据权利要求26所述的任务调度方法,其特征在于,所述确定待处理的任务的任务类型,包括:The task scheduling method according to claim 26, wherein said determining the task type of the task to be processed comprises:
    确定所述任务的资源需求量、所述任务的通讯量需求信息以及所述节点服务器中的资源数量;determining the resource requirement of the task, the traffic requirement information of the task, and the resource quantity in the node server;
    基于确定的所述资源需求量、任务的通讯量需求信息、所述节点服务器中的资源数量,确定所述任务的任务类型。The task type of the task is determined based on the determined resource demand, communication traffic demand information of the task, and resource quantity in the node server.
  28. 根据权利要求26所述的任务调度方法,其特征在于,所述确定待处理的任务的任务类型,包括:The task scheduling method according to claim 26, wherein said determining the task type of the task to be processed comprises:
    获取节点服务器上的空闲资源;Obtain idle resources on the node server;
    基于所述节点服务器上的空闲资源、所述任务的资源需求量、所述任务的通讯量需求信息,确定执行所述任务的至少一个目标节点服务器以及所述目标节点服务器上的目标资源;Determine at least one target node server for executing the task and target resources on the target node server based on idle resources on the node server, resource requirements of the task, and traffic demand information of the task;
    基于所述至少一个目标节点服务器以及所述目标节点服务器上的目标资源,确定所述任务的任务类型。A task type of the task is determined based on the at least one target node server and target resources on the target node server.
  29. 一种任务调度装置,其特征在于,包括:A task scheduling device, characterized in that it comprises:
    获取模块,用于获取待处理的任务的任务信息;An acquisition module, configured to acquire task information of tasks to be processed;
    第一确定模块,用于基于所述任务信息,确定所述任务的任务类型;A first determining module, configured to determine the task type of the task based on the task information;
    第二确定模块,用于基于所述任务类型,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;A second determining module, configured to determine a target node server for executing the task and target resources on the target node server based on the task type;
    分配模块,用于将所述目标节点服务器以及所述目标节点服务器上的目标资源分配用于执行所述任务。An allocating module, configured to allocate the target node server and target resources on the target node server to execute the task.
  30. 一种任务调度装置,其特征在于,应用于客户端,包括:A task scheduling device, characterized in that it is applied to a client, comprising:
    第三确定模块,用于确定待处理的任务的任务类型;The third determining module is used to determine the task type of the task to be processed;
    第四确定模块,用于基于所述任务的任务类型,确定执行所述任务的目标节点服务器以及所述目标节点服务器上的目标资源;A fourth determining module, configured 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;
    发送模块,用于将所述目标节点服务器的信息以及所述目标资源的信息发送给调度器,以使所述调度器将所述目标节点服务器以及所述目标资源分配给所述待处理的任务。A sending module, configured to send the information of the target node server and the information of the target resource to a scheduler, so that the scheduler allocates the target node server and the target resource to the task to be processed .
  31. 一种计算机设备,其特征在于,包括:处理器、存储器,所述存储器存储有所述处理器可执行的机器可读指令,所述处理器用于执行所述存储器中存储的机器可读指令,所述机器可读指令被所述处理器执行时,所述处理器执行如权利要求1至25任意一项所述的任务调度方法的步骤,或者,所述处理器执行如权利要求26至28任意一项所述的任务调度方法的步骤。A computer device, characterized by comprising: a processor and a memory, the memory stores machine-readable instructions executable by the processor, and the processor is configured 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 according to any one of claims 1 to 25, or, the processor executes the steps of the task scheduling method according to claims 26 to 28. The steps of any one of the task scheduling methods.
  32. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被计算机设备运行时,所述计算机设备执行如权利要求1至25任意一项所述的任务调度方法的步骤,或者,所述计算机设备执行如权利要求26至28任意一项所述的任务调度方法的步骤。A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is run by a computer device, the computer device executes the computer program described in any one of claims 1 to 25. or, the computer device executes the steps of the task scheduling method according to any one of claims 26 to 28.
  33. 一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行用于实现权利要求1至25任意一项所述的任务调度方法的步骤,或者,执行如权利要求26至28任意一项所述的任务调度方法的步骤。A computer program product, comprising computer readable codes, or a non-volatile computer readable storage medium bearing computer readable codes, when the computer readable codes are run in a processor of an electronic device, the electronic The processor in the device executes the steps for realizing the task scheduling method described in any one of claims 1 to 25, or executes the steps of the task scheduling method described in any one of claims 26 to 28.
PCT/CN2021/124136 2021-05-27 2021-10-15 Task scheduling method and apparatus, computer device and storage medium WO2022247105A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110586526.2A CN113238848A (en) 2021-05-27 2021-05-27 Task scheduling method and device, computer equipment and storage medium
CN202110586526.2 2021-05-27

Publications (1)

Publication Number Publication Date
WO2022247105A1 true WO2022247105A1 (en) 2022-12-01

Family

ID=77139282

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/124136 WO2022247105A1 (en) 2021-05-27 2021-10-15 Task scheduling method and apparatus, computer device and storage medium

Country Status (3)

Country Link
CN (1) CN113238848A (en)
TW (1) TW202246977A (en)
WO (1) WO2022247105A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117151433A (en) * 2023-10-30 2023-12-01 浙江大学高端装备研究院 Cloud-based intelligent manufacturing service supply and demand matching evaluation method and device

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113238848A (en) * 2021-05-27 2021-08-10 上海商汤科技开发有限公司 Task scheduling method and device, computer equipment and storage medium
CN113742068A (en) * 2021-08-27 2021-12-03 深圳市商汤科技有限公司 Task scheduling method, device, equipment, storage medium and computer program product
CN113590301A (en) * 2021-09-30 2021-11-02 苏州浪潮智能科技有限公司 Task scheduling method and related device for deep learning service
CN114138500B (en) * 2022-01-29 2022-07-08 阿里云计算有限公司 Resource scheduling system and method
CN116302404B (en) * 2023-02-16 2023-10-03 北京大学 Resource decoupling data center-oriented server non-perception calculation scheduling method
CN116756282A (en) * 2023-06-16 2023-09-15 北京百度网讯科技有限公司 Task processing method, server, language prediction system and man-machine interaction system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109254842A (en) * 2017-07-12 2019-01-22 腾讯科技(深圳)有限公司 Method for managing resource, device and the readable storage medium storing program for executing of distributive type system
US20200104170A1 (en) * 2018-09-28 2020-04-02 Atlassian Pty Ltd Systems and methods for scheduling tasks
CN111190712A (en) * 2019-12-25 2020-05-22 北京推想科技有限公司 Task scheduling method, device, equipment and medium
CN111190739A (en) * 2019-12-31 2020-05-22 西安翔腾微电子科技有限公司 Resource allocation method and device, electronic equipment and storage medium
CN111694649A (en) * 2020-06-12 2020-09-22 北京字节跳动网络技术有限公司 Resource scheduling method and device, computer equipment and storage medium
CN112486648A (en) * 2020-11-30 2021-03-12 北京百度网讯科技有限公司 Task scheduling method, device, system, electronic equipment and storage medium
CN113238848A (en) * 2021-05-27 2021-08-10 上海商汤科技开发有限公司 Task scheduling method and device, computer equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148468B (en) * 2019-06-28 2023-10-10 杭州海康威视数字技术股份有限公司 Resource scheduling method and device, electronic equipment and storage medium
CN112667376A (en) * 2020-12-23 2021-04-16 数字广东网络建设有限公司 Task scheduling processing method and device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109254842A (en) * 2017-07-12 2019-01-22 腾讯科技(深圳)有限公司 Method for managing resource, device and the readable storage medium storing program for executing of distributive type system
US20200104170A1 (en) * 2018-09-28 2020-04-02 Atlassian Pty Ltd Systems and methods for scheduling tasks
CN111190712A (en) * 2019-12-25 2020-05-22 北京推想科技有限公司 Task scheduling method, device, equipment and medium
CN111190739A (en) * 2019-12-31 2020-05-22 西安翔腾微电子科技有限公司 Resource allocation method and device, electronic equipment and storage medium
CN111694649A (en) * 2020-06-12 2020-09-22 北京字节跳动网络技术有限公司 Resource scheduling method and device, computer equipment and storage medium
CN112486648A (en) * 2020-11-30 2021-03-12 北京百度网讯科技有限公司 Task scheduling method, device, system, electronic equipment and storage medium
CN113238848A (en) * 2021-05-27 2021-08-10 上海商汤科技开发有限公司 Task scheduling method and device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117151433A (en) * 2023-10-30 2023-12-01 浙江大学高端装备研究院 Cloud-based intelligent manufacturing service supply and demand matching evaluation method and device
CN117151433B (en) * 2023-10-30 2024-01-30 浙江大学高端装备研究院 Cloud-based intelligent manufacturing service supply and demand matching evaluation method and device

Also Published As

Publication number Publication date
CN113238848A (en) 2021-08-10
TW202246977A (en) 2022-12-01

Similar Documents

Publication Publication Date Title
WO2022247105A1 (en) Task scheduling method and apparatus, computer device and storage medium
US8893148B2 (en) Performing setup operations for receiving different amounts of data while processors are performing message passing interface tasks
WO2020001320A1 (en) Resource allocation method, device, and apparatus
RU2571366C2 (en) Virtual non-uniform memory access architecture for virtual machines
US8312464B2 (en) Hardware based dynamic load balancing of message passing interface tasks by modifying tasks
US8127300B2 (en) Hardware based dynamic load balancing of message passing interface tasks
US8108876B2 (en) Modifying an operation of one or more processors executing message passing interface tasks
CA2697155C (en) Allocating network adapter resources among logical partitions
US9563474B2 (en) Methods for managing threads within an application and devices thereof
WO2016078008A1 (en) Method and apparatus for scheduling data flow task
CN109564528B (en) System and method for computing resource allocation in distributed computing
US8516487B2 (en) Dynamic job relocation in a high performance computing system
US10897428B2 (en) Method, server system and computer program product for managing resources
KR20130119285A (en) Apparatus and method for resources allocation in a clustered computing environment
US20090064166A1 (en) System and Method for Hardware Based Dynamic Load Balancing of Message Passing Interface Tasks
CN112783659B (en) Resource allocation method and device, computer equipment and storage medium
WO2017185285A1 (en) Method and device for assigning graphics processing unit task
WO2016145904A1 (en) Resource management method, device and system
US11995016B2 (en) Input/output command rebalancing in a virtualized computer system
US10579416B2 (en) Thread interrupt offload re-prioritization
CN112181613A (en) Heterogeneous resource distributed computing platform batch task scheduling method and storage medium
CN114968567A (en) Method, apparatus and medium for allocating computing resources of a compute node
CN114721818A (en) Kubernetes cluster-based GPU time-sharing method and system
JP2006195985A (en) Method for controlling resource utilization rate and computer system
WO2024001851A1 (en) Resource scheduling method, apparatus and system

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2022532575

Country of ref document: JP

Kind code of ref document: A

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21942670

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21942670

Country of ref document: EP

Kind code of ref document: A1