Task scheduling method and device, chip, equipment and storage medium

By introducing a task scheduling method that prioritizes large clusters and substitutes small clusters into artificial intelligence chips, the problem of imbalance between computing performance and resource utilization in cluster mode is solved, achieving efficient resource utilization and performance improvement.

CN121210071BActive Publication Date: 2026-04-21SHANGHAI BIREN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI BIREN TECH CO LTD
Filing Date
2025-11-21
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In existing technologies, cluster mode is difficult to balance computing performance and resource utilization, which prevents artificial intelligence chips from fully utilizing their computing power in practical applications and affects overall operating efficiency.

Method used

A task scheduling method is introduced, which obtains cluster size parameters of two different sizes and logically divides them into a first priority resource set and a second alternative resource set. The large-size cluster is used first to ensure high performance, while the small-size cluster is used to consume fragmented resources, thereby achieving dynamic adaptation and efficient utilization of resources.

Benefits of technology

While ensuring high-performance task execution, it significantly improves the overall resource utilization and computing efficiency of artificial intelligence chips, and reduces the idleness and waste of computing units.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121210071B_ABST
    Figure CN121210071B_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer technology and provides a task scheduling method, apparatus, chip, device, and storage medium. The method is applied to an artificial intelligence chip, which includes multiple computing clusters, each containing multiple computing units. The method includes: determining a first resource set and a second resource set based on a first size parameter and a second size parameter, as well as idle computing units in each computing cluster whose task status is idle; the first resource set and the second resource set respectively include idle computing units that can form a first cluster and idle computing units that can form a second cluster; prioritizing the allocation of tasks to be scheduled to idle computing units in the first resource set; and when there are insufficient idle computing units in the first resource set, allocating tasks to idle computing units in the second resource set. This achieves a balance between task performance and throughput, improving the overall resource utilization and computing efficiency of the artificial intelligence chip.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a task scheduling method, apparatus, chip, device, and storage medium. Background Technology

[0002] With the development of technologies such as artificial intelligence, machine learning, and big data analytics, society's demand for computing power has exploded. Parallel processors, represented by graphics processing units (GPUs) and artificial intelligence chips, have become the core hardware supporting modern computing-intensive applications due to their massive computing resources.

[0003] In existing technologies, clustering is widely used to improve parallel processing efficiency. Generally, the larger the cluster, the better the performance. However, due to hardware physical constraints and the irregularity of resource distribution, traditional cluster scheduling has a fatal problem: it is difficult to achieve an effective balance between computing performance and resource utilization. This results in the chip not being able to fully utilize its computing power in real-world applications, severely impacting overall operating efficiency. Summary of the Invention

[0004] This invention provides a task scheduling method, apparatus, chip, device, and storage medium to solve the problem of balancing computing performance and resource utilization in the prior art.

[0005] This invention provides a task scheduling method applied to an artificial intelligence chip, the artificial intelligence chip comprising multiple computing clusters, each computing cluster containing multiple computing units, the method comprising:

[0006] Obtain a first size parameter and a second size parameter, wherein the size of the first cluster corresponding to the first size parameter is greater than the size of the second cluster corresponding to the second size parameter;

[0007] Based on the first size parameter and the second size parameter, and the idle computing units in each computing cluster whose task status is idle, a first resource set and a second resource set are determined; the first resource set includes idle computing units that can form the first cluster, and the second resource set includes idle computing units that can form the second cluster.

[0008] Task scheduling is performed based on the first resource set and the second resource set; during the task scheduling process, the tasks to be scheduled are preferentially assigned to the idle computing units in the first resource set, and if there are not enough idle computing units in the first resource set, the tasks are assigned to the idle computing units in the second resource set.

[0009] According to a task scheduling method provided by the present invention, determining a first resource set and a second resource set based on the first size parameter and the second size parameter, and idle computing units in each computing cluster whose task status is idle, includes:

[0010] Traverse the computing clusters and identify idle computing units in each cluster whose task status is idle;

[0011] If the number of idle computing units in any computing cluster meets the first size parameter, the idle computing units in the computing cluster that meet the first size parameter are allocated to the first resource set.

[0012] If the number of remaining idle computing units in any computing cluster satisfies the second size parameter, the remaining idle computing units in any computing cluster that satisfy the second size parameter are allocated to the second resource set;

[0013] The remaining idle computing units are the idle computing units in any of the computing processing clusters that have not been assigned to the first resource set.

[0014] According to a task scheduling method provided by the present invention, the step of allocating idle computing units in any computing processing cluster that satisfy the first size parameter to the first resource set includes:

[0015] A first mark is made on the idle computing unit that meets the first size parameter, and the first mark is used to indicate that the corresponding idle computing unit belongs to the first cluster;

[0016] The step of allocating the remaining idle computing units in any of the computing processing clusters that satisfy the second size parameter to the second resource set includes:

[0017] The remaining idle computing units that meet the second size parameter are marked with a second mark, which indicates that the corresponding remaining idle computing units belong to the second cluster.

[0018] According to a task scheduling method provided by the present invention, the step of marking the idle computing units that satisfy the first size parameter includes:

[0019] In the idle computing unit that satisfies the first size parameter, the value of the register or memory location used to store the size parameter of the cluster to which it belongs is set as the first size parameter;

[0020] The step of marking the remaining free calculation units that satisfy the second size parameter in a second manner includes:

[0021] In the remaining free computing units that satisfy the second size parameter, the value of the register or memory location used to store the size parameter of the cluster to which it belongs is set as the second size parameter.

[0022] According to a task scheduling method provided by the present invention, the step of scheduling tasks based on a first resource set and a second resource set includes:

[0023] The total number of idle computing units in the first resource set is counted to obtain the first available resource quantity;

[0024] The total number of remaining idle computing units in the second resource set is counted to obtain the second available resource quantity;

[0025] Task scheduling is performed based on the first available resource quantity and the second available resource quantity.

[0026] According to a task scheduling method provided by the present invention, the task scheduling based on the first available resource quantity and the second available resource quantity further includes:

[0027] If the task is completed by any idle computing unit or any remaining idle computing unit, task completion information is generated; the task completion information includes a first size parameter of the first cluster to which the idle computing unit belongs, or a second size parameter of the second cluster to which the remaining idle computing unit belongs.

[0028] Based on the task completion information, update the quantity of the first available resource or the quantity of the second available resource.

