WO2021128737A1 - 资源调度方法及装置、电子设备和存储介质 - Google Patents

资源调度方法及装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2021128737A1
WO2021128737A1 PCT/CN2020/094181 CN2020094181W WO2021128737A1 WO 2021128737 A1 WO2021128737 A1 WO 2021128737A1 CN 2020094181 W CN2020094181 W CN 2020094181W WO 2021128737 A1 WO2021128737 A1 WO 2021128737A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
task
node
score
scheduling
Prior art date
Application number
PCT/CN2020/094181
Other languages
English (en)
French (fr)
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 上海商汤智能科技有限公司
Priority to JP2021538194A priority Critical patent/JP2022518127A/ja
Priority to KR1020217020244A priority patent/KR20210094639A/ko
Publication of WO2021128737A1 publication Critical patent/WO2021128737A1/zh

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
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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
    • 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]
    • 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/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • 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
    • G06F9/5072Grid computing
    • 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
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources

Definitions

  • the present disclosure proposes a resource scheduling method and device, electronic equipment and storage medium.
  • the method further includes: determining the second scheduling of each resource node according to the task type allocated by each resource node in the plurality of resource nodes and the type of the target task Score; the determining, at least in part, the target resource node for processing the target task among the plurality of resource nodes according to the first scheduling score of each resource node in the plurality of resource nodes includes: Determine the total scheduling score of each resource node based on the first scheduling score and the second scheduling score of each resource node; based on the total scheduling score of each resource node in the plurality of resource nodes , Determine the target resource node.
  • the second scheduling score of the first node is higher than the second scheduling score of the second node, where the first node is the task type allocated in the multiple resource nodes and the Nodes with the same target task type, and the second node is a node whose assigned task type is different from the target task type among the multiple resource nodes.
  • a resource scheduling device including: a first determining module for determining, at least in part, based on the resource demand of the target task and the first resource of each resource node in the plurality of resource nodes. The remaining amount of current resources and the total amount of available resources of the second resource are used to determine the first scheduling score of each resource node for the target task, where the first resource includes deep learning resources, and the second resource includes Universal resource; a second determining module, configured to determine, at least in part, the resource node for processing the target task in the plurality of resource nodes based on the first scheduling score of each resource node in the plurality of resource nodes The target resource node.
  • Fig. 1 shows a flowchart of a resource scheduling method according to an embodiment of the present disclosure.
  • Fig. 3 shows an application schematic diagram of a resource scheduling method according to an embodiment of the present disclosure.
  • Fig. 4 shows a block diagram of a resource scheduling device according to an embodiment of the present disclosure.
  • Fig. 1 shows a flowchart of a resource scheduling method according to an embodiment of the present disclosure. As shown in Fig. 1, the method includes the following steps.
  • the current remaining amount of resources of the first resource and the total amount of available resources of the second resource can be comprehensively considered when scheduling resources to determine the first scheduling score, which is beneficial to reduce resource fragments and improve resources. Utilization rate.
  • the resource scheduling method may be executed by a terminal device or other processing device, where the terminal device may be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, Cordless phones, personal digital assistants (PDAs), handheld devices, computing devices, in-vehicle devices, wearable devices, etc.
  • UE User Equipment
  • PDA personal digital assistant
  • Other processing equipment can be desktops, servers, or cloud servers.
  • the resource scheduling method may be implemented by a processor invoking computer-readable instructions stored in a memory.
  • the resource scheduling method can be used in a server to schedule resources for tasks to be processed when a task processing request is received, and use the resources to process tasks.
  • the server may include multiple resource nodes, each resource node may be used to process the task, and the resource node may include a first resource and a second resource.
  • the first resource may be a deep learning resource (for example, GPU resource, TPU (Tensor Processing Unit) resource, FPGA (Field Programmable Gate Array), etc.)
  • the second resource may be a general resource (for example, CPU ( Central Processing Unit) resources and/or memory resources).
  • CPU Central Processing Unit
  • the resource node includes all resources of the physical machine.
  • the resource node when the resource node is a virtual machine, through specific software and/or hardware CPU virtualization technology, one or more virtual CPUs of the virtual machine can reuse the physical CPU, and for the GPU, the related equipment of the physical GPU can be used. The information is directly passed through to the virtual machine for use by the virtual machine.
  • one or more virtual GPUs of the virtual machine when the resource node is a virtual machine, one or more virtual GPUs of the virtual machine can be multiplexed with physical GPUs through GPU virtualization technology, and the embodiments of the present disclosure are not limited thereto.
  • Each task unit requests 1 GPU resource
  • task T2 contains one task unit and requests 7 GPU resources.
  • task T1 can be arranged before task T2, and processing resources for task T1 can be scheduled first.
  • the two task units of task T1 may be assigned to the same resource node (for example, resource node A) for processing.
  • the resource node has 6 GPU resources left at this time, which is not enough to process the task unit of task T2. Therefore, the task unit of task T2
  • the task unit can be allocated to another resource node (for example, resource node B) for processing.
  • resource node B will have 1 free GPU resource left.
  • the fragmented GPU resource ie , 1 free GPU resource of resource node B
  • 1 free GPU resource may refer to 1 free GPU.
  • sorting the multiple tasks to obtain the first task queue includes: The priority of each task in the multiple tasks determines the initial ranking of the multiple tasks; in the case that at least two tasks have the same priority in the initial ranking, according to the respective average resource requirements of the at least two tasks Quantity, determine the target ranking of the at least two tasks.
  • the at least two tasks with the same priority may be ranked according to the average resource demand of the task unit to determine the at least two tasks For example, tasks with higher average resource requirements of task units can be ranked before tasks with lower average resource requirements of task units.
  • resource node A and resource node B each have 8 free GPU resources, existing tasks T1 and task T2, where tasks T1 and T2 have the same priority, T1 includes two task units, and each task unit requests 1 GPU resource, the average resource requirement of task unit of task T1 is 1 GPU resource, and task T2 contains one task unit and requests 7 GPU resources, then the average resource requirement of task unit of task T2 is 7 GPU resources , Task T2 can be arranged before task T1, and priority is given to scheduling processing resources for task T2.
  • a task unit of task T2 can be allocated to resource node A for processing, and the resource node has 1 GPU resource left at this time, and then a task unit of task T1 can be allocated to resource node A for processing, and task T2 can be allocated Another task unit of is assigned to another resource node (for example, resource node B) for processing.
  • resource node A has no remaining GPU resources, and no fragmented GPU resources are generated, which improves resource utilization and reduces resource waste.
  • sorting the multiple tasks to obtain the first task queue includes: Based at least in part on the priority of each of the multiple tasks, the average resource requirements of the multiple task units included in each of the multiple tasks, and the creation timestamp of each of the multiple tasks, for multiple tasks Sort to get the first task queue.
  • the initial ranking there may be at least two tasks with the same priority and the same average resource requirement of the task unit. For example, there are two tasks with high priority, three tasks with medium priority, five tasks with low priority, etc. Among them, two tasks with high priority (for example, task T3 and task T4) )
  • the average resource requirement of the task unit is also the same.
  • the order of the two tasks can be determined by the creation time of the two tasks. For example, if the creation time of task T3 is earlier than task T4, task T3 can be ranked before task T4 according to the respective timestamps of task T3 and task T4.
  • the target task may be scheduled based on the order of the target task in the first task queue. For example, after the task processing before the target task is completed, resource nodes may be scheduled for the target task to process the target task.
  • the average resource demand of task units is introduced into the sorting basis to make full use of processing resources, improve resource utilization, and reduce resource waste.
  • the processing resources can be scheduled to sequentially process the tasks in the first task queue.
  • resource nodes can be scheduled to process current tasks, such as target tasks.
  • the score of each resource node can be calculated, and the resource node with the highest score can be used to process the target task.
  • the score of each resource node can be calculated according to the resource demand of the task unit and the total resource of each resource node. For example, the ratio between the resource demand of the task unit and the total resource of each resource node can be calculated. To determine the score of each resource node. This calculation method can make the resource node with the smaller total resource score higher, that is, the resource node with the smaller total resource is prioritized to process the task units of the target task, so that the resource node with the larger total resource It is used in other follow-up tasks.
  • the server includes 8 nodes, and each node includes 8 GPU resources.
  • the target task has 8 task units, and the resource demand of each task unit is a GPU resource.
  • the score of each node is equal, and it is possible to evenly distribute 8 task units to 8 resource nodes, and each resource node occupies 1 GPU. If the resource demand of a task unit in the subsequent task is 8 GPUs, each resource node cannot process the task, and can only process the task after the task unit processing of the target task is completed, resulting in the task waiting time Too long.
  • the target task can be based on the first resource demand and the second resource demand of the target task, the current remaining amount of the first resource of each resource node in the multiple resource nodes, and the availability of the second resource.
  • the total amount of resources is used to determine the first scheduling score of each resource node for the target task. That is, the remaining amount of the first resource and the total amount of available resources of the second resource are comprehensively considered to determine the first scheduling score of each resource node.
  • step S11 may include: obtaining a first score according to the first resource demand of the target task and the current resource remaining amount of the first resource; and according to the second resource requirement of the target task A second score is determined based on the resource demand and the total amount of available resources of the second resource; and the first scheduling score is obtained based on the first score and the second score.
  • the first score of each resource node can be obtained according to the first resource demand of the target task and the current resource remaining amount of the first resource.
  • the first score of each resource node can be obtained.
  • the second score of each resource node may be determined according to the second resource demand of the target task and the total amount of available resources of the second resource. For example, the second score of each resource node may be passed. 2. The ratio of the resource demand to the total amount of available resources of the second resource of each resource node to obtain the second score of each resource node. If the resource node has multiple second resources (such as CPU and memory), the average value of the ratios of the various second resource requirements and the total amount of available resources of the various second resources can be used to determine the second resource of each resource node. Two scores.
  • a first weight value ⁇ may be set, 0 ⁇ 1, for example, ⁇ may be 1, 0.9, 0.6, 0.5, 0.3, 0, etc. ⁇ can be preset by the administrator.
  • the first scheduling score may be obtained based on the weighted summation of the first score and the second score, for example, the first scheduling score is determined according to the following formula (1):
  • S i is the first scheduling score of the i-th resource node (i is a positive integer)
  • re 1 is the first resource demand
  • id 1i is the first resource remaining amount of the i-th resource node
  • re CPU is the right
  • al CPUi is the total amount of available CPU resources of the i-th resource node
  • re mem is the memory demand
  • al memi is the total amount of available memory of the i-th resource node
  • PW is the weight of the target task, That is the second weight.
  • the first weight ⁇ is an adjustable parameter, which can be set according to actual needs, and its value can be fixed or dynamically variable in a specific application scenario.
  • the first weight ⁇ may be determined according to the type of the task. For example, for a neural network training task, the first weight ⁇ may take a larger value. For tasks that do not require GPU resources, the first weight can be a smaller value. The present disclosure does not limit the value of the first weight ⁇ .
  • the first scheduling score may be obtained based on the weighted average or arithmetic average of the first score and the second score, etc.
  • the embodiment of the present disclosure does not limit the specific implementation of the first scheduling score.
  • the resource node may be scheduled for the target task according to the first scheduling score.
  • the server includes 8 resource nodes, and each resource node includes 8 GPU resources.
  • the target task has 8 task units, and the resource demand of each task unit is a GPU resource. Since the ratio of the first resource demand to the first resource remaining amount is considered when calculating the first scheduling score, after the first task unit is allocated to a certain resource node, the first resource remaining amount of the resource node is reduced , So that the first scheduling score of the resource node is increased, and subsequent task units can be assigned to the resource node preferentially, which is conducive to all task units being allocated to the same resource node as much as possible, reducing the number of task units being allocated. In a resource node, multiple resource nodes are occupied.
  • the remaining amount of the first resource and the total amount of available resources of the second resource can be comprehensively considered to determine the first scheduling score of each resource node, and each task unit of the target task can be allocated to the same resource node for processing as much as possible , Reduce fragmented resources, improve resource utilization efficiency, and reduce waiting time for subsequent tasks.
  • the first scheduling scores of at least two resource nodes are the same.
  • tasks can be allocated to resource nodes that have processed tasks of the same type for processing, so as to reduce fragmented resources.
  • multiple scheduling strategies may be used to determine the scheduling score of a resource node, and then the scheduling scores corresponding to the multiple scheduling strategies of the resource node are comprehensively considered to obtain the total scheduling score of the resource node, and based on the total scheduling score The scheduling score determines the target node.
  • the method further includes: determining the second scheduling of each resource node according to the task type allocated by each resource node in the plurality of resource nodes and the type of the target task fraction.
  • the total scheduling score of the resource node is obtained based on the first scheduling score and the second scheduling score of the resource node. For example, based on the weighted sum of the first scheduling score and the second scheduling score, the total scheduling score is obtained, or based on the weighted average of the first scheduling score and the second scheduling score, the total scheduling score is obtained, etc., but the present disclosure The embodiment does not limit this.
  • the task units of the target task can be concentrated in resource nodes that are processing tasks of the same type as the target task. For example, if the target task is a deep learning task, if there are two resource nodes with the first scheduling score In the same way, the task unit of the target task can be assigned to the resource node that is processing the deep learning task.
  • the target type of the target task may be determined according to the resource type required by the target task, and in the at least two resource nodes, the type of the task being processed is the The resource node of the target type is determined as the target node.
  • the target task is a deep learning type task
  • the deep learning type task mainly requires GPU resources.
  • the target task and the type of the task being processed in each resource node can be determined according to the resource type required by the task. For example, if the task being processed in resource node A occupies 2 GPU resources and resource node B is idle, it can be considered that the task being processed in resource node A is of the same type as the target task. Or, the task being processed in resource node A occupies 2 GPU resources, and the task being executed in resource node B occupies CPU resources, but not GPU resources, it can be considered that the task being processed in resource node A is the target task Same type.
  • the second scheduling score of the first node is higher than the second scheduling score of the second node, wherein the first node is a node in the plurality of resource nodes whose assigned task type is the same as the target task type, so The second node is a node in which the assigned task type among the multiple resource nodes is different from the target task type. That is, the resource node A can obtain a higher second scheduling score.
  • step S12 may include: determining the total scheduling score of each resource node based on the first scheduling score of each resource node and the second scheduling score; based on the multiple resources The total scheduling score of each resource node in the node determines the target resource node.
  • the second scheduling score may also have a second weight for its own calculation strategy, and the first scheduling score and the second scheduling score may be weighted and summed to obtain the total scheduling score, and the resource node may be selected according to the total scheduling score.
  • the scores obtained by each calculation strategy can be weighted and summed to obtain the total scheduling score, for example, based on the first
  • the scheduling score and the second scheduling score obtain a third scheduling score, and based on the third scheduling score and at least one fourth scheduling score obtained based on at least one other calculation strategy, a total scheduling score is obtained.
  • the resource node with the highest total scheduling score can be used to process the target task, that is, as the target resource node.
  • the present disclosure does not limit the calculation strategy.
  • Fig. 2 shows a schematic diagram of selecting a target node according to an embodiment of the present disclosure.
  • both task 1 and task 2 are deep learning tasks, and the resource requirements are both a GPU resource.
  • Resource node A includes 6 GPU resources, and resource node B includes 3 GPU resources, but the task being executed in resource node A has occupied 3 GPU resources.
  • the first scheduling score of the resource node A may be the same as the first scheduling score of the resource node B.
  • the task being processed in the resource node A occupies 3 GPU resources. It can be considered that the task being processed in the resource node A is of the same type as the task 1, and the resource node A can obtain a higher second scheduling score. After being added to the first scheduling score, the total scheduling score of resource node A is higher, so that resource node A can be scheduled to process task 1. Further, the remaining amount of resources of resource node A is 2 GPU resources, and the remaining amount of resources is less than that of resource node B. Therefore, resource node A can still be scheduled to process task 2.
  • the task 1 and task 2 are concentrated in the resource node A for processing, so as to avoid the resource nodes occupied by the target task from being too scattered, occupying too many resource nodes, generating fragmented resources, and causing resource waste.
  • the average resource demand of task units can be used as a sorting basis to make full use of processing resources, improve resource utilization, and reduce resource waste. It can also comprehensively consider the remaining amount of the first resource and the total amount of available resources of the second resource to determine the first scheduling score of each resource node.
  • Each task unit of the target task can be allocated to the same resource node for processing as much as possible to reduce fragmented resources , Improve resource utilization efficiency and reduce the waiting time of subsequent tasks.
  • the tasks can be concentrated in the same resource node for processing, so as to avoid occupying too many resource nodes, generating fragmented resources, and causing resources. waste.
  • FIG. 3 shows an application schematic diagram of a resource scheduling method according to an embodiment of the present disclosure.
  • the task queue of the server there may be multiple tasks (for example, M, M is a positive integer), which may be a task queue
  • multiple calculation strategies may be used to calculate the first scheduling score of each resource node.
  • formula (1) may be used first to calculate the first scheduling score of each resource node (for example, a total of N resource nodes, N is a positive integer) in each calculation strategy.
  • tasks can be allocated to resource nodes that have processed tasks of the same type for processing according to the second scheduling score, so as to reduce fragmented resources .
  • other computing strategies can be adopted. For example, if task i is a deep learning type task, the requested resource is a GPU resource. The task being processed in the resource node A occupies 2 GPU resources, and the resource node B is idle. It can be considered that the task being processed in the resource node A is of the same type as the target task, and the resource node A can obtain a higher second scheduling score.
  • the respective second scheduling scores will be added to obtain their respective total scheduling scores, and the total scheduling scores obtained by resource node A may be higher. Use resource node A to process the target task. That is, the tasks are concentrated in the same resource node as much as possible to reduce fragmented resources.
  • multiple calculation strategies may also be used, for example, K calculation strategies, and a weighted sum of the scheduling scores obtained by each calculation strategy can be used to obtain the total scheduling score of each resource node. And the resource node with the highest total scheduling score can be determined as the target resource node (for example, resource node j, j are integers, and j ⁇ N).
  • the resource scheduling method of the present disclosure can be used in a server, and each resource node can be scheduled to process various tasks in the server.
  • each resource node can be scheduled to process various tasks in the server.
  • it can be used in a server of an artificial intelligence teaching platform, and can be used to schedule resource nodes to handle various artificial intelligence teaching tasks or experimental tasks.
  • it can be used in the server of a monitoring system and can be used to schedule various resource nodes to process tasks such as face recognition or face clustering.
  • the present disclosure does not limit the application scenarios of the scheduling method.
  • the present disclosure also provides resource scheduling devices, electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any resource scheduling method provided in the present disclosure.
  • resource scheduling devices electronic equipment, computer-readable storage media, and programs, all of which can be used to implement any resource scheduling method provided in the present disclosure.
  • the writing order of the steps does not mean a strict execution order but constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possibility.
  • the inner logic is determined.
  • FIG. 4 shows a block diagram of a resource scheduling device according to an embodiment of the present disclosure. As shown in FIG. 4, the device includes: a first determining module 41 and a second determining module 42.
  • the first determining module 41 is configured to determine the amount of resources available at least partially based on the resource demand of the target task, the current remaining amount of the first resource of each resource node in the plurality of resource nodes, and the total amount of available resources of the second resource.
  • the second determining module 42 is configured to determine a target resource for processing the target task among the plurality of resource nodes based at least in part on the first scheduling score of each resource node in the plurality of resource nodes node.
  • the resource demand of the target task includes a first resource demand and a second resource demand; the first determining module is further configured to: according to the first resource demand of the target task And the current remaining amount of resources of the first resource to obtain a first score; according to the second resource demand of the target task and the total amount of available resources of the second resource, a second score is determined; A weighted sum is performed on a score and the second score to obtain the first scheduling score.
  • the device further includes: a third determining module, configured to determine the type of each target task according to the task type allocated by each resource node of the plurality of resource nodes and the type of the target task.
  • the second scheduling score of each resource node; the second determining module is further configured to: determine the total scheduling score of each resource node based on the first scheduling score of each resource node and the second scheduling score; The total scheduling score of each resource node in the multiple resource nodes determines the target resource node.
  • the second scheduling score of the first node is higher than the second scheduling score of the second node, where the first node is the task type allocated in the multiple resource nodes and the Nodes with the same target task type, and the second node is a node whose assigned task type is different from the target task type among the multiple resource nodes.
  • the device further includes: a first obtaining module configured to, at least in part, according to the priority of each task in the multiple tasks and the multiple tasks included in each task in the multiple tasks.
  • the average resource demand of the task unit sort the multiple tasks to obtain a first task queue, wherein the multiple tasks include the target task;
  • the scheduling module is configured to be based on the target task in the first task queue;
  • a sort in the task queue to schedule the target task.
  • the first obtaining module is further configured to: determine the initial ranking of the multiple tasks according to the priority of each of the multiple tasks; In the case where the priorities of at least two tasks are the same, the target order of the at least two tasks is determined according to the respective average resource requirements of the at least two tasks.
  • the first obtaining module is further configured to: at least partially according to the priority of each task in the multiple tasks, and the multiple tasks included in each task in the multiple tasks The average resource demand of the unit and the creation timestamp of each task in the plurality of tasks are sorted to obtain the first task queue.
  • the functions or modules contained in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments.
  • the functions or modules contained in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments.
  • the embodiment of the present disclosure also proposes a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, they prompt the processor to implement the foregoing resource scheduling method.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium.
  • An embodiment of the present disclosure also provides an electronic device, including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to perform the above-mentioned resource scheduling method.
  • the electronic device can be provided as a terminal, server or other form of device.
  • Fig. 5 is a block diagram showing an electronic device 500 according to an exemplary embodiment.
  • the electronic device 500 may be a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and other terminals.
  • the electronic device 500 may include one or more of the following components: a processing component 502, a memory 504, a power supply component 506, a multimedia component 508, an audio component 510, an input/output (I/O) interface 512, and a sensor component 514 , And communication component 516.
  • the processing component 502 generally controls the overall operations of the electronic device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the foregoing method.
  • the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components.
  • the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.
  • the memory 504 is configured to store various types of data to support operations in the electronic device 500. Examples of these data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, videos, etc.
  • the memory 504 can be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable and Programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable and Programmable read only memory
  • PROM programmable read only memory
  • ROM read only memory
  • magnetic memory flash memory
  • flash memory magnetic or optical disk.
  • the power supply component 506 provides power for various components of the electronic device 500.
  • the power supply component 506 may include a power management system, one or more power supplies, and other components associated with the generation, management, and distribution of power for the electronic device 500.
  • the multimedia component 508 includes a screen that provides an output interface between the electronic device 500 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure related to the touch or slide operation.
  • the multimedia component 508 includes a front camera and/or a rear camera. When the electronic device 500 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
  • the audio component 510 is configured to output and/or input audio signals.
  • the audio component 510 includes a microphone (MIC), and when the electronic device 500 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal.
  • the received audio signal may be further stored in the memory 504 or transmitted via the communication component 516.
  • the audio component 510 further includes a speaker for outputting audio signals.
  • the I/O interface 512 provides an interface between the processing component 502 and a peripheral interface module.
  • the above-mentioned peripheral interface module may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: home button, volume button, start button, and lock button.
  • the sensor component 514 includes one or more sensors for providing the electronic device 500 with various aspects of state evaluation.
  • the sensor component 514 can detect the on/off status of the electronic device 500 and the relative positioning of the components.
  • the component is the display and the keypad of the electronic device 500.
  • the sensor component 514 can also detect the electronic device 500 or the electronic device 500.
  • the position of the component changes, the presence or absence of contact between the user and the electronic device 500, the orientation or acceleration/deceleration of the electronic device 500, and the temperature change of the electronic device 500.
  • the sensor component 514 may include a proximity sensor configured to detect the presence of nearby objects when there is no physical contact.
  • the sensor component 514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
  • the communication component 516 is configured to facilitate wired or wireless communication between the electronic device 500 and other devices.
  • the electronic device 500 can access a wireless network based on a communication standard, such as Wi-Fi, 2G, 3G, 4G, or 5G, or a combination thereof.
  • the communication component 516 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 516 further includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field-available A programmable gate array (FPGA), controller, microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • ASIC application-specific integrated circuits
  • DSP digital signal processors
  • DSPD digital signal processing devices
  • PLD programmable logic devices
  • FPGA field-available A programmable gate array
  • controller microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • a non-volatile computer-readable storage medium such as the memory 504 including computer program instructions, which can be executed by the processor 520 of the electronic device 500 to complete the foregoing method.
  • the embodiments of the present disclosure also provide a computer program product, including computer readable code, and when the computer readable code runs on the device, the processor in the device executes instructions for implementing the method provided in any of the above embodiments.
  • the computer program product can be specifically implemented by hardware, software, or a combination thereof.
  • the computer program product is specifically embodied as a computer storage medium.
  • the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc. Wait.
  • SDK software development kit
  • Fig. 6 is a block diagram showing an electronic device 600 according to an exemplary embodiment.
  • the electronic device 600 may be provided as a server.
  • the electronic device 600 includes a processing component 622, which further includes one or more processors, and a memory resource represented by a memory 632, for storing instructions that can be executed by the processing component 622, such as application programs.
  • the application program stored in the memory 632 may include one or more modules each corresponding to a set of instructions.
  • the processing component 622 is configured to execute instructions to implement the aforementioned resource scheduling method.
  • the electronic device 600 may also include a power supply component 626 configured to perform power management of the electronic device 600, a wired or wireless network interface 650 configured to connect the electronic device 600 to a network, and an input output (I/O) interface 658 .
  • the electronic device 600 can operate based on an operating system stored in the memory 632, such as Windows Server TM , Mac OS X TM , Unix TM , LinuxTM, FreeBSD TM or the like.
  • a non-volatile computer-readable storage medium is also provided, such as a memory 632 including computer program instructions, which can be executed by the processing component 622 of the electronic device 600 to complete the foregoing method.
  • the present disclosure may be a system, method and/or computer program product.
  • the computer program product may include a computer-readable storage medium loaded with computer-readable program instructions for enabling a processor to implement various aspects of the present disclosure.
  • the computer-readable storage medium may be a tangible device that can hold and store instructions used by the instruction execution device.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Non-exhaustive list of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a printer with instructions stored thereon
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory flash memory
  • SRAM static random access memory
  • CD-ROM compact disk read-only memory
  • DVD digital versatile disk
  • memory stick floppy disk
  • mechanical encoding device such as a printer with instructions stored thereon
  • the computer-readable storage medium used here is not interpreted as the instantaneous signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (for example, light pulses through fiber optic cables), or through wires Transmission of electrical signals.
  • the computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing/processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • the network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network, and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device .
  • the computer program instructions used to perform the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or in one or more programming languages.
  • Source code or object code written in any combination, the programming language includes object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages.
  • Computer-readable program instructions can be executed entirely on the user's computer, partly on the user's computer, executed as a stand-alone software package, partly on the user's computer and partly executed on a remote computer, or entirely on the remote computer or server carried out.
  • the remote computer can be connected to the user's computer through any kind of network-including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect to the user's computer) connection).
  • LAN local area network
  • WAN wide area network
  • an electronic circuit such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by using the status information of the computer-readable program instructions.
  • FPGA field programmable gate array
  • PDA programmable logic array
  • the computer-readable program instructions are executed to realize various aspects of the present disclosure.
  • These computer-readable program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine that makes these instructions when executed by the processor of the computer or other programmable data processing device , A device that implements the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams is produced. It is also possible to store these computer-readable program instructions in a computer-readable storage medium. These instructions make computers, programmable data processing apparatuses, and/or other devices work in a specific manner. Thus, the computer-readable medium storing the instructions includes An article of manufacture, which includes instructions for implementing various aspects of the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
  • each block in the flowchart or block diagram may represent a module, program segment, or part of an instruction, and the module, program segment, or part of an instruction contains one or more components for realizing the specified logical function.
  • Executable instructions may also occur in a different order from the order marked in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or actions Or it can be realized by a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本公开涉及一种资源调度方法及装置、电子设备和存储介质,所述方法包括:至少部分的根据目标任务的资源需求量、多个资源节点中每个资源节点的第一资源的当前资源剩余量以及第二资源的可用资源总量,确定各资源节点的第一调度分数;至少部分的根据各资源节点的所述第一调度分数,确定目标资源节点。

