Task processing method and device, electronic equipment and storage medium

By selecting the processor with the lowest energy consumption and the batch size for processing tasks in a heterogeneous intelligent computing cluster, the problem of energy waste in heterogeneous intelligent computing clusters is solved, and energy efficiency is improved.

CN121116562BActive Publication Date: 2026-02-03PENG CHENG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511659254.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-02-03
Estimated Expiration
2045-11-13

AI Technical Summary

Technical Problem

In heterogeneous intelligent computing clusters, the differences in computing power and power consumption of different types of processors during task processing lead to unnecessary energy waste and affect energy efficiency.

Method used

By obtaining the initial task deadline and the preset batch size for each type of processor, the latest execution time and target batch size are determined, and the processor with the lowest power consumption is selected for task processing to ensure that the task is completed on time.

Benefits of technology

While ensuring timely completion of tasks, it significantly reduced energy consumption, improved the operational efficiency of heterogeneous intelligent computing clusters, and avoided resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121116562B_ABST
    Figure CN121116562B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a task processing method and device, electronic equipment and storage medium, and relate to the technical field of artificial intelligence. The method comprises: obtaining a task preset time for each type of processor to run an initial task at different preset batch sizes; determining a latest running time according to each task preset time and a task deadline; for each type of processor, selecting a target latest running time of the initial task from the corresponding multiple latest running times according to a current scheduling time, and determining a target batch size corresponding to the target latest running time as a target batch size; obtaining an energy consumption value of each type of processor running the initial task at the corresponding target batch size, and selecting a processor corresponding to an energy consumption value with the smallest value from the multiple energy consumption values as a target processor; and running the initial task at the corresponding target batch size in the target processor to obtain a target processing result. The present application can improve the energy efficiency of a heterogeneous intelligent computing cluster.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a task processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] The heterogeneous intelligent computing cluster refers to a high-performance computing system composed of multiple different types of computing processors. Since the heterogeneous intelligent computing cluster has the advantage of processing capability of multiple different types of processors, it can efficiently run various tasks. In the related art, when multiple tasks need to be processed by the heterogeneous intelligent computing cluster synchronously, the heterogeneous intelligent computing cluster will combine the multiple tasks into one batch for running according to the principle of first-come-first-processed to improve hardware utilization.

[0003] However, different types of processors have different performances in terms of computing capability, power consumption, etc. Therefore, the energy consumption value of the task processing method adopted in the related art is not necessarily the minimum, i.e., unnecessary energy waste will be caused, and thus the energy efficiency of the heterogeneous intelligent computing cluster is poor. SUMMARY

[0004] The embodiments of the present application provide a task processing method and device, electronic equipment and storage medium, which can improve the energy efficiency of the heterogeneous intelligent computing cluster.

[0005] In order to achieve the above-mentioned purpose, the embodiments of the present application provide a task processing method, which is applied to a heterogeneous intelligent computing cluster, and the heterogeneous intelligent computing cluster includes multiple different types of processors, including:

[0006] obtaining an initial task to be processed and a task deadline of the initial task;

[0007] obtaining a task preset time for each type of processor to run the initial task at a different preset batch size, and determining a corresponding latest running time according to each task preset time and the task deadline;

[0008] obtaining a current scheduling time, for each type of processor, selecting a target latest running time of the initial task from the corresponding multiple latest running times according to the current scheduling time, and determining that a preset batch size corresponding to the target latest running time is a target batch size, wherein the target latest running time is the closest to the current scheduling time, and a task completion time of the initial task executed at the target latest running time does not exceed the task deadline;

[0009] obtaining an energy consumption value for each type of processor to run the initial task at the corresponding target batch size, and selecting a processor corresponding to an energy consumption value with the minimum value from the multiple energy consumption values as a target processor;

[0010] Run the initial task in the target processor with a corresponding target batch size to obtain a target processing result corresponding to the initial task.

[0011] In some embodiments, after selecting the processor corresponding to the energy consumption value with the minimum value from the plurality of energy consumption values as the target processor, the method further comprises:

[0012] When the number of the initial tasks to be processed obtained is a plurality, according to the target processor corresponding to each initial task, determining at least one first target task of each type of processor to be run;

[0013] When the number of the first target tasks is a plurality, according to the target batch size corresponding to each first target task, determining at least one second target task to be processed under each preset batch size from the plurality of first target tasks;

[0014] For each type of processor, selecting a current batch size from the plurality of preset batch sizes in ascending order, and running at least one second target task under the current batch size to obtain a target processing result corresponding to each second target task.

[0015] In some embodiments, after determining at least one second target task to be processed under each preset batch size from the plurality of first target tasks, the method further comprises:

[0016] For each type of processor, obtaining the number of processing cores of the processor;

[0017] When the number of the second target tasks is a plurality and the number of the second target tasks exceeds the number of processing cores, determining a difference value between the number of processing cores and the number of the second target tasks, and putting the difference value number of the second target tasks into a preset waiting queue;

[0018] Selecting a current batch size from the plurality of preset batch sizes in ascending order, and running the number of processing cores of the second target tasks under the current batch size first;

[0019] After the number of processing cores of the second target tasks are run, according to the difference value, calling and running the preset number of the second target tasks from the preset waiting queue to obtain a target processing result corresponding to each second target task.

[0020] In some embodiments, according to the difference value, calling and running the preset number of the second target tasks from the preset waiting queue to obtain a target processing result corresponding to each second target task, comprises:

[0021] Obtaining the remaining processing time between the current scheduling time and the task deadline time corresponding to each second target task;

[0022] In sequence from small to large of the remaining processing time, the second target task corresponding to each remaining processing time is invoked in turn, and each second target task is run in turn under the current batch size according to the invocation order, to obtain a target processing result corresponding to each second target task.

[0023] In some embodiments, after running the at least one second target task under the current batch size, the method further comprises:

[0024] An update scheduling time is obtained, and if the update scheduling time reaches a preset update time and there is still at least one initial task that has not been processed, an update task preset time for each initial task of each type of processor running at a different preset batch size is re-obtained, and an update latest running time corresponding to each update task preset time is determined according to each update task preset time and a task deadline.

[0025] For each type of processor, an update target latest running time of the initial task is selected from the corresponding multiple update latest running times according to the update scheduling time, and a preset batch size corresponding to the update target latest running time is determined as an update target batch size, wherein the task completion time of the initial task performed at the update target latest running time does not exceed the task deadline, and the update target latest running time is closest to the update scheduling time.

[0026] An update energy consumption value of each type of processor running the initial task at the corresponding update target batch size is obtained, and a processor corresponding to an update energy consumption value with the smallest value is selected as an update target processor from the multiple energy consumption values.

[0027] For each initial task that has not been processed, the initial task is run at the corresponding update target batch size in the update target processor, to obtain a target processing result corresponding to the initial task.

[0028] In some embodiments, the task preset time for each type of processor running the initial task at different preset batch sizes is obtained, and a corresponding latest running time is determined according to each task preset time and a task deadline, comprising:

[0029] The task preset time for each type of processor running the initial task at different preset batch sizes is obtained, wherein the task preset time for the initial task running at different preset batch sizes increases with the increase of the corresponding preset batch size.

[0030] For each preset batch size, the task deadline and the task preset time for running the initial task at the preset batch size are subtracted to obtain a latest running time for running the initial task at the current preset batch size.

[0031] In some embodiments, the energy consumption value of each type of processor running the initial task at the corresponding target batch size is obtained, and the processor corresponding to the energy consumption value with the minimum value is selected as the target processor from the plurality of energy consumption values, comprising:

[0032] The energy consumption value of each type of processor running the initial task at the corresponding target batch size is obtained, wherein the energy consumption value of the initial task running at different preset batch sizes decreases with the increase of the corresponding preset batch size;

[0033] When there are a plurality of energy consumption values with the same value, the target batch size corresponding to each energy consumption value with the same value is selected, and the target batch size with the minimum value is selected as the optimal target batch size;

[0034] The processor corresponding to the optimal target batch size is determined as the target processor.

[0035] In order to achieve the above-mentioned purpose, the embodiments of the present application provide a task processing device, which is applied to a heterogeneous intelligent computing cluster, the heterogeneous intelligent computing cluster comprising a plurality of different types of processors, comprising:

[0036] The obtaining module is configured to obtain an initial task to be processed and a task deadline of the initial task;