[0029] The present invention also provides a task scheduling device applied to an artificial intelligence chip, the artificial intelligence chip comprising multiple computing clusters, each computing cluster containing multiple computing units, the device comprising:

[0030] An acquisition unit is used to acquire a first size parameter and a second size parameter, wherein the size of the first cluster corresponding to the first size parameter is greater than the size of the second cluster corresponding to the second size parameter;

[0031] The determining unit is configured to determine a first resource set and a second resource set based on the first size parameter and the second size parameter, as well as idle computing units in each computing processing cluster whose task status is idle; the first resource set includes idle computing units that can form the first cluster, and the second resource set includes idle computing units that can form the second cluster.

[0032] The scheduling unit is used to perform task scheduling based on the first resource set and the second resource set; during the task scheduling process, the task to be scheduled is preferentially assigned to the idle computing unit in the first resource set, and if there is insufficient idle computing unit in the first resource set, the task is assigned to the idle computing unit in the second resource set.

[0033] The present invention also provides an artificial intelligence chip, including a command processor, a queue manager and multiple computing clusters, each computing cluster containing multiple computing units;

[0034] The queue manager is used to obtain a first size parameter and a second size parameter; based on the first size parameter and the second size parameter, and the idle computing units in each computing cluster whose task status is idle, a first resource set and a second resource set are determined; the size of the first cluster corresponding to the first size parameter is greater than the size of the second cluster corresponding to the second size parameter; the first resource set includes idle computing units that can form the first cluster, and the second resource set includes idle computing units that can form the second cluster;

[0035] The command processor is used to perform task scheduling based on the first resource set and the second resource set; during the task scheduling process, the task to be scheduled is preferentially assigned to the idle computing unit in the first resource set, and if there is insufficient idle computing unit in the first resource set, the task is assigned to the idle computing unit in the second resource set.

[0036] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the task scheduling method as described above.

[0037] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the task scheduling method as described above.

[0038] The task scheduling method, apparatus, chip, device, and storage medium provided by this invention obtain cluster size parameters of two different sizes and logically divide idle computing resources into a priority first resource set and a substitute second resource set based on these parameters. During task scheduling, large-size clusters are used first to ensure high performance, while small-size clusters are used to consume fragmented computing resources. This achieves an excellent balance between ensuring the performance of core tasks and improving overall throughput, greatly reducing the idleness and waste of computing units caused by resource mismatch, and significantly improving the overall resource utilization and computing efficiency of artificial intelligence chips. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0040] Figure 1 This is a flowchart illustrating the task scheduling method provided by the present invention;

[0041] Figure 2 This is an example diagram of the cluster partitioning process provided by the present invention;

[0042] Figure 3 This is an interactive example diagram of the task scheduling process provided by the present invention;

[0043] Figure 4 This is a flowchart illustrating the resource quantification process provided by the present invention;

[0044] Figure 5 This is a schematic diagram of the task scheduling device provided by the present invention;

[0045] Figure 6 This is a schematic diagram of the structure of the artificial intelligence chip provided by the present invention;

[0046] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0048] With the rapid development of technologies such as Artificial Intelligence (AI), Machine Learning (ML), and Big Data Analytics, society's demand for computing power has exploded. To meet these high-concurrency, high-throughput computing demands, parallel processors, represented by Graphics Processing Units (GPUs) and AI chips, have emerged and become the core hardware supporting modern compute-intensive applications.

[0049] A key characteristic of these parallel processors is their massive computing resources. To effectively manage and utilize these resources, the hardware architecture typically employs a layered design. That is, a complete computing device usually contains multiple Compute Processing Clusters (SPCs), and each SPC integrates several Compute Units (CUs) that execute specific computational instructions. By decomposing massive computational tasks and distributing them to numerous computing units for parallel processing, extremely high computing speeds are achieved.

[0050] Currently, to further improve the efficiency of parallel processing, a cluster mode is commonly used to execute tasks. This mode logically combines multiple computing units within a single computing cluster into a single cluster and uses a multicast mechanism to simultaneously distribute instructions or data to all computing units within that cluster. Because the multicast mechanism can significantly reduce the latency and overhead of instruction distribution, the larger the cluster size (i.e., the number of computing units contained in a cluster), the better the cluster performance.

[0051] However, in practice, this cluster-based scheduling method suffers from an inherent contradiction, stemming from the physical constraints of the hardware and the rigidity of the scheduling strategy. On one hand, due to stringent requirements for signal synchronization and communication latency, cluster construction must occur between physically adjacent computing units; that is, a cluster can only consist of computing units within a single SPC, and cannot combine computing units across SPCs. On the other hand, due to chip design or manufacturing processes, the number of computing units contained in different SPCs may vary, and the number of idle computing units within each SPC changes dynamically during task execution, resulting in an irregular distribution of available idle resources. This physical constraint and the irregularity of resource distribution put the traditional scheduling method using fixed-size clusters into a dilemma:

[0052] If high performance is prioritized and large-size clusters are used for scheduling, for example, only a cluster of 4 CUs is generated, when there are exactly 2 or 3 idle CUs in a certain SPC, these scattered CUs cannot meet the conditions for forming a large-size cluster, resulting in them being idle and wasted, and causing insufficient utilization of the chip's overall computing resources.

[0053] If a small cluster is used for scheduling in order to prioritize high resource utilization, such as generating a cluster with only 2 CUs, although it can make more flexible use of fragmented idle resources, it sacrifices the multicast efficiency and performance advantages brought by the large cluster, resulting in the chip's peak performance not being fully utilized and the overall throughput being reduced.

[0054] In response, this invention provides a task scheduling method that introduces a hybrid size and priority scheduling mechanism of "large clusters first, small clusters as substitutes" to dynamically adapt to the irregular distribution of idle computing resources in the hardware. This achieves the goal of ensuring the priority execution of high-performance tasks while making full use of fragmented computing resources, thereby significantly improving the overall resource utilization and throughput of artificial intelligence chips.

[0055] Figure 1 This is a flowchart illustrating the task scheduling method provided by the present invention, as shown below. Figure 1 As shown, this method is applied to an artificial intelligence chip, which includes multiple computing processing clusters (SPCs), each containing multiple computing units (CUs) that execute specific computational instructions. The method includes:

[0056] Step 110: Obtain the first size parameter and the second size parameter, wherein the size of the first cluster corresponding to the first size parameter is greater than the size of the second cluster corresponding to the second size parameter;

