A task scheduling method and device, electronic equipment and storage medium

By acquiring computing tasks and device status in a distributed server cluster, and utilizing attraction potential energy, execution cost potential energy, and system field effect potential energy, combined with a meta-reinforcement learning framework, tasks and devices are dynamically matched, solving the problem of low resource utilization in traditional scheduling methods and improving system stability and resource utilization.

CN120973546BActive Publication Date: 2026-01-27INSPUR (SHANDONG) COMPUTER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511499895.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2026-01-27
Estimated Expiration
2045-10-21

AI Technical Summary

Technical Problem

Traditional task scheduling methods cannot perceive device status in real time in distributed server clusters, cannot deeply model task topology, and do not fully exploit the characteristics of heterogeneous hardware, resulting in low resource utilization.

Method used

A task scheduling method is adopted, which obtains the computing task and device status, utilizes the attraction potential energy, execution cost potential energy and system field effect potential energy, and combines a meta-reinforcement learning framework to dynamically match tasks and devices and optimize scheduling decisions.

Benefits of technology

It enables dynamic resource matching and global state awareness, improving system stability and resource utilization while reducing performance bottlenecks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973546B_ABST
    Figure CN120973546B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a task scheduling method and device, electronic equipment and storage medium, relating to the technical field of computer, the method comprising: obtaining the computing task state and computing device state required by a heterogeneous computing system to be processed; determining at least one scheduling action corresponding to each computing task for each computing task in a schedulable state according to the computing task state and the computing device state; the scheduling action represents allocating the computing task to the corresponding computing device; determining the scheduling potential of each scheduling action corresponding to each computing task; for each computing task, selecting the scheduling action with the minimum scheduling potential as the target scheduling action of the computing task; determining the task allocation strategy according to the target scheduling action corresponding to each computing task. In this way, dynamic resource matching and global state perception are achieved, and system stability and resource utilization are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a task scheduling method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the rapid development of cloud computing, edge computing, and distributed server architectures, modern computing scenarios are evolving from centralized data centers to distributed models involving multiple nodes and devices. In distributed server clusters, task scheduling is a core element determining system performance, aiming to dynamically allocate computing tasks to the optimal devices to minimize task completion time and maximize resource utilization. However, traditional scheduling methods (such as rule-based heuristic algorithms and static priority queues) often face the following bottlenecks when dealing with heterogeneous hardware resources, dynamic load fluctuations, and complex task dependencies: First, static strategies cannot perceive device status in real time (such as GPU computing power fluctuations, memory usage, and network bandwidth changes), causing scheduling decisions to lag behind environmental changes; second, dependencies between distributed tasks (such as DAG task flows) require dynamic coordination, while traditional methods lack the ability to deeply model task topologies; third, the differentiated characteristics of heterogeneous hardware (CPU, GPU, FPGA, etc.) are not fully exploited, resulting in low task-device matching efficiency, and in some scenarios, system performance utilization is less than 10%.

[0003] To address the aforementioned issues, existing technologies attempt to introduce reinforcement learning (RL) frameworks to achieve dynamic scheduling optimization through the interaction between agents and the environment. However, traditional RL methods face two major problems in distributed server scenarios:

[0004] First, there are limitations in state representation: the heterogeneity between device states (such as multi-node load and communication link quality) and task characteristics (such as computational load and hardware preferences) makes it difficult to uniformly encode them into a vector space that RL agents can understand.

[0005] Second, there is a combinatorial explosion in the action space: In distributed systems, task allocation must simultaneously consider device type, resource constraints, and task dependencies, leading to an exponential increase in the dimension of the action space, making it difficult for traditional RL models to converge. Summary of the Invention

[0006] This application provides a task scheduling method, apparatus, electronic device, and storage medium to at least solve the above-mentioned technical problems existing in the prior art.

[0007] The technical solution of this application embodiment is implemented as follows:

[0008] In a first aspect, embodiments of this application provide a task scheduling method, the method comprising:

[0009] Obtain the computing task status and computing device status required by the heterogeneous computing system, wherein the number of computing tasks corresponding to the computing task status is at least one, and the number of computing devices corresponding to the computing device status is at least one.

[0010] Based on the computing task status and computing device status, for each computing task in the schedulable state, at least one scheduling action is determined for each computing task; the scheduling action represents allocating the computing task to the corresponding computing device.

[0011] Determine the scheduling potential energy for each scheduling action corresponding to each computational task; the scheduling potential energy is related to at least one of the attraction potential energy, execution cost potential energy, and system field effect potential energy;

[0012] For each computing task, the scheduling action with the lowest scheduling potential is selected as the target scheduling action for the computing task.

[0013] A task allocation strategy is determined based on the target scheduling action corresponding to each computing task.

[0014] Secondly, embodiments of this application provide a task scheduling apparatus, the apparatus comprising:

[0015] The first processing module is used to obtain the computing task status and computing device status required to be processed by the heterogeneous computing system. The number of computing tasks corresponding to the computing task status is at least one, and the number of computing devices corresponding to the computing device status is at least one.

[0016] The second processing module is configured to determine at least one scheduling action for each computing task in a schedulable state, based on the computing task state and computing device state; the scheduling action represents allocating the computing task to the corresponding computing device.

[0017] The third processing module is used to determine the scheduling potential energy of each scheduling action corresponding to each computing task; the scheduling potential energy is related to at least one of the attraction potential energy, execution cost potential energy, and system field effect potential energy.

[0018] The fourth processing module is used to select the scheduling action with the lowest scheduling potential energy for each computing task as the target scheduling action for the computing task.

[0019] The fifth processing module is used to determine the task allocation strategy based on the target scheduling action corresponding to each computing task.

[0020] Thirdly, embodiments of this application provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the task scheduling method.

[0021] Fourthly, embodiments of this application provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the task scheduling method.

[0022] The embodiments of this application have the following beneficial effects:

[0023] The task scheduling method, apparatus, electronic device, and storage medium provided in this application include: acquiring the state of computing tasks and the state of computing devices required to be processed by a heterogeneous computing system, wherein the number of computing tasks corresponding to the computing task state is at least one, and the number of computing devices corresponding to the computing device state is at least one; based on the computing task state and the computing device state, for each computing task in a schedulable state, determining at least one scheduling action corresponding to each computing task; the scheduling action represents allocating the computing task to a corresponding computing device; determining the scheduling potential energy of each scheduling action corresponding to each computing task; the scheduling potential energy is related to at least one of attraction potential energy, execution cost potential energy, and system field effect potential energy; for each computing task, selecting the scheduling action with the minimum scheduling potential energy as the target scheduling action for the computing task; and determining a task allocation strategy based on the target scheduling action corresponding to each computing task. Thus, scheduling is performed based on the real-time state of computing devices and computing tasks, achieving dynamic resource matching and global state awareness. By combining the use of scheduling potential energy as the selection criterion for target scheduling actions, system stability and resource utilization are improved.

[0024] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0025] Figure 1 A flowchart illustrating a task scheduling method provided in an embodiment of this application;

[0026] Figure 2 A schematic diagram of a task heterogeneity graph provided for an application embodiment of this application;

[0027] Figure 3 A schematic diagram of a device state heterogeneity diagram provided for an application embodiment of this application;

[0028] Figure 4 This is a schematic diagram of the structure of a task scheduling device provided in an embodiment of this application;

[0029] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0030] To make the objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0031] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0032] If the application documents contain similar descriptions such as "first / second", the following explanation shall be added: In the following description, the terms "first / second / third" are used only to distinguish similar objects and do not represent a specific order of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0034] Figure 1 This is a flowchart illustrating a task scheduling method provided in an embodiment of this application, as shown below. Figure 1 As shown, the method is applied to an electronic device, and the task scheduling method includes:

[0035] Step 101: Obtain the status of the computing tasks and computing devices required by the heterogeneous computing system;

[0036] Here, the number of computing tasks corresponding to the computing task status is at least one, and the number of computing devices corresponding to the computing device status is at least one;

[0037] Step 102: Based on the computing task status and computing device status, for each computing task in the schedulable state, determine at least one scheduling action corresponding to each computing task.