Description

资源调度方法及装置、电子设备和存储介质 技术领域
本公开涉及计算机技术领域,尤其涉及一种资源调度方法及装置、电子设备和存储介质。
背景技术
随着应用规模快速增长,对处理资源的调度的重要性越来越高,良好的调度可支持系统稳定高效运行。在相关技术中,在资源调度时,容易产生资源碎片,导致资源利用率较低。
发明内容
本公开提出了一种资源调度方法及装置、电子设备和存储介质。
根据本公开的第一方面,提供了一种资源调度方法,包括:至少部分的根据目标任务的资源需求量、多个资源节点中每个资源节点的第一资源的当前资源剩余量以及第二资源的可用资源总量,确定所述每个资源节点针对所述目标任务的第一调度分数,其中,所述第一资源包括深度学习资源,所述第二资源包括通用资源;至少部分的根据所述多个资源节点中每个资源节点的所述第一调度分数,在所述多个资源节点中确定用于处理所述目标任务的目标资源节点。
根据本公开的实施例的资源调度方法,可在调度处理资源时综合考虑第一资源的当前资源剩余量和第二资源的可用资源总量,确定第一调度分数,有利于减少资源碎片,提高资源利用率。
在一种可能的实现方式中,所述目标任务的资源需求量包括第一资源需求量和第二资源需求量;所述至少部分的根据所述目标任务的资源需求量、多个资源节点中每个资源节点的第一资源的当前资源剩余量以及第二资源的可用资源总量,确定所述每个资源节点针对所述目标任务的第一调度分数,包括:根据所述目标任务的所述第一资源需求量和所述第一资源的所述当前资源剩余量,得到第一分数;根据所述目标任务的所述第二资源需求量以及所述第二资源的所述可用资源总量,确定第二分数;基于所述第一分数和所述第二分数进行加权求和,得到所述第一调度分数。
通过这种方式,可综合考虑第一资源剩余量以及第二资源总量,来确定各资源节点的第一调度分数,可将目标任务的各任务单元集中分配到同一资源节点进行处理,减少碎片资源,提高资源利用效率,减少后续任务的等待时间。
在一种可能的实现方式中,所述方法还包括:根据所述多个资源节点中每个资 源节点分配的任务类型以及所述目标任务的类型,确定所述每个资源节点的第二调度分数;所述至少部分的根据所述多个资源节点中每个资源节点的所述第一调度分数,在所述多个资源节点中确定用于处理所述目标任务的目标资源节点,包括:基于每个资源节点的所述第一调度分数和所述第二调度分数,确定所述每个资源节点的总调度分数;基于所述多个资源节点中每个资源节点的所述总调度分数,确定所述目标资源节点。
在一种可能的实现方式中,第一节点的第二调度分数高于第二节点的第二调度分数,其中,所述第一节点是所述多个资源节点中分配的任务类型与所述目标任务的类型相同的节点,所述第二节点是所述多个资源节点中分配的任务类型与所述目标任务的类型不同的节点。
在一种可能的实现方式中,所述方法还包括:至少部分的根据多个任务中每个任务的优先级和所述多个任务中每个任务包括的多个任务单元的平均资源需求量,对所述多个任务进行排序,获得第一任务队列,其中,所述多个任务包括所述目标任务;基于所述目标任务在所述第一任务队列中的排序,对所述目标任务进行调度。
通过这种方式,可通过任务单元平均资源需求量作为排序依据,充分利用处理资源,提高资源利用率,减少资源的浪费。
在一种可能的实现方式中,所述至少部分的根据多个任务中每个任务的优先级和所述多个任务中每个任务包括的多个任务单元的平均资源需求量,对所述多个任务进行排序,获得第一任务队列,包括:根据所述多个任务中每个任务的优先级,确定所述多个任务的初始排序;在所述初始排序中存在至少两个任务的优先级相同的情况下,根据所述至少两个任务各自的平均资源需求量,确定所述至少两个任务的目标排序。
在一种可能的实现方式中,所述至少部分的根据多个任务中每个任务的优先级和所述多个任务中每个任务包括的多个任务单元的平均资源需求量,对所述多个任务进行排序,获得第一任务队列,包括:至少部分的根据所述多个任务中每个任务的优先级、所述多个任务中每个任务包括的多个任务单元的平均资源需求量以及所述多个任务中每个任务的创建时间戳,对所述多个任务进行排序,获得所述第一任务队列。
根据本公开的第二方面,提供了一种资源调度装置,包括:第一确定模块,用于至少部分的根据目标任务的资源需求量、多个资源节点中每个资源节点的第一资源的当前资源剩余量以及第二资源的可用资源总量,确定所述每个资源节点针对所述目标任务的第一调度分数,其中,所述第一资源包括深度学习资源,所述第二资源包括通用资源;第二确定模块,用于至少部分的根据所述多个资源节点中每个资源节点的所述第一调度分数,在所述多个资源节点中确定用于处理所述目标任务的目标资源节点。
根据本公开的第三方面,提供了一种电子设备,包括:处理器;用于存储所述处理器可执行指令的存储器;其中,所述处理器被配置为:执行上述第一方面的资源调度方法。
根据本公开的第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时,促使所述处理器实现上述第一方面的资源调度方法。
根据本公开的第五方面,提供了一种计算机程序产品,包括计算机可读代码,当计算机可读代码在设备上运行时,促使所述设备中的处理器执行用于实现上述第一方面的资源调度方法的指令。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。
根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。
图1示出根据本公开实施例的资源调度方法的流程图。
图2示出根据本公开实施例的选择目标节点的示意图。
图3示出根据本公开实施例的资源调度方法的应用示意图。
图4示出根据本公开实施例的资源调度装置的框图。
图5示出根据本公开实施例的电子装置的框图。
图6示出根据本公开另一实施例的电子装置的框图。
具体实施方式
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。
另外,为了更好的说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。
图1示出根据本公开实施例的资源调度方法的流程图,如图1所示,所述方法包括以下步骤。
在步骤S11中,至少部分的根据目标任务的资源需求量、多个资源节点中每个资源节点的第一资源的当前资源剩余量以及第二资源的可用资源总量,确定所述每个资源节点针对所述目标任务的第一调度分数,其中,所述第一资源包括深度学习资源,所述第二资源包括通用资源。
在步骤S12中,至少部分的根据所述多个资源节点中每个资源节点的第一调度分数,在所述多个资源节点中确定用于处理所述目标任务的目标资源节点。
根据本公开的实施例的资源调度方法,可在调度资源时综合考虑第一资源的当前资源剩余量和第二资源的可用资源总量,确定第一调度分数,有利于减少资源碎片,提高资源利用率。
在一种可能的实现方式中,所述资源调度方法可以由终端设备或其它处理设备执行,其中,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字处理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等。其它处理设备可为台式机、服务器或云端服务器等。在一些可能的实现方式中,该资源调度方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。
在一种可能的实现方式中,所述资源调度方法可用于服务器中,用于在接收到任务处理请求时,为待处理的任务调度资源,并利用该资源来处理任务。
在一种可能的实现方式中,所述服务器中可包括多个资源节点,每个资源节点均可用于处理所述任务,所述资源节点可包括第一资源和第二资源。在示例中,所述第一资源可以是深度学习资源(例如,GPU资源、TPU(Tensor Processing Unit)资源、FPGA(Field Programmable Gate Array)等),第二资源可以是通用资源(例如,CPU(Central Processing Unit)资源和/或内存资源)。本公开对处理资源的类型不做限制。例如,当资源节点是物理机时,该资源节点包括物理机的所有资源。又例如,当资源节点是虚拟机时,通过特定的软件和/或硬件CPU虚拟化技术,虚拟机的一个或多个虚拟CPU可以复用物理CPU,而对于GPU,可以将物理GPU的相关设备信息直接透传(passthrough)给虚拟机,供虚拟机使用。又例如,当资源节点是虚拟机时,可以通过GPU虚拟化技术,虚拟机的一个或多个虚拟GPU复用物理GPU,本公开实施例不限于此。
在一种可能的实现方式中,在所述服务器的任务队列中,可存在多个任务,可为任务队列中的任务进行排序,以确定任务处理的顺序,提高任务处理的效率。
在一种可能的实现方式中,所述任务可具有各自的优先级。例如,某个任务的优先级为高,另一任务的优先级为中,则优先级高的任务可被优先处理。在相关技术中,如果两个或多个任务的优先级相同,可按照任务的创建时间(例如,任务创建的时间戳)来对优先级相同的任务进行排序。例如,创建时间较早的任务排在创建时间较晚的任务之前。但这种排序方式灵活性较差,且容易产生资源碎片。例如,资源节点A与资源节点B分别有8块空闲GPU资源,现有任务T1与任务T2,其中任务T1与任务T2的优先级相同,但任务T1的创建时间早于任务T2,T1包括两个任务单元,每个任务单元请求1块GPU资源,而任务T2包含一个任务单元,请求7块GPU资源。按照上述任务排序方式,可将任务T1排在任务T2之前,优先为任务T1调度处理资源。可能会将任务T1的两个任务单元分配至同一个资源节点(例如资源节点A)进行处理,该资源节点此时剩余6块GPU资源,不足以处理任务T2的任务单元,因此,任务T2的任务单元可被分配至另一资源节点(例如资源节点B)进行处理。按照上述调度方式,资源节点B将会剩余1块空闲的GPU资源,若后续任务请求GPU的数量较大(例如,任务单元的资源需求量大于1块GPU资源),则该碎片GPU资源(即,资源节点B的1块空闲的GPU资源)可能造成资源的浪费。在一些示例中,1块空闲的GPU资源可以是指1块空闲的GPU。
在一种可能的实现方式中,还可按照任务单元平均资源需求量来排序,所述方法还包括:至少部分的根据多个任务中每个任务的优先级和多个任务中每个任务包括的多个任务单元的平均资源需求量,对多个任务进行排序,获得第一任务队列,其中,所述多个任务包括所述目标任务;基于所述目标任务在所述第一任务队列中的排序,对所述目标任务进行调度。
在一种可能的实现方式中,如果两个或多个任务的优先级相同,还可根据任务单元平均资源需求量来排序。至少部分的根据多个任务中每个任务的优先级和多个任务中每个任务包括的多个任务单元的平均资源需求量,对多个任务进行排序,获得第一任务队列,包括:根据多个任务中每个任务的优先级,确定多个任务的初始排序;在所述初始排序中存在至少两个任务的优先级相同的情况下,根据所述至少两个任务各自的平均资源需求量,确定所述至少两个任务的目标排序。
在一种可能的实现方式中,可首先按照优先级对多个任务进行排序,获得初始排序,即,优先级较高的任务排在优先级较低的任务之前。在所述初始排序中,可能存在至少两个优先级相同的任务。例如,优先级为高的任务有两个,优先级为中的任务有三个,优先级为低的任务有五个等,初始排序中可不区分优先级相同的任务的先后顺序。
在一种可能的实现方式中,如果初始排序中存在至少两个优先级相同的任务, 可通过任务单元平均资源需求量对优先级相同的至少两个任务进行排序,确定所述至少两个任务的目标排序,例如,可将任务单元平均资源需求量较大的任务排在任务单元平均资源需求量较小的任务之前。
在示例中,资源节点A与资源节点B分别有8块空闲GPU资源,现有任务T1与任务T2,其中任务T1与任务T2的优先级相同,T1包括两个任务单元,每个任务单元请求1块GPU资源,则任务T1的任务单元平均资源需求量为1块GPU资源,而任务T2包含一个任务单元,请求7块GPU资源,则任务T2的任务单元平均资源需求量为7块GPU资源,可将任务T2排在任务T1之前,优先为任务T2调度处理资源。例如,可以将任务T2的一个任务单元分配至资源节点A进行处理,该资源节点此时剩余1块GPU资源,然后可以将任务T1的一个任务单元分配至资源节点A进行处理,可以将任务T2的另一个任务单元分配至另一资源节点(例如资源节点B)进行处理。按照上述调度方式,资源节点A无剩余的GPU资源,不会产生碎片GPU资源,提高了资源利用率,减少了资源的浪费。
在一种可能的实现方式中,如果初始排序中存在至少两个任务的优先级相同且任务单元平均资源需求量相同,可按照任务的创建时间来进行排序。,至少部分的根据多个任务中每个任务的优先级和多个任务中每个任务包括的多个任务单元的平均资源需求量,对多个任务进行排序,获得第一任务队列,包括:至少部分的根据多个任务中每个任务的优先级、多个任务中每个任务包括的多个任务单元的平均资源需求量以及多个任务中每个任务的创建时间戳,对多个任务进行排序,获得第一任务队列。
在一种可能的实现方式中,在所述初始排序中,可能存在至少两个优先级相同且任务单元平均资源需求量相同的任务。例如,优先级为高的任务有两个,优先级为中的任务有三个,优先级为低的任务有五个等,其中,优先级为高的两个任务(例如,任务T3和任务T4)的任务单元平均资源需求量也相同。在示例中,可通过这两个任务的创建时间来确定两个任务的顺序。例如,任务T3的创建时间早于任务T4,则可根据任务T3和任务T4各自的时间戳,将任务T3排在任务T4之前。
在一种可能的实现方式中,可基于所述目标任务在所述第一任务队列中的排序,对所述目标任务进行调度。例如,可在目标任务之前的任务处理完成后,为所述目标任务调度资源节点,以处理目标任务。
通过这种方式,将任务单元平均资源需求量引入排序依据,充分利用处理资源,提高资源利用率,减少资源的浪费。
在一种可能的实现方式中,在为任务排序后,可调度处理资源依次处理第一任务队列中的任务。例如,可调度资源节点来处理当前任务,如,目标任务。
在一个例子中,可针对目标任务,计算各资源节点的分数,并使用分数最高的资源节点来处理目标任务。在示例中,可根据任务单元的资源需求量与各资源节点的资 源总量来计算各资源节点的分数,例如,可根据任务单元的资源需求量与各资源节点的资源总量之间的比值来确定各资源节点的分数。这种计算方式可使资源总量较小的资源节点的分数较高,即,优先调度资源总量较小的资源节点来处理目标任务的各任务单元,从而使资源总量较大的资源节点被用于后续其他任务中,在后续其他任务中,如果出现资源需求量较大的任务,则可使用资源总量较大的资源节点来处理,减少资源需求量较大的任务的等待时间。但该调度方法仅考虑资源节点的资源总量(通常为固定值),可能存在资源总量较大的资源节点在资源剩余量较少的情况下,依然优先调度资源总量较小的空闲资源节点,造成资源总量较大的资源节点中的少量剩余资源浪费。
此外,上述调度方式还可能出现均匀占用多个资源节点,导致后续任务等待时间过长的情况。例如,服务器中包括8个节点,每个节点包括8块GPU资源。目标任务有8个任务单元,每个任务单元的资源需求量均为一块GPU资源。则在确定各节点的分数时,每个节点的分数均相等,则可能将8个任务单元均匀分配至8个资源节点中,每个资源节点均被占用1块GPU。如果后续任务中的某个任务单元的资源需求量为8块GPU,则各资源节点均无法处理该任务,只能等待目标任务的任务单元处理完成后才可处理该任务,导致该任务等待时间过长。
在一些例子中,某些特定的任务(例如深度学习的任务或神经网络训练任务等)需求的资源类型为GPU资源等深度学习资源(即,第一资源),而另一些任务可通过CPU资源和/或内存资源等通用资源(即,第二资源)来处理,还可能存在第一资源和第二资源共同处理的任务。随着神经网络技术的发展,这种特定任务对于GPU资源的需求越来越大,需要对GPU资源的调度进行优化,以提高GPU资源利用率。
在一种可能的实现方式中,可根据目标任务的第一资源需求量和第二资源需求量、多个资源节点中每个资源节点的第一资源的当前资源剩余量以及第二资源的可用资源总量,分别确定所述每个资源节点针对所述目标任务的第一调度分数。即,综合考虑第一资源剩余量以及第二资源的可用资源总量,来确定各资源节点的第一调度分数。
在一种可能的实现方式中,步骤S11可包括:根据所述目标任务的第一资源需求量和所述第一资源的当前资源剩余量,得到第一分数;根据所述目标任务的第二资源需求量以及所述第二资源的可用资源总量,确定第二分数;基于第一分数和第二分数,得到所述第一调度分数。
在一种可能的实现方式中,可根据所述目标任务的第一资源需求量和所述第一资源的当前资源剩余量,得到各资源节点的第一分数,例如,可通过目标任务的第一资源需求量和各资源节点的第一资源的当前资源剩余量之比,获得所述各资源节点的第一分数。
在一种可能的实现方式中,可根据所述目标任务的第二资源需求量以及所述第二资源的可用资源总量,确定各资源节点的第二分数,例如,可通过目标任务的第二资 源需求量和各资源节点的第二资源的可用资源总量之比,获得所述各资源节点的第二分数。如果资源节点具有多种第二资源(例如CPU和内存),则可使用各种第二资源需求量和各种第二资源的可用资源总量之比的平均值确定所述各资源节点的第二分数。
在一种可能的实现方式中,针对目标任务,可设置第一权值β,0≤β≤1,例如,β可以为1、0.9、0.6、0.5、0.3、0等。β可以由管理员预先设定。
在一种可能的实现方式中,可以基于第一分数和第二分数的加权求和,得到第一调度分数,例如根据以下公式(1)确定第一调度分数:
Figure PCTCN2020094181-appb-000001
其中,S i为第i(i为正整数)个资源节点的第一调度分数,re 1为第一资源需求量,id 1i为第i个资源节点的第一资源剩余量,re CPU为对CPU资源的需求量,al CPUi为第i个资源节点的CPU可用资源总量,re mem为内存需求量,al memi为第i个资源节点的可用内存总量,PW为目标任务的权值,即第二权值。
β为可调参数,可以根据实际需求进行设置,其数值在某个具体应用场景中可以固定不变或者动态可变。在一些示例中,可根据任务的类型来确定第一权值β,例如,针对神经网络训练任务,第一权值β可取较大的值。针对无需GPU资源的任务,第一权值可取较小的值。本公开对第一权值β的取值不做限制。
在另一些实施例中,可以基于第一分数和第二分数的加权平均值或算数平均值,得到第一调度分数,等等,本公开实施例对第一调度分数的具体实现不做限定。
在示例中,可根据第一调度分数来为目标任务调度资源节点。例如,服务器中包括8个资源节点,每个资源节点包括8块GPU资源。目标任务有8个任务单元,每个任务单元的资源需求量均为一块GPU资源。由于计算第一调度分数时,考虑了第一资源需求量与第一资源剩余量的比值,则在第一个任务单元被分配到某个资源节点后,该资源节点的第一资源剩余量减少,从而使得该资源节点的第一调度分数增大,后续的任务单元可被优先分配到该资源节点,有利于各任务单元被尽量分配到同一个资源节点中,减少各任务单元被分配到多个资源节点中,占用多个资源节点的情况。
通过这种方式,可综合考虑第一资源剩余量以及第二资源的可用资源总量,来确定各资源节点的第一调度分数,可将目标任务的各任务单元尽量分配到同一资源节点进行处理,减少碎片资源,提高资源利用效率,减少后续任务的等待时间。
在一种可能的实现方式中,针对同一个任务,可能出现至少两个资源节点的第一调度分数相同的情况。在该情况下,可根据第二调度分数,将任务分配到已处理相同类型任务的资源节点中进行处理,以减少碎片资源。
在一些实施例中,可以通过多个调度策略分别确定资源节点的调度分数,然后 将资源节点的多个调度策略对应的调度分数进行综合考量,得到该资源节点的总调度分数,并基于该总调度分数确定目标节点。
在一种可能的实现方式中,所述方法还包括:根据所述多个资源节点中每个资源节点分配的任务类型以及所述目标任务的类型,确定所述每个资源节点的第二调度分数。
在一些实施例中,基于资源节点的第一调度分数和第二调度分数,得到该资源节点的总调度分数。例如,基于第一调度分数和第二调度分数的加权求和,得到总调度分数,或者,基于第一调度分数和第二调度分数的加权平均值,得到总调度分数,等等,但本公开实施例对此不做限定。
在示例中,可将目标任务的各任务单元集中于正在处理与目标任务类型相同的任务的资源节点中,例如,目标任务为深度学习类型的任务,如果有两个资源节点的第一调度分数相同,则可将目标任务的任务单元分配到正在处理深度学习任务的资源节点中。
在一种可能的实现方式中,可根据所述目标任务需求的资源类型,确定所述目标任务的目标类型,并在所述至少两个资源节点中,将正在处理的任务的类型为所述目标类型的资源节点确定为所述目标节点。
在示例中,目标任务为深度学习类型的任务,深度学习类型的任务主要需求GPU资源,可根据任务需求的资源类型来确定目标任务以及各资源节点中正在处理的任务的类型。例如,资源节点A中正在处理的任务占用了2块GPU资源,资源节点B空闲,可认为资源节点A中正在处理的任务与目标任务类型相同。或者,资源节点A中正在处理的任务占用了2块GPU资源,资源节点B中正在执行的任务占用了CPU资源,而并未占用GPU资源,可认为资源节点A中正在处理的任务与目标任务类型相同。第一节点的第二调度分数高于第二节点的第二调度分数,其中,所述第一节点是所述多个资源节点中分配的任务类型与所述目标任务的类型相同的节点,所述第二节点是所述多个资源节点中分配的任务类型与所述目标任务的类型不同的节点。即,可使资源节点A获得较高的第二调度分数。
在一种可能的实现方式中,步骤S12可包括:基于每个资源节点的第一调度分数和所述第二调度分数,确定所述每个资源节点的总调度分数;基于所述多个资源节点中每个资源节点的总调度分数,确定所述目标资源节点。例如,第二调度分数也可具有针对自身的计算策略的第二权值,可将第一调度分数与第二调度分数进行加权求和,获得总调度分数,并根据总调度分数选择资源节点。
在示例中,在计算总调度分数时,还可使用除以上描述的计算策略以外的其他计算策略,并可对各计算策略得到的分数进行加权求和,获得总调度分数,例如,基于第一调度分数和第二调度分数得到第三调度分数,并基于第三调度分数和基于其他至少 一个计算策略得到的至少一个第四调度分数,得到总调度分数。进一步地,可使用总调度分数最高的资源节点处理目标任务,即,作为目标资源节点。本公开对计算策略不做限制。
图2示出根据本公开实施例的选择目标节点的示意图。如图2所示,任务1和任务2均为深度学习类型的任务,资源需求量均为一块GPU资源。资源节点A包括6块GPU资源,资源节点B包括3块GPU资源,但资源节点A中正在执行的任务已占用了3块GPU资源,在确定资源节点A和资源节点B的第一调度分数时,由于GPU资源的资源剩余量一致,则资源节点A的第一调度分数与资源节点B的第一调度分数可能相同。
在示例中,资源节点A中正在处理的任务占用了3块GPU资源,可认为资源节点A中正在处理的任务与任务1的类型相同,可使资源节点A获得较高的第二调度分数。在与第一调度分数相加后,资源节点A的总调度分数较高,从而,可以调度资源节点A来处理任务1。进一步地,资源节点A的资源剩余量为2块GPU资源,资源剩余量小于资源节点B,因此,仍可调度资源节点A来处理任务2。使得任务1和任务2集中在资源节点A中进行处理,避免目标任务占用的资源节点过于分散,占用过多的资源节点,产生碎片资源,造成资源浪费。
根据本公开的实施例的资源调度方法,可通过任务单元平均资源需求量作为排序依据,充分利用处理资源,提高资源利用率,减少资源的浪费。并可综合考虑第一资源剩余量以及第二资源的可用资源总量,来确定各资源节点的第一调度分数,可将目标任务的各任务单元尽量分配到同一资源节点进行处理,减少碎片资源,提高资源利用效率,减少后续任务的等待时间。进一步地,可根据确定目标任务的资源类型以及各资源节点正在处理的任务的资源类型,尽量将任务集中在同一个资源节点中进行处理,避免占用过多的资源节点,产生碎片资源,造成资源浪费。
图3示出根据本公开实施例的资源调度方法的应用示意图,如图3所示,在服务器的任务队列中,可存在多个任务(例如M个,M为正整数),可为任务队列中的任务进行排序,例如,可根据任务优先级和任务单元平均资源需求量来排序,即,首先按照任务优先级来排序,如果序列中存在至少两个任务的优先级相同,可将任务单元平均资源需求量较大的任务排在任务单元平均资源需求量较小的任务之前。
在一种可能的实现方式中,针对任务i,可使用多个计算策略来计算各资源节点的第一调度分数。例如,可首先使用公式(1)来计算各资源节点(例如,共N个资源节点,N为正整数)在各计算策略中的第一调度分数。
在一种可能的实现方式中,如果有至少两个资源节点的第一调度分数相同,可根据第二调度分数,将任务分配到已处理相同类型任务的资源节点中进行处理,以减少碎片资源。例如,可采用其他计算策略,例如,如果任务i为深度学习类型的任务,请 求的资源为GPU资源。资源节点A中正在处理的任务占用了2块GPU资源,资源节点B空闲,可认为资源节点A中正在处理的任务与目标任务类型相同,可使资源节点A获得更高的第二调度分数。如果资源节点A的第一调度资源分数与资源节点B的第一调度分数相同,则与各自第二调度分数相加后得到各自的总调度分数,资源节点A获得的总调度分数较高,可使用资源节点A处理目标任务。即,将任务尽量集中在同一个资源节点中处理,减少碎片资源。
在一种可能的实现方式中,还可使用多个计算策略,例如,K个计算策略,并对各计算策略获得的调度分数进行加权求和,可获得各资源节点的总调度分数。并可将总调度分数最高的资源节点确定为目标资源节点(例如,资源节点j,j为整数,且j≤N)。
在一种可能的实现方式中,本公开的资源调度方法可用于服务器中,可调度各资源节点来处理服务器中的各个任务。例如,可用于人工智能教学平台的服务器中,可用于调度资源节点来处理各人工智能教学任务或实验任务。又例如,可用于监控系统的服务器中,可用于调度各资源节点来处理人脸识别或人脸聚类等任务。本公开对调度方法的应用场景不做限制。
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。
此外,本公开还提供了资源调度装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开提供的任一种资源调度方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
图4示出根据本公开实施例的资源调度装置的框图,如图4所示,所述装置包括:第一确定模块41和第二确定模块42。
第一确定模块41,用于至少部分的根据目标任务的资源需求量、多个资源节点中每个资源节点的第一资源的当前资源剩余量以及第二资源的可用资源总量,确定所述每个资源节点针对所述目标任务的第一调度分数,其中,所述第一资源包括深度学习资源,所述第二资源包括通用资源。
第二确定模块42,用于至少部分的根据所述多个资源节点中每个资源节点的所述第一调度分数,在所述多个资源节点中确定用于处理所述目标任务的目标资源节点。
在一种可能的实现方式中,所述目标任务的资源需求量包括第一资源需求量和第二资源需求量;所述第一确定模块进一步用于:根据所述目标任务的第一资源需求量 和所述第一资源的当前资源剩余量,得到第一分数;根据所述目标任务的第二资源需求量以及所述第二资源的可用资源总量,确定第二分数;对所述第一分数和所述第二分数进行加权求和,得到所述第一调度分数。
在一种可能的实现方式中,所述装置还包括:第三确定模块,用于根据所述多个资源节点中每个资源节点分配的任务类型以及所述目标任务的类型,确定所述每个资源节点的第二调度分数;所述第二确定模块进一步用于:基于每个资源节点的第一调度分数和所述第二调度分数,确定所述每个资源节点的总调度分数;基于所述多个资源节点中每个资源节点的总调度分数,确定所述目标资源节点。
在一种可能的实现方式中,第一节点的第二调度分数高于第二节点的第二调度分数,其中,所述第一节点是所述多个资源节点中分配的任务类型与所述目标任务的类型相同的节点,所述第二节点是所述多个资源节点中分配的任务类型与所述目标任务的类型不同的节点。
在一种可能的实现方式中,所述装置还包括:第一获得模块,用于至少部分的根据多个任务中每个任务的优先级和所述多个任务中每个任务包括的多个任务单元的平均资源需求量,对所述多个任务进行排序,获得第一任务队列,其中,所述多个任务包括所述目标任务;调度模块,用于基于所述目标任务在所述第一任务队列中的排序,对所述目标任务进行调度。
在一种可能的实现方式中,所述第一获得模块进一步用于:根据所述多个任务中每个任务的优先级,确定所述多个任务的初始排序;在所述初始排序中存在至少两个任务的优先级相同的情况下,根据所述至少两个任务各自的平均资源需求量,确定所述至少两个任务的目标排序。
在一种可能的实现方式中,所述第一获得模块进一步用于:至少部分的根据所述多个任务中每个任务的优先级、所述多个任务中每个任务包括的多个任务单元的平均资源需求量以及所述多个任务中每个任务的创建时间戳,对所述多个任务进行排序,获得第一任务队列。
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时,促使所述处理器实现上述资源调度的方法。计算机可读存储介质可以是非易失性计算机可读存储介质。
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为执行上述资源调度的方法。
电子设备可以被提供为终端、服务器或其它形态的设备。
图5是根据一示例性实施例示出的一种电子设备500的框图。例如,电子设备500可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。
参照图5,电子设备500可以包括以下一个或多个组件:处理组件502,存储器504,电源组件506,多媒体组件508,音频组件510,输入/输出(I/O)的接口512,传感器组件514,以及通信组件516。
处理组件502通常控制电子设备500的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件502可以包括一个或多个处理器520来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件502可以包括一个或多个模块,便于处理组件502和其他组件之间的交互。例如,处理组件502可以包括多媒体模块,以方便多媒体组件508和处理组件502之间的交互。
存储器504被配置为存储各种类型的数据以支持在电子设备500的操作。这些数据的示例包括用于在电子设备500上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器504可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件506为电子设备500的各种组件提供电力。电源组件506可以包括电源管理系统,一个或多个电源,及其他与为电子设备500生成、管理和分配电力相关联的组件。
多媒体组件508包括在所述电子设备500和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件508包括一个前置摄像头和/或后置摄像头。当电子设备500处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件510被配置为输出和/或输入音频信号。例如,音频组件510包括一个麦克风(MIC),当电子设备500处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器504或经由通信组件516发送。在一些实施例中,音频组件510还包括一个扬声器, 用于输出音频信号。
I/O接口512为处理组件502和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件514包括一个或多个传感器,用于为电子设备500提供各个方面的状态评估。例如,传感器组件514可以检测到电子设备500的打开/关闭状态,组件的相对定位,例如所述组件为电子设备500的显示器和小键盘,传感器组件514还可以检测电子设备500或电子设备500一个组件的位置改变,用户与电子设备500接触的存在或不存在,电子设备500方位或加速/减速和电子设备500的温度变化。传感器组件514可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件514还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件514还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件516被配置为便于电子设备500和其他设备之间有线或无线方式的通信。电子设备500可以接入基于通信标准的无线网络,如Wi-Fi,2G,3G,4G或5G,或它们的组合。在一个示例性实施例中,通信组件516经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件516还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,电子设备500可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器504,上述计算机程序指令可由电子设备500的处理器520执行以完成上述方法。
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,当计算机可读代码在设备上运行时,设备中的处理器执行用于实现如上任一实施例提供的方法的指令。
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。
图6是根据一示例性实施例示出的一种电子设备600的框图。例如,电子设备600可以被提供为一服务器。参照图6,电子设备600包括处理组件622,其进一步包括一个或多个处理器,以及由存储器632所代表的存储器资源,用于存储可由处理组件622的执行的指令,例如应用程序。存储器632中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件622被配置为执行指令,以实现上述资源调度的方法。
电子设备600还可以包括一个电源组件626被配置为执行电子设备600的电源管理,一个有线或无线网络接口650被配置为将电子设备600连接到网络,和一个输入输出(I/O)接口658。电子设备600可以操作基于存储在存储器632的操作系统,例如Windows Server TM,Mac OS X TM,UnixTM,Linux TM,FreeBSD TM或类似。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器632,上述计算机程序指令可由电子设备600的处理组件622执行以完成上述方法。
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言 —诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对 于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中技术的技术改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。

