CN114064259A - Resource scheduling method and device for heterogeneous computing resources - Google Patents

Resource scheduling method and device for heterogeneous computing resources Download PDF

Info

Publication number
CN114064259A
CN114064259A CN202010766349.1A CN202010766349A CN114064259A CN 114064259 A CN114064259 A CN 114064259A CN 202010766349 A CN202010766349 A CN 202010766349A CN 114064259 A CN114064259 A CN 114064259A
Authority
CN
China
Prior art keywords
resource
subtask
computing
allocation scheme
resource allocation
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202010766349.1A
Other languages
Chinese (zh)
Other versions
CN114064259B (en
Inventor
张佩珩
陆天翼
张剑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Chaoxing Future Technology Co ltd
Original Assignee
Beijing Chaoxing Future Technology Co ltd
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 Beijing Chaoxing Future Technology Co ltd filed Critical Beijing Chaoxing Future Technology Co ltd
Priority to CN202010766349.1A priority Critical patent/CN114064259B/en
Publication of CN114064259A publication Critical patent/CN114064259A/en
Application granted granted Critical
Publication of CN114064259B publication Critical patent/CN114064259B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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)

Abstract

The embodiment of the invention discloses a resource scheduling method and device for heterogeneous computing resources. By applying the scheme provided by the embodiment of the invention, the subtask with the longest execution time in the critical path can be scheduled to the corresponding computing resource in other non-critical paths in the currently obtained optimal scheme, so that the total execution time of all tasks in the critical path can be reduced, and the resource allocation scheme with the shortest execution time can be obtained through multiple cycles, so that the time consumption of heterogeneous computing can be reduced, and the computing speed can be improved. And moreover, the computing resources are distributed by taking the code amount of each subtask as the initial weight, so that each computing resource can be in a working state to the maximum extent according to the resource granularity provided by each computing resource, and each computing resource can be fully utilized.

Description

