A method, system and electronic device for scheduling elastic tasks of heterogeneous resources

By scheduling cluster resources, expanding or reducing the running elastic tasks according to the situation of the task queue to be run, the problem of low cluster resource utilization is solved and more efficient resource utilization and task execution is achieved.

CN119739500APending Publication Date: 2025-04-01GUANGZHOU HUYA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411643206.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The low utilization rate of cluster resources in the prior art leads to insufficient resources during peak periods and waste of resources during peak periods.

Method used

By obtaining the queue of tasks to be run, determining whether it is empty, and expanding or reducing the running elastic tasks according to the situation, ensuring that the idle resources of the cluster meet the resource requirements of the tasks to be run. Use pre-trained models to predict the benefit ratio of each elastic strategy, and select the optimal strategy for scaling or scaling operations.

Benefits of technology

It improves the utilization rate of cluster resources, avoids task waiting caused by insufficient resources, executes tasks to be run in a timely manner, and reduces task time. Through online training of the model, the prediction accuracy is continuously optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739500A_ABST
    Figure CN119739500A_ABST
Patent Text Reader

Abstract

The present application relates to a heterogeneous resource elastic task scheduling method system and electronic device, the method comprising: obtaining a queue of tasks to be run, determining whether the queue of tasks to be run is empty, and if so, performing a capacity expansion operation based on the elastic tasks in operation; if the queue of tasks to be run is not empty, traversing the queue of tasks to be run and determining whether the idle resources of the cluster meet the resource requirements of the currently traversed tasks to be run; if the resource requirements of the currently traversed tasks to be run are not met, stopping the traversal and performing a capacity reduction operation based on the currently traversed tasks to be run and the elastic tasks in operation; if the idle resources of the cluster meet the resource requirements of the currently traversed tasks to be run, scheduling the currently traversed tasks to be run. By determining the situation of the queue of tasks to be run and performing a capacity expansion operation on the elastic tasks in operation, the elastic tasks can make more full use of the resources in the cluster and improve the utilization rate of the cluster resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of task scheduling, and more specifically, to a method, system and electronic device for scheduling elastic tasks of heterogeneous resources. Background Art

[0002] At present, the rise of artificial intelligence has made deep learning models more and more widely used. In view of this, in the face of the application of deep learning algorithms, it is usually necessary to build a dedicated cluster system to meet its computing needs. These cluster systems often contain a variety of machine configurations, covering different models of CPU, GPU, memory, network card and other hardware resources. Especially in the era of large models, some expensive high-performance graphics cards are usually specially configured for training these large models, such as A100, H100, etc., to meet their high-intensity computing requirements. For some routine task processing, ordinary graphics cards with lower costs, such as V100, 4090, etc., will be chosen to save resource costs.

[0003] The utilization rate of cluster resources often changes with the fluctuation of user demand, showing peak and off-peak periods. During peak periods, resources may be insufficient. At this time, the training tasks submitted by users need to be queued and scheduled in order according to priority to ensure that key tasks can be executed smoothly. During off-peak periods, cluster resources may be largely idle, resulting in insufficient utilization of resources and waste. Summary of the invention

[0004] The present invention aims to overcome at least one defect (shortcoming) of the above-mentioned prior art and provide a method and system for elastic task scheduling of heterogeneous resources, so as to solve the problem of low cluster resource utilization in the prior art.

[0005] According to a first aspect of the present application, a method for elastic task scheduling of heterogeneous resources is provided, the method comprising: Get the queue of tasks to be run, and determine whether the queue is empty. If the queue is empty, perform capacity expansion based on the running elastic tasks. If the queue of pending tasks is not empty, each pending task in the queue is traversed, and each idle resource in the cluster is judged to see whether it meets the resource requirements of the currently traversed pending tasks. If the idle resources of the cluster do not meet the resource requirements of the currently traversed tasks to be run, stop traversing and scale down the running elastic tasks based on the currently traversed tasks to be run and the running elastic tasks; If the idle resources of the cluster meet the resource requirements of the currently traversed task to be run, the currently traversed task to be run is scheduled.

[0006] This method can more fully utilize the resources in the cluster and improve the utilization rate of cluster resources by judging the status of the task queue to be run and performing expansion or reduction operations on the running elastic tasks.

[0007] Optionally, the capacity expansion operation based on the running elastic task specifically includes: Acquire all heterogeneous resource information from idle resources in the cluster, and generate several elastic strategies according to the heterogeneous resource information and resource requirements of the running elastic tasks; Using the pre-trained model to predict each of the elastic strategies to obtain the optimal strategy; Performing capacity expansion operations on the running elastic tasks using an optimal strategy; and / or, The scaling operation is performed based on the currently traversed pending tasks and running elastic tasks, including: Select several elastic tasks from the running elastic tasks for scaling down; Calculate the amount of resources released after the scaling-in operation is performed, and determine whether the released amount of resources meets the resource requirements of the tasks to be run; If the amount of released resources does not meet the resource requirements of the currently traversed task to be run, the currently traversed task to be run enters a waiting state; If the amount of released resources meets the resource requirements of the currently traversed task to be run, the scaling-down operation is performed and the currently traversed task to be run is scheduled.

