Test method and device, electronic equipment and storage medium
By determining the order of synchronization tasks and execution tasks in the core-to-core synchronization test method, the problems of insufficient code redundancy and scalability in the existing technology are solved, efficient and in-depth chip testing is achieved, and the stability of the chip is improved. and reliability.
Patent Information
- Application Number
- CN202410978355.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-09-13
AI Technical Summary
Existing core-to-core synchronous testing methods have problems with code redundancy, insufficient scalability, and limited space for code optimization when testing artificial intelligence chips, making it difficult to achieve efficient and in-depth chip testing.
By determining the synchronization task based on the initial task execution sequence information and the address space of multiple co-processing units, using multiple co-processing units to execute the tasks to be executed, obtaining the execution results to be tested, and determining the test results based on the execution results to be tested and the simulation execution results. , realize the decoupling and event-based synchronization of tasks and control cores, and optimize the insertion of synchronization tasks.
It improves the diversity and depth of testing, enhances the stability and reliability of the chip, ensures the consistency of data flow, simplifies synchronization operations, and improves execution efficiency.
Smart Images

Figure CN118642827A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of chip technology and testing technology. More specifically, the present disclosure provides a testing method, device, electronic device and storage medium. Background Art
[0002] With the development of artificial intelligence technology, the application scenarios of artificial intelligence chips are constantly increasing. When testing artificial intelligence chips, you can use the core-to-core method for synchronization. Summary of the invention
[0003] The present disclosure provides a testing method, an apparatus, a device and a storage medium.
[0004] According to one aspect of the present disclosure, a testing method is provided, the method comprising: determining at least one synchronization task based on initial task execution order information and respective address spaces of a plurality of coprocessing units, wherein the initial task execution order information is used to indicate the order of executing respective initial tasks of the plurality of coprocessing units, and the synchronization task is used to indicate that a target coprocessing unit of at least two coprocessing units having overlapping address spaces executes the initial task; utilizing the plurality of coprocessing units to execute at least one to-be-executed task of the plurality of coprocessing units to obtain an execution result to be tested, wherein the at least one to-be-executed task of the coprocessing unit includes at least one of the initial task and the synchronization task; and determining a test result based on the execution result to be tested and the simulated execution results of the plurality of tasks to be executed.
[0005] According to another aspect of the present disclosure, a testing device is provided, which includes: a plurality of control units, wherein the control units are configured to: generate at least one instruction to be executed corresponding to at least one task to be executed, the at least one task to be executed includes at least one of an initial task and a synchronization task, the synchronization task is determined based on initial task execution sequence information and respective address spaces of a plurality of coprocessing units, the initial task execution sequence information is used to indicate the order of executing respective initial tasks of the plurality of coprocessing units, the synchronization task is used to indicate that a target coprocessing unit of at least two coprocessing units with overlapping address spaces executes the initial task; the plurality of coprocessing units are configured to execute at least one instruction to be executed of the plurality of coprocessing units respectively, and obtain execution results to be tested; the plurality of control units are further configured to: determine the test results based on the execution results to be tested and the simulated execution results of the plurality of tasks to be executed.
[0006] According to another aspect of the present disclosure, an electronic device is provided, comprising the device provided by the present disclosure.
[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method provided according to the present disclosure.
[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method provided according to the present disclosure.
[0009] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method provided according to the present disclosure is implemented.
[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0012] Figure 1 is a flow chart of a testing method according to an embodiment of the present disclosure;
[0013] Figure 2A is a schematic diagram of multiple address spaces according to an embodiment of the present disclosure;
[0014] Figure 2B is a schematic diagram of a synchronization task matrix between multiple co-processing units according to an embodiment of the present disclosure;
[0015] Figure 2C is a schematic diagram of an updated synchronization task matrix according to an embodiment of the present disclosure;
[0016] Figure 2D is a schematic diagram of executing a task to be executed according to an embodiment of the present disclosure;
[0017] Figure 3A is a schematic diagram of the initial task execution sequence according to an embodiment of the present disclosure;
[0018] Figure 3B is a schematic diagram of multiple address spaces according to another embodiment of the present disclosure;
[0019] Figure 3C is a schematic diagram of executing a task to be executed according to another embodiment of the present disclosure;
[0020] Figure 4 is a block diagram of a testing device according to an embodiment of the present disclosure;
[0021] Figure 5 is a block diagram of an electronic device according to an embodiment of the present disclosure; and
[0022] Figure 6 is a block diagram of an electronic device to which a testing method can be applied according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0024] The Random Instruction Generator (RIG) can generate random and valid instruction sequences based on preset constraints, and generate test cases with wide coverage, which can comprehensively test multiple functions designed for the processor to reveal potential hardware defects. When testing artificial intelligence chips, core-to-core synchronization can be used.
[0025] For the Bulk Synchronous Parallel (BSP) programming model, the core-to-core synchronization method can have the advantages of large block data processing and simple hardware unit scheduling. However, the core-to-core synchronization method requires high-precision planning of tasks for each core and fine management of data storage areas. In addition, core-to-core synchronization also has disadvantages such as code redundancy, insufficient scalability, and limited space for code optimization.
[0026] Therefore, in order to improve the testing efficiency, the present disclosure provides a testing method, which will be described below.
[0027] Figure 1 is a flow chart of a testing method according to an embodiment of the present disclosure.
[0028] like Figure 1 As shown, the method 100 may include operations S110 to S130.
[0029] In operation S110 , at least one synchronization task is determined according to initial task execution sequence information and respective address spaces of a plurality of co-processing units.
[0030] In an embodiment of the present disclosure, the initial task execution sequence information may indicate the order in which the initial tasks of the respective co-processing units are executed. For example, the co-processing unit may execute the initial task. The initial task execution sequence information may indicate the order in which different co-processing units execute the initial tasks.
[0031] In the embodiment of the present disclosure, the co-processing unit may be a multiply-accumulate (MAC) unit, a direct memory access unit (DMA) and the like.
[0032] In an embodiment of the present disclosure, a synchronization task may instruct a target coprocessing unit among at least two coprocessing units whose address spaces overlap to execute an initial task. For example, a coprocessing unit may read data or write data from a corresponding address space. The address spaces of multiple coprocessing units may overlap. In order to avoid conflicts such as Read After Write (RAW), synchronization tasks between different coprocessing units may be determined. In the case where there are synchronization tasks between different coprocessing units, after the synchronization task is executed, the target coprocessing unit executes the initial task of the target coprocessing unit.
[0033] In operation S120, the plurality of co-processing units are used to execute at least one task to be executed by each of the plurality of co-processing units to obtain an execution result to be tested.
[0034] In an embodiment of the present disclosure, at least one task to be executed of a coprocessing unit may include at least one of an initial task and a synchronization task. For example, a coprocessing unit may execute a first initial task and a synchronization task. Thus, after the synchronization task is executed, another coprocessing unit that overlaps with the address space of the coprocessing unit may execute a second initial task. After multiple tasks to be executed are executed, a test execution result may be obtained. For another example, if there is no overlap with the address space of other coprocessing units, one or more coprocessing units may also only execute the initial task.
[0035] In operation S130 , a test result is determined according to the execution result to be tested and the simulation execution results of the plurality of tasks to be executed.
[0036] In the disclosed embodiment, the simulation test result may be obtained by executing a plurality of tasks to be executed using various simulators or simulation software.
[0037] In the embodiment of the present disclosure, the test result can be determined according to the difference between the simulation execution result and the execution result to be tested. The test result can indicate whether the accuracy of the chip including the multiple co-processing units meets the requirements.
[0038] Through the embodiments of the present disclosure, synchronization tasks between coprocessing units with overlapping address spaces are determined based on the initial task execution sequence information, decoupling of tasks and control cores is achieved in the synchronization mechanism, and event (task)-based synchronization is achieved. The insertion of synchronization tasks is optimized, so that multiple coprocessing units can execute tasks in the order indicated by the initial task execution sequence information, and task execution tests in multiple orders can be implemented, thereby improving the diversity of tests. The chip can be tested comprehensively and in depth, which helps to improve the stability and reliability of the chip.
[0039] It can be understood that the method of the present disclosure is described above, and the method of the present disclosure will be further described below.
[0040] In some embodiments, the above method may further include: randomly determining multiple coprocessing units for testing. For example, the coprocessing unit for testing may be randomly determined from multiple coprocessing units of the artificial intelligence chip. It is understood that the number of coprocessing units for testing is less than or equal to the number of coprocessing units of the artificial intelligence chip. For another example, the multiple coprocessing units for testing may include: a first coprocessing unit, a second coprocessing unit, a third coprocessing unit, and a fourth coprocessing unit.
[0041] In some embodiments, the method may further include: randomly determining initial task execution order information of the plurality of co-processing units. For example, the initial task execution order information may indicate: sequentially executing the initial task of the first co-processing unit, the initial task of the second co-processing unit, and the initial task of the third co-processing unit, and sequentially executing the initial task of the first co-processing unit and the initial task of the fourth co-processing unit.
[0042] In some embodiments, the above method may further include: determining the address space of each of the plurality of co-processing units. Figure 2A Provide explanation.
[0043] Figure 2A is a schematic diagram of multiple address spaces according to an embodiment of the present disclosure.
[0044] like Figure 2A As shown, address space addr201 may be the address space of the first coprocessing unit. Address space addr202 may be the address space of the second coprocessing unit. Address space addr203 may be the address space of the third coprocessing unit. Address space addr204 may be the address space of the fourth coprocessing unit. Address space addr201 overlaps with address space addr202, address space addr203 and address space addr204. Address space addr202 also overlaps with address space addr203.
[0045] In some embodiments, in some implementations of the above operation S110, determining at least one synchronization task according to the initial task execution order information and the respective address spaces of the plurality of coprocessing units includes: in response to determining that there is an overlap between the address spaces of at least two coprocessing units, determining a target coprocessing unit and a preceding coprocessing unit of the target coprocessing unit from the at least two coprocessing units according to the initial task execution order information. Determine the synchronization task between the preceding coprocessing unit and the target coprocessing unit. The synchronization task is executed by the preceding coprocessing unit. Through the embodiments of the present disclosure, multiple address spaces can be randomly determined, and synchronization tasks between multiple coprocessing units with overlapping address spaces can also be determined, which can effectively realize the decoupling of tasks from the control core, optimize the insertion of synchronization tasks, ensure the consistency of data flow, and improve the stability and reliability of the chip.
[0046] For example, there is overlap between address space addr201, address space addr202, address space addr203, and address space addr204. For the corresponding first to fourth coprocessing units, according to the above-mentioned initial task execution information, it can be determined from the first coprocessing unit, the second coprocessing unit and the third coprocessing unit that the second coprocessing unit and the third coprocessing unit are the target coprocessing units, respectively, and the first coprocessing unit is the previous processing unit. A synchronization task can be determined, and the synchronization task can be executed by the first coprocessing unit. For another example, there is also overlap between address space addr202 and address space addr203. For the corresponding second and third coprocessing units, according to the above-mentioned initial task execution information, it can be determined from the second and third coprocessing units that the third coprocessing unit is the target coprocessing unit, and the second coprocessing unit is the previous processing unit. Therefore, a synchronization task can be determined, and the synchronization task can be executed by the second coprocessing unit. Therefore, the synchronization tasks between multiple coprocessing units are as follows. Figure 2B shown.
[0047] Figure 2B is a schematic diagram of a synchronization task matrix between multiple co-processing units according to an embodiment of the present disclosure.
[0048] like Figure 2BAs shown, the synchronization task matrix M200 includes multiple column header fields and row header fields. The values of the multiple column header fields are: the first coprocessing unit, the second coprocessing unit, the third coprocessing unit and the fourth coprocessing unit. The values of the multiple row header fields are: the first coprocessing unit, the second coprocessing unit, the third coprocessing unit and the fourth coprocessing unit. The synchronization task matrix M200 may include multiple element values. The element value may be a first preset value or a second preset value. The first preset value may indicate that there is a synchronization task between the two coprocessing units. The second preset value may indicate that there is no synchronization task between the two coprocessing units. The first preset value may be, for example, 1. The second preset value may be, for example, 0.
[0049] like Figure 2B As shown, the values of the 1st row and 2nd column, the 1st row and 3rd column, and the 1st row and 4th column of the synchronization task matrix M200 are respectively 1, which can indicate that: there is a synchronization task between the first coprocessing unit and the second coprocessing unit, there is a synchronization task between the first coprocessing unit and the third coprocessing unit, and there is a synchronization task between the first coprocessing unit and the fourth coprocessing unit.
[0050] like Figure 2B As shown, the value of the 2nd row and the 3rd column of the synchronization task matrix M200 is 1, which can indicate that a synchronization task exists between the second co-processing unit and the third co-processing unit.
[0051] In some embodiments, in some implementations of the above operation S110, determining at least one synchronization task according to the initial task execution order information and the respective address spaces of the plurality of coprocessing units may further include: in response to determining that there is a synchronization task between a preceding coprocessing unit of a target coprocessing unit and the target coprocessing unit, a synchronization task between the target coprocessing unit and a succeeding coprocessing unit of the target coprocessing unit, and a synchronization task between the preceding coprocessing unit and the succeeding coprocessing unit, deleting the synchronization task between the preceding coprocessing unit and the succeeding coprocessing unit. Figure 2B As shown, after determining the synchronization task according to the coprocessing units with overlapping address spaces, according to the above initial task execution order information, the first coprocessing unit can be used as the previous processing unit, the second coprocessing unit can be used as the target processing unit, and the third coprocessing unit can be used as the subsequent coprocessing unit. There is a synchronization task between the first coprocessing unit and the second coprocessing unit, a synchronization task between the first coprocessing unit and the third coprocessing unit, and a synchronization task between the second coprocessing unit and the third coprocessing unit. The synchronization task between the first coprocessing unit and the third coprocessing unit can be deleted, and the following is obtained: Figure 2C The updated synchronization task matrix M201 is shown. Through the embodiment of the present disclosure, the synchronization operation is simplified, the accuracy of synchronization is ensured, and the execution efficiency is improved.
[0052] Figure 2C is a schematic diagram of an updated synchronization task matrix according to an embodiment of the present disclosure.
[0053] like Figure 2C As shown, the value of the 1st row and the 3rd column of the updated synchronization task matrix M201 is 0, which can indicate that there is no synchronization task between the first co-processing unit and the third co-processing unit.
[0054] It can be understood that the above describes some ways of determining synchronization tasks in the present disclosure, and the following describes some ways of executing tasks.
[0055] Figure 2D is a schematic diagram of executing a task to be executed according to an embodiment of the present disclosure.
[0056] In the embodiment of the present disclosure, at least one task to be executed by the co-processing unit may include at least one of an initial task and a synchronization task. Figure 2D As shown, at least one task to be executed of the first co-processing unit includes an initial task Mi201 and a synchronization task Ms201. At least one task to be executed of the second co-processing unit includes an initial task Mi202 and a synchronization task Ms202. At least one task to be executed of the third co-processing unit includes an initial task Mi203. At least one task to be executed of the fourth co-processing unit includes an initial task Mi204.
[0057] In some embodiments, in some implementations of the above operation S120, using multiple co-processing units to execute at least one task to be executed of each of the multiple co-processing units to obtain the execution result to be tested may include: using a previous co-processing unit to execute the initial task and obtain the execution result of the previous co-processing unit. In response to determining that the previous co-processing unit has executed the initial task, using the previous co-processing unit to execute the synchronization task, obtain the synchronization signal, and provide the synchronization signal to the target co-processing unit. In response to receiving the synchronization signal provided by the previous co-processing unit, according to the execution result of the previous co-processing unit, using the target co-processing unit to execute the initial task.
[0058] like Figure 2DAs shown, the first coprocessing unit may wait for a start signal. After receiving the start signal, the first coprocessing unit may execute the initial task Mi201 and obtain a first execution result. In response to determining that the first coprocessing unit has executed the initial task Mi201, the synchronization task Ms201 may be executed to obtain a synchronization signal singal201, and the synchronization signal singal201 may be provided to the second coprocessing unit and the fourth coprocessing unit. It can be understood that the synchronization task Ms201 may be a fused synchronization task. As described above, there is a synchronization task between the first coprocessing unit and the second coprocessing unit, and the synchronization task is executed by the first coprocessing unit. There is a synchronization task between the first coprocessing unit and the fourth coprocessing unit, and the synchronization task is also executed by the first coprocessing unit. Both synchronization tasks are executed by the first coprocessing unit, and the difference is that the synchronization signal is provided to two different coprocessing units. Therefore, the two synchronization tasks can be merged to obtain the synchronization task Ms201. After the synchronization task Ms201 is executed, the generated synchronization signal can be provided to the second coprocessing unit and the fourth coprocessing unit respectively.
[0059] like Figure 2D As shown, the second co-processing unit may wait for the synchronization signal. After receiving the synchronization signal singal201, the second co-processing unit may execute the initial task Mi202 according to the first execution result to obtain the second execution result. In response to determining that the second co-processing unit has executed the initial task Mi202, the synchronization task Ms202 may be executed to obtain the synchronization signal singal202, and the synchronization signal singal202 may be provided to the third co-processing unit.
[0060] like Figure 2D As shown, the third co-processing unit may wait for the synchronization signal. After receiving the synchronization signal singal202, the third co-processing unit may execute the initial task Mi203 according to the second execution result to obtain a third execution result.
[0061] like Figure 2D As shown, the fourth co-processing unit may wait for the synchronization signal. After receiving the synchronization signal singal201, the fourth co-processing unit may execute the initial task Mi204 according to the first execution result to obtain a fourth execution result.
[0062] According to the third execution result and the fourth execution result, the execution result to be tested can be obtained.
[0063] It can be understood that the above describes some ways in which the present disclosure performs tasks to be performed, and the following describes some ways in which the present disclosure determines test results.
[0064] In some embodiments, in some implementations of the above operation S130, determining the test result according to the execution result to be tested and the simulation execution results of the multiple tasks to be executed includes: in response to determining that the difference between the execution result to be tested and the simulation execution result is greater than a preset difference threshold, determining that the test result is a first test result. The first test result is used to indicate that the accuracy of the multiple co-processing units does not meet the requirements. For example, the difference between the execution result to be tested and the simulation execution result can be determined in various ways. The difference can be, for example, a mean square error (MSE).
[0065] In some embodiments, in other implementations of the above operation S130, determining the test result according to the execution result to be tested and the simulation execution results of the multiple tasks to be executed includes: in response to determining that the difference between the execution result to be tested and the simulation execution result is less than or equal to a preset difference threshold, determining that the test result is a second test result. The second test result is used to indicate that the accuracy of the multiple co-processing units meets the requirements.
[0066] It can be understood that the above describes the method of the present disclosure, and the following will describe the initial task execution sequence information of the present disclosure.
[0067] In some embodiments, the initial task execution order information is further used to indicate the respective levels of the plurality of co-processing units, the plurality of co-processing units including at least two associated co-processing units of different levels, and the address spaces of at least two associated co-processing units overlap. The plurality of levels include at least two of a producer level, a pre-processor level, a processor level, and a consumer level. Figure 3A Provide explanation.
[0068] Figure 3A It is a schematic diagram of the initial task execution sequence according to an embodiment of the present disclosure.
[0069] like Figure 3AAs shown, the multiple coprocessing units may include a producer coprocessing unit cop310, a preprocessor coprocessing unit cop320, a first processor coprocessing unit cop331, a second processor coprocessing unit cop332, a third processor coprocessing unit cop333, a first consumer coprocessing unit cop341, and a second consumer coprocessing unit cop342. The level of the producer coprocessing unit cop310 may be a producer level. The level of the preprocessor coprocessing unit cop320 may be a preprocessor level. The level of the first processor coprocessing unit cop331, the second processor coprocessing unit cop332, and the third processor coprocessing unit cop333 may be a processor level. The level of the first consumer coprocessing unit cop341 and the second consumer coprocessing unit cop342 may be a consumer level. Through the embodiments of the present disclosure, based on the producer-consumer model, the addition of synchronization tasks can be further optimized, the consistency of the data flow can be further ensured, and the stability and reliability of the chip can be improved.
[0070] like Figure 3A The initial task execution sequence information shown may indicate: the initial task of the producer coprocessor unit cop310 and the initial task of the preprocessor coprocessor unit cop320 are executed in sequence; next, the initial task of the first processor coprocessor unit cop331, the initial task of the second processor coprocessor unit cop332 and the initial task of the third processor coprocessor unit cop333 are executed in a distributed manner; after the initial task of the first processor coprocessor unit cop331 and the initial task of the second processor coprocessor unit cop332 are executed, the initial task of the first consumer coprocessor unit cop341 is executed; after the initial task of the second consumer coprocessor unit cop332 is executed, the initial task of the second consumer coprocessor unit cop342 is executed.
[0071] Next, the address spaces of the multiple co-processing units can be determined. Figure 3B Provide explanation.
[0072] Figure 3B is a schematic diagram of multiple address spaces according to another embodiment of the present disclosure.
[0073] like Figure 3BAs shown, address space addr310 may be the address space of producer coprocessor cop310. Address space addr320 may be the address space of preprocessor coprocessor cop320. Address space addr331 may be the address space of first processor coprocessor cop311. Address space addr332 may be the address space of second processor coprocessor cop332. Address space addr333 may be the address space of third processor coprocessor. Address space addr341 may be the address space of first consumer coprocessor cop341. Address space addr342 may be the address space of second consumer coprocessor cop342. There is overlap between address space addr310 and address space addr320. There is overlap between address space addr320 and address space addr331, address space addr332 and address space addr333. There is also overlap between address space addr341 and address space addr331 and address space addr332. There is also overlap between address space addr342 and address space addr333.
[0074] Next, the above operation S110 may be performed to determine at least one synchronization task. In addition, when determining the synchronization task, if there is a synchronization task between the previous co-processing unit of the target co-processing unit and the target co-processing unit, a synchronization task between the target co-processing unit and the subsequent co-processing unit of the target co-processing unit, and a synchronization task between the previous co-processing unit and the subsequent co-processing unit, the synchronization task between the previous co-processing unit and the subsequent co-processing unit may be deleted. Next, the above operation S120 may be performed. Figure 3C Provide explanation.
[0075] Figure 3C is a schematic diagram of executing a task to be executed according to another embodiment of the present disclosure.
[0076] like Figure 3CAs shown, at least one task to be executed of the producer coprocessor unit cop310 includes an initial task Mi310 and a synchronization task Ms310. At least one task to be executed of the preprocessor coprocessor unit cop320 includes an initial task Mi320 and a synchronization task Ms320. At least one task to be executed of the first processor coprocessor unit cop331 includes an initial task Mi331 and a synchronization task Ms331. At least one task to be executed of the second processor coprocessor unit cop332 includes an initial task Mi332 and a synchronization task Ms332. At least one task to be executed of the third processor coprocessor unit cop333 includes an initial task Mi333 and a synchronization task Ms333. At least one task to be executed of the first consumer coprocessor unit cop341 includes an initial task Mi341. At least one task to be executed of the second consumer coprocessor unit cop342 includes an initial task Mi342.
[0077] like Figure 3C As shown, the producer coprocessing unit cop310 may wait for a start signal. After receiving the start signal, the producer coprocessing unit cop310 may execute the initial task Mi310 to obtain a fifth execution result. In response to determining that the producer coprocessing unit cop310 has executed the initial task Mi310, the synchronization task Ms310 may be executed to obtain a synchronization signal singal310, and the synchronization signal singal310 may be provided to the preprocessor coprocessing unit cop320.
[0078] like Figure 3C As shown, the preprocessor coprocessing unit cop320 may wait for the synchronization signal. After receiving the synchronization signal singal310, according to the fifth execution result, the preprocessor coprocessing unit cop320 may execute the initial task Mi320 to obtain the sixth execution result. In response to determining that the preprocessor coprocessing unit has executed the initial task Mi320, the synchronization task Ms320 may be executed to obtain the synchronization signal singal320, and the synchronization signal singal320 may be provided to the first processor coprocessing unit cop331, the second processor coprocessing unit cop332, and the third processor coprocessing unit cop333.
[0079] like Figure 3CAs shown, the first processor coprocessing unit cop331 may wait for a synchronization signal. After receiving the synchronization signal singal320, according to the sixth execution result, the first processor coprocessing unit cop331 may execute the initial task Mi331 to obtain a seventh execution result. In response to determining that the first processor coprocessing unit cop331 has executed the initial task Mi331, the synchronization task Ms331 may be executed to obtain the synchronization signal singal331, and the synchronization signal singal331 may be provided to the first consumer coprocessing unit cop341. In addition, the second processor coprocessing unit cop332 may wait for a synchronization signal. After receiving the synchronization signal singal320, according to the sixth execution result, the second processor coprocessing unit cop332 may execute the initial task Mi332 to obtain an eighth execution result. In response to determining that the second processor coprocessing unit cop332 has executed the initial task Mi332, the synchronization task Ms332 may be executed, the synchronization signal singal332 may be obtained, and the synchronization signal singal332 may be provided to the first consumer coprocessing unit cop341. In addition, the third processor coprocessing unit cop333 may wait for the synchronization signal. After receiving the synchronization signal singal320, according to the sixth execution result, the third processor coprocessing unit cop333 may execute the initial task Mi333 and obtain a ninth execution result. In response to determining that the third processor coprocessing unit cop333 has executed the initial task Mi333, the synchronization task Ms333 may be executed, the synchronization signal singal333 may be obtained, and the synchronization signal singal333 may be provided to the second consumer coprocessing unit cop342.
[0080] like Figure 3C As shown, the first consumer coprocessing unit cop341 can wait for the synchronization signal. After receiving the synchronization signal singal331 and the synchronization signal singal332, according to the seventh execution result and the eighth execution result, the first consumer coprocessing unit can execute the initial task Mi341 to obtain the tenth execution result. In addition, the second consumer coprocessing unit cop342 can wait for the synchronization signal. After receiving the synchronization signal singal333, according to the ninth execution result, the second consumer coprocessing unit cop342 can execute the initial task Mi342 to obtain the eleventh execution result.
[0081] According to the tenth execution result and the eleventh execution result, the execution result to be tested can be obtained. Next, the above operation S130 can be performed to obtain the test result.
[0082] It can be understood that the method of the present disclosure is described above, and the device of the present disclosure will be described below.
[0083] Figure 4 is a schematic block diagram of a testing device according to an embodiment of the present disclosure.
[0084] like Figure 4 As shown, the device 400 may include multiple control units 410 and multiple co-processing units 420 .
[0085] A plurality of control units 410, the control unit 410 is configured to: generate at least one instruction to be executed corresponding to at least one task to be executed. The at least one task to be executed includes at least one of an initial task and a synchronization task. The synchronization task is determined according to the initial task execution sequence information and the address spaces of the plurality of co-processing units. The initial task execution sequence information is used to indicate the order of executing the initial tasks of the plurality of co-processing units. The synchronization task is used to indicate the target co-processing unit in at least two co-processing units with overlapping address spaces to execute the initial task.
[0086] The multiple co-processing units 420 are configured to execute at least one to-be-executed instruction of each of the multiple co-processing units to obtain an execution result to be tested.
[0087] The multiple control units 410 are further configured to determine the test results according to the execution results to be tested and the simulation execution results of the multiple tasks to be executed.
[0088] In some embodiments, the initial task execution order information is further used to indicate respective levels of a plurality of co-processing units, wherein the plurality of co-processing units include at least two associated co-processing units of different levels, and address spaces between at least two associated co-processing units overlap.
[0089] In some embodiments, the plurality of tiers includes at least two of a producer tier, a pre-processor tier, a processor tier, and a consumer tier.
[0090] In some embodiments, the synchronization task is determined by determining at least one synchronization task according to the initial task execution order information and the respective address spaces of the plurality of coprocessing units by the following operations: in response to determining that there is an overlap between the address spaces of at least two coprocessing units, determining a target coprocessing unit and a preceding coprocessing unit of the target coprocessing unit from the at least two coprocessing units according to the initial task execution order information. Determining a synchronization task between the preceding coprocessing unit and the target coprocessing unit. The synchronization task is executed by the preceding coprocessing unit.
[0091] In some embodiments, the previous co-processing unit is further configured to: execute the initial task, obtain the execution result of the previous co-processing unit, execute the synchronization task in response to determining that the initial task has been executed, obtain the synchronization signal, and provide the synchronization signal to the target co-processing unit.
[0092] In some embodiments, the target co-processing unit is further configured to: in response to receiving a synchronization signal provided by the previous co-processing unit, execute the initial task of the target co-processing unit according to the execution result of the previous co-processing unit.
[0093] In some embodiments, the synchronization task is also determined by the following operation to determine at least one synchronization task according to the initial task execution order information and the respective address spaces of the plurality of coprocessing units: in response to determining that there is a synchronization task between a preceding coprocessing unit of a target coprocessing unit and the target coprocessing unit, a synchronization task between the target coprocessing unit and a succeeding coprocessing unit of the target coprocessing unit, and a synchronization task between the preceding coprocessing unit and the succeeding coprocessing unit, the synchronization task between the preceding coprocessing unit and the succeeding coprocessing unit is deleted.
[0094] In some embodiments, the plurality of control units are further configured to perform the following operations to determine a test result based on the execution result to be tested and the simulation execution results of the plurality of tasks to be executed: in response to determining that the difference between the execution result to be tested and the simulation execution result is greater than a preset difference threshold, determining the test result to be a first test result. The first test result is used to indicate that the accuracy of the plurality of co-processing units does not meet the requirements. In response to determining that the difference between the execution result to be tested and the simulation execution result is less than or equal to the preset difference threshold, determining the test result to be a second test result. The second test result is used to indicate that the accuracy of the plurality of co-processing units meets the requirements.
[0095] It can be understood that the apparatus of the present disclosure is described above, and the device of the present disclosure will be described below.
[0096] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present disclosure.
[0097] like Figure 5 As shown, the device 5000 may include a testing apparatus 500. The testing apparatus 500 may be the apparatus 400 described above.
[0098] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0099] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0100] Figure 6A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0101] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 to a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0102] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0103] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the test method. For example, in some embodiments, the test method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the test method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the testing method in any other appropriate manner (eg, by means of firmware).
[0104] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), system on chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0105] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0106] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories (EPROM) or flash memories, optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0107] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) display or a liquid crystal display (LCD)) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0108] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a Local Area Network (LAN), a Wide Area Network (WAN), and the Internet.
[0109] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0110] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0111] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A testing method comprising: Determine at least one synchronization task according to the initial task execution sequence information and the respective address spaces of the plurality of co-processing units, wherein the initial task execution sequence information is used to indicate the sequence of executing the respective initial tasks of the plurality of co-processing units, and the synchronization task is used to indicate a target co-processing unit in at least two co-processing units with overlapping address spaces to execute the initial task; Utilizing the plurality of co-processing units to execute at least one task to be executed of each of the plurality of co-processing units to obtain an execution result to be tested, wherein the at least one task to be executed of the co-processing unit includes at least one of the initial task and the synchronization task; A test result is determined according to the execution result to be tested and the simulation execution results of the plurality of tasks to be executed.
2. The method according to claim 1, wherein: The initial task execution order information is further used to indicate respective levels of the plurality of co-processing units, wherein the plurality of co-processing units include at least two associated co-processing units of different levels, and address spaces between at least two of the associated co-processing units overlap.
3. The method according to claim 2, wherein: The plurality of tiers include at least two of a producer tier, a pre-processor tier, a processor tier, and a consumer tier.
4. The method according to claim 1, wherein: Determining at least one synchronization task according to the initial task execution order information and the respective address spaces of the plurality of co-processing units comprises: In response to determining that there is overlap between address spaces of at least two of the co-processing units, determining a target co-processing unit and a preceding co-processing unit of the target co-processing unit from the at least two co-processing units according to the initial task execution order information; and The synchronization task between the preceding co-processing unit and the target co-processing unit is determined, wherein the synchronization task is performed by the preceding co-processing unit.
5. The method according to claim 4, wherein: The using the plurality of co-processing units to execute at least one task to be executed by each of the plurality of co-processing units to obtain the execution result to be tested comprises: Utilizing the previous co-processing unit to execute the initial task, and obtaining an execution result of the previous co-processing unit; In response to determining that the previous co-processing unit has executed the initial task, the synchronization task is executed by using the previous co-processing unit to obtain a synchronization signal, and the synchronization signal is provided to the target co-processing unit.
6. The method according to claim 5, wherein: The using the plurality of co-processing units to execute at least one task to be executed by each of the plurality of co-processing units to obtain the execution result to be tested further comprises: In response to receiving a synchronization signal provided by a previous co-processing unit, the target co-processing unit is used to execute the initial task according to the execution result of the previous co-processing unit.
7. The method according to claim 1, wherein: Determining at least one synchronization task according to the initial task execution order information and the respective address spaces of the plurality of co-processing units comprises: In response to determining that the synchronization task exists between a preceding coprocessing unit of the target coprocessing unit and the target coprocessing unit, the synchronization task exists between the target coprocessing unit and a succeeding coprocessing unit of the target coprocessing unit, and the synchronization task exists between the preceding coprocessing unit and the succeeding coprocessing unit, the synchronization task between the preceding coprocessing unit and the succeeding coprocessing unit is deleted.
8. The method according to claim 1, wherein: Determining the test result according to the execution result to be tested and the simulation execution results of the plurality of tasks to be executed includes: In response to determining that the difference between the execution result to be tested and the simulation execution result is greater than a preset difference threshold, determining that the test result is a first test result, the first test result is used to indicate that the accuracy of the plurality of co-processing units does not meet the requirement; In response to determining that the difference between the execution result to be tested and the simulation execution result is less than or equal to the preset difference threshold, the test result is determined to be a second test result, and the second test result is used to indicate that the accuracy of the plurality of co-processing units meets the requirements.
9. A testing device comprising: A plurality of control units, wherein the control unit is configured to: generate at least one instruction to be executed corresponding to at least one task to be executed, wherein the at least one task to be executed includes at least one of an initial task and a synchronization task, wherein the synchronization task is determined according to initial task execution sequence information and respective address spaces of a plurality of co-processing units, wherein the initial task execution sequence information is used to indicate the sequence of executing respective initial tasks of the plurality of co-processing units, and the synchronization task is used to indicate a target co-processing unit of at least two co-processing units having overlapping address spaces to execute the initial task; A plurality of co-processing units, configured to execute at least one to-be-executed instruction of each of the plurality of co-processing units to obtain an execution result to be tested; The multiple control units are further configured to determine the test results according to the execution results to be tested and the simulation execution results of the multiple tasks to be executed.
10. The device according to claim 9, wherein: The initial task execution order information is further used to indicate respective levels of the plurality of co-processing units, wherein the plurality of co-processing units include at least two associated co-processing units of different levels, and address spaces between at least two of the associated co-processing units overlap.
11. The device according to claim 10, wherein: The plurality of tiers include at least two of a producer tier, a pre-processor tier, a processor tier, and a consumer tier.
12. The device according to claim 9, wherein: The synchronization task is determined by determining at least one synchronization task according to the initial task execution order information and the respective address spaces of the plurality of co-processing units through the following operations: In response to determining that there is overlap between the address spaces of at least two of the co-processing units, determining a target co-processing unit and a preceding co-processing unit of the target co-processing unit from the at least two co-processing units according to the initial task execution order information; as well as The synchronization task between the preceding co-processing unit and the target co-processing unit is determined, wherein the synchronization task is performed by the preceding co-processing unit.
13. The device according to claim 12, wherein: The previous co-processing unit is further configured as: Executing the initial task to obtain the execution result of the previous co-processing unit; In response to determining that the initial task has been executed, the synchronization task is executed, a synchronization signal is obtained, and the synchronization signal is provided to the target co-processing unit.
14. The device according to claim 13, wherein: The target co-processing unit is further configured as: In response to receiving a synchronization signal provided by a previous co-processing unit, the initial task of the target co-processing unit is executed according to the execution result of the previous co-processing unit.
15. The device according to claim 9, wherein: The synchronization task is also determined by the following operation, according to the initial task execution order information and the respective address spaces of the plurality of co-processing units, to determine at least one synchronization task: In response to determining that the synchronization task exists between a preceding coprocessing unit of the target coprocessing unit and the target coprocessing unit, the synchronization task exists between the target coprocessing unit and a succeeding coprocessing unit of the target coprocessing unit, and the synchronization task exists between the preceding coprocessing unit and the succeeding coprocessing unit, the synchronization task between the preceding coprocessing unit and the succeeding coprocessing unit is deleted.
16. The device according to claim 9, wherein: The plurality of control units are further configured to perform the following operations to determine a test result according to the execution result to be tested and the simulation execution results of the plurality of tasks to be executed: In response to determining that the difference between the execution result to be tested and the simulation execution result is greater than a preset difference threshold, determining that the test result is a first test result, the first test result is used to indicate that the accuracy of the plurality of co-processing units does not meet the requirement; In response to determining that the difference between the execution result to be tested and the simulation execution result is less than or equal to the preset difference threshold, the test result is determined to be a second test result, and the second test result is used to indicate that the accuracy of the plurality of co-processing units meets the requirements.
17. An electronic device comprising the device according to any one of claims 9 to 16.
18. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.
19. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 9.
20. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.
