A heterogeneous-aware GPU resource allocation and scheduling method and system

Through the heterogeneous-aware GPU resource allocation and scheduling method, combined with the double-layer feedback queue and the minimum server priority algorithm, the problem of GPU heterogeneity and model heterogeneity in deep learning training tasks is solved, and the task completion time and throughput, avoiding task starvation.

CN113535387BActive Publication Date: 2024-10-18ZHEJIANG LAB

Patent Information

Application Number
CN202110699347.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-23
Publication Date
2024-10-18
Estimated Expiration
2041-06-23

AI Technical Summary

Technical Problem

Existing technologies fail to fully consider GPU heterogeneity and model heterogeneity in deep learning training task scheduling, resulting in unknown task duration and underutilized task throughput optimization space.

Method used

It adopts a heterogeneous-aware GPU resource allocation and scheduling method, pre-analyzes the performance indicators of tasks under different GPU resources, and uses a double-layer feedback queue and the minimum server priority algorithm to dynamically adjust task priorities and resource allocation to ensure that tasks are Run on the GPU with the best performance to prevent task starvation and optimize overall throughput.

Benefits of technology

It effectively improves the average task completion time of deep learning training tasks. By fully considering device heterogeneity and model heterogeneity, it optimizes task resource occupation and device placement, reduces subsequent task waiting time, and avoids task starvation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535387B_ABST
    Figure CN113535387B_ABST
Patent Text Reader

Abstract

The invention discloses a heterogeneity-aware GPU resource allocation and scheduling method and system, the method comprising: S1: pre-analyzing the performance index required for the task; S2: after the task is submitted, setting the task priority to the highest and submitting it to the high-priority Q1 waiting queue; S3: when the available GPU resources change, triggering scheduling, a placer allocates GPU resources to the task according to the GPU heterogeneity and the performance index of the task; S4: monitoring the tasks being executed, calculating their priorities, determining whether the tasks need to give up GPU resources according to the priorities, and placing the tasks that need to give up GPU resources into the low-priority Q2 waiting queue; S5: monitoring whether the waiting time of the tasks in the Q2 waiting queue exceeds the starvation threshold, if so, setting the priority of the task to the highest and moving it into the Q1 waiting queue; the system comprises: a scheduler, a placer, a detector, and high-priority and low-priority waiting queues.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology, and in particular to a heterogeneous-aware GPU resource allocation and scheduling method and system. Background Art

[0002] Deep learning has achieved great success and has been widely used in computer vision, speech recognition, natural language processing and other fields, and is playing an increasingly important role in emerging fields such as autonomous driving. Deep learning applications usually include model design, model training and model reasoning. Among them, deep learning training is usually computationally intensive. As the model size becomes larger and larger, the requirements for model accuracy become higher and higher, and more and faster newer accelerators are applied to deep learning training. As the scale of training data sets becomes larger and larger, in order to reduce training time, it is usually necessary to perform distributed deep learning training on multiple GPUs.

[0003] Currently, many cloud service providers have built large-scale GPU clusters to meet the computing power requirements of various deep learning training tasks. However, the most common cluster batch job scheduler, Yarn, does not fully consider the unpredictable training time of deep learning tasks, high task switching costs, and large interference between tasks. In order to overcome these problems, academia and industry have proposed various scheduling systems.

[0004] The unpredictability of deep learning training tasks is an important feature that is different from traditional batch processing tasks. In the task scheduling scenario, we know that when the task duration and task arrival time are known, the shortest job first algorithm can achieve the best scheduling effect in the scenario with the goal of minimizing the average task completion time (JCT); when the task duration is known and the task arrival time is unknown, the shortest remaining time first (SRTF) algorithm can achieve the best scheduling effect in the above scenario. However, they all rely on the prediction of task execution time. In traditional batch processing tasks, the task execution time can be approximately estimated by the amount of data and computing resources, but in deep learning training tasks, it is often difficult to make a reasonable prediction of the task execution time. Since deep learning task training is often iteratively advanced, the academic community predicts the task execution time by assuming that the task loss curve can be converged and captures the repeated execution mode in the previous training. This is not feasible in real production environment tasks because it makes overly simplified assumptions for tasks that are difficult to converge.