[0037] The latest running time determination module is configured to obtain a task preset time of each type of processor running the initial task at different preset batch sizes, and determine a corresponding latest running time according to each task preset time and the task deadline;

[0038] The target batch size determination module is configured to obtain a current scheduling time, and for each type of processor, select a target latest running time of the initial task from the corresponding plurality of latest running times according to the current scheduling time, and determine a preset batch size corresponding to the target latest running time as a target batch size, wherein the task completion time of the initial task executed at the target latest running time does not exceed the task deadline, and the target latest running time is closest to the current scheduling time;

[0039] The target processor determination module is configured to obtain an energy consumption value of each type of processor running the initial task at the corresponding target batch size, and select the processor corresponding to the energy consumption value with the minimum value as the target processor from the plurality of energy consumption values;

[0040] The target execution module is configured to run the initial task at the corresponding target batch size in the target processor to obtain a target processing result corresponding to the initial task.

[0041] To achieve the above object, the embodiment of the present application provides a computer readable storage medium in one aspect, the computer readable storage medium stores a plurality of instructions, the instructions are suitable for being loaded by a processor to execute steps in a task processing method provided by the embodiment of the present application.

[0042] To achieve the above object, the embodiment of the present application provides a computer device in one aspect, comprising a memory, a processor and a computer program stored in the memory and capable of running on the processor, the processor executes the computer program to realize steps in a task processing method provided by the embodiment of the present application.

[0043] To achieve the above object, the embodiment of the present application provides a computer program product in one aspect, comprising a computer program or instructions, the computer program or instructions are executed by a processor to realize steps in a task processing method provided by the embodiment of the present application.

[0044] The task processing method, device, electronic device and storage medium provided by the present application, by obtaining an initial task to be processed and a task deadline of the initial task; obtaining a task preset time of each type of processor running the initial task with different preset batch sizes, determining a corresponding latest running time according to each task preset time and the task deadline; obtaining a current scheduling time, for each type of processor, selecting a target latest running time of the initial task from the corresponding multiple latest running times according to the current scheduling time, and determining that the preset batch size corresponding to the target latest running time is a target batch size, wherein the task completion time of executing the initial task at the target latest running time does not exceed the task deadline, and the target latest running time is closest to the current scheduling time; obtaining an energy consumption value of each type of processor running the initial task with the corresponding target batch size, and selecting a processor corresponding to an energy consumption value with the smallest value from multiple energy consumption values as a target processor; running the initial task in the target processor with the corresponding target batch size to obtain a target processing result corresponding to the initial task.

[0045] The embodiment of the present application determines the maximum acceptable batch size of the initial task running on each different type of processor according to the task deadline of the initial task, that is, the target batch size; then, by comparing the energy efficiency horizontally between multiple optimal "processor-target batch size" options, the target processor with the smallest overall energy consumption value under the time delay constraint is finally selected for the initial task. In this way, the embodiment of the present application can intelligently match the initial task to the most energy-saving computing path of the heterogeneous intelligent computing cluster, avoiding assigning the initial task to a processor with high power consumption and low batch utilization, thereby significantly reducing unnecessary energy consumption while ensuring that the initial task can be completed on time, greatly improving the operation energy efficiency of the entire heterogeneous intelligent computing cluster.

[0046] Other features and advantages of the present application will be set forth in the description that follows, and in part will be apparent from the description, or can be learned by practice of the application. The purposes and other advantages of the present application will be realized and attained by the structure particularly pointed out in the description and claims of the application. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0048] Figure 1 is a system framework schematic diagram corresponding to the task processing method provided by the embodiments of the present application;

[0049] Figure 2 is a flow schematic diagram of the task processing method provided by the embodiments of the present application;

[0050] Figure 3 is a relationship schematic diagram between the preset batch size and the task preset time provided by the embodiments of the present application;

[0051] Figure 4 is a relationship schematic diagram between the preset batch size and the energy consumption value provided by the embodiments of the present application;

[0052] Figure 5 is a module structure schematic diagram of the task processing device provided by the embodiments of the present application;

[0053] Figure 6 is a hardware structure schematic diagram of the electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0054] In order to make the person in the art better understand the scheme of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.

[0055] It should be noted that in various specific embodiments of the present application, when referring to the need to obtain initial tasks and the task deadline corresponding to the initial tasks, permission or consent of the relevant personnel managing these data will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiments of the present application need to obtain sensitive personal information of relevant personnel, the separate permission or separate consent of the relevant personnel will be obtained through a pop-up window or a jump to a confirmation page, and after obtaining the separate permission or separate consent of the relevant personnel, the necessary initial tasks and the task deadline corresponding to the initial tasks for enabling the embodiments of the present application to normally operate are obtained. The other data obtained by the embodiments of the present application are authorized and legal data, which will not be described one by one here.

[0056] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, programmable consumer computer devices, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0057] Before the embodiments of the present application are described in detail, the terms and terms involved in the embodiments of the present application are first described, and the terms and terms involved in the embodiments of the present application are applicable to the following explanations:

[0058] Heterogeneous intelligent computing cluster refers to a high-performance computing system composed of multiple different types of computing processors. Since the heterogeneous intelligent computing cluster has the advantage of multiple different types of processors, it can efficiently run various tasks.

[0059] Energy efficiency refers to the ratio of useful output to energy consumed by a system or device when completing a specific task. In simple terms, it is "how much effective work can be done per joule of energy consumed". The higher the energy efficiency, the more computing tasks are completed with less energy.

[0060] Artificial Intelligence (AI) is a new technical science that studies, develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. Artificial intelligence is a branch of computer science. Artificial intelligence attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a similar way to human intelligence. The research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is also the theory, method, technology and application system of using digital computers or digital computer controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0061] The above is an explanation of the concepts of terms related to task processing in this application. If other concepts are involved, they will be described later.

[0062] Next, the technical means adopted by the related art and the technical problems existing in the related art are described.

[0063] In the related art, when multiple tasks need to be processed synchronously by a heterogeneous intelligent computing cluster, the heterogeneous intelligent computing cluster will combine the multiple tasks into one batch for running according to the principle of first-come-first-processed to improve hardware utilization.

[0064] However, different types of processors perform differently in terms of computing power, power consumption, etc. Therefore, the energy consumption value of the task processing method adopted in the related art is not necessarily the minimum, that is, unnecessary energy waste will be caused, and the energy efficiency of the heterogeneous intelligent computing cluster will be poor.

[0065] Taking an offline training task with large computing amount and insensitive to completion time received by an intelligent computing center as an example, the related art relies on the scheduling method of "first-come-first-processed", which may assign it to a processor that is idle at that time but has low performance and high energy consumption, resulting in that although the intelligent computing center can complete the offline training task, unnecessary resource waste will be caused. If the intelligent computing center uses the same technical means for each task obtained, a large number of tasks cannot be run at a non-optimal energy efficiency point in the long run, and the intelligent computing center will inevitably waste a lot of energy.

[0066] The task processing method and device, electronic device and storage medium provided in the application obtain an initial task to be processed and a task deadline of the initial task, obtain a task preset time of each type of processor running the initial task at different preset batch sizes, determine a corresponding latest running time according to each task preset time and the task deadline, obtain a current scheduling time, for each type of processor, select a target latest running time of the initial task from the corresponding multiple latest running times according to the current scheduling time, and determine that a preset batch size corresponding to the target latest running time is a target batch size, wherein a task completion time of executing the initial task at the target latest running time does not exceed the task deadline and is the latest completion time, obtain an energy consumption value of each type of processor running the initial task at the corresponding target batch size, and select a processor corresponding to an energy consumption value with the minimum value from the multiple energy consumption values as a target processor, and run the initial task at the corresponding target batch size in the target processor to obtain a target processing result corresponding to the initial task.

[0067] According to the task deadline of the initial task, the embodiment of the application determines the maximum acceptable batch size, that is, the target batch size, of the initial task running on each different type of processor, and then compares the energy efficiency between multiple optimal "processor-target batch size" options to finally select the target processor with the minimum overall energy consumption under the time delay constraint for the initial task. In this way, the embodiment of the application can intelligently match the initial task to the most energy-saving computing path of the heterogeneous intelligent computing cluster, avoid assigning the initial task to a processor with high power consumption and low batch utilization, and significantly reduce unnecessary energy consumption while ensuring that the initial task can be completed on time, thereby greatly improving the operation energy efficiency of the entire heterogeneous intelligent computing cluster.