[0057] Step 120: Based on the first size parameter and the second size parameter, and the idle computing units in each computing cluster whose task status is idle, determine the first resource set and the second resource set; the first resource set includes idle computing units that can form the first cluster, and the second resource set includes idle computing units that can form the second cluster.

[0058] Step 130: Perform task scheduling based on the first resource set and the second resource set; during the task scheduling process, prioritize the allocation of tasks to be scheduled to idle computing units in the first resource set, and if there are insufficient idle computing units in the first resource set, allocate tasks to idle computing units in the second resource set.

[0059] Specifically, before task scheduling, it is necessary to first determine the first size parameter (large cluster size) and the second size parameter (small cluster size). Both parameters are numerical and are used to define two logically different combinations of computing resources, namely, clusters.

[0060] In detail, the first size parameter defines a larger cluster, i.e., the first cluster; the second size parameter defines a smaller cluster, i.e., the second cluster. Here, the size of the first cluster corresponding to the first size parameter is larger than the size of the second cluster corresponding to the second size parameter. For example, the first size parameter can be 4, meaning that a first cluster consists of 4 computing units to pursue higher multicast efficiency and execution performance; meanwhile, the second size parameter can be 2, meaning that a second cluster consists of 2 computing units for more flexible resource utilization. The first and second size parameters can be written into the configuration register of the queue manager in the chip by the upper-layer software through the driver at startup, or they can be submitted together as part of the metadata of the tasks to be executed.

[0061] After determining the size parameters of these two types of clusters, in this embodiment of the invention, the first resource set and the second resource set can be determined based on the first and second size parameters, as well as the idle computing units in each computing cluster whose task status is idle. This process is the core of computing resource inventory and partitioning. Specifically, it is first necessary to know which computing resources are available, that is, to identify all computing units on the artificial intelligence chip whose task status is idle; these units are the idle computing units. Subsequently, the queue manager (qm) will traverse all computing clusters on the chip. In order to ensure extremely low communication latency and precise synchronous execution, the construction of a cluster is restricted to the physical boundary of a single computing cluster, and it is not allowed to combine scattered computing units across computing clusters.

[0062] Based on this, in this embodiment of the invention, when traversing each computing cluster to determine the first resource combination and the second resource combination, qm first scans each computing cluster and counts the number of idle computing units within it. If the total number of idle computing units in a computing cluster is greater than or equal to the first size parameter, then qm considers that the cluster is capable of providing one or more first clusters. These idle computing units identified in all computing clusters that can constitute a first cluster collectively constitute the first resource set.

[0063] The following two specific examples illustrate the cluster partitioning process:

[0064] Example one, Figure 2 This is an example diagram of the cluster partitioning process provided by the present invention, such as... Figure 2 As shown, the artificial intelligence chip contains 4 SPCs, and each SPC contains 6 idle CUs. In this case, if the first size parameter is 4, the 4 idle CUs in each SPC will be logically assigned to the first resource set.

[0065] Example 2: When different SPCs contain different numbers of idle cu, for example, a computing cluster A has 8 idle cu and another computing cluster B has 5 idle cu, then the 8 idle cu in A (which can form two first clusters) and the 4 idle cu in B (which can form one first cluster, leaving 1) will be assigned to the first resource set.

[0066] Next, a second resource set needs to be determined, which includes idle computing units that can form a second cluster. This process is essentially utilizing the "leftover" resources from the previous round of partitioning. That is, QM scans for idle computing units not included in the first resource set, i.e., remaining idle computing units. Similarly, within a single computing cluster, if the number of these remaining idle computing units is sufficient to form one or more second clusters (i.e., the number is greater than or equal to the second size parameter), they will be logically included in the second resource set. Continuing with example two, computing cluster B has one remaining idle computing unit, which, because it is smaller than the second size parameter (e.g., the first size parameter is 2), cannot form a second cluster. However, if there is another computing cluster C with three remaining idle computing units (which, because they are less than four, cannot form a first cluster), then two of these three remaining idle computing units can form a second cluster and be included in the second resource set. Through this process, physically irregular idle resources are logically and orderly organized into two standardized resource pools.

[0067] After this, tasks can be scheduled based on the first and second resource sets. Here, a task to be scheduled refers to a computational work unit submitted by the upper-layer software and stored in the task queue awaiting execution; for example, it could be a thread block. The scheduling process follows a clear priority strategy: when the command processor (cp) on the chip needs to allocate a new task, it will prioritize allocating the task to be scheduled to an idle computational unit in the first resource set. This means that the high-performance first cluster will be used first to execute the task to ensure optimal running efficiency.

[0068] When there are insufficient idle computing units in the first resource set—for example, when all available first clusters are occupied—the scheduling strategy's substitution mechanism takes effect to prevent processors from becoming idle. Specifically, the processor queue (CP) will then allocate tasks to idle computing units in the second resource set. In this way, fragmented resources that cannot form large-scale clusters can be effectively utilized to execute additional tasks, thereby improving the chip's overall concurrent processing capability.

[0069] It should be noted that the task manager and the command processor can be separate hardware units, meaning the task manager can be configured independently of the command processor. Of course, the task manager can also be integrated into the command processor as a submodule. The specific implementation can be set according to the actual situation, and this embodiment of the invention does not impose any specific limitations on this.

[0070] The task scheduling method provided by this invention obtains cluster size parameters of two different sizes and logically divides idle computing resources into a priority first resource set and a substitute second resource set based on these parameters. During task scheduling, large-size clusters are used first to ensure high performance, while small-size clusters are used to consume fragmented computing resources. This achieves an excellent balance between ensuring the performance of core tasks and improving overall throughput, greatly reducing the idleness and waste of computing units caused by resource mismatch, and significantly improving the overall resource utilization and computing efficiency of artificial intelligence chips.

[0071] Based on the above embodiments, step 120 includes:

[0072] Traverse the computing clusters and identify idle computing units in each cluster whose task status is idle;

[0073] If the number of idle computing units in any computing cluster meets the first size parameter, the idle computing units in the computing cluster that meet the first size parameter are allocated to the first resource set.

[0074] If the number of remaining idle computing units in the computing cluster meets the second size parameter, the remaining idle computing units in the computing cluster that meet the second size parameter are allocated to the second resource set; the remaining idle computing units are the idle computing units in the computing cluster that have not been allocated to the first resource set.