Resource scheduling method and device for heterogeneous computing resources
Technical Field
The invention relates to the technical field of resource scheduling, in particular to a resource scheduling method and device for heterogeneous computing resources.
Background
In a heterogeneous computing platform, a good resource management strategy can improve the resource utilization rate and reduce the task overhead. However, in some application scenarios, the optimization effect is not ideal from the viewpoint of reducing the task overhead, and the calculation speed needs to be further optimized from the viewpoint of scheduling. Therefore, in order to reduce the computation speed of heterogeneous computation, a resource scheduling method is needed.
Disclosure of Invention
The invention provides a resource scheduling method and device for heterogeneous computing resources, which aim to improve the computing speed of heterogeneous computing. The specific technical scheme is as follows.
In a first aspect, an embodiment of the present invention provides a resource scheduling method for heterogeneous computing resources, where the method includes:
receiving a task to be processed, wherein the task to be processed comprises a plurality of subtasks, and a dependency relationship exists among the subtasks; generating a directed acyclic graph DAG according to the dependency relationship among the plurality of subtasks;
acquiring the resource amount of each computing resource, and constructing a heterogeneous resource pool; the heterogeneous resource pool comprises resource amounts of the computing resources; each computing resource is a heterogeneous computing resource;
according to a preset corresponding relation between each task and each computing resource, allocating computing resources for each subtask in the heterogeneous resource pool by taking the code amount of each subtask in the DAG as an initial weight to obtain an initial resource allocation scheme; taking the initial resource allocation scheme as an optimal scheme;
executing each subtask included in the DAG according to the optimal scheme and recording the execution duration of each subtask;
determining a key path in the DAG and a subtask A with the longest execution time in the key path according to the execution time of each subtask, wherein the key path is the path with the longest execution time; randomly selecting a unit computing resource K from the computing resources corresponding to the subtask A, determining a non-critical path with the unit computing resource K larger than the unit computing resource K, and determining a unit computing resource K from the non-critical path to be allocated to the subtask A to obtain a current resource allocation scheme;
judging whether a preset ending condition is met;
when the preset ending condition is met, taking the current resource allocation scheme as a final resource allocation scheme;
when the preset ending condition is not met, executing each subtask included in the DAG according to the current resource allocation scheme, recording the execution duration of each subtask, calculating a current value corresponding to the current resource allocation scheme and an optimal value corresponding to the optimal scheme according to a preset evaluation function, and updating the optimal scheme by using the current resource allocation scheme when the current value is smaller than the optimal value; and returning to execute the steps of executing each subtask included in the DAG according to the optimal scheme and recording the execution duration of each subtask.
Optionally, the preset evaluation function is:
Figure BDA0002614761080000021
Lkis the execution duration of subtask k, LuAnd N is the total number of the subtasks.
Optionally, before determining a unit of computing resource K from the non-critical path and allocating the unit of computing resource K to the subtask a to obtain the current resource allocation scheme, the method further includes:
judging whether a non-critical path with more than one unit of computing resource K exists;
the step of determining a non-critical path having more than one unit of computing resource K, determining a unit of computing resource K from the non-critical path to allocate to the subtask a, and obtaining a current resource allocation scheme includes:
and when a non-critical path with more than one unit of computing resource K exists, determining one unit of computing resource K from the non-critical path to be allocated to the subtask A, and obtaining a current resource allocation scheme.
Optionally, after determining whether there is a non-critical path with more than one unit of computing resource K, the method further includes:
and when a non-critical path with more than one unit of computing resources K does not exist, distributing computing resources for each subtask in the heterogeneous resource pool by taking the execution duration of each subtask in the critical path as a weight to obtain a current resource distribution scheme.
Optionally, the preset end condition includes: and when the repetition times reach the maximum repetition times, or the change value of the optimal value obtained by calculating according to the preset evaluation function in two adjacent times reaches the preset times, wherein the times continuously within the set range reach the preset times.
In a second aspect, an embodiment of the present invention provides a resource scheduling apparatus for heterogeneous computing resources, where the apparatus includes:
the task receiving module is used for receiving a task to be processed, wherein the task to be processed comprises a plurality of subtasks, and a dependency relationship exists among the subtasks; generating a directed acyclic graph DAG according to the dependency relationship among the plurality of subtasks;
the resource acquisition module is used for acquiring the resource amount of each computing resource and constructing a heterogeneous resource pool; the heterogeneous resource pool comprises resource amounts of the computing resources; each computing resource is a heterogeneous computing resource;
a resource allocation module, configured to allocate, according to a preset correspondence between each task and each computing resource, the computing resource for each subtask in the heterogeneous resource pool by using the code amount of each subtask in the DAG as an initial weight, so as to obtain an initial resource allocation scheme; taking the initial resource allocation scheme as an optimal scheme;
a task execution module, configured to execute each of the subtasks included in the DAG according to the optimal scheme and record an execution duration of each of the subtasks;
a task scheduling module, configured to determine, according to the execution duration of each sub-task, a key path in the DAG and a sub-task a with the longest execution duration in the key path, where the key path is the path with the longest execution duration; randomly selecting a unit computing resource K from the computing resources corresponding to the subtask A, determining a non-critical path with the unit computing resource K larger than the unit computing resource K, and determining a unit computing resource K from the non-critical path to be allocated to the subtask A to obtain a current resource allocation scheme;
the condition judgment module is used for judging whether a preset ending condition is met or not;
a scheme determining module, configured to take the current resource allocation scheme as a final resource allocation scheme when the condition determining module determines that the current resource allocation scheme is the final resource allocation scheme;
a scheme replacement module, configured to, when the judgment result of the condition judgment module is negative, execute each of the subtasks included in the DAG according to the current resource allocation scheme and record an execution duration of each of the subtasks, calculate a current value corresponding to the current resource allocation scheme and an optimal value corresponding to the optimal scheme according to a preset evaluation function, and update the optimal scheme using the current resource allocation scheme when the current value is smaller than the optimal value; and triggering the task execution module.
Optionally, the preset evaluation function is:
Figure BDA0002614761080000041
Lkis the execution duration of subtask k, LuAnd N is the total number of the subtasks.
Optionally, the apparatus further comprises:
the path judgment module is used for judging whether a non-critical path with more than one unit of computing resources K exists or not;
the task scheduling module is specifically configured to determine that a unit of computing resource K is allocated to the subtask a from the non-critical path to obtain a current resource allocation scheme when the path determining module determines that the path has a non-critical path larger than the unit of computing resource K.
Optionally, the apparatus further comprises:
and the resource determining module is used for allocating the computing resources to each subtask in the heterogeneous resource pool by taking the execution duration of each subtask in the critical path as a weight when the path judging module determines that no non-critical path with more than one unit of computing resources K exists, so as to obtain a current resource allocation scheme.
Optionally, the preset end condition includes: and when the repetition times reach the maximum repetition times, or the change value of the optimal value obtained by calculating according to the preset evaluation function in two adjacent times reaches the preset times, wherein the times continuously within the set range reach the preset times.
As can be seen from the above, the resource scheduling method and apparatus for heterogeneous computing resources provided in the embodiments of the present invention can schedule the subtask with the longest execution time in the critical path to the corresponding computing resource in other non-critical paths in the currently obtained optimal solution, so as to reduce the total execution time of all tasks in the critical path, and obtain the resource allocation solution with the shortest execution time through multiple cycles, thereby reducing the time consumption of heterogeneous computing and increasing the computing speed. And moreover, the computing resources are distributed by taking the code amount of each subtask as the initial weight, so that each computing resource can be in a working state to the maximum extent according to the resource granularity provided by each computing resource, and each computing resource can be fully utilized. Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
The innovation points of the embodiment of the invention comprise:
1. in the currently obtained optimal scheme, the subtask with the longest execution time in the critical path is scheduled to the corresponding computing resource in other non-critical paths, so that the total execution time of all tasks in the critical path can be reduced, and the resource allocation scheme with the shortest execution time can be obtained through multiple cycles, so that the time consumption of heterogeneous computing can be reduced, and the computing speed is improved. And moreover, the computing resources are distributed by taking the code amount of each subtask as the initial weight, so that each computing resource can be in a working state to the maximum extent according to the resource granularity provided by each computing resource, and each computing resource can be fully utilized.
2. For the same subtask, the execution duration of the computing resource with the larger resource amount is shorter than the execution duration of the computing resource with the smaller resource amount, so that when the subtask with the longest execution duration in the critical path is scheduled, and when a non-critical path with the corresponding computing resource does not exist, the computing resource is reallocated to each subtask by taking the execution duration of each subtask in the critical path as the weight, that is, the subtask with the longer execution duration can be allocated to the computing resource with the larger resource amount, so that a resource allocation scheme with the shortest execution duration can be obtained, and the computing speed is improved. Moreover, the working time of each computing resource can be balanced, local aging caused by long-term use of the local computing resources is prevented, the aging speed of the computing resources is averaged, and the service life of the computing resources is prolonged.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It is to be understood that the drawings in the following description are merely exemplary of some embodiments of the invention. For a person skilled in the art, without inventive effort, further figures can be obtained from these figures.
Fig. 1 is a schematic flowchart of a resource scheduling method for heterogeneous computing resources according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a directed acyclic graph according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a resource scheduling apparatus for heterogeneous computing resources according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely a few embodiments of the invention, and not all embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.
It is to be noted that the terms "comprises" and "comprising" and any variations thereof in the embodiments and drawings of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
The embodiment of the invention discloses a resource scheduling method and device for heterogeneous computing resources, which can improve the computing speed of heterogeneous computing. The following provides a detailed description of embodiments of the invention.
Fig. 1 is a flowchart illustrating a resource scheduling method for heterogeneous computing resources according to an embodiment of the present invention. The method is applied to the electronic equipment. The method specifically comprises the following steps.
S110: receiving a task to be processed, wherein the task to be processed comprises a plurality of subtasks, and a dependency relationship exists among the plurality of subtasks; and generating a directed acyclic graph DAG according to the dependency relationship among the plurality of subtasks.
If there is a non-directed acyclic graph, and point A can go from B to C and back to A, forming a ring. Changing the edge direction from C to A from A to C becomes DAG (Directed Acyclic Graph).
For example, when the task to be processed includes subtasks a, b, c, d, and e. And a and b are calculated, the output data is sent to c, c is calculated and sent to d and e, as shown in fig. 2, the graph structure formed by the subtasks a, b, c, d and e is a DAG with two inputs and two outputs.
S120: acquiring the resource amount of each computing resource, and constructing a heterogeneous resource pool; the heterogeneous resource pool comprises the resource amount of each computing resource; each computing resource is a heterogeneous computing resource.
For example, the electronic device may send a resource amount acquisition request to each heterogeneous computing resource, and each heterogeneous computing resource may send its resource amount to the electronic device after receiving the resource amount acquisition request. The resource amount may include a CPU margin, a hardware margin, and the like of the computing resource.
S130: according to the preset corresponding relation between each task and each computing resource, allocating computing resources for each subtask in the heterogeneous resource pool by taking the code amount of each subtask in the DAG as an initial weight to obtain an initial resource allocation scheme; and the initial resource allocation scheme is taken as an optimal scheme.
In heterogeneous computing platforms, the types of tasks that can be processed by the computing resources are different. Therefore, in the embodiment of the present invention, the correspondence between each task and each computing resource may be set in advance, that is, for each type of task, which computing resource can execute the task may be set. For example, the computing resources corresponding to the task a can be set to 1, 2, and 3; and b, the computing resources corresponding to the tasks are 4, 5 and the like.
For example, when the task to be processed includes subtasks a, b, c, d, and e, and the computing resources corresponding to the subtask a are 1, 2, and 3, the computing resource with the highest resource amount, such as 2, may be selected from the computing resources 1, 2, and 3 as the computing resource corresponding to the subtask a; similarly, the sub-tasks b, c, d, and e may be allocated with their respective corresponding computing resources, e.g. 4, 8, 11, and 15, respectively, to obtain an initial resource allocation scheme: a-2, b-4, c-8, d-11, e-15.
S140: and executing each subtask included in the DAG according to the optimal scheme and recording the execution time length of each subtask.
Taking the above example as an example, it is possible that the sub-task a is executed by the computing resource 2, the sub-task b is executed by the computing resource 4, the sub-task c is executed by the computing resource 8, the sub-task d is executed by the computing resource 11, and the sub-task e is executed by the computing resource 15. The execution duration of each subtask is the total duration required for the corresponding computing resource to run the subtask.
S150: determining a key path in the DAG and a subtask A with the longest execution time in the key path according to the execution time of each subtask, wherein the key path is the path with the longest execution time; randomly selecting a unit computing resource K from the computing resources corresponding to the subtask A, determining a non-critical path with the unit computing resource K larger than one, and determining a unit computing resource K from the non-critical path to be allocated to the subtask A to obtain a current resource allocation scheme.
In the DAG shown in FIG. 2, the execution duration corresponding to the path ac-ce is the sum of the execution durations of the subtasks a, c and e; the execution time length corresponding to the path ac-cd is the sum of the execution time lengths of the subtasks a, c and d; the execution time length corresponding to the path bc-ce is the sum of the execution time lengths of the subtasks b, c and e; the execution time length corresponding to the path bc-cd is the sum of the execution time lengths of the subtasks b, c and d.
And determining the path with the longest execution time as the critical path in all paths. In the embodiment of the present invention, in order to balance the usage amount of each computing resource and shorten the execution duration of the critical path, the computing resources in the critical path may be scheduled.
It can be understood that the execution time of the critical path can be effectively shortened by scheduling the subtask with the longest execution time in the critical path. Therefore, in the embodiment of the invention, the electronic device can determine the subtask a with the longest execution time in the critical path. For example, when the critical path is ac-cd, subtask A may be task c.
There may be multiple computing resources corresponding to the subtask A with the longest execution time. In the embodiment of the present invention, when scheduling the subtask a, specifically, the electronic device may randomly select a unit of computing resource K from the computing resources corresponding to the subtask a, determine a non-critical path having more than one unit of computing resource K, and determine a unit of computing resource K from the non-critical path to allocate to the subtask a, so as to obtain a current resource allocation scheme.
In one implementation, before determining that a unit of computing resource K is allocated to the sub-task a from the non-critical path, the electronic device may first determine whether there is a non-critical path with more than one unit of computing resource K; and when a non-critical path with more than one unit of computing resource K exists, determining one unit of computing resource K from the non-critical path to be allocated to the subtask A, and obtaining the current resource allocation scheme. And when a non-critical path with more than one unit of computing resources K does not exist, distributing the computing resources for each subtask in the heterogeneous resource pool by taking the execution duration of each subtask in the critical path as the weight to obtain the current resource distribution scheme.
That is, the subtask with the highest time cost in the critical path may be set as a, one of the resource types required by a may be randomly selected as K, a node may be randomly selected from non-critical path nodes having more than one unit of K computation resources, one unit of K resources owned by the node may be allocated to a, and if all computation tasks belong to the critical path or the computation resources owned by the non-critical path nodes have only one unit, the computation resources of each subtask on the critical path may be reallocated with the execution time of each subtask on the critical path as a weight.
For the same subtask, the execution duration of the computing resource with the larger resource amount is shorter than the execution duration of the computing resource with the smaller resource amount, so that when the subtask with the longest execution duration in the critical path is scheduled, and when a non-critical path with the corresponding computing resource does not exist, the computing resource is reallocated to each subtask by taking the execution duration of each subtask in the critical path as the weight, that is, the subtask with the longer execution duration can be allocated to the computing resource with the larger resource amount, so that a resource allocation scheme with the shortest execution duration can be obtained, and the computing speed is improved. Moreover, the working time of each computing resource can be balanced, local aging caused by long-term use of the local computing resources is prevented, the aging speed of the computing resources is averaged, and the service life of the computing resources is prolonged.
S160: judging whether a preset ending condition is met; if yes, go to step S170; if not, step S180 is executed.
The preset end condition may include: and when the repetition times reach the maximum repetition times, or the change value of the optimal value obtained by calculating according to the preset evaluation function in two adjacent times reaches the preset times, wherein the times continuously within the set range reach the preset times. Setting the preset ending condition can avoid the cycle time from being too long and ensure the efficiency of resource scheduling.
S170: and taking the current resource allocation scheme as a final resource allocation scheme.
When it is determined that the preset end condition is satisfied, the resource allocation process ends, in which case the electronic device may take the current resource allocation scheme as the final resource allocation scheme.
S180: executing each subtask included in the DAG according to the current resource allocation scheme, recording the execution duration of each subtask, calculating a current value corresponding to the current resource allocation scheme and an optimal value corresponding to the optimal scheme according to a preset evaluation function, and updating the optimal scheme by using the current resource allocation scheme when the current value is smaller than the optimal value; and returns to perform step S140.
When it is determined that the preset end condition is not satisfied, the electronic device may continue to optimize the resource allocation scheme. Specifically, the electronic device may execute each subtask included in the DAG according to the current resource allocation scheme and record the execution duration of each subtask, calculate a current value corresponding to the current resource allocation scheme and an optimal value corresponding to the optimal scheme according to a preset evaluation function, and update the optimal scheme using the current resource allocation scheme when the current value is smaller than the optimal value.
That is, the current resource allocation scheme may be compared with the optimal scheme, and when the current resource allocation scheme is better, the optimal scheme is replaced with the current resource allocation scheme.
Wherein, the preset evaluation function is as follows:
Figure BDA0002614761080000091
Lkis the execution duration of subtask k, LuAnd N is the total number of the subtasks.
As can be seen from the above, in the currently obtained optimal solution, the present embodiment may schedule the subtask with the longest execution time in the critical path to the corresponding computing resource in the other non-critical path, so as to reduce the total execution time of all tasks in the critical path, and obtain the resource allocation scheme with the shortest execution time through multiple cycles, thereby reducing the time consumption of heterogeneous computing and increasing the computing speed. And moreover, the computing resources are distributed by taking the code amount of each subtask as the initial weight, so that each computing resource can be in a working state to the maximum extent according to the resource granularity provided by each computing resource, and each computing resource can be fully utilized.
As shown in fig. 3, a schematic structural diagram of a resource scheduling apparatus for heterogeneous computing resources according to an embodiment of the present invention is shown, where the apparatus may include:
a task receiving module 310, configured to receive a to-be-processed task, where the to-be-processed task includes multiple subtasks, and a dependency relationship exists between the multiple subtasks; generating a directed acyclic graph DAG according to the dependency relationship among the plurality of subtasks;
a resource obtaining module 320, configured to obtain resource amounts of each computing resource, and construct a heterogeneous resource pool; the heterogeneous resource pool comprises resource amounts of the computing resources; each computing resource is a heterogeneous computing resource;
a resource allocation module 330, configured to allocate, according to a preset correspondence between each task and each computing resource, the computing resource for each subtask in the DAG in the heterogeneous resource pool by using the code amount of each subtask in the DAG as an initial weight, so as to obtain an initial resource allocation scheme; taking the initial resource allocation scheme as an optimal scheme;
a task execution module 340, configured to execute each of the subtasks included in the DAG according to the optimal scheme and record an execution duration of each of the subtasks;
a task scheduling module 350, configured to determine, according to the execution duration of each sub-task, a key path in the DAG and a sub-task a with the longest execution duration in the key path, where the key path is the path with the longest execution duration; randomly selecting a unit computing resource K from the computing resources corresponding to the subtask A, determining a non-critical path with the unit computing resource K larger than the unit computing resource K, and determining a unit computing resource K from the non-critical path to be allocated to the subtask A to obtain a current resource allocation scheme;
a condition judgment module 360, configured to judge whether a preset end condition is met;
a scheme determining module 370, configured to take the current resource allocation scheme as a final resource allocation scheme when the condition determining module 360 determines that the current resource allocation scheme is yes;
a scheme replacing module 380, configured to, when the judgment result of the condition judging module 360 is negative, execute each of the subtasks included in the DAG according to the current resource allocation scheme and record an execution duration of each of the subtasks, calculate a current value corresponding to the current resource allocation scheme and an optimal value corresponding to the optimal scheme according to a preset evaluation function, and update the optimal scheme with the current resource allocation scheme when the current value is smaller than the optimal value; and triggering the task execution module.
Optionally, the preset evaluation function is:
Figure BDA0002614761080000101
Lkis the execution duration of subtask k, LuAnd N is the total number of the subtasks.
Optionally, the apparatus further comprises:
the path judgment module is used for judging whether a non-critical path with more than one unit of computing resources K exists or not;
the task scheduling module is specifically configured to determine that a unit of computing resource K is allocated to the subtask a from the non-critical path to obtain a current resource allocation scheme when the path determining module determines that the path has a non-critical path larger than the unit of computing resource K.
Optionally, the apparatus further comprises:
and the resource determining module is used for allocating the computing resources to each subtask in the heterogeneous resource pool by taking the execution duration of each subtask in the critical path as a weight when the path judging module determines that no non-critical path with more than one unit of computing resources K exists, so as to obtain a current resource allocation scheme.
Optionally, the preset end condition includes: and when the repetition times reach the maximum repetition times, or the change value of the optimal value obtained by calculating according to the preset evaluation function in two adjacent times reaches the preset times, wherein the times continuously within the set range reach the preset times.
As can be seen from the above, in the currently obtained optimal solution, the present embodiment may schedule the subtask with the longest execution time in the critical path to the corresponding computing resource in the other non-critical path, so as to reduce the total execution time of all tasks in the critical path, and obtain the resource allocation scheme with the shortest execution time through multiple cycles, thereby reducing the time consumption of heterogeneous computing and increasing the computing speed. And moreover, the computing resources are distributed by taking the code amount of each subtask as the initial weight, so that each computing resource can be in a working state to the maximum extent according to the resource granularity provided by each computing resource, and each computing resource can be fully utilized.
The above device embodiment corresponds to the method embodiment, and has the same technical effect as the method embodiment, and for the specific description, refer to the method embodiment. The device embodiment is obtained based on the method embodiment, and for specific description, reference may be made to the method embodiment section, which is not described herein again.
Those of ordinary skill in the art will understand that: the figures are merely schematic representations of one embodiment, and the blocks or flow diagrams in the figures are not necessarily required to practice the present invention.
Those of ordinary skill in the art will understand that: modules in the devices in the embodiments may be distributed in the devices in the embodiments according to the description of the embodiments, or may be located in one or more devices different from the embodiments with corresponding changes. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A resource scheduling method for heterogeneous computing resources, the method comprising:
receiving a task to be processed, wherein the task to be processed comprises a plurality of subtasks, and a dependency relationship exists among the subtasks; generating a directed acyclic graph DAG according to the dependency relationship among the plurality of subtasks;
acquiring the resource amount of each computing resource, and constructing a heterogeneous resource pool; the heterogeneous resource pool comprises resource amounts of the computing resources; each computing resource is a heterogeneous computing resource;
according to a preset corresponding relation between each task and each computing resource, allocating computing resources for each subtask in the heterogeneous resource pool by taking the code amount of each subtask in the DAG as an initial weight to obtain an initial resource allocation scheme; taking the initial resource allocation scheme as an optimal scheme;
executing each subtask included in the DAG according to the optimal scheme and recording the execution duration of each subtask;
determining a key path in the DAG and a subtask A with the longest execution time in the key path according to the execution time of each subtask, wherein the key path is the path with the longest execution time; randomly selecting a unit computing resource K from the computing resources corresponding to the subtask A, determining a non-critical path with the unit computing resource K larger than the unit computing resource K, and determining a unit computing resource K from the non-critical path to be allocated to the subtask A to obtain a current resource allocation scheme;
judging whether a preset ending condition is met;
when the preset ending condition is met, taking the current resource allocation scheme as a final resource allocation scheme;
when the preset ending condition is not met, executing each subtask included in the DAG according to the current resource allocation scheme, recording the execution duration of each subtask, calculating a current value corresponding to the current resource allocation scheme and an optimal value corresponding to the optimal scheme according to a preset evaluation function, and updating the optimal scheme by using the current resource allocation scheme when the current value is smaller than the optimal value; and returning to execute the steps of executing each subtask included in the DAG according to the optimal scheme and recording the execution duration of each subtask.
2. The method of claim 1, wherein the preset merit function is:
Figure FDA0002614761070000011
Lkis the execution duration of subtask k, LuAnd N is the total number of the subtasks.
3. The method of claim 1, wherein before determining a unit of computing resources K from the non-critical path to allocate to the subtask a to obtain a current resource allocation scheme, the method further comprises:
judging whether a non-critical path with more than one unit of computing resource K exists;
the step of determining a non-critical path having more than one unit of computing resource K, determining a unit of computing resource K from the non-critical path to allocate to the subtask a, and obtaining a current resource allocation scheme includes:
and when a non-critical path with more than one unit of computing resource K exists, determining one unit of computing resource K from the non-critical path to be allocated to the subtask A, and obtaining a current resource allocation scheme.
4. The method of claim 3, wherein after determining whether there is a non-critical path having more than one unit of computing resources K, the method further comprises:
and when a non-critical path with more than one unit of computing resources K does not exist, distributing computing resources for each subtask in the heterogeneous resource pool by taking the execution duration of each subtask in the critical path as a weight to obtain a current resource distribution scheme.
5. The method according to any one of claims 1 to 4, wherein the preset end condition comprises: and when the repetition times reach the maximum repetition times, or the change value of the optimal value obtained by calculating according to the preset evaluation function in two adjacent times reaches the preset times, wherein the times continuously within the set range reach the preset times.
6. An apparatus for resource scheduling for heterogeneous computing resources, the apparatus comprising:
the task receiving module is used for receiving a task to be processed, wherein the task to be processed comprises a plurality of subtasks, and a dependency relationship exists among the subtasks; generating a directed acyclic graph DAG according to the dependency relationship among the plurality of subtasks;
the resource acquisition module is used for acquiring the resource amount of each computing resource and constructing a heterogeneous resource pool; the heterogeneous resource pool comprises resource amounts of the computing resources; each computing resource is a heterogeneous computing resource;
a resource allocation module, configured to allocate, according to a preset correspondence between each task and each computing resource, the computing resource for each subtask in the heterogeneous resource pool by using the code amount of each subtask in the DAG as an initial weight, so as to obtain an initial resource allocation scheme; taking the initial resource allocation scheme as an optimal scheme;
a task execution module, configured to execute each of the subtasks included in the DAG according to the optimal scheme and record an execution duration of each of the subtasks;
a task scheduling module, configured to determine, according to the execution duration of each sub-task, a key path in the DAG and a sub-task a with the longest execution duration in the key path, where the key path is the path with the longest execution duration; randomly selecting a unit computing resource K from the computing resources corresponding to the subtask A, determining a non-critical path with the unit computing resource K larger than the unit computing resource K, and determining a unit computing resource K from the non-critical path to be allocated to the subtask A to obtain a current resource allocation scheme;
the condition judgment module is used for judging whether a preset ending condition is met or not;
a scheme determining module, configured to take the current resource allocation scheme as a final resource allocation scheme when the condition determining module determines that the current resource allocation scheme is the final resource allocation scheme;
a scheme replacement module, configured to, when the judgment result of the condition judgment module is negative, execute each of the subtasks included in the DAG according to the current resource allocation scheme and record an execution duration of each of the subtasks, calculate a current value corresponding to the current resource allocation scheme and an optimal value corresponding to the optimal scheme according to a preset evaluation function, and update the optimal scheme using the current resource allocation scheme when the current value is smaller than the optimal value; and triggering the task execution module.
7. The apparatus of claim 6, wherein the preset merit function is:
Figure FDA0002614761070000031
Lkis the execution duration of subtask k, LuAnd N is the total number of the subtasks.
8. The apparatus of claim 6, further comprising:
the path judgment module is used for judging whether a non-critical path with more than one unit of computing resources K exists or not;
the task scheduling module is specifically configured to determine that a unit of computing resource K is allocated to the subtask a from the non-critical path to obtain a current resource allocation scheme when the path determining module determines that the path has a non-critical path larger than the unit of computing resource K.
9. The apparatus of claim 8, further comprising:
and the resource determining module is used for allocating the computing resources to each subtask in the heterogeneous resource pool by taking the execution duration of each subtask in the critical path as a weight when the path judging module determines that no non-critical path with more than one unit of computing resources K exists, so as to obtain a current resource allocation scheme.
10. The apparatus according to any one of claims 6-9, wherein the preset end condition comprises: and when the repetition times reach the maximum repetition times, or the change value of the optimal value obtained by calculating according to the preset evaluation function in two adjacent times reaches the preset times, wherein the times continuously within the set range reach the preset times.
CN202010766349.1A 2020-08-03 2020-08-03 Heterogeneous computing resource-oriented resource scheduling method and device Active CN114064259B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010766349.1A CN114064259B (en) 2020-08-03 2020-08-03 Heterogeneous computing resource-oriented resource scheduling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010766349.1A CN114064259B (en) 2020-08-03 2020-08-03 Heterogeneous computing resource-oriented resource scheduling method and device