[0068] The task processing method, device, electronic device and storage medium provided by the embodiment of the application will be described in detail below.

[0069] Please refer to Figure 1 , Figure 1 is a system framework schematic diagram corresponding to the task processing method provided by the embodiment of the application. The task processing method provided by the embodiment of the application can be applied in the system framework.

[0070] It includes a terminal 140, an Internet 130, a gateway 120, a server 110, and the like.

[0071] The terminal 140 or the server 110 can be a device for executing the task processing method.

[0072] Terminal 140 includes, but is not limited to, mobile phones, tablets, computers, and intelligent computing centers. Terminal 140 can be a single device or a collection of multiple devices. For example, multiple computers can be interconnected via a local area network, sharing a single monitor to work collaboratively, thus forming a terminal 140. Terminal 140 can communicate with the Internet 130 via wired or wireless means to exchange data.

[0073] Server 110 refers to a computer system that can provide certain services to terminal 140. Compared to ordinary terminal 140, server 110 has higher requirements in terms of stability, security, and performance. Server 110 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0074] Gateway 120, also known as an internetwork connector or protocol converter, is a computer system or device that acts as a translator, enabling network interconnection at the transport layer. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateways can also provide filtering and security functions. Messages sent from terminal 140 to server 110 are forwarded to the corresponding server 110 via gateway 120. Messages sent from server 110 to terminal 140 are also forwarded to the corresponding terminal 140 via gateway 120.

[0075] The embodiments of this application can be applied to task processing in various scenarios, such as AI inference platforms of large public cloud services and high-performance computing clusters of research institutions and universities. Specifically, in the AI ​​inference services provided by large public cloud service platforms, tens of thousands of users will submit various inference tasks simultaneously, such as image recognition, speech transcription, and natural language processing. These tasks are characterized by high concurrency, latency sensitivity, and large load fluctuations. By applying the task processing method provided in this application, the cloud platform can meet the users' task processing needs within a specified time while saving energy consumption and improving the energy efficiency of the cloud platform. In high-performance computing clusters of research institutions and universities, these clusters typically serve numerous research projects, running various types of computational tasks, from gene sequencing and molecular dynamics simulations to deep learning model training and inference. For example, one researcher might submit a time-limited model inference verification task, while another researcher might submit a long-running large-scale data analysis task. The proposed solution can find a processor-batch combination that can complete the task on time while also considering energy consumption for latency-sensitive tasks. At the same time, it can schedule non-urgent tasks to the most energy-efficient but potentially less powerful processor in the cluster, thus avoiding the phenomenon of all tasks competing for the most expensive and highest-performance processor. This allows for greater research output with limited research resources.

[0076] Of course, the above scenarios are only for illustrative purposes and do not imply any limitation on the scenarios in which the task processing method can be applied.

[0077] Next, we will describe it from the perspective of the task processing device, such as... Figure 2 As shown, Figure 2 This is a flowchart illustrating the task processing method provided in an embodiment of this application. The task processing method is applied to a heterogeneous intelligent computing cluster, which includes multiple processors of different types. Figure 2 The method may include, but is not limited to, the following steps 210 to 250. When the task processing device executes the task processing method, the specific process is as follows. It should be noted first that this embodiment... Figure 2 The order of steps 210 to 250 is not specifically limited. The order of steps can be adjusted or some steps can be reduced or added according to actual needs.

[0078] Step 210: Obtain the initial task to be processed and the deadline of the initial task;

[0079] Step 220: Obtain the preset time for each type of processor to run the initial task with a different preset batch size, and determine the corresponding latest running time based on the preset time and deadline of each task.

[0080] Step 230: Obtain the current scheduling time. For each type of processor, select the target latest running time of the initial task from multiple latest running times based on the current scheduling time, and determine the preset batch size corresponding to the target latest running time as the target batch size. The task completion time corresponding to the initial task executed at the target latest running time does not exceed the task deadline time, and the target latest running time is closest to the current scheduling time.

[0081] Step 240: Obtain the energy consumption value of each type of processor running the initial task with the corresponding target batch size, and select the processor with the smallest energy consumption value from multiple energy consumption values ​​as the target processor.

[0082] Step 250: Run the initial task in the target processor with the corresponding target batch size to obtain the target processing result corresponding to the initial task.

[0083] Steps 210 to 250 will be described in detail below.

[0084] In step 210, the initial task to be processed and the deadline of the initial task are obtained.

[0085] In this context, an initial task refers to a single computing request submitted by a user or upstream system to the heterogeneous intelligent computing cluster, awaiting processing and execution. For example, tasks such as object recognition on an image or converting a piece of speech into text can be considered initial tasks.

[0086] The task deadline refers to the latest time by which the initial task must be completed and return a result. This deadline is usually set by the user submitting the task, or by the relevant system based on the needs of the application scenario, such as real-time interaction or offline analysis. For example, if the deadline for an initial task is October 31, 2025, 00:00:000, it means that the initial task must be completed and the corresponding target result obtained before October 31, 2025, 00:00:000.

[0087] In step 220, the preset time for each type of processor to run the initial task with a different preset batch size is obtained, and the corresponding latest running time is determined based on the preset time and deadline of each task.

[0088] Here, each type of processor refers to a processor within a heterogeneous intelligent computing cluster, categorized according to hardware model, architecture, or performance and power consumption characteristics. For example, a heterogeneous intelligent computing cluster may simultaneously contain multiple types of processors, including a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), an Artificial Intelligence Accelerator (AI Accelerator), and a Neural Processing Unit (NPU). The CPU is a general-purpose computing core responsible for system control, task scheduling, and serial computation; the GPU is used for large-scale image computation and deep learning training / inference; the AI ​​Accelerator is hardware optimized for neural network computation; and the NPU is dedicated to accelerating neural network inference and training, commonly found in edge devices and AI chips. Of course, the processors mentioned above are merely illustrative examples, and the types of processors included in a heterogeneous intelligent computing cluster can be adjusted according to actual circumstances. This application does not impose any limitations on this.

[0089] Furthermore, there can be one or more processors of each type. For example, a heterogeneous intelligent computing cluster contains NPUs, and there are multiple NPUs. When the heterogeneous intelligent computing cluster needs to use the NPUs to run the initial task, since processors of the same type have similar performance, their energy consumption for processing the same initial task is almost the same. Therefore, one of the multiple NPUs can be selected to process the initial task.

[0090] The preset batch size refers to a fixed, discrete number of batches supported by each processor at the hardware or software level for efficient parallel computing. The preset batch size is typically a power of 2, such as 1, 2, 4, 8, 16, 32, 64, 128, etc. The processor selects the current batch size from these preset batch sizes and combines multiple initial tasks into a single batch for execution within that batch size.

[0091] The task preset time refers to the runtime measured or estimated in advance for completing a single initial task under specific hardware and software configurations. The task preset time is typically derived through extensive benchmark testing on actual hardware or calculated based on performance models and recorded in a query database. Therefore, in application, this embodiment can quickly obtain the task preset time for each type of processor to run initial tasks with different preset batch sizes.

[0092] The latest execution time refers to the point in time determined for an initial task, a specific type of processor, and a specific preset batch size. The latest execution time indicates the latest point at which the initial task must begin execution in order to complete just before its deadline if it is to run on this processor with the current batch size.

[0093] Furthermore, based on the preset time for running the initial task with different preset batch sizes for each type of processor, and the task deadline, the latest execution time for each type of processor to run the initial task under the corresponding preset batch size is determined. It's important to clarify that the "latest execution time" here refers to the latest start time of the initial task under each preset batch size for each type of processor, not the latest start time of the initial task under each type of processor. In other words, the latest execution time corresponding to a certain preset batch size represents the latest point in time when the initial task starts running if it runs under that preset batch size of the processor, not the latest time the initial task starts running within that type of processor.

[0094] It is understood that the embodiments of this application take into account the differences in processing the same initial task by different types of processors under different batch sizes. Therefore, unlike the traditional method, which arbitrarily merges the initial task into the batch size of any processor according to the principle of first-come, first-served, the embodiments of this application first determine the latest acceptable start time of each processor under the premise of meeting the task deadline, so as to determine the corresponding target batch size and target processor according to the latest running time of the initial task, thereby avoiding resource waste caused by blind scheduling.