[0038] Here, the scheduling action represents the allocation of the computing task to the corresponding computing device;

[0039] Step 103: Determine the scheduling potential energy of each scheduling action corresponding to each computing task;

[0040] Here, the scheduling potential energy is related to at least one of the attraction potential energy, execution cost potential energy, and system field effect potential energy;

[0041] Step 104: For each computing task, select the scheduling action with the lowest scheduling potential as the target scheduling action for the computing task.

[0042] Step 105: Determine the task allocation strategy based on the target scheduling action corresponding to each computing task.

[0043] In some embodiments, a heterogeneous computing system includes various types of computing devices; the computing devices may also be described as computing units, computing nodes, processing devices, processors, etc.

[0044] The computing device can be at least one of the following types: central processing unit (CPU), graphics processing unit (GPU), embedded neural network processing unit (NPU), tensor processing unit (TPU), data processing unit (DPU), application-specific integrated circuit (ASIC), or field-programmable gate array (FPGA), etc. Of course, other types of computing devices are also possible, which will not be listed here.

[0045] In some embodiments, based on the computing task state and computing device state, for each computing task in a schedulable state, at least one scheduling action corresponding to each computing task is determined, including:

[0046] Based on the computing task status, each computing task in the schedulable state is determined sequentially; wherein, if there are multiple computing tasks, there are dependencies between computing tasks, and being in the schedulable state indicates that the computing tasks have met the dependency conditions.

[0047] For each computing task in a schedulable state, at least one scheduling action is determined for the computing task, the scheduling action representing the allocation of the computing task that has met the dependency conditions to a computing device that can meet the processing requirements of the computing task.

[0048] Here, the scheduling action specifically represents the legitimate action of assigning the computational task that has met the dependency conditions to a computing device that can meet the processing requirements of the computational task. The computational task that has met the dependency conditions refers to a task that is currently in a schedulable state.

[0049] Dependency state can characterize the dependency relationship between a computation task and its direct parent task. To satisfy the dependency condition or be in a schedulable state, all of its direct parent tasks must have been scheduled. In this way, the current computation task is in a schedulable state.

[0050] For example, each scheduling action This indicates that a task that is currently in a schedulable state will be... Assign to a specific computing device .

[0051] Assuming, For at any time The set of all legal scheduling actions. A scheduling action can be defined as: ,in And computing devices Meet the resource constraints of the task.

[0052] Here, Dependency_Mask can be a binary vector used to mark which computational tasks have met the dependency conditions and are in a schedulable state.

[0053] , indicating computational task The dependency conditions have been met, and the device is in a schedulable state.

[0054] Conversely, if Represents computational task The dependency conditions were not met, and the device was not in a schedulable state.

[0055] Dependency_Mask can record the task dependencies of each computation task and the current scheduling status in real time.

[0056] In some embodiments, determining the scheduling potential energy for each scheduling action corresponding to each computing task includes:

[0057] Based on the computing task status and computing device status, determine the attraction potential energy, execution cost potential energy, and system field effect potential energy;

[0058] Based on the first characteristic of the computing task state and the second characteristic of the computing device state, determine the first weight corresponding to the attraction potential energy, the second weight corresponding to the execution cost potential energy, and the third weight corresponding to the system field effect potential energy;

[0059] The scheduling potential is determined based on the attraction potential, execution cost potential, system field effect potential, and the first weight corresponding to the attraction potential, the second weight corresponding to the execution cost potential, and the third weight corresponding to the system field effect potential.

[0060] Here, the scheduling potential is calculated based on the system state vector, which includes system characteristics determined based on the computing task state and computing device state; at the same time, the direct parent task of each computing task also needs to be considered, so the dependency mask and the completion ratio of the parent task can also be combined.

[0061] Considering that the system characteristic vector changes at different times, the scheduling action must incorporate the concept of time, i.e., the system state vector at time t (denoted as t) needs to be determined. The system state vector includes: the first feature at time t ( ), the second characteristic of time t ( ), the dependency code at time t, and the completion percentage of the parent task at time t. Specifically, .

[0062] Among them, the dependency code ( ) is a binary vector used to mark which tasks have met the dependency conditions and are in a schedulable state; the completion percentage of the parent task ( ), used to record each task The completion rate of the parent task.

[0063] In some embodiments, determining the attractive potential energy based on the computing task state and the computing device state includes:

[0064] Based on the computing task status, determine the computational load of the computing task and the computing task's preference for computing devices;

[0065] The computational affinity of the computational task to the computing device is determined based on the computational task's preference for the computing device.

[0066] The attractive potential energy is determined based on the computational load of the computational task and the computational affinity of the computational task to the computing device.

[0067] In some embodiments, determining the execution cost potential based on the computing task state and the computing device state includes:

[0068] Based on the computing task status and the computing device status, the following information is determined: the computational load of the computing task, all direct parent tasks of the computing task and the amount of data that each parent task needs to transmit to the computing task, the current effective computing capacity of the computing device involved in the scheduling action, and the available communication bandwidth between the computing device to which the parent task has been scheduled and the computing device involved in the scheduling action.

[0069] Based on the determined information, the execution cost potential energy is determined.

[0070] In some embodiments, determining the system field effect potential energy based on the computing task state and the computing device state includes:

[0071] Based on the computing task status and the computing device status, determine the current load of the computing devices involved in the scheduling action, and the vector of the expected new load of all computing devices in the heterogeneous computing system after the scheduling action is executed;

[0072] After normalizing the vector of the new load, a probability distribution is obtained, and the information entropy of the probability distribution is determined.

[0073] Determine the fourth weight corresponding to the information entropy and the fifth weight corresponding to the load;

[0074] The system field effect potential energy is determined based on the fourth weight, the fifth weight, the information entropy, and the current load of the computing device involved in the scheduling action.

[0075] Specifically, a scheduling simulator can be used to simulate task scheduling, and the optimal task classification strategy can be determined based on the simulation results.

[0076] Specifically, the scheduling simulator can acquire the computing task status and computing device status, and for each computing task in a schedulable state, determine at least one scheduling action corresponding to each computing task; then, determine the scheduling potential energy of each scheduling action corresponding to each computing task, and for each computing task, select the scheduling action with the minimum scheduling potential energy as the target scheduling action of the computing task; finally, determine the optimal task allocation strategy based on the target scheduling action corresponding to each computing task.

[0077] The method for determining the scheduling potential energy of each scheduling action, as well as the process for determining the attraction potential energy, execution cost potential energy, system field effect potential energy, the first weight corresponding to the attraction potential energy, the second weight corresponding to the execution cost potential energy, and the third weight corresponding to the system field effect potential energy, are explained in detail below.

[0078] This disclosure provides a deterministic strategy for task scheduling. This strategy involves determining the appropriate scheduling action for each valid action. Calculate a scheduling potential To make a decision. At any time t, the goal of this strategy is to select the scheduling action that minimizes the scheduling potential energy, denoted as:

[0079]

[0080] in, Let arg min represent the scheduling potential, and let arg min represent finding the input value that minimizes a certain function value. This represents the selected scheduling action. The following is a function for calculating scheduling potential energy (i.e., a function for calculating the scheduling potential energy of each scheduling action corresponding to each computational task), which is a composite function composed of multiple physical and information theory concepts, as follows:

[0081]

[0082] in, The weights are divided into three categories (first weight, second weight, and third weight), and are optimized through meta-reinforcement learning.

[0083] , , These are attraction potential energy, execution cost potential energy, and system field effect potential energy, respectively.

[0084] The three potential energies will be explained separately below.

[0085] 1. Attractive potential energy Attraction Potential Energy represents the inherent affinity between a task and a computing device, reflecting the physical intuition that a task is "attracted" by the computing device best suited to it. The formula for calculating the attraction potential energy is as follows:

[0086]

[0087] in, Represents computational task The computational load;

[0088] Represents computational task For computing devices Calculate affinity; The preference setting for computing devices is based on the computing task; this value is a value between... The dimensionless values ​​between these are set based on the task's preference for computing units (such as CPU, GPU, FPGA, etc.). For example, if... yes The ideal computing device (i.e., the one with the highest preference) is... Conversely, if they do not match, then It tends towards 0;