[0075] Specifically, the process of determining the first resource set and the second resource set based on the first size parameter and the second size parameter, as well as the idle computing units in each computing cluster whose task status is idle, may include:

[0076] First, QM iterates through all compute clusters to determine the available computing units within each cluster. This iteration is systematic; QM checks each compute cluster on the chip to assess the real-time availability of resources within each cluster. For each checked compute cluster, QM executes the following large-cluster-first partitioning logic. The entire partitioning process consists of two phases:

[0077] Phase 1: Prioritizing the allocation of the first resource set. For any computing cluster, QM determines whether the number of idle computing units within it meets a first size parameter, i.e., whether the number is greater than or equal to the first size parameter. If the first size parameter is met, QM prioritizes using these idle computing units to form the first cluster. Specifically, it allocates the idle computing units in the computing cluster that meet the first size parameter to the first resource set. For example, if the first size parameter is 4, and the computing cluster currently being checked by QM has 7 idle CUs, since 7 is greater than or equal to 4, the condition for forming the first cluster is met. Therefore, QM will select 4 of these 7 idle CUs and logically mark or classify the set of these 4 idle CUs into the first resource set.

[0078] This prioritization ensures that, given sufficient resources, larger, higher-performance clusters will be prioritized for formation.

[0079] Phase Two: Utilizing Remaining Resources to Divide the Resource Set into a Second Set. That is, after the first phase of partitioning, there may still be unused idle computing units within the computing cluster, i.e., remaining idle computing units. Continuing the previous example, 4 out of the 7 idle CUs were assigned to the first resource set, leaving 3 idle CUs; ​​these 3 CUs are the remaining idle computing units.

[0080] Next, QM determines whether the number of these remaining idle computing units satisfies the second size parameter. If the second size parameter is satisfied, QM will allocate the remaining idle computing units in the computing cluster that satisfy the second size parameter to the second resource set. Continuing the previous example, if the second size parameter is 2, since there are still 3 remaining idle computing units in the computing cluster, the number is greater than 2, satisfying the condition for forming a second cluster. Therefore, QM will take 2 of these 3 remaining idle computing units and logically assign these 2 remaining idle computing units to the second resource set.

[0081] After these two stages of processing, for a computing cluster that initially had 7 idle computing units, 4 idle computing units were ultimately allocated to the first resource set, 2 idle computing units were allocated to the second resource set, and 1 idle computing unit was temporarily idle in this round of scheduling because it could not meet any cluster size requirements. QM will repeat this two-stage partitioning process for all computing clusters on the chip, and the final first and second resource sets are the summary of all computing cluster partitioning results.

[0082] In this embodiment of the invention, this ordered partitioning process, prioritizing large clusters over smaller ones, ensures that the construction needs of high-performance, large-scale clusters are met first within each local resource pool (i.e., each computing cluster). This avoids the inappropriate and premature splitting of available resources into multiple small clusters, thereby maximizing the number of the first clusters and maintaining the baseline of overall performance. Based on this, a second cluster is then used to fill gaps and utilize remaining fragmented resources, thus achieving synergistic optimization of resource utilization and performance.

[0083] Based on the above embodiments, idle computing units in the computing cluster that satisfy the first size parameter are allocated to a first resource set, including:

[0084] A first mark is made on the idle computing unit that meets the first size parameter. The first mark is used to indicate that the corresponding idle computing unit belongs to the first cluster.

[0085] The remaining idle computing units in the computing cluster that satisfy the second size parameter are allocated to the second resource set, including:

[0086] The remaining idle computing units that meet the second size parameter are marked with a second mark, which is used to indicate that the corresponding remaining idle computing units belong to the second cluster.

[0087] Specifically, when QM determines, during the first phase of scanning, that a group of idle computing units in a computing cluster meet a first size parameter, it can then perform a first marking on these idle computing units. This first marking is a specific identifier indicating that the corresponding idle computing unit belongs to the first cluster. In a preferred hardware implementation, each computing unit includes a special register that QM can write to. The process of performing the first marking can be that QM writes a specific value into the special register inside each of these idle computing units.

[0088] For example, this specific value could be the first size parameter itself, such as the value 4. Therefore, when the value of this special register inside an idle computing unit is 4, it means that it has been marked with the first tag and has become a member of the first resource set.

[0089] Similarly, in the second phase of the scan, when qm determines that a group of remaining idle computing units in a certain computing cluster meets the second size parameter, it can assign a second mark to the remaining idle computing units that meet the second size parameter. The second mark is also a clear identifier used to indicate that the corresponding remaining idle computing unit belongs to the second cluster.

[0090] Corresponding to the implementation of the first marking, the process of marking the second mark can be as follows: qm writes the value of the second size parameter, such as the value 2, into a special register inside each of the remaining free computing units in this group of free computing units. In this way, a free computing unit with a special register value of 2 means that it has been marked with the second mark and has become a member of the second resource set.

[0091] For example, a computing cluster has 7 idle computing units, with a first size parameter of 4 and a second size parameter of 2.

[0092] First marking process: qm selects 4 idle computing units and writes the value 4 into the special registers inside these 4 idle computing units. These 4 idle computing units are now marked with the first mark.

[0093] The second marking process: qm selects two of the three remaining free computing units and writes the value 2 into the special registers inside these two remaining free computing units. These two remaining free computing units are now marked with the second mark.

[0094] This marking mechanism ensures that the result of resource allocation is no longer a temporary logical concept existing only within qm, but is persistently and distributedly recorded on each computing unit itself.

[0095] In this embodiment of the invention, the introduction of a distributed marking mechanism (storing the marks within the computing unit itself) makes subsequent task scheduling and execution more efficient. On the one hand, the kernel does not need to maintain a complex, centralized mapping table to track the affiliation of each computing unit, simplifying the scheduling logic. On the other hand, when a task is distributed to a computing unit for execution, the kernel can directly query the mark of its own computing unit to know its cluster affiliation and execute the corresponding optimized computing logic, further improving overall operating efficiency.

[0096] Based on the above embodiments, a first mark is made on the idle computing units that satisfy the first size parameter, including:

[0097] In the idle computing unit that meets the first size parameter, the value of the register or memory location used to store the cluster size parameter is set as the first size parameter;

[0098] The remaining free computational units that satisfy the second size parameter are marked with a second mark, including:

