GPU scheduling optimization method for task and node bidirectional modeling
By adopting a bidirectional modeling approach for tasks and nodes, the problem of low resource utilization in existing GPU scheduling strategies is solved, achieving fine-grained task and node matching, improving GPU resource utilization and scheduling accuracy, and supporting multi-tenant AI task scheduling.
Patent Information
- Application Number
- CN202511437635.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-09
- Publication Date
- 2026-01-23
AI Technical Summary
Existing GPU scheduling strategies lack detailed modeling of task characteristics and node heterogeneity, resulting in low resource utilization and scheduling decisions that lack precision and interpretability, making it difficult to meet the needs of high-performance computing tasks.
A bidirectional modeling approach for tasks and nodes is adopted. By constructing a multi-dimensional feature modeling system, tasks and nodes are abstractly expressed. Combined with multi-index weight fusion and hierarchical scheduling strategies, refined matching and allocation of tasks and nodes can be achieved.
It improves the utilization of GPU resources, optimizes scheduling accuracy and system interpretability, ensures that AI tasks are assigned to the most suitable GPU nodes, reduces fragmentation of video memory and computing power, and improves cluster throughput and stability.
Smart Images

Figure CN121387528A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a scheduling optimization method, in particular to a GPU scheduling optimization method based on bidirectional modeling of tasks and nodes, and belongs to the technical field of computing resource scheduling and management. BACKGROUND
[0002] In recent years, the new generation of information technology represented by artificial intelligence and deep learning has developed rapidly, having a profound impact on China's economic and social development, and is also having a profound impact on China's economic structure and social structure. With the rapid popularization and application of large language models such as DeepSeek and GPT-4, the complexity and scale of computing tasks have increased unprecedentedly, and traditional CPU computing mode has been difficult to meet the needs of these high-performance computing tasks. The graphics processing unit (GPU) has become the core computing device in the fields of artificial intelligence, big data analysis, and scientific computing due to its highly parallel architecture, excellent computing power, and efficient floating-point operation performance. According to the report of the International Data Corporation (IDC), the GPU server market is in a stage of rapid growth, and in the first half of 2024, GPU servers accounted for a dominant position in the Chinese acceleration server market, with a market size of 43 billion US dollars. However, this is accompanied by the high cost of GPU resources and the serious problem of low resource utilization, which has brought great economic pressure to cloud computing service providers, AI research institutions, and various enterprises.
[0003] Kubernetes, which is open-sourced by Google, has been widely concerned since its inception in 2014 and has become the standard solution in the container orchestration field. Due to its excellent scalability, automated deployment capabilities, and efficient resource management, Kubernetes is widely used in cloud computing and artificial intelligence fields. Kubernetes performs well in general resource scheduling, but its native GPU scheduling capabilities are still relatively primitive. The main performance is as follows: the task scheduling granularity is coarse, and there is a lack of perception ability for task differentiation needs and behavior; the heterogeneous computing power characteristics are not well perceived, making it difficult to fully reflect the actual situation of resources; the scheduling score and matching strategy are rough, and the node selection logic relies too much on resource idle rate, making it difficult to quantify the real adaptation degree of tasks and nodes.
[0004] In the face of the above challenges, industry and academia have carried out many explorations in GPU resource scheduling. For example, introducing scheduling optimization strategies based on node resource utilization, scheduling mechanisms that perceive the performance differences of heterogeneous resources, preemption scheduling methods based on task priority, and means such as resource partitioning to achieve multi-task coexistence, which to some extent improves resource utilization efficiency and scheduling flexibility. However, the existing research still has the following limitations: first, most strategies focus on static indicators such as resource request volume and node load, and lack detailed modeling and adaptation of task characteristics such as type, execution behavior, and delay sensitivity; second, although some methods attempt to introduce runtime sensing capabilities, they mostly rely on global complex strategies or centralized monitoring, which lacks real-time performance and practicality; third, the scheduling system lacks accurate quantitative means for task-node adaptation, and the scheduling decision is still driven by experience, making it difficult to achieve explainable optimization of resource matching.
[0005] Therefore, it is urgent to propose a GPU scheduling method based on comprehensive modeling of task characteristics and computing power characteristics, combining multi-index weight fusion and hierarchical scheduling strategy to improve scheduling accuracy, resource utilization, and system explainability. SUMMARY
[0006] The present application is aimed at the technical problems existing in the prior art, and provides a GPU scheduling optimization method based on bidirectional modeling of tasks and nodes, which aims to address the problems of insufficient understanding of task differentiation needs, low utilization rate of node heterogeneity, and low GPU utilization rate in existing scheduling strategies. This method constructs a multi-dimensional feature modeling system to abstractly represent the resource demand characteristics of computing tasks and the computing power ability characteristics of computing nodes; then, based on a multi-index comprehensive weighting mechanism, the matching relationship between tasks and nodes is evaluated, and factors such as task dependency structure and task urgency are integrated, and a hierarchical scheduling mechanism is used to perform fine allocation, thereby achieving efficient utilization of GPU resources and explainable optimization of scheduling results.
[0007] To achieve the above purpose, the technical scheme of the present application is as follows: a GPU scheduling optimization method based on bidirectional modeling of tasks and nodes, comprising the following steps:
[0008] Step 1, task modeling and classification,
[0009] Firstly, all tasks are divided into two categories: a strongly dependent task group with execution precedence constraints, and an independent task group (weakly dependent task) without explicit dependency relationship. Each task is represented by a multi-dimensional vector, and the vector dimensions cover its computing load, memory demand, data communication volume, delay sensitivity, and urgency key attributes, providing modeling basis for subsequent scheduling scoring;
[0010] Task modeling: for each task T to be scheduled i, extract its main feature parameters, and construct the original task feature vector:
[0011] Ti={WL i , MF i , DS i , UR i},
[0012] wherein WL i represents the computational load of the task, MF i represents the memory requirement of the task, DS i represents the data transmission required by the task, and UR i represents the task urgency
[0013] The task set is: T={T1,T2,...,T n}
[0014] Task classification: according to the dependency relationship between tasks, the tasks are divided into two categories, strong dependent task group with execution sequence constraint, and independent task group (weak dependent task) without explicit dependency relationship. And define the task dependency strength index:
[0015] DepScore i =α·CCR i +β·CPL i
[0016] Wherein, CCRi=Commi / Compi, represents the ratio of communication overhead to computational overhead of the task; CPLi represents the critical path length of the task in the dependency graph; α and β are weight coefficients, used to adjust the contribution of communication ratio and critical path length in dependency strength, the values are set by experience or combined with historical task data statistics.
[0017] Further, set the dependency strength threshold θ, used to distinguish strong dependent task and weak dependent task. When DepScore i >=θ, it is judged that the task is a strong dependent task and needs to be scheduled preferentially; when DepScore i <θ, it is judged that the task is a weak dependent task, which is suitable for optimal matching strategy for allocation. The threshold θ is a preset fixed value, which is dynamically adjusted based on the statistical characteristics of the task set and the experimental results in the experiment, so as to ensure the rationality and adaptability of the classification results.
[0018] Step 2, node feature modeling and scoring mechanism, as follows,
[0019] Node feature modeling: for each computing node N j , extract its main computing power and resource parameters, and construct the node feature vector:
[0020] Nj = {PP j , MC j , GC j , GM j , BW j}
[0021] wherein, PP j represents the processing power of the node, MC j represents the memory capacity of the node, GC j represents the number of GPU cores, GM j represents the GPU memory capacity, and BW j represents the communication bandwidth, which can be obtained through node monitoring, driver interface or cluster resource reporting;
[0022] Task-node scoring mechanism:
[0023] Process 1: Matching index design,
[0024] Task: Ti = {WL i , MF i , DS i , UR i}, Node: N j = {PP j , MC j , GC j , GM j , BW j},
[0025] For task Ti and node Nj, a unified evaluation index set of task and node is constructed, which is used to quantify the performance of the task on the node, and is divided into cost type and benefit type according to the characteristics of the index,
[0026] Task: Ti = {WL i , MF i , DS i , UR i}, wherein, WL i represents the computational load of the task, MF i represents the memory requirement of the task, DS i represents the data transmission required by the task, and UR i represents the task urgency,
[0027] Node: Nj = {PP j , MC j , GC j , GM j , BW j}, wherein, PP j represents the processing power of the node, MCj denotes the memory capacity of a node, GC j denotes the number of GPU cores, GM j denotes the memory capacity of a GPU, BW j denotes the communication bandwidth,
[0028] Detailed indicators include: (1) execution time indicators (cost type): where wait j is the current expected available time of a node, used to depict queue congestion, WL i denotes the computational load of a task, PP j denotes the processing capacity of a node.
[0029] (2) Memory / Video Memory Constraints: Feasij = 1 (MC j ≥ MF i ∧ GM j ≥ VM i ), where VM i is the GPU video memory requirement of a task, when Feasij = 0, the node is considered infeasible and does not enter the subsequent scoring,
[0030] (3) Transmission delay indicators (cost type):
[0031] (4) Parallelism matching degree (benefit type): used to depict the support of GPU parallelism to the computational density of a task, where κ is a scaling coefficient,
[0032] (5) Video memory matching degree (benefit type):
[0033] Uniform and normalized processing of indicators: convert cost type indicators into benefit type indicators, using inverse transformation:
[0034]
[0035] and eliminate infeasible combinations of Feasij = 0, then vector norm normalization is performed on each column to eliminate dimensional differences:
[0036]
[0037] Process two: weight calculation,
[0038] Subjective weight calculation: using AHP hierarchical analysis method, based on the paired comparison of the importance of each indicator by experts, a judgment matrix A = [a pq ] is constructed, which is the judgment matrix obtained by the experts' paired comparison of the importance of indicator p and indicator q, according to the characteristic vector method, the subjective weight w AHP is obtained, and consistency check is performed: The consistency is considered acceptable when CR < 0.1, and the result is
[0039] wherein CI is the consistency index,
[0040] RI is the random consistency index, which is obtained from a statistical table and is related to the size of n,
[0041] CR is the consistency ratio, and when CR < 0.1, the judgment matrix is considered to pass the consistency test,
[0042] λ max is the maximum eigenvalue of A, and the objective weight is calculated: based on the entropy weight method, the normalized matrix The proportion is calculated:
[0043] wherein, is the normalized value of the ith task on the jth node and the kth index,
[0044] is the proportion of the ith task on the jth node and the kth index,
[0045] wherein ε is a small constant to prevent the denominator from being zero,
[0046] and the entropy value and the difference degree are calculated:
[0047] and the objective weight is obtained:
[0048] wherein, E k is the information entropy of the kth index,
[0049] d k is the difference degree of the kth index,
[0050] is the entropy weight of the kth index, and the weight fusion: in order to consider the expert experience and the data objectivity, the weights are linearly fused: γ is selected as 0.5,
[0051] wherein, γ, is the balance coefficient of the subjective weight and the objective weight,
[0052] is the AHP subjective weight of the kth index,
[0053] is the entropy weight objective weight of the kth index.
[0054] The weighted standardized matrix is constructed: the weighted matrix is obtained according to the fusion weight:
[0055] Flow three: scoring mechanism,
[0056] Determination of ideal solution and negative ideal solution: determine the positive ideal solution and negative ideal solution for each index k:
[0057] Proximity calculation and node matching score:
[0058] Calculate the Euclidean distance of task Ti on node Nj relative to the ideal solution / negative ideal solution:
[0059]
[0060] And get the proximity score: Where the combination of Feasij=0 does not participate in scoring; or equivalently, set its Score ij to zero,
[0061] Where, is the weighted normalized value of the ith task on the jth node, the kth index;
[0062] is the positive ideal solution of the kth index;
[0063] is the negative ideal solution of the kth index;
[0064] is the distance of the ith task on the jth node relative to the positive ideal solution;
[0065] is the distance of the ith task on the jth node relative to the negative ideal solution;
[0066] Score ij is the matching score of the ith task on the jth node, ranging from [0, 1],
[0067] Feasij is the feasibility flag, which is 0 when the resource demand of task i exceeds the available resources of node j, indicating that the combination is not feasible,
[0068] Matching score function output and interface: summarize the matching degree of each task-node combination into a score matrix S={Score ij ∣i=1,…,n;j=1,…,m} This matrix is the basis for subsequent scheduling stages (for tasks with dependency constraints, preferentially select Score ij higher and meet the data arrival timing nodes; for independent or weakly dependent tasks, perform global optimal allocation combined with the score matrix.
[0069] Step 3, preferential scheduling of strongly dependent tasks,
[0070] For the task group with strong dependency, based on the topology of task dependency graph (DAG) and the constraint of critical path, an upward priority calculation model is constructed to reflect the urgency of the task in global scheduling. On this basis, combined with the urgency parameter of the task and the task-node scoring mechanism, a comprehensive scheduling score is formed to guide the priority allocation of key tasks.
[0071] The steps are as follows:
[0072] Strong dependency subset: In the task set T = {T1, T2,..., T n}, according to the "task dependency strength index", the strong dependency task subset is obtained. The tasks in this subset have clear execution constraints, usually determined by data transmission and control dependency between tasks. A directed acyclic graph (DAG) is constructed through task dependency relationship, where tasks are nodes and edge weights reflect the communication cost between tasks.
[0073] Task priority calculation: for each strong dependency task T i , its upward priority value rank (i) is calculated, the formula is as follows:
[0074]
[0075] Where, Comp i represents the execution overhead of the task under the average computing power; Comm i,j represents the communication overhead of the task under the average bandwidth; Succ(i) is the successor task set of task T i . This priority value is used to globally sort tasks to ensure that tasks on the critical path are given priority in scheduling.
[0076] Candidate node completion time calculation: for the sorted task T i , traverse all feasible nodes N j , calculate its earliest completion time on the node,
[0077] Where, RT i is the earliest readiness time of the task, which depends on the completion time of all predecessor tasks and data transmission delay; ETA j is the earliest available time of node N j ; WL i is the computing load of the task; PP j is the processing capacity of the node. The completion time is used to measure the performance difference of executing tasks on different nodes.
[0078] Time normalization: Different tasks have different completion times. To facilitate the fusion of scores, the completion time indicator is normalized to the interval [0, 1]:
[0079] where ∈ is a small constant to avoid zero denominator. The normalized NormEFT ij The larger the value is, the more conducive the node is to the rapid completion of the task.
[0080] Comprehensive score and scheduling decision: Based on the task-node matching score Score ij (calculated based on the scoring mechanism in step two) and the demand for urgent tasks, the comprehensive scheduling score is defined: λ1+λ2+λ3=1.
[0081] where λ1balances execution efficiency, and a larger value is conducive to reducing task delay; λ2balances matching accuracy, and a larger value is conducive to improving the matching degree of tasks and nodes. The task setting has considered UR, so λ3serves as an enhancement mechanism, keeping it at 0 in the regular scenario, and increasing its λ3weight when there are urgent tasks,
[0082] The node with the highest comprehensive score is finally selected as the execution node of the task, and the available time ETA j of the node is updated.
[0083] Step 4, optimal matching scheduling of weakly dependent tasks,
[0084] For the task subset divided into weakly dependent tasks, there is no explicit execution order constraint within it, and it can be allocated to different nodes in parallel under the premise of meeting resource constraints. To ensure overall resource utilization and scheduling efficiency, this problem is modeled as a task-node bipartite graph matching problem.
[0085] The steps are as follows:
[0086] Task-node bipartite graph construction: For the weakly dependent task subset and the node set, a bipartite graph is constructed
[0087]
[0088] where the left vertex set corresponds to tasks, the right vertex set corresponds to nodes, the edge set E represents the executable relationship of tasks on candidate nodes, and each edge is assigned a weight C ij , which is used to characterize the comprehensive adaptability of task T i on node N j .
[0089] Cost matrix construction: for weakly dependent task set and node set, construct the cost matrix of task-node combination:
[0090] C ij = eta * NormEFT ij + (1-eta) * Score ij
[0091] Wherein, NormEFT ij Indicates the normalized earliest finish time of task T i On node N j ; Score ij Indicates the matching degree score obtained based on the task-node scoring mechanism; eta is a balance parameter, used to adjust the importance of execution efficiency and matching degree.
[0092] Global optimal matching solution: based on the above cost matrix, adopt bipartite graph optimal matching solution:
[0093]
[0094] The constraint condition is: Wherein, x ij =1 indicates that task T i Is assigned to node N j , otherwise x ij =0.
[0095] Finally, the matching relationship of task-node is obtained, the global optimal allocation of weakly dependent tasks is realized, and the balance between execution efficiency and resource utilization is achieved.
[0096] An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the task and node bidirectional modeling GPU scheduling optimization method when executing the program.
[0097] A computer readable storage medium having computer instructions stored thereon, wherein the computer instructions are executed by a processor to implement the task and node bidirectional modeling GPU scheduling optimization method.
[0098] Compared with the prior art, the application has the following advantages: the task and node bidirectional modeling GPU scheduling optimization method proposed in the application is superior to the existing scheduling strategy in terms of task modeling depth, node scoring mechanism, scheduling strategy rationality and resource utilization efficiency, and has the following advantages and beneficial technical effects: 1. improve the scheduling accuracy of AI tasks, avoid the coarse-grained allocation of only memory or computing power in traditional scheduling, and ensure that AI training and inference tasks can be allocated to the most suitable GPU node,
[0099] 2Optimize dependency task execution, in the common DAG dependency scenario of deep learning tasks, priority is given to critical path tasks to reduce overall training delay,
[0100] 3Improve GPU resource utilization: through task-node bidirectional modeling, reduce the fragmentation problem of memory and computing power, reduce GPU idle waste,
[0101] 4Support real cluster application, use Kubernetes platform, can be used for multi-tenant AI task scheduling, improve cluster throughput and stability. BRIEF DESCRIPTION OF DRAWINGS
[0102] Figure 1 The overall flowchart of the application. DETAILED DESCRIPTION
[0103] In order to deepen the understanding of the application, the following detailed description of the embodiment is combined with the drawings.
[0104] Example 1: see Figure 1 A task and node bidirectional modeling GPU scheduling optimization method, the method comprises the following steps:
[0105] Step 1, task modeling and classification,
[0106] Firstly, all tasks are divided into two categories: a strong dependent task group with execution sequence constraint, and an independent task group (weak dependent task) without explicit dependency relationship, each task is represented by a multi-dimensional vector, the vector dimension covers its calculation load, memory demand, data communication volume, delay sensitivity, urgency key attribute, which provides modeling basis for subsequent scheduling score;
[0107] Task modeling: for each to-be-scheduled task T i , extract its main feature parameters to form the original task feature vector:
[0108] Ti={WL i , MF i , DS i , UR i},
[0109] Wherein, WL i represents the calculation load of the task, MF i represents the memory demand of the task, DS i represents the data transmission volume required by the task, UR i represents the task urgency
[0110] Then the task set is: T={T1,T2,...,T n}
[0111] Task classification: According to the dependency relationship between tasks, tasks are divided into two categories: strongly dependent task groups with execution constraints, and independent task groups (weakly dependent tasks) without explicit dependency relationships. And define the task dependency strength index:
[0112] DepScore i =α·CCR i +β·CPL i
[0113] Where CCRi = Commi / Compi, represents the ratio of communication overhead to computing overhead of the task; CPLi represents the critical path length of the task in the dependency graph; α and β are weight coefficients, used to adjust the contribution of communication ratio and critical path length in dependency strength, the value is set by experience or combined with historical task data statistics.
[0114] Further, set the dependency strength threshold θ, used to distinguish between strongly dependent tasks and weakly dependent tasks. When DepScore i > = θ, it is determined that the task is a strongly dependent task and needs to be scheduled first; when DepScore i < θ, it is determined that the task is a weakly dependent task, and is suitable for using the optimal matching strategy for allocation. The threshold θ is a preset fixed value, which is dynamically adjusted based on the statistical characteristics of the task set and the experimental results in the experiment, so as to ensure the rationality and adaptability of the classification results.
[0115] Step 2, node feature modeling and scoring mechanism,
[0116] A multi-dimensional resource capability vector of the node is constructed, including its core computing power, GPU memory, number of computing cores, communication bandwidth, etc. Then, a comprehensive weighting mechanism is introduced to normalize the node capability score, generating a node comprehensive performance index that can be referenced in the task scheduling stage, so as to realize a more reasonable matching strategy;
[0117] Node feature modeling: For each computing node N j , extract its main computing power and resource parameters to construct a node feature vector:
[0118] N j ={PP j ,MC j ,GC j ,GM j ,BW j}
[0119] Where PP j represents the processing power of the node, MC j represents the memory capacity of the node, GC j represents the number of GPU cores, GM jMemory capacity of GPU, BW j Communication bandwidth. These parameters can be obtained by node monitoring, driver interface or cluster resource reporting.
[0120] Task-node scoring mechanism:
[0121] Process 1: Matching index design
[0122] Task: Ti={WL i , MF i , DS i , UR i}, Node: N j ={PP j , MC j , GC j , GM j , BW j}
[0123] For task Ti and node Nj, construct the unified evaluation index set of task and node, used to quantify the "performance of the task on the node". According to the characteristics of the index, it is divided into cost type and benefit type.
[0124] Detailed indexes include: (1) Execution time index (cost type): Where wait j is the current expected available time of the node, which is used to describe queue congestion.
[0125] (2) Memory / video memory constraint: Feasij=1 (MC j ≥ MF i ∧ GM j ≥ VM i ), where VM i is the GPU memory requirement of the task (which can be obtained by task description or static analysis). When Feasij=0, the node is considered infeasible and does not enter the subsequent scoring.
[0126] (3) Transmission delay index (cost type):
[0127] (4) Parallelism matching degree (benefit type): used to describe the support of GPU parallelism to task computing density, where κ is the scaling coefficient.
[0128] (5) Video memory matching degree (benefit type):
[0129] Unified and normalized processing of indexes: convert cost type indexes to benefit type indexes, using inverse transformation:
[0130]
[0131] And eliminate the infeasible combinations of Feasij = 0. Then, vector norm normalization is done for each column to eliminate dimensional differences:
[0132]
[0133] Process two: weight calculation
[0134] Subjective weight calculation: using AHP hierarchical analysis method, based on the importance of each index of the expert pair comparison, construct the judgment matrix A = [a pq ], according to the characteristic vector method, subjective weight w AHP , and consistency check: When CR < 0.1, it is considered that the consistency is acceptable, and the subjective weight w Objective weight calculation: based on entropy weight method, the normalized matrix Calculate the proportion:
[0135] And calculate the entropy value and difference degree:
[0136] Further get the objective weight:
[0137] Weight fusion: in order to give consideration to the expert experience and data objectivity, the weight is linearly fused: γ is selected as 0.5.
[0138] Construct weighted standardized matrix: get the weighted matrix according to the fusion weight:
[0139] Process three: scoring mechanism
[0140] Determine the ideal solution and negative ideal solution: determine the positive ideal solution and negative ideal solution for each index k:
[0141] Proximity calculation and node matching score:
[0142] Calculate the Euclidean distance of task Ti on node Nj relative to the ideal solution / negative ideal solution:
[0143]
[0144] And get the proximity score: Among them, the combination of Feasij = 0 does not participate in scoring; or equivalently, set its Score ij Zero.
[0145] Matching score function output and interface: the matching degree of each task-node combination is summarized into a score matrix, S = {Score ij ∣i = 1, …, n; j = 1, …, m}, which is the input basis for the subsequent scheduling stage (selecting Score ij higher and meeting the data arrival timing for tasks with dependency constraints; for independent or weakly dependent tasks, perform global optimal allocation based on the score matrix.
[0146] Step 3, priority scheduling of strongly dependent tasks,
[0147] For task groups with strong dependency relationships, based on the topological structure and critical path constraints of the task dependency graph (DAG), an upward priority calculation model is constructed to reflect the urgency of tasks in global scheduling. On this basis, combined with the urgency parameter of the task and the task-node scoring mechanism, a comprehensive scheduling score is formed to guide the priority allocation of key tasks.
[0148] The steps are as follows:
[0149] Strongly dependent subset: In the task set T = {T1, T2, …, T n}, according to the "task dependency strength index", the strongly dependent task subset is obtained.
[0150] Task priority calculation: for each strongly dependent task T i , calculate its upward priority value rank (i) , the formula is as follows:
[0151]
[0152] where, Comp i represents the execution overhead of the task under the average computing power; Comm i,j represents the communication overhead of the task under the average bandwidth; Succ(i) is the successor task set of task T i . This priority value is used to globally sort tasks to ensure that tasks on the critical path are prioritized into scheduling.
[0153] Candidate node completion time calculation: for the sorted task T i , traverse all feasible nodes N j , calculate its earliest completion time on the node,
[0154] where RT i is the earliest finish time of a task, which depends on the finish time of all its predecessor tasks and the data transfer latency; ETA j is the earliest available time of node N j ; WL i is the computation load of a task; PP j is the processing power of a node. The finish time is used to measure the performance difference of executing a task on different nodes.
[0155] Finish time normalization: There is a difference in the finish time of different tasks. To facilitate the fusion of matching scores, the finish time indicator is normalized to the interval [0, 1]:
[0156] where ∈ is a small constant to avoid zero denominator. The normalized NormEFT ij is larger, indicating that the node is more conducive to the rapid completion of the task.
[0157] Comprehensive score and scheduling decision: Based on the task-node matching score Score ij (calculated based on the scoring mechanism in step two) and the demand for urgent tasks, the comprehensive scheduling score is defined as: λ1+λ2+λ3=1.
[0158] where λ1balances execution efficiency, and increasing its value is conducive to reducing task delay; λ2balances matching accuracy, and increasing its value is conducive to improving the matching degree of tasks and nodes. The UR has been considered in the previous task setting, so λ3serves as an enhancement mechanism, which remains 0 in the regular scenario, and increases its λ3weight when there is an urgent task,
[0159] The node with the highest comprehensive score is finally selected as the execution node of the task, and the available time ETA j of the node is updated.
[0160] Step 4, optimal matching scheduling of weakly dependent tasks,
[0161] For the task subset divided into weakly dependent tasks, there is no explicit execution order constraint within it, and it can be allocated to different nodes in parallel under the premise of meeting the resource constraints. To ensure overall resource utilization and scheduling efficiency, this problem is modeled as a task-node bipartite graph matching problem.
[0162] The steps are as follows:
[0163] Task-node bipartite graph construction: For the weakly dependent task subset and the node set, a bipartite graph is constructed
[0164]
[0165] wherein the left vertex set corresponds to tasks, the right vertex set corresponds to nodes, and the edge set E represents the executable relationship of tasks on candidate nodes, and each edge is assigned a value C ij , used to depict the comprehensive fitness of task T i on node N j .
[0166] Cost matrix construction: for the weakly dependent task set and the node set, a cost matrix of task-node combination is constructed:
[0167] C ij = η· NormEFT ij + (1-η)· Score ij
[0168] wherein NormEFT ij represents the normalized earliest completion time of task T i on node N j ; Score ij represents the fitness score obtained based on the task-node scoring mechanism; η is a balance parameter, used to adjust the importance of execution efficiency and matching degree.
[0169] Global optimal matching solution: based on the above cost matrix, a bipartite graph optimal matching solution is adopted:
[0170]
[0171] The constraint condition is: wherein x ij = 1 indicates that task T i is assigned to node N j , otherwise x ij = 0.
[0172] Finally, the matching relationship of task-node is obtained, realizing the global optimal allocation of weakly dependent tasks, so that the overall scheduling reaches a balance between execution efficiency and resource utilization.
[0173] It should be noted that the above embodiments are not used to limit the protection scope of the present application, and equivalent transformations or substitutions made on the basis of the above technical solutions all fall within the scope of protection of the claims of the present application.
Claims
1. A GPU scheduling optimization method based on bidirectional task and node modeling, characterized in that, The method includes the following steps: Step 1: Task modeling and classification. First, all tasks are divided into two categories: strongly dependent task groups with execution order constraints, and independent task groups with no explicit dependencies, i.e., weakly dependent tasks. Each task is represented by a multi-dimensional vector, and the vector dimension covers its key attributes such as computational load, memory requirements, data communication volume, latency sensitivity, and urgency, providing a modeling basis for subsequent scheduling and scoring. Step 2: Node feature modeling and scoring mechanism. A multi-dimensional resource capability vector for nodes is constructed, including dimensions such as core computing power, GPU memory, number of computing cores, communication bandwidth, and cost coefficient. Subsequently, a comprehensive weighting mechanism is introduced to normalize the node capability score and generate a comprehensive node performance index that can be referenced in the task scheduling stage, so as to achieve a more reasonable matching strategy. Step 3: Prioritize scheduling of strongly dependent tasks. For task groups with strong dependencies, a hierarchical scheduling priority model is constructed, considering the topological structure and critical path constraints between tasks. Based on the task hierarchy, a combined scoring mechanism of task urgency and node rating is introduced to achieve priority scheduling of critical tasks and shortest critical path, thereby improving overall scheduling efficiency and task completion time performance. Step 4: Optimal matching and scheduling of weakly dependent tasks. For independent task groups that do not have explicit dependencies, an adaptation score matrix between tasks and nodes is constructed, and the optimal matching between tasks and nodes is achieved by using a graph theory matching model.
2. The GPU scheduling optimization method for bidirectional task and node modeling according to claim 1, characterized in that, Step 1, Task Modeling and Classification, as follows: During the task modeling phase, each task is represented as a vector containing multidimensional attributes, including computational complexity, memory requirements, data volume, urgency, and topology. Based on whether there are dependencies between tasks, tasks are divided into two main categories: Strongly dependent tasks: There are explicit directed dependency edges, represented by a DAG graph; Weakly dependent tasks: These tasks are independent of each other and have no direct constraints on their execution order; After classification, different scheduling logics are used for processing.
3. The GPU scheduling optimization method for bidirectional task and node modeling according to claim 2, characterized in that, Step 3: Prioritize scheduling of strongly dependent tasks. Specifically, for groups of strongly dependent tasks, a hierarchical priority scheduling strategy is adopted. The main steps are as follows: The tasks in the DAG graph are divided into layers, with each layer representing a set of tasks that can be scheduled in parallel. Calculate the "critical path distance" for each task, which is the longest estimated completion time from the destination to the destination along the path it is on; By integrating task hierarchy weights, node scores, and estimated completion times, a scheduling priority is constructed. Tasks will be assigned to the nodes with the highest overall scores and available resources, according to scheduling priority. After allocation, the node availability status and task completion time are updated in real time to ensure the correct execution of dependency constraints and optimize the overall task completion time.
4. The GPU scheduling optimization method for bidirectional task and node modeling according to claim 3, characterized in that, Step 4: Optimal matching and scheduling of weakly dependent tasks, as detailed below. For tasks with weak dependencies, a scoring matrix is constructed between tasks and nodes, where each element represents the matching score between the task and the node. The scheduling process is as follows: For each task-node pair, a matching score is calculated, and the evaluation is based on the Euclidean distance and cosine similarity index between the task resource requirements and the node capability vector. After constructing the scoring matrix, a graph matching algorithm is used to solve for the optimal allocation scheme to maximize the overall matching score; If the rating matrix is not a square matrix, it can be expanded into a balanced matrix using virtual tasks or virtual nodes; After the task is assigned, update the node load information and report it to the next round of scheduling.
5. The GPU scheduling optimization method for bidirectional task and node modeling according to claim 1, characterized in that, Step 1, Task Modeling and Classification, as follows: Task modeling: For each task T to be scheduled i Extract its main feature parameters to construct the original task feature vector: Ti={WL i ,MF i ,DS i ,UR i }, Among them, WL i MF represents the computational load of the task. i DS represents the memory requirements of a task. i UR represents the amount of data transfer required for the task. i Indicates the urgency of the task. The task set is then: T = {T1, T2, ..., T} n } Task Classification: Based on the dependencies between tasks, tasks are divided into two categories: strongly dependent task groups with execution order constraints, and independent task groups without explicit dependencies. A task dependency strength index is defined as follows: DepScore i =a·CCR i +β·CPL i Where CCRi = Commi / Compi, representing the ratio of communication overhead to computational overhead of the task; CPLi represents the critical path length of the task in the dependency graph; α and β are weighting coefficients used to adjust the contribution of the communication ratio and critical path length to dependency strength, and their values are obtained through empirical settings or by combining historical task data statistics. Set a dependency strength threshold θ to distinguish between strongly dependent and weakly dependent tasks. When DepScore... i When DepScore >= θ, the task is determined to be a strongly dependent task and should be scheduled first; when DepScore i When the threshold θ is less than θ, the task is determined to be a weakly dependent task, which is suitable for allocation using the optimal matching strategy. The threshold θ is a preset fixed value, which is dynamically adjusted based on the statistical characteristics of the task set and the experimental results during the experiment, so as to ensure the rationality and adaptability of the classification results.
6. The GPU scheduling optimization method for bidirectional task and node modeling according to claim 5, characterized in that, Step 2, Node Feature Modeling and Scoring Mechanism, is detailed below. Node feature modeling: For each computing node N j Extract its main computing power and resource parameters, and construct node feature vectors: N j ={PP j ,MC j ,GC j ,GM j ,BW j } Among them, PP j MC represents the processing power of a node. j Represents the memory capacity of a node, GC j GM represents the number of GPU cores. j BW represents the GPU's video memory capacity. j These parameters, representing communication bandwidth, can be obtained through node monitoring, driver interfaces, or cluster resource reporting. Task-Node Scoring Mechanism: Step 1: Design of matching metrics Task: Ti = {WL i MF i DS i ,UR i }, Node: N j ={PP j MC j GC j ,GM j BW j }, For task Ti and node Nj, construct a unified set of evaluation metrics for tasks and nodes. Used to quantify "task performance at this node", it is divided into cost-based and benefit-based metrics based on their characteristics. Task: Ti = {WL i MF i DS i ,UR i }, where WL i MF represents the computational load of the task. i DS represents the memory requirements of a task. i UR represents the amount of data transfer required for the task. i Indicates the urgency of the task. Node: Nj = {PP j MC j GC j ,GM j BW j }, where PP j MC represents the processing power of a node. j Represents the memory capacity of a node, GC j GM represents the number of GPU cores. j BW represents the GPU's video memory capacity. j Indicates communication bandwidth. Detailed metrics include: (1) Execution time metrics (cost-based): wait j WL represents the current estimated availability time of a node, used to characterize queue congestion. i PP represents the computational load of the task. j This indicates the node's processing capacity. (2) Memory / Video Memory Constraints: Feasij = 1 (MC j ≥MF i ∧GM j ≥VM i ), where VM i Based on the task's GPU memory requirements, when Feasij=0, this node is considered infeasible and will not be included in subsequent scoring. (3) Transmission delay metrics (cost-based): (4) Parallelism matching degree (efficiency type): This is used to characterize the support of GPU parallelism for task computation density, where κ is a scaling factor. (5) Memory matching degree (efficiency type): The indicators are standardized and normalized: cost-based indicators are transformed into benefit-based indicators using a reciprocal transformation. Infeasible combinations with Feasij = 0 are removed, and then vector norm normalization is performed on each column to eliminate dimensional differences: Step 2: Weight Calculation Subjective weight calculation: Using the Analytic Hierarchy Process (AHP), based on pairwise comparisons of the importance of each indicator by experts, a judgment matrix A = [a pq This is a judgment matrix obtained by experts through pairwise comparisons of the importance of indicators p and q, calculated using the eigenvector method, with subjective weight w. AHP And perform a consistency check: Consistency is considered acceptable when CR < 0.
1. CI stands for Consistency Index. RI is a random consistency index, which can be found in statistical tables and is related to the size of n. CR is the consistency ratio. When CR < 0.1, the judgment matrix considers the consistency test passed. λ max Let A be the largest eigenvalue. Objective weight calculation: Based on the entropy weight method, for the normalized matrix Calculation ratio: in, For the i-th task at the j-th node, the normalized value of the k-th metric is... Let k be the weight of the i-th task at the j-th node. Where ε is a small constant to prevent the denominator from being zero. And calculate the entropy and difference: This leads to the objective weights: Among them, E k Let the information entropy be the k-th indicator. d k The degree of difference for the k-th indicator. The entropy weight of the k-th index, Weight fusion: To balance expert experience with data objectivity, the weights are linearly fused. γ is chosen to be 0.
5. Where γ is the balance coefficient between subjective and objective weights. Let k be the AHP subjective weight of the k-th indicator. The entropy weight is the objective weight of the k-th indicator. Constructing the weighted normalization matrix: Obtain the weighted matrix based on the fusion weights: Step 3: Scoring Mechanism Determine the ideal and negative ideal solutions: For each index k, determine the positive and negative ideal solutions: Proximity calculation and node matching score: Calculate the Euclidean distance of task Ti at node Nj relative to the ideal solution / negative ideal solution: And receive a relevance rating: Combinations where Feasij = 0 are not scored; or Equivalently, its score ij Set to zero. in, For the i-th task at the j-th node, the weighted normalized value of the k-th indicator; This is the positive ideal solution for the k-th index; The negative ideal solution for the k-th index; Let be the distance of the i-th task relative to the positive ideal solution at the j-th node; Let be the distance of the i-th task relative to the negative ideal solution at the j-th node; Score ij The matching score for the i-th task at the j-th node, ranging from [0,1]. Feasij is a feasibility flag. It is set to 0 when the resource requirements of task i exceed the available resources of node j, indicating that the combination is not feasible. Matching scoring function output and interface: The matching degree of each task-node combination is summarized into a scoring matrix, S = {Score}. ij The matrix |i=1,…,n;j=1,…,m} serves as the input for subsequent scheduling phases (tasks with dependency constraints are preferentially selected based on their scores). ij Nodes with higher priority and satisfying data arrival time order; for independent or weakly dependent tasks, perform globally optimal allocation by combining the scoring matrix.
7. The GPU scheduling optimization method for bidirectional task and node modeling according to claim 6, characterized in that, Step 3: Prioritize scheduling of strongly dependent tasks, as detailed below. Strongly dependent subsets: In the task set T = {T1, T2, ..., T} n In the above, based on the "task dependency strength index", a subset of strongly dependent tasks is obtained. The tasks within this subset all have explicit execution order constraints, determined by data transmission and control dependencies between tasks. A directed acyclic graph (DAG) is constructed based on these task dependencies, where tasks act as nodes and edge weights reflect the communication cost between tasks. Task priority calculation: For each strongly dependent task T i Calculate its upward priority value rank. (i) The formula is as follows: in, Comp i This represents the execution cost of the task under average computing power. Comm i,j This represents the communication overhead of the task under average bandwidth; Succ(i) represents the communication overhead of task T. i The set of successor tasks, with this priority value used for global sorting of tasks to ensure that tasks on the critical path are given priority in scheduling. Candidate node completion time calculation: For sorted task T i Traverse all feasible nodes N j Calculate its earliest completion time at that node. Among them, RT i It is the earliest ready time of a task, which depends on the completion times of all its predecessor tasks and data transmission latency; ETA j It is node N j The earliest available time; WL i The computational load of the task; PP j The processing capacity of a node and the completion time are used to measure the performance differences in executing tasks on different nodes. Completion time normalization: Since completion times vary across different tasks, to facilitate matching and score fusion, the completion time metric is normalized to the [0,1] interval. Where ∈ is a small constant to avoid the denominator being zero, and the normalized NormEFT is... ij The larger the value, the more conducive the node is to the rapid completion of the task. Comprehensive scoring and scheduling decision: Combining task-node matching score ij The comprehensive scheduling score is defined based on the needs of urgent and pressing tasks. λ1+λ2+λ3=1, Among them, λ1 balances execution efficiency, and increasing its value helps reduce task latency; λ2 balances matching accuracy, and increasing its value helps improve the matching degree between tasks and nodes. UR has already been considered in the previous task settings, so λ3, as an enhancement mechanism, remains at 0 in normal scenarios, but its weight is increased when an emergency task intervenes. Finally, the node with the highest overall score is selected as the task execution node, and the available time (ETA) of that node is updated. j .
8. The GPU scheduling optimization method for bidirectional task and node modeling according to claim 7, characterized in that, Step 4: Optimal matching and scheduling of weakly dependent tasks. For a subset of tasks with weak dependencies, there are no explicit execution order constraints within it. These tasks are then distributed in parallel to different nodes while satisfying resource constraints. To ensure overall resource utilization and scheduling efficiency, this problem is modeled as a task-node bipartite graph matching problem. The steps are as follows: Task-Node Bipartite Graph Construction: Construct a bipartite graph for a subset of weakly dependent tasks and a set of nodes. In this system, the left vertex set corresponds to the task, the right vertex set corresponds to the node, the edge set E represents the executable relationship of the task on the candidate node, and each edge is assigned a weight C. ij Used to characterize task T i At node N j Overall compatibility Cost Matrix Construction: For a set of weakly dependent tasks and a set of nodes, construct a cost matrix combining task and node components. C ij =η·NormEFT ij +(1-th) Score ij NormEFT ij Indicates task T i At node N j Earliest completion time of normalization on; Score ij This represents the fit score obtained based on the task-node scoring mechanism; η is a balancing parameter used to adjust the importance of execution efficiency and matching degree. Global optimal matching solution: Based on the above cost matrix, the bipartite graph optimal matching solution is used. The constraints are: Where, x ij =1 indicates task T i Assigned to node N j Otherwise x ij =0, Ultimately, the task-node matching relationship is obtained, achieving the global optimal allocation of weakly dependent tasks, so that the overall scheduling achieves a balance between execution efficiency and resource utilization.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the GPU scheduling optimization method for bidirectional task and node modeling as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by the processor, the computer instructions implement the GPU scheduling optimization method for bidirectional task and node modeling as described in any one of claims 1-8.
Citation Information
Cited By
A method and system for allocating AI computing power on a cloud computing platform considering energy consumption constraints.
CN122309178A
An AI computing power allocation method and system of a cloud computing platform considering energy consumption constraints
CN122309178B