[0089] This represents a positive constant used to prevent the denominator from being zero; this value is an extremely small positive constant (e.g., ...). (), used to prevent the denominator from being zero.

[0090] 2. Execution cost potential (Execution Cost Potential Energy) represents the direct time cost of executing this scheduling decision, including the computation time of the task on the device and the communication time required to receive data from the devices where all parent tasks reside. The formula for calculating the execution cost potential energy is as follows:

[0091]

[0092] in, Indicates computing device The current effective computing power; for example, floating-point operations per second (GFLOPS / s).

[0093] Represents computational task The set of all direct parent tasks; as in a task dependency graph, a task The set of all direct parent tasks;

[0094] Indicates the parent task Need to be transmitted to the computing task The amount of data;

[0095] Indicates the parent task The location of the equipment that has already been scheduled;

[0096] Indicates equipment and equipment Available communication bandwidth between them.

[0097] 3. System field effect potential energy (System Field Effect Potential Energy) is used to quantify the perturbation of a decision on the future state of the entire system, thus giving the strategy a forward-looking nature. The formula for calculating the system field effect potential energy is as follows:

[0098]

[0099] in, Indicates the calculation of the action to be performed. Then, the vector of the expected new load for all computing devices in the heterogeneous computing system;

[0100] Indicates to The information entropy of the probability distribution obtained after normalization;

[0101] Indicates computing device Current load;

[0102] Indicates the fourth weight. Indicates the fifth weight;

[0103] This is the gradient operator.

[0104] Based on the above formula, it can be seen that the system's field effect potential energy consists of two parts. The first part is the future load entropy. Information entropy is used to measure the future load balancing of the heterogeneous computing system, and the goal is for the system to be as balanced as possible (i.e., maximizing entropy). The implementation using a scheduling simulator is as follows:

[0105] First, calculate and execute the scheduled action. Subsequently, the expected new load vector for all devices in the system. .in, The load balancing vector representing the first computing device, L1', is calculated using the formula: (expected task allocation + unfinished task volume of the current computing device) / effective computing capacity S(Pj) of the current computing device. Similar examples will not be individually marked.

[0106] Then, the load vector Normalization to probability distribution ,in, ; express For any one of them, m can be equal to N in the middle;

[0107] Finally, the information entropy of this distribution is calculated. .

[0108] The second part is the Load Gradient Laplacian operator. This operator penalizes the assignment of tasks to already overloaded "hot spots." It measures the performance of computing devices. Current load The difference between its average load and that of all its neighboring devices. Its mathematical expression is: .

[0109] in, For computing devices Degree (i.e., number of neighbors) in a device heterogeneity graph. Indicates computing device The load, It is a computing device Neighboring devices; Indicates computing device The load.

[0110] Here, the computing device is measured using the load gradient Laplacian operator. Current load By distributing the load across the entire cluster to the average load of all its neighbors, the avalanche effect and localized congestion can be avoided. Considering only a single node, a new task might be assigned to a node that is currently under manageable load, but whose neighbors are all overloaded. This could cause that node to quickly become overloaded as well, potentially requiring frequent communication or data exchange with already busy neighbors, exacerbating network congestion and computational latency across the entire area, creating a "hotspot" that could spread and ultimately lead to a performance avalanche. By penalizing the entire area, tasks can be avoided from being "thrown into the fire" in the first place. By preventing localized overheating, the entire computing cluster runs more smoothly, reducing performance bottlenecks caused by localized overload. When the load is more evenly distributed, each node's resources (CPU, memory, network bandwidth) can be utilized more fully, thereby improving the throughput and efficiency of the entire cluster.

[0111] In some embodiments, determining the first weight corresponding to the attractive potential energy, the second weight corresponding to the execution cost potential energy, and the third weight corresponding to the system field effect potential energy based on the first characteristic of the computing task state and the second characteristic of the computing device state includes:

[0112] Based on the first feature and the second feature, determine the global feature;

[0113] The global features are input into the meta-learning agent, and the meta-learning agent is used to identify the global features to obtain a weight vector; the weight vector includes: the first weight, the second weight, and the third weight.

[0114] Here, the global features can be represented as ,in The first feature representing the state of the computation task. The second characteristic indicating the state of a computing device;

[0115] The first weight, the second weight, and the third weight are determined using a pre-trained meta-learning agent. Specifically, the weights are... Input is sent to the meta-learning agent, and the meta-learning agent... Obtain the weight vector.

[0116] In some embodiments, determining the fourth weight corresponding to the information entropy and the fifth weight corresponding to the load includes:

[0117] Based on the first feature and the second feature, determine the global feature;

[0118] The global features are input into the meta-learning agent, and the meta-learning agent is used to identify the global features to obtain a weight vector; the weight vector includes: a fourth weight and a fifth weight.

[0119] Here, the weight vector also includes: a fourth weight and a fifth weight, which can be determined using a pre-trained meta-learning agent. Specifically, the fourth and fifth weights are... Input is sent to the meta-learning agent, and the meta-learning agent... The resulting weight vector includes the fourth and fifth weights.

[0120] That is, the weight vector can be represented as .

[0121] In this embodiment of the disclosure, the behavior of the task allocation strategy utilizes a weight vector. To enable the policy to adapt to different task types and system conditions, a meta-reinforcement learning framework is provided to automatically learn and optimize this set of weights.

[0122] The meta-agent is a high-level agent. The training process involves the following parameters:

[0123] Meta-State: Features of the entire heterogeneous graph of tasks to be scheduled, such as the total number of tasks, the depth and width of the graph, the proportion of computationally intensive tasks, etc.; and features of the heterogeneous graph of device states.

[0124] Meta-Action: The action of a Meta-Agent is to output a specific weight vector. .

[0125] Meta-Reward: The weight vector output by the Meta-Agent. Configure the strategy and execute the scheduled task once. After the task is completed, the final reward (denoted as ) can be calculated. This serves as the reward for Meta-Agent's action.

[0126] The Meta-Agent is trained using standard reinforcement learning algorithms (such as PPO, A2C, etc.) to learn to generate an optimal set of weight vectors based on different task graph features, thereby indirectly optimizing the underlying scheduling strategy.

[0127] The following describes a meta-reinforcement learning training process for a meta-learning agent, comprising two loops: an outer loop and an inner loop. The outer loop (meta-learning) includes:

[0128] 1. Meta-state acquisition: Randomly generate a new task heterogeneous graph and a device state heterogeneous graph, and extract their global features as the input state of the Meta-Agent. ;

[0129] 2. Meta-Action Selection: Meta-Agent's Policy Network Output a weight vector ;

[0130] 3. Execute the inner loop: Use this weight Perform a complete scheduling simulation;

[0131] 4. Obtain the original reward: After the simulation ends, calculate the final reward. ;

[0132] 5. Strategy Update: As an empirical sample, this is used to update the policy network parameters of the Meta-Agent. .

[0133] The inner loop (executed by EPFSP scheduler) includes:

[0134] a. Initialization: Based on the weight passed from the outer loop. Configure scheduling potential function This function measures the cost or utility of scheduling actions;

[0135] b. Loop Decision: In the inner loop, as long as there are still unscheduled tasks, the system will continue to execute the following decision steps:

[0136] b1. Based on the current system status Determine the set of all legal actions. ;

[0137] b2, Yes Every action in Using weights Calculate its scheduling potential energy ;

[0138] b3. Choose the action with the least potential energy. And execute;

[0139] b4. Update the system status and proceed to the next decision point;

[0140] c. End: After all tasks have been scheduled, the inner loop ends and returns the final performance metrics to the outer loop for calculating the meta-reward.

[0141] The rewards mentioned above are key metrics used in the outer loop to measure the performance of the scheduling strategy, reflecting the effectiveness of the scheduling task. Higher rewards indicate a more successful scheduling strategy. This reward mechanism guides the Meta-Agent to update its strategy through feedback, enabling it to make more optimized scheduling decisions in future tasks. Through repeated training, the agent's decision-making ability gradually improves.