[0099] In the remaining free computing units that satisfy the second size parameter, the value of the register or memory location used to store the cluster size parameter is set to the second size parameter.

[0100] Specifically, the above-mentioned first marking process can be implemented at the hardware level by setting the value of a special register in an idle computing unit that satisfies the first size parameter, i.e., the register or memory location used to store the size parameter of the cluster to which it belongs, to the first size parameter.

[0101] Here, the register or memory location storing the cluster size parameter refers to a specific storage space reserved in the hardware design of each computing unit. This storage space can be a dedicated configuration register or a predefined address in the computing unit's local memory. Its function is to record the size information of the logical cluster to which the computing unit is currently programmed. When QM identifies a group of idle computing units as being able to form the first cluster, it performs a write operation, directly writing the value of the first size parameter (e.g., the value 4) into the register or memory location inside each idle computing unit in this group. At this point, these idle computing units have completed the first marking, and their internal state has clearly recorded that they belong to a cluster of size 4.

[0102] Correspondingly, the second marking process also adopts the same technical means. Its specific implementation includes setting the value of the special register in the remaining free computing unit that satisfies the second size parameter, that is, the register or memory location used to store the size parameter of the cluster to which it belongs, to the second size parameter.

[0103] Specifically, when QM identifies a group of remaining idle computing units as capable of forming a second cluster in the second phase, it also performs a write operation, writing the value of the second size parameter (e.g., the value 2) into the register or memory location inside each of these remaining idle computing units. After the write is complete, these remaining idle computing units are successfully marked with the second tag, and their internal state clearly records that they belong to a cluster of size 2.

[0104] In this embodiment of the invention, the cluster size parameters are directly written into the registers or memory of the computing unit itself, enabling each computing unit to be aware of the size of its cluster, greatly simplifying the subsequent processing flow. Specifically, on the one hand, after distributing tasks, the compute unit (CP) no longer needs to track the specific cluster configuration used by each task; on the other hand, the kernel can easily and quickly learn its current operating environment (such as whether it is running on a 4-unit cluster or a 2-unit cluster) by reading the value of this local register, thereby enabling it to execute the optimal matching algorithm or data access mode, further improving the program's execution efficiency and overall performance.

[0105] Based on the above embodiments, task scheduling based on the first resource set and the second resource set includes:

[0106] The total number of idle computing units in the first resource set is counted to obtain the first available resource quantity;

[0107] The total number of remaining idle computing units in the second resource set is counted to obtain the number of second available resources;

[0108] Task scheduling is based on the first and second available resource quantities.

[0109] Specifically, the above-mentioned task scheduling process based on the first resource set and the second resource set may include:

[0110] First, QM counts the total number of idle computing units in the first resource set to obtain the first available resource quantity. This process involves a global inventory of all idle computing units marked with the first tag. For example, if computing cluster A contributes 4 idle computing units marked as the first cluster and computing cluster B contributes 8 (forming two first clusters) idle computing units in the entire chip, then QM will not send "A has one, B has two" to CP, but will directly summarize to obtain a total. In this case, the initial value of the first available resource quantity is 12 (4+8).

[0111] Similarly, qm will also count the total number of remaining idle computing units in the second resource set to obtain the number of second available resources. This process involves counting all computing units that have been marked with the second tag. For example, if computing cluster C contributes 2 remaining idle computing units marked as the second cluster in the entire chip, and computing cluster D also contributes 2 remaining idle computing units, then the number of second available resources is 4 (2+2).

[0112] It should be noted here that the number of first and second available resources is not fixed. Their initial values ​​are determined by the aforementioned resource inventory and allocation process, but in actual applications, they will be updated in real time as tasks are scheduled and completed.

[0113] Subsequently, cp can schedule tasks based on the first and second available resource quantities. That is, when a task to be scheduled, such as a thread block, needs to be allocated, cp executes the following scheduling loop logic based on priority and dynamic counting:

[0114] The compiler (CP) first checks if the current value of the first available resource quantity is greater than zero. Since the idle computing units included in the first resource set are guaranteed to form the first cluster during the initial statistics, the current value must be an integer multiple of the first size parameter. Therefore, checking if it is greater than zero is equivalent to checking if any available first clusters still exist.

[0115] If the number of available resources is greater than zero, the CP (Processing Cluster) will issue a scheduling instruction to assign the task to a first cluster. Simultaneously, it will subtract a first size parameter from the number of available resources. For example, if the current number of available resources is 12 and the first size parameter is 4, the current value will be immediately updated to 8 after a task is successfully assigned. The CP itself does not need to know which specific physical computing cluster the task is assigned to; the underlying hardware logic will handle the actual binding.

[0116] If the current value of the first available resource quantity is zero, meaning all available first clusters are already occupied, the CP (Content Provider) replacement mechanism is activated. It then checks if the current value of the second available resource quantity is greater than zero to determine if a second cluster is available.

[0117] If the number of second available resources is greater than zero, cp will schedule the task to a second cluster and correspondingly subtract a second size parameter from the number of second available resources.

[0118] Once any cluster completes its task, it sends a task completion message to the resource pool (CP), which includes its cluster size parameters. Upon receiving this message, the CP will increase the number of first or second available resources accordingly, returning the released resources to the corresponding available resource pool for subsequent task allocation.

[0119] In this embodiment of the invention, by abstracting and quantifying physically dispersed and heterogeneous cluster resources into two simple available resources, the logical complexity of the task scheduler is greatly simplified. The task scheduler (CP) deals with two logical, standardized resource pools, rather than a complex physical topology. Its decision-making process is simplified to priority checking and addition / subtraction operations on the counts of the two available resources, achieving decoupling between physical resource discovery and logical resource scheduling. This design not only facilitates faster scheduling decisions and reduces hardware implementation overhead, but also ensures consistency and efficiency in resource allocation and release through a clear dynamic cyclic process.

[0120] Based on the above embodiments, task scheduling is performed based on the first available resource quantity and the second available resource quantity, and then the process further includes:

[0121] When any idle computing unit or any remaining idle computing unit completes a task, task completion information is generated; the task completion information includes the first size parameter of the first cluster to which the idle computing unit belongs, or the second size parameter of the second cluster to which the remaining idle computing unit belongs.

[0122] Based on task completion information, update the quantity of the first or second available resources.

[0123] Specifically, after task scheduling is performed based on the first and second available resource quantities, resource reclamation and status updates will be performed after a cluster completes its task.