[0095] In some embodiments, the preset time for each type of processor to run the initial task with a different preset batch size is obtained, and the corresponding latest run time is determined based on the preset time and deadline of each task, including:

[0096] (1.1) Obtain the preset time for each type of processor to run the initial task with different preset batch sizes, wherein the preset time for running the initial task with different preset batch sizes increases as the corresponding preset batch size increases;

[0097] (1.2) For each preset batch size, subtract the task deadline from the preset task time for running the initial task under the preset batch size to obtain the latest running time for running the initial task under the current preset batch size.

[0098] In some embodiments, such as Figure 3 As shown, Figure 3This is a schematic diagram illustrating the relationship between preset batch size and preset task time provided in an embodiment of this application. It can be understood that when running the same initial task with different preset batch sizes, the required preset task time exhibits a non-linear, accelerating growth trend as the preset batch size increases (e.g., from 1 to 128). For example, when running the same initial task on the same type of processor, the preset task time for running the initial task with a batch size of 128 is greater than the preset task time for running the initial task with a batch size of 64.

[0099] Furthermore, for each preset batch size, the task deadline and the preset time for running the initial task under the preset batch size are subtracted to obtain the latest execution time for the initial task under the current preset batch size. For example, the deadline for initial task A is set at 10:00:00.500 on October 31, 2025 (i.e., 10:00:500 AM on October 31, 2025; for ease of description, the timestamps mentioned below will no longer show the year, month, and day); the heterogeneous intelligent computing cluster includes processor a of a certain type, processor a includes preset batch size a1 and preset batch size a2. Assuming that the preset time for processor a to run initial task A under preset batch size a1 is 30 milliseconds (ms), then processor a must start running initial task A no later than 10:00:00.500 - 30ms = 10:00:00.470; assuming processor... If processor a has a preset time of 90ms for running initial task A with a preset batch size a2, then processor a must start running initial task A no later than 10:00:00.500 - 90ms = 10:00:00.410; 10:00:00.470 is the latest running time of processor a running initial task A with a preset batch size a1, and 10:00:00.410 is the latest running time of processor a running initial task A with a preset batch size a2; other types of processors in the heterogeneous intelligent computing cluster also use similar steps to calculate their latest running time for running initial tasks with different preset batch sizes, which will not be repeated here in the embodiments of this application.

[0100] In step 230, the current scheduling time is obtained. For each type of processor, the target latest running time of the initial task is selected from multiple corresponding latest running times based on the current scheduling time, and the preset batch size corresponding to the target latest running time is determined as the target batch size. The task completion time corresponding to the initial task executed at the target latest running time does not exceed the task deadline time, and the target latest running time is closest to the current scheduling time.

[0101] The current scheduling time indicates the current time. The target latest execution time refers to the target time selected from all possible latest execution times for a specific type of processor to run its initial task. The target latest execution time ensures that the processor can complete the initial task before the deadline if it runs the initial task at the corresponding preset batch size at this time, and this time is closest to the current time.

[0102] For example, assuming the current scheduling time is 10:00:15.000 (i.e., 10:00 AM 15 seconds past the appointed time), and an initial task has a deadline of 10:01:00.000 (10:01 AM 1 minute past the appointed time), when running an initial task B using the GPU, the latest execution times corresponding to each preset batch size are as follows:

[0103] If the preset batch size is 8, the preset task time is 50 seconds, so the initial task B must start running no later than 10:00:10.000;

[0104] If the preset batch size of 4 is used, the preset task time is 30 seconds, so the initial task B must start running no later than 10:00:30.000;

[0105] If the preset batch size 2 is used, the preset task time is 15 seconds, so the initial task B must start running no later than 10:00:45.000;

[0106] If the preset batch size is 1, the preset task time is 8 seconds, so the initial task B must start running no later than 10:00:52.000.

[0107] Since the target latest execution time for the initial task does not exceed the task deadline, and the target latest execution time is closest to the current scheduling time, 10:00:30.000 is selected as the target latest execution time for the GPU to run the initial task B, and the preset batch size 4 corresponding to 10:00:30.000 is determined as the target batch size for the GPU to run the initial task B.

[0108] In step 240, the energy consumption value of each type of processor running the initial task with the corresponding target batch size is obtained, and the processor with the smallest energy consumption value is selected as the target processor from multiple energy consumption values.

[0109] The energy consumption value refers to the energy consumed by a processor when running a task in a specific batch size, from the start to the completion of execution. The energy consumption value reflects the energy cost required to execute the task; the lower the value, the more energy-efficient it is. For example, if a processor consumes 100 watts (W) to run a task that lasts for 10 seconds (s), then the energy consumption value is 100 watts × 10 seconds = 1000 joules (J).

[0110] Furthermore, energy consumption values ​​can be obtained through pre-measurement and the creation of an energy consumption lookup table. For each type of processor, typical tasks are run at different batch sizes. Power monitoring tools are used to record the average power consumption and runtime throughout the task execution. Then, the corresponding energy consumption value is obtained by calculating "average power consumption × task preset time". To facilitate subsequent lookups, this data can be constructed into a processor-batch size-energy consumption value mapping table. During actual scheduling, relevant devices or systems only need to look up the table based on the processor type and target batch size to quickly obtain the energy consumption value for that configuration, without the need for real-time measurement, thus efficiently supporting scheduling decisions.

[0111] Here, the target processor is the processor with the lowest energy consumption among all processor types running the initial task at the corresponding target batch size. The target batch sizes for different target processors can be the same or different. For example, suppose there are three types of processors available, and the information for each type of processor is as follows:

[0112] Processor a runs the initial task C with the corresponding target batch size 8. The task is preset to last 50 seconds and has an average power consumption of 200 watts. The energy consumption value is 200W × 50s = 10000 joules.

[0113] Processor b runs the initial task C with the corresponding target batch size 4. The task preset time is 30 seconds, the average power consumption is 180 watts, and the energy consumption value is 180W×30s=5400 joules.

[0114] Processor C runs the initial task C with the corresponding target batch size 2. The task is preset to last 15 seconds and has an average power consumption of 500 watts. The energy consumption value is 500W × 15s = 7500 joules.

[0115] Comparing the energy consumption values ​​of the three, it can be found that the energy consumption value generated by processor b running the initial task C with the corresponding target batch size of 4 is the lowest. Therefore, processor b with 5400 joules is selected as the target processor.

[0116] It is understood that, by comprehensively considering the relationship between task deadlines, processor types, batch sizes, and energy consumption, this embodiment of the application achieves optimal processor selection while ensuring timely task completion. Thus, this embodiment effectively improves the energy utilization efficiency of heterogeneous intelligent computing clusters, reduces operating costs, and avoids energy waste caused by blindly pursuing performance.

[0117] In some embodiments, obtaining the energy consumption value of each type of processor running the initial task at the corresponding target batch size, and selecting the processor with the smallest energy consumption value from multiple energy consumption values ​​as the target processor includes:

[0118] (2.1) Obtain the energy consumption value of each type of processor running the initial task with the corresponding target batch size, wherein the energy consumption value of running the initial task with different preset batch sizes decreases as the corresponding preset batch size increases;

[0119] (2.2) When there are multiple energy consumption values ​​with the same value, select the target batch size with the smallest value from the target batch sizes corresponding to each energy consumption value with the same value as the optimal target batch size;

[0120] (2.3) Determine the processor corresponding to the optimal target batch size as the target processor.

[0121] In some embodiments, such as Figure 4 As shown, Figure 4 This is a schematic diagram illustrating the relationship between preset batch size and energy consumption value provided in the embodiments of this application. The energy consumption value generated by the same processor running the same initial task with different preset batch sizes is usually different. Furthermore, the energy consumption value of running the initial task with different preset batch sizes decreases as the corresponding preset batch size increases. For example, when running the same initial task on the same type of processor, the energy consumption value of running the initial task with a batch size of 128 is less than the energy consumption value of running the initial task with a batch size of 64.

[0122] Furthermore, if multiple energy consumption values ​​exist, the target batch size with the smallest value is selected as the optimal target batch size from the target batch sizes corresponding to each identical energy consumption value. When multiple energy consumption values ​​exist, selecting a smaller batch size for processing can reduce memory or video memory usage, reduce initial task execution latency, and return the corresponding target processing results of the initial task faster, thereby improving the overall response speed of the system and enhancing the scheduling flexibility of the heterogeneous intelligent computing cluster while improving energy efficiency.