[0005] In the context of unknown duration of deep learning training tasks, the Least Attained Service (LAS) algorithm is more suitable for current scenarios than other scheduling algorithms. LAS was proposed in the mid-1960s and is a preemptive scheduling strategy that does not require prior knowledge. LAS prioritizes service resources to tasks with the least service in the system. In deep learning training task scheduling scenarios, the service obtained by a task is often calculated based on the number of GPU cards occupied by the task and the duration.

[0006] At present, it is difficult for GPU models in GPU cluster environments to be homogeneous due to different purchase batches, so heterogeneous hardware environments will become the norm for GPU clusters. For example, the price of Nvida V100 GPU is three times that of Nvida K80 GPU, and the single-precision computing performance is twice that of K80. On the other hand, the performance of deep learning models on different acceleration devices also shows heterogeneity. For example, ResNet-50 achieves a 10-fold performance improvement on V100 compared to K80, while the A3C model only achieves a 2-fold improvement. Considering the economics, V100 is no longer the best choice for all models. Although cheaper devices have lower performance than V100, they may perform better in the training of some models in terms of economy. Existing scheduling strategies do not fully consider this.

[0007] In view of the above research background, there is an urgent need for a heterogeneous-aware GPU resource allocation and scheduling method and system to solve the two challenges of current deep learning training task schedulers:

[0008] First, under the premise that the duration of the task is unknown, the weight calculation based on the least attended service (LAS) does not take into account the heterogeneity of devices;

[0009] Second, tasks are placed on GPUs, which are considered homogeneous devices. Device heterogeneity and model heterogeneity are not taken into consideration, so there is room for optimization of the overall task throughput. Summary of the invention

[0010] In order to solve the shortcomings of the prior art and achieve the purpose of improving the average task completion time, the present invention adopts the following technical solutions:

[0011] A heterogeneous-aware GPU resource allocation and scheduling method includes the following steps:

[0012] S1: Before submitting a deep learning training task, perform a preliminary analysis to analyze the performance indicators of the task under different GPU resources by running the task on different GPU resources;

[0013] S2: After submitting the deep learning training task, set the task priority to the highest and submit it to the high-priority Q1 waiting queue;

[0014] S3: When an event occurs, the scheduling is triggered, and the placer allocates GPU resources to the task according to the GPU heterogeneity and the performance index of the task to improve the overall throughput. The event includes task submission, and / or task completion, and / or change in available GPU resources;

[0015] S4: Monitor the tasks being executed, calculate their priorities, determine whether the computing tasks need to give up GPU resources based on the priorities, and put the tasks that need to give up GPU resources into the low-priority Q2 waiting queue, thereby reducing the waiting time of subsequent tasks and the average task completion time;

[0016] S5: Monitor whether the waiting time of tasks in the Q2 waiting queue exceeds the starvation threshold (STARVE_THRESHOLD). If it exceeds, the priority of the task is set to the highest and moved into the Q1 waiting queue to avoid task starvation.

[0017] The performance indicators in step S1 are the peak video memory occupied by the deep learning model on a single card and the average number of iterations per second of the deep learning distributed training task on different models of GPUs when the deep learning distributed training task is running.

[0018] In step S1, if the deep learning distributed training task has never been run in a GPU cluster, the deep learning distributed training task is pre-executed in an environment containing multiple models of GPUs to parse out performance indicators on different models of GPUs.

[0019] Furthermore, the step S4 comprises the following steps:

[0020] S41: monitor the computing tasks currently being executed, and accumulate the priorities of the computing tasks from the beginning of execution to the current moment. The priorities adopt the Least Attained Service (LAS) scheduling algorithm, and the formula is:

[0021]

[0022] in:

[0023] L is the number of times the task is scheduled from the beginning to the current time;

[0024] i′ is the i′th scheduling;

[0025] T i′ is the duration calculated at the i′th scheduling;