Claims (16)

  1. 一种用于资源调度的方法,其特征在于,包括:
    至少部分的根据目标任务的资源需求量、多个资源节点中每个资源节点的第一资源的当前资源剩余量以及第二资源的可用资源总量,确定所述每个资源节点针对所述目标任务的第一调度分数,其中,所述第一资源包括深度学习资源,所述第二资源包括通用资源;
    至少部分的根据所述多个资源节点中每个资源节点的所述第一调度分数,在所述多个资源节点中确定用于处理所述目标任务的目标资源节点。
  2. 根据权利要求1所述的方法,其特征在于,所述目标任务的资源需求量包括第一资源需求量和第二资源需求量;
    所述至少部分的根据所述目标任务的资源需求量、所述多个资源节点中每个资源节点的第一资源的当前资源剩余量以及第二资源的可用资源总量,确定所述每个资源节点针对所述目标任务的第一调度分数,包括:
    根据所述目标任务的所述第一资源需求量和所述第一资源的所述当前资源剩余量,得到第一分数;
    根据所述目标任务的所述第二资源需求量以及所述第二资源的所述可用资源总量,确定第二分数;
    基于所述第一分数和所述第二分数进行加权求和,得到所述第一调度分数。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    根据所述多个资源节点中每个资源节点分配的任务类型以及所述目标任务的类型,确定所述每个资源节点的第二调度分数;
    所述至少部分的根据所述多个资源节点中每个资源节点的所述第一调度分数,在所述多个资源节点中确定用于处理所述目标任务的目标资源节点,包括:
    基于每个资源节点的所述第一调度分数和所述第二调度分数,确定所述每个资源节点的总调度分数;
    基于所述多个资源节点中每个资源节点的所述总调度分数,确定所述目标资源节点。
  4. 根据权利要求3所述的方法,其特征在于,第一节点的第二调度分数高于第二节点的第二调度分数,其中,所述第一节点是所述多个资源节点中分配的任务类型与所述目标任务的类型相同的节点,所述第二节点是所述多个资源节点中分配的任务类型与所述目标任务的类型不同的节点。
  5. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    至少部分的根据多个任务中每个任务的优先级和所述多个任务中每个任务包括的多个任务单元的平均资源需求量,对所述多个任务进行排序,获得第一任务队列,其中,所述多个任务包括所述目标任务;
    基于所述目标任务在所述第一任务队列中的排序,对所述目标任务进行调度。
  6. 根据权利要求5所述的方法,其特征在于,所述至少部分的根据多个任务中每个任务的优先级和所述多个任务中每个任务包括的多个任务单元的平均资源需求量,对所述多个任务进行排序,获得第一任务队列,包括:
    根据所述多个任务中每个任务的优先级,确定所述多个任务的初始排序;
    在所述初始排序中存在至少两个任务的优先级相同的情况下,根据所述至少两个任务各自的平均资源需求量,确定所述至少两个任务的目标排序。
  7. 根据权利要求5或6所述的方法,其特征在于,所述至少部分的根据多个任务中每个任务的优先级和所述多个任务中每个任务包括的多个任务单元的平均资源需求量,对所述多个任务进行排序,获得第一任务队列,包括:
    至少部分的根据所述多个任务中每个任务的优先级、所述多个任务中每个任务包括的多个任务单元的平均资源需求量以及所述多个任务中每个任务的创建时间戳,对所述多个任务进行排序,获得所述第一任务队列。
  8. 一种用于资源调度的装置,其特征在于,包括:
    第一确定模块,用于至少部分的根据目标任务的资源需求量、多个资源节点中每个资源节点的第一资源的当前资源剩余量以及第二资源的可用资源总量,确定所述每个资源节点针对所述目标任务的第一调度分数,其中,所述第一资源包括深度学习资源,所述第二资源包括通用资源;
    第二确定模块,用于至少部分的根据所述多个资源节点中每个资源节点的所述第一调度分数,在所述多个资源节点中确定用于处理所述目标任务的目标资源节点。
  9. 根据权利要求8所述的装置,其特征在于,所述目标任务的资源需求量包括第一资源需求量和第二资源需求量;
    所述第一确定模块进一步用于:
    根据所述目标任务的所述第一资源需求量和所述第一资源的所述当前资源剩余量,得到第一分数;
    根据所述目标任务的所述第二资源需求量以及所述第二资源的所述可用资源总量,确定第二分数;
    基于所述第一分数和所述第二分数进行加权求和,得到所述第一调度分数。
  10. 根据权利要求8或9所述的装置,其特征在于,所述装置还包括:
    第三确定模块,用于根据所述多个资源节点中每个资源节点分配的任务类型以及所述目标任务的类型,确定所述每个资源节点的第二调度分数;
    所述第二确定模块进一步用于:
    基于每个资源节点的所述第一调度分数和所述第二调度分数,确定所述每个资源节点的总调度分数;
    基于所述多个资源节点中每个资源节点的所述总调度分数,确定所述目标资源节点。
  11. 根据权利要求10所述的装置,其特征在于,第一节点的第二调度分数高于第二节点的第二调度分数,其中,所述第一节点是所述多个资源节点中分配的任务类型与所述目标任务的类型相同的节点,所述第二节点是所述多个资源节点中分配的任务类型与所述目标任务的类型不同的节点。
  12. 根据权利要求8所述的装置,其特征在于,所述装置还包括:
    第一获得模块,用于至少部分的根据多个任务中每个任务的优先级和所述多个任务中每个任务包括的多个任务单元的平均资源需求量,对所述多个任务进行排序,获得第一任务队列,其中,所述多个任务包括所述目标任务;
    调度模块,用于基于所述目标任务在所述第一任务队列中的排序,对所述目标任务进行调度。
  13. 根据权利要求12所述的装置,其特征在于,所述第一获得模块进一步用于:
    根据所述多个任务中每个任务的优先级,确定所述多个任务的初始排序;
    在所述初始排序中存在至少两个任务的优先级相同的情况下,根据所述至少两个任务各自的平均资源需求量,确定所述至少两个任务的目标排序。
  14. 根据权利要求12或13所述的装置,其特征在于,所述第一获得模块进一步用于:
    至少部分的根据所述多个任务中每个任务的优先级、所述多个任务中每个任务包括的多个任务单元的平均资源需求量以及所述多个任务中每个任务的创建时间戳,对所述多个任务进行排序,获得所述第一任务队列。
  15. 一种电子设备,其特征在于,包括:
    处理器;
    用于存储所述处理器可执行指令的存储器;
    其中,所述处理器被配置为:执行权利要求1至7中任意一项所述的方法。
  16. 一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计 算机程序指令被处理器执行时,使得所述处理器实现权利要求1至7中任意一项所述的方法。