[0124] In detail, task completion information is generated when any idle computing unit or any remaining idle computing unit completes its task. Here, any idle computing unit refers to a computing unit previously assigned to the first resource set and formed into the first cluster to execute the task; while any remaining idle computing unit refers to a computing unit assigned to the second resource set and formed into the second cluster to execute the task. When a cluster completes its assigned task, it will proactively send task completion information to the CP. This task completion information includes the first size parameter of the first cluster to which the idle computing unit belongs, or the second size parameter of the second cluster to which the remaining idle computing unit belongs. This means that the cluster that completes the task reports the size of its cluster at the same time as reporting task completion. For example, a first cluster consisting of 4 computing units will report task completion information containing the value 4 after completing its task.

[0125] Upon receiving a task completion message carrying the size parameter of its associated cluster, the cp instance can update the quantity of either the first or second available resources based on this information. Specifically, when the cp receives a task completion message containing the first size parameter (e.g., 4), it knows that a first cluster has been released. Therefore, it will increment the current quantity of first available resources by the value corresponding to the first size parameter (e.g., adding 4 to the original quantity). Similarly, when the cp receives a task completion message containing the second size parameter (e.g., 2), it knows that a second cluster has been released. Therefore, it will increment the current quantity of second available resources by the value corresponding to the second size parameter (e.g., adding 2 to the original quantity).

[0126] Through the above process, whenever a resource is released, the two available resources maintained by cp will be precisely updated, thus forming a dynamic, closed-loop resource management process.

[0127] In this embodiment of the invention, the cluster that completes the task actively reports the size of its cluster and updates the number of available resources accordingly. This ensures that the first and second available resource quantities on which the CP depends can always accurately reflect the real-time idle resource status of the chip, thereby avoiding erroneous decisions based on "outdated" information and greatly improving the response speed, robustness and efficiency of the entire scheduling process.

[0128] Based on the above embodiments, Figure 3 This is an interactive example diagram of the task scheduling process provided by the present invention. Figure 4 This is a flowchart illustrating the resource quantification process provided by the present invention. For example... Figure 3 and Figure 4 As shown, the entire task scheduling process includes:

[0129] See Figure 4 As can be seen, the execution of the entire mixed-size cluster scheduling scheme begins with the upper-layer software configuring the hardware. First, the software sets a function switch (enable) to activate the scheduling mode. Subsequently, it provides two core parameters to the queue manager (qm): the first size parameter (largecluster size) corresponding to the first cluster (large cluster) and the second size parameter (small cluster size) corresponding to the second cluster (small cluster).

[0130] Upon receiving the configuration parameters, QM immediately performs an inventory and partitioning of the computing units (cu) of all computing processing clusters (SPCs) within the chip. This process follows a "large to small" priority principle: First, within each computing processing cluster, all idle computing units that can form the first cluster are identified and marked; then, among the remaining unmarked idle computing units, all computing units that can form the second cluster are identified and marked.

[0131] The final output of this partitioning process consists of two quantified and abstracted values ​​that need to be sent to the command processor (cp): the first total number of available resources (large_cu_num) and the second number of available resources (small_cu_num). Through this process, physically irregular and scattered computing resources are transformed into two logically clear and easily managed resource pools.

[0132] like Figure 3 As shown, QM maintains multiple task queues (queue_0 to queue_n), and each task queue stores multiple tasks submitted by the upper-layer software that are waiting to be scheduled, i.e., thread blocks. Each task queue is managed by two pointers: the head pointer points to the next thread block that will be scheduled for execution, and the tail pointer points to the last thread block in the task queue that is waiting to be scheduled for execution.

[0133] When cp performs task scheduling, its decision-making is based on the aforementioned large_cu_num and small_cu_num. When the task queue is not empty (i.e., the head has not reached the tail position), cp executes the following priority scheduling logic:

[0134] First, `cp` checks if `large_cu_num` is greater than zero. If so, it decides to assign the task and interacts with `qm` to retrieve a thread block (`tb`) from the head of the task queue and schedule it to be executed in the first cluster. Simultaneously, `cp` subtracts the value corresponding to the first size parameter from `large_cu_num`.

[0135] If large_cu_num equals zero, cp will check if small_cu_num is greater than zero. If it is, it will take a thread block (tb) from the head of the queue, schedule it to a second cluster for execution, and subtract the value corresponding to the second size parameter from small_cu_num.