[0123] For example, suppose there is an initial task C that needs to be scheduled, and there are three types of processors available in the heterogeneous intelligent computing cluster: GPU A100, GPU V100, and NPU 370; in step 230, the target batch size for each type of processor to complete the initial task C on time has been determined, and the energy consumption data for each type of processor running the initial task C at the corresponding target batch size is as follows:

[0124] GPU A100: Target batch size = 16, energy consumption for running initial task C = 8000 joules;

[0125] GPU V100: Target batch size = 8, energy consumption for running initial task C = 6000 joules;

[0126] NPU 370: Target batch size = 4, energy consumption for running initial task C = 6000 joules;

[0127] It can be observed that in this example, the GPU V100 and NPU 370 have the same and the lowest power consumption (6000J). In this case, the one with the smaller target batch size is selected, that is, the target batch size is the optimal target batch size, and NPU370 is selected as the target processor.

[0128] In step 250, the initial task is run in the target processor with the corresponding target batch size to obtain the target processing result corresponding to the initial task.

[0129] In some embodiments, the task processing device assigns an initial task to a selected target processor and actually executes the initial task using a target batch size determined for it, and obtains the target processing result corresponding to the initial task. In this way, the present application can ensure that the execution of the initial task not only meets the real-time requirements, but also achieves the optimization of the energy efficiency of the heterogeneous intelligent computing cluster.

[0130] In some embodiments, steps 210 to 250 describe the processing method when the heterogeneous intelligent computing cluster receives only one initial task. When the heterogeneous intelligent computing cluster receives multiple initial tasks, the target batch size and target processor corresponding to each initial task are determined using the method shown in steps 210 to 240, and the scheduling method for multiple initial tasks is determined according to the following steps (3.1) to (3.3):

[0131] In some embodiments, after selecting the processor corresponding to the smallest energy consumption value from a plurality of energy consumption values ​​as the target processor, the method further includes:

[0132] (3.1) When there are multiple initial tasks to be processed, determine at least one first target task that each type of processor needs to run, based on the target processor corresponding to each initial task.

[0133] (3.2) When there are multiple first target tasks, at least one second target task to be processed under each preset batch size shall be determined from the multiple first target tasks according to the target batch size corresponding to each first target task;

[0134] (3.3) For each type of processor, select the current batch size from multiple preset batch sizes in ascending order, and run at least one second target task under the current batch size to obtain the target processing result corresponding to each second target task.

[0135] In some embodiments, when there are multiple initial tasks to be processed, the task processing device determines which initial tasks each type of processor needs to run based on the target processor previously calculated for each initial task. The first target task refers to the initial task that, after preliminary energy efficiency optimization analysis, is determined to be most suitable for execution on a specific type of processor.

[0136] Furthermore, when multiple first target tasks exist on a processor, the task processing device will further refine these tasks into smaller groups based on the target batch size corresponding to each first target task, thereby determining the specific initial set of tasks to be processed under each preset batch size. Second target tasks refer to those first target tasks that are not only assigned to the same processor but also have the same target batch size.

[0137] Furthermore, for each type of processor, the task processing device sequentially selects one of the multiple preset batch sizes supported by each processor as the current batch size, in ascending order, and runs all the second target tasks in that batch size queue until the target processing result corresponding to each second target task is obtained. For example, a certain type of processor will first process all initial tasks with a target batch size of 1. After all initial tasks with a target batch size of 1 have been completed, it will then process all initial tasks with a target batch size of 2, and so on, until all initial tasks under the current type of processor have been processed.

[0138] It is understood that the embodiments of this application transform the complex problem of multi-task parallel processing into a clear, conflict-free, and highly efficient pipeline operation process by layering, grouping, and executing initial tasks in an orderly manner. This not only ensures that each initial task can run under its pre-calculated optimal energy efficiency configuration, but also improves the system responsiveness and throughput of the entire heterogeneous intelligent computing cluster by prioritizing the processing of small batches of tasks, thus achieving dual optimization of global energy efficiency and operating efficiency in multi-task concurrent scenarios.

[0139] In some embodiments, after determining at least one second target task to be processed at each preset batch size from a plurality of first target tasks, the method further includes:

[0140] (3.2.1) For each type of processor, obtain the number of processor cores;

[0141] (3.2.2) When there are multiple second target tasks and the number of second target tasks exceeds the number of processing cores, determine the difference between the number of processor cores and the number of second target tasks, and put the second target tasks with the difference into a preset waiting queue;

[0142] (3.2.3) Select the current batch size from multiple preset batch sizes in ascending order, and run the number of processing cores of the second target task under the current batch size;

[0143] (3.2.4) After the number of second target tasks is completed, a preset number of second target tasks are retrieved from the preset waiting queue according to the difference number and run to obtain the target processing result corresponding to each second target task.

[0144] The number of processing cores refers to the number of computing cores within a processor that can execute tasks in parallel. It is a key indicator of a processor's parallel processing capability. For example, a GPU may contain thousands of computing cores, an NPU may integrate multiple AI computing engines, and a multi-core CPU typically has 4, 8, or more independent processing cores. In task scheduling, the number of processing cores determines the maximum number of tasks a processor can run concurrently at any given time. When the number of initial tasks to be processed exceeds the number of processing cores, the excess initial tasks must wait until a computing core becomes available before they can be executed.

[0145] Furthermore, obtain the number of processing cores for each type of processor. If there are multiple processors of each type, then the number of processing cores for each type of processor is the sum of the number of processing cores for each processor.

[0146] Furthermore, when the number of second target tasks under a certain preset batch size is multiple, and this number exceeds the number of processing cores possessed by this type of processor, the task processing device will calculate the difference between the number of second target tasks and the number of processing cores. The difference represents the overflow portion that exceeds the single parallel processing capability of the current type of processor. Then, the task processing device will temporarily store the difference number of second target tasks in a preset waiting queue to await subsequent scheduling.

[0147] Furthermore, the current batch size is selected sequentially from smallest to largest. Within this current batch size, a second target task equal to the number of processing cores is first scheduled to run on the processor. This ensures that all processing cores are fully utilized when the processor is executing tasks, maximizing the utilization of hardware resources.

[0148] Furthermore, after the previous batch of second target tasks, whose number equals the number of processing cores, has finished running and released resources, a preset number of second target tasks are retrieved from the previously established preset waiting queue and continue to run under the same current batch size. The preset number can be the number of processor cores or a portion exceeding an integer multiple of the number of processor cores, depending on the actual situation.

[0149] For example, suppose a certain type of processor has a total of 20 processing cores. There are 55 second target tasks that need to be run on a preset batch size of 1 on this type of processor. First, 20 second target tasks are run in parallel, and 55-20=35 tasks are placed in a waiting queue. After the 20 processor cores complete their current tasks, since 35 is still greater than the number of processing cores, 20 more (the preset number) second target tasks are retrieved from the remaining 35 tasks, and 35-20=15 tasks remain in the waiting queue. After the 20 processor cores complete their current tasks, since 15 is less than the number of processing cores, the remaining 15 (the preset number) second target tasks are retrieved and run. At this point, the processor has completed the execution of all second target tasks within the current batch size and obtained the target processing result for each second target task.

[0150] It is understood that the embodiments of this application automatically replenish tasks to be processed from a preset waiting queue, forming a continuous processing pipeline. This ensures that each type of processor can work continuously when processing a large number of initial tasks of the same batch size, reducing idle time caused by waiting for new task scheduling. Furthermore, when the number of tasks to be processed exceeds the processor's parallel processing capacity, excess tasks are temporarily stored in the preset waiting queue to avoid resource overload. Subsequently, tasks are scheduled and executed in batches in ascending order of batch size, prioritizing the full-load operation of tasks equal to the number of processing cores to maximize hardware utilization. After completion, remaining tasks are retrieved from the queue in an orderly manner to continue processing, achieving a balance between the orderliness, efficiency, and resource utilization of task scheduling.

[0151] In some embodiments, a preset number of second target tasks are retrieved from a preset waiting queue and run according to the difference quantity, to obtain the target processing result corresponding to each second target task, including:

[0152] (A.1) Obtain the remaining processing time between the current scheduling time and the deadline time corresponding to each second target task;