PCT/CN2020/094181 2019-12-25 2020-06-03 资源调度方法及装置、电子设备和存储介质 WO2021128737A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2021538194A JP2022518127A (ja) 2019-12-25 2020-06-03 リソーススケジューリング方法及び装置、電子デバイス並びに記録媒体
KR1020217020244A KR20210094639A (ko) 2019-12-25 2020-06-03 리소스 스케줄링 방법 및 장치, 전자 디바이스 및 기록 매체

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911357908.7 2019-12-25
CN201911357908.7A CN113032112A (zh) 2019-12-25 2019-12-25 资源调度方法及装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2021128737A1 true WO2021128737A1 (zh) 2021-07-01

Family

ID=76458238

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/094181 WO2021128737A1 (zh) 2019-12-25 2020-06-03 资源调度方法及装置、电子设备和存储介质

Country Status (5)

Country Link
JP (1) JP2022518127A (zh)
KR (1) KR20210094639A (zh)
CN (1) CN113032112A (zh)
TW (1) TW202125274A (zh)
WO (1) WO2021128737A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115686799A (zh) * 2022-12-29 2023-02-03 中国华能集团清洁能源技术研究院有限公司 一种大数据平台中的任务调度方法、装置、设备及介质
WO2023207623A1 (zh) * 2022-04-24 2023-11-02 阿里巴巴(中国)有限公司 任务处理方法
CN117714452A (zh) * 2023-12-14 2024-03-15 摩尔线程智能科技(北京)有限责任公司 一种流量负载均衡方法、系统及装置

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114756347A (zh) * 2022-04-19 2022-07-15 中国联合网络通信集团有限公司 基于集群的服务器资源调度方法、装置、云平台及介质
CN115242662B (zh) * 2022-09-22 2023-02-17 音信云(武汉)信息技术有限公司 基于云计算的数据资源分配方法及装置
CN116501478A (zh) * 2023-06-28 2023-07-28 中国电信股份有限公司 任务分配方法、装置、设备、介质及数字孪生系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130219395A1 (en) * 2012-02-21 2013-08-22 Disney Enterprises, Inc. Batch scheduler management of tasks
CN105791447A (zh) * 2016-05-20 2016-07-20 北京邮电大学 一种面向视频服务的云资源调度方法及装置
CN107168777A (zh) * 2016-03-07 2017-09-15 阿里巴巴集团控股有限公司 分布式系统中资源的调度方法以及装置
CN110191500A (zh) * 2019-05-25 2019-08-30 西安电子科技大学 支持资源碎片消减的自组织网络时频资源调度方法
CN110413391A (zh) * 2019-07-24 2019-11-05 上海交通大学 基于容器集群的深度学习任务服务质量保证方法和系统

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002007364A (ja) * 2000-06-22 2002-01-11 Fujitsu Ltd 並列計算機システムのジョブスケジューリングを行うスケジューリング装置
JP5722247B2 (ja) * 2012-02-10 2015-05-20 株式会社野村総合研究所 仮想サーバ管理システム
CN106354729B (zh) * 2015-07-16 2020-01-07 阿里巴巴集团控股有限公司 一种图数据处理方法、装置和系统
JP6339978B2 (ja) * 2015-07-17 2018-06-06 日本電信電話株式会社 リソース割当管理装置およびリソース割当管理方法
US10963309B2 (en) * 2016-09-16 2021-03-30 Advanced Micro Devices, Inc. Network interface controller-based scheduling of processing tasks in a distributed computing system
JP6969268B2 (ja) * 2017-10-11 2021-11-24 日本電信電話株式会社 計算機およびcpuコア割当方法
US20190332420A1 (en) * 2018-04-27 2019-10-31 Advanced Micro Devices, Inc. Feedback guided split workgroup dispatch for gpus
CN109743751B (zh) * 2018-06-26 2021-08-03 国网江苏省电力有限公司南京供电分公司 无线接入网的资源分配方法及装置
CN109582452B (zh) * 2018-11-27 2021-03-02 北京邮电大学 一种容器调度方法、调度装置及电子设备
CN109857551B (zh) * 2019-01-09 2023-12-19 平安科技(深圳)有限公司 基于云计算的服务资源的调度方法及装置、电子设备
CN110221915B (zh) * 2019-05-21 2020-11-10 新华三大数据技术有限公司 节点调度方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130219395A1 (en) * 2012-02-21 2013-08-22 Disney Enterprises, Inc. Batch scheduler management of tasks
CN107168777A (zh) * 2016-03-07 2017-09-15 阿里巴巴集团控股有限公司 分布式系统中资源的调度方法以及装置
CN105791447A (zh) * 2016-05-20 2016-07-20 北京邮电大学 一种面向视频服务的云资源调度方法及装置
CN110191500A (zh) * 2019-05-25 2019-08-30 西安电子科技大学 支持资源碎片消减的自组织网络时频资源调度方法
CN110413391A (zh) * 2019-07-24 2019-11-05 上海交通大学 基于容器集群的深度学习任务服务质量保证方法和系统

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023207623A1 (zh) * 2022-04-24 2023-11-02 阿里巴巴(中国)有限公司 任务处理方法
CN115686799A (zh) * 2022-12-29 2023-02-03 中国华能集团清洁能源技术研究院有限公司 一种大数据平台中的任务调度方法、装置、设备及介质
CN115686799B (zh) * 2022-12-29 2023-04-07 中国华能集团清洁能源技术研究院有限公司 一种大数据平台中的任务调度方法、装置、设备及介质
CN117714452A (zh) * 2023-12-14 2024-03-15 摩尔线程智能科技(北京)有限责任公司 一种流量负载均衡方法、系统及装置