[0008] The pre-trained model is used to predict the benefit ratio of each elastic strategy to select the optimal strategy to expand the capacity of the running elastic tasks, so that the elastic tasks can make full use of the heterogeneous resources in the cluster and improve the utilization rate of cluster resources. By releasing resources for elastic tasks and evaluating whether the released resources meet the needs of the tasks to be run, the task waiting caused by insufficient resources can be effectively improved. When the amount of resource release meets the demand, the resources can be allocated to the tasks to be run, thereby further improving the utilization rate of cluster resources, so that the tasks to be run can be executed in time, and the time of the tasks to be run can be reduced.

[0009] Optionally, the using a pre-trained model to predict each of the elastic strategies to obtain an optimal strategy includes: Using the pre-trained model to predict each of the elastic strategies to obtain a corresponding benefit ratio score; The elastic strategy with the highest benefit ratio score is selected as the optimal strategy.

[0010] Optionally, the heterogeneous resources include at least two of a CPU, a GPU, a memory, and a network card; The current configuration information and the newly added configuration information both include the number of nodes and tag information corresponding to heterogeneous resources; The current configuration monitoring information includes heterogeneous resource evaluation information, wherein the heterogeneous resource evaluation information corresponding to the CPU, GPU, memory and network card are CPU utilization, GPU utilization, memory utilization and bandwidth respectively.

[0011] Optionally, the pre-trained model is obtained by training a model based on the historical elastic task, specifically including: Obtaining historical elastic tasks, and obtaining historical resource configuration requirements and historical actual resource configurations of the historical elastic tasks; Scheduling the historical elastic tasks according to the historical actual resource configuration to obtain current configuration monitoring information and initial speed; Constructing several resource configuration combinations based on heterogeneous resource information according to the resource configuration requirements of the historical elastic tasks; Running the historical elastic task on each resource configuration combination, and obtaining the combined speed and newly added configuration information of the historical elastic task running on each resource configuration combination; Constructing first training data, wherein the first training data includes current configuration information, current configuration monitoring information, newly added configuration information, and a benefit ratio score; the benefit ratio score is equal to the combination speed divided by the initial speed; The first training data is preprocessed, and the preprocessed first training data is input into a model for training to obtain a pretrained model.

[0012] By training the model through historical elastic tasks and using the benefit ratio score as the training target, the model's prediction ability and scheduling efficiency can be improved, which is conducive to the application of subsequent pre-trained models.

[0013] Optionally, the preprocessing the second training data specifically includes: The preprocessing of the first training data specifically includes: A hash embedding strategy is used to convert the tag information corresponding to the heterogeneous resources into a first learnable embedding vector through a hash function; Convert CPU utilization, GPU utilization, and memory utilization into integer indices, and convert the integer indices into a second learnable embedding vector; Converting the node number into a third learnable embedding vector; The bandwidth is normalized and converted into a fourth learnable embedding vector.

[0014] By preprocessing the second training data and converting the second training data into a data format that can be processed by the model, subsequent model training is facilitated.

[0015] Optionally, the method further comprises: Obtaining resource configuration information and heterogeneous resource evaluation information when the running elastic task performs a capacity expansion operation under an optimal strategy; constructing second training data based on the resource configuration information and the heterogeneous resource evaluation information; The pre-training model is trained online using the second training data, and the parameters of the pre-training model are updated after the training is completed.

[0016] The pre-trained model can be continuously optimized through online training, thereby continuously improving the accuracy of model prediction.

[0017] Optionally, the model is a Transformer model, and constructing an input sequence of the Transformer model specifically includes: Setting the length of an input sequence, wherein the input sequence includes a current configuration combination consisting of a preset number of current configuration information and a newly added configuration combination consisting of a preset number of newly added configuration information; Each current configuration information in the current configuration combination and each newly added configuration information in the newly added configuration combination are separated from adjacent configurations by a segmentation mark; If the number of configuration combinations is less than the preset number of combinations, a padding flag is used to pad the end of the input sequence so that the length of the input sequence reaches the preset length.

[0018] When using the Transformer model to process input sequences, the input sequence length is set and the [SEP] segmentation mark is used to distinguish different configuration combinations. When the number of configuration combinations is insufficient, the [PAD] padding mark is used to fill the gap. This ensures the input consistency and completeness of the input sequence, effectively improving the Transformer model's ability to learn the features of multiple current configurations and newly added configuration combinations, thereby enhancing the model's accuracy and generalization performance in resource allocation prediction and decision-making tasks.

[0019] According to a second aspect of the present application, a heterogeneous resource elastic task scheduling system is provided, the system comprising: The task queue acquisition module is used to obtain the task queue to be run; The task queue judgment module is used to judge whether the task queue to be run is empty; The task scheduling module is used to perform capacity expansion operations based on the running elastic tasks when the task queue judgment module determines that the queue of tasks to be run is empty; when the task queue judgment module determines that the queue of tasks to be run is not empty, traverse each task to be run in the queue of tasks to be run, and judge one by one whether the idle resources of the cluster meet the resource requirements of the currently traversed tasks to be run; if the idle resources of the cluster do not meet the resource requirements of the currently traversed tasks to be run, stop traversal and perform capacity reduction operations based on the currently traversed tasks to be run and the running elastic tasks; if the idle resources of the cluster meet the resource requirements of the currently traversed tasks to be run, schedule the currently traversed tasks to be run.

[0020] According to a third aspect of the present application, an electronic device is provided, including: a memory for storing one or more computer programs; The processor implements the heterogeneous resource elastic task scheduling method described in the first aspect when the one or more computer programs are executed by the processor.

[0021] Based on any of the above aspects, the heterogeneous resource elastic task scheduling method, system and electronic device provided in the embodiments of the present application have the following beneficial effects: 1. By judging the status of the task queue to be run, the capacity of the running elastic tasks is expanded, so that the elastic tasks can make more full use of the resources in the cluster, thereby improving the utilization rate of cluster resources.

[0022] 2. After the model completes each prediction, the model can be continuously optimized and learned through online training, thereby continuously improving the accuracy of model predictions. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments 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 any creative work.

[0024] Figure 1 A schematic diagram of an application scenario of the heterogeneous resource elastic task scheduling method provided in this embodiment.

[0025] Figure 2 This is a flow chart of the heterogeneous resource elastic task scheduling method provided in this embodiment.

[0026] Figure 3 A flow chart of the capacity expansion operation of the heterogeneous resource elastic task scheduling method provided in this embodiment.

[0027] Figure 4 This is a specific flow chart of the heterogeneous resource elastic task scheduling method provided in this embodiment.

[0028] Figure 5 A specific flow chart of the capacity expansion operation of the heterogeneous resource elastic task scheduling method provided in this embodiment.

[0029] Figure 6 This is a specific flow chart of the scaling-down operation of the heterogeneous resource elastic task scheduling method provided in this embodiment.

[0030] Figure 7 This is a model training flowchart of the heterogeneous resource elastic task scheduling method provided in this embodiment.

[0031] Figure 8 Schematic diagram of the input sequence structure of the Transformer model provided in this embodiment.

[0032] Fig. 9 A schematic diagram of the structure of the heterogeneous resource elastic task scheduling system provided in this embodiment.

[0033] Fig.10 This is a schematic diagram of the structure of an electronic device provided in this embodiment. DETAILED DESCRIPTION

[0034] The drawings of this application are only used for illustrative purposes and should not be construed as limiting the present application. In order to better illustrate the following embodiments, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product; it is understandable to those skilled in the art that some well-known structures and their descriptions in the drawings may be omitted.

[0035] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present application.

[0036] It should be noted that the terms "first", "second", etc. 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 be implemented in an order other than those illustrated or described herein. 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 comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0037] The inventors have found that in order to solve the problem of resource waste, the common practice is to use an elastic training framework to adjust the number of copies of training tasks according to the current status of cluster resources without affecting the overall training logic, so as to more flexibly utilize the resources of the current cluster. Although the elastic scheduling in the prior art can maximize the utilization of resources in the cluster, the resource requirements of each task are of a specific type. For example, when a user publishes a CPU elastic task, the elastic scheduling system only scales up and down according to the idle status of CPU resources. Even if the GPU resources are idle, they will not be utilized. Similarly, for GPU elastic tasks of model A100, the system will only adjust according to the idle status of A100 resources. If you blindly mix resources and elastically expand the capacity of devices with different performance, the training speed of the elastic task may decrease due to differences in device performance.

[0038] This embodiment provides a technical solution that can solve the above-mentioned problem. The specific implementation methods of this application are described in detail below in conjunction with the accompanying drawings.

[0039] For example, a schematic diagram of an application scenario of a heterogeneous resource elastic task scheduling method provided in an embodiment of the present application is provided. Figure 1 As shown, the application scenario at least includes a server 100 and a terminal 200 that can communicate with the server 100, the server 100 has a data processing function; the terminal 200 has a streaming media playback function and may also have a data processing function.

[0040] It is understandable that the server 100 can be an independent electronic device or a cluster of multiple electronic devices; the terminal 200 can be a smart phone terminal, a personal computer, a tablet computer, a car terminal, etc., but is not limited thereto.

[0041] In one practicable manner, the server 100 and the terminal 200 can respectively execute the heterogeneous resource elastic task scheduling method provided in the embodiment of the present application, or, optionally, the heterogeneous resource elastic task scheduling method provided in the embodiment of the present application is partially executed in the server 100 and partially executed in the terminal 200.

[0042] like Figure 4 As shown, this embodiment provides a heterogeneous resource elastic task scheduling method, which may include the following steps: S1. Obtain the queue of tasks to be run, and determine whether the queue of tasks to be run is empty. If the queue of tasks to be run is empty, perform a capacity expansion operation based on the running elastic tasks.

[0043] In this embodiment, an elastic task refers to a task whose resource requirements can be dynamically calculated and resources can be allocated, such as a training task for a deep learning model, and appropriate resources can be allocated to the elastic task based on the idle resources in the cluster resources. A task to be run refers to a non-elastic task to be scheduled. The type and quantity of resources required for a task to be run are generally determined when it is created, and will not change during the entire execution process. The cluster includes many different types of resources, such as various models of CPUs, GPUs, memory, network cards, and other resources.

[0044] In this embodiment, performing a capacity expansion operation based on a running elastic task refers to adding corresponding resources to the running elastic task, such as adding a CPU, a GPU, a memory, a network card, etc.

[0045] S2. If the queue of pending tasks is not empty, traverse each pending task in the queue of pending tasks, and determine whether the idle resources of the cluster meet the resource requirements of the currently traversed pending tasks.

[0046] In the specific implementation process, the resource requirement information of the current task is obtained, including the types and quantities of resources such as CPU, memory, storage, network bandwidth, etc. The idle resources currently available in the cluster are obtained, and then the resource requirements of the current task are matched with the idle resources in the cluster to determine whether the resource requirements of the currently traversed task to be run are met.

[0047] S3. If the idle resources of the cluster do not meet the resource requirements of the currently traversed tasks to be run, stop traversing and scale down the running elastic tasks based on the currently traversed tasks to be run and the running elastic tasks.

[0048] In this embodiment, scaling down the running elastic task means releasing the resources of the elastic task to meet the resource requirements of the currently traversed tasks to be run. In the specific implementation process, the scaling down operation can be achieved by releasing the resources such as CPU and memory occupied by the running elastic task.

[0049] S4. If the idle resources of the cluster meet the resource requirements of the currently traversed task to be run, the currently traversed task to be run is scheduled.

[0050] In this embodiment, the model is pre-trained using historical elastic tasks, and the historical elastic tasks are scheduled on a variety of heterogeneous resource devices in different combinations, so as to collect the training speed of the historical elastic tasks on each heterogeneous resource device combination. By judging the situation of the task queue to be run and performing expansion or reduction operations on the running elastic tasks, the resources in the cluster can be more fully utilized, thereby improving the utilization rate of cluster resources.

[0051] like Figure 7 As shown, the pre-trained model of this embodiment is obtained by training the model based on the historical elastic task, specifically including: A1. Obtain historical elastic tasks, and obtain historical resource configuration requirements and historical actual resource configurations of the historical elastic tasks.

[0052] In the specific implementation process, resource configuration requirement records of elastic tasks can be extracted from historical data. These resource configuration requirements include configuration information such as resource type and quantity.

[0053] A2. Scheduling the historical elastic tasks according to the historical actual resource configuration to obtain current configuration monitoring information and initial speed.

[0054] In this embodiment, the historical actual resource configuration of the historical elastic task refers to the resource configuration requirements when the elastic task was actually executed in the past. Scheduling according to the historical actual resource configuration of the historical elastic task can simulate the execution environment of the historical elastic task, so that the configuration monitoring information such as CPU utilization, GPU utilization, memory utilization and network bandwidth during the execution of the historical elastic task can be collected and the execution speed of the task under the current configuration can be obtained.

[0055] A3. Construct several resource configuration combinations based on heterogeneous resource information according to the resource configuration requirements of the historical elastic tasks.

[0056] In the specific implementation process, the resource configuration combination construction strategy can be determined according to the resource configuration requirements of the historical elastic tasks. It is understandable that the resource configuration combination based on heterogeneous resource devices can be generated by random combination or other methods, as long as the resource configuration combination can meet the resource configuration requirements of the historical elastic tasks.

[0057] A4. Run the historical elastic task on each resource configuration combination to obtain the combined speed and newly added configuration information of the historical elastic task running on each resource configuration combination.

[0058] By running the historical elastic task on each heterogeneous resource configuration combination, information such as resource usage and execution time during the running of the historical elastic task on each heterogeneous resource configuration combination can be monitored.

[0059] A5. Construct first training data, wherein the first training data includes current configuration information, current configuration monitoring information, newly added configuration information, and a benefit ratio score; the benefit ratio score is equal to the combination speed divided by the initial speed.

[0060] In this embodiment, heterogeneous resources include at least two of the resources such as CPU, GPU, memory and network card. Among them, the current configuration information and the newly added configuration information both include the number of nodes and tag information corresponding to the heterogeneous resources. For example, the tag information corresponding to the heterogeneous resources such as CPU, GPU, memory and network card are CPU model, GPU model, memory model and network card model respectively. The current configuration monitoring information includes heterogeneous resource evaluation information such as CPU utilization, GPU utilization, memory utilization and bandwidth. In the specific implementation process, for each heterogeneous resource configuration combination, [current configuration information, current configuration monitoring information, newly added configuration information, benefit ratio] can be used as a training data.

[0061] In actual operation, in order to collect enough training data, as many resource configuration combinations as possible can be generated according to step A3.

[0062] A6. Preprocess the first training data, and input the preprocessed first training data into a model for training to obtain a pre-trained model.

[0063] After obtaining the training data, since the current configuration information, current configuration monitoring information, and newly added configuration information are non-numeric data and cannot be directly input into the model, the training data needs to be preprocessed and converted into Embedding embedding vectors before it can be processed by the model.

[0064] In this embodiment, preprocessing the first training data specifically includes: The HashEmbedding hash embedding strategy is used to convert the tag information corresponding to the heterogeneous resources into the first learnable Embedding embedding vector through the hash function; Convert CPU utilization, GPU utilization, and memory utilization into integer indices, and convert the integer indices into the second learnable Embedding embedding vectors; Convert the node number into a third learnable Embedding embedding vector; The bandwidth is normalized and converted into a fourth learnable Embedding embedding vector.

[0065] It can be understood that the model structure adopted in the embodiments of the present application can be freely set according to actual needs. For example, a Transformer model, a recurrent neural network, a convolutional model and other models can be adopted.

[0066] In this embodiment, the input sequence for constructing the Transformer model specifically includes: Setting the length of an input sequence, wherein the input sequence includes a current configuration combination consisting of a preset number of current configuration information and a newly added configuration combination consisting of a preset number of newly added configuration information; Each current configuration information in the current configuration combination and each newly added configuration information in the newly added configuration combination are separated from adjacent configurations by a segmentation mark.

[0067] By segmenting the mark, the model can easily identify each configuration and improve the model's processing of data.

[0068] If the number of configuration combinations is less than the preset number of combinations, the [PAD] padding flag is used to pad the end of the input sequence so that the length of the input sequence reaches the preset length.

[0069] In the specific implementation process, the preset length can be adjusted according to the resource configuration type of the cluster. For example, the input sequence length can be set to 49, and a maximum of 3 current configuration combinations plus 3 newly added configuration combinations are supported. The input sequence structure is: [PREDICT] prediction flag + (current configuration information 5 + current configuration monitoring information 4 + [SEP] segmentation flag) * 3 + (newly added configuration information 5 + [SEP] segmentation flag) * 3.

[0070] In this embodiment, in order to facilitate the Transformer model to distinguish the position information of the mark, an Embedding vector related to its position can be added to each [PREDICT] prediction mark and [SEP] segmentation mark.

[0071] In order to distinguish the current configuration information from the newly added configuration information, learnable group embeddings can also be superimposed to identify different configurations. Specifically, the Embedding [CURRENT] embedding vector is added to the Embedding embedding vector related to the current configuration information, and the Embedding [New] embedding vector is added to the Embedding embedding vector related to the newly added configuration information.

[0072] The processed input sequence is input into the Transformer model for processing, the output vector corresponding to the [PREDICT] prediction flag is obtained, and the final prediction is made by the output vector corresponding to [PREDICT].

[0073] In the specific implementation process, the model can be trained using the back propagation principle. During the training process, the pre-processed training data is input into the model, and the acceleration ratio is used as the target value of the regression task. In order to quantify the difference between the model prediction result and the true value, this embodiment uses the mean square error function to calculate the loss value of the model.

[0074] After completing model training, you can use the pre-trained model to scale up the running elastic tasks.

[0075] like Figure 5 As shown, in step S1, the capacity expansion operation is performed based on the running elastic task, specifically including: S11. Obtain all heterogeneous resource information in the idle resources of the cluster, and generate several elastic strategies according to the heterogeneous resource information and the resource requirements of the running elastic tasks.

[0076] S12. Predict each of the elastic strategies using a pre-trained model to obtain an optimal strategy.

[0077] Specifically, using the pre-trained model to predict each of the elastic strategies to obtain the optimal strategy includes: Using the pre-trained model to predict each of the elastic strategies to obtain a corresponding benefit ratio score; The elastic strategy with the highest benefit ratio score is selected as the optimal strategy.

[0078] S13: perform capacity expansion operation on the running elastic task using the optimal strategy.

[0079] According to the heterogeneous resource information and the resource requirements of the running elastic tasks, different combinations of heterogeneous resources that meet the resource requirements of the running elastic tasks can be determined. Based on different combinations of heterogeneous resources, resource configuration solutions that meet the resource requirements of the running elastic tasks can be further obtained.

[0080] In the specific implementation process, when expanding to a low-configuration resource device, it is necessary to determine whether the low-configuration resource device meets the resource requirements of the running elastic task based on the current configuration information and configuration monitoring information. If it does not meet the requirements, the capacity cannot be expanded to the low-configuration resource device. For example, if the memory size used by the current configuration information is 500G, it cannot be expanded to a machine with only 128G memory.

[0081] By inputting the current configuration, monitoring, and newly added configuration corresponding to each elasticity strategy into the model for training, the benefit ratio of each elasticity strategy can be calculated, and the corresponding benefit ratio is used as the score for evaluating each elasticity strategy.

[0082] The method of this embodiment also includes: Obtaining resource configuration information and heterogeneous resource evaluation information when the running elastic task performs a capacity expansion operation under an optimal strategy; constructing second training data based on the resource configuration information and the heterogeneous resource evaluation information; The pre-trained model is trained online using the second training data, and the parameters of the pre-trained model are updated after the training is completed.

[0083] By constructing a first training data set to train the model online, the model can be continuously optimized after each application of the model for prediction, thereby further improving the accuracy of the model prediction.

[0084] like Figure 6 As shown, in step S3, the scaling-down operation is performed based on the currently traversed tasks to be run and the elastic tasks in operation, specifically including: S31. Select several elastic tasks from the running elastic tasks to perform a scaling-in operation.

[0085] S32: Calculate the amount of resources released after the scaling-in operation is performed, and determine whether the amount of resources released meets the resource requirements of the tasks to be run.

[0086] S33: If the amount of released resources does not meet the resource demand of the currently traversed task to be run, the currently traversed task to be run enters a waiting state.

[0087] S34: If the amount of released resources meets the resource demand of the currently traversed task to be run, a scaling-down operation is performed and the currently traversed task to be run is scheduled.

[0088] This embodiment evaluates scaling down of one or more currently running elastic tasks based on the resource requirements of the tasks to be run, and compares the amount of resources released by the elastic tasks with the resource requirements of the tasks to be run to determine whether the resource requirements of the tasks to be run are met and performs corresponding scaling down operations, thereby optimizing resource utilization in the cluster.

[0089] The technical solution of the heterogeneous resource elastic task scheduling method provided by the present application is described below in conjunction with a specific embodiment.

[0090] like Fig. 9 As shown, the embodiment of the present application further provides a heterogeneous resource elastic task scheduling system 610. Optionally, the heterogeneous resource elastic task scheduling system 610 may include: The task queue acquisition module 611 is used to acquire the task queue to be executed; The task queue determination module 612 is used to determine whether the task queue to be executed is empty; The task scheduling module 613 is used to perform capacity expansion operations based on the running elastic tasks when the task queue judgment module determines that the queue of tasks to be run is empty; when the task queue judgment module determines that the queue of tasks to be run is not empty, traverse each task to be run in the queue of tasks to be run, and determine one by one whether the idle resources of the cluster meet the resource requirements of the currently traversed tasks to be run; if the idle resources of the cluster do not meet the resource requirements of the currently traversed tasks to be run, stop traversal and perform capacity reduction operations based on the currently traversed tasks to be run and the running elastic tasks; if the idle resources of the cluster meet the resource requirements of the currently traversed tasks to be run, schedule the currently traversed tasks to be run.

[0091] It can be understood that the above-mentioned system embodiment and the above-mentioned method embodiment can correspond to each other, and similar descriptions of the system embodiment can refer to the method embodiment. To avoid repetition, it will not be repeated here. A heterogeneous resource elastic task scheduling system provided in an embodiment of the present application can execute a heterogeneous resource elastic task scheduling method provided in any embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution method. The functional modules of the heterogeneous resource elastic task scheduling system can be implemented in the form of hardware, can be implemented by instructions in the form of software, and can also be implemented by a combination of hardware and software modules.