[0136] Furthermore, when a cluster (whether it's the first or second cluster) completes a task, it sends a task completion message to the cp. This message contains the size parameters of its cluster (i.e., the first or second size parameter). Upon receiving this message, the cp adds the corresponding value back to large_cu_num or small_cu_num based on the reported size parameters, thus completing resource reclamation and real-time updates of available resources.

[0137] This invention establishes a complete closed loop from configuration input, resource quantization, priority scheduling to resource reclamation. By abstracting complex physical resource topology into simple available resources, the scheduling logic of the CPU is greatly simplified. At the same time, through the strategy of "large clusters first, small clusters as substitutes", a perfect balance is achieved between pursuing high performance and improving resource utilization, thereby maximizing the computing efficiency of the entire chip.

[0138] The task scheduling device provided by the present invention is described below. The task scheduling device described below and the task scheduling method described above can be referred to in correspondence.

[0139] Figure 5 This is a schematic diagram of the task scheduling device provided by the present invention, as shown below. Figure 5 As shown, this device is applied to an artificial intelligence chip, which includes multiple computing clusters, each containing multiple computing units. The device includes:

[0140] The acquisition unit 510 is used to acquire a first size parameter and a second size parameter, wherein the size of the first cluster corresponding to the first size parameter is greater than the size of the second cluster corresponding to the second size parameter.

[0141] The determining unit 520 is configured to determine a first resource set and a second resource set based on the first size parameter and the second size parameter, as well as the idle computing units in each computing processing cluster whose task status is idle; the first resource set includes idle computing units that can form the first cluster, and the second resource set includes idle computing units that can form the second cluster.

[0142] The scheduling unit 530 is used to perform task scheduling based on the first resource set and the second resource set; during the task scheduling process, the task to be scheduled is preferentially assigned to the idle computing unit in the first resource set, and if there is insufficient idle computing unit in the first resource set, the task is assigned to the idle computing unit in the second resource set.

[0143] The task scheduling device provided by this invention acquires cluster size parameters of two different sizes and logically divides idle computing resources into a priority first resource set and a substitute second resource set based on these parameters. During task scheduling, it prioritizes the use of large-size clusters to ensure high performance, while utilizing small-size clusters to consume fragmented computing resources. This achieves an excellent balance between ensuring the performance of core tasks and improving overall throughput, greatly reducing the idleness and waste of computing units caused by resource mismatch, and significantly improving the overall resource utilization and computing efficiency of artificial intelligence chips.

[0144] Based on the above embodiments, the determining unit 520 is used for:

[0145] Traverse the computing clusters and identify idle computing units in each cluster whose task status is idle;

[0146] If the number of idle computing units in any computing cluster meets the first size parameter, the idle computing units in the computing cluster that meet the first size parameter are allocated to the first resource set.

[0147] If the number of remaining idle computing units in any computing cluster satisfies the second size parameter, the remaining idle computing units in any computing cluster that satisfy the second size parameter are allocated to the second resource set;

[0148] The remaining idle computing units are the idle computing units in any of the computing processing clusters that have not been assigned to the first resource set.

[0149] Based on the above embodiments, the determining unit 520 is used for:

[0150] A first mark is made on the idle computing unit that meets the first size parameter, and the first mark is used to indicate that the corresponding idle computing unit belongs to the first cluster;

[0151] The remaining idle computing units that meet the second size parameter are marked with a second mark, which indicates that the corresponding remaining idle computing units belong to the second cluster.

[0152] Based on the above embodiments, the determining unit 520 is used for:

[0153] In the idle computing unit that satisfies the first size parameter, the value of the register or memory location used to store the size parameter of the cluster to which it belongs is set as the first size parameter;

[0154] In the remaining free computing units that satisfy the second size parameter, the value of the register or memory location used to store the size parameter of the cluster to which it belongs is set as the second size parameter.

[0155] Based on the above embodiments, the scheduling unit 530 is used for:

[0156] The total number of idle computing units in the first resource set is counted to obtain the first available resource quantity;

[0157] The total number of remaining idle computing units in the second resource set is counted to obtain the second available resource quantity;

[0158] Task scheduling is performed based on the first available resource quantity and the second available resource quantity.

[0159] Based on the above embodiments, the scheduling unit 530 is further configured to:

[0160] If the task is completed by any idle computing unit or any remaining idle computing unit, task completion information is generated; the task completion information includes a first size parameter of the first cluster to which the idle computing unit belongs, or a second size parameter of the second cluster to which the remaining idle computing unit belongs.

[0161] Based on the task completion information, update the quantity of the first available resource or the quantity of the second available resource.

[0162] This invention also provides an artificial intelligence chip. Figure 6 This is a schematic diagram of the structure of the artificial intelligence chip provided by the present invention, as shown below. Figure 6 As shown, the chip includes a command processor 610, a queue manager 620, and multiple computing clusters 630, each computing cluster containing multiple computing units.

[0163] The queue manager is used to obtain a first size parameter and a second size parameter; based on the first size parameter and the second size parameter, and the idle computing units in each computing cluster whose task status is idle, a first resource set and a second resource set are determined; the size of the first cluster corresponding to the first size parameter is greater than the size of the second cluster corresponding to the second size parameter; the first resource set includes idle computing units that can form the first cluster, and the second resource set includes idle computing units that can form the second cluster;

[0164] The command processor is used to perform task scheduling based on the first resource set and the second resource set; during the task scheduling process, the task to be scheduled is preferentially assigned to the idle computing unit in the first resource set, and if there is insufficient idle computing unit in the first resource set, the task is assigned to the idle computing unit in the second resource set.

[0165] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communications bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other through the communications bus 740. The processor 710 can call logical instructions in the memory 730 to execute a task scheduling method. This method is applied to an artificial intelligence chip, which includes multiple computing clusters, each containing multiple computing units. The method includes: obtaining a first size parameter and a second size parameter, wherein the size of a first cluster corresponding to the first size parameter is larger than the size of a second cluster corresponding to the second size parameter; determining a first resource set and a second resource set based on the first size parameter and the second size parameter, and idle computing units in each computing cluster whose task status is idle; the first resource set includes idle computing units that can form the first cluster, and the second resource set includes idle computing units that can form the second cluster; performing task scheduling based on the first resource set and the second resource set; during the task scheduling process, tasks to be scheduled are preferentially assigned to idle computing units in the first resource set, and if there are insufficient idle computing units in the first resource set, the tasks are assigned to idle computing units in the second resource set.

[0166] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a 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 several 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 described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0167] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the computer is able to execute the task scheduling method provided by the above methods. This method is applied to an artificial intelligence chip, the artificial intelligence chip comprising multiple computing processing clusters, each computing processing cluster containing multiple computing units. The method comprises: obtaining a first size parameter and a second size parameter, wherein the size of a first cluster corresponding to the first size parameter is larger than the size of a second cluster corresponding to the second size parameter; determining a first resource set and a second resource set based on the first size parameter and the second size parameter, and idle computing units in each computing processing cluster whose task status is idle; the first resource set comprising idle computing units capable of forming the first cluster, and the second resource set comprising idle computing units capable of forming the second cluster; performing task scheduling based on the first resource set and the second resource set; during the task scheduling process, tasks to be scheduled are preferentially allocated to idle computing units in the first resource set, and if there are insufficient idle computing units in the first resource set, the tasks are allocated to idle computing units in the second resource set.

[0168] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the task scheduling method provided by the above methods. This method is applied to an artificial intelligence chip, which includes multiple computing processing clusters, each containing multiple computing units. The method includes: obtaining a first size parameter and a second size parameter, wherein the size of a first cluster corresponding to the first size parameter is larger than the size of a second cluster corresponding to the second size parameter; determining a first resource set and a second resource set based on the first size parameter and the second size parameter, and idle computing units in each computing processing cluster whose task status is idle; the first resource set includes idle computing units that can form the first cluster, and the second resource set includes idle computing units that can form the second cluster; performing task scheduling based on the first resource set and the second resource set; during the task scheduling process, tasks to be scheduled are preferentially allocated to idle computing units in the first resource set, and if there are insufficient idle computing units in the first resource set, the tasks are allocated to idle computing units in the second resource set.

