Computing unit detection method, parallel processor and electronic device

By adding a detection unit to the parallel processor and comparing the output results of the computing units to detect abnormalities and repair them, the problem in the existing technology of being unable to timely detect and correct physical damage to the computing unit is solved, and the operational reliability of the processor is improved.

CN111858196BActive Publication Date: 2024-09-03HYGON INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010540012.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-12
Publication Date
2024-09-03
Estimated Expiration
2040-06-12

AI Technical Summary

Technical Problem

The existing technology cannot detect the physical damage of the computing unit in the parallel processor during the running of the software, resulting in operation errors that are difficult to correct in time.

Method used

Add a detection unit to the parallel processor, input the thread data corresponding to the same instruction into the detected computing unit and the detection unit respectively for operation, compare the output results to detect anomalies, and suspend the thread or replace the detection unit to repair after the abnormality is determined.

Benefits of technology

It achieves timely detection and correction of physical damage to the computing unit during software operation, avoids calculation errors, and improves the accuracy of computing unit detection and the reliability of the processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111858196B
    Figure CN111858196B
Patent Text Reader

Abstract

The present application relates to a computing unit detection method, a parallel processor and an electronic device, and belongs to the field of computer technology. The method is applied to a parallel processor, and the parallel processor includes a computing unit group and a detection unit. The method includes: inputting thread data corresponding to the same instruction into the detected computing unit and the detection unit for calculation; wherein the detected computing unit is a computing unit in the computing unit group; the detected computing unit is detected according to the output result of the detection unit and the output result of the detected computing unit to obtain a detection result. In an embodiment of the present application, the computing unit in the computing unit group is detected by adding a detection unit to the hardware, so that physical damage to the computing unit can be detected during the software operation. At the same time, during the detection, the data input to the detected computing unit and the detection unit are the same, which ensures the reliability of the detection result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and specifically relates to a computing unit detection method, a parallel processor and an electronic device. Background Art

[0002] With the development of artificial intelligence (AI) and big data, higher requirements are placed on the computing power of processors. The emergence of parallel processors, such as graphics processing units (GPUs) and various AI parallel processors, just meets this demand. Generally speaking, there are hundreds or thousands of parallel computing units in parallel processors, which are independent of each other and work together to complete the assigned computing tasks. However, it is precisely because of the large number of computing units in parallel processors, the number of chip transistors is usually dozens of times that of central processing units (CPUs), and the probability of physical MOS tube damage also increases proportionally. If such problems are found in the testing phase, it only reduces a certain yield rate and does not cause too much loss. If MOS damage occurs during the operation of the parallel processor, it may cause the calculation results of the entire computing unit to be wrong, and then the entire operation to be wrong, and the error behavior can only be discovered during the next self-check process. Obviously, such physical damage is not allowed in long-term, high-precision computing applications.

[0003] The usual solution to this problem is to perform self-test. Self-test is to add self-test logic when the chip is powered on or in the idle phase of program running to complete the check of the computing unit and ensure the normal operation of the computing unit. However, the self-test strategy cannot check for physical damage that occurs during the normal operation of the software, nor can it correct this problem. Summary of the invention

[0004] In view of this, the purpose of the present application is to provide a computing unit detection method, a parallel processor and an electronic device to solve the problem that the existing solutions cannot detect physical damage to the computing unit during software operation.

[0005] The embodiment of the present application is implemented as follows:

[0006] In the first aspect, an embodiment of the present application provides a computing unit detection method, which is applied to a parallel processor, wherein the parallel processor includes a computing unit group and a detection unit, and the method includes: inputting thread data corresponding to the same instruction into the detected computing unit and the detection unit for calculation, respectively, wherein the detected computing unit is a computing unit in the computing unit group; detecting the detected computing unit according to the output result of the detection unit and the output result of the detected computing unit to obtain a detection result. In an embodiment of the present application, the computing units in the computing unit group are detected by adding a detection unit to the hardware, so that physical damage to the computing unit can be detected during the software operation. At the same time, during the detection, the data input to the detected computing unit and the detection unit are the same, which ensures the reliability of the detection result.

[0007] In combination with a possible implementation of the first aspect, when the detection result indicates that the output result of the detected computing unit is inconsistent with the output result of the detection unit, the method further includes: pausing the input of the thread corresponding to the instruction after the time when the instruction is located, and determining whether the detected computing unit or the detection unit is abnormal. In the embodiment of the present application, when the detection result indicates that the output result of the detected computing unit is inconsistent with the output result of the detection unit, the thread operation after the time when the current thread is located is suspended to reduce more operation errors, and at the same time, it is further determined whether the detected computing unit or the detection unit is abnormal, so as to adopt different strategies for correction.

[0008] In combination with a possible implementation of the embodiment of the first aspect, determining whether the detected computing unit or the detection unit is abnormal includes: inputting the thread data corresponding to the inconsistent detection results into each computing unit in the computing unit group and the detection unit for calculation; determining whether the detected computing unit or the detection unit is abnormal based on the output result of each computing unit and the output result of the detection unit, wherein when the output results of more than half of the computing units are consistent with the output results of the detection unit, the detected computing unit is determined to be abnormal. In the embodiment of the present application, when determining whether the detected computing unit or the detection unit is abnormal, each computing unit and the detection unit in the computing unit group are used to calculate the same thread data, and if the output results of more than half of the computing units are consistent with the output results of the detection unit, the detected computing unit is determined to be abnormal, thereby ensuring the accuracy of the judgment result.

[0009] In combination with a possible implementation manner of the embodiment of the first aspect, determining whether the detected computing unit or the detection unit is abnormal includes: inputting the corresponding thread data when the detection results are inconsistent into each computing unit in the computing unit group and the detection unit for calculation; when the output results of more than half of the computing units are consistent with the output results of the detection unit, inputting the thread data into each computing unit in the computing unit group and the detection unit for calculation again; determining whether the detected computing unit or the detection unit is abnormal based on the output results of each computing unit calculated again and the output results of the detection unit calculated again, wherein if the result of the recalculation is that the output results of more than half of the computing units are still consistent with the output results of the detection unit, it is determined that the detected computing unit is abnormal. In an embodiment of the present application, when determining whether the detected computing unit or the detection unit is abnormal, the same thread data is respectively input into each computing unit and the detection unit in the computing unit group for calculation. If the output results of more than half of the computing units are consistent with the output results of the detection unit, the thread data is again respectively input into each computing unit in the computing unit group and the detection unit for calculation. When the result of the recalculation is still that the output results of more than half of the computing units are consistent with the output results of the detection unit, it is determined that the detected computing unit is abnormal, so as to eliminate the error influence caused by the error in the running of the software program, and further improve the accuracy of the judgment result.

[0010] In combination with a possible implementation of the embodiment of the first aspect, determining whether the detected computing unit or the detection unit is abnormal further includes: when the output results of more than half of the computing units are inconsistent with the output results of the detection unit, updating the number of times the output results are inconsistent, wherein if the output results of more than half of the computing units are consistent with the output results of the detection unit, the number is reset to zero; when the updated number is equal to a preset threshold, the detection unit is determined to be abnormal. In the embodiment of the present application, when the output results of more than half of the computing units are inconsistent with the output results of the detection unit, the detection unit is not directly determined to be abnormal, but the number of consecutive inconsistencies in the detection unit is counted. Only when the number of inconsistencies is equal to the preset threshold, the detection unit is determined to be abnormal, so as to eliminate the influence of errors caused by errors in the operation of the software program, and further improve the accuracy of the judgment result.

[0011] In combination with a possible implementation method of the first aspect embodiment, after determining that the detected computing unit is abnormal, the method also includes: setting the detected computing unit to an unavailable state, and tracing back to the time node where the thread needs to be recalculated; reallocating the threads corresponding to all instructions that need to be recalculated after the time node to other computing units in the computing unit group except the detected computing unit for calculation. In the embodiment of the present application, after determining that the detected computing unit is abnormal, the detected computing unit is set to an unavailable state, and tracing back to the time node where the thread needs to be recalculated, and reallocating the threads corresponding to all instructions that need to be recalculated after the time node to other computing units in the computing unit group except the detected computing unit for calculation, so as to eliminate the operation errors caused by the abnormality of the detected computing unit.

[0012] In combination with a possible implementation of the first aspect, after determining that the detected computing unit is abnormal, the method further includes: setting the detected computing unit to an unavailable state, and setting the detection unit as a computing unit to replace the detected computing unit, and tracing back to the time node at which the thread needs to be recalculated; reallocating the threads corresponding to all instructions that need to be recalculated after the time node to other computing units in the computing unit group except the detected computing unit and the detection unit for calculation. In the embodiment of the present application, after determining that the detected computing unit is abnormal, the detected computing unit is set to an unavailable state, and the detection unit is set as a computing unit to replace the detected computing unit, and tracing back to the time node at which the thread needs to be recalculated, and the threads corresponding to all instructions that need to be recalculated after the time node are reallocated to other computing units and the detection unit in the computing unit group except the detected computing unit for calculation, so as to eliminate the operation error caused by the abnormality of the detected computing unit. At the same time, since the abnormal detected computing unit is replaced by the detection unit, the number of original computing units remains unchanged, so there is no need to change the operation logic.

[0013] In combination with a possible implementation of the embodiment of the first aspect, when detecting the computing units in the computing unit group, each computing unit in the computing unit group is polled and detected in a preset order. In the embodiment of the present application, when detecting the computing units in the computing unit group, each computing unit in the computing unit group is polled and detected, so as to promptly find the computing units with physical damage, and at the same time, it is also conducive to simplifying the control logic.

[0014] In the second aspect, an embodiment of the present application also provides a parallel processor, including a SIMD architecture, wherein the SIMD architecture includes: a computing unit group; a detection unit; a control unit; a scheduling unit and an arbitration unit; the scheduling unit is used to input thread data corresponding to the same instruction into the detected computing unit and the detection unit for calculation under the control of the control unit, wherein the detected computing unit is a computing unit in the computing unit group; the arbitration unit is used to detect the detected computing unit according to the output result of the detection unit and the output result of the detected computing unit under the control of the control unit to obtain a detection result.

[0015] In combination with a possible implementation manner of the second aspect embodiment, the control unit is also used to suspend the input of the thread corresponding to the instruction after the moment when the instruction is located when the detection result indicates that the output result of the detected computing unit is inconsistent with the output result of the detection unit, and determine whether the detected computing unit or the detection unit is abnormal.

[0016] In combination with a possible implementation manner of the second aspect embodiment, the control unit is also used to control the scheduling unit to input the corresponding thread data when the detection results are inconsistent into each computing unit in the computing unit group and the detection unit for calculation; and is also used to determine whether the detected computing unit or the detection unit is abnormal based on the output results of each computing unit and the output results of the detection unit, wherein when the output results of more than half of the computing units are consistent with the output results of the detection unit, the detected computing unit is determined to be abnormal.

[0017] In combination with a possible implementation manner of the second aspect embodiment, the control unit is also used to control the scheduling unit to input the corresponding thread data when the detection results are inconsistent into each computing unit in the computing unit group and the detection unit for calculation; when the output results of more than half of the computing units are consistent with the output results of the detection unit, the scheduling unit is controlled again to input the thread data into each computing unit in the computing unit group and the detection unit for calculation; and it is also used to determine whether the detected computing unit or the detection unit is abnormal based on the output result of each computing unit calculated again and the output result of the detection unit calculated again, wherein if the result of the recalculation is still that the output results of more than half of the computing units are consistent with the output result of the detection unit, it is determined that the detected computing unit is abnormal.

[0018] In combination with a possible implementation manner of the second aspect, the control unit is also used to update the number of inconsistencies in the output results when more than half of the output results of the calculation units are inconsistent with the output results of the detection unit, wherein if more than half of the output results of the calculation units are consistent with the output results of the detection unit, the number is reset to zero; and is also used to determine that the detection unit is abnormal when the updated number is equal to a preset threshold.

[0019] In combination with a possible implementation manner of the second aspect embodiment, the SIMD architecture also includes: a storage unit, used to store input instruction blocks; the control unit is also used to, after determining that the detected computing unit is abnormal, set the detected computing unit to an unavailable state and trace back to the time node where the thread needs to be recalculated; and based on the instruction blocks stored in the storage unit, reallocate the threads corresponding to all instructions that need to be recalculated after the time node to other computing units in the computing unit group except the detected computing unit for calculation.

[0020] In combination with a possible implementation manner of the second aspect embodiment, the SIMD architecture also includes: a storage unit, for storing input instruction blocks; the control unit is also used to, after determining that the detected computing unit is abnormal, set the detected computing unit to an unavailable state, and set the detection unit as a computing unit to replace the detected computing unit, and trace back to the time node at which the thread needs to be recalculated; and based on the instruction blocks stored in the storage unit, reallocate the threads corresponding to all instructions that need to be recalculated after the time node to other computing units in the computing unit group except the detected computing unit for calculation.

[0021] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a parallel processor provided by the above-mentioned second aspect embodiment and / or any possible implementation method in combination with the second aspect embodiment.

[0022] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by implementing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. As shown in the drawings, the above and other purposes, features and advantages of the present application will be clearer. The same reference numerals indicate the same parts in all the drawings. The drawings are not deliberately scaled to the actual size, and the focus is on showing the main purpose of the present application.

[0024] Figure 1 A schematic diagram of the structure of a current parallel processor is shown.

[0025] Figure 2 A schematic diagram showing the working mode of MAC in the current SIMD architecture is shown.

[0026] Figure 3 A schematic diagram of a SIMD architecture provided by an embodiment of the present application is shown.

[0027] Figure 4 A schematic flow chart of a computing unit detection method provided in an embodiment of the present application is shown.

[0028] Figure 5 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0029] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0030] It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it is not necessary to further define and explain it in the subsequent drawings. At the same time, in the description of this application, relational terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.

[0031] Furthermore, the term "and / or" in this application is merely a term used to describe the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone.

[0032] In order to solve the problem that the current solution cannot detect physical damage to the computing unit during software operation, the embodiment of the present application adds a computing unit (Multiply and Accumulate, MAC) to each original parallel computing unit group as a detection unit, and adds related storage units, arbitration units and control units. By increasing certain hardware consumption on the basis of the original hardware structure, the computing unit with physical damage can be discovered in time, and it is ensured that when the computing unit is physically damaged, it can be spontaneously corrected and repaired to avoid calculation errors. For ease of understanding, Figure 1 Taking the architecture of the parallel processor shown in FIG. 1 as an example, the parallel processor includes 4 independent shader engines (SE), namely SE0, SE1, SE2 and SE3. Each SE contains 16 CUs (Computing Units), namely CU0, CU1, ..., CU14, CU15. Each CU contains 4 single instruction multiple data (SIMD) architectures, namely SIMD0, SIMD1, SIMD2, SIMD3. Each SIMD contains 16 MACs, and each MAC completes a basic multiplication and addition operation. This unit is the most basic computing unit (MAC). Each SE corresponds to a work group, each SIMD corresponds to an instruction block (Wave), and a Wave corresponds to 64 threads. The operation of the entire Wave can be completed in 4 phases, and each MAC corresponds to a thread.

[0033] Figure 2This is a schematic diagram of the working mode of MAC in a typical SIMD architecture. Since it is a schematic diagram, the discussion of functions such as data reading is simplified. The Wave information is input into the thread scheduling unit (thread_dispatch) at the front end for distribution. During the distribution, the 16 thread data in the Wave information are input into 16 MACs in parallel for calculation at one time. After 4 stages, the calculation of the entire Wave can be completed. The calculation result reaches MAC_OUT for fifo (first in, first out) operation and is finally output, wherein MAC_OUT is used to complete the selection and output of MAC calculation data. For the present application, since it is necessary to complete the determination and repair of physical damage, some additional hardware modules need to be added. The embodiment of the present application adds a MAC unit for detection and related storage units (Wave_fifo), arbitration units (arbitration) and control units (thread_control) in each SIMD architecture to realize the function of the detection logic. The schematic diagram of the modified SIMD architecture is shown in FIG. Figure 3 As shown. Of course, in one implementation, it is also possible not to add an additional MAC unit, but to select one MAC unit from the original 16 MAC units as a detection unit. However, in this implementation, the original operation logic needs to be modified, that is, the number of threads completed in each stage is reduced, and one Wave requires 5 stages to complete. In addition, this application is explained by taking the number of initial computing units (MAC) as 16 as an example. Of course, in one implementation, the default number of initial computing units (MAC) may not be 16.

[0034] The added MAC unit is used as a detection unit to complete the detection of the 16 computing units in the original computing unit group. The added MAC unit is equivalent to the original 16 MAC units, that is, they have the same processing function for threads, and the register can be used to configure which of the 17 MAC units is used as the detection unit. When running applications with short cycles and low accuracy requirements, the added MAC unit can be used as a computing unit to calculate the application together with the original computing unit to increase the computing power of the chip. For example, when inspection and repair are not required, the processing capacity of a Wave of more than 64 threads is supported in time, and the capacity is increased to 68 threads. At this time, Wave_fifo, arb0~16, and arb_s are all disabled. When performing applications with short cycles and high accuracy requirements, the added MAC unit is used as a detection unit. When performing applications with long time and high accuracy requirements, the computing unit exists as a detection unit.

[0035] The added control unit (thread_control) exists as the core module of the newly added functions, and is used to determine which of the 17 MAC units is used as the detection unit according to the configuration of the static register; and is used to complete the control of the arbitration unit (arb0~16) and the control of the fifo control module (arb_s), and when the calculation unit is detected to be damaged, the damaged calculation unit is set to an unavailable state, and the thread needs to be recalculated. The time node, and the Wave information stored in the storage unit are used to reallocate the calculations to all subsequent threads, and the stall signal is output to prevent the input of new Waves, etc. In addition, during the detection process, the control unit will also record the polling detection in real time to facilitate the understanding of which calculation unit is being detected at the current moment.

[0036] The added arbitration units (arb0-16) are used to complete the arbitration of the calculation unit and the detection unit under the control of the control unit (thread_control), and feed back the comparison results to the control unit (thread_control) and the fifo control module (arb_s) for further processing. Among them, each arbitration unit (arb) can receive the output of 17 MACs at the same time, and according to the control of the control unit, select the output data of its corresponding MAC unit and the output data of the detection unit for comparison, and feed back the comparison results to thread_control and arb_s. For example, the detected unit is MAC3 and the detection unit is MAC16, then the arb3 unit selects the output data of MAC3 and the output data of MAC16 from the input 17 MACs for comparison. Among them, it should be noted that in order to improve the arbitration efficiency, in the embodiment of the present application, one calculation unit (MAC) can correspond to one arbitration unit (arb) to realize parallel arbitration of 16 calculation units (MAC). Since each of these 17 MAC units may be a detection unit, 17 arbitration units are required. When MAC16 is a detection unit, MAC0-15 are calculation units, arb16 is marked as not working, and the remaining arb0-15 are each used to compare the output data of the corresponding MAC unit with the output data of the detection unit. For example, arb0 is used to compare the output data of MAC0 with the output data of MAC16, arb1 is used to compare the output data of MAC1 with the output data of MAC16, arb2 is used to compare the output data of MAC2 with the output data of MAC16, and so on. Of course, the number of arbitration units can also be less than 17, for example, there is only one arbitration unit. In this case, the arbitration unit is used to compare the output data of each calculation unit with the output data of the detection unit, that is, to compare the output data of MAC0 with the output data of MAC16, to compare the output data of MAC1 with the output data of MAC16, to compare the output data of MAC2 with the output data of MAC16, and so on. Therefore, the arbitration unit in the above example cannot be understood as a limitation to the present application.

[0037] The added fifo control module (arb_s) is used to complete the control of the thread storage unit (Wave_fifo) according to the control of the control unit (thread_control) to achieve the storage of a certain amount of Wave information. During normal operation, new Wave information is continuously written into Wave_fifo. Once the computing unit is damaged, it traces back to the time node where the thread needs to be recalculated, and uses the Wave information stored in Wave_fifo to recalculate all subsequent threads. Of course, in one implementation, the function of the fifo control module (arb_s) can be merged into the control unit (thread_control). At this time, the storage unit (Wave_fifo) is directly controlled by the control unit.

[0038] The storage unit (Wave_fifo) is used to store a certain amount of Wave information according to the control of the fifo control module (arb_s), wherein the amount of Wave information stored is determined by the cycle required to complete the MAC polling detection. For example, 16 clocks are required to poll 16 MACs, each clock corresponds to 16 threads, that is, 16*16=196 threads are required, and one Wave information corresponds to 64 threads, therefore, 4 Wave information need to be stored.

[0039] The following will be combined Figure 3The schematic diagram shown in the figure illustrates the process of detecting the computing units in the computing unit group. At this time, 16 MAC units are opened as computing units, and the extra MAC unit is used as a detection unit. For example, MAC16 is used as the detection unit by default, and arb16 is marked as not working. At the same time, the maximum number of threads corresponding to a Wave is restored to 64 threads. The input Wave information arrives at the storage unit (Wave_fifo) and the scheduling unit (thread_dispatch) at the same time. Thread_dispatch distributes the thread data corresponding to each instruction in the instruction block (Wave) to the corresponding computing unit in the computing unit group for calculation according to the control of the control unit (thread_control), and at the same time, the thread data input to the detected computing unit is input into the detection unit for calculation, that is, the thread data corresponding to the same instruction is respectively input into the detected computing unit and the detection unit for calculation, so as to ensure that the input data of the detected computing unit and the input data of the detection unit are the same. It should be noted that when the number of threads in the Wave information is less than 64, some MACs may not have input data. If the detected computing unit does not have input data at this time, the scheduling unit can generate input data for the detected computing unit by itself and copy it to the detection unit. The input data can be generated randomly or according to a specific function to ensure that the data input of the detection unit is the same as the data input of the detected computing unit. The output results of the 17 MACs arrive at arb0~15 at the same time. Assuming that the detected computing unit is MAC0, arb0 selects the output results of MAC0 and the output results of MAC16 from the 17 inputs under the control of the control unit, and detects the detected computing unit according to the output results of the detection unit (MAC16) and the output results of the detected computing unit (MAC0), obtains the detection results, and feeds back the detection results to thread_control and arb_s. In one embodiment, as long as the detection result indicates that the output result of the detected computing unit is inconsistent with the output result of the detection unit, it is assumed that the detected computing unit is abnormal, and the control unit outputs the relevant register indication signal and outputs the stall signal to prevent the input of new Wave information. Of course, in another implementation, when the detection result indicates that the output results of the two are inconsistent, the control unit is also used to suspend the thread operation after the current thread (for example, suspend the operation of thread 16-63), and further determine whether the detected computing unit or the detection unit is abnormal.

[0040] When determining whether the detected computing unit or the detection unit is abnormal, in one implementation mode, the control unit controls the scheduling unit to input the corresponding thread data when the detection results are inconsistent into all MAC units respectively, that is, respectively input into each computing unit and detection unit in the computing unit group for calculation, at this time, each arbitration unit (arb0~15) compares the output data of the corresponding computing unit with the output data of the detection unit, and feeds back the detection result to thread_control and arb_s. The control unit is also used to determine whether the detected computing unit or the detection unit is abnormal based on the output result of each computing unit and the output result of the detection unit, wherein when the output results of more than half of the computing units are consistent with the output results of the detection unit, it is considered that the detected computing unit is abnormal, and when the output results of more than half of the computing units are inconsistent with the output results of the detection unit, it is considered that the detection unit is abnormal, and the relevant register indication signal is output, and the subsequent computing units are no longer detected.

[0041] When determining whether the detected computing unit or the detection unit is abnormal, in another implementation, the control unit may control the scheduling unit to input the corresponding thread data when the detection results are inconsistent into each computing unit and the detection unit in the computing unit group for calculation, and when the output results of more than half of the computing units are consistent with the output results of the detection unit, the control unit is further used to control the scheduling unit again to input the thread data into each computing unit and the detection unit in the computing unit group for calculation, and determine whether the detected computing unit or the detection unit is abnormal based on the output results of each computing unit calculated again and the output results of the detection unit calculated again, wherein the detected computing unit is determined to be abnormal only if the result of the recalculation is still that the output results of more than half of the computing units are consistent with the output results of the detection unit, so as to reduce the impact of the software process abnormality on the judgment result.

[0042] Similarly, when determining that the detection unit is abnormal, in one embodiment, when more than half of the output results of the calculation units are inconsistent with the output results of the detection unit, the detection unit is determined to be abnormal. In another embodiment, when more than half of the output results of the calculation units are inconsistent with the output results of the detection unit, the control unit updates the number of inconsistencies in the output results, such as adding 1 to the counter, and then determines whether the updated number of inconsistencies reaches the preset threshold. When the updated number of inconsistencies is equal to the preset threshold (such as 3 times), the detection unit is determined to be abnormal. During this period, as long as more than half of the output results of the calculation units are consistent with the output results of the detection unit once, the number of inconsistencies is reset. It should be noted that the preset threshold can be set as needed, such as 3, 4, 5, etc. Similarly, the above-mentioned half can be set as needed. The larger the half is set, the more accurate the result, such as 14. Of course, the half can be set to any value between 9-15, and is not limited to 14.

[0043] After determining that the detected computing unit is abnormal, the control unit is also used to set the detected computing unit (such as arb0) to an unavailable state, and trace back to the time node where the thread needs to be recalculated, and indirectly control Wave_fifo by controlling arb_s, and use the Wave information stored in the storage unit to reallocate the threads corresponding to all instructions that need to be recalculated after the time node to other computing units in the computing unit group except the detected computing unit for calculation. Of course, in one implementation, after determining that the detected computing unit is abnormal, the control unit sets the detected computing unit to an unavailable state, and sets the detection unit as a computing unit to replace the detected computing unit, and traces back to the time node where the thread needs to be recalculated; and based on the instruction block stored in the storage unit, the threads corresponding to all instructions that need to be recalculated after the time node are reallocated to other computing units in the computing unit group except the detected computing unit for calculation. At this time, the SIMD does not have a self-checking function. When the Wave that needs to be recalculated is recalculated and the output is completed, the stall state is released, and new Wave information is allowed to be input, and the system continues to calculate.

[0044] Among them, after determining that the detected computing unit is abnormal, it is necessary to trace back to the time node where the thread needs to be recalculated. If the detected computing unit is being tested for the first time, then the time node to which the thread needs to be recalculated is traced back to the time starting point for starting the thread operation. For example, when each computing unit is polled for the first time, since there are 16 computing units, 16 clocks are required for one polling test. For example, clk0 detects MAC0, clk1 detects MAC1, clk2 detects MAC2, ..., assuming that when clk15 detects MAC15, MAC15 is found to be abnormal, then the time node to be traced back is clk0. Similarly, if it is assumed that when clk5 detects MAC5, MAC5 is found to be abnormal, then the time node to be traced back is clk0. If the detected computing unit is not being tested for the first time, then the time node to be traced back to when the thread needs to be recalculated is the time node of the last test of the detected computing unit.

[0045] When the detection unit detects the computing units in the computing unit group, it may detect each computing unit in turn, or it may detect a designated computing unit according to the configuration of the register.

[0046] After the introduction Figure 3 After the functions of the modules shown in the figure in the process of detecting the computing units in the computing unit group, the following will be combined with Figure 4 , a computing unit detection method applied to a parallel processor provided in an embodiment of the present application is described.

[0047] Step S101: when detecting a computing unit in the computing unit group, thread data corresponding to the same instruction are respectively input into the detected computing unit and the detecting unit for calculation.

[0048] Assuming that the detection unit is MAC16, when it is necessary to detect the computing unit in the computing unit group, assuming that it is MAC5, the thread data corresponding to the same instruction is input into the detected computing unit (MAC5 in this case) and the detection unit (MAC16 in this case) for calculation, so as to ensure that the input data of the two are the same. The detected computing unit is the computing unit in the computing unit group.

[0049] As an implementation method, when detecting the computing units in the computing unit group, each computing unit in the computing unit group is polled and detected in a preset order. For example, polling detection is performed in the order of MAC0 to MAC16. Of course, polling detection can also be performed in other orders, for example, polling detection is performed in the order of MAC5 to MAC16, MAC0 to MAC4. Of course, it is also possible to detect the specified computing unit according to the configuration of the register. During the detection process, the polling detection situation will be recorded in real time to facilitate the understanding of which computing unit is being detected at the current moment.

[0050] Step S102: Detect the detected computing unit according to the output result of the detection unit and the output result of the detected computing unit to obtain a detection result.

[0051] After the thread data corresponding to the same instruction are input into the detected computing unit and the detection unit for operation, the detected computing unit is detected according to the output results of the detection unit and the detected computing unit to obtain the detection result. In this way, it can be judged whether the detected computing unit is abnormal or not according to the detection result. For example, when the detection result indicates that the output results of the two are inconsistent, it is assumed that the detected computing unit is abnormal, and the thread operation after the current thread moment is suspended.

[0052] Of course, in one implementation, when the detection result indicates that the output results of the two are inconsistent, the method further includes: pausing the input of the thread corresponding to the instruction after the time of the instruction, and further determining whether the detected computing unit or the detection unit is abnormal. In this implementation, when the detection result indicates that the output results of the two are inconsistent, it is no longer assumed that the detected computing unit is abnormal, but it is necessary to further determine whether the detected computing unit or the detection unit is abnormal.

[0053] Among them, when determining whether the detected computing unit or the detection unit is abnormal, in one implementation, the thread data corresponding to the inconsistent detection results are respectively input into each computing unit and the detection unit in the computing unit group for calculation; according to the output result of each computing unit and the output result of the detection unit, it is determined whether the detected computing unit or the detection unit is abnormal. That is, in this implementation, the thread data corresponding to the detected computing unit (MAC5) is respectively input into each computing unit (MAC0~15) and the detection unit (MAC16) in the computing unit group for calculation, and according to the output results of these 17 MAC units, it is determined whether the MAC5 unit or the MAC16 unit is damaged. For example, when the output results of more than half of the computing units are consistent with the output results of the detection unit (MAC16), it is considered that the detected computing unit (MAC5) is abnormal, and when the output results of more than half of the computing units are inconsistent with the output results of the detection unit (MAC16), it is considered that the detection unit (MAC16) is abnormal.

[0054] When determining whether it is the detected computing unit or the detection unit that is abnormal, in another implementation, the thread data corresponding to the inconsistent detection results are respectively input into each computing unit and the detection unit in the computing unit group for calculation. When the output results of more than half of the computing units are consistent with the output results of the detection unit, the thread data are again respectively input into each computing unit and the detection unit in the computing unit group for calculation. According to the output results of each computing unit calculated again and the output results of the detection unit calculated again, it is determined whether it is the detected computing unit or the detection unit that is abnormal. For example, if the result of the recalculation is still that the output results of more than half of the computing units are consistent with the output results of the detection unit, it is determined that the detected computing unit is abnormal. In this implementation, it is determined that the detected computing unit is abnormal only when the output results of more than half of the computing units are consistent with the output results of the detection unit twice in a row.

[0055] When determining whether the detected computing unit or the detection unit is abnormal, in one implementation, when more than half of the output results of the computing units are inconsistent with the output results of the detection unit, the detection unit is determined to be abnormal. In another implementation, when more than half of the output results of the computing units are inconsistent with the output results of the detection unit, the number of inconsistencies in the output results is updated, and as long as more than half of the output results of the computing units are consistent with the output results of the detection unit during this period, the number of inconsistencies is reset to zero; when the updated number of inconsistencies is equal to the preset threshold, the detection unit is determined to be abnormal. In this implementation, when more than half of the output results of the computing units are inconsistent with the output results of the detection unit, the detection unit is no longer directly determined to be abnormal, but the number of inconsistencies is counted. Only when the accumulated number of inconsistencies reaches the preset threshold (for example, 5 times), the detection unit is determined to be abnormal. During this period, as long as more than half of the output results of the computing units are consistent with the output results of the detection unit, the number of inconsistencies is reset to zero.

[0056] Optionally, after determining that the detected computing unit is abnormal, the method further includes: setting the detected computing unit to an unavailable state, and tracing back to the time node where the thread needs to be recalculated; reallocating the threads corresponding to all instructions that need to be recalculated after the time node to other computing units in the computing unit group except the detected computing unit for operation. That is, MAC5 is set to an unavailable state, and tracing back to the time node when MAC5 was last checked, and the threads corresponding to all instructions that need to be recalculated after the time node are reallocated to MAC0~4, MAC6~15 except MAC5 for operation. In order not to change the original operation logic, after determining that the detected computing unit is abnormal, in one implementation, by modifying the relevant register configuration, the detection unit is used as a calculation unit to replace the damaged MAC unit. In this implementation, the detected computing unit is set to an unavailable state, and the detection unit is set as a calculation unit to replace the detected computing unit, and tracing back to the time node where the thread needs to be recalculated; the threads corresponding to all instructions that need to be recalculated after the time node are reallocated to other computing units in the computing unit group except the detected computing unit and the detection unit for operation.

[0057] The computing unit detection method shown in the embodiment of the present application can be detected during the idle phase of chip power-on or program running, or can be detected during the normal operation of the software. For example, in the process of inputting 16 threads in a Wave information to the 16 computing units MAC0 to 15 for calculation, assuming that MAC0 is detected, the input data corresponding to MAC0 needs to be input into the detection unit (MAC16). If the output result of MAC0 is inconsistent with the output result of MAC16, the input data corresponding to MAC0 needs to be input into MAC0 to 16 for calculation.

[0058] The method provided in the embodiment of the present application has the same implementation principle and technical effects as those in the aforementioned device embodiment. For the sake of brief description, for matters not mentioned in the method embodiment, reference may be made to the corresponding contents in the aforementioned device embodiment.

[0059] like Figure 5 As shown, Figure 5 The electronic device 100 provided in the embodiment of the present application is shown in the structural block diagram. The electronic device 100 comprises: a transceiver 110 , a memory 120 , a communication bus 130 and a parallel processor 140 .

[0060] The transceiver 110, the memory 120, and the parallel processor 140 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses 130 or signal lines. Among them, the transceiver 110 is used to send and receive data. The memory 120 is used to store a computer program, which includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 100. The parallel processor 140 is used to execute the executable software function module or computer program stored in the memory 120. For example, the parallel processor 140 is used to input the thread data corresponding to the same instruction into the detected computing unit and the detection unit respectively when detecting the computing unit in the computing unit group; the detected computing unit is detected according to the output result of the detection unit and the output result of the detected computing unit to obtain the detection result.

[0061] Among them, the memory 120 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.

[0062] The parallel processor 140 may be an integrated circuit chip with signal processing capability. The above-mentioned parallel processor may be a graphics processor GPU, or other AI parallel processor. The disclosed methods, steps and logic block diagrams in the embodiments of the present application may be implemented or executed.

[0063] The electronic device 100 mentioned above includes but is not limited to a smart phone, a tablet, a computer, a server, etc.

[0064] An embodiment of the present application further provides a non-volatile computer-readable storage medium (hereinafter referred to as storage medium), on which a computer program is stored. When the computer program is run by a computer such as the above-mentioned electronic device 100, the above-mentioned computing unit detection method is executed.

[0065] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0066] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0067] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0068] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for enabling an electronic device (which can be a personal computer, a laptop, a server, or an electronic device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0069] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A computing unit detection method, characterized in that: Applied to a parallel processor, the parallel processor includes a computing unit group and a detection unit, the method includes: Inputting thread data corresponding to the same instruction into the detected computing unit and the detection unit for calculation respectively, so as to ensure that the input data of the detected computing unit is the same as the input data of the detection unit; wherein the detected computing unit is a computing unit in the computing unit group; Detecting the detected computing unit according to the output result of the detection unit and the output result of the detected computing unit to obtain a detection result; When the detection result indicates that the output result of the detected computing unit is inconsistent with the output result of the detection unit, suspend the input of the thread corresponding to the instruction after the time when the instruction is located, and determine whether the detected computing unit or the detection unit is abnormal; Wherein, determining whether the detected computing unit or the detection unit is abnormal includes: Inputting the thread data corresponding to the inconsistent detection results into each computing unit in the computing unit group and the detection unit for calculation respectively; According to the output result of each calculation unit and the output result of the detection unit, it is determined whether the detected calculation unit or the detection unit is abnormal.

2. The method according to claim 1, characterized in that in, When the output results of more than half of the computing units are consistent with the output result of the detection unit, it is determined that the detected computing unit is abnormal.

3. The method according to claim 1, characterized in that Determining whether the detected computing unit or the detection unit is abnormal includes: Inputting the thread data corresponding to the inconsistent detection results into each computing unit in the computing unit group and the detection unit for calculation respectively; When the output results of more than half of the computing units are consistent with the output result of the detection unit, the thread data is input again into each computing unit in the computing unit group and the detection unit for calculation; Based on the output results of each calculation unit recalculated and the output results of the detection unit recalculated, determine whether the detected calculation unit or the detection unit is abnormal, wherein if the result of the recalculation still shows that the output results of more than half of the calculation units are consistent with the output results of the detection unit, it is determined that the detected calculation unit is abnormal.

4. The method according to claim 2 or 3, characterized in that: Determining whether the detected computing unit or the detection unit is abnormal further includes: When the output results of more than half of the computing units are inconsistent with the output results of the detection unit, the number of times the output results are inconsistent is updated, wherein if the output results of more than half of the computing units are consistent with the output results of the detection unit, the number is reset to zero; When the updated number is equal to a preset threshold, it is determined that the detection unit is abnormal.

5. The method according to claim 1, characterized in that After determining that the detected computing unit is abnormal, the method further includes: Setting the detected computing unit to an unavailable state, and tracing back to the time node where the thread needs to be recalculated; The threads corresponding to all instructions that need to be recalculated after the time node are reallocated to other computing units in the computing unit group except the detected computing unit for calculation.

6. The method according to claim 1, characterized in that After determining that the detected computing unit is abnormal, the method further includes: Setting the detected computing unit to an unavailable state, and setting the detection unit to a computing unit to replace the detected computing unit, and tracing back to the time node where the thread needs to be recalculated; The threads corresponding to all instructions that need to be recalculated after the time node are reallocated to other computing units in the computing unit group except the detected computing unit and the detection unit for calculation.

7. The method according to claim 1, characterized in that When detecting the computing units in the computing unit group, each computing unit in the computing unit group is polled and detected in a preset order.

8. A parallel processor, characterized in that: Comprising a SIMD architecture, the SIMD architecture comprising: Computing unit group; detection unit; control unit; a scheduling unit, configured to input thread data corresponding to the same instruction into a detected computing unit and the detecting unit for calculation respectively under the control of the control unit, so as to ensure that the input data of the detected computing unit is the same as the input data of the detecting unit, wherein the detected computing unit is a computing unit in the computing unit group; an arbitration unit, configured to detect the detected computing unit according to an output result of the detection unit and an output result of the detected computing unit under the control of the control unit, to obtain a detection result; The control unit is further configured to, when the detection result indicates that the output result of the detected computing unit is inconsistent with the output result of the detection unit, suspend the input of the thread corresponding to the instruction after the time when the instruction is located, and determine whether the detected computing unit or the detection unit is abnormal; The control unit is also used to control the scheduling unit to input the corresponding thread data when the detection results are inconsistent into each computing unit in the computing unit group and the detection unit for calculation; and is also used to determine whether the detected computing unit or the detection unit is abnormal based on the output result of each computing unit and the output result of the detection unit.

9. The parallel processor according to claim 8, characterized in that: in, When the output results of more than half of the computing units are consistent with the output result of the detection unit, it is determined that the detected computing unit is abnormal.

10. The parallel processor according to claim 8, characterized in that: The control unit is further used to control the scheduling unit to input the corresponding thread data when the detection results are inconsistent into each computing unit in the computing unit group and the detection unit for calculation; When the output results of more than half of the computing units are consistent with the output result of the detection unit, controlling the scheduling unit again to input the thread data into each computing unit in the computing unit group and the detection unit for calculation; The device is also used to determine whether the detected computing unit or the detection unit is abnormal based on the output result of each computing unit recalculated and the output result of the detection unit recalculated, wherein if the result of the recalculation still shows that the output results of more than half of the computing units are consistent with the output result of the detection unit, the detected computing unit is determined to be abnormal.

11. The parallel processor according to claim 9 or 10, characterized in that: The control unit is also used to update the number of inconsistencies in the output results when more than half of the output results of the calculation units are inconsistent with the output results of the detection unit, wherein if more than half of the output results of the calculation units are consistent with the output results of the detection unit, the number is reset to zero; and is also used to determine that the detection unit is abnormal when the updated number is equal to a preset threshold.

12. The parallel processor according to claim 8, characterized in that: The SIMD architecture further includes: a storage unit for storing input instruction blocks; The control unit is also used to, after determining that the detected computing unit is abnormal, set the detected computing unit to an unavailable state and trace back to the time node where the thread needs to be recalculated; and based on the instruction block stored in the storage unit, reallocate the threads corresponding to all instructions that need to be recalculated after the time node to other computing units in the computing unit group except the detected computing unit for calculation.

13. The parallel processor according to claim 8, characterized in that: The SIMD architecture further includes: a storage unit for storing input instruction blocks; The control unit is also used to, after determining that the detected computing unit is abnormal, set the detected computing unit to an unavailable state, and set the detection unit as a computing unit to replace the detected computing unit, and trace back to the time node where the thread needs to be recalculated; and based on the instruction block stored in the storage unit, reallocate the threads corresponding to all instructions that need to be recalculated after the time node to other computing units in the computing unit group except the detected computing unit for calculation.

14. An electronic device, characterized in that: include: A parallel processor as claimed in any one of claims 8 to 13.