[0142] The following provides a reward function for meta-learning optimization. To guide the entire scheduling policy towards the global optimum, this application designs a composite reward function that evaluates the entire scheduling task after completion. This reward evaluates a set of performance metrics for the entropy potential policy, rather than evaluating individual actions, as follows:

[0143]

[0144] in, This represents the final reward value after the entire scheduling task is completed. The objective is to maximize this reward, i.e., minimize the weighted cost within the parentheses.

[0145] This indicates the total task completion time, which is the total duration from the start of the first task to the end of the last task.

[0146] This represents the total system energy consumption, calculated by summing the energy consumption of each task executed on the corresponding device.

[0147] : Indicates the degree of system load imbalance, which can be measured by the variance of the average load of each device over the entire scheduling cycle; ;

[0148] Three preset weighting coefficients are used to balance the optimization objectives of time, energy consumption, and load balancing.

[0149] After training, Meta-Agent can learn to generate optimal weights for different types of tasks. In practical applications or inference phases, for a given new task, the first step is to extract its global features. ;Will Inputting the trained Meta-Agent yields a set of optimal fixed weights w; these optimal weights w are then used to configure the Entropy Potential Field Scheduling Policy (EPFSP). Throughout the real-time scheduling process of the entire task, this fixed EPFSP policy is consistently used, meaning that at each decision point, a policy is selected that makes the target value 10 ... The smallest action.

[0150] Thus, since the potential energy value only needs to be calculated according to the formula, without the need for forward propagation of a neural network, the decision-making process can be ensured to be extremely fast. Furthermore, the decision-making behavior can be made completely interpretable, allowing for clear analysis of which "forces" are at play for each decision. Dynamic resource utilization is balanced, avoiding insufficient memory or device overload, and forward-looking load balancing is achieved through entropy and gradient terms.

[0151] Furthermore, in this embodiment, a dependency mask and a critical path reward function are designed to address the temporal dependency characteristics of distributed task flows, driving the policy network to prioritize scheduling critical path tasks. Tasks that do not meet dependency conditions (such as tasks whose parent tasks are incomplete) are dynamically masked using a binary mask to avoid ineffective exploration. Simultaneously, based on hard constraints on device resources (such as memory thresholds and hardware compatibility), illegal allocation actions are filtered out (such as allocating tasks with excessive memory requirements to low-memory devices), reducing the exploration dimensions of the policy network.

[0152] In some embodiments, a task allocation strategy is determined based on the target scheduling action corresponding to each computing task, including:

[0153] The target scheduling actions corresponding to each computing task are combined to determine the task allocation strategy.

[0154] Here, for one or more scheduling actions corresponding to each computing task, after obtaining the weight vector based on the meta-learning agent, the scheduling potential energy of each scheduling action is calculated, and the target scheduling action with the smallest scheduling potential energy is selected. After the target scheduling actions corresponding to each computing task are determined, they are combined to obtain the final task allocation strategy.

[0155] In some embodiments, the method further includes:

[0156] Based on the computing task status required to be processed by the heterogeneous computing system, a task heterogeneity graph is constructed; the task heterogeneity graph is used to record the task information required to be processed by the heterogeneous computing system; the heterogeneous computing system includes various types of computing devices.

[0157] Based on the computing device status of the heterogeneous computing system, a device status heterogeneity diagram is constructed; the computing device status heterogeneity diagram is used to record the real-time status of different computing devices in the heterogeneous computing system.

[0158] Extract the first feature of the task heterogeneity graph and the second feature of the device state heterogeneity graph.

[0159] In some embodiments, extracting a first feature of the task heterogeneity graph and a second feature of the device state heterogeneity graph includes:

[0160] The first feature is obtained by identifying the task heterogeneous graph using a task heterogeneous graph network.

[0161] The second feature is obtained by identifying the device state heterogeneity graph using a device state heterogeneity graph network.

[0162] In some embodiments, the computational task status and / or task heterogeneity graph is used to record task information that the heterogeneous computing system needs to process, specifically the real-time task status of each task, etc. Specifically, the information recorded by the task heterogeneity graph includes at least one of the following:

[0163] The set of tasks, the task execution dependencies between tasks, the set of task computation volume, the set of task communication volume, the set of task computation preferences, the set of all computing nodes of the heterogeneous computing system, the current remaining memory of the heterogeneous computing system, and the current set of interconnect bandwidth of all computing nodes of the heterogeneous computing system.

[0164] For example, the task heterogeneity graph is used to record at least one of the following information:

[0165] , represents a set of tasks; here, the number of tasks the system needs to process can be one or more, for example, a project or function that consists of multiple computing tasks, which can be assigned to different computing nodes (here, each computing device involved in the task heterogeneity graph is described as a computing node). Here, n represents the total number of tasks.

[0166] This indicates the dependency relationship between tasks in terms of task execution. For example, in an image recognition project, featureization is required first to construct an image vector, and then the vector is input into a classifier for classification. Featureization and classification are two separate tasks that are processed sequentially, and this is called a dependency relationship.

[0167] , represents the set of computational costs for each task; here, the computational cost is different for each task. For example, the above-mentioned feature-based task corresponds to one computational cost, and the classification task corresponds to another computational cost.

[0168] , representing the set of communication traffic for a task; here, data needs to be transferred between the processing of each task. For example, after the image is normalized, it needs to be passed to the computing node to execute the subsequent processing of the next task. The normalized processing result is the communication traffic of a task.

[0169] , represents the set of computational preferences for the task; here, computational preference can refer to which type of computing node to use for computation. For example, its value can be {0, 1, 2, 3}, where 0 represents CPU, 1 represents GPU, 2 represents FPGA, and 3 represents other types of computing devices such as GPU. The earlier the value is in the order, the more suitable it is for the task.

[0170] , represents the set of all computing nodes in a heterogeneous computing system, including CPUs, GPUs, FPGAs, etc.; m represents the total number of computing nodes;

[0171] , representing the current remaining memory of each computing node in the heterogeneous computing system; where m, as a subscript, indicates the quantity. The value in represents the remaining memory of the m-th computing node;

[0172] , representing the current set of interconnect bandwidth for each computing node in a heterogeneous computing system.

