Task scheduling method and device
By monitoring and adjusting the acceleration chip throughput and thread allocation in deep learning tasks, the problem of low resource utilization of elastic heterogeneous acceleration chips is solved, load balancing and performance optimization are achieved, and the overall efficiency of the cluster is improved.
Patent Information
- Application Number
- CN202210334460.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-03-30
AI Technical Summary
In deep learning training tasks, the resource utilization of elastic heterogeneous acceleration chips is low, resulting in load imbalance and waste of performance, thereby reducing the overall efficiency of the cluster.
By monitoring the statistics of tasks, including the throughput and number of threads of various types of acceleration chips, the computing power and performance ratio of each task are calculated, and thread allocation is adjusted to achieve optimal resource allocation and load balancing.
It improves the resource utilization of the cluster, reduces task completion time, and improves job efficiency.
Smart Images

Figure CN114579284B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a task scheduling method and device. Background Art
[0002] Deep neural networks have been used in many widely deployed systems across multiple fields, including computer vision, natural language processing, speech recognition, as well as recommendations and advertising. Therefore, deep learning has become a vital part of product data flow. In order to support such large-scale deep learning applications, large-scale shared acceleration chip clusters are generally built to perform multiple deep learning tasks.
[0003] However, it is observed in these shared acceleration chip clusters that in fact, the acceleration chip resources are often still in a relatively low utilization state. At the same time, some tasks are still waiting in line, and the throughput of the entire cluster is not very high. In addition, resource sharing will also lead to task preemption. In order to solve the above-mentioned problems of long queue delays for cluster tasks and failures caused by preemption, adapting training tasks to elastic resources is a very direct method. After supporting elasticity, training tasks can start processing as soon as possible using available resources, eliminating the mandatory waiting caused by group scheduling, and continue training using the remaining resources when resources are preempted, thereby improving cluster utilization and reducing task completion time. However, this elastic method may lead to difficult-to-reproduce model accuracy, and tasks show different capabilities when using heterogeneous acceleration chips, which is not commensurate with the theoretical computing power of acceleration chips. In addition, the number of threads is a discrete integer, while the computing power of acceleration chips is a continuous real number. Heterogeneous acceleration chips are usually not allocated a number of threads proportional to their computing power, which is very likely to cause load imbalance and performance waste.
[0004] Therefore, in the existing technology, in the elastic heterogeneous, precision-invariant deep learning training task scenario, there are problems of load imbalance and performance waste, which in turn leads to low cluster utilization and low operating efficiency. Summary of the invention
[0005] The embodiments of the present application provide a task scheduling method and device to solve the problems of load imbalance and performance waste in elastic heterogeneous, precision-invariant deep learning training task scenarios, thereby improving cluster utilization and improving work efficiency.
[0006] In a first aspect, an embodiment of the present application provides a task scheduling method, the method comprising:
[0007] Obtaining statistical data of each of the multiple tasks, the statistical data including the throughput of each type of acceleration chip of the task under the current configuration, the current configuration including the acceleration chip type, the number of each type of acceleration chips, and the number of threads allocated on each type of acceleration chip;
[0008] Determine proposal information according to the statistical data of each task, the current configuration and the acquired maximum number of threads corresponding to each task, where the proposal information is used to represent a proposal for applying for required resources for each task;
[0009] According to the proposal information, resources are scheduled for each thread in a target task, where the target task is at least one task among all the tasks.
[0010] Optionally, determining the proposal information according to the statistical data of each task, the current configuration, and the acquired maximum number of threads corresponding to each task includes:
[0011] Determine the computing power of each type of acceleration chip for each task under the current configuration according to the throughput of each type of acceleration chip for each task under the current configuration;
[0012] The proposal information is determined based on the computing power of each type of acceleration chip under the current configuration of each task, the type of acceleration chip, the number of each type of acceleration chips, the number of threads allocated on each type of acceleration chip, and the maximum number of threads corresponding to each task obtained.
[0013] Optionally, determining the computing capacity of each type of acceleration chip for each task under the current configuration according to the throughput of each type of acceleration chip for each task under the current configuration includes:
[0014] Perform the following steps for each of the tasks described:
[0015] Calculate the ratio of the throughput of each type of acceleration chip under the current configuration of the task to obtain the performance ratio of each type of acceleration chip;
[0016] The performance ratio is referred to as the computing capacity.
[0017] Optionally, the proposal information is determined according to the computing power of each type of acceleration chip under the current configuration of each task, the type of acceleration chip, the number of each type of acceleration chips, the number of threads allocated on each type of acceleration chip, and the maximum number of threads corresponding to each task obtained, including:
[0018] Perform the following steps for each of the tasks described:
[0019] Determine the target number of threads allocated to each type of acceleration chip after the increase under the proposed configuration according to the acceleration chip type, the number of each type of acceleration chips, the number of threads allocated to each type of acceleration chips, and the maximum number of threads corresponding to the task;
[0020] According to the computing power of each type of acceleration chip under the current configuration of the task, the type of acceleration chip, the number of each type of acceleration chips, the type of acceleration chip after increase, the total number of each type of acceleration chips after increase, the number of threads allocated on each type of acceleration chip, the target number of threads allocated on each type of acceleration chip after increase under the configuration to be proposed, and the maximum number of threads corresponding to the task, the performance waste data under the current configuration and the performance waste data under the configuration to be proposed are determined;
[0021] Determine the communication overhead under the current configuration and the communication overhead under the configuration to be proposed according to the computing power of each type of acceleration chips under the current configuration of the task, the number of each type of acceleration chips, the total number of each type of acceleration chips after the increase, the maximum number of threads corresponding to the task, the performance waste data under the current configuration, the performance waste data under the configuration to be proposed, and the respective influencing factors of the acquired number of acceleration chips and the maximum number of threads;
[0022] The proposal information is determined based on the computing power of each type of acceleration chips under the current configuration of the task, the number of each type of acceleration chips, the type of acceleration chips, the type of acceleration chips after the increase, the total number of each type of acceleration chips after the increase, the performance waste data under the current configuration, the performance waste data under the configuration to be proposed, the communication overhead under the current configuration, and the communication overhead under the configuration to be proposed.
[0023] Optionally, determining the target number of threads allocated to each type of acceleration chip after the increase under the proposed configuration according to the acceleration chip type, the number of each type of acceleration chips, the number of threads allocated to each type of acceleration chips, and the maximum number of threads corresponding to the task includes:
[0024] According to the acceleration chip type and the number of each type of acceleration chips, determine the target acceleration chip type to be added and the total number of each type of acceleration chips after the addition;
[0025] According to the added acceleration chip type, the total number of each type of acceleration chips after the addition, and the number of threads allocated on each type of acceleration chips, determine the target number of threads allocated on each type of acceleration chips under the configuration to be proposed, and calculate the sum of the threads allocated in the proposal;
[0026] Among them, the sum of the threads allocated in the proposal to be proposed is greater than or equal to the maximum number of threads corresponding to the task.
[0027] Optionally, the method of determining the performance waste data under the current configuration and the performance waste data under the configuration to be proposed according to the computing power of each type of acceleration chip under the current configuration of the task, the acceleration chip type, the number of each type of acceleration chips, the type of acceleration chip after increase, the total number of each type of acceleration chips after increase, the number of threads allocated on each type of acceleration chip, the target number of threads allocated on each type of acceleration chip after increase under the configuration to be proposed, and the maximum number of threads corresponding to the task, includes:
[0028] Determine the overload factor under the current configuration and the overload factor under the configuration to be proposed according to the computing power of each type of acceleration chip under the current configuration, the number of threads allocated on each type of acceleration chip, and the target number of threads allocated on each type of acceleration chip after the increase under the configuration to be proposed;
[0029] Based on the computing power of each type of acceleration chip under the current configuration of the task, the acceleration chip type, the number of each type of acceleration chips, the type of acceleration chip after increase, the total number of each type of acceleration chips after increase, the number of threads allocated on each type of acceleration chip, the target number of threads allocated on each type of acceleration chip after increase under the configuration to be proposed and the maximum number of threads corresponding to the task, the overload factor under the current configuration and the overload factor under the configuration to be proposed, the performance waste data under the current configuration and the performance waste data under the configuration to be proposed are calculated.
[0030] Optionally, after calculating and obtaining the performance waste data under the current configuration and the performance waste data under the configuration to be proposed, the method further includes:
[0031] Determine the sum of the performance of each type of acceleration chip analyzed under the current configuration and the sum of the performance of each type of acceleration chip analyzed under the configuration to be proposed according to the computing power of each type of acceleration chip under the current configuration of the task, the number of each type of acceleration chips, and the total number of each type of acceleration chips after the increase;
[0032] The performance waste data under the current configuration, the performance waste data under the configuration to be proposed, the sum of the performance analyzed by each type of acceleration chip under the current configuration, and the sum of the performance analyzed by each type of acceleration chip under the configuration to be proposed, determine the proportion of wasted performance under the current configuration to the analyzed performance and the proportion of wasted performance under the configuration to be proposed to the analyzed performance.
[0033] Optionally, the proposal information is determined according to the computing power of each type of acceleration chip under the current configuration of the task, the number of each type of acceleration chips, the type of acceleration chip, the type of acceleration chip after the increase, the total number of each type of acceleration chips after the increase, performance waste data under the current configuration, performance waste data under the configuration to be proposed, communication overhead under the current configuration, and communication overhead under the configuration to be proposed, including:
[0034] Determine the sum of the performance of each type of acceleration chip analyzed under the current configuration and the sum of the performance of each type of acceleration chip analyzed under the configuration to be proposed according to the computing power of each type of acceleration chip under the current configuration of the task, the number of each type of acceleration chips, and the total number of each type of acceleration chips after the increase;
[0035] The target performance under the current configuration is obtained by subtracting the waste data of the performance under the current configuration from the sum of the performances analyzed by each type of acceleration chip under the current configuration and adding the communication overhead under the current configuration;
[0036] The target performance of the configuration to be proposed is obtained by subtracting the waste data of the performance of the configuration to be proposed from the sum of the performance of each type of acceleration chip analyzed under the configuration to be proposed and adding the communication overhead under the configuration to be proposed;
[0037] Comparing the target performance under the configuration to be proposed with the target performance under the current configuration, to obtain a speedup ratio of the target performance under the configuration to be proposed relative to the target performance under the current configuration;
[0038] The proposal information is determined based on the number of acceleration chips of each type, the type of acceleration chips after the increase, the total number of acceleration chips of each type after the increase, and the corresponding acceleration ratio.
[0039] Optionally, the proposal information includes the target acceleration chip type and acceleration ratio applied for addition corresponding to each task;
[0040] The resource scheduling of each thread in the target task according to the proposal information includes:
[0041] Compare the speedup ratios corresponding to each of the tasks, determine the proposal corresponding to the maximum speedup ratio as the target proposal, and use the task corresponding to the target proposal as the target task;
[0042] Generate scheduling information according to the target task and the type of target acceleration chip applied for addition corresponding to the target task;
[0043] According to the target acceleration chip type requested for addition corresponding to the target task in the scheduling information, the target acceleration chip resources to be allocated are determined, and according to the number of target threads pre-allocated on each type of acceleration chip after the addition in the proposal information, the actual threads in the target task are allocated to the corresponding target acceleration chip.
[0044] In a second aspect, an embodiment of the present application provides a task scheduling device, the device comprising:
[0045] An acquisition module, used to acquire statistical data of each task in the plurality of tasks, wherein the statistical data includes the throughput of each type of acceleration chip of the task under the current configuration, wherein the current configuration includes the acceleration chip type, the number of each type of acceleration chips, and the number of threads allocated on each type of acceleration chip;
[0046] A processing module, used to determine proposal information according to the statistical data of each task, the current configuration and the acquired maximum number of threads corresponding to each task, wherein the proposal information is used to represent a proposal for applying for required resources for each task;
[0047] A scheduling module is used to schedule resources for each thread in a target task according to the proposal information, and the target task is at least one task among all the tasks.
[0048] The task scheduling method and device provided by the embodiment of the present application obtains the statistical data and current configuration of each task, such as the throughput of each type of acceleration chip under the current configuration of the task, and determines the resources required for each task application according to the throughput of each type of acceleration chip under the current configuration, the type of acceleration chip in the current configuration, the number of each type of acceleration chip and the number of threads allocated on each type of acceleration chip, and combines the maximum number of threads corresponding to each task to form proposal information corresponding to each task, and determines the target task to be allocated resources by comprehensively considering the proposal information corresponding to each task, and allocates the resources to the target task and specifically to each thread based on the proposal information. Therefore, based on the statistical data and current configuration of the elastic training task, the load balancing within the elastic training task and the resource allocation between tasks are comprehensively considered, wherein the load balancing within the task fully considers the difference in actual computing power between heterogeneous acceleration chips based on throughput calculation to determine the allocation of each thread in the target task, thereby proposing an incremental acceleration chip resource request with better efficiency, and determining the target task to be allocated when resources permit, so as to maximize cluster utilization and minimize the average job completion time. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0050] Figure 1 A flowchart of a task scheduling method provided in an embodiment of the present application;
[0051] Figure 2 A flowchart of a task scheduling method provided in yet another embodiment of the present application;
[0052] Figure 3A A schematic diagram of a task scheduling scenario provided for an embodiment of the present application;
[0053] Figure 3B A schematic diagram of a task scheduling scenario provided for another embodiment of the present application;
[0054] Figure 4 A schematic diagram of the structure of a task scheduling device provided in an embodiment of the present application;
[0055] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0057] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can also include other sequential instances in addition to those illustrated or described. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0058] Currently, training tasks can start processing as soon as possible using available resources after supporting elasticity, eliminating mandatory waiting caused by group scheduling, and using remaining resources to continue training when resources are preempted, thereby improving cluster utilization and reducing task completion time. However, this technology is rarely used in production clusters, mainly because this elastic method will lead to difficult-to-reproduce model accuracy, and tasks show different capabilities when using heterogeneous acceleration chips, which is not commensurate with the theoretical computing power of acceleration chips. In addition, the number of threads is a discrete integer while the computing power of acceleration chips is a continuous real number. Heterogeneous acceleration chips are usually not allocated a number of threads proportional to their computing power, which can easily cause load imbalance and performance waste.
[0059] Therefore, in the existing technology, in the elastic heterogeneous, precision-invariant deep learning training task scenario, there are problems of load imbalance and performance waste, which in turn leads to low cluster utilization and low operating efficiency.
[0060] In order to solve the above problems, the invention of this application is conceived as follows: the AI Master, an artificial intelligence management module of the task currently running on the cluster in the server, monitors the statistical data of the task, such as the throughput under the current configuration, and then determines the proposal content based on the throughput, current configuration and the maximum number of threads specified when configuring the task and reports it to the cluster scheduler in the server. The cluster scheduler determines which task to allocate the idle acceleration chip resources to based on the proposal information obtained by the AI Master analysis of multiple tasks, and realizes the resource allocation between tasks. Then the AI Master allocates the acceleration chip resources to each thread in the task based on the analyzed proposal information. The load balancing within the elastic training task and the resource allocation between tasks are comprehensively considered, and the two work together to maximize the cluster utilization and minimize the average job completion time.
[0061] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0062] Figure 1 The flowchart of the task scheduling method provided in the embodiment of the present application is shown in FIG. 1 . The method of the present embodiment can be executed by a server, in which a cluster scheduler and an artificial intelligence management module AI Master for tasks running on the cluster can be deployed. Figure 1 As shown, the method of this embodiment may include:
[0063] S101: Obtain statistical data and current configuration of each task.
[0064] Among them, the statistical data include the throughput of each type of acceleration chip of the task under the current configuration, the current configuration includes the acceleration chip type, the number of each type of acceleration chips and the number of threads allocated on each type of acceleration chip, and each of the tasks supports flexible training.
[0065] The acceleration chip here can be a GPU (Graphics Processing Unit, GPU) chip or an AI chip. The following embodiments all take GPU as an example to explain the task scheduling method in detail.
[0066] For example, the statistical data includes the throughput of each type of GPU of the task under the current configuration, and the current configuration includes the GPU type, the number of each type of GPU, and the number of threads allocated on each type of GPU.
[0067] In this embodiment, the task supports elastic training, and each task is configured with an AI Master. AI Master is used to: estimate performance by monitoring the statistical data of the task, and propose a proposal to apply for the required resources to expand the scale; allocate threads (i.e., EasyScaleThread) of a deep learning training framework that supports elastic heterogeneity and lossless precision between heterogeneous GPUs to maximize GPU utilization. Among them, EasyScaleThread: Here, the user programs the application and algorithm logic to execute in one thread, which is in line with the current programming model in the field of deep learning. When programming, the user only needs to consider the logic of the application (for example, the learning rate hyperparameter) based on the number of theoretical workers (that is, the number of EasyScaleThreads, which is consistent with the number of workers used in the native distributed data parallel method (DistributedDataParallel, DDP) of PyTorch (deep learning computing framework)). At runtime, each GPU can execute any number of EasyScaleThreads, thereby achieving elastic training. Through such abstraction, deep learning training tasks are no longer tightly coupled with the fixed parallelism of the GPU.
[0068] Among them, during the training process, such as when running on a cluster, the AI Master monitors the statistical data of the task, that is, the throughput under the current configuration (the number N of heterogeneous GPUs (i.e., various types of GPUs) and the number or number of threads allocated on the heterogeneous GPUs).
[0069] S102: Determine proposal information according to the statistical data of each task, the current configuration and the acquired maximum number of threads corresponding to each task, wherein the proposal information is used to represent a proposal for applying for required resources for each task.
[0070] In this embodiment, when submitting an elastic task, the user needs to specify the maximum number of threads to be started (maxP). At the same time, the user can also specify the minimum number of GPUs that require resource guarantee (minP). Setting minP = maxP means that the task falls back to a fixed degree of parallelism (not using elastic resources).
[0071] Specifically, for each task, the AI Master of each task estimates the performance based on the throughput of the task under the current configuration, and proposes a proposal to apply for the required resources to expand the scale. And allocate threads between heterogeneous GPUs to maximize GPU utilization. Then the AI Master reports the proposal application (i.e., proposal information) to the cluster's scheduler, and the scheduler combines the proposal information submitted by the AI Master of each task to comprehensively consider the scheduling plan between tasks.
[0072] There is a scheduler on a cluster, which adopts a layered architecture. The cluster scheduler (Cluser Schedule) works in global mode and is responsible for coordinating resources between tasks.
[0073] S103: Perform resource scheduling on each thread in a target task according to the proposal information, where the target task is at least one task among all the tasks.
[0074] In this embodiment, the cluster scheduler determines which task to allocate idle GPU resources to based on the proposal information obtained by the AI Master analysis of multiple tasks, and implements resource allocation between tasks. Then the AI Master allocates GPU resources to each thread in the task based on the analyzed proposal information. The various types of GPUs here are referred to as heterogeneous GPUs.
[0075] The task scheduling method provided in the present application obtains the statistical data and current configuration of each task, such as the throughput of each type of GPU under the current configuration, and determines the resources required for each task application according to the throughput of each type of GPU under the current configuration, the GPU type in the current configuration, the number of each type of GPU, and the number of threads allocated on each type of GPU, and combines the maximum number of threads corresponding to each task to form the proposal information corresponding to each task. By comprehensively considering the proposal information corresponding to each task, the scheduling information of the target task containing the resources to be allocated is determined, and the resources are allocated to the target task and specifically to each thread based on the scheduling information. Therefore, based on the statistical data and current configuration of the elastic training task, the load balancing within the elastic training task and the resource allocation between tasks are comprehensively considered, wherein the load balancing within the task fully considers the difference in actual computing power between heterogeneous GPUs based on throughput calculation to determine the allocation of each thread in the target task, thereby proposing an efficient incremental GPU resource request, and determining the target task to be allocated when resources permit, so as to maximize cluster utilization and minimize the average job completion time.
[0076] Optionally, determining the proposal information according to the statistical data of each of the tasks, the current configuration, and the acquired maximum number of threads corresponding to each of the tasks can be achieved by the following steps:
[0077] Step a1: Determine the computing power of each type of acceleration chip for each task under the current configuration according to the throughput of each type of acceleration chip for each task under the current configuration.
[0078] Optionally, according to the throughput of each type of acceleration chip under the current configuration of each task, determining the computing capacity of each type of acceleration chip under the current configuration of each task can be achieved by the following steps:
[0079] The following steps are performed for each of the tasks: the throughput of each type of acceleration chip of the task under the current configuration is proportionally calculated to obtain the performance ratio of each type of acceleration chip; and the performance ratio is used as the computing power.
[0080] Step a2: Determine the proposal information based on the computing power of each type of acceleration chip under the current configuration for each task, the type of acceleration chip, the number of each type of acceleration chips, the number of threads allocated on each type of acceleration chip, and the maximum number of threads corresponding to each task obtained.
[0081] In this embodiment, the throughput of each type of GPU in the task under the current configuration is proportionally calculated to obtain the performance ratio of heterogeneous GPUs, that is, the computing power; based on the computing power, current configuration and the maximum number of threads corresponding to the task, the task running acceleration ratio after adding heterogeneous GPUs is determined through model calculation, and proposal information is generated.
[0082] Exemplary, combined Figure 2 As shown, Figure 2 A flowchart of a task scheduling method provided in yet another embodiment of the present application. Figure 2 Two tasks, Job0 and Job1, are shown in the figure. Both tasks are configured with their own AI Master. Three heterogeneous GPU resources are allocated to Job0: V100, P100, and T4. Job0 is divided into three processes: PyTorch worker0, PyTorch worker1, and PyTorch worker2. PyTorch worker0 of Job0 includes three threads (EST_0, EST_1, and EST_2), PyTorch worker1 of Job0 includes two threads (EST_3 and EST_4), and PyTorch worker2 of Job0 includes one thread (EST_5). Two homogeneous GPU resources are allocated to Job1: V100. Job1 is divided into two processes (PyTorch worker0 and PyTorch worker1), that is, each V100 corresponds to one process, each process includes three threads, the PyTorch worker0 of Job1 includes three threads (EST_0, EST_1 and EST_2), and the PyTorch worker1 of Job1 includes three threads (EST_3, EST_4 and EST_5).
[0083] Specifically, the AI Master of Job0 makes a proposal to apply for the required resources based on the throughput, current configuration and maximum number of threads of Job0 under the current configuration by evaluating the performance. Similarly, the AI Master of Job1 makes a proposal to apply for the required resources based on the throughput, current configuration and maximum number of threads of Job1 under the current configuration by evaluating the performance.
[0084] like Figure 2The resource proposals shown in the figure are: for Job1, its AI Master calculates that if a GPU V100 is added to Job1, the acceleration ratio (i.e., Speed up) is 1.5x, that is, the task completion time can be accelerated by 1.5 times under the current configuration. For Job0, its AI Master calculates that if a GPU V100 is added to Job1, the Speedup is 1.3x, that is, the task completion time can be accelerated by 1.3 times under the current configuration; if a GPU P100 is added to Job1, the Speed up is 1.1x, that is, the task completion time can be accelerated by 1.1 times under the current configuration, and so on. If a GPU T4 is added to Job1, the calculation process is similar and will not be repeated here.
[0085] Among them, the cluster scheduler (Cluster Schedule) selects the highest speedup ratio based on the above speedup ratio and assigns the available GPUs (i.e. Available GPUs), such as V100, to the task with the highest speedup ratio, such as Job1.
[0086] Optionally, based on the above embodiment, this embodiment provides a detailed description of how to determine the proposal information. According to the computing power of each type of acceleration chip under the current configuration of each task, the type of acceleration chip, the number of each type of acceleration chip, the number of threads allocated on each type of acceleration chip, and the maximum number of threads corresponding to each task obtained, the proposal information can be determined by the following steps:
[0087] Perform the following steps for each of the tasks described:
[0088] Step b1, according to the acceleration chip type, the number of each type of acceleration chips, the number of threads allocated on each type of acceleration chips and the maximum number of threads corresponding to the task, determine the target number of threads allocated on each type of acceleration chips after the increase under the proposed configuration.
[0089] Step b2, according to the computing power of each type of acceleration chip under the current configuration of the task, the type of acceleration chip, the number of each type of acceleration chips, the type of acceleration chip after increase, the total number of each type of acceleration chips after increase, the number of threads allocated on each type of acceleration chip, the target number of threads allocated on each type of acceleration chip after increase under the configuration to be proposed, and the maximum number of threads corresponding to the task, determine the performance waste data under the current configuration and the performance waste data under the configuration to be proposed.
[0090] In this embodiment, the performance waste data under the current configuration is calculated based on the computing power of each type of GPU under the current configuration, the GPU type, the number of GPUs of each type, the number of threads allocated on each type of GPU, and the maximum number of threads corresponding to the task; the performance waste data under the configuration to be proposed is determined based on the increased GPU type, the total number of GPUs of each type after the increase, the number of threads allocated on each type of GPU, the target number of threads allocated on each type of GPU after the increase under the configuration to be proposed, and the maximum number of threads corresponding to the task.
[0091] Step b3, based on the computing power of each type of acceleration chip under the current configuration of the task, the number of each type of acceleration chips, the total number of each type of acceleration chips after the increase, the maximum number of threads corresponding to the task, the performance waste data under the current configuration, the performance waste data under the configuration to be proposed, and the respective influencing factors of the number of acceleration chips and the maximum number of threads obtained, calculate the communication overhead under the current configuration and the communication overhead under the configuration to be proposed.
[0092] In this embodiment, the communication overhead under the current configuration is calculated based on the computing power of each type of GPU for the task under the current configuration, the number of each type of GPU, the maximum number of threads corresponding to the task, the performance waste data under the current configuration, and the respective influencing factors of the obtained number of GPUs and the maximum number of threads; the communication overhead under the current configuration and the communication overhead under the configuration to be proposed are calculated based on the total number of each type of GPU after the increase, the maximum number of threads corresponding to the task, the performance waste data under the configuration to be proposed, and the respective influencing factors of the obtained number of GPUs and the maximum number of threads.
[0093] Step b4, determine the proposal information according to the computing power of each type of acceleration chip under the current configuration of the task, the number of each type of acceleration chips, the type of acceleration chip, the type of acceleration chip after the increase, the total number of each type of acceleration chips after the increase, the performance waste data under the current configuration, the performance waste data under the configuration to be proposed, the communication overhead under the current configuration and the communication overhead under the configuration to be proposed.
[0094] In this embodiment, in the process of determining the proposal information, the resource allocation within the task can be calculated. AI Master calculates the allocation method within the task based on the computing power of heterogeneous GPUs, combined with the current configuration, such as GPU type, number of heterogeneous GPUs, number of threads allocated on heterogeneous GPUs, and maxP. Among them, the allocation method of computing tasks within the task (AI Master role) includes average allocation and load balancing methods. DDP-compatible tasks can use a number of GPUs less than or equal to the maximum degree of parallelism (ie, maxP), and can continuously use a flexible number of GPUs for training.
[0095] Combination Figure 3A and Figure 3B As shown, Figure 3A Schematic diagram of task scheduling scenario provided in the embodiment of the present application and Figure 3B A schematic diagram of a task scheduling scenario provided by another embodiment of the present application. Figure 3A and Figure 3B This shows how to distribute computational tasks within a task (calculated by the AI Master role), including average distribution (e.g. Figure 3A The diagram shows the scheduling scenario of the average distribution method) and the load balancing method (such as Figure 3B Figure 1 shows a scheduling scenario diagram of the load balancing method. DDP-compatible tasks can use a number of GPUs less than or equal to the maximum parallelism (i.e., maxP), and can continuously use an elastic number of GPUs for training. If the allocated GPUs are homogeneous and the number is a divisor of maxP, then it is only necessary to evenly distribute EasyScaleThreads to these GPUs (e.g., Figure 3A and 3B In the T4, two workers are evenly divided between the two T4s. Figure 3A and 3B In the figure, worker refers to thread, GPU idle cycles refers to GPU idle cycles, SyncBarrier refers to synchronization barrier, Naive worker allocation on GPUs introduces idle cycles, and Resource-aware allocation to improve jobperformance refers to the use of resource performance-aware allocation method to reasonably allocate resources to improve work efficiency).
[0096] However, industrial GPU clusters are often heterogeneous. When a task is assigned to heterogeneous GPUs, it is often inefficient to evenly distribute EasyScaleThreads on these GPUs. Figure 3AAs shown in Figure 1. Different computing capabilities of heterogeneous GPUs will result in different forward-backward computation completion times. At the same time, Synchronized Stochastic Gradient Descent (Sync-SGD) executes a synchronization point on all GPUs to wait for the last GPU (that is, the GPU with the worst computing capability) to complete the computation, which will result in a large number of GPU cycles being idle, as shown in Figure 1. Figure 3A Taking this into account, it is necessary to allocate EasyScaleThread according to the computing power of the GPU to achieve load balancing and eliminate idle cycles to the greatest extent, as shown in Figure 3B shown.
[0097] Specifically, tasks exhibit different capabilities when utilizing heterogeneous GPUs (e.g., ResNet50 is 2.45x faster on V100 than on T4, but BERT is 1.55x), which is not commensurate with the theoretical computational capabilities of GPU hardware. Therefore, static allocation methods may make suboptimal decisions. In addition, there is a gap between the allocated threads and the actual computational capabilities. The number of threads is a discrete integer (e.g., 2 threads for P100 and 1 thread for T4), while the computational capabilities of GPUs are continuous (e.g., P100 is 2.5x faster than T4). This results in heterogeneous GPUs often not being allocated the number of threads proportional to their computational capabilities (as a result, P100 takes 0.8t time, but T4 takes t time). Therefore, the AI Master module can profile tasks based on the statistics of EasyScaleThread execution and use an analytical model to evaluate performance waste, because the resource allocation combinations of heterogeneous GPUs are too large to be directly analyzed.
[0098] Based on performance waste data, computing power of heterogeneous GPUs, configuration data, maxP and influencing factors, the communication overhead is calculated, and the final acceleration ratio is calculated through the estimated computing performance and communication overhead to form proposal information. There is no need to modify hyperparameters, thereby ensuring the accuracy of the trained model. It also supports elastic heterogeneity and implements load-balanced proposals, thereby improving operation time and resource utilization.
[0099] Optionally, according to the acceleration chip type, the number of acceleration chips of each type, the number of threads allocated on the acceleration chips of each type, and the maximum number of threads corresponding to the task, determining the target number of threads allocated on the increased acceleration chips of each type under the proposed configuration can be achieved by the following steps:
[0100] Step c1: Determine the target acceleration chip type to be added and the total number of acceleration chips of each type after addition according to the acceleration chip type and the number of acceleration chips of each type.
[0101] Step c2, according to the added acceleration chip type, the total number of each type of acceleration chips added, and the number of threads allocated to each type of acceleration chips, determine the target number of threads allocated to each type of acceleration chips under the proposed configuration, and calculate the sum of the threads allocated in the proposed configuration;
[0102] Among them, the sum of the threads allocated in the proposal to be proposed is greater than or equal to the maximum number of threads corresponding to the task.
[0103] In this embodiment, according to the GPU type and the number of GPUs of each type in the current configuration, first determine the resource GPU that needs to be added in the proposal application, that is, the target GPU type. For example, if there are V100 and T4 in the current configuration, the target GPU types that can be added can be V100 and T4. Then, combine the GPU type in the current configuration, each target GPU type, the total number of GPUs, and the number of threads allocated on each type of GPU in the current configuration to calculate the number of threads that need to run on each GPU in the proposal, and calculate the sum of the threads allocated in the proposal. Here, it is necessary to ensure that the sum of the threads allocated in the proposal is greater than or equal to the maximum number of threads corresponding to the task.
[0104] Combined with the following formula (1), the sum of threads allocated in the proposal to be proposed (i.e. # of threads) is calculated:
[0105] # of thread = ∑ i N i ×A i ,#of threads ≥ max P (1)
[0106] Where, N in formula (1) i Indicates the number of heterogeneous GPUs (for example, the number of GPUs of each type in the current configuration or the number of GPUs of each type in the configuration to be proposed (i.e., the total number of GPUs of each type after the increase, indicating the number of GPUs corresponding to each type)), and the subscript i indicates the type of GPU (i.e., the GPU type or the GPU type after the increase). C i Represents the computing power of heterogeneous GPUs related to computing load (mini-batch per second, where mini-batch is: in deep learning scenarios, when executing the gradient descent algorithm on the training set, the entire data set is divided into several small training sets, and a small subset is trained each time. On the one hand, it avoids the huge amount of computation caused by the participation of the entire data set in training at one time, and on the other hand, the gradient direction of the subset is not too different from that of the entire data set, which ensures the correctness of the training.); Ai Represents the number of EasyScaleThreads allocated on the heterogeneous GPU. As shown in formula (1), the sum of the number of allocated threads should be greater than or equal to maxP, otherwise the proposal will fail due to insufficient number of threads. Therefore, in the proposal calculation process, resource allocation within the task is realized.
[0107] Optionally, according to the computing power of each type of acceleration chip under the current configuration of the task, the acceleration chip type, the number of each type of acceleration chips, the type of acceleration chip after increase, the total number of each type of acceleration chips after increase, the number of threads allocated on each type of acceleration chip, the target number of threads allocated on each type of acceleration chip after increase under the configuration to be proposed, and the maximum number of threads corresponding to the task, the performance waste data under the current configuration and the performance waste data under the configuration to be proposed can be determined by the following steps:
[0108] Step d1, determine the overload factor under the current configuration and the overload factor under the configuration to be proposed based on the computing power of each type of acceleration chip under the current configuration, the number of threads allocated on each type of acceleration chip, and the target number of threads allocated on each type of acceleration chip after the increase under the configuration to be proposed.
[0109] Step d2, based on the computing power of each type of acceleration chip under the current configuration of the task, the acceleration chip type, the number of each type of acceleration chips, the type of acceleration chip after increase, the total number of each type of acceleration chips after increase, the number of threads allocated on each type of acceleration chip, the target number of threads allocated on each type of acceleration chip after increase under the configuration to be proposed and the maximum number of threads corresponding to the task, the overload factor under the current configuration and the overload factor under the configuration to be proposed, calculate the performance waste data under the current configuration and the performance waste data under the configuration to be proposed.
[0110] In this embodiment, the overload factor f is calculated by combining formula (2): overload (The overload factor under the current configuration and the overload factor under the proposed configuration can be calculated):
[0111]
[0112] Where, as shown in formula (2), the overload factor f overload Indicates the maximum number of threads that each computing power of all GPU types bears. If a GPU bears too many threads, it will become a performance bottleneck and slow down other GPUs due to load imbalance. Therefore, the overload factor f can be used to calculate the maximum number of threads that can be taken by each computing power of all GPU types. overload , C i , A i, maxP and the sum of the allocated threads obtained by formula (1), and the performance waste data waste (including the performance waste data under the current configuration and the performance waste data under the proposed configuration) are calculated by formula (3):
[0113]
[0114] Specifically, the performance waste under the current configuration and the performance waste under the proposed configuration can be calculated by formula (3). Taking the current configuration as an example, under the current configuration, the computing capacity C of the analysis i Theoretical performance can be obtained by summing up, but the current configuration may not be able to fully realize the theoretical performance due to load balancing issues. Therefore, it is necessary to calculate the difference between theoretical performance and actual performance, which is the waste of performance.
[0115] Optionally, after calculating and obtaining the performance waste data under the current configuration and the performance waste data under the configuration to be proposed, the method further includes the following steps:
[0116] Step e1, determining the sum of the performance of each type of acceleration chip analyzed under the current configuration and the sum of the performance of each type of acceleration chip analyzed under the configuration to be proposed according to the computing power of each type of acceleration chip under the current configuration of the task, the number of each type of acceleration chips, and the total number of each type of acceleration chips after the increase;
[0117] Step e2, the performance waste data under the current configuration, the performance waste data under the configuration to be proposed, the sum of the performance analyzed by each type of acceleration chip under the current configuration, and the sum of the performance analyzed by each type of acceleration chip under the configuration to be proposed, determine the proportion of wasted performance under the current configuration to the analyzed performance and the proportion of wasted performance under the configuration to be proposed to the analyzed performance.
[0118] In this embodiment, the ratio N of wasted performance to analyzed performance can be calculated by formula (4): waste (including the ratio of wasted performance under the current configuration to the analyzed performance, and the ratio of wasted performance under the proposed configuration to the analyzed performance):
[0119] N waste =[waste / (∑ i N i ×C i )]% (4)
[0120] Among them, sum(N*C) (that is, ∑ i N i ×C i ) is to calculate the sum of the performance of all GPU profiles.
[0121] Specifically, performance waste is composed of waste caused by load imbalance and over-provisioned capacity. The normalized percentage of performance waste is calculated by formula (4), making the relationship between wasted performance and profiled performance more intuitive.
[0122] Optionally, according to the computing power of each type of acceleration chip of the task under the current configuration, the number of each type of acceleration chips, the type of acceleration chip, the type of acceleration chip after the increase, the total number of each type of acceleration chips after the increase, the performance waste data under the current configuration, the performance waste data under the configuration to be proposed, the communication overhead under the current configuration and the communication overhead under the configuration to be proposed, the proposal information is determined, which can be achieved by the following steps:
[0123] Step f1, determining the sum of the performance of each type of acceleration chip analyzed under the current configuration and the sum of the performance of each type of acceleration chip analyzed under the configuration to be proposed according to the computing power of each type of acceleration chip under the current configuration of the task, the number of each type of acceleration chips, and the total number of each type of acceleration chips after the increase;
[0124] Step f2, subtracting the wasted data of the performance under the current configuration from the sum of the performances analyzed by each type of acceleration chip under the current configuration, and adding the communication overhead under the current configuration to obtain the target performance under the current configuration;
[0125] Step f3, subtracting the waste data of the performance under the configuration to be proposed from the sum of the performance of each type of acceleration chip analyzed under the configuration to be proposed, and adding the communication overhead under the configuration to be proposed, to obtain the target performance under the configuration to be proposed;
[0126] Step f4, comparing the target performance under the configuration to be proposed with the target performance under the current configuration, to obtain a speedup ratio of the target performance under the configuration to be proposed relative to the target performance under the current configuration;
[0127] Step f5, determining the proposal information according to the number of acceleration chips of each type, the type of acceleration chips after increase, the total number of acceleration chips of each type after increase and the corresponding acceleration ratio.
[0128] In this embodiment, the communication overhead is further considered. The communication overhead is related to the number of GPUs and maxP. Therefore, the communication overhead COMM can be calculated by formula (5): overhead (including communication overhead under the current configuration and communication overhead under the configuration to be proposed):
[0129] Comm overhead =α×∑ i N i +β×maxP (5)
[0130] Among them, α represents the impact factor of the number of GPUs on the communication overhead; β represents the impact factor of the maximum number of threads maxP on the communication overhead.
[0131] The performance perf under the current proposal can be calculated by formula (6). The specific calculation is to use the total profiled performance, subtract the performance waste, and then consider the communication overhead:
[0132] perf=∑ i N i ×C i -waste+Comm overhead (6)
[0133] Similarly, the performance perf under the current configuration can be calculated by formula (6) cur .
[0134] Then, the final speedup is calculated based on the estimated computing performance and communication overhead using formula (7):
[0135] speedup=perf / perf cur (7)
[0136] Specifically, after obtaining the analyzed computing power, the intra-task load balancer will submit the K proposals with the highest performance to the cluster scheduler (combined with Figure 2 In resource proposal, for each task, due to different resource allocation combinations within the task, the corresponding calculated speedup ratio is different. Therefore, for the required GPU, the one with the highest speedup ratio needs to be calculated as the proposal with the highest performance under the required GPU type. Since the application may require multiple GPU types, for example Figure 2 Taking Job0 as an example, each incremental GPU corresponds to a proposal with the highest performance, so K proposals with the highest performance need to be submitted).
[0137] These proposals will satisfy the constraints of total cluster resources, minP, maxP, and normalized resource waste ratio. When a task is executed for the first time and there is no performance data for heterogeneous GPUs, the performance ratio of heterogeneous GPUs is determined based on historical data. Performance estimation may sometimes fail, which may lead to poor training performance. Therefore, once poor performance is observed, it may be caused by inaccurate performance estimation or potential interference between tasks. You can fall back to using the previous resources and release the newly allocated resources.
[0138] Optionally, the proposal information includes the target acceleration chip type and acceleration ratio corresponding to each task. According to the proposal information, resource scheduling for each thread in the target task can be achieved by the following steps:
[0139] Step g1, compare the acceleration ratios corresponding to each of the tasks, determine the proposal corresponding to the maximum acceleration ratio as the target proposal, and take the task corresponding to the target proposal as the target task; if there is at least one target proposal, then there is at least one target task.
[0140] Step g2: Generate scheduling information according to the target task and the type of target acceleration chip applied for addition corresponding to the target task;
[0141] Step g3: Determine the target acceleration chip resources to be allocated according to the target acceleration chip type applied for addition corresponding to the target task in the scheduling information, and allocate the actual threads in the target task to the corresponding target acceleration chip according to the number of target threads pre-allocated on each type of acceleration chip after addition in the proposal information.
[0142] In this embodiment, the scheduling between tasks can be performed by the inter-task scheduler. Among them, the inter-task scheduler is a cluster scheduler that can respond to the proposals proposed by the AI Master module of the task based on the available GPUs. In order to improve the overall utilization of the cluster and the throughput of the aggregated tasks, the inter-task scheduler believes in the estimates in the AI Master proposal. If multiple proposals introduce the same average speedup ratio, the scheduler will give priority to proposals that accept more GPU requests. It adopts a greedy algorithm and tends to accept proposals with higher average speedups per GPU. The inter-task scheduler sorts the proposals in descending order according to the average speedup ratio of the proposals. Then, it processes these proposals one by one and starts to accept the proposals ranked first (when the cluster resources meet the proposal resource requirements). If multiple proposals introduce the same average speedup ratio, the scheduler will give priority to proposals that accept more GPU requests. After accepting the proposal, the scheduler updates the cluster available resource information and subtracts the resources of the accepted proposal from it. The scheduler repeats this step until all proposals are fully processed or the cluster resources are fully allocated. The cluster scheduler applies the heuristic algorithm mentioned above to allow elastic tasks to make the best use of idle resources. These resources usually belong to someone else but are temporarily idle. However, if these GPUs need to be returned, preemption may be triggered. In this case, the cluster scheduler will try to allocate the same GPU as the preempted GPU. If the attempt times out, the task will fall back to best-effort to utilize the remaining GPUs it currently owns.
[0143] This embodiment comprehensively considers the load balancing within the task and the resource allocation between tasks of the elastic training task. The balance within the task fully considers the difference in actual computing power between heterogeneous GPUs to determine the allocation of EasyScaleThread, thereby making efficient incremental GPU resource requests to the inter-task scheduler. The inter-task scheduler responds to these requests and greedily selects requests with higher acceleration ratios if resources permit. The two work together to maximize cluster utilization and minimize average job completion time.
[0144] Therefore, this application adopts a hierarchical scheduler structure. The load balancer in the task proposes the required resources to expand the scale based on the runtime and historical statistical data, and allocates EasyScaleThread between heterogeneous GPUs to maximize GPU utilization. Between tasks, the cluster scheduler is responsible for responding to task proposals and coordinating resource allocation between tasks to improve cluster resource utilization.
[0145] Based on the same idea, the present application also provides a device corresponding to the above method, such as Figure 4 As shown, Figure 4 A schematic diagram of the structure of a task scheduling device provided in an embodiment of the present application. The task scheduling device may include:
[0146] An acquisition module 401 is used to acquire statistical data and current configuration of each task, wherein the statistical data includes the throughput of each type of acceleration chip of the task under the current configuration, and the current configuration includes the acceleration chip type, the number of each type of acceleration chips, and the number of threads allocated on each type of acceleration chip, and each task supports elastic training;
[0147] The processing module 402 is used to determine proposal information according to the statistical data of each task, the current configuration and the acquired maximum number of threads corresponding to each task, where the proposal information is used to represent a proposal for applying for required resources for each task;
[0148] The scheduling module 403 is used to schedule resources for each thread in the target task according to the proposal information, and the target task is at least one task among all the tasks.
[0149] In this embodiment, by setting an acquisition module 401, a processing module 402 and a scheduling module 403, by acquiring the statistical data and current configuration of each task, such as the throughput of each type of acceleration chip under the current configuration of the task, according to the throughput of each type of acceleration chip under the current configuration of the task, the type of acceleration chip in the current configuration, the number of each type of acceleration chip and the number of threads allocated on each type of acceleration chip, and in combination with the maximum number of threads corresponding to each task, the resources required for each task application are determined, and the proposal information corresponding to each task is formed, and the target task to be allocated resources is determined by comprehensively considering the proposal information corresponding to each task, and the resources are allocated to the target task and specifically to each thread based on the proposal information. Therefore, based on the statistical data and current configuration of the elastic training task, the load balancing within the elastic training task and the resource allocation between tasks are comprehensively considered, wherein the load balancing within the task fully considers the difference in actual computing power between heterogeneous acceleration chips based on throughput calculation to determine the allocation of each thread in the target task, thereby proposing an incremental acceleration chip resource request with better efficiency, and determining the target task to be allocated when resources allow, so as to maximize cluster utilization and minimize the average job completion time.
[0150] Optionally, the processing module 402 includes a first processing unit and a second processing unit; the first processing unit is used to determine the computing power of each type of acceleration chip for each task under the current configuration based on the throughput of each type of acceleration chip for each task under the current configuration; the second processing unit is used to determine the proposal information based on the computing power of each type of acceleration chip for each task under the current configuration, the acceleration chip type, the number of each type of acceleration chips, the number of threads allocated on each type of acceleration chip, and the maximum number of threads corresponding to each task obtained.
[0151] Optionally, the first processing unit is specifically used to: perform the following steps for each of the tasks: calculate the ratio of the throughput of each type of acceleration chip for the task under the current configuration to obtain the performance ratio of each type of acceleration chip; and use the performance ratio as the computing power.
[0152] Optionally, the second processing unit is specifically configured to:
[0153] Perform the following steps for each of the tasks described:
[0154] Determine the target number of threads allocated to each type of acceleration chip after the increase under the proposed configuration according to the acceleration chip type, the number of each type of acceleration chips, the number of threads allocated to each type of acceleration chips, and the maximum number of threads corresponding to the task;
[0155] According to the computing power of each type of acceleration chip under the current configuration of the task, the type of acceleration chip, the number of each type of acceleration chips, the type of acceleration chip after increase, the total number of each type of acceleration chips after increase, the number of threads allocated on each type of acceleration chip, the target number of threads allocated on each type of acceleration chip after increase under the configuration to be proposed, and the maximum number of threads corresponding to the task, the performance waste data under the current configuration and the performance waste data under the configuration to be proposed are determined;
[0156] Determine the communication overhead under the current configuration and the communication overhead under the configuration to be proposed according to the computing power of each type of acceleration chips under the current configuration of the task, the number of each type of acceleration chips, the total number of each type of acceleration chips after the increase, the maximum number of threads corresponding to the task, the performance waste data under the current configuration, the performance waste data under the configuration to be proposed, and the respective influencing factors of the acquired number of acceleration chips and the maximum number of threads;
[0157] The proposal information is determined based on the computing power of each type of acceleration chips under the current configuration of the task, the number of each type of acceleration chips, the type of acceleration chips, the type of acceleration chips after the increase, the total number of each type of acceleration chips after the increase, the performance waste data under the current configuration, the performance waste data under the configuration to be proposed, the communication overhead under the current configuration, and the communication overhead under the configuration to be proposed.
[0158] Optionally, the second processing unit is specifically configured to:
[0159] According to the acceleration chip type and the number of each type of acceleration chips, determine the target acceleration chip type to be added and the total number of each type of acceleration chips after the addition;
[0160] According to the added acceleration chip type, the total number of each type of acceleration chips after the addition, and the number of threads allocated on each type of acceleration chips, determine the target number of threads allocated on each type of acceleration chips under the configuration to be proposed, and calculate the sum of the threads allocated in the proposal;
[0161] Among them, the sum of the threads allocated in the proposal to be proposed is greater than or equal to the maximum number of threads corresponding to the task.
[0162] Optionally, the second processing unit is specifically configured to:
[0163] Determine the overload factor under the current configuration and the overload factor under the configuration to be proposed according to the computing power of each type of acceleration chip under the current configuration, the number of threads allocated on each type of acceleration chip, and the target number of threads allocated on each type of acceleration chip after the increase under the configuration to be proposed;
[0164] Based on the computing power of each type of acceleration chip under the current configuration of the task, the acceleration chip type, the number of each type of acceleration chips, the type of acceleration chip after increase, the total number of each type of acceleration chips after increase, the number of threads allocated on each type of acceleration chip, the target number of threads allocated on each type of acceleration chip after increase under the configuration to be proposed and the maximum number of threads corresponding to the task, the overload factor under the current configuration and the overload factor under the configuration to be proposed, the performance waste data under the current configuration and the performance waste data under the configuration to be proposed are calculated.
[0165] Optionally, the second processing unit is further configured to:
[0166] After the performance waste data under the current configuration and the performance waste data under the configuration to be proposed are obtained by the calculation, the sum of the performance analyzed by each type of acceleration chip under the current configuration and the sum of the performance analyzed by each type of acceleration chip under the configuration to be proposed are determined according to the computing power of each type of acceleration chip under the current configuration of the task, the number of each type of acceleration chips, and the total number of each type of acceleration chips after the increase;
[0167] The performance waste data under the current configuration, the performance waste data under the configuration to be proposed, the sum of the performance analyzed by each type of acceleration chip under the current configuration, and the sum of the performance analyzed by each type of acceleration chip under the configuration to be proposed, determine the proportion of wasted performance under the current configuration to the analyzed performance and the proportion of wasted performance under the configuration to be proposed to the analyzed performance.
[0168] Optionally, the second processing unit is further specifically configured to:
[0169] Determine the sum of the performance of each type of acceleration chip analyzed under the current configuration and the sum of the performance of each type of acceleration chip analyzed under the configuration to be proposed according to the computing power of each type of acceleration chip under the current configuration of the task, the number of each type of acceleration chips, and the total number of each type of acceleration chips after the increase;
[0170] The target performance under the current configuration is obtained by subtracting the waste data of the performance under the current configuration from the sum of the performances analyzed by each type of acceleration chip under the current configuration and adding the communication overhead under the current configuration;
[0171] The target performance of the configuration to be proposed is obtained by subtracting the waste data of the performance of the configuration to be proposed from the sum of the performance of each type of acceleration chip analyzed under the configuration to be proposed and adding the communication overhead under the configuration to be proposed;
[0172] Comparing the target performance under the configuration to be proposed with the target performance under the current configuration, to obtain a speedup ratio of the target performance under the configuration to be proposed relative to the target performance under the current configuration;
[0173] The proposal information is determined based on the number of acceleration chips of each type, the type of acceleration chips after the increase, the total number of acceleration chips of each type after the increase, and the corresponding acceleration ratio.
[0174] Optionally, the proposal information includes the target acceleration chip type and acceleration ratio applied for addition corresponding to each task; the scheduling module is specifically used to:
[0175] Compare the speedup ratios corresponding to each of the tasks, determine the proposal corresponding to the maximum speedup ratio as the target proposal, and use the task corresponding to the target proposal as the target task;
[0176] Generate scheduling information according to the target task and the type of target acceleration chip applied for addition corresponding to the target task;
[0177] According to the target acceleration chip type requested for addition corresponding to the target task in the scheduling information, the target acceleration chip resources to be allocated are determined, and according to the number of target threads pre-allocated on each type of acceleration chip after the addition in the proposal information, the actual threads in the target task are allocated to the corresponding target acceleration chip.
[0178] The device provided in the embodiment of the present application can realize the above-mentioned Figure 1 -The implementation principle and technical effect of the method in the embodiment shown in 3 are similar and will not be repeated here.
[0179] Figure 5 The hardware structure diagram of the electronic device provided in the embodiment of the present application is shown in FIG. Figure 5 As shown, the device 500 provided in this embodiment includes: a processor 501 and a memory connected to the processor in communication. The processor 501 and the memory 502 are connected via a bus 503 .
[0180] In a specific implementation process, the processor 501 executes the computer-executable instructions stored in the memory 502, so that the processor 501 executes the method in the above method embodiment.
[0181] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0182] In the above Figure 5In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0183] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk storage.
[0184] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0185] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the task scheduling method of the above method embodiment is implemented.
[0186] An embodiment of the present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the task scheduling method described above is implemented.
[0187] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0188] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0189] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0190] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A task scheduling method, characterized in that: The method comprises: Obtaining statistical data and current configuration of each task, wherein the statistical data includes the throughput of each type of acceleration chip of the task under the current configuration, the current configuration includes the acceleration chip type, the number of each type of acceleration chips, and the number of threads allocated on each type of acceleration chip, and each task supports elastic training; Determine proposal information according to the statistical data of each task, the current configuration and the acquired maximum number of threads corresponding to each task, where the proposal information is used to represent a proposal for applying for required resources for each task; According to the proposal information, resources are scheduled for each thread in a target task, where the target task is at least one task among all the tasks.
2. The method according to claim 1, characterized in that The determining of proposal information according to the statistical data of each task, the current configuration and the acquired maximum number of threads corresponding to each task includes: Determine the computing power of each type of acceleration chip for each task under the current configuration according to the throughput of each type of acceleration chip for each task under the current configuration; The proposal information is determined based on the computing power of each type of acceleration chip under the current configuration of each task, the type of acceleration chip, the number of each type of acceleration chips, the number of threads allocated on each type of acceleration chip, and the maximum number of threads corresponding to each task obtained.
3. The method according to claim 2, characterized in that Determining the computing capacity of each type of acceleration chip under the current configuration for each task according to the throughput of each type of acceleration chip under the current configuration for each task includes: Perform the following steps for each of the tasks described: Calculate the ratio of the throughput of each type of acceleration chip under the current configuration of the task to obtain the performance ratio of each type of acceleration chip; The performance ratio is referred to as the computing capacity.
4. The method according to claim 2 or 3, characterized in that: The proposal information is determined according to the computing power of each type of acceleration chip under the current configuration of each task, the type of acceleration chip, the number of each type of acceleration chips, the number of threads allocated on each type of acceleration chip, and the maximum number of threads corresponding to each task obtained, including: Perform the following steps for each of the tasks described: Determine the target number of threads allocated to each type of acceleration chip after the increase under the proposed configuration according to the acceleration chip type, the number of each type of acceleration chips, the number of threads allocated to each type of acceleration chips, and the maximum number of threads corresponding to the task; According to the computing power of each type of acceleration chip under the current configuration of the task, the type of acceleration chip, the number of each type of acceleration chips, the type of acceleration chip after increase, the total number of each type of acceleration chips after increase, the number of threads allocated on each type of acceleration chip, the target number of threads allocated on each type of acceleration chip after increase under the configuration to be proposed, and the maximum number of threads corresponding to the task, the performance waste data under the current configuration and the performance waste data under the configuration to be proposed are determined; Determine the communication overhead under the current configuration and the communication overhead under the configuration to be proposed according to the computing power of each type of acceleration chips under the current configuration of the task, the number of each type of acceleration chips, the total number of each type of acceleration chips after the increase, the maximum number of threads corresponding to the task, the performance waste data under the current configuration, the performance waste data under the configuration to be proposed, and the respective influencing factors of the acquired number of acceleration chips and the maximum number of threads; The proposal information is determined based on the computing power of each type of acceleration chips under the current configuration of the task, the number of each type of acceleration chips, the type of acceleration chips, the type of acceleration chips after the increase, the total number of each type of acceleration chips after the increase, the performance waste data under the current configuration, the performance waste data under the configuration to be proposed, the communication overhead under the current configuration, and the communication overhead under the configuration to be proposed.
5. The method according to claim 4, characterized in that The step of determining the target number of threads allocated to each type of acceleration chip after the increase under the proposed configuration according to the acceleration chip type, the number of each type of acceleration chips, the number of threads allocated to each type of acceleration chip, and the maximum number of threads corresponding to the task includes: According to the acceleration chip type and the number of each type of acceleration chips, determine the target acceleration chip type to be added and the total number of each type of acceleration chips after the addition; According to the added acceleration chip type, the total number of each type of acceleration chips after the addition, and the number of threads allocated on each type of acceleration chips, determine the target number of threads allocated on each type of acceleration chips under the configuration to be proposed, and calculate the sum of the threads allocated in the proposal; Among them, the sum of the threads allocated in the proposal to be proposed is greater than or equal to the maximum number of threads corresponding to the task.
6. The method according to claim 4, characterized in that The method of determining the performance waste data under the current configuration and the performance waste data under the configuration to be proposed according to the computing power of each type of acceleration chip under the current configuration of the task, the acceleration chip type, the number of each type of acceleration chips, the type of acceleration chip after increase, the total number of each type of acceleration chips after increase, the number of threads allocated on each type of acceleration chip, the target number of threads allocated on each type of acceleration chip after increase under the configuration to be proposed, and the maximum number of threads corresponding to the task, includes: Determine the overload factor under the current configuration and the overload factor under the configuration to be proposed according to the computing power of each type of acceleration chip under the current configuration, the number of threads allocated on each type of acceleration chip, and the target number of threads allocated on each type of acceleration chip after the increase under the configuration to be proposed; Based on the computing power of each type of acceleration chip under the current configuration of the task, the acceleration chip type, the number of each type of acceleration chips, the type of acceleration chip after increase, the total number of each type of acceleration chips after increase, the number of threads allocated on each type of acceleration chip, the target number of threads allocated on each type of acceleration chip after increase under the configuration to be proposed and the maximum number of threads corresponding to the task, the overload factor under the current configuration and the overload factor under the configuration to be proposed, the performance waste data under the current configuration and the performance waste data under the configuration to be proposed are calculated.
7. The method according to claim 6, characterized in that After the calculation obtains the performance waste data under the current configuration and the performance waste data under the configuration to be proposed, the method further includes: Determine the sum of the performance of each type of acceleration chip analyzed under the current configuration and the sum of the performance of each type of acceleration chip analyzed under the configuration to be proposed according to the computing power of each type of acceleration chip under the current configuration of the task, the number of each type of acceleration chips, and the total number of each type of acceleration chips after the increase; The performance waste data under the current configuration, the performance waste data under the configuration to be proposed, the sum of the performance analyzed by each type of acceleration chip under the current configuration, and the sum of the performance analyzed by each type of acceleration chip under the configuration to be proposed, determine the proportion of wasted performance under the current configuration to the analyzed performance and the proportion of wasted performance under the configuration to be proposed to the analyzed performance.
8. The method according to claim 5, characterized in that The proposal information is determined according to the computing power of each type of acceleration chip under the current configuration of the task, the number of each type of acceleration chips, the type of acceleration chip, the type of acceleration chip after the increase, the total number of each type of acceleration chips after the increase, the performance waste data under the current configuration, the performance waste data under the configuration to be proposed, the communication overhead under the current configuration, and the communication overhead under the configuration to be proposed, including: Determine the sum of the performance of each type of acceleration chip analyzed under the current configuration and the sum of the performance of each type of acceleration chip analyzed under the configuration to be proposed according to the computing power of each type of acceleration chip under the current configuration of the task, the number of each type of acceleration chips, and the total number of each type of acceleration chips after the increase; The target performance under the current configuration is obtained by subtracting the waste data of the performance under the current configuration from the sum of the performances analyzed by each type of acceleration chip under the current configuration and adding the communication overhead under the current configuration; The target performance of the configuration to be proposed is obtained by subtracting the waste data of the performance of the configuration to be proposed from the sum of the performance of each type of acceleration chip analyzed under the configuration to be proposed and adding the communication overhead under the configuration to be proposed; Compare the target performance under the configuration to be proposed with the target performance under the current configuration to obtain a speedup ratio of the target performance under the configuration to be proposed relative to the target performance under the current configuration; The proposal information is determined based on the number of acceleration chips of each type, the type of acceleration chips after the increase, the total number of acceleration chips of each type after the increase, and the corresponding acceleration ratio.
9. The method according to claim 4, characterized in that The proposal information includes the target acceleration chip type and acceleration ratio applied for addition corresponding to each task; The resource scheduling of each thread in the target task according to the proposal information includes: Compare the speedup ratios corresponding to each of the tasks, determine the proposal corresponding to the maximum speedup ratio as the target proposal, and use the task corresponding to the target proposal as the target task; Generate scheduling information according to the target task and the type of target acceleration chip applied for addition corresponding to the target task; According to the target acceleration chip type requested for addition corresponding to the target task in the scheduling information, the target acceleration chip resources to be allocated are determined, and according to the number of target threads pre-allocated on each type of acceleration chip after the addition in the proposal information, the actual threads in the target task are allocated to the corresponding target acceleration chip.
10. A task scheduling device, characterized in that: The device comprises: An acquisition module, used to acquire statistical data and current configuration of each task, wherein the statistical data includes the throughput of each type of acceleration chip of the task under the current configuration, and the current configuration includes the acceleration chip type, the number of each type of acceleration chips, and the number of threads allocated on each type of acceleration chip; A processing module, used to determine proposal information according to the statistical data of each task, the current configuration and the acquired maximum number of threads corresponding to each task, wherein the proposal information is used to represent a proposal for applying for required resources for each task; A scheduling module is used to schedule resources for each thread in a target task according to the proposal information, and the target task is at least one task among all the tasks.
Citation Information
Patent Citations
Resource allocation method of virtual machine and device thereof
CN104995604A
Fine-grained GPU resource management method for mixed loads
CN107357661A