Also Published As

Publication number Publication date
JP2022518127A (ja) 2022-03-14
CN113032112A (zh) 2021-06-25
KR20210094639A (ko) 2021-07-29
TW202125274A (zh) 2021-07-01

Similar Documents

Publication Publication Date Title
WO2021128737A1 (zh) 资源调度方法及装置、电子设备和存储介质
US20210304069A1 (en) Method for training classification model, classification method and device, and storage medium
US8913730B2 (en) Communication system with message prioritization mechanism and method of operation thereof
WO2020155609A1 (zh) 一种目标对象处理方法、装置、电子设备及存储介质
WO2017031875A1 (zh) 在聊天界面更改表情符号的方法、装置及终端设备
CN110245757B (zh) 一种图像样本的处理方法及装置、电子设备和存储介质
KR20210134675A (ko) 사용자 시연을 통하여 명령들을 학습하고 실행 가능하게 하기 위한 방법 및 시스템
CN111090687B (zh) 数据处理方法及装置、系统、计算机可读存储介质
WO2017206902A1 (zh) 应用控制方法及相关设备
US20180367325A1 (en) Method and system for sorting chatroom list based on conversational activeness and contextual information
US20210149558A1 (en) Method and apparatus for controlling terminal device, and non-transitory computer-readle storage medium
TW202113752A (zh) 神經網路訓練及圖像生成方法、電子設備、儲存媒體
KR20200047162A (ko) 분할된 화면 상에서 실행 가능한 어플리케이션 리스트를 디스플레이하는 전자 장치 및 전자 장치의 동작 방법
CN112668707B (zh) 运算方法、装置及相关产品
WO2023185647A1 (zh) 媒体内容的显示方法、装置、设备、存储介质和程序产品
WO2022247128A1 (zh) 图像处理方法及装置、电子设备和存储介质
CN114138439A (zh) 任务调度方法及装置、电子设备和存储介质
US20220245401A1 (en) Method and apparatus for training model
US10649993B2 (en) Continuous caster scheduling with template driven search
US20210397991A1 (en) Predictively setting information handling system (ihs) parameters using learned remote meeting attributes
WO2023237102A1 (zh) 一种连麦展示方法、装置、电子设备、计算机可读介质
WO2017215658A1 (zh) 音效添加方法及用户终端
CN115098262B (zh) 一种多神经网络任务处理方法及装置
CN115512116B (zh) 图像分割模型优化方法、装置、电子设备及可读存储介质
CA3098735A1 (en) Display interface switching method, display interface switching apparatus, and electronic device

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2021538194

Country of ref document: JP

Kind code of ref document: A

Ref document number: 20217020244

Country of ref document: KR

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: 20906090

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: 20906090

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20906090

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 23.01.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20906090

Country of ref document: EP

Kind code of ref document: A1