Publications (2)

Publication Number Publication Date
CN114064259A true CN114064259A (en) 2022-02-18
CN114064259B CN114064259B (en) 2024-06-14

Family

ID=80231678

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010766349.1A Active CN114064259B (en) 2020-08-03 2020-08-03 Heterogeneous computing resource-oriented resource scheduling method and device

Country Status (1)

Country Link
CN (1) CN114064259B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117435442A (en) * 2023-12-21 2024-01-23 石家庄学院 Automatic matching monitoring method and system for online computer resources and computing UPS

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239141A (en) * 2014-09-05 2014-12-24 北京邮电大学 Task optimized-scheduling method in data center on basis of critical paths of workflow
CN105468452A (en) * 2014-09-04 2016-04-06 中国联合网络通信集团有限公司 Resource pool allocation method and resource scheduler
CN108762899A (en) * 2018-05-16 2018-11-06 武汉轻工大学 A kind of cloud task rescheduling method and apparatus
CN109542620A (en) * 2018-11-16 2019-03-29 中国人民解放军陆军防化学院 The scheduling of resource configuration method of associated task stream in a kind of cloud

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468452A (en) * 2014-09-04 2016-04-06 中国联合网络通信集团有限公司 Resource pool allocation method and resource scheduler
CN104239141A (en) * 2014-09-05 2014-12-24 北京邮电大学 Task optimized-scheduling method in data center on basis of critical paths of workflow
CN108762899A (en) * 2018-05-16 2018-11-06 武汉轻工大学 A kind of cloud task rescheduling method and apparatus
CN109542620A (en) * 2018-11-16 2019-03-29 中国人民解放军陆军防化学院 The scheduling of resource configuration method of associated task stream in a kind of cloud

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈廷伟;张斌;郝宪文;: "基于任务-资源分配图优化选取的网格依赖任务调度", 计算机研究与发展, no. 10, 15 October 2007 (2007-10-15) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117435442A (en) * 2023-12-21 2024-01-23 石家庄学院 Automatic matching monitoring method and system for online computer resources and computing UPS
CN117435442B (en) * 2023-12-21 2024-03-12 石家庄学院 Automatic matching monitoring method and system for online computer resources and computing UPS