[0092] Specifically, each step of the method embodiment of the present application can be completed by the hardware integrated logic circuit and / or software instructions in the processor. The steps of the heterogeneous resource elastic task scheduling method in the embodiment of the present application can be directly embodied as a hardware coding processor for execution, or a combination of hardware and software modules in the coding processor for execution. Optionally, the software module can be located in a random access memory, a read-only memory, a programmable read-only memory, a flash memory, an electrically erasable programmable memory, a register, or other storage media. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiment in combination with its hardware.

[0093] The present application embodiment provides an electronic device 710, whose structure is as follows: Fig.10 The electronic device 710 may be Figure 1 The server 100 or the terminal 200 is shown.

[0094] like Fig.10 As shown, the electronic device 710 includes a memory 711, a processor 712, a communication module 713 and an input / output interface 714, etc. Optionally, the memory 711, the processor 712, the communication module 713 and the input / output interface 714 can be connected and communicated through a bus 715.

[0095] The memory 711 is used to store one or more computer programs and transmit the code of the computer program to the processor 712; when the one or more computer programs are executed by the processor 712, the heterogeneous resource elastic task scheduling method in the embodiment of the present application is implemented.

[0096] Optionally, the electronic device 710 can be connected to a network via a communication module 713 to communicate with other devices, such as a terminal or a server, through the network to achieve data interaction. The electronic device 710 can be various forms of digital computers, such as desktop computers, servers, workstations, mainframe computers or other types of computers. The electronic device 710 can also be various forms of mobile terminals, such as smart phones, tablet computers, wearable devices (such as helmets, glasses, watches, etc.) and other similar mobile terminals.

[0097] Optionally, the electronic device 710 can be connected to the required input / output devices, such as a keyboard, a display device, etc., through the input / output interface 714. The electronic device 710 itself can have a display device, and can also be connected to other display devices through the input / output interface 714. Optionally, a storage device, such as a hard disk, can also be connected through the input / output interface 714, so that data in the electronic device 710 can be stored in the storage device, or data in the storage device can be read, and data in the storage device can also be stored in the memory 711. It can be understood that the input / output interface 714 can be a wired interface or a wireless interface. Depending on the actual application scenario, the device connected to the input / output interface 714 can be a component of the electronic device 710, or it can be an external device connected to the electronic device 710 when needed.

[0098] Optionally, the memory 711 may be a volatile memory and / or a non-volatile memory, the volatile memory may be a random access memory, etc., and the non-volatile memory may be a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory or a flash memory, etc.

[0099] Optionally, the computer program stored in the processor 712 may be divided into one or more modules, which are stored in the memory 711 and executed by the processor 712 to complete the method provided in the embodiment. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the computer program instruction segments are used to describe the execution process of the computer program in the electronic device 710.

[0100] Optionally, the processor 712 may be various general and / or special processing components with processing and computing capabilities. Some examples of the processor 712 include, but are not limited to, a central processing unit, a graphics processing unit, a digital signal processor, various special artificial intelligence computing chips, various processors running machine learning model algorithms, and may also be any appropriate controller, microcontroller, processor, etc. The processor 712 executes various methods and processes of this embodiment, illustratively, such as a heterogeneous resource elastic task scheduling method in an embodiment of the present application.

[0101] Optionally, the bus 715 may include a path for transmitting information. The bus 715 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. According to different functions, the bus 715 may be divided into an address bus, a data bus, a control bus, etc.

[0102] Obviously, the above embodiments of the present application are merely examples for clearly illustrating the technical solution of the present application, and are not intended to limit the specific implementation methods of the present application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present application shall be included in the protection scope of the claims of the present application.

Claims

1. A method for elastic task scheduling of heterogeneous resources, characterized in that: The method comprises: Get the queue of tasks to be run, and determine whether the queue is empty. If the queue is empty, perform capacity expansion based on the running elastic tasks. If the queue of pending tasks is not empty, each pending task in the queue is traversed, and each idle resource in the cluster is judged to see whether it meets the resource requirements of the currently traversed pending tasks. If the idle resources of the cluster do not meet the resource requirements of the currently traversed tasks to be run, stop traversing and scale down the running elastic tasks based on the currently traversed tasks to be run and the running elastic tasks; If the idle resources of the cluster meet the resource requirements of the currently traversed task to be run, the currently traversed task to be run is scheduled.

2. The method for elastically scheduling tasks of heterogeneous resources according to claim 1, characterized in that: The capacity expansion operation based on the running elastic task specifically includes: Acquire all heterogeneous resource information from idle resources in the cluster, and generate several elastic strategies according to the heterogeneous resource information and resource requirements of the running elastic tasks; Using the pre-trained model to predict each of the elastic strategies to obtain the optimal strategy; Performing capacity expansion operations on the running elastic tasks using an optimal strategy; and / or, The scaling operation is performed based on the currently traversed pending tasks and running elastic tasks, including: Select several elastic tasks from the running elastic tasks for scaling down; Calculate the amount of resources released after the scaling-in operation is performed, and determine whether the released amount of resources meets the resource requirements of the tasks to be run; If the amount of released resources does not meet the resource requirements of the currently traversed task to be run, the currently traversed task to be run enters a waiting state; If the amount of released resources meets the resource requirements of the currently traversed task to be run, the scaling-down operation is performed and the currently traversed task to be run is scheduled.