[0153] (A.2) In order of increasing remaining processing time, retrieve the second target task corresponding to each remaining processing time, and run each second target task in the order of retrieval under the current batch size to obtain the target processing result corresponding to each second target task.

[0154] In some embodiments, when there are multiple second target tasks and the number of second target tasks exceeds the number of processing cores, it means that the processor cannot process all tasks under the current batch size at once. In this case, the processing order of the remaining tasks is determined by the remaining processing time (i.e., the time difference between the current scheduling time and the task deadline). This allows the processor to prioritize the tasks with the most urgent time and the closest deadline, thereby effectively reducing the risk of task timeout and improving the overall on-time completion rate of tasks.

[0155] For example, assuming the current scheduling time is 10:00:00.000, the remaining processing time for each of the second target tasks to be processed under the current batch size for a certain type of processor is:

[0156] The deadline for the second objective task A is 10:00:15.000, therefore the remaining processing time for the second objective task A is 10:00:15.000 - 10:00:00.000 = 15.000 seconds;

[0157] The deadline for the second objective task B is 10:00:10.000, therefore the remaining processing time for the second objective task B is 10:00:10.000 - 10:00:00.000 = 10.000 seconds;

[0158] The deadline for the second objective task C is 10:00:30.000, therefore the remaining processing time for the second objective task C is 10:00:30.000 - 10:00:00.000 = 30.000 seconds;

[0159] The deadline for the second objective task D is 10:00:20.000, therefore the remaining processing time for the second objective task D is 10:00:20.000 - 10:00:00.000 = 20.000 seconds;

[0160] In this example, after the number of second target tasks that process the cores has been completed, the second target tasks B, A, D, and B are retrieved and run in order of increasing remaining processing time.

[0161] In some embodiments, after running at least one second target task at the current batch size, the method further includes:

[0162] (3.3.1) Obtain the update scheduling time. If the update scheduling time reaches the preset update time and there is still at least one unprocessed initial task, re-obtain the preset time for each type of processor to run each initial task with a different preset batch size, and determine the corresponding latest update running time based on the preset time and deadline of each update task.

[0163] (3.3.2) For each type of processor, select the latest execution time of the update target of the initial task from multiple latest execution times of the corresponding update scheduling time, and determine the preset batch size corresponding to the latest execution time of the update target as the update target batch size. Wherein, the task completion time corresponding to the initial task executed at the latest execution time of the update target does not exceed the task deadline time, and the latest execution time of the update target is closest to the update scheduling time.

[0164] (3.3.3) Obtain the update energy consumption value of each type of processor running the initial task with the corresponding update target batch size, and select the processor with the smallest update energy consumption value from multiple energy consumption values ​​as the update target processor;

[0165] (3.3.4) For each unprocessed initial task, run the initial task in the update target processor with the corresponding update target batch size to obtain the target processing result corresponding to the initial task.

[0166] In this context, after running at least one second target task under the current batch size, a period of time has passed since the task processing device initially acquired the current scheduling time. Therefore, it is necessary to reacquire the updated scheduling time, which also represents the "now" time, but it is usually different from the current scheduling time.

[0167] The preset update time refers to one or more pre-defined time points used to trigger dynamic adjustments to the task scheduling strategy. If the current scheduling time reaches the preset update time and there are still at least one unprocessed initial task, the task processing device will reassess the status of the currently unfinished tasks and resources, update the time predictions required to run the tasks obtained by various processors (such as the preset task time), the latest possible start time (latest execution time), and key parameters such as energy consumption, and re-select batch size and processor allocation decisions based on the latest information. This mechanism enables heterogeneous intelligent computing clusters to adapt to changes during operation (such as load fluctuations and resource usage updates), improve the accuracy and timeliness of scheduling, and ensure that tasks can still be completed efficiently and energy-savingly within the deadline.

[0168] The initial task deadline typically remains unchanged; therefore, this embodiment does not acquire the updated deadline. However, if the initial task deadline may change in practice, the updated deadline will be acquired synchronously. Furthermore, the definitions of updating the task preset time and the latest execution time, updating the target latest execution time and the target latest execution time, updating the target batch size and the target batch size, updating the energy consumption value and the energy consumption value, and updating the target processor and the target processor are similar, and therefore will not be elaborated upon here.

[0169] It is understood that the embodiments of this application periodically re-evaluate the task status at preset update times, perceive changes in system load, network conditions, etc. in real time, and recalculate the optimal execution strategy for unprocessed initial tasks. In this way, under the hard constraint of ensuring that tasks do not time out, the system continuously pursues the minimization of global energy consumption, thereby realizing the dynamic optimization of energy efficiency of heterogeneous intelligent computing clusters.

[0170] To help readers better understand the task processing method proposed in the embodiments of this application, another complete example is provided below:

[0171] (a) Establish a three-dimensional mapping table of task-processor-batch:

[0172] For each task i obtained, let the corresponding deadline for completion required by the user be denoted as . Let the runtime of task i on the k-th type AI processor, when run in batches of size b, be . Given that the energy consumption of each task running on the k-th type AI processor at batch size b is... These relevant parameters, after being statistically analyzed, are stored as input data in the scheduler cache for subsequent execution. To complete the task without exceeding the task latency constraint, the latest execution time of task i can be calculated. .

[0173] Before scheduling begins, the latest execution time for all tasks is first calculated for all available processors k and all available batch sizes b. These results are recorded in a table indexed (i, k, b), thus establishing a "task-processor-batch three-dimensional mapping table". Let i range from 1 to I, k range from 1 to K, and b range from 1 to B (containing only powers of 2). Therefore, the table contains a total of... item.

[0174] (ii) Determine the maximum acceptable batch size for each task at the current moment:

[0175] At the current scheduling time T, for each task i, if it is to run on the k-th type of processor, calculate the maximum acceptable batch size b(k,i) for that task. Specifically, start the batch size b from 1 and gradually double it, substituting it into the following inequality until a value for b is found that simultaneously satisfies:

[0176] ,as well as .in, and The value needs to be looked up in the task-processor-batch 3D mapping table established in the previous step. That is, the value at index (i,k,b) in the mapping table. This refers to the value at index (i, k, 2b) in the mapping table. This inequality indicates that when starting the initial task at the current scheduling time T, choosing a batch size b(k, i) guarantees the task will not time out. However, if the batch size is doubled to 2*b(k, i), the deadline will be violated. Doubling the batch size is considered here because in deep learning systems, to achieve efficient operation of the AI ​​processor, the batch size is always a power of 2. Furthermore, since the maximum acceptable batch size b(k, i) depends on the processor type k and the task i, b(k, i) is also the target batch size mentioned in the text.

[0177] In addition, for a certain task i, doubling the batch size multiple times will inevitably lead to a timeout, so the maximum acceptable batch size b(k,i) always exists.

[0178] Thus, based on the relevant parameter combinations of each task i and processor k, a table consisting of b(k,i) values ​​is obtained. This table uses task i and processor type k as rows and columns, thereby establishing the "maximum acceptable batch table".

[0179] Since processors consume roughly the same amount of energy when processing the same type of task, the determined "task-processor-batch three-dimensional mapping table" and "maximum acceptable batch table" can be stored so that the target batch size for each task i can be quickly found through these two tables later.

[0180] (III) Selection of the most energy-efficient processor type:

[0181] Because heterogeneous clusters contain multiple AI processors, the energy consumption of each processor varies depending on the batch size. There are differences. To minimize the average energy consumption per task, for each task i, the processor type that minimizes energy consumption needs to be selected based on its acceptable maximum batch size b(k,i):

[0182] This formula indicates that, for each task i, the processor type with the lowest energy consumption on its maximum acceptable batch size b(k,i) is preferentially selected; this type is denoted as... The specific method is as follows: for task i, for each processor type k, find the value of b(k,i) in the corresponding maximum acceptable batch table, and compare the energy consumption values ​​of different processor types k under the corresponding target batch size. Find the k corresponding to the minimum value, and then determine the target processor. .

[0183] (iv) Adaptive Batch Scheduling:

[0184] After determining the optimal processor type and maximum acceptable batch size for each task i, actual scheduling is performed according to the principle of "using the largest possible batch." This is because, in terms of hardware characteristics, larger batches always result in higher hardware utilization, thereby reducing the average energy consumption per task. Specifically, as the batch size increases, the average energy consumption of the task decreases, meeting the requirements. relation.