Also Published As

Publication number Publication date
CN114064259B (en) 2024-06-14

Similar Documents

Publication Publication Date Title
Huang et al. SSUR: an approach to optimizing virtual machine allocation strategy based on user requirements for cloud data center
Jung et al. Synchronous parallel processing of big-data analytics services to optimize performance in federated clouds
US9218213B2 (en) Dynamic placement of heterogeneous workloads
Hazra et al. Cooperative transmission scheduling and computation offloading with collaboration of fog and cloud for industrial IoT applications
Tran et al. A proactive cloud scaling model based on fuzzy time series and SLA awareness
Chen et al. Adaptive multiple-workflow scheduling with task rearrangement
Yao et al. Self-adjusting slot configurations for homogeneous and heterogeneous hadoop clusters
Nagarajan et al. Flowflex: Malleable scheduling for flows of mapreduce jobs
Hähnel et al. Extending the cutting stock problem for consolidating services with stochastic workloads
Li et al. Federated scheduling for stochastic parallel real-time tasks
CN106407007B (en) Cloud resource configuration optimization method for elastic analysis process
Arabnejad et al. Budget constrained scheduling strategies for on-line workflow applications
CN114064259B (en) Heterogeneous computing resource-oriented resource scheduling method and device
Le et al. ITA: the improved throttled algorithm of load balancing on cloud computing
Dubey et al. QoS driven task scheduling in cloud computing
Lin et al. Two-tier project and job scheduling for SaaS cloud service providers
Mazrekaj et al. The Experiential Heterogeneous Earliest Finish Time Algorithm for Task Scheduling in Clouds.
Happe et al. A prediction model for software performance in symmetric multiprocessing environments
Goyal et al. A fault-tolerant energy-efficient computational offloading approach with minimal energy and response time in mobile cloud computing
Chen et al. A two-level virtual machine self-reconfiguration mechanism for the cloud computing platforms
Wang et al. Hill climbing-based decentralized job scheduling on computational grids
CN114064258A (en) Non-real-time resource scheduling method and device for heterogeneous computing resources
Maia et al. Semi-partitioned scheduling of fork-join tasks using work-stealing
Desirena-Lopez et al. On-line scheduling in multiprocessor systems based on continuous control using timed continuous petri nets
Ilyushkin et al. Performance-feedback autoscaling with budget constraints for cloud-based workloads of workflows

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant