Artificial intelligence chip and its operation method, storage medium and computer program product

By dynamically configuring processor clusters, the problem of AI chip fault tolerance and task scheduling efficiency when the processor core fails is solved, and higher processor core utilization and yield are achieved.

CN118502971BActive Publication Date: 2024-10-29北京壁仞科技开发有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410963345.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-10-29
Estimated Expiration
2044-07-18

AI Technical Summary

Technical Problem

Existing AI chips are difficult to achieve fault tolerance when the processor core fails, resulting in low chip yield. In addition, traditional schedulers have low utilization rates due to uneven occupation of processor cores during task scheduling.

Method used

Using the method of dynamically configuring processor clusters, the scheduling circuit establishes a processor cluster mapping table in real time based on the cluster configuration information set by the host, and dynamically schedules tasks to processor clusters to achieve flexible grouping and utilization optimization of processor cores.

Benefits of technology

It improves the AI ​​chip's fault tolerance when the processor core fails, improves processor core utilization and chip yield, reduces manufacturing costs, and optimizes task scheduling efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118502971B_ABST
    Figure CN118502971B_ABST
Patent Text Reader

Abstract

The present disclosure provides an artificial intelligence (AI) chip and an operation method thereof, a storage medium and a computer program product to dynamically configure a processor cluster. In an embodiment, the AI ​​chip includes a plurality of processor cores and a scheduler circuit. The scheduler circuit is coupled to the processor core. The scheduler circuit establishes a processor cluster mapping table in real time based on cluster configuration information dynamically set by a host, wherein the processor cluster mapping table is used to record a mapping relationship between a processor core and at least one processor cluster. The scheduler circuit schedules tasks to the processor cluster based on the processor cluster mapping table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of chip technology, and in particular to an artificial intelligence chip and an operating method thereof, a machine-readable storage medium, and a computer program product. Background Art

[0002] Artificial intelligence (AI) chips can provide huge computing power. The huge computing power of AI chips comes from a large number of internal hardware execution units (EUs, or execution cores). An AI chip usually contains multiple processor clusters, each of which usually contains multiple compute units (CUs, or compute units or processor cores), such as integer (INT) compute cores, floating point (FP) compute cores, tensor cores, and vector cores, and each compute core usually contains multiple execution cores. The programming model divides the multiple compute cores (processor cores) of the AI ​​chip into several processor clusters, and the programming model programs parallel AI chips at the granularity of processor clusters. By organizing various types of compute cores through programming, AI chips can support general computing, scientific computing, and neural network computing. In many computing task scenarios, different compute cores in the same processor cluster will jointly execute the same computing task, or different processor clusters will jointly execute the same computing task. How to improve the utilization efficiency of compute cores is one of the many technical topics in this field.

[0003] For example, a large number of processor cores (computing cores) have a greater probability of being affected by manufacturing defects and failing. How to introduce a fault-tolerant hardware mechanism for multi-core parallel AI chips is one of many technical issues. The fault-tolerant hardware mechanism shields defective processor cores and organizes the available processor cores into several processor clusters according to program requirements, so as to evenly schedule multiple parallel computing tasks to the processor clusters for execution. The fault-tolerant hardware mechanism allows AI chips to still work normally when they contain a certain number of failed processor cores, improving the yield of the chip and reducing manufacturing costs.

[0004] For another example, in general, a fixed processor cluster division method is adopted, that is, starting from the processor core with the smallest number, M consecutive available processor cores (computing cores) form a processor cluster of size M (called an M processor cluster). Multiple processor cores can be divided into processor clusters of different sizes. The division method of processor clusters remains fixed. Traditional schedulers randomly schedule tasks to processor clusters for execution. When scheduling computing tasks of different sizes, tasks with a smaller number of processor cores have the opportunity to occupy processor core resources in a larger processor cluster, thereby blocking the distribution of computing tasks and reducing the utilization of processor cores. For example, a traditional scheduler may schedule a small task to a small processor cluster (for example, a processor cluster containing only one processor core is called a 1 processor cluster), but the processor core belonging to this small processor cluster also belongs to another large processor cluster (for example, a processor cluster containing eight processor cores is called an 8 processor cluster). Since one processor core in this 8 processor cluster is occupied, even if the remaining seven processor cores in the cluster are idle, the large task cannot be scheduled to this large processor cluster for execution, resulting in low utilization of processor cores. How to reduce idle processor cores is one of many technical issues. Summary of the invention

[0005] The present disclosure is directed to an artificial intelligence (AI) chip and an operating method thereof, a machine-readable storage medium, and a computer program product for dynamically configuring a processor cluster.

[0006] In an embodiment according to the present disclosure, the artificial intelligence chip includes multiple processor cores and a scheduler circuit. The scheduler circuit is coupled to the processor core. The scheduler circuit establishes a processor cluster mapping table in real time based on cluster configuration information dynamically set by the host, wherein the processor cluster mapping table is used to record a mapping relationship between the processor core and at least one processor cluster. The scheduler circuit schedules tasks to the processor cluster based on the processor cluster mapping table.

[0007] In an embodiment of the present disclosure, the operating method includes: the scheduling circuit establishes a processor cluster mapping table in real time based on cluster configuration information dynamically set by the host, wherein the processor cluster mapping table is used to record the mapping relationship between the processor core and at least one processor cluster; and the scheduling circuit schedules tasks to the processor cluster based on the processor cluster mapping table.

[0008] In an embodiment of the present disclosure, the machine-readable storage medium is used to store non-transitory machine-readable instructions. When the non-transitory machine-readable instructions are executed by a processor, the operating method of the artificial intelligence chip can be implemented.

[0009] In an embodiment of the present disclosure, the computer program product includes a computer program. When the computer program is executed by a processor, the operation method of the artificial intelligence chip can be implemented.

[0010] Based on the above, the host can dynamically set cluster configuration information to the scheduling circuit. The scheduling circuit establishes a processor cluster mapping table (mapping relationship between processor cores and processor clusters) based on the cluster configuration information to dynamically configure the processor cluster. The scheduling circuit can schedule tasks to the processor cluster for execution in real time based on the processor cluster mapping table. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 Detailed description of the invention is provided in detail.

[0012] Figure 2 It is a flowchart of an operating method of an AI chip according to an embodiment of the present disclosure.

[0013] Figure 3 is a circuit block diagram of a scheduling circuit according to an embodiment of the present disclosure.

[0014] Figure 4 It is a flowchart of another AI chip operation method according to an embodiment of the present disclosure.

[0015] Description of Reference Numerals

[0016] 10: Host

[0017] 100: Artificial Intelligence (AI) Chip

[0018] 110: Scheduling Circuit

[0019] 111: Usable controller

[0020] 112: Processor core mapping table

[0021] 113: Cluster Controller

[0022] 114: Processor cluster mapping table

[0023] 115: Task Scheduler

[0024] 120: Processor core

[0025] 130: Interface circuit

[0026] Cluster_8_Mask, Cluster_4_Mask, Cluster_2_Mask, Cluster_1_Mask: Cluster registers

[0027] Harvest_Mask: Useful mask register

[0028] S210~S220, S410~S470: Steps

[0029] Task_req: Task DETAILED DESCRIPTION

[0030] Reference will now be made in detail to exemplary embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.

[0031] The term "coupled (or connected)" used in the entire specification of this case (including the claims) may refer to any direct or indirect means of connection. For example, if the text describes a first device coupled (or connected) to a second device, it should be interpreted that the first device can be directly connected to the second device, or the first device can be indirectly connected to the second device through other devices or some means of connection. The terms "first", "second", etc. mentioned in the entire specification of this case (including the claims) are used to name the components (element) or to distinguish different embodiments or ranges, and are not used to limit the upper or lower limit of the number of components, nor to limit the order of components. In addition, wherever possible, components / components / steps with the same number in the drawings and embodiments represent the same or similar parts. Components / components / steps with the same number or the same terminology in different embodiments can refer to the relevant descriptions of each other.

[0032] Figure 1 FIG. 1 is a schematic diagram of a circuit block of an artificial intelligence (AI) chip 100 according to an embodiment of the present disclosure. Figure 1 The AI ​​chip 100 shown may be a graphics processing unit (GPU), a general-purpose graphics processing unit (GPGPU) or other computing chips. The AI ​​chip 100 can provide huge computing power to the host 10. Figure 1In the illustrated embodiment, the AI ​​chip 100 includes a scheduler circuit 110, a plurality of processor cores 120, and an interface circuit 130. The host 10 can control the scheduler circuit 110 and the processor core 120 through the interface circuit 130. The scheduler circuit 110 is coupled to the plurality of processor cores 120. The scheduler circuit 110 is a command processor. The scheduler circuit 110 selectively transmits tasks to one or more of the processor cores 120.

[0033] Based on different applications, the processor core can be a compute unit (CU, or compute core). For example, the processor core 120 may include at least one of an integer (INT) compute core, a floating point (FP) compute core, a tensor core, and a vector core. Based on actual design, each processor core 120 usually includes multiple execution units (EU, or execution core, not shown in the figure). Figure 1 ). The programming model can divide the multiple processor cores 120 of the AI ​​chip into several processor clusters of different sizes. The processor cluster can be a stream processor cluster (SPC) or other programmable multi-computing core group. The programming model programs the AI ​​chip 100 at the granularity of the processor cluster, so the scheduling circuit 110 can schedule computing tasks to the processor cluster for execution. In many computing task scenarios, different processor cores in the same processor cluster will jointly execute the same computing task, or different processor clusters will jointly execute the same computing task. By organizing various types of processor cores 120 through programming, the AI ​​chip 100 can support general computing, scientific computing, and neural network computing.

[0034] The above-mentioned scheduling circuit 110 and processor core 120 can be implemented as logic circuits on an integrated circuit. For example, the related functions of the scheduling circuit 110 and the processor core 120 can be implemented in various logic blocks, modules and circuits in one or more hardware controllers, microcontrollers, hardware processors, microprocessors, application-specific integrated circuits (ASICs), digital signal processors (DSPs), field programmable gate arrays (FPGAs), central processing units (CPUs) and / or other processing units. The related functions of the scheduling circuit 110 and the processor core 120 can be implemented as hardware circuits using hardware description languages ​​(such as Verilog HDL or VHDL) or other suitable programming languages, such as various logic blocks, modules and circuits in an integrated circuit.

[0035] Figure 2 is a flowchart of an operation method of an AI chip according to an embodiment of the present disclosure. In some embodiments, each step in the flowchart or a combination of steps in the flowchart can be implemented by various means, such as hardware, one or more computer-readable media storing a computer program, or a computer program product. In some embodiments, Figure 2 The operation method shown can be implemented in hardware, for example, Figure 1 The AI ​​chip 100 is shown.

[0036] In other embodiments, Figure 2 or Figure 4 The operation method shown can be implemented in firmware or software. In the form of firmware or software, Figure 2 or Figure 4 The functions of the operation method shown can be implemented as programming codes. For example, general programming languages ​​(such as C, C++ or assembly language) or other suitable programming languages ​​can be used to implement Figure 2 or Figure 4The operating method shown. The programming code can be recorded / stored in a "non-transitory machine-readable storage medium". In some embodiments, the non-transitory machine-readable storage medium includes, for example, a semiconductor memory and / or a storage device. The semiconductor memory includes a memory card, a read-only memory (ROM), a flash memory (FLASH memory), a programmable logic circuit or other semiconductor memory. The storage device includes a hard disk drive (HDD), a solid-state drive (SSD) or other storage device. An electronic device (such as a computer, a CPU, a hardware controller, a microcontroller, a hardware processor or a microprocessor) can read and execute the programming code from the non-transitory machine-readable storage medium, thereby achieving Figure 2 or Figure 4 Alternatively, the programming code may be provided to the electronic device via any transmission medium (e.g., a communication network or broadcast waves, etc.). The communication network may be, for example, the Internet, a wired communication network, a wireless communication network, or other communication medium.

[0037] For example, Figure 2 or Figure 4 The related operations of the operation method shown can be implemented as non-transitory machine-readable instructions (code or program), and the non-transitory machine-readable instructions can be stored in a "non-transitory machine-readable storage medium". When the non-transitory machine-readable instructions are executed by a processor in a computing device, the Figure 2 or Figure 4 In some other embodiments, Figure 2 or Figure 4 One or more steps in the operation method shown may be embodied by a computer program of a computer program product. The computer program product may be stored in one or more memory devices in a computing device and executed by a processor in the computing device. When the computer program is executed by the processor, Figure 2 or Figure 4 Shown how to operate.

[0038] Please refer to Figure 1 and Figure 2In step S210, the host 10 may dynamically set cluster configuration information to the scheduling circuit 110, wherein the cluster configuration information is used to indicate the configuration relationship between the plurality of processor cores 120 and at least one processor cluster. The host 10 may dynamically write the cluster configuration information into the cluster register of the scheduling circuit 110. For example (but not limited to this), the host 10 may dynamically write the cluster configuration information into the cluster registers Cluster_8_Mask, Cluster_4_Mask, Cluster_2_Mask, and Cluster_1_Mask (not shown) of the scheduling circuit 110. Figure 1 , which will be described in detail later). The cluster register Cluster_8_Mask is used to record the configuration relationship between the multiple processor cores 120 and the 8-processor cluster (a processor cluster including 8 processor cores), the cluster register Cluster_4_Mask is used to record the configuration relationship between the multiple processor cores 120 and the 4-processor cluster (a processor cluster including 4 processor cores), the cluster register Cluster_2_Mask is used to record the configuration relationship between the multiple processor cores 120 and the 2-processor cluster (a processor cluster including 2 processor cores), and the cluster register Cluster_1_Mask is used to record the configuration relationship between the multiple processor cores 120 and the 1-processor cluster (a processor cluster including only 1 processor core).

[0039] For example (but not limited to this), the following Table 1 or Table 2 can be used as one of the many implementation examples of the cluster configuration information. The cluster configuration information includes a logical number field and a cluster field to record the mapping relationship between the logical number of the processor core 120 and the n processor cluster (a processor cluster including n processor cores, where n is an integer). For example (but not limited to this), the following Table 1 or Table 2 includes a logical number field, an 8 processor cluster field, a 4 processor cluster field, a 2 processor cluster field and a 1 processor cluster field, wherein the content of the 8 processor cluster field is placed in the cluster register Cluster_8_Mask, the content of the 4 processor cluster field is placed in the cluster register Cluster_4_Mask, the content of the 2 processor cluster field is placed in the cluster register Cluster_2_Mask, and the content of the 1 processor cluster field is placed in the cluster register Cluster_1_Mask. It should be noted that the content of the following Table 1 or Table 2 is only a reference example. The specific content of the cluster configuration information can be dynamically determined according to actual applications and operations.

[0040] Table 1: Example of cluster configuration information (1 processor cluster adopts mutual exclusion strategy)

[0041]

[0042] In the example shown in Table 1, 1 processor cluster adopts a mutual exclusion strategy. Mutual exclusion means that a processor core can only participate in the composition of one processor cluster. For example, the processor cores with logical numbers 8 and 17 can only form 1 processor cluster (1-ProcessorCluster). Based on the dynamic setting of the host 10, the corresponding cluster register Cluster_8_Mask = 03FD_FEFF (hexadecimal number), cluster register Cluster_4_Mask = 03FD_FEFF (hexadecimal number), cluster register Cluster_2_Mask = 03FD_FEFF (hexadecimal number), and cluster register Cluster_1_Mask (Exclusive) = 0002_0100 (hexadecimal number). The mutual exclusion strategy does not allow a small processor cluster to occupy the processor cores in a large processor cluster, so the computing performance of the large processor cluster can be fully utilized.

[0043] Table 2: Example of cluster configuration information (1 processor cluster uses overlapping strategy)

[0044]

[0045] In the example shown in Table 2, 1 processor cluster adopts an overlapping strategy. The overlapping strategy allows a small processor cluster to occupy part of the processor cores in a large processor cluster. Overlapping means that a processor core can participate in the composition of multiple processor clusters. For example, processor cores with logical numbers 9 to 16 can form an 8-processor cluster, a 4-processor cluster, a 2-processor cluster, and a 1-processor cluster. Based on the dynamic setting of the host 10, the corresponding cluster register Cluster_8_Mask = 03FD_FEFF (hexadecimal number), cluster register Cluster_4_Mask = 03FD_FEFF (hexadecimal number), cluster register Cluster_2_Mask = 03FD_FEFF (hexadecimal number), and cluster register Cluster_1_Mask(Overlapping) = 0003_FF00 (hexadecimal number).

[0046] In step S210, the scheduling circuit 110 establishes a processor cluster mapping table in real time based on the cluster configuration information dynamically set by the host 10, wherein the processor cluster mapping table is used to record the mapping relationship between the multiple processor cores 120 and at least one processor cluster. For example (but not limited to this), the following Table 3 or Table 4 can be used as one of the many implementation examples of the processor cluster mapping table. The processor cluster mapping table includes a logical number field and an n processor cluster field. The logical number field is used to record the logical number of the processor core 120. The n processor cluster field is used to record the number of the n processor cluster (n is an integer). For example (but not limited to this), the following Table 3 or Table 4 includes a logical number field, an 8 processor cluster field, a 4 processor cluster field, a 2 processor cluster field and a 1 processor cluster field. It should be noted that the content of the following Table 3 or Table 4 is only a reference example. The specific content of the processor cluster mapping table can be determined in real time according to actual applications and operations. Starting from the logical number 0, every N valid logical processor cores in the register Cluster_N_Mask form a processor cluster of size N. In the examples of Table 3 or Table 4, the processor cores with logical numbers 0 to 7, 9 to 16, and 18 to 25 form three 8-processor clusters (the 8-processor clusters are numbered 0 to 2), the processor cores with logical numbers 0 to 3, 4 to 7, 9 to 12, 13 to 16, 18 to 21, and 22 to 25 form six 4-processor clusters (the 4-processor clusters are numbered 0 to 5), and the processor cores with logical numbers 0 to 1, 2 to 3, 4 to 5, 6 to 7, 9 to 10, 11 to 12, 13 to 14, 15 to 16, 18 to 19, 20 to 21, 22 to 23, and 24 to 25 form 12 2-processor clusters (the 2-processor clusters are numbered 0 to 11). When the mutual exclusion strategy is adopted (as shown in Table 3), the processor cores with logical numbers 8 and 17 form two 1-processor clusters (the 1-processor clusters are numbered 0 to 1). When the overlapping strategy is adopted (as shown in Table 4), the processor cores with logical numbers 8 to 17 form 10 1-processor clusters (the 1-processor clusters are numbered 0 to 9).

[0047] Table 3: Configuration example of processor cluster mapping table (1 processor cluster adopts mutual exclusion strategy)

[0048]

[0049] Table 4: Configuration example of processor cluster mapping table (1 processor cluster uses overlapping strategy)

[0050]

[0051] In step S220, the scheduling circuit 110 schedules the task to the at least one processor cluster based on the processor cluster mapping table. For example (but not limited to this), the scheduling circuit 110 selects a target processor cluster from multiple processor clusters for the current task based on the processor cluster mapping table. In some embodiments, the scheduling circuit 110 selects the target processor cluster based on the required number of processor cores for the current task (the upper limit of the number of processor cores occupied by the computing task is specified by the program) so that the number of processor cores of the target processor cluster meets the order of magnitude of processor cores to which the required number of processor cores belongs. For example, assuming that the required number of processor cores for the current task is 4, the scheduling circuit 110 selects 4 processor clusters as the target processor cluster (because the number of processor cores 4 of the target processor cluster meets the order of magnitude of processor cores "4 processor clusters").

[0052] The scheduling circuit 110 finds the logical number of the corresponding processor core of the target processor cluster from the processor cluster mapping table, and the scheduling circuit 110 uses the processor core mapping table to convert the logical number of the corresponding processor core into a physical number, and the scheduling circuit 110 assigns the current task to the corresponding processor core according to the physical number of the corresponding processor core. In some embodiments, the processor core mapping table can be pre-set in the scheduling circuit 110. In some embodiments, the scheduling circuit 110 can schedule the circuit 110 to establish a processor core mapping table based on the available (harvest) processor information. The available processor information can be pre-written into the available mask register Harvest_Mask (not shown) of the scheduling circuit 110. Figure 1 , which will be described in detail later). According to the actual design, the available mask register may include an electronic fuse (efuse), a flash memory (FLASH) or other information recording components.

[0053] For example (but not limited to this), the following Table 5 can be used as one of the many implementation examples of the available processor information. It should be noted that the content of the following Table 5 is only a reference example. The specific content of the available processor information can be determined in real time according to actual applications and operations. The available processor information includes a physical number field and a harvest mask field, wherein the physical number field is used to record the physical numbers of the multiple processor cores 120, and the harvest mask field is used to record the availability of the multiple processor cores 120. For example, the harvest mask "1" of the physical number "0" indicates that the processor core of the physical number 0 is available and good. The harvest mask "0" of the physical number "1" indicates that the processor core of the physical number 1 is failed and damaged. The available processor information allows that some processor cores of the chip are damaged, and the damaged processor cores will be masked, and the remaining processor cores of the chip work normally. In the example shown in Table 5, the processor cores of physical numbers 1, 5, 11, 21, 28 and 29 are failed (damaged) processor cores. In the example shown in Table 5, the usable mask register Harvest_Mask = CFDF_F7DD (hexadecimal number).

[0054] Table 5: Example of content of available processor information

[0055]

[0056] The processor core mapping table is used to record the mapping relationship between the physical number and the logical number of the available processor cores indicated by the available processor information in the multiple processor cores 120. For example (but not limited to this), the following Table 6 can be used as one of the many implementation examples of the processor core mapping table. It should be noted that the content of the following Table 6 is only a reference example. The specific content of the processor core mapping table can be determined in real time according to actual applications and operations. The processor core mapping table includes a valid bit field, a physical number field and a logical number field. The physical number field and the logical number field are used to record the physical number and the logical number of the available processor core. The valid bit field is used to record the validity of each entry in the processor core mapping table. The content of the processor core mapping table excludes the physical number of the failed processor core indicated by the available processor information in the multiple processor cores 120. Following the example content shown in Table 5, the example of the processor core mapping table shown in Table 6 excludes the failed processor cores with physical numbers 1, 5, 11, 21, 28 and 29. The scheduling circuit 110 converts the logical number of the corresponding processor core into a physical number using the processor core mapping table, and the scheduling circuit 110 assigns the current task to the corresponding processor core according to the physical number of the corresponding processor core.

[0057] Table 6: Example of the contents of the processor core mapping table

[0058]

[0059] Based on the above, the on-chip processor cores form a processor core pool (Partition), and the scheduling circuit 110 performs harvest processing based on the processor core granularity. Therefore, the damaged processor core will be shielded, and the processor cluster (Cluster) is composed of functional processor cores. The host 10 can dynamically set cluster configuration information to the scheduling circuit 110. The scheduling circuit 110 establishes a processor cluster mapping table (the mapping relationship between the processor core 120 and the processor cluster) based on the cluster configuration information to dynamically configure the processor cluster. Therefore, the processor cluster mapping table (the composition method of the processor cluster) can be flexibly configured by software. In addition, a processor core mapping table of available processor cores is established with the processor core physical number as an index. The processor cores in the processor core pool are grouped with the processor core logical number as an index to establish a processor cluster mapping table (Cluster Mapping Table). The scheduling circuit 110 can schedule tasks to the processor cluster for execution in real time based on the processor core mapping table and the processor cluster mapping table.

[0060] Figure 3 is a circuit block diagram of a scheduling circuit 110 according to an embodiment of the present disclosure. Figure 3 The scheduling circuit 110 shown can be used as Figure 1 The scheduling circuit 110 is one of many implementation examples. Figure 3 In the illustrated embodiment, the scheduling circuit 110 includes an availability controller 111 , a processor core mapping table 112 , a cluster controller 113 , a processor cluster mapping table 114 , and a task dispatcher 115 .

[0061] Figure 4 is a flowchart of an operating method of an AI chip according to another embodiment of the present disclosure. In some embodiments, each step in the flowchart or a combination of steps in the flowchart can be implemented by various means, such as hardware, one or more computer-readable media storing a computer program, or a computer program product. In some embodiments, Figure 4 The operation method shown can be implemented in hardware, for example, Figure 1 The AI ​​chip 100 is shown. Please refer to Figure 3 and Figure 4, step S410 configures the usable mask register Harvest_Mask. Generally speaking, the chip can detect which of the multiple processor cores 120 are usable and good, and which are failed and damaged processor cores during the packaging and testing phase. Therefore, the content of the usable mask register Harvest_Mask (usable processor information, such as the above Table 5) can be set during the chip packaging and testing phase. In step S420, the usable controller 111 establishes a processor core mapping table 112 based on the content of the usable mask register Harvest_Mask (usable processor information). The processor core mapping table 112 is used to record the mapping relationship between the physical number and the logical number of the usable processor core indicated by the usable processor information in the multiple processor cores 120 (such as the above Table 6).

[0062] Figure 4 Steps S430 and S440 shown can be used as Figure 2 One of the many implementation examples of step S210 shown. In step S430, the host 10 can dynamically set the cluster configuration information to the cluster register (Cluster register) of the scheduling circuit 110. For example (but not limited to this), the host 10 can dynamically write the cluster configuration information into the cluster registers Cluster_8_Mask, Cluster_4_Mask, Cluster_2_Mask and Cluster_1_Mask (such as the above Table 1 or Table 2) of the scheduling circuit 110. According to the usage scenario, the cluster configuration information of the cluster registers Cluster_8_Mask, Cluster_4_Mask, Cluster_2_Mask and Cluster_1_Mask can be flexibly configured by software as required to give full play to the performance of the multi-core processor core. In step S440, the cluster controller 113 creates a processor cluster mapping table 114 (e.g., Table 3 or Table 4 above) in real time based on the cluster configuration information (the contents of cluster registers Cluster_8_Mask, Cluster_4_Mask, Cluster_2_Mask, and Cluster_1_Mask) dynamically set by the host 10 and the processor core mapping table 112. Starting from logical number 0, every N valid logical processor cores form a processor cluster of size N. In the example shown in Table 4, logical numbers 0-7, 9-16, 18-25 form three 8-processor clusters, and logical numbers 8-17 form ten 1-processor clusters.

[0063] Figure 4 Steps S450, S460 and S470 shown may be used as Figure 2 One of many implementation examples of step S220 is shown. Figure 4In the illustrated embodiment, the scheduling circuit 110 identifies the independent processor cluster in the processor cluster based on the cluster configuration information (the contents of the cluster registers Cluster_8_Mask, Cluster_4_Mask, Cluster_2_Mask and Cluster_1_Mask), and the scheduling circuit 110 can preferentially schedule tasks to the independent processor cluster for execution. The independent processor cluster means that this processor cluster is completely composed of one or more independent processor cores, wherein the independent processor core means a processor core dedicated to this independent processor cluster.

[0064] In detail, in step S450, the task scheduler 115 identifies the independent processor cluster in the processor cluster based on the cluster configuration information (the contents of the cluster registers Cluster_8_Mask, Cluster_4_Mask, Cluster_2_Mask and Cluster_1_Mask). For example (but not limited to this), the task scheduler 115 calculates the following equation 1 to obtain the independent m processor cluster relative to the n processor cluster. Wherein, Independent_Cluster_m_Mask represents the independent processor cluster mask, Cluster_m_Mask represents the cluster configuration information of the m processor cluster (a processor cluster including m processor cores, m is an integer), ⊕ represents the XOR operator, the Cluster_n_Mask represents the cluster configuration information of the n processor cluster (a processor cluster including n processor cores, n is an integer), and & represents the AND operator.

[0065] Individual_Cluster_m_Mask = (Cluster_m_Mask ⊕ Cluster_n_Mask) &Cluster_m_Mask (Equation 1).

[0066] For example, the task scheduler 115 can calculate Indiviual_Cluster_1_Mask = (Cluster_1_Mask ⊕ Cluster_8_Mask) & Cluster_1_Mask to obtain the independent 1 processor cluster relative to the 8 processor cluster. Assuming that the cluster register Cluster_8_Mask = 03FD_FEFF (hexadecimal number) and the cluster register Cluster_1_Mask(Exclusive) = 0003_FF00 (hexadecimal number), the independent processor cluster mask Indiviual_Cluster_1_Mask is 0002_0100 (hexadecimal number). That is, relative to the 8 processor cluster, the processor cores with logical numbers 8 and 17 are independent 1 processor clusters (because the mask bits corresponding to these two processor cores in the independent processor cluster mask Indiviual_Cluster_1_Mask are "1").