[0173] like Figure 2 As shown, this is a schematic diagram of a task heterogeneity graph; Figure 2 This paper describes a task scheduling relationship in a heterogeneous computing system. For a certain project and a large task, it is decomposed into 7 computing tasks (hereinafter referred to as tasks): V1, V2, V3, V4, V5, V6, and V7. Directed edges represent the execution dependencies between tasks, such as the dependency relationship between V1 and V2 (denoted as e). 12 There are dependencies between V2 and V5, and between V5 and V7, which will not be listed here. Task V1 is the entry task. The computational characteristics of task V1 help determine how the task should be processed in the heterogeneous system, including: the computational load, communication load, and computational preferences of task V1 (referring to each task's preference for different computing resources, such as CPU, GPU, FPGA).

[0174] In the above relationship, V1 is the direct parent task of V2 and V3, V2 and V3 are the direct parent tasks of V5; V3, V4, V5, and V6 are the direct parent tasks of V7.

[0175] Each computational task in the heterogeneous task graph is called a task node. Each task node records the computational characteristics of that task. For example, the computational characteristics recorded in V1 may include: c1 (representing computational complexity), t 12 + t 13 + t 14 (represents the communication volume with task V2 + communication volume with task V3 + communication volume with task V4), y1 (represents computational preference). Although the above computational features are not marked one by one in the figure, it is not difficult to understand that each task node has its own computational features.

[0176] In some embodiments, the task heterogeneous graph includes: a feature matrix and an adjacency matrix;

[0177] The step of constructing a task heterogeneity graph based on the computing task states required by the heterogeneous computing system includes:

[0178] Based on the task information to be processed by the heterogeneous computing system, a feature matrix and an adjacency matrix are constructed. The feature matrix is ​​used to characterize the computational characteristics of each task node; the adjacency matrix is ​​used to characterize the dependencies between task nodes.

[0179] Calculate the degree of each task node based on the adjacency matrix, and determine the degree matrix based on the degree of each task node;

[0180] The adjacency matrix is ​​normalized using the degree matrix to obtain the processed adjacency matrix.

[0181] Here, by creating a task heterogeneous graph, the task scheduling relationship is represented in a way that graph neural networks can handle. The adjacency matrix (denoted as A) can be used to represent the connection relationship between tasks, and the feature matrix (denoted as X) can be used to represent the characteristics of each task (such as computational load, communication load, and computational preference).

[0182] By combining the two matrices, a structured representation of the graph can be effectively achieved, enabling each task node in the graph neural network to obtain information from its neighboring nodes and gradually learn the deep representation of the task node through multi-layer processing.

[0183] In some embodiments, the step of identifying the task heterogeneous graph using a task heterogeneous graph network to obtain the first feature includes:

[0184] The graph neural network is used to propagate features of the heterogeneous task graph, update the features of each task node in the heterogeneous task graph layer by layer, and introduce the dependencies between tasks into the features of the task nodes to obtain the updated feature vector of the task nodes.

[0185] Aggregate and update the feature vectors of all the task nodes;

[0186] Determine the local contribution of each task node; the local contribution is determined based on at least one of the degree centrality, proximity centrality, and betweenness centrality of the task node.

[0187] Based on the dependencies between task nodes, the feature vectors of all task nodes are sorted according to their local contribution.

[0188] The feature vectors of all sorted task nodes are input into a Long Short-Term Memory (LSTM) network, and the first feature of the task heterogeneous graph is obtained based on the LSTM.

[0189] Here, the temporal dependencies between tasks and the impact of the critical path on the overall execution time are considered. For example, if task V1→V2→V5→V7 constitutes the critical path, but V2 is assigned to a low-performance CPU, it will cause subsequent tasks to be collectively delayed. This application proposes a task heterogeneous graph, quantifies the influence of nodes through a centrality index, and designs an LSTM network to extract temporal dependency features, prioritizing the allocation of high-performance devices to critical path tasks, which can significantly shorten the overall task completion time (by 15%-25%).

[0190] Specifically, the following example illustrates the process of constructing a task heterogeneity graph and extracting the first feature. The specific steps include:

[0191] Step 1: Construct the feature matrix X: for each task node Construct a vector of its computational features. The vector can include one-hot encoding of computational cost, communication cost, and computational preference. If there are n tasks, then the feature matrix X is a... The matrix is ​​given by n and m, where n and m represent the quantity, m is the dimension of the feature of each task node, and m represents the feature length of the task's computational cost, communication cost, and computational preference.

[0192] Step 2: Construct the adjacency matrix A: For each pair of task nodes with a dependency relationship, for the dependency relationship... Set in adjacency matrix A If there is no dependency, 0. Because a directed graph is constructed, A is not symmetric.

[0193] Step 3: Calculate the degree matrix D: For each task node Calculate its degree based on the adjacency matrix A. (i.e., from the task node) The number of edges pointing to other tasks is calculated, and a degree matrix D is constructed on the diagonal based on the calculated degree.

[0194] Step 4: Calculate the normalized adjacency matrix Normalize the adjacency matrix A using the degree matrix D to obtain: , where I is the identity matrix.

[0195] Step 5, Feature Propagation: Based on the normalized adjacency matrix The task node features are updated using a graph neural network (specifically, a graph convolutional layer) according to the following formula:

[0196]

[0197] Wherein, the first layer H is denoted as , This is the normalized adjacency matrix. Let be the weight matrix of the l-th layer. It is an activation function, such as ReLU.

[0198] Step 6, Recursive Feature Propagation: For l=1,2,…,L, repeatedly apply the feature propagation step (i.e., step 5) to learn deeper node features and obtain the feature propagation result of the i-th task node. L represents the total number of layers. After feature propagation, the connections between task nodes remain unchanged, but the features of each task node are updated.

[0199] Step 7: Aggregate the features of all task nodes to obtain the temporally joint graph features; here, an output function R is defined to aggregate the feature vectors of all task nodes and obtain the representation of the entire task heterogeneous graph: Where R is the temporally coupled graph feature output function.

[0200] Step 8: Determine the local contribution of each task node; the local contribution can be defined as its importance in the graph structure and connectivity, and is usually related to the centrality of the nodes in the graph. For example, the "centrality" metric can be used to reflect the importance of a node in the entire network.

[0201] Specifically, the local contribution of each node is determined, including:

[0202] Compute task node V i Degree centrality : ;

[0203] Degree centrality represents the number of direct neighbor nodes of a task node. For task nodes The corresponding feature vector; It is a task node The total number of neighboring nodes, This represents the total number of task nodes.

[0204] Compute task node V i proximity centrality : ;

[0205] Closeness centrality measures the average distance from a task node to all other task nodes in the graph. It is a task node eigenvectors To the task node eigenvectors The shortest path length.

[0206] Compute node V i betweenness centrality :

[0207] Betweenness centrality represents the frequency with which a task node appears on the shortest path between all pairs of task nodes. It is a task node To the task node The number of all shortest paths, It is through the task node The number of paths.

[0208] The local contribution index is determined based on at least one of degree centrality, proximity centrality, and betweenness centrality. The determination method may be to select one based on graph characteristics, or to take the median value of degree centrality, proximity centrality, and betweenness centrality, etc.

[0209] Step 9: Sort the feature vectors of each task node according to their local contribution to further mine graph logical connection information.

[0210] The sorting method can employ a temporal dependency sorting approach to identify the temporal dependencies of each task node (this may require pre-timestamping each node or defining the node order according to specific rules). Since V1 is the entry node, the access order of each node is determined starting from V1 and following the directed edges. The specific process is as follows:

[0211] 1) Establish a dependency list: For each task node V i Create a dependency list D i This list includes all direct references to V. i The node (i.e., V) i (direct predecessor node).

[0212] 2) Determine the temporal hierarchy of each task node: Starting from the entry node (e.g., V1), determine the temporal hierarchy of each node, i.e., which nodes must be completed before the computation of the current node can begin. The entry node has the lowest temporal hierarchy, usually 0.

[0213] 3) Use breadth-first search (BFS) to traverse the graph and update the temporal hierarchy of each task node.

[0214] 4) Collect peer nodes: Some task nodes are in the same time sequence level. All task nodes in the same time sequence level can be regarded as peer nodes. Collect each peer node to form a peer node set.

[0215] 5) Output a set of peer nodes: For each time series level, output a set of nodes, and the task nodes in these sets are peer nodes.

[0216] 6) Calculate the centrality metric: Calculate the centrality metric for each task node in the graph. For example, betweenness centrality can be chosen. This serves as the basis for sorting, so as to better reflect the influence of nodes in the entire graph.

[0217] 7) Sort peer nodes: For each group of peer task nodes, sort them according to the centrality index of each task node, and put the node with higher centrality first.

[0218] 8) Generate a sorted sequence: Nodes sorted by time dependency and peer nodes sorted by centrality are combined into a complete sorted sequence.

[0219] This sorted sequence will be input into a feature encoding network for sequence feature encoding. The sequence feature encoding consists of... ,in, Q represents the Q task nodes in the sorted sequence (the actual number is the same as the number of tasks), and ins represents the feature encoding.

[0220] Step 10, Sequence Feature Encoding: The sorted sequence of task nodes is input into the sequence feature encoding network (specifically, a Long Short-Term Memory network (LSTM)) to extract graph features from the entry point V1 to the exit point V7.

[0221] For example, BiLSTM (Bidirectional Long Short-Term Memory Neural Network) can be used to extract dependency features from all sorted nodes. The formula is as follows:

[0222] ,

[0223] The left and right arrows represent the directions of LSTM encoding, i.e., the forward and reverse encoding of node dependency features. This represents the output of the q-th unit in the BiLSTM. Different arrow directions indicate forward and backward feature aggregation according to the node sorting order, resulting in BiLSTM encoded outputs in different directions. Similarly, This represents the output of the (q-1)th unit in the BiLSTM, which is also the output of the previous node state.

[0224] Assume the sorted sequence dependency features have Q steps. This represents the feature of the q-th node in the T-th layer of the graph neural network. Following the order and reverse order of the generated sorted sequence information, these features are sequentially input into their corresponding BiLSTM networks, ultimately yielding the BiLSTM encodings of all task nodes, as shown in the following formula: .