3. A heterogeneous resource elastic task scheduling method according to claim 2, characterized in that: The using of the pre-trained model to predict each of the elastic strategies to obtain the optimal strategy includes: Using the pre-trained model to predict each of the elastic strategies to obtain a corresponding benefit ratio score; The elastic strategy with the highest benefit ratio score is selected as the optimal strategy.

4. The method for elastically scheduling tasks of heterogeneous resources according to claim 2, characterized in that: The heterogeneous resources include at least two of CPU, GPU, memory and network card; The current configuration information and the newly added configuration information both include the number of nodes and tag information corresponding to heterogeneous resources; The current configuration monitoring information includes heterogeneous resource evaluation information, wherein the heterogeneous resource evaluation information corresponding to the CPU, GPU, memory and network card are CPU utilization, GPU utilization, memory utilization and bandwidth respectively.

5. A heterogeneous resource elastic task scheduling method according to claim 4, characterized in that: The pre-training of the pre-trained model specifically includes: Obtaining historical elastic tasks, and obtaining historical resource configuration requirements and historical actual resource configurations of the historical elastic tasks; Scheduling the historical elastic tasks according to the historical actual resource configuration to obtain current configuration monitoring information and initial speed; Constructing several resource configuration combinations based on heterogeneous resource information according to the resource configuration requirements of the historical elastic tasks; Running the historical elastic task on each resource configuration combination, and obtaining the combined speed and newly added configuration information of the historical elastic task running on each resource configuration combination; Constructing first training data, wherein the first training data includes current configuration information, current configuration monitoring information, newly added configuration information, and a benefit ratio score; the benefit ratio score is equal to the combination speed divided by the initial speed; The first training data is preprocessed, and the preprocessed first training data is input into a model for training to obtain a pretrained model.

6. A heterogeneous resource elastic task scheduling method according to claim 5, characterized in that: The preprocessing of the first training data specifically includes: A hash embedding strategy is used to convert the tag information corresponding to the heterogeneous resources into a first learnable embedding vector through a hash function; Convert CPU utilization, GPU utilization, and memory utilization into integer indices, and convert the integer indices into a second learnable embedding vector; Converting the node number into a third learnable embedding vector; The bandwidth is normalized and converted into a fourth learnable embedding vector.

7. A heterogeneous resource elastic task scheduling method according to claim 4, characterized in that: The method further comprises: Obtaining resource configuration information and heterogeneous resource evaluation information when the running elastic task performs a capacity expansion operation under an optimal strategy; constructing second training data based on the resource configuration information and the heterogeneous resource evaluation information; The pre-training model is trained online using the second training data, and the parameters of the pre-training model are updated after the training is completed.

8. A heterogeneous resource elastic task scheduling method according to any one of claims 1 to 7, characterized in that: The model is a Transformer model, and the input sequence for constructing the Transformer model specifically includes: Setting the length of an input sequence, wherein the input sequence includes a current configuration combination consisting of a preset number of current configuration information and a newly added configuration combination consisting of a preset number of newly added configuration information; Each current configuration information in the current configuration combination and each newly added configuration information in the newly added configuration combination are separated from adjacent configurations by a segmentation mark; If the number of configuration combinations is less than the preset number of combinations, a padding flag is used to pad the end of the input sequence so that the length of the input sequence reaches the preset length.

9. A heterogeneous resource elastic task scheduling system, characterized in that: The system comprises: The task queue acquisition module is used to obtain the task queue to be run; The task queue judgment module is used to judge whether the task queue to be run is empty; The task scheduling module is used to perform capacity expansion operations based on the running elastic tasks when the task queue judgment module determines that the queue of tasks to be run is empty; when the task queue judgment module determines that the queue of tasks to be run is not empty, traverse each task to be run in the queue of tasks to be run, and judge one by one whether the idle resources of the cluster meet the resource requirements of the currently traversed tasks to be run; if the idle resources of the cluster do not meet the resource requirements of the currently traversed tasks to be run, stop traversal and perform capacity reduction operations based on the currently traversed tasks to be run and the running elastic tasks; if the idle resources of the cluster meet the resource requirements of the currently traversed tasks to be run, schedule the currently traversed tasks to be run.

10. An electronic device, characterized in that: include: a memory for storing one or more computer programs; A processor, when the one or more computer programs are executed by the processor, implements the heterogeneous resource elastic task scheduling method as described in any one of claims 1-8.