[0067] In step S460, the task scheduler 115 may schedule the task Task_req to the processor cluster. The task scheduler 115 may preferentially schedule the task Task_req to the independent processor cluster that matches the task for execution. For example, it is assumed that the software adopts an overlapping strategy to configure a 1-processor cluster and an 8-processor cluster, such as the configuration example of the cluster configuration information shown in Table 2 and the processor cluster mapping table shown in Table 4. It is further assumed that there are 4 computing tasks Task0, Task1, Task2 and Task3 to be scheduled, wherein the task Task0 needs to occupy 1 1-processor cluster, and the tasks Task1, Task2 and Task3 need to occupy 3 8-processor clusters. The task scheduler 115 preferentially schedules the task Task0 to the independent 1-processor cluster (the 1-processor cluster number 0 or 9 shown in Table 4) for execution, that is, the processor core with the logical number 8 or 17. At this time, the 8-processor cluster numbers 0, 1 and 2 are not occupied, so the task scheduler 115 can schedule the tasks Task1, Task2 and Task3 to these 8-processor clusters for execution. Next, when all independent 1-processor clusters are occupied, subsequent 1-processor cluster tasks will be randomly scheduled by the task scheduler 115 to non-independent 1-processor clusters numbered 1 to 8. If there are new tasks to be scheduled, the software can reconfigure the cluster configuration information (the contents of cluster registers Cluster_8_Mask, Cluster_4_Mask, Cluster_2_Mask, and Cluster_1_Mask) to meet the task requirements and give full play to the performance of the multi-core processor core.

[0068] In step S470, the task scheduler 115 may route the task Task_req to the corresponding processor core. By querying the processor core mapping table 112, the task scheduler 115 may map the logical number of the corresponding processor core to the physical number, and then route the computing task Task_req to the corresponding processor core (schedule and transmit the task Task_req to the target processor cluster), so that the corresponding processor core executes the task Task_req.

[0069] The grouping method of the processor cores can be flexibly configured by software without affecting the programming model. The grouping method of the processor cores is described according to the logical number of the processor cores, and the number of configuration registers required is small, which saves resources. The computing task Task_req is preferentially scheduled to the matching independent processor cluster for execution, reducing processor cluster bubbles and increasing the utilization rate of the processor cores. The upper limit of the number of processor clusters occupied by the computing task Task_req is specified by the cluster register to avoid a certain task occupying too many processor core resources and achieve the best parallel capability. For example, a computing task occupying a single processor core is limited to be assigned to 1 processor cluster (1-Processor Cluster), and cannot be assigned to other types of processor clusters (such as 8 processor clusters). The computing task occupying two processor cores is limited to be assigned to 2 processor clusters (2-Processor Cluster), and cannot be assigned to other types of processor clusters (such as 8 processor clusters). The above embodiment can realize the coordinated scheduling of software and hardware. For different tasks, the user can optimize the task scheduling by reconfiguring the cluster configuration information (such as the content of the cluster registers Cluster_8_Mask, Cluster_4_Mask, Cluster_2_Mask and Cluster_1_Mask) to give full play to the performance of the multi-core processor core.

[0070] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present disclosure.

Claims

1. An artificial intelligence chip, characterized in that: The artificial intelligence chip includes: multiple processor cores; and A scheduling circuit coupled to the plurality of processor cores, wherein the scheduling circuit establishes a processor cluster mapping table in real time based on cluster configuration information dynamically set by a host, the processor cluster mapping table being used to record a mapping relationship between the plurality of processor cores and at least one processor cluster, and the scheduling circuit schedules tasks to the at least one processor cluster based on the processor cluster mapping table; The scheduling circuit establishes a processor core mapping table based on the available processor information, wherein the processor core mapping table is used to record a mapping relationship between a physical number and a logical number of the available processor cores indicated by the available processor information among the multiple processor cores; The available processor information includes a first physical number field and an available mask field, wherein the first physical number field is used to record the physical numbers of the multiple processor cores, and the available mask field is used to record the availability of the multiple processor cores to determine whether the multiple processor cores are the available processor cores or the failed processor cores; Wherein, the scheduling circuit selects a target processor cluster for the current task from multiple processor clusters based on the processor cluster mapping table, the scheduling circuit finds out the logical number of at least one corresponding processor core of the target processor cluster from the processor cluster mapping table, the scheduling circuit uses the processor core mapping table to convert the logical number of the at least one corresponding processor core into a physical number, and the scheduling circuit assigns the current task to the at least one corresponding processor core according to the physical number of the at least one corresponding processor core.

2. The artificial intelligence chip according to claim 1, characterized in that: The processor core mapping table includes a valid bit field, a second physical number field and a first logical number field. The second physical number field and the first logical number field are used to record the physical number and logical number of the available processor core, and the valid bit field is used to record the validity of each entry in the processor core mapping table.

3. The artificial intelligence chip according to claim 1, characterized in that: The content of the processor core mapping table excludes the physical number of the failed processor core indicated by the available processor information among the multiple processor cores.

4. The artificial intelligence chip according to claim 1, characterized in that: The cluster configuration information includes a second logic number field and a cluster field to record the mapping relationship between the logic numbers of the multiple processor cores and n processor clusters, wherein the n processor clusters means that a processor cluster includes n processor cores, and n is an integer.