[0225] In some embodiments, the information recorded in the computing device status and / or the device status heterogeneity graph includes at least one of the following: the status of all computing nodes in the heterogeneous computing system, and the connection relationships and communication rates between computing nodes.

[0226] Here, the nodes in the device state heterogeneity graph represent computing nodes (denoted as...). The state of each computing node can be represented as a vector, which contains the state information of the computing node, such as CPU utilization and memory usage.

[0227] In some embodiments, the device state heterogeneity graph includes: an adjacency matrix and a feature matrix;

[0228] Based on the computing device status of the heterogeneous computing system, construct a device status heterogeneity diagram, including:

[0229] Based on the computing device status of the heterogeneous computing system, a feature matrix and an adjacency matrix are constructed. The feature matrix is ​​used to characterize the state characteristics of each computing node; the adjacency matrix is ​​used to characterize the connection relationship and / or communication rate between computing nodes.

[0230] Calculate the degree of each computing node based on the adjacency matrix, and determine the degree matrix based on the degree of each computing node;

[0231] The adjacency matrix is ​​normalized using the degree matrix to obtain the processed adjacency matrix.

[0232] Here, each edge in the device state heterogeneous graph This indicates a connection between two computing nodes, and the communication rate can be represented by weights. To indicate;

[0233] An adjacency matrix (denoted as A) can be used to represent the connections between all computing nodes using an N×N matrix, where N is the number of computing nodes. If the computing nodes... and computing nodes If there is direct communication between them, then ,otherwise, .

[0234] The state vectors of each computing node can be set into a feature matrix (denoted as X), where each row corresponds to the state vector of a computing node.

[0235] like Figure 3 As shown, a schematic diagram of a device state heterogeneity diagram is provided, such as... Figure 3 As shown, the device state heterogeneity graph is used to record the real-time status of different computing devices (also called computing nodes). The status includes each computing device (e.g., P1, P2, P3, P4) and the connection relationships between computing devices (e.g., b1, b2, ... b11). Each computing node contains the status information of that computing device (e.g., M1, M2, M3, M4), such as CPU utilization and memory usage. The device state heterogeneity graph represents the current computing load and resource utilization, as well as the optimization of task scheduling and resource allocation.

[0236] In some embodiments, the device state heterogeneity graph is identified using a device state heterogeneity graph network to obtain the second feature, including:

[0237] The device state heterogeneous graph is subjected to feature aggregation at least one layer using graph convolutional networks (GCNs) to obtain the feature aggregation results for each layer.

[0238] Based on the feature aggregation results of each layer, calculate the average value of the feature vector of each computing node;

[0239] The average value of the feature vectors of each computing node is aggregated to obtain the second feature of the device state heterogeneity graph.

[0240] This involves using graph neural networks to aggregate features at each layer, including:

[0241] Based on the feature matrix and the adjacency matrix, the feature vectors of all neighboring nodes are aggregated to obtain the feature vector of each computing node; feature transformation and nonlinear activation are performed on the feature vector of each computing node to obtain the processed feature vector of each computing node.

[0242] Here, a graph neural network is used in both the task heterogeneous graph network and the device state heterogeneous graph network. The structure, design, and training of the two graph neural networks can be the same or different. They can be used for feature propagation or feature aggregation. There is no restriction on the specific graph neural network used.

[0243] Here, considering that traditional methods rely on static task partitioning rules, they cannot perceive the real-time status of processors (such as CPUs, GPUs, and FPGAs) (e.g., memory usage, load fluctuations, and interconnect bandwidth changes). For example, when the GPU load suddenly increases to 90%, the static strategy still allocates tasks according to the preset rules, leading to resource contention and latency. This application constructs a heterogeneous device state graph, updates the node state every 5 seconds, and combines it with a graph convolutional network (GCN) to dynamically aggregate global resource features, capturing device changes in real time. This enables task allocation to accurately match the current resource state, greatly improving resource utilization (approximately 30%-50%).

[0244] Specifically, the device state heterogeneity diagram can be represented as: G = (V, E, A, X).

[0245] Where V represents the set of computing nodes, corresponding to each computing node in the graph. , E is the set of edges, corresponding to each edge in the graph. , This represents the directed edges from the source computation node to the target computation node and their corresponding weights. As the source node, For the destination node, The values ​​represent weights. A is the adjacency matrix, which defines the connections between computing nodes and their communication rates. X is the feature matrix, where each row corresponds to the state vector of a computing node.

[0246] Furthermore, a degree matrix D is defined to represent the connectivity of each computation node. The degree matrix D is a diagonal matrix whose diagonal elements are... It is a computing node The sum of the out-degrees, i.e. .

[0247] Normalization is performed based on the degree matrix: When processing directed graphs, the in-degree matrix D is calculated, and the adjacency moments are normalized using the degree matrix. This array helps maintain a balance in the total amount of information during transmission.

[0248] The following section provides a detailed explanation of extracting the second feature using a device state heterogeneity graph. This may include:

[0249] 1) Aggregate neighbor information: For each computing node Graph Neural Networks (GCNs) aggregate the feature vectors of all their neighboring nodes. This is typically achieved by weighting the feature vectors of the neighboring nodes, with the weights determined by the edge weights. For computation nodes... Its updated feature vector It can be calculated as:

[0250]

[0251] in, It is a non-linear activation function. It is a learnable weight matrix. It is a computing node The degree, It is a computing node and The connection weight between them can be 0 (if there is no connection) or the communication rate.

[0252] 2) Feature transformation: The feature vectors of the computed nodes may be further processed through a linear transformation, usually by multiplying them by a learnable weight matrix.

[0253] 3) Nonlinear activation: After feature transformation, nonlinear activation functions can be applied to increase the expressive power of the model. Common activation functions include ReLU, tanh, etc.

[0254] 4) Hierarchical processing: In actual GCN models, the above process can be performed in multiple layers, with each layer capturing different feature abstractions and complex relationships between computation nodes.

[0255] 5) Use a global average aggregation method to achieve global aggregation of device status diagram features:

[0256] Calculate the average of the feature vectors of all computation nodes, if If the output feature of the i-th compute node in the last layer of the GCN is the second feature of the device state heterogeneity graph. It could be:

[0257] .

[0258] By extracting features from both the device state heterogeneity graph and the task heterogeneity graph, this application extracts feature vectors from these graphs. The device state heterogeneity graph includes features such as CPU load, memory usage, and communication rate, while the task heterogeneity graph includes features such as dependencies between tasks and resource requirements of tasks. These features are then concatenated. This is called a system characteristic, denoted as .

[0259] The task heterogeneous graph network and device state heterogeneous graph network can be pre-trained, and there are no restrictions on their training methods; feature extraction is sufficient.

[0260] By constructing a dual-graph joint model of task heterogeneous graph and device state heterogeneous graph, feature extraction of the above device state heterogeneous graph and task heterogeneous graph is realized. Based on the combination of the two features, dynamic matching of tasks and resources and global state awareness are realized.

[0261] The task heterogeneous graph characterizes the topology of a distributed task flow in the form of a directed graph. Nodes represent the computational cost, communication cost, and hardware preferences of a task, while edges define the dependencies between tasks. By using temporal hierarchical partitioning and node centrality ordering (such as betweenness centrality), combined with graph convolutional networks and bidirectional long short-term memory networks, the spatiotemporal dependency features of the task flow are extracted. For example, critical path tasks are prioritized through backpropagation encoding using BiLSTM, enhancing their impact on the global scheduling strategy.

[0262] The heterogeneous graph of device status dynamically records the real-time status of the distributed server cluster. Nodes represent the remaining memory, load rate, and hardware type of computing units (CPU / GPU / FPGA), and edge weights correspond to the communication bandwidth between nodes. Through the hierarchical graph attention mechanism, the resource status of multi-hop neighbor nodes is aggregated to capture the collaborative potential across devices (such as the adaptation of communication-intensive tasks on high-bandwidth link devices).