[0185] For each type of processor k, perform the following operations in ascending order of maximum acceptable batch size:

[0186] (1) Tasks with a maximum acceptable batch size b(k,i)=1:

[0187] For these tasks, since they can no longer wait to be grouped into larger batches or they would exceed the deadline, they are immediately started running in single batches, and to minimize the risk of timeouts, tasks with more pressing deadlines are always prioritized for pairing.

[0188] (2) Tasks with a maximum acceptable batch size of b(k,i)=2:

[0189] For these tasks, all such tasks are grouped into batches of size 2 and run. If there are any tasks that cannot be paired at the end, they are left in the queue to await scheduling at the next time. In order to minimize the risk of timeout, tasks with more pressing deadlines are always paired first.

[0190] (3) Tasks with a maximum acceptable batch size b(k,i)=4:

[0191] For these tasks, group them into batches of 4 and run them. If there are any tasks that cannot be matched, leave them in the queue to await scheduling at the next time. To minimize the risk of timeouts, always prioritize matching tasks with more pressing deadlines.

[0192] The processing method for other batch sizes (each batch size raised to the power of 2) is similar and will not be elaborated further until the largest batch B is reached, at which point the target processing result for each task i is obtained.

[0193] (v) Dynamic iteration and continuous optimization:

[0194] The adaptive scheduling process is dynamic, and the above steps are executed at each discrete scheduling time T. When a new task arrives or the status of a task in the queue changes, b(k,i) needs to be recalculated based on the updated time and the remaining deadline of the task to achieve continuous optimization of energy efficiency.

[0195] like Figure 5 As shown, Figure 5 This is a schematic diagram of the module structure of a task processing device provided in an embodiment of this application. The task processing device is applied to a heterogeneous intelligent computing cluster, which includes multiple processors of different types. The task processing device 300 may include the following modules 310 to 350:

[0196] The acquisition module 310 is used to acquire the initial task to be processed and the task deadline of the initial task;

[0197] The latest run time determination module 320 is used to obtain the task preset time for each type of processor to run the initial task with a different preset batch size, and determine the corresponding latest run time based on the task preset time and task deadline.

[0198] The target batch size determination module 330 is used to obtain the current scheduling time. For each type of processor, it selects the target latest running time of the initial task from multiple corresponding latest running times based on the current scheduling time, and determines the preset batch size corresponding to the target latest running time as the target batch size. The task completion time corresponding to the initial task executed at the target latest running time does not exceed the task deadline time, and the target latest running time is closest to the current scheduling time.

[0199] The target processor determination module 340 is used to obtain the energy consumption value of each type of processor running the initial task with the corresponding target batch size, and select the processor with the smallest energy consumption value from multiple energy consumption values ​​as the target processor.

[0200] The target execution module 350 is used to run the initial task in the target processor with the corresponding target batch size and obtain the target processing result corresponding to the initial task.

[0201] The specific implementation of this task processing device is basically the same as the specific embodiment of the task processing method described above, and will not be repeated here.

[0202] In some embodiments, the target processor determination module 340 is used to:

[0203] When there are multiple initial tasks to be processed, determine at least one first target task that each type of processor needs to run, based on the target processor corresponding to each initial task.

[0204] When there are multiple first target tasks, at least one second target task to be processed under each preset batch size is determined from the multiple first target tasks according to the target batch size corresponding to each first target task.

[0205] For each type of processor, the current batch size is selected sequentially from multiple preset batch sizes in ascending order, and at least one second target task is run under the current batch size to obtain the target processing result corresponding to each second target task.

[0206] In some embodiments, the target processor determining module 340 is further configured to:

[0207] For each type of processor, obtain the number of processing cores.

[0208] When there are multiple second target tasks and the number of second target tasks exceeds the number of processing cores, determine the difference between the number of processor cores and the number of second target tasks, and put the second target tasks with the difference number into a preset waiting queue;

[0209] Select the current batch size from multiple preset batch sizes in ascending order, and run the number of processing cores of the second target task under the current batch size;

[0210] After the number of second target tasks that have been processed are completed, a preset number of second target tasks are retrieved from the preset waiting queue and run according to the difference, so as to obtain the target processing result corresponding to each second target task.

[0211] In some embodiments, the target processor determining module 340 is further configured to:

[0212] Get the remaining processing time between the current scheduling time and the deadline time corresponding to each second target task;

[0213] Based on the remaining processing time in ascending order, the second target task corresponding to each remaining processing time is retrieved sequentially, and each second target task is run in the retrieval order within the current batch size to obtain the target processing result corresponding to each second target task.

[0214] In some embodiments, the target processor determining module 340 is further configured to:

[0215] Obtain the update scheduling time. If the update scheduling time reaches the preset update time and there is still at least one unprocessed initial task, re-obtain the preset time for each type of processor to run each initial task with a different preset batch size. Determine the latest update execution time based on the preset time and deadline of each update task.

[0216] For each type of processor, the latest execution time of the update target of the initial task is selected from multiple latest execution times of the update schedule according to the update schedule time, and the preset batch size corresponding to the latest execution time of the update target is determined as the update target batch size. Among them, the task completion time corresponding to the initial task is executed at the latest execution time of the update target does not exceed the task deadline time, and the latest execution time of the update target is closest to the update schedule time.

[0217] Obtain the update energy consumption value of each type of processor running the initial task with the corresponding update target batch size, and select the processor with the smallest update energy consumption value from multiple energy consumption values ​​as the update target processor;

[0218] For each unprocessed initial task, run the initial task in the update target processor with the corresponding update target batch size to obtain the target processing result corresponding to the initial task.

[0219] In some embodiments, the latest runtime determination module 320 is used for:

[0220] Obtain the preset time for each type of processor to run the initial task with different preset batch sizes, wherein the preset time for running the initial task with different preset batch sizes increases as the corresponding preset batch size increases;

[0221] For each preset batch size, subtract the task deadline from the preset task time for running the initial task under the preset batch size to obtain the latest execution time for running the initial task under the current preset batch size.

[0222] In some embodiments, the target processor determining module 340 is further configured to:

[0223] Obtain the energy consumption value of each type of processor running the initial task with the corresponding target batch size, wherein the energy consumption value of running the initial task with different preset batch sizes decreases as the corresponding preset batch size increases;

[0224] When there are multiple energy consumption values ​​with the same value, the target batch size with the smallest value is selected as the optimal target batch size from the target batch sizes corresponding to each energy consumption value with the same value.

[0225] The processor corresponding to the optimal target batch size is determined as the target processor.

[0226] The task processing method, apparatus, electronic device, and storage medium proposed in this application involve: acquiring the initial task to be processed and the task deadline of the initial task; acquiring the preset time for each type of processor to run the initial task with a different preset batch size, and determining the corresponding latest running time based on each task's preset time and task deadline; acquiring the current scheduling time, and for each type of processor, selecting the target latest running time of the initial task from multiple corresponding latest running times based on the current scheduling time, and determining the preset batch size corresponding to the target latest running time as the target batch size, wherein the task completion time corresponding to the initial task executed at the target latest running time does not exceed the task deadline, and the target latest running time is closest to the current scheduling time; acquiring the energy consumption value of each type of processor running the initial task with the corresponding target batch size, and selecting the processor with the smallest energy consumption value from multiple energy consumption values ​​as the target processor; and running the initial task in the target processor with the corresponding target batch size to obtain the target processing result corresponding to the initial task.

[0227] This embodiment of the application determines the maximum acceptable batch size, i.e., the target batch size, for the initial task to run on each different type of processor based on the task deadline. Then, by comparing the energy efficiency across multiple optimal "processor-target batch size" options, the target processor with the lowest overall energy consumption while satisfying latency constraints is ultimately selected for the initial task. Thus, this embodiment of the application can intelligently match the initial task to the most energy-efficient computing path in the heterogeneous intelligent computing cluster, avoiding assigning the initial task to processors with high power consumption and low batch utilization. This significantly reduces unnecessary energy consumption while ensuring the initial task can be completed on time, greatly improving the overall energy efficiency of the heterogeneous intelligent computing cluster.

[0228] like Figure 6 As shown, Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device includes:

[0229] The processor 401 can be implemented using a general-purpose central processing unit, microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0230] The memory 402 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 402 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 402 and called by the processor 401 to execute the image analysis method of the embodiments of this application.