5. The artificial intelligence chip according to claim 1, characterized in that: The processor cluster mapping table includes a second logical number field and an n processor cluster field, wherein the second logical number field is used to record the logical numbers of the multiple processor cores, and the n processor cluster field is used to record the numbers of n processor clusters, wherein the n processor clusters means that a processor cluster includes n processor cores, and n is an integer.

6. The artificial intelligence chip according to claim 1, characterized in that: The scheduling circuit selects the target processor cluster based on the required number of processor cores of the current task, so that the number of processor cores of the target processor cluster meets the order of magnitude of processor cores to which the required number of processor cores belongs.

7. The artificial intelligence chip according to claim 1, characterized in that: The scheduling circuit identifies an independent processor cluster in the at least one processor cluster based on the cluster configuration information, wherein the independent processor cluster means that the independent processor cluster is completely composed of independent processor cores, the independent processor core means a processor core dedicated to the independent processor cluster, and the scheduling circuit preferentially schedules the task to the independent processor cluster for execution.

8. The artificial intelligence chip according to claim 7, characterized in that: The scheduling circuit calculates Indiviual_Cluster_m_Mask=(Cluster_m_Mask⊕Cluster_n_Mask)&Cluster_m_Mask to obtain the independent m processor cluster relative to the n processor cluster, wherein the Indiviual_Cluster_m_Mask represents the independent processor cluster mask, the Cluster_m_Mask represents the cluster configuration information of the m processor cluster, the m processor cluster means a processor cluster containing m processor cores, m is an integer, the ⊕ represents an exclusive-OR operator, the Cluster_n_Mask represents the cluster configuration information of the n processor cluster, the n processor cluster means a processor cluster containing n processor cores, n is an integer, and the & represents an AND operator.

9. The artificial intelligence chip according to claim 1, characterized in that: The scheduling circuit comprises: a cluster controller configured to establish the processor cluster mapping table in real time based on the cluster configuration information dynamically set by the host; and A task scheduler, wherein the task scheduler selects a target processor cluster for the current task from a plurality of processor clusters defined by the processor cluster mapping table, the task scheduler finds out the logical number of at least one corresponding processor core of the target processor cluster from the processor cluster mapping table, the task scheduler uses the processor core mapping table to convert the logical number of the at least one corresponding processor core into the physical number, and the task scheduler assigns the current task to the at least one corresponding processor core according to the physical number of the at least one corresponding processor core.

10. The artificial intelligence chip according to claim 9, characterized in that: The scheduling circuit also includes: An available controller, wherein the available controller establishes the processor core mapping table based on the available processor information, and the processor core mapping table is used to record the mapping relationship between the physical number and the logical number of the available processor cores indicated by the available processor information among the multiple processor cores.

11. A method for operating an artificial intelligence chip, characterized in that: The artificial intelligence chip includes multiple processor cores and a scheduling circuit, and the operation method includes: The scheduling circuit establishes a processor cluster mapping table in real time based on cluster configuration information dynamically set by the host, wherein the processor cluster mapping table is used to record a mapping relationship between the plurality of processor cores and at least one processor cluster; The scheduling circuit schedules tasks to the at least one processor cluster based on the processor cluster mapping table; The scheduling circuit establishes a processor core mapping table based on the available processor information, wherein the processor core mapping table is used to record a mapping relationship between physical numbers and logical numbers of the available processor cores indicated by the available processor information among the multiple processor cores; The available processor information includes a first physical number field and an available mask field, wherein the first physical number field is used to record the physical numbers of the multiple processor cores, and the available mask field is used to record the availability of the multiple processor cores to determine whether the multiple processor cores are the available processor cores or the failed processor cores; Wherein, the scheduling circuit selects a target processor cluster for the current task from a plurality of processor clusters based on the processor cluster mapping table, the scheduling circuit finds out the logical number of at least one corresponding processor core of the target processor cluster from the processor cluster mapping table, the scheduling circuit uses the processor core mapping table to convert the logical number of the at least one corresponding processor core into a physical number, and the scheduling circuit assigns the current task to the at least one corresponding processor core according to the physical number of the at least one corresponding processor core.

12. The operating method according to claim 11, characterized in that: The operation method also includes: The scheduling circuit identifies an independent processor cluster in the at least one processor cluster based on the cluster configuration information, wherein the independent processor cluster means that the independent processor cluster is completely composed of independent processor cores. The independent processor core refers to a processor core dedicated to the independent processor cluster, and the scheduling circuit preferentially schedules the task to the independent processor cluster for execution.

13. A machine-readable storage medium for storing non-transitory machine-readable instructions, characterized in that: When the non-temporary machine-readable instructions are executed by a processor, the operating method of the artificial intelligence chip described in any one of claims 11 or 12 can be implemented.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the operating method of the artificial intelligence chip described in any one of claims 11 or 12 is implemented.

Citation Information

Patent Citations

  • Task scheduling method, task scheduling device and multi-core system

    CN104820618A

  • Processor cluster power saving method and device, chip, equipment and storage medium

    CN112114651A