[0263] Dual-graph features generate joint representations through cross-modal concatenation (e.g., task feature vector ⊕ device feature vector), providing high-dimensional state inputs for reinforcement learning strategies and solving the problem of task and resource feature separation in traditional methods.

[0264] Thus, in this embodiment, the optimization of task allocation not only considers traditional task characteristics (such as computational and communication loads) but also introduces heterogeneous graph networks (task heterogeneous graph networks, device state heterogeneous graph networks) to obtain in-depth state information. Furthermore, an Entropic Potential Field-based Scheduling Policy (EPFSP) based on physics and information theory is provided. This policy finds the optimal decision by calculating the "potential energy" of each possible scheduling action and adaptively optimizes the policy through a meta-reinforcement learning framework. Compared to traditional black-box neural networks that directly output decisions and cannot interpret process parameters, whose content has no obvious meaning, this disclosure uses various potential energies to evaluate scheduling actions, and the meta-learning agent is only used to determine the weights in the policy.

[0265] Figure 4 This is a schematic diagram of the structure of a task scheduling device provided in an embodiment of this application; as shown below. Figure 4 As shown, the device includes:

[0266] The first processing module is used to obtain the computing task status and computing device status required to be processed by the heterogeneous computing system. The number of computing tasks corresponding to the computing task status is at least one, and the number of computing devices corresponding to the computing device status is at least one.

[0267] The second processing module is configured to determine at least one scheduling action for each computing task in a schedulable state, based on the computing task state and computing device state; the scheduling action represents allocating the computing task to the corresponding computing device.

[0268] The third processing module is used to determine the scheduling potential energy of each scheduling action corresponding to each computing task; the scheduling potential energy is related to at least one of the attraction potential energy, execution cost potential energy, and system field effect potential energy.

[0269] The fourth processing module is used to select the scheduling action with the lowest scheduling potential energy for each computing task as the target scheduling action for the computing task.

[0270] The fifth processing module is used to determine the task allocation strategy based on the target scheduling action corresponding to each computing task.

[0271] It is understood that the task scheduling device provided in the above embodiments, when implementing the corresponding task scheduling method, can allocate the above processing to different program modules as needed to complete all or part of the processing described above. Furthermore, the device and the corresponding method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0272] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform a task scheduling method.

[0273] This application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored and when executed by a processor, they will cause the processor to execute the task scheduling method provided in this application.

[0274] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0275] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0276] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0277] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0278] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application; as shown below. Figure 5As shown, the electronic device 50 includes: a processor 501, and a memory 502 communicatively connected to the processor 501; the memory 502 stores instructions executable by the processor 501. The instructions are executed by the processor 501 to enable the processor 501 to perform:

[0279] The first processing module is used to obtain the computing task status and computing device status required to be processed by the heterogeneous computing system. The number of computing tasks corresponding to the computing task status is at least one, and the number of computing devices corresponding to the computing device status is at least one.

[0280] The second processing module is configured to determine at least one scheduling action for each computing task in a schedulable state, based on the computing task state and computing device state; the scheduling action represents allocating the computing task to the corresponding computing device.

[0281] The third processing module is used to determine the scheduling potential energy of each scheduling action corresponding to each computing task; the scheduling potential energy is related to at least one of the attraction potential energy, execution cost potential energy, and system field effect potential energy.

[0282] The fourth processing module is used to select the scheduling action with the lowest scheduling potential energy for each computing task as the target scheduling action for the computing task.

[0283] The fifth processing module is used to determine the task allocation strategy based on the target scheduling action corresponding to each computing task.

[0284] The electronic devices and corresponding task scheduling methods provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0285] In practical applications, the electronic device 50 may further include at least one network interface 503. The various components of the electronic device 50 are coupled together via a bus system 504. It is understood that the bus system 504 is used to implement communication between these components. In addition to a data bus, the bus system 504 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 5 All buses are labeled as bus system 504. The number of processors 501 and the number of memories 502 can be at least one. The network interface 503 is used for wired or wireless communication between the electronic device 50 and other devices.

[0286] The memory 502 in this embodiment is used to store various types of data to support the operation of the electronic device 50.

[0287] The methods disclosed in the embodiments of this application can be applied to or implemented by processor 501. Processor 501 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 501 or by instructions in software form. The processor 501 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 501 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory 502. Processor 501 reads the information in memory 502 and, in conjunction with its hardware, completes the steps of the aforementioned task scheduling method.

[0288] In some embodiments, the electronic device 50 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned methods.

[0289] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.

[0290] In the above description, the term "some embodiments" refers to a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0291] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this application is for the purpose of describing embodiments of this application only and is not intended to be limiting of this application.

[0292] It should be understood that in the various embodiments of this application, the sequence number of each implementation process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0293] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0294] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A task scheduling method, characterized in that, The method includes: Obtain the computing task status and computing device status required by the heterogeneous computing system, wherein the number of computing tasks corresponding to the computing task status is at least one, and the number of computing devices corresponding to the computing device status is at least one. Based on the computing task status and computing device status, for each computing task in the schedulable state, at least one scheduling action is determined for each computing task; the scheduling action represents allocating the computing task to the corresponding computing device. Determine the scheduling potential energy for each scheduling action corresponding to each computational task; the scheduling potential energy is related to at least one of the attraction potential energy, execution cost potential energy, and system field effect potential energy; For each computing task, the scheduling action with the lowest scheduling potential is selected as the target scheduling action for the computing task. The task allocation strategy is determined based on the target scheduling action corresponding to each computing task; The determination of the scheduling potential energy for each scheduling action corresponding to each computational task includes: Based on the computing task status and computing device status, determine the attraction potential energy, execution cost potential energy, and system field effect potential energy; Based on the first characteristic of the computing task state and the second characteristic of the computing device state, determine the first weight corresponding to the attraction potential energy, the second weight corresponding to the execution cost potential energy, and the third weight corresponding to the system field effect potential energy; The scheduling potential is determined based on the attraction potential energy, the execution cost potential energy, the system field effect potential energy, and the first weight corresponding to the attraction potential energy, the second weight corresponding to the execution cost potential energy, and the third weight corresponding to the system field effect potential energy. Determining the attractive potential energy based on the computational task status and the computing device status includes: Based on the computing task status, determine the computational load of the computing task and the computing task's preference for computing devices; The computational affinity of the computational task to the computing device is determined based on the computational task's preference for the computing device. The attractive potential energy is determined based on the computational load of the computational task and the computational affinity of the computational task to the computing device. Based on the computing task status and computing device status, the execution cost potential is determined, including: Based on the computing task status and the computing device status, the following information is determined: the computational load of the computing task, all direct parent tasks of the computing task and the amount of data that each parent task needs to transmit to the computing task, the current effective computing capacity of the computing device involved in the scheduling action, and the available communication bandwidth between the computing device to which the parent task has been scheduled and the computing device involved in the scheduling action. Based on the determined information, the execution cost potential energy is determined; Based on the computational task status and the computing device status, the system field effect potential energy is determined, including: Based on the computing task status and the computing device status, determine the current load of the computing devices involved in the scheduling action, and the vector of the expected new load of all computing devices in the heterogeneous computing system after the scheduling action is executed; After normalizing the vector of the new load, a probability distribution is obtained, and the information entropy of the probability distribution is determined; the fourth weight corresponding to the information entropy and the fifth weight corresponding to the load are determined. The system field effect potential energy is determined based on the fourth weight, the fifth weight, the information entropy, and the current load of the computing device involved in the scheduling action.

2. The method according to claim 1, characterized in that, Based on the computing task state and computing device state, for each computing task in a schedulable state, at least one scheduling action is determined for each computing task, including: Based on the computing task status, each computing task in the schedulable state is determined sequentially; wherein, if there are multiple computing tasks, there are dependencies between computing tasks, and being in the schedulable state indicates that the computing tasks have met the dependency conditions. For each computing task in a schedulable state, at least one scheduling action is determined for the computing task, the scheduling action representing the allocation of the computing task that has met the dependency conditions to a computing device that can meet the processing requirements of the computing task.