[0231] Input / output interface 403 is used to implement information input and output;

[0232] The communication interface 404 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0233] Bus 405 transmits information between various components of the device (e.g., processor 401, memory 402, input / output interface 403, and communication interface 404);

[0234] The processor 401, memory 402, input / output interface 403 and communication interface 404 are connected to each other within the device via bus 405.

[0235] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described image analysis method.

[0236] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0237] The task processing method, apparatus, electronic device, and storage medium proposed in this application involve: acquiring the initial task to be processed and the task deadline of the initial task; acquiring the preset time for each type of processor to run the initial task with a different preset batch size, and determining the corresponding latest running time based on each task's preset time and task deadline; acquiring the current scheduling time, and for each type of processor, selecting the target latest running time of the initial task from multiple corresponding latest running times based on the current scheduling time, and determining the preset batch size corresponding to the target latest running time as the target batch size, wherein the task completion time corresponding to the initial task executed at the target latest running time does not exceed the task deadline, and the target latest running time is closest to the current scheduling time; acquiring the energy consumption value of each type of processor running the initial task with the corresponding target batch size, and selecting the processor with the smallest energy consumption value from multiple energy consumption values ​​as the target processor; and running the initial task in the target processor with the corresponding target batch size to obtain the target processing result corresponding to the initial task.

[0238] This embodiment of the application determines the maximum acceptable batch size, i.e., the target batch size, for the initial task to run on each different type of processor based on the task deadline. Then, by comparing the energy efficiency across multiple optimal "processor-target batch size" options, the target processor with the lowest overall energy consumption while satisfying latency constraints is ultimately selected for the initial task. Thus, this embodiment of the application can intelligently match the initial task to the most energy-efficient computing path in the heterogeneous intelligent computing cluster, avoiding assigning the initial task to processors with high power consumption and low batch utilization. This significantly reduces unnecessary energy consumption while ensuring the initial task can be completed on time, greatly improving the overall energy efficiency of the heterogeneous intelligent computing cluster.

[0239] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0240] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0241] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0242] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0243] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0244] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0245] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0246] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0247] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0248] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0249] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A task processing method, characterized in that, Applied to heterogeneous intelligent computing clusters, wherein the heterogeneous intelligent computing clusters include multiple processors of different types, the method includes: Obtain the initial task to be processed, and the task deadline of the initial task; Obtain the preset time for each type of processor to run the initial task with a different preset batch size, and determine the corresponding latest running time based on each preset time and the task deadline. Obtain the current scheduling time. For each type of processor, select the target latest running time of the initial task from the corresponding multiple latest running times based on the current scheduling time, and determine the preset batch size corresponding to the target latest running time as the target batch size. The task completion time corresponding to the initial task is executed at the target latest running time and does not exceed the task deadline time, and the target latest running time is closest to the current scheduling time. Obtain the energy consumption value of each type of processor running the initial task with the corresponding target batch size, and select the processor with the smallest energy consumption value from the multiple energy consumption values ​​as the target processor; The initial task is run in the target processor with the corresponding target batch size to obtain the target processing result corresponding to the initial task.

2. The task processing method according to claim 1, characterized in that, After selecting the processor with the smallest energy consumption value from the plurality of energy consumption values ​​as the target processor, the method further includes: When there are multiple initial tasks to be processed, determine at least one first target task that each type of processor needs to run, based on the target processor corresponding to each initial task. When there are multiple first target tasks, at least one second target task to be processed under each preset batch size is determined from the multiple first target tasks according to the target batch size corresponding to each first target task. For each type of processor, the current batch size is selected sequentially from multiple preset batch sizes in ascending order, and at least one of the second target tasks is run under the current batch size to obtain the target processing result corresponding to each second target task.

3. The task processing method according to claim 2, characterized in that, After determining at least one second target task to be processed at each preset batch size from a plurality of first target tasks, the method further includes: For each type of processor, obtain the number of processing cores of the processor; When there are multiple second target tasks and the number of second target tasks exceeds the number of processing cores, the difference between the number of processor cores and the number of second target tasks is determined, and the second target tasks with the difference are placed in a preset waiting queue. Select the current batch size from multiple preset batch sizes in ascending order, and run the number of second target tasks of the specified number of processing cores under the current batch size; After the number of second target tasks in the processing cores is completed, a preset number of second target tasks are retrieved from the preset waiting queue and run according to the difference, so as to obtain the target processing result corresponding to each second target task.

4. The task processing method according to claim 3, characterized in that, The step of retrieving and running a preset number of second target tasks from the preset waiting queue based on the difference quantity, and obtaining the target processing result corresponding to each second target task, includes: Obtain the remaining processing time between the current scheduling time and the deadline time corresponding to each of the second target tasks; According to the remaining processing time in ascending order, the second target task corresponding to each remaining processing time is retrieved sequentially, and each second target task is run sequentially according to the retrieval order under the current batch size to obtain the target processing result corresponding to each second target task.

5. The task processing method according to claim 2, characterized in that, After running at least one of the second target tasks at the current batch size, the process further includes: Obtain the update scheduling time. If the update scheduling time reaches the preset update time and there are still at least one unprocessed initial task, re-obtain the preset time for each type of processor to run each initial task with a different preset batch size. Determine the corresponding latest update running time based on the preset time of each update task and the task deadline. For each type of processor, the latest execution time of the update target of the initial task is selected from the corresponding multiple latest execution times of the update scheduling time according to the update scheduling time, and the preset batch size corresponding to the latest execution time of the update target is determined as the update target batch size. The task completion time of the initial task corresponding to the latest execution time of the update target does not exceed the task deadline time, and the latest execution time of the update target is closest to the update scheduling time. Obtain the update energy consumption value of each type of processor running the initial task with the corresponding update target batch size, and select the processor with the smallest update energy consumption value from the multiple energy consumption values ​​as the update target processor; For each unprocessed initial task, the initial task is run in the update target processor with the corresponding update target batch size to obtain the target processing result corresponding to the initial task.

6. The task processing method according to claim 1, characterized in that, The process of obtaining the preset time for each type of processor to run the initial task with different preset batch sizes, and determining the corresponding latest execution time based on each preset task time and the task deadline, includes: Obtain the preset task time for each type of processor to run the initial task with different preset batch sizes, wherein the preset task time for running the initial task with different preset batch sizes increases as the corresponding preset batch size increases; For each preset batch size, the task deadline and the preset time for running the initial task under the preset batch size are subtracted to obtain the latest running time for running the initial task under the current preset batch size.

7. The task processing method according to claim 1, characterized in that, The step of obtaining the energy consumption value of each type of processor running the initial task at the corresponding target batch size, and selecting the processor with the smallest energy consumption value from a plurality of energy consumption values ​​as the target processor, includes: Obtain the energy consumption value of each type of processor running the initial task at the corresponding target batch size, wherein the energy consumption value of running the initial task at different preset batch sizes decreases as the corresponding preset batch size increases; When there are multiple energy consumption values ​​with the same value, the target batch size with the smallest value is selected as the optimal target batch size from the target batch sizes corresponding to each energy consumption value with the same value. The processor corresponding to the optimal target batch size is determined as the target processor.

8. A task processing device, characterized in that, Applied to heterogeneous intelligent computing clusters, which include multiple different types of processors, including: The acquisition module is used to acquire the initial task to be processed and the task deadline of the initial task; The latest execution time determination module is used to obtain the preset time for each type of processor to run the initial task with different preset batch sizes, and determine the corresponding latest execution time based on each preset time and the task deadline. The target batch size determination module is used to obtain the current scheduling time, and for each type of processor, select the target latest running time of the initial task from the corresponding multiple latest running times according to the current scheduling time, and determine the preset batch size corresponding to the target latest running time as the target batch size. The task completion time corresponding to the initial task is executed at the target latest running time and does not exceed the task deadline time, and the target latest running time is closest to the current scheduling time. The target processor determination module is used to obtain the energy consumption value of each type of processor running the initial task at the corresponding target batch size, and select the processor with the smallest energy consumption value from the multiple energy consumption values ​​as the target processor; The target execution module is used to run the initial task in the target processor with the corresponding target batch size to obtain the target processing result corresponding to the initial task.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the task processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the task processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Computing device parameter adjustment method, product, device, server and medium

    CN119376960A

  • Adaptive batching for optimizing execution of machine learning tasks

    US20240208542A1