[0026] Ni′ is the number of GPUs;

[0027] P i′ This is the GPU factory performance indicator, which is determined based on the indicators given by the manufacturer.

[0028] S42: If the priority is greater than the average priority of all current tasks multiplied by the priority threshold coefficient (PRIORITY_THRESHOLD_RATIO), it means that the current task occupies too many resources or the current resources occupy too long a time. The scheduler suspends the current task and schedules the task to the Q2 waiting queue. The priority threshold coefficient is a floating point number derived from the system configuration.

[0029] Furthermore, step S5 comprises the following steps:

[0030] S51: Monitor the tasks in the current Q2 waiting queue and record the waiting time from the task entering the queue to the current time;

[0031] S52: If the waiting time exceeds the task's running time multiplied by the starvation threshold coefficient (STARVE_THRESHOLD_RATIO), the task is considered to be in a starvation state, and the task is scheduled to the Q1 waiting queue, and its priority is set to 0, i.e. the highest. The starvation threshold coefficient is a floating point number derived from the system configuration.

[0032] Furthermore, step S3 includes the following steps:

[0033] S31: When an event occurs, a scheduling operation is started, wherein the event includes task submission, and / or task completion, and / or a change in available GPU resources;

[0034] S32: Compare whether the available GPU resources in the GPU cluster meet the GPU resources required by the head task of the Q1 waiting queue. If not, skip the task and take the next task until a task that meets the conditions is found or the end of the queue is reached. If no task that meets the conditions is found, this round of scheduling operation ends.

[0035] S33: When a task that meets the conditions is found, the task tuple (Job s ,M s ,R s )Submit the placer, where Job s is the task name, M s is the task throughput matrix, R s is the amount of GPU resources required. The placer searches for the GPU resources with the best performance that meet the task requirements from the available GPU resources and marks them as unavailable;

[0036] S34: The placer traverses all currently executing task lists (Job i ,M i ,R i ), find R i Less than or equal to R s The task, according to the throughput matrix, is calculated with R s The throughput increase brought by resource swapping is selected, and the task R with the largest increase that is greater than 0 is selected. i With Job s Replace resources. If there is no task with a throughput increase greater than 0, directly replace R s Assign to Job s ;

[0037] Step S35: The placer sends the GPU resource information (model and time) allocated when the task is first scheduled or re-migrated to the scheduler for persistence, which is used for subsequent monitoring of the priority calculation of the task being executed.

[0038] In step S31, the available GPU resources change when the task is finished, which means that the task gives up resources due to an error, or the task is stopped and gives up resources because it occupies too many service resources for too long.

[0039] The GPU resources required for the task in step S32 refer to the number of GPU cards required for the task being met at the same time, and the allocated GPUs meeting the peak GPU memory requirement in the task performance data.

[0040] In step S33, the placer is a module responsible for placing tasks on specific devices. The placer needs to fully consider heterogeneity to improve the average task completion time.

[0041] Furthermore, in step S34, the calculation formula for throughput growth is:

[0042] N i (M ik -M ij )+N s (M sj -M sk )

[0043] in:

[0044] M is the distributed training task throughput matrix, M ij represents the performance of the i-th task on the GPU model j;

[0045] i is the task to be replaced;

[0046] s is the task to be assigned;

[0047] Ni The number of GPU cards required for task i;

[0048] N s The number of GPU cards required for task s;

[0049] j is the GPU model that has been assigned to task i;

[0050] k is the GPU model to be assigned to task s.

[0051] Furthermore, the step S2 comprises the following steps:

[0052] S21: When submitting a task to the scheduler, the performance indicator corresponding to the task is submitted to the scheduler, and the scheduler persists the performance indicator for subsequent calculation;

[0053] S22: The scheduler sets the priority of the task just submitted to 0. The priority is a floating point number less than or equal to 0. The larger the value, the higher the priority. 0 is the highest priority.

[0054] S23: The scheduler puts the task just submitted into the Q1 waiting queue.