3. The method according to claim 1, characterized in that, The method further includes: Based on the computing task status required to be processed by the heterogeneous computing system, a task heterogeneity graph is constructed; the task heterogeneity graph is used to record the task information required to be processed by the heterogeneous computing system; the heterogeneous computing system includes various types of computing devices. Based on the computing device status of the heterogeneous computing system, a device status heterogeneity diagram is constructed; the computing device status heterogeneity diagram is used to record the real-time status of different computing devices in the heterogeneous computing system. Extract the first feature of the task heterogeneity graph and the second feature of the device state heterogeneity graph.

4. The method according to claim 1, characterized in that, The step of determining the first weight corresponding to the attractive potential energy, the second weight corresponding to the execution cost potential energy, and the third weight corresponding to the system field effect potential energy based on the first characteristic of the computing task state and the second characteristic of the computing device state includes: Based on the first feature and the second feature, determine the global feature; The global features are input into the meta-learning agent, and the meta-learning agent is used to identify the global features to obtain a weight vector; the weight vector includes: the first weight, the second weight, and the third weight.

5. The method according to claim 1, characterized in that, Determining the fourth weight corresponding to the information entropy and the fifth weight corresponding to the load includes: Based on the first feature and the second feature, determine the global feature; The global features are input into the meta-learning agent, and the meta-learning agent is used to identify the global features to obtain a weight vector; the weight vector includes: a fourth weight and a fifth weight.

6. The method according to claim 1, characterized in that, Based on the target scheduling action corresponding to each computing task, a task allocation strategy is determined, including: The target scheduling actions corresponding to each computing task are combined to determine the task allocation strategy.

7. The method according to claim 3, characterized in that, Extracting the first feature of the task heterogeneity graph and the second feature of the device state heterogeneity graph includes: The first feature is obtained by identifying the task heterogeneous graph using a task heterogeneous graph network. The second feature is obtained by identifying the device state heterogeneity graph using a device state heterogeneity graph network.

8. The method according to claim 3, characterized in that, The task heterogeneous graph includes: a feature matrix and an adjacency matrix; The step of constructing a task heterogeneity graph based on the computing task states required by the heterogeneous computing system includes: Based on the task information to be processed by the heterogeneous computing system, a feature matrix and an adjacency matrix are constructed. The feature matrix is ​​used to characterize the computational characteristics of each task node; the adjacency matrix is ​​used to characterize the dependencies between task nodes. Calculate the degree of each task node based on the adjacency matrix, and determine the degree matrix based on the degree of each task node; The adjacency matrix is ​​normalized using the degree matrix to obtain the processed adjacency matrix.

9. The method according to claim 7, characterized in that, The step of using a task heterogeneous graph network to identify the task heterogeneous graph and obtain the first feature includes: The graph neural network is used to propagate features of the heterogeneous task graph, update the features of each task node in the heterogeneous task graph layer by layer, and introduce the dependencies between tasks into the features of the task nodes to obtain the updated feature vector of the task nodes. Aggregate and update the feature vectors of all the task nodes; Determine the local contribution of each task node; the local contribution is determined based on at least one of the degree centrality, proximity centrality, and betweenness centrality of the task node. Based on the dependencies between task nodes, the feature vectors of all task nodes are sorted according to their local contribution. The feature vectors of all sorted task nodes are input into a Long Short-Term Memory (LSTM) network, and the first feature of the task heterogeneous graph is obtained based on the LSTM.

10. The method according to claim 3, characterized in that, The device state heterogeneity graph includes: an adjacency matrix and a feature matrix; Based on the computing device status of the heterogeneous computing system, construct a device status heterogeneity diagram, including: Based on the state of computing devices in a heterogeneous computing system, a feature matrix and an adjacency matrix are constructed. The feature matrix is ​​used to characterize the state characteristics of each computing device; the adjacency matrix is ​​used to characterize the connection relationships and / or communication rates between computing devices. Calculate the degree of each computing device based on the adjacency matrix, and determine the degree matrix based on the degree of each computing device; The adjacency matrix is ​​normalized using the degree matrix to obtain the processed adjacency matrix.

11. The method according to claim 7, characterized in that, The second feature is obtained by identifying the device state heterogeneity graph using a device state heterogeneity graph network, including: The device state heterogeneous graph is subjected to feature aggregation at least one layer using a graph neural network to obtain the feature aggregation result of each layer. Based on the feature aggregation results of each layer, calculate the average value of the feature vector for each computing device; The average value of the feature vectors of each computing device is aggregated to obtain the second feature of the device state heterogeneity graph.

12. The method according to claim 1 or 3, characterized in that, The information recorded in the computation task state and / or task heterogeneity graph includes at least one of the following: The set of computing tasks, the task execution dependencies between computing tasks, the set of computing workloads of computing tasks, the set of communication workloads of computing tasks, the set of computing preferences of computing tasks, the set of all computing devices in the heterogeneous computing system, the current remaining memory of the heterogeneous computing system, and the current interconnect bandwidth of all computing devices in the heterogeneous computing system.

13. The method according to claim 1 or 3, characterized in that, The information recorded in the computing device status and / or device status heterogeneity diagram includes at least one of the following: the status of all computing devices in the heterogeneous computing system, and the connection relationships and communication rates between the computing devices.

14. A task scheduling device, characterized in that, The device includes: The first processing module is used to obtain the status of computing tasks and computing devices that need to be processed by the heterogeneous computing system, wherein the number of computing tasks is at least one and the number of computing devices is at least one. The second processing module is configured to determine at least one scheduling action for each computing task in a schedulable state, based on the computing task state and computing device state; the scheduling action represents allocating the computing task to the corresponding computing device. The third processing module is used to determine the scheduling potential energy of each scheduling action corresponding to each computing task; the scheduling potential energy is related to at least one of the attraction potential energy, execution cost potential energy, and system field effect potential energy. The fourth processing module is used to select the scheduling action with the lowest scheduling potential energy for each computing task as the target scheduling action for the computing task. The fifth processing module is used to determine the task allocation strategy based on the target scheduling action corresponding to each computing task; The determination of the scheduling potential energy for each scheduling action corresponding to each computational task includes: Based on the computing task status and computing device status, determine the attraction potential energy, execution cost potential energy, and system field effect potential energy; Based on the first characteristic of the computing task state and the second characteristic of the computing device state, determine the first weight corresponding to the attraction potential energy, the second weight corresponding to the execution cost potential energy, and the third weight corresponding to the system field effect potential energy; The scheduling potential is determined based on the attraction potential energy, the execution cost potential energy, the system field effect potential energy, and the first weight corresponding to the attraction potential energy, the second weight corresponding to the execution cost potential energy, and the third weight corresponding to the system field effect potential energy. Determining the attractive potential energy based on the computational task status and the computing device status includes: Based on the computing task status, determine the computational load of the computing task and the computing task's preference for computing devices; The computational affinity of the computational task to the computing device is determined based on the computational task's preference for the computing device. The attractive potential energy is determined based on the computational load of the computational task and the computational affinity of the computational task to the computing device. Based on the computing task status and computing device status, the execution cost potential is determined, including: Based on the computing task status and the computing device status, the following information is determined: the computational load of the computing task, all direct parent tasks of the computing task and the amount of data that each parent task needs to transmit to the computing task, the current effective computing capacity of the computing device involved in the scheduling action, and the available communication bandwidth between the computing device to which the parent task has been scheduled and the computing device involved in the scheduling action. Based on the determined information, the execution cost potential energy is determined; Based on the computational task status and the computing device status, the system field effect potential energy is determined, including: Based on the computing task status and the computing device status, determine the current load of the computing devices involved in the scheduling action, and the vector of the expected new load of all computing devices in the heterogeneous computing system after the scheduling action is executed; After normalizing the vector of the new load, a probability distribution is obtained, and the information entropy of the probability distribution is determined; the fourth weight corresponding to the information entropy and the fifth weight corresponding to the load are determined. The system field effect potential energy is determined based on the fourth weight, the fifth weight, the information entropy, and the current load of the computing device involved in the scheduling action.

15. An electronic device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 13.

16. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • DAG task scheduling method and device, equipment and storage medium

    CN114756358A

  • Heterogeneous computing platform task scheduling method based on graph neural network

    CN117850999A