[0169] The device embodiments described above are merely illustrative. The units described 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0170] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0171] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A task scheduling method, characterized in that, Applied to an artificial intelligence chip, the artificial intelligence chip comprising multiple computing clusters, each computing cluster containing multiple computing units, the method includes: Obtain a first size parameter and a second size parameter, wherein the size of the first cluster corresponding to the first size parameter is greater than the size of the second cluster corresponding to the second size parameter; Based on the first size parameter and the second size parameter, and the idle computing units in each computing cluster whose task status is idle, a first resource set and a second resource set are determined; the first resource set includes idle computing units that can form the first cluster, and the second resource set includes idle computing units that can form the second cluster. Task scheduling is performed based on the first resource set and the second resource set; during the task scheduling process, the tasks to be scheduled are preferentially assigned to the idle computing units in the first resource set, and if there are not enough idle computing units in the first resource set, the tasks are assigned to the idle computing units in the second resource set. The determination of the first resource set and the second resource set based on the first size parameter and the second size parameter, as well as the idle computing units in each computing cluster whose task status is idle, includes: Traverse the computing clusters and identify idle computing units in each cluster whose task status is idle; If the number of idle computing units in any computing cluster meets the first size parameter, the idle computing units in the computing cluster that meet the first size parameter are allocated to the first resource set. If the number of remaining idle computing units in any computing cluster satisfies the second size parameter, the remaining idle computing units in any computing cluster that satisfy the second size parameter are allocated to the second resource set; The remaining idle computing units are the idle computing units in any of the computing processing clusters that have not been assigned to the first resource set.

2. The task scheduling method according to claim 1, characterized in that, The step of allocating idle computing units in any of the computing processing clusters that satisfy the first size parameter to the first resource set includes: A first mark is made on the idle computing unit that meets the first size parameter, and the first mark is used to indicate that the corresponding idle computing unit belongs to the first cluster; The step of allocating the remaining idle computing units in any of the computing processing clusters that satisfy the second size parameter to the second resource set includes: The remaining idle computing units that meet the second size parameter are marked with a second mark, which indicates that the corresponding remaining idle computing units belong to the second cluster.

3. The task scheduling method according to claim 2, characterized in that, The step of marking the idle computing units that satisfy the first size parameter includes: In the idle computing unit that satisfies the first size parameter, the value of the register or memory location used to store the size parameter of the cluster to which it belongs is set as the first size parameter; The step of marking the remaining free calculation units that satisfy the second size parameter in a second manner includes: In the remaining free computing units that satisfy the second size parameter, the value of the register or memory location used to store the size parameter of the cluster to which it belongs is set as the second size parameter.

4. The task scheduling method according to any one of claims 1 to 3, characterized in that, The task scheduling based on the first resource set and the second resource set includes: The total number of idle computing units in the first resource set is counted to obtain the first available resource quantity; The total number of remaining idle computing units in the second resource set is counted to obtain the second available resource quantity; Task scheduling is performed based on the first available resource quantity and the second available resource quantity.

5. The task scheduling method according to claim 4, characterized in that, The process of scheduling tasks based on the first available resource quantity and the second available resource quantity further includes: If the task is completed by any idle computing unit or any remaining idle computing unit, task completion information is generated; the task completion information includes a first size parameter of the first cluster to which the idle computing unit belongs, or a second size parameter of the second cluster to which the remaining idle computing unit belongs. Based on the task completion information, update the quantity of the first available resource or the quantity of the second available resource.

6. A task scheduling device, characterized in that, Applied to artificial intelligence chips, the artificial intelligence chip includes multiple computing processing clusters, each computing processing cluster contains multiple computing units, the device includes: An acquisition unit is used to acquire a first size parameter and a second size parameter, wherein the size of the first cluster corresponding to the first size parameter is greater than the size of the second cluster corresponding to the second size parameter; The determining unit is configured to determine a first resource set and a second resource set based on the first size parameter and the second size parameter, as well as idle computing units in each computing processing cluster whose task status is idle; the first resource set includes idle computing units that can form the first cluster, and the second resource set includes idle computing units that can form the second cluster. The scheduling unit is used to perform task scheduling based on the first resource set and the second resource set; during the task scheduling process, the task to be scheduled is preferentially allocated to the idle computing unit in the first resource set, and if there is insufficient idle computing unit in the first resource set, the task is allocated to the idle computing unit in the second resource set. The determining unit is specifically used for: Traverse the computing clusters and identify idle computing units in each cluster whose task status is idle; If the number of idle computing units in any computing cluster meets the first size parameter, the idle computing units in the computing cluster that meet the first size parameter are allocated to the first resource set. If the number of remaining idle computing units in any computing cluster satisfies the second size parameter, the remaining idle computing units in any computing cluster that satisfy the second size parameter are allocated to the second resource set; The remaining idle computing units are the idle computing units in any of the computing processing clusters that have not been assigned to the first resource set.

7. An artificial intelligence chip, characterized in that, It includes a command processor, a queue manager, and multiple computing clusters, each containing multiple computing units; The queue manager is used to obtain a first size parameter and a second size parameter; based on the first size parameter and the second size parameter, and the idle computing units in each computing cluster whose task status is idle, a first resource set and a second resource set are determined; The size of the first cluster corresponding to the first size parameter is larger than the size of the second cluster corresponding to the second size parameter; the first resource set includes idle computing units that can form the first cluster, and the second resource set includes idle computing units that can form the second cluster. The command processor is used to perform task scheduling based on the first resource set and the second resource set; during the task scheduling process, the task to be scheduled is preferentially assigned to the idle computing unit in the first resource set, and if there is insufficient idle computing unit in the first resource set, the task is assigned to the idle computing unit in the second resource set. The queue manager is specifically used to traverse the computing clusters and determine the idle computing units in each computing cluster whose task status is idle; if the number of idle computing units in any computing cluster meets the first size parameter, the idle computing units in any computing cluster that meet the first size parameter are allocated to the first resource set. If the number of remaining idle computing units in any computing cluster satisfies the second size parameter, the remaining idle computing units in any computing cluster that satisfy the second size parameter are allocated to the second resource set; The remaining idle computing units are the idle computing units in any of the computing processing clusters that have not been assigned to the first resource set.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the task scheduling method as described in any one of claims 1 to 5.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the task scheduling method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Computing task optimization method and device, equipment, medium and program product

    CN119166287A

  • Resource allocation method and apparatus, and electronic device

    CN120295796A