[0055] Furthermore, the sorting method of the Q1 waiting queue is: first sorting by priority from high to low, and then sorting tasks with the same priority by submission time.

[0056] Furthermore, the performance indicator in S1 is R=(M′, G), where G represents the peak memory usage of a deep learning distributed training task on a GPU card, M′ represents the number of iterations per second of a deep learning distributed training task on different models of GPUs, and M′ is a vector.

[0057] A heterogeneous-aware GPU resource allocation and scheduling system, including: a scheduler, a placer, and a detector, adopts a double-layer feedback queue to prevent task starvation and make the average task completion time (Job Complete Time, JCT) is minimized, including the high-priority Q1 waiting queue and the low-priority Q2 waiting queue. The priority of the newly submitted task is set to the highest and enters the Q1 waiting queue. The executing task and the task in the Q1 waiting queue are input to the scheduler. The scheduler sets the priority for the task. When the available GPU resources change, the scheduling is triggered. The scheduler calculates the priority of the executing task and determines whether the executing computing task needs to give up the GPU resources according to the priority. The task that needs to give up the GPU resources is placed in the Q2 waiting queue, thereby reducing the waiting time of subsequent tasks and the average task completion time. The scheduler monitors whether the waiting time of the task in the Q2 waiting queue exceeds the starvation threshold. If it exceeds, the priority of the task is set to the highest and moved into the Q1 waiting queue to avoid task starvation. The detector is responsible for analyzing the tasks and calculating the throughput index for the tasks under different types of GPU resources. The placer allocates GPU resources to the tasks according to the GPU heterogeneity and places the tasks on specific devices to improve the overall throughput and improve the average task completion time.

[0058] Furthermore, the scheduler compares whether the available GPU resources in the GPU cluster meet the GPU resources required by the head task of the Q1 waiting queue. If not, the task is skipped and the next task is taken until a task that meets the conditions is found or the end of the queue is reached. If no task that meets the conditions is found, this round of scheduling operations ends. When a task that meets the conditions is found, the placer marks the available GPU resources as unavailable, and traverses the list of tasks being executed to find a task being executed whose GPU resource amount is less than or equal to the GPU resource amount of the task that meets the conditions. According to the throughput matrix, the throughput increase brought by the exchange of GPU resources is calculated, and a task being executed with an increase greater than 0 and the largest increase is selected to replace resources with the task that meets the conditions. If there is no task being executed with a throughput increase greater than 0, the available CPU resources are directly allocated to the task that meets the conditions.

[0059] The advantages and beneficial effects of the present invention are:

[0060] Based on the LAS scheduling algorithm, the present invention fully considers device heterogeneity to optimize the calculation of task occupation service resources; in the placement algorithm of tasks to GPU computing devices, it has the advantage of fully considering device heterogeneity to optimize the overall average task completion time. The present invention determines the resource occupation and device placement of tasks by analyzing the performance indicators on different models of GPUs for deep learning training tasks, and uses the LAS algorithm to handle the problem of unpredictable duration, so as to achieve the goal of improving the average task completion time. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 This is the overall architecture diagram of the present invention.

[0062] Figure 2 Schematic diagram of the structure of the parameter server in the present invention.

[0063] Figure 3 This is a task state conversion flow chart in the present invention. DETAILED DESCRIPTION

[0064] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0065] Deep learning distributed training tasks often involve data parallelism and model parallelism. Here, deep learning distributed training tasks refer to the training process of deep learning models in data parallel mode. Deep learning distributed training tasks usually use parameter server architecture, such as Figure 2 As shown in the figure. The architecture includes parameter servers and worker servers. The parameter server stores global model parameters and accepts parameter queries and update requests from the worker server as a service provider. The worker server pulls and updates the parameters in the parameter server and maintains a model copy locally. The training data is usually stored in a distributed file system. Each computing node can access the distributed file system and iteratively load only the required training data according to the logical division. Deep learning distributed training tasks may be allocated to multiple GPUs on a server or multiple GPUs on multiple servers depending on the resource situation.

[0066] The deep learning scheduler is mainly composed of detectors, schedulers, placers, and GPU clusters. The detector is responsible for analyzing tasks, with the goal of obtaining the task's computing throughput indicators under different types of GPUs. The scheduler is the most core component, such as Figure 1As shown in the figure, a double-layer feedback queue is used here to prevent task starvation. The scheduling goal is to minimize the average job completion time (Job Complete Time, JCT). Among them:

[0067] JCT=T 完成时间 -T 到达时间

[0068] The two-layer feedback queue consists of the Q1 queue and the Q2 queue. The Q1 queue is a high priority queue, and the Q2 queue is a low priority queue. All newly submitted tasks enter the Q1 queue, and all replaced tasks enter the Q2 queue. Tasks in the Q2 queue enter a starvation state (such as Figure 3 As shown in the figure, it will enter the Q1 queue. What is different from process scheduling here is that in the double-layer feedback queue here, new tasks in the high-priority queue will not preempt the running low-priority queue, but will wait for the low-priority queue to reach the maximum resource occupancy before being scheduled to the Q2 queue by the scheduler. The placer integrates the placement algorithm and maintains and manages the underlying GPU cluster. The placer is responsible for maintaining the mapping relationship between tasks and resources. Its core is the placement algorithm. The placement algorithm plans a reasonable and efficient task placement plan based on the characteristics of the task and the existing resource allocation.

[0069] The scheduler schedules the entire deep learning distributed training task at a granularity, without performing more fine-grained scheduling and management of the internal parameter servers and computing servers. After the scheduler allocates computing resources from the GPU cluster for the deep learning distributed training task, the allocation of parameter servers and computing servers is completed by the task itself. Therefore, a deep learning distributed training task, including parameter servers, training servers, data, and the hardware they depend on, is abstracted into the concept of a task in the scheduler.

[0070] A deep learning distributed training task has the characteristics of periodic iteration and unpredictable task duration.

[0071] In each iteration of a deep learning distributed training task, the worker node will perform a forward propagation and a backward propagation calculation based on the training data obtained from the previous logical division. Since deep learning distributed training tasks are performed iteratively, the data loading, calculation, and network synchronization are highly similar in each iteration, so the time consumption of each iteration in the training process is highly similar. Therefore, the task can be stopped and resumed by persisting the model to the file system and reading the model from the file system.

[0072] There are hyperparameters that can be adjusted before training in deep learning distributed training tasks. These include network parameters, optimization parameters, regularization parameters, etc. In AutoML, many models are often trained in batches by combining multiple hyperparameters, and most of these models will stop training early due to various problems, such as slow convergence. It can be seen that the execution of a task in AutoML depends on the AutoML search algorithm, not just on whether the task will converge. Therefore, it is unreliable to predict the execution time of a deep learning training task based solely on the model structure and the logs generated by the training task. Therefore, we use the LAS algorithm to avoid predicting the duration of deep learning training tasks.

[0073] The present invention proposes a heterogeneity-aware GPU resource allocation and scheduling method and system. Based on the double-layer feedback queue and LAS algorithm, it takes into account the heterogeneity of GPUs and applications, optimizes the scheduling algorithm, and improves the average task completion time. Its overall architecture is as follows: Figure 1 As shown, the specific implementation includes the following steps:

[0074] (1) Perform a preliminary analysis before submitting a deep learning training task and parse the required performance indicators from the running logs of the task on different GPU accelerators.

[0075] The tasks of computing nodes in a deep learning distributed training task include different stages such as data IO, CPU calculation, GPU calculation, network communication, etc. The present invention treats multiple stages as a whole. As mentioned above, a deep learning distributed training task has the characteristics of periodic iteration, and the time consumption of each iteration during the training process is highly similar. Therefore, it is possible to perform a pre-analysis before submitting the deep learning training task, pre-execute the task on different GPU accelerators, record it in the operation log, and parse the required performance indicators from it.

[0076] In the present invention, the performance index of the program is defined as R = (M', G). G represents the peak memory usage of a deep learning distributed training task on a card. M' represents the number of iterations per second of a deep learning distributed training task on different models of GPUs, and M' is a vector.

[0077] (2) After submitting the deep learning training task, its priority is set to the maximum and submitted to the high-priority Q1 waiting queue.

[0078] After submitting the task, the performance indicator R = (M', G) is also submitted to the scheduler. The scheduler will persist this part of the content for subsequent calculations. The scheduler will also set the priority for the task. The formula for calculating the priority is:

[0079]

[0080] in:

[0081] L is the number of times the task has been scheduled since its start.

[0082] i′ is the number of scheduling

[0083] T i′ To calculate the duration at the first scheduling

[0084] N i′ is the number of GPUs

[0085] P i′ This is the GPU performance indicator, which is determined according to the indicators given by the manufacturer.

[0086] Since the task has just been submitted and there is no task resource occupation, the task priority is set to zero, which is the highest. The task enters the Q1 queue.

[0087] The present invention uses a double-layer feedback queue, where the Q1 queue is a high priority queue and the Q2 queue is a low priority queue.

[0088] (3) When an event (task submission, task completion, or change in available GPU resources) occurs, scheduling is triggered and the placer allocates GPU resources to tasks based on GPU heterogeneity to improve overall throughput.

[0089] The present invention designs a scheduler based on the Least Attained Service (LAS) scheduling algorithm, whose input is the tasks running in the GPU cluster and the tasks waiting in the queue. When the above three events occur, the execution of Algorithm 2 is triggered.

[0090] Algorithm 1 gives the specific placement strategy of the present invention, where N i The number of GPU cards required for task i. The placement strategy considers the heterogeneity of devices and applications.

[0091] Algorithm 2 gives the specific scheduling strategy of the present invention, where M is the distributed training task throughput matrix, M ij Represents the performance of the i-th task on the GPU model j.

[0092] Algorithm 1: Placement Algorithm

[0093] Function Place(s,J):

[0094] Initialize c to a null value

[0095] For each task i in J,

[0096] If the number of available GPUs is greater than N i And N i Less than N s have

[0097] Record the newly added throughput iv as N i (M ik -M ij )+N s (M sj -M sk )

[0098] If the newly added throughput iv is greater than the maximum value already recorded,

[0099] The maximum increase in throughput recorded is iv

[0100] Update c to i

[0101] If c is not empty, there is

[0102] Schedule the c task to an existing idle GPU

[0103] Schedule task s to the GPU of task c

[0104] otherwise

[0105] Schedule the s task to an existing idle GPU

[0106] Algorithm 2: Heterogeneous-aware LAS scheduling algorithm

[0107] Function HLAS(Jobs J, Queue Q1, Queue Q2)

[0108] avgP = average value of priority in J

[0109] For each task i in J,

[0110] Calculate the priority p of task i according to the function Priority(i,J),

[0111] If p is greater than avgP*PRIORITY_THRESHOLD_RATIO,

[0112] Stop Task i

[0113] Enqueue task i to Q2

[0114] For each task j in Q2,

[0115] If WAITING_TIME of i divided by RUNNING_TIME of i is greater than STARVE_THRESHOLD_RATIO

[0116] Set the priority of task i to 0 and clear the previous execution period

[0117] Enqueue task i to Q1

[0118] For each task i in Q1,

[0119] If the number of available GPUs is greater than N i have

[0120] Place(i)

[0121] The number of available GPUs minus N i

[0122] Function Priority(i)

[0123] Initialize the priority level p to 0

[0124] For each execution period of task i,

[0125] For each GPU in period,

[0126] p-=period duration*GPU performance

[0127] Return p

[0128] (4) Monitor the tasks being executed, calculate their priorities, and determine whether the computing tasks should give up GPU resources and be placed in the Q2 waiting queue based on the priorities, thereby reducing the waiting time of subsequent tasks and reducing the average task completion time.

[0129] Monitor the current computing task. Its priority is essentially the currently occupied service resources. Its calculation formula refers to the Priority function in the algorithm. We do not set a specific threshold for measuring excessive service resources, but use the ratio to the average value to measure. If the current priority is greater than the average value multiplied by the value of PRIORITY_THRESHOLD_RATIO, it is considered that the system resources are excessively occupied.

[0130] (5) Monitor whether the waiting time of tasks in the Q2 queue exceeds STARVE_THRESHOLD. If so, set the priority to the highest and move it into the Q1 queue to avoid task starvation.

[0131] Similar to the judgment of excessive occupation of service resources by a task, for starvation caused by too long task waiting time, we judge whether the waiting time exceeds the running time multiplied by the value of STARVE_THRESHOLD. If it exceeds, the task is considered to be in a starvation state, and the task is scheduled to Q1, its priority is set to 0, and past execution records are ignored in future priority calculations.

[0132] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A heterogeneous-aware GPU resource allocation and scheduling method, characterized in that The steps include: S1: Before submitting a deep learning training task, perform a preliminary analysis to analyze the performance indicators of the task under different GPU resources by running the task on different GPU resources; S2: After submitting the deep learning training task, set the task priority to the highest and submit it to the high-priority Q1 waiting queue; S3: When an event occurs, the scheduling is triggered, and the placer allocates GPU resources to the task according to the GPU heterogeneity and the performance index of the task. The event includes task submission, and / or task completion, and / or change in available GPU resources; S4: Monitor the tasks being executed, calculate their priorities, determine whether the tasks need to give up GPU resources based on the priorities, and put the tasks that need to give up GPU resources into the low-priority Q2 waiting queue; S5: Monitor whether the waiting time of tasks in the Q2 waiting queue exceeds the starvation threshold. If so, the priority of the task is set to the highest and moved into the Q1 waiting queue.

2. According to claim 1, a heterogeneous-aware GPU resource allocation and scheduling method is characterized in that The step S4 comprises the following steps: S41: Monitor the currently executed tasks, and accumulate the priorities of the tasks from the beginning of execution to the current moment. The priorities are scheduled using the scheduling algorithm of giving priority to the smallest service provider, and the formula is: in: L is the number of times the task is scheduled from the beginning to the current time; i′ is the i′th scheduling; T i′ is the duration calculated at the i′th scheduling; N i′ is the number of GPUs; P i′ It is the factory performance index of GPU; S42: If the priority is greater than the average priority of all current tasks multiplied by the priority threshold coefficient, the scheduler pauses the current task and schedules the task to the Q2 waiting queue.

3. The heterogeneous-aware GPU resource allocation and scheduling method according to claim 1 is characterized in that The step S5 comprises the following steps: S51: Monitor the tasks in the current Q2 waiting queue and record the waiting time from the task entering the queue to the current time; S52: If the waiting time exceeds the task's running time multiplied by the starvation threshold coefficient, the task is scheduled to the Q1 waiting queue and its priority is set to the highest.

4. The heterogeneous-aware GPU resource allocation and scheduling method according to claim 1 is characterized in that The step S3 comprises the following steps: S31: When an event occurs, a scheduling operation is started, wherein the event includes task submission, and / or task completion, and / or a change in available GPU resources; S32: Compare whether the available GPU resources in the GPU cluster meet the GPU resources required by the head task of the Q1 waiting queue. If not, skip the task and take the next task until a task that meets the conditions is found or the end of the queue is reached. If no task that meets the conditions is found, this round of scheduling operation ends. S33: When a task that meets the conditions is found, the task tuple (Job s ,M s ,R s )Submit the placer, where Job s is the task name, M s is the task throughput matrix, R s is the amount of GPU resources required. The placer searches for GPU resources that meet the task requirements from the available GPU resources and marks them as unavailable; S34: The placer traverses the list of tasks being executed (Job i ,M i ,R i ), find R i Less than or equal to R s The task, according to the throughput matrix, is calculated with R s The throughput increase brought by resource swapping is selected, and the task R with the largest increase greater than 0 is selected. i With Job s Replace resources. If there is no task with a throughput increase greater than 0, directly replace R s Assign to Job s ; Step S35: The placer sends the GPU resource information allocated when the task is first scheduled or re-migrated to the scheduler for persistence.

5. A heterogeneous-aware GPU resource allocation and scheduling method according to claim 4, characterized in that In step S34, the calculation formula for throughput growth is: N i (M ik -M ij )+N s (M sj -M sk ) in: M is the distributed training task throughput matrix, M ij represents the performance of the i-th task on the GPU model j; i is the task to be replaced; s is the task to be assigned; N i The number of GPU cards required for task i; N s The number of GPU cards required for task s; j is the GPU model that has been assigned to task i; k is the GPU model to be assigned to task s.

6. The heterogeneous-aware GPU resource allocation and scheduling method according to claim 1, characterized in that The step S2 comprises the following steps: S21: Submit the performance indicator corresponding to the task to the scheduler, and the scheduler persists the performance indicator; S22: The scheduler sets the priority of the task just submitted to the highest priority; S23: The scheduler puts the task just submitted into the Q1 waiting queue.

7. The heterogeneous-aware GPU resource allocation and scheduling method according to claim 1, characterized in that The sorting method of the Q1 waiting queue is: first sort by priority from high to low, and then sort by submission time for tasks with the same priority.

8. The heterogeneous-aware GPU resource allocation and scheduling method according to claim 1, characterized in that The performance indicator in S1 is R=(M′,G), where G represents the peak memory usage of the task on the GPU card, M′ represents the number of iterations per second of the task on different models of GPUs, and M′ is a vector.

9. A heterogeneous-aware GPU resource allocation and scheduling system, comprising: The scheduler, placer and detector are characterized by adopting a double-layer feedback queue, including a high-priority Q1 waiting queue and a low-priority Q2 waiting queue. The priority of the newly submitted task is set to the highest and enters the Q1 waiting queue. The tasks being executed and the tasks in the Q1 waiting queue are input into the scheduler. The scheduler sets the priority for the task. When the available GPU resources change, the scheduling is triggered. The scheduler calculates the priority of the task being executed, determines whether the task being executed needs to give up the GPU resources based on the priority, and puts the task that needs to give up the GPU resources into the Q2 waiting queue. The scheduler monitors whether the waiting time of the tasks in the Q2 waiting queue exceeds the starvation threshold. If it exceeds, the priority of the task is set to the highest and moved into the Q1 waiting queue; the detector is responsible for analyzing the tasks and calculating the throughput index for the tasks under different GPU resources; the placer allocates GPU resources to the tasks according to the GPU heterogeneity.

10. The heterogeneous-aware GPU resource allocation and scheduling system according to claim 9, characterized in that The scheduler compares the available GPU resources in the GPU cluster to see whether they meet the GPU resources required by the head task in the Q1 waiting queue. If not, the task is skipped and the next task is taken until a task that meets the conditions is found or the end of the queue is reached. If no task that meets the conditions is found, this round of scheduling ends. When a task that meets the conditions is found, the placer marks the available GPU resources as unavailable, and traverses the list of tasks being executed to find a task being executed whose GPU resource amount is less than or equal to the GPU resource amount of the task that meets the conditions. According to the throughput matrix, the throughput increase brought by exchanging GPU resources is calculated, and an executing task with an increase greater than 0 and the largest increase is selected to replace resources with the task that meets the conditions. If there is no executing task with a throughput increase greater than 0, the available CPU resources are directly allocated to the task that meets the conditions.

Citation Information

Patent Citations

  • Deep learning task service quality guarantee method and system based on container cluster

    CN110413391A

  • Task scheduling method and device in heterogeneous cluster and electronic equipment

    CN110489223A

  • Heterogeneous resource distributed computing platform batch task scheduling method and storage medium

    CN112181613A

  • Dynamic matching algorithm, system and device based on GPU resource occupation characteristics

    CN112559147A

  • A system of quality of service enabled (QOS) join minimum loaded queue (JMLQ) for cloud computing environment

    IN201911039375A

Cited By

  • Method and apparatus for job allocation

    WO2026226050A1