A test method and related products
By obtaining the device information of the target chip and configuring the running environment of the cloud processor, it solves the problem of debugging and testing the artificial intelligence chip in the pre-silicon state, realizes early debugging and multi-environment simulation of the chip, simplifies the development process, and improves Improve development efficiency.
Patent Information
- Application Number
- CN201910315961.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-04-18
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2039-11-04
AI Technical Summary
In the existing technology, artificial intelligence chips cannot be debugged and tested before being tape-out, which requires algorithm developers to spend dedicated time adapting, prolonging the product launch period, and making it difficult to simulate multiple types of processors on the same model. Test environment.
By obtaining the device information of the target chip, determine the test environment, and send it to the cloud device to configure the cloud processor's operating environment to be consistent with the target chip, thereby realizing chip debugging and testing.
It realizes early debugging and testing of artificial intelligence chips without tape-out, simplifies the matching process between algorithm models and chips, shortens development time, and simulates multiple chip environments on the same cloud device, improving the reliability of the system. Portability and computational efficiency.
Smart Images

Figure CN111831539B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a testing method and related products. Background Art
[0002] In traditional technology, only after the AI chip is successfully taped out can algorithm application developers develop and test it on the corresponding version of the AI processor (hardware entity).
[0003] From the above description, we can know that in traditional technology, the same type of artificial intelligence processor can only realize the debugging and testing process of specific processing tasks in a specific operating environment. The specific operating environment of the artificial intelligence processor is determined by its hardware architecture information. Therefore, how to simulate multiple types of test environments based on the same artificial intelligence processor is a hot research issue for technicians in this field. Summary of the invention
[0004] An embodiment of the present application provides a testing method that can simulate multiple different types of test environments on a server board, and implement the debugging and testing process of an artificial intelligence chip based on the determined test environment.
[0005] In a first aspect, an embodiment of the present application provides a testing method, the method comprising:
[0006] Acquire first device information of a target chip;
[0007] Determine a first test environment according to first device information of the target chip;
[0008] The first test environment is sent to a cloud device to configure the current operating environment parameters of the artificial intelligence processor in the cloud device so that the current operating environment parameters of the artificial intelligence processor are consistent with the first device information of the target chip.
[0009] In implementing the embodiments of the present application, the processor configures different test environments through different device information, and sends the test environment to the cloud device, so that the cloud device sets the current operating environment parameters of the artificial intelligence processor in the cloud device according to the acquired test environment, and implements the debugging and testing process of the target chip based on the determined test environment.
[0010] In one possible implementation manner, the first device information includes chip operating environment parameters of the target chip; the chip operating environment parameters include an operating main frequency and a memory access bandwidth of the target chip.
[0011] In one possible implementation manner, determining a first test environment according to first device information of the target chip, and sending the first test environment to a cloud device further includes:
[0012] Determine at least one first register value and at least one second register value according to the chip operating environment parameter;
[0013] Send the value of the at least one first register and the value of the at least one second register to the cloud device.
[0014] In one possible implementation manner, the first device information further includes hardware architecture information of the target chip; and determining the first test environment according to the first device information of the target chip and sending the first test environment to the cloud device further includes:
[0015] The hardware architecture information of the target chip is transmitted to the artificial intelligence processor of the cloud device.
[0016] In one possible implementation, the method further includes:
[0017] Receiving a first test result obtained when the artificial intelligence processor processes a preset task under the current operating environment parameters; wherein the first test result is used to indicate the processing performance of the artificial intelligence processor in processing the preset task;
[0018] If the first test result does not meet the preset condition, the first device information of the target chip is reacquired.
[0019] In one possible implementation manner, the first test result includes at least one of a running time of the target chip for processing the preset task and a power consumption of the target chip for processing the preset task.
[0020] In one possible implementation, the first test environment includes a main frequency of the target chip, a memory access bandwidth of the target chip, and a computing capability of the target chip;
[0021] The operating main frequency of the target chip is less than or equal to the actual main frequency of the artificial intelligence processor;
[0022] The memory access bandwidth of the target chip is less than or equal to the actual memory access bandwidth of the artificial intelligence processor;
[0023] The computing power of the target chip is less than or equal to the actual computing power of the artificial intelligence processor.
[0024] In a second aspect, an embodiment of the present application provides a testing method, which is applied to a testing system, wherein the testing system includes a processor and a cloud device; the method includes:
[0025] The processor acquires first device information of the target chip;
[0026] The processor determines a first test environment according to first device information of the target chip;
[0027] The processor sends the first test environment to the cloud device to determine the current operating environment parameters of the artificial intelligence processor in the cloud device;
[0028] The cloud device sets the current operating environment parameters of the artificial intelligence processor according to the first test environment, so that the current operating environment parameters of the artificial intelligence processor are consistent with the first device information of the target chip.
[0029] In implementing the embodiments of the present application, the processor configures different test environments through different device information, and sends the test environment to the cloud device, so that the cloud device sets the current operating environment parameters of the artificial intelligence processor in the cloud device according to the acquired test environment, and implements the debugging and testing process of the target chip based on the determined test environment.
[0030] In one possible implementation manner, the first device information includes chip operating environment parameters of the target chip; the chip operating environment parameters include an operating main frequency and a memory access bandwidth of the target chip.
[0031] In one possible implementation manner, the processor determines the first test environment according to the first device information of the target chip, further comprising:
[0032] Determine at least one first register value and at least one second register value according to the chip operating environment parameter;
[0033] Send the value of the at least one first register and the value of the at least one second register to the cloud device.
[0034] In one possible implementation, the cloud device sets the current operating environment parameters of the artificial intelligence processor according to the first test environment, further comprising:
[0035] The MCU of the cloud device sets the current operating environment of the artificial intelligence processor according to the acquired value of at least one first register and the acquired value of at least one second register.
[0036] In one possible implementation, the method further includes:
[0037] The artificial intelligence processor processes the preset task under the current operating environment parameters;
[0038] The processor receives a first test result when the artificial intelligence processor processes the preset task under the current operating environment; wherein the first test result is used to indicate the processing performance of the artificial intelligence processor in processing the preset task;
[0039] If the first test result does not meet a preset condition, the processor re-acquires the first device information of the target chip.
[0040] In one possible implementation, the test system further includes a hardware monitoring tool for monitoring the current operating environment of the artificial intelligence processor; and the method further includes:
[0041] The hardware monitoring tool obtains the first test result and transmits the first test result to the processor.
[0042] In a third aspect, an embodiment of the present application provides a testing device, and also a unit for executing the method of the first aspect. Specifically, the testing device is applied to a processor unit; wherein,
[0043] The processor unit is used to obtain first device information of the target chip;
[0044] The processor unit is further configured to determine a first test environment according to first device information of the target chip;
[0045] The processor unit is also used to send the first test environment to the cloud device to configure the current operating environment parameters of the artificial intelligence processor in the cloud device so that the current operating environment parameters of the artificial intelligence processor are consistent with the first device information of the target chip.
[0046] In one possible implementation manner, the first device information includes chip operating environment parameters of the target chip; the chip operating environment parameters include an operating main frequency and a memory access bandwidth of the target chip.
[0047] In one possible implementation manner, the processor unit is further configured to determine a first test environment according to the first device information of the target chip, and send the first test environment to a cloud device, further comprising:
[0048] The processor unit is further used to determine the value of at least one first register and the value of at least one second register according to the chip operating environment parameters;
[0049] The processor unit is further used to send the value of the at least one first register and the value of the at least one second register to the cloud device.
[0050] In one possible implementation, the first device information further includes hardware architecture information of the target chip; the processor unit is further configured to determine a first test environment according to the first device information of the target chip, and send the first test environment to a cloud device, further comprising:
[0051] The processor unit is also used to transmit the hardware architecture information of the target chip to the artificial intelligence processor of the cloud device.
[0052] In one possible implementation manner, the processor unit may further include:
[0053] The processor unit is further used to receive a first test result obtained when the artificial intelligence processor processes a preset task under the current operating environment parameters; wherein the first test result is used to indicate the processing performance of the artificial intelligence processor in processing the preset task;
[0054] If the first test result does not meet a preset condition, the processor unit reacquires the first device information of the target chip.
[0055] In one possible implementation manner, the first test result includes at least one of a running time of the target chip for processing the preset task and a power consumption of the target chip for processing the preset task.
[0056] In one possible implementation, the first test environment includes the frequency of the target chip, the memory access bandwidth of the target chip, and the computing power of the target chip;
[0057] The operating main frequency of the target chip is less than or equal to the actual main frequency of the artificial intelligence processor;
[0058] The memory access bandwidth of the target chip is less than or equal to the actual memory access bandwidth of the artificial intelligence processor.
[0059] In a fourth aspect, an embodiment of the present application provides a test device, which includes a method and a unit for executing the second aspect. Specifically, the test device is applied to a test system, and the test system includes a processor unit and a cloud device; wherein,
[0060] The processor unit is used to obtain first device information of the target chip;
[0061] The processor unit is further configured to determine a first test environment according to first device information of the target chip;
[0062] The processor unit is further used to send the first test environment to the cloud device to determine the current operating environment parameters of the artificial intelligence processor in the cloud device;
[0063] The cloud device is used to set the current operating environment parameters of the artificial intelligence processor according to the first test environment, so that the current operating environment parameters of the artificial intelligence processor are consistent with the first device information of the target chip.
[0064] In one possible implementation manner, the first device information includes chip operating environment parameters of the target chip; the chip operating environment parameters include an operating main frequency and a memory access bandwidth of the target chip.
[0065] In one possible implementation manner, the processor unit is further configured to determine a first test environment according to first device information of the target chip, and further includes:
[0066] The processor unit is further used to determine the value of at least one first register and the value of at least one second register according to the chip operating environment parameters;
[0067] The processor unit is further used to send the value of the at least one first register and the value of the at least one second register to the cloud device.
[0068] In one possible implementation, the cloud device is used to set the current operating environment parameters of the artificial intelligence processor according to the first test environment, and further includes:
[0069] The cloud device, the MCU used for the cloud device sets the current operating environment of the artificial intelligence processor according to the acquired value of at least one first register and the acquired value of at least one second register.
[0070] In one possible implementation, the device further includes:
[0071] The cloud device is also used for the artificial intelligence processor in the cloud device to process preset tasks under the current operating environment parameters;
[0072] The processor unit is further used to receive a first test result obtained when the artificial intelligence processor processes the preset task under the current operating environment; wherein the first test result is used to indicate the processing performance of the artificial intelligence processor in processing the preset task;
[0073] The processor unit is further configured to reacquire the first device information of the target chip when the first test result does not meet a preset condition.
[0074] In one possible implementation, the test system further includes a hardware monitoring tool for monitoring the current operating environment of the artificial intelligence processor; the device further includes:
[0075] The hardware monitoring tool obtains the first test result and transmits the first test result to the processor.
[0076] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method of the first aspect or the second aspect mentioned above.
[0077] In a sixth aspect, an embodiment of the present application further provides a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method of the first aspect or the second aspect mentioned above. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments.
[0079] Figure 1 This is a system architecture diagram of an artificial intelligence software development platform provided in an embodiment of the present application;
[0080] Figure 2 It is a schematic diagram of an application scenario of a testing method provided in an embodiment of the present application;
[0081] Figure 3 This is a schematic diagram of an application scenario of a testing method provided by another embodiment of the present application;
[0082] Figure 4 It is a flow chart of a testing method provided in an embodiment of the present application;
[0083] Figure 5A It is a schematic diagram of a process of configuring a frequency value, a memory access bandwidth value, and a computing capability mode value of a hardware device provided in an embodiment of the present application;
[0084] Figure 5B This is a schematic diagram of a process for configuring power consumption values of a hardware device provided in an embodiment of the present application;
[0085] Figure 5C It is a flow chart of another testing method provided in an embodiment of the present application;
[0086] Figure 6 It is a structural diagram of a cloud device provided in an embodiment of the present application;
[0087] Figure 7 is a schematic diagram of the structure of another cloud device provided in an embodiment of the present application;
[0088] Figure 8 is a structural diagram of another cloud device provided in an embodiment of the present application;
[0089] Fig. 9 is a structural schematic diagram of a computer device provided in an embodiment of the present application;
[0090] Fig.10 is a structural schematic diagram of another computer device provided in an embodiment of the present application;
[0091] Fig.11 It is a structural schematic diagram of a test system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0092] 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.
[0093] In order to better understand the present technical solution, the technical terms involved in the embodiments of the present application are explained below:
[0094] Tapeout: In the field of integrated circuit design, tapeout refers to trial production, that is, after designing an integrated circuit that meets the preset functions, a few or dozens of pieces are produced for testing. If the test requirements are met, large-scale production is carried out according to the structure of the integrated circuit that currently meets the test requirements.
[0095] Binary instructions: information that can be recognized by the underlying artificial intelligence processor.
[0096] Artificial intelligence processor: also known as a dedicated processor, a processor for a specific application or field. For example: Graphics Processing Unit (GPU), also known as display core, visual processor, display chip, is a dedicated processor for image computing on personal computers, workstations, game consoles and some mobile devices (such as tablets, smartphones, etc.). Another example: Neural Processing Unit (NPU), is a dedicated processor for matrix multiplication operations in the field of artificial intelligence. It adopts the "data-driven parallel computing" architecture and is particularly good at processing massive multimedia data such as videos and images.
[0097] Reconfigurable architecture: If an artificial intelligence processor can utilize reusable hardware resources and flexibly change its own architecture according to different application requirements, so as to provide an architecture that matches each specific application requirement, then this artificial intelligence processor is called a reconfigurable computing system, and its architecture is called a reconfigurable architecture.
[0098] First, the main inventive concept of this application is introduced.
[0099] In the prior art, algorithm application developers can only complete the adaptation and debugging work between the AI algorithm model and the AI processor on the corresponding version of the hardware entity. It is understandable that the implementation scheme of the prior art cannot realize the debugging process between the chip and the algorithm that has not been taped out, so it takes special time to complete the adaptation work between the algorithm model and the chip, so the deadline for the product to be put on the market will be delayed, and it is easy to miss the opportunity to occupy the market due to time issues.
[0100] Based on this, the present application proposes a technical solution. Regardless of whether the artificial intelligence processor is tape-out, according to the device information of the artificial intelligence processor on the end side, a suitable artificial intelligence processor is matched from the cloud device to simulate the artificial intelligence processor on the end side, wherein the artificial intelligence processor contained in the cloud device can be an artificial intelligence processor hardware entity. Specifically, the user can input the device information of the artificial intelligence processor on the end side through an artificial intelligence software development platform, and the software development platform can convert the device information into a test environment for the artificial intelligence processor in the cloud device, and send the test environment to the cloud device. Afterwards, the cloud device can configure the operating environment parameters of the artificial intelligence processor therein through the hardware circuit of the cloud device according to the test environment it receives, so that the current operating environment parameters of the artificial intelligence processor in the cloud device are consistent with the device information of the artificial intelligence processor on the end side, and then the operation process of the artificial intelligence processor on the end side can be simulated on the artificial intelligence processor of the cloud device. It should be clear that in the embodiment of the present application, the current operating environment parameters of the artificial intelligence processor of the cloud device can be the same as its actual operating environment parameters, or different from its actual operating parameters. Furthermore, it is also possible to determine whether the device information of the artificial intelligence processor on the end side meets the expected conditions based on the test results of the artificial intelligence processor of the cloud device for a specific processing task. When the device information of the artificial intelligence processor on the end side does not meet the expected conditions, the device information of the artificial intelligence processor on the end side can be further adjusted until the device information of the artificial intelligence processor on the end side meets the expected conditions.
[0101] That is to say, in the embodiment of the present application, by adjusting the operating environment parameters of the cloud device, the same artificial intelligence processor in the cloud device can simulate multiple different artificial intelligence processors on the end side, so that even if the artificial intelligence processor on the end side is in a non-taped-out state, it is possible to debug the device information of the non-taped-out artificial intelligence processor, and match and debug the algorithm model with the non-taped-out artificial intelligence processor.
[0102] In the prior art, developers can only develop and test on the corresponding version of the AI processor (hardware entity) after the AI chip is successfully taped out. Based on the current state of the art, technicians in this field would not think of simulating multiple different AI processors on the same AI processor.
[0103] Further optionally, the software development platform processes the algorithm model provided by the customer in a series of processes to obtain a corresponding machine learning task, which is run on the artificial intelligence processor on the cloud side to obtain an operation result. The embodiment of the present application can adjust the machine learning task on the software development platform according to the operation result to achieve adaptation between the artificial intelligence processor on the terminal side and the algorithm model.
[0104] Based on this, an embodiment of the present application provides a testing method, whereby the user sets up the test environment required for different types of chips on the artificial intelligence software development platform, thereby further realizing the debugging and testing process for multiple end-side artificial intelligence chips on the same cloud device (such as a board).
[0105] See also Figure 1 As shown in FIG. 1 , it is a system architecture diagram of an artificial intelligence software development platform provided in an embodiment of the present application. Figure 1 As shown, the system architecture may include: a cloud device 101, an artificial intelligence software development platform 102, and a terminal device 103, wherein the terminal device may be a terminal device such as a mobile phone, or an edge device such as a camera.
[0106] Among them, the artificial intelligence software development platform 102 provides a series of toolkits for application development, performance tuning, function debugging, etc. Among them, the application development tools include machine learning libraries, runtime libraries, compilers, and software development tools for specific fields (such as video analysis). Among them, the machine learning library is used to provide various machine learning operators, and the runtime library is used for memory management and operation management of artificial intelligence chips, etc. The compiler in the embodiment of the present application may include a traditional compiler of C++ language, and may also include a machine learning compiler based on a C-like language, or a machine learning compiler based on other high-level languages or specially designed domain-specific programming languages (Domain Specific Language). Optionally, the software development platform can run on a cloud device or on a local (host) computer device, and the local computer device may include a general-purpose processor (such as a CPU) and a display, etc., which are not specifically limited here. Further optionally, the above-mentioned artificial intelligence software development platform can run on a local computer device or a cloud device in the form of a client, and the embodiment of the present application is not specifically limited.
[0107] Optionally, the cloud-side device 101 is a complete computer system, and the cloud-side device 101 may include a server board, and the server board may include at least one artificial intelligence processor, and the artificial intelligence processor may be a processor based on a non-reconfigurable architecture or a processor based on a reconfigurable architecture. Further optionally, the server board may also include a general-purpose processor such as a CPU, a processor such as an FPGA, and the like.
[0108] In a specific implementation, the terminal device can be a device that has not been taped out, or a device that has been taped out. Optionally, the terminal device can be an artificial intelligence processor, and the terminal device 103 is used to deploy offline operation files and target chips that have been successfully taped out. Optionally, the offline operation file is obtained by solidifying the corresponding binary instructions when the operation result of the artificial intelligence processor in the cloud device meets the set conditions during the processing of the preset task. The offline operation file generated based on the cloud device 101 can be migrated and deployed in the terminal device 103 involved in the embodiment of the present application, so that the seamless migration of offline operation files can be achieved. In the embodiment of the present application, in order to realize that the offline operation file can be run on the artificial intelligence processor of the cloud device or on the terminal device, and the operation result generated when the machine learning task is executed on the artificial intelligence processor of the cloud device is completely consistent with the operation result generated when it is executed on the terminal device or within a certain allowable error range, in this technical solution, the hardware architecture information of the artificial intelligence processor of the cloud device is compatible with the hardware architecture information of the terminal device, and the instruction set of the artificial intelligence processor of the cloud device is compatible with the instruction set of the terminal device, so that the seamless migration of offline operation files can be achieved. In this way, the portability of the offline running file can be improved, thereby improving the computing power and efficiency of the system architecture. At the same time, programmers do not need to program and debug the terminal device and the cloud device separately, which simplifies the programming process.
[0109] Further optionally, when there are multiple artificial intelligence processors with different architectures in the cloud device, the software development platform can select an artificial intelligence processor that is compatible with its hardware architecture information from the multiple artificial intelligence processors of the cloud device based on the device information of the target chip, and then send the first test environment determined according to the device information of the target chip to the cloud device to configure the current operating environment parameters of the selected artificial intelligence processor in the cloud device.
[0110] In order to facilitate a better understanding of a testing method provided in an embodiment of the present application, the application scenarios to which the method described in the embodiment of the present application can be applied are first described below.
[0111] In one possible implementation, Figure 2 The application scenario schematic diagram of the test method provided in the embodiment of the present application shown may include a cloud device and an artificial intelligence software development client. Specifically, the cloud device may include a processor and at least one artificial intelligence processor. In an embodiment of the present application, the artificial intelligence processor may include 8 clusters, each cluster including 4 artificial intelligence processor cores. Further optionally, an artificial intelligence software development client is running on the cloud device.
[0112] In a specific implementation, the processor on the cloud device obtains the first device information of the target chip, where the first device information includes the chip operating environment parameters of the target chip (for example, the chip operating environment parameters include the main operating frequency of the target chip and the memory access bandwidth of the target chip). Afterwards, the processor determines the first test environment based on the first device information of the target chip, where the first test environment includes the main frequency of the target chip, the memory access bandwidth of the target chip, and the computing power of the target chip. Among them, the memory access bandwidth of the target chip can be the memory access bandwidth value of each cluster, or it can be the memory access bandwidth of each artificial intelligence processor core.
[0113] After the software development platform 102 determines the first test environment, it sends it to the cloud device. In this case, the cloud device can set the current operating environment parameters of the artificial intelligence processor on it to be consistent with the first device information of the target chip, so that the artificial intelligence processor processes the preset task under the current operating environment parameters. When the artificial intelligence processor processes the preset task, the test result of the artificial intelligence processor under the current operating environment parameters is monitored by the hardware monitoring program, and the test result is used to indicate the processing performance of the artificial intelligence processor in processing the preset task.
[0114] It should be noted that in actual applications, the process of an artificial intelligence processor processing a preset task, in essence, refers to: running binary instructions adapted to the preset task, and obtaining the running results corresponding to the above binary instructions. Here, the running results include the accuracy of the target chip in processing the preset task, etc. When the running results meet the set conditions (for example, the accuracy of the target chip in processing the preset task meets the set threshold), the binary instructions can be solidified, so that the solidified offline running file can be obtained. In a specific implementation, the offline running file can be run on the end-side device to be deployed. From the above implementation process, it can be seen that by setting the chip operating environment parameters of the artificial intelligence processor in the cloud device to be equal to the operating environment parameters of the target chip, the early debugging and testing process of the target chip can be implemented based on the artificial intelligence processing chip.
[0115] It should be noted that in the embodiment of the present application, the computing power of the artificial intelligence processor in the cloud device is greater than or equal to the computing power of the target chip, and the operating environment parameter range of the artificial intelligence processor can cover the operating environment parameters of the target chip (for example, the operating main frequency of the target chip is less than or equal to the actual main frequency of the artificial intelligence processor; the memory access bandwidth of the target chip is less than or equal to the actual memory access bandwidth of the artificial intelligence processor). In other words, the hardware architecture information of the artificial intelligence processor of the cloud device is compatible with the hardware architecture information of the end-side device, so that the test environment of multiple un-taped target chips can be simulated on the same artificial intelligence processor, and then the early debugging and testing process of the target chip can be realized based on the determined test environment.
[0116] In another possible implementation, Figure 3 The schematic diagram of an application scenario of another testing method provided by an embodiment of the present application may include a terminal device, a cloud device, and an artificial intelligence software development client.
[0117] In a specific implementation, the artificial intelligence software client runs on a local computer device. As mentioned above, the local computer device may include a general-purpose processor (such as a CPU) and a display, etc. User 1 logs in to the artificial intelligence software development client through a first account. After user 1 successfully logs in to the artificial intelligence software development client, the first device information of the target chip is obtained through the processor in the local computer device. As mentioned above, the first device information includes the chip operating environment parameters of the target chip (for example, the chip operating environment parameters include the main operating frequency and memory access bandwidth of the target chip). Afterwards, the processor in the local computer device determines the first test environment according to the first device information of the target chip. Here, the first test environment includes the main frequency of the target chip, the memory access bandwidth of the target chip, and the computing power of the target chip. After determining the first test environment, the local computer device can send the first test environment to the cloud device. In this case, the cloud device can set the current operating environment parameters of the artificial intelligence processor on the cloud device to be consistent with the first device information of the target chip, so that the artificial intelligence processor processes the preset task under the current operating environment parameters. When the artificial intelligence processor processes the preset task, the test results of the artificial intelligence processor under the current operating environment parameters are monitored by the hardware monitoring program, and the test results are used to indicate the processing performance of the artificial intelligence processor in processing the preset task.
[0118] It should be noted that in actual applications, the process of an artificial intelligence processor processing a preset task, in essence, refers to: running binary instructions adapted to the preset task, and obtaining the running results corresponding to the above binary instructions. Here, the running results include the accuracy of the target chip in processing the preset task, etc. When the running results meet the set conditions (for example, the accuracy of the target chip in processing the preset task meets the set threshold), the binary instructions can be solidified, so that the solidified offline running file can be obtained. In a specific implementation, the offline running file can be run on the end-side device to be deployed. From the above implementation process, it can be seen that by setting the chip operating environment parameters of the artificial intelligence processor in the cloud device to be equal to the operating environment parameters of the target chip, the early debugging and testing process of the target chip can be implemented based on the artificial intelligence processing chip.
[0119] It should be noted that in the embodiment of the present application, the hardware architecture information of the artificial intelligence processor in the cloud device (for example, the hardware architecture information includes version information and model information, wherein the model information can characterize the computing power of the artificial intelligence processor) is greater than or equal to the computing power of the target chip, and the operating environment parameter range of the artificial intelligence processor can cover the operating environment parameters of the target chip (for example, the operating main frequency of the target chip is less than or equal to the actual main frequency of the artificial intelligence processor; the memory access bandwidth of the target chip is less than or equal to the actual memory access bandwidth of the artificial intelligence processor). In other words, the hardware architecture information of the artificial intelligence processor of the cloud device can be compatible with the artificial intelligence processor of the terminal device, so that it is possible to simulate the test environment of multiple different models of target chips on the same artificial intelligence processor, and then realize the early debugging and testing process of the terminal artificial intelligence chip based on the determined test environment.
[0120] Based on the above application scenarios, the following Figure 4 The flowchart of a test method provided in the embodiment of the present application is shown, which specifically describes how to implement the early debugging and testing process for the target chip in the embodiment of the present application, and may include but is not limited to the following steps:
[0121] Step S400: The processor obtains first device information of the target chip;
[0122] In a specific implementation, the target chip can be a chip that has not been taped out, or a chip that has been taped out. The processor can be a processor of a cloud device, or a processor of a local computer device.
[0123] Specifically, the first device information of the target chip may include the hardware architecture information of the target chip and the chip operating environment parameters. For example, the hardware architecture information of the target chip may include the version of the target chip and the model information of the target chip (in practical applications, the model information of the target chip can characterize the computing power of the target chip). The operating environment parameters of the target chip may include the operating main frequency and memory access bandwidth of the target chip. Here, the operating main frequency of the target chip refers to the number of pulses emitted by the chip per unit time. Specifically, a pulse is a special voltage or current change. In practical applications, the operating main frequency of the chip is used to measure the processing speed of the chip. For example, the higher the main frequency of the chip, the faster its computing speed. Memory access bandwidth refers to the storage bandwidth between the external dynamic random access memory DRAM and the chip.
[0124] Step S402: The processor determines a first test environment according to first device information of the target chip.
[0125] Specifically, in an embodiment of the present application, there is a one-to-one correspondence between the first device information and the first test environment. As described above, the first device information includes the hardware architecture information of the target chip, the main operating frequency of the target chip, and the memory access bandwidth. In the first test environment determined by the processor based on the first device information, the first test environment includes the main frequency of the target chip, the memory access bandwidth of the target chip, and the computing power of the target chip.
[0126] In one possible implementation manner, determining the first test environment according to the first device information of the target chip includes:
[0127] According to the correspondence between the preset device information and the test environment, a first test environment corresponding to the first device information of the target chip is determined.
[0128] Specifically, the processor can determine different test environments according to the device information of different target chips, that is, there is a one-to-one correspondence between the device information and the test environment. For example, the correspondence between the device information and the test environment may include but is not limited to that shown in Table 1:
[0129] Table 1 Correspondence between device information and test environment
[0130] Device Information Test environment Device Information 1 Test environment 1 Device Information 2 Test environment 2 Device Information 3 Test environment 3
[0131] As shown in Table 1, the processor determines the test environment as test environment 1 according to device information 1; the processor determines the test environment as test environment 2 according to device information 2; and the processor determines the test environment as test environment 3 according to device information 3.
[0132] In one possible implementation, the first test environment determined by the processor according to the first device information is the same as the actual environment of the artificial intelligence processor in the cloud device. For example, the first test environment determined according to the first device information is: the computing power of the target chip is the first computing power, the operating main frequency of the target chip is 1GHz, and the memory access bandwidth of the target chip is 32GB / s. The actual environment of the artificial intelligence processor in the cloud device is: the computing power is the first computing power, the operating main frequency is 1GHz, and the memory access bandwidth is 32GB / s. In this case, the artificial intelligence processor in the cloud device can simulate the test environment of the target chip based on its own original actual environment.
[0133] In one possible implementation, the first test environment determined by the processor according to the first device information is different from the actual environment of the artificial intelligence processor in the cloud device. For example, the first test environment determined according to the first device information is: the computing power of the target chip is the second computing power (the second computing power may be less than or equal to the actual computing power of the artificial intelligence processor of the cloud device), the operating main frequency of the target chip is 500Hz, and the memory access bandwidth of the target chip is 32GB / s. The actual environment of the artificial intelligence processor in the cloud device is: the computing power of the artificial intelligence processor is the first computing power, the operating main frequency is 1GHz, and the memory access bandwidth is 32GB / s. In this case, the cloud device can adjust the actual environment of the artificial intelligence processor on it to be consistent with the above test environment, so as to simulate the test environment of the target chip.
[0134] In one possible implementation manner, determining the first test environment according to the first device information of the target chip further includes:
[0135] Receive input configuration file;
[0136] A first test environment corresponding to the first device information of the target chip is determined according to the configuration file.
[0137] For example, the input configuration file could look like this:
[0138] / proc / driver / cambricon / mlus / (bdf number) / config
[0139] enable 1
[0140] freq 500cluster 8bandwidth 32 32 32 32 32 32 32 32capability 1H8 (here, 1H8 can represent computing power)
[0141] enable 0
[0142] Here, the bdf number, i.e., identification information, is used to distinguish different multi-card environments.
[0143] enable is the enable flag, 1 means enable, 0 means disable.
[0144] The test environment corresponding to the first device information of the target chip determined according to the above configuration file is: the frequency of the target chip is 500 Hz, the memory access bandwidth of 8 clusters of the target chip is 30 GB / s, and the computing capability of the target chip is the first computing capability.
[0145] Step S404: The processor sends the first test environment to the cloud device to determine the current operating environment parameters of the artificial intelligence processor in the cloud device.
[0146] Optionally, the determining a first test environment according to the first device information of the target chip, and sending the first test environment to a cloud device, further includes:
[0147] Determining at least one first register value and at least one second register value according to a chip operating environment parameter of the target chip;
[0148] Send the value of the at least one first register and the value of the at least one second register to the cloud device.
[0149] For example, in an embodiment of the present application, the first register is used to record and store the frequency value, and the second register is used to record and store the memory access bandwidth value. Specifically, the number of the first register and the number of the second register are at least one, for example, the number of the first register is 1, and the number of the second register can be equal to the number of clusters in the artificial intelligence processor, specifically 8. The processor corresponding to the software development platform can determine the value of the first register and the values of each second register based on the chip operating environment parameters of the target chip it obtains.
[0150] Step S406: The cloud device receives the first test environment, and sets the current operating environment parameters of the artificial intelligence processor of the cloud device according to the first test environment, so that the current operating environment parameters of the artificial intelligence processor are consistent with the first device information of the target chip.
[0151] Specifically, after receiving the first test environment, the cloud device sets the current operating environment parameters of the artificial intelligence processor therein to be equal to the first device information. It is understandable that the process of the cloud device setting the current operating environment parameters of the artificial intelligence processor to be equal to the first device information depends on the corresponding hardware device (for example, the microcontroller unit MCU of the cloud device) to complete. For example, the MCU can shield some functions of the artificial intelligence processor of the cloud device so that the artificial intelligence processor of the cloud device can simulate the terminal device. Of course, in other embodiments, the artificial intelligence processor of the cloud device can also shield some of its own functions according to its current operating environment parameters so that the artificial intelligence processor of the cloud device can simulate the terminal device. See. Figure 5A , is a schematic diagram of a process of configuring a frequency value, a memory access bandwidth value, and a computing capability mode value of a hardware device provided in an embodiment of the present application.
[0152] In the embodiment of the present application, the software development platform 102 drives and changes the different operating environment parameters supported by the artificial intelligence processor of the same cloud device, so that some functions in the high-configuration version of the artificial intelligence processor are shielded, and only the implemented functions are adapted to the functions of the corresponding terminal device. Therefore, the value range of the chip operating environment parameters of the high-configuration version of the artificial intelligence processor includes the different chip operating environment parameters supported by the artificial intelligence processor on the terminal side.
[0153] Optionally, a first test result of the artificial intelligence processing chip when processing a preset task is obtained through a hardware monitoring program. In practical applications, the hardware monitoring program can run on a processor or on an artificial intelligence processor, which is not specifically limited in the embodiments of the present application. Further optionally, the hardware monitoring program can be part of a software development platform, and the user can obtain the current operating environment parameters of the artificial intelligence processor of the cloud device in real time through the hardware monitoring program. For the sake of ease of explanation, in the embodiments of the present application, the hardware monitoring program (Cambricon Neuware Minitor, CNMON) running on an artificial intelligence processor is used as an example for explanation.
[0154] In the specific implementation, the hardware monitoring program writes the main frequency, memory access bandwidth value and computing power mode value of the artificial intelligence processor into the proc file, and proc_write converts the frequency value and memory access bandwidth value into corresponding register values and writes them into their respective corresponding registers. Here, the register corresponding to the main frequency is the first register, and the n registers corresponding to the bandwidth of each of the n clusters are the second register [n], and the computing power mode value is saved in the private data of the artificial intelligence processor.
[0155] Here, the conversion relationship between the main frequency and the register value can be expressed as:
[0156] Main frequency = 25*(fbdiv*refdiv) / (postdiv1*postdiv2)
[0157] In the above conversion expression between the main frequency and the register value, fbdiv (PLL feedback dividevalue, fbdiv) represents the PLL feedback division factor, refdiv (reference divide value, refdiv) represents the reference clock division factor, postdiv1 (post divide1, postdiv1) represents the output division factor 1, and postdiv2 (postdivide2, postdiv2) represents the output division factor 2.
[0158] The conversion relationship between the memory access bandwidth value and the register value can be expressed as:
[0159] Memory access bandwidth value = corresponding register value / 0×100
[0160] In the above expression for the conversion relationship between the memory access bandwidth value and the register value, 100 is the decimal number 256 expressed in hexadecimal.
[0161] After that, the hardware monitor tool CNMON reads the register value and converts it into the corresponding real value by calling the interface for obtaining frequency or bandwidth. The computing power mode value is passed to the runtime. Here, runtime refers to the state of a program running. In other words, when you open a program and run it on a computer device, the program is in runtime.
[0162] Finally, the processor will adjust the frequency and bandwidth according to the frequency value written in the corresponding at least one first register and the memory access bandwidth value written in the at least one second register, thereby setting the current operating environment parameters of the artificial intelligence processor to be equal to the first device information of the target chip. The artificial intelligence processor sets its own hardware architecture information according to the computing power mode value it receives. Specifically, the operating environment parameters of its own chip are set to be equal to the operating environment parameters of the target chip. It can be understood that after the operating environment parameters of its own chip are set, the artificial intelligence processor can process preset tasks in the operating environment.
[0163] Further optionally, when there are multiple artificial intelligence processors of different models in the cloud device, the cloud device can select an artificial intelligence processor that is compatible with the target chip from the multiple artificial intelligence processors of different models based on the hardware architecture information of the target chip it receives.
[0164] In one possible implementation, after executing the above step S406, steps S408-S4012 may also be executed:
[0165] Step S408: After the artificial intelligence processor has set its own operating environment parameters, it processes the preset tasks under the current operating environment parameters.
[0166] Here, processing the preset task means running the offline running file that matches the preset task under the current running environment parameters, and then obtaining the running result corresponding to running the offline running file. The following is a detailed description of how the processor generates the offline running file:
[0167] In a specific implementation, the processor sets software parameters corresponding to the compilation interface in the artificial intelligence software development platform according to the first device information of the target chip obtained. The software parameters refer to the transfer parameters between different functional modules in the machine learning library configured for the target chip. Afterwards, the processor generates binary instructions for the target chip according to the software parameters.
[0168] Specifically, the processor generates binary instructions for the target chip according to the software parameters, which may include:
[0169] The processor combines the machine learning model obtained by the programming framework and calls the internal compilation interface of the machine learning library for compilation. After the compilation process is completed, binary instructions can be obtained. Further, through the above steps S401-S406, the corresponding hardware operating environment is configured by the driver, and then the generated binary instructions are run by the artificial intelligence processor to obtain the operating results corresponding to the binary instructions.
[0170] When the processor determines that the running result of a binary instruction sent by the artificial intelligence processor meets the set threshold, the processor obtains the binary instruction corresponding to the running result, and solidifies the binary instruction to obtain the solidified offline running file. Here, the offline running file is allowed to run on the target chip, and the offline running file includes information used to characterize its own properties. For example, the offline running file includes: the version of the offline model, the version information of the artificial intelligence processor core, the binary instruction, the constant table, the input / output data scale, the data layout description information and the parameter information.
[0171] Specifically, the version of the offline model refers to the version information of the offline running file; the version information of the AI processor core refers to the hardware architecture information of the target chip; the data layout description information refers to the processing of input / output data based on hardware characteristics; the constant table, input / output data scale and parameter information are based on the developed deep learning algorithm model. In the constant table, the data required for the execution of binary instruction operations is stored.
[0172] In actual applications, the processor can send the above offline operation file to the terminal device through the communication interface of the device (for example, the cloud device). In this case, for the terminal device, after receiving the offline operation file sent by the cloud device, the terminal device can parse and run the offline operation file on the terminal device and obtain the operation result that meets the above-set threshold.
[0173] It should be noted that, in one possible implementation, the operating result obtained by the target chip on the end-side device when running the above offline operating file is consistent with the operating result obtained by the artificial intelligence processor on the cloud device when running the same offline operating file. In one possible implementation, the operating result obtained by the target chip on the end-side device when running the above offline operating file and the operating result obtained by the artificial intelligence processor on the cloud device when running the same offline operating file meet the preset error range.
[0174] It can be understood that for the end-side device, before the hardware of the end-side device is taped out, the cloud device can implement the debugging and testing process of the target chip, and then, the offline running file corresponding to the running result that meets the set threshold can be deployed on the end-side device that matches the device information of the target chip, thereby realizing seamless migration of the offline running file.
[0175] In practical applications, after the above-described configuration drive operating environment and generation of offline operating files, the artificial intelligence processor can process the preset task. In the embodiment of the present application, the order of the steps of configuring the drive operating environment and generating the offline operating file is not limited.
[0176] When the artificial intelligence processor is processing a preset task, the hardware monitor tool CNMON running on the artificial intelligence processor obtains the first test result of the artificial intelligence processor when processing the above preset task under the current operating environment. Here, the first test result is used to indicate the processing performance of the artificial intelligence processor in processing the preset task. Furthermore, the first test result may include at least one of the running time of the target chip processing the preset task and the power consumption of the target chip processing the preset task. Specifically, the running time in the preset condition may include the set maximum running time of the target chip processing the preset task, or it may be the set time range for the target chip to process the preset task. Alternatively, the power consumption in the preset condition may include the set maximum power consumption of the target chip when processing the preset task, or it may be the set power consumption range of the target chip when processing the preset task, which is not specifically limited in the embodiments of the present application.
[0177] Step S4010: The artificial intelligence processor sends the first test result to the processor.
[0178] Step S4012: The processor receives a first test result when the artificial intelligence processor processes the preset task under the current operating environment.
[0179] Step S4014: If the first test result does not meet the preset conditions, the processor can re-acquire the first device information of the target chip, and send the first test environment determined according to the first device information to the cloud device, so that the cloud device can reconfigure the current operating environment parameters of the artificial intelligence processor therein according to the first test environment; or, the processor can obtain the power consumption value, and send the power consumption value to the cloud device, so that the cloud device can reconfigure the main frequency in the current operating environment parameters of the artificial intelligence processor thereon according to the power consumption value.
[0180] In actual applications, when the first test result does not meet the preset condition, the processor can re-acquire new first device information and configure the test environment according to the latest acquired first device information to ensure that the test result obtained under the new test environment meets the preset condition.
[0181] As mentioned above, the first test result includes at least one of the running time of the target chip for processing the preset task and the power consumption of the target chip for processing the preset task. When the first test result does not meet the preset condition, it may include the following three situations: (1) the running time of the target chip for processing the preset task does not meet the preset condition; (2) the power consumption of the target chip for processing the preset task does not meet the preset condition; (3) the running time of the target chip for processing the preset task and the power consumption of the target chip for processing the preset task do not meet the preset condition.
[0182] For any of the above three situations, the processor can re-acquire the first device information of the target chip to reconfigure the current operating environment parameters of the artificial intelligence processor.
[0183] For example, the processor determines that the first test result corresponding to the first device information (here, the first device information includes that the computing power of the target chip is the first computing power, the operating main frequency of the target chip is 500Hz, and the memory access bandwidth of the target chip is 32GB / s) does not meet the preset conditions. In this case, the processor re-acquires the first device information. For example, the first device information re-acquired by the processor is that the computing power of the target chip is the first computing power, the operating main frequency of the target chip is 600Hz, and the memory access bandwidth of the target chip is 32GB / s. At this time, the processor configures the corresponding test environment according to the re-acquired first device information (for example, the computing power of the artificial intelligence processing chip in the test environment is the first computing power, the operating main frequency is 600Hz, and the memory access bandwidth is 32GB / s), and obtains the test result based on the configured test environment. When the test result does not meet the preset conditions, the above steps are repeated until the test result meets the preset conditions.
[0184] Generally speaking, the higher the main operating frequency of the chip, the greater the power consumption of the chip, that is, there is a positive proportional relationship between frequency and power consumption. In the above three situations, when the power consumption of the target chip in processing the preset task does not meet the preset conditions, the processor can adjust the main operating frequency of the target chip to achieve the power consumption of the target chip in processing the preset task to meet the preset conditions. For example, in the first device information reacquired by the processor, the main operating frequency of the target chip is less than the previous main operating frequency of the target chip. It can be understood that this implementation method of adjusting power consumption by frequency is an indirect implementation method of adjusting power consumption.
[0185] For the second situation above, if the first test result indicates that the power consumption does not meet the preset conditions, the first device information can be re-acquired through the above processor, and the current operating environment parameters of the artificial intelligence processor can be reconfigured according to the first device information (including reconfiguring the main frequency, memory access bandwidth and computing power of the artificial intelligence processor, etc.). In one implementation, for the second situation above, if the first test result indicates that the power consumption does not meet the preset conditions, the power consumption of the target chip processing the preset task can be adjusted through power capping, a direct method to meet the preset conditions.
[0186] In an embodiment of the present application, the third register is used to record and store the power value, and the third register includes at least N bits, for example, N=8, wherein the first bit of the at least N bits is used to represent the enable flag of the powercapping, and the first bit includes the 0th bit or the N-1th bit of the at least N bits. For example, the 7th bit is the enable flag. The first bit can be an enabled state or a disabled state, for example, 1 represents enable, and 0 represents disable. See Figure 5B , is a schematic diagram of a process of configuring power consumption value of a hardware device provided in an embodiment of the present application. In a specific implementation, when the first bit is 1, the processor where the software development platform is located receives the power value input by the user and stores the power value in a third register. Afterwards, the cloud device can read the power value from the third register, and determine the frequency value corresponding to the current power value from the corresponding relationship between the preset frequency and power consumption according to the power value, and then, the cloud device (for example, MCU) adjusts the power consumption by adjusting the first register corresponding to the frequency value.
[0187] As mentioned above, adjusting the operating main frequency of the target chip is achieved by adjusting the value in the first register, and power capping adjustment is also achieved by adjusting the value in the first register. Therefore, it can be known that there is a conflict between the indirect method of adjusting power consumption by adjusting the frequency and the direct method of adjusting power consumption by power capping when they are in parallel. The specific conflict is reflected in:
[0188] In the first scenario, when power capping adjusts the frequency value, it is set according to the state of the first bit. Before the adjustment, the first register value is not read. If the frequency is adjusted by adjusting the frequency value when power capping is not turned off (that is, the first bit is 1) (that is, the power consumption is adjusted according to the power consumption value and the power consumption is adjusted according to the frequency value at the same time), power capping cannot know that the first register value has changed. In this case, a conflict occurs.
[0189] In the second scenario, when power capping is turned off (i.e., the first bit changes from 1 to 0), the first register value needs to be set to a preset value, for example, the preset value is 1GB / s. If the first register value has been modified by adjusting the frequency value before, it means that the first register value modified by adjusting the frequency value will be overwritten. In this case, a conflict occurs.
[0190] In view of the above two conflict situations, the present application also provides a method for resolving the above conflicts, which is described in detail below:
[0191] In the specific implementation, the configuration adjustment frequency value, memory access bandwidth value, and computing capability value are mutually exclusive with power capping:
[0192] Specifically, a flag is set for each of the functions of driving the frequency adjustment value, adjusting the memory access bandwidth value and the computing power value (recorded as the first configuration mode) and power capping (recorded as the second configuration mode), and the flag is used to record the enabled state (enable) and the disabled state (disable), for example, 1 represents enable, and 0 represents disable; here, the flags of the two functions cannot be 1 at the same time. Further optionally, the flag corresponding to powercapping can be the first bit therein.
[0193] When the MCU in the cloud device detects that the flag corresponding to power capping is 1, the value of the first register can be configured by adjusting the power consumption value. When the MCU in the cloud device detects that the flag corresponding to the function of driving the adjustment frequency value, adjusting the memory access bandwidth value, and the computing power value is 1, the value of the first register can be configured by re-acquiring the first device information.
[0194] Further, when the flag bit of the above-mentioned first configuration mode or second configuration mode is set to 0, it can be determined by a polling mechanism to further avoid the conflict between the first configuration mode and the second configuration mode. Specifically, when the MCU in the cloud device detects that the first bit of power capping changes from 1 to 0, for example, bit [7] changes from 1 to 0, in this case, the MCU sets the frequency value in the first register to a preset value, for example, the preset value is 1GB / s. In the process of the MCU setting the frequency value in the first register to the preset value, it is determined by a polling mechanism whether the frequency value in the first register has been restored to the preset value. Only when the frequency value in the first register has been restored to the preset value, the flag bit of power capping is set to 0. Here, the preset value is a value within the set frequency value range, and the preset value is less than the operating main frequency of the target chip in the current operating environment parameters of the artificial intelligence processor. It can be understood that in the process of the MCU setting the frequency value in the first register to the preset value, it takes a certain amount of time. When the time for the MCU to perform the above recovery operation is greater than the preset time, an error is reported. In one possible implementation manner, if the MCU detects that the first bit of power capping is 0, the frequency value in the first register is a preset value. At this time, the MCU does not need to restore the first register value to the preset value.
[0195] Similarly, the first configuration mode also needs to add a function of restoring the preset frequency value and memory access bandwidth value in a non-enabled state (for example, 0), and after confirming that the first register value has been restored to the preset value through a polling mechanism, the flag of the first configuration mode is set to 0. Specifically, the process of setting the flag of the first configuration mode to 0 is basically the same as the process of setting the flag of the power capping to 0, and the details can be found in the description above.
[0196] In order to facilitate a better understanding of a test method provided in an embodiment of the present application, the following is an explanation in conjunction with a specific example: the cloud device includes a processor and a first artificial intelligence processor, the computing power of the first artificial intelligence processor is the first computing power (here, the first computing power is greater than or equal to the second computing power), the main operating frequency is 1GHz, and the memory access bandwidth value is 32GB / s. On the first artificial intelligence processor, the test environment of the second artificial intelligence processor (here, the second artificial intelligence processor is a chip different from the first artificial intelligence processor) can be simulated, where the computing power of the second artificial intelligence processor is the second computing power, the frequency is 500Hz, and the memory access bandwidth is 32GB / s. Specifically, after the processor obtains the first device information of the second artificial intelligence processor, it determines the first test environment according to the first device information. Here, the determined first test environment has a computing power of the second computing power, a frequency of 500Hz, and a memory access bandwidth of 32GB / s. After that, the first test environment is sent to the cloud device. After receiving the above first test environment, the cloud device sets the current operating environment parameters of the first artificial intelligence processor to a frequency of 500Hz and a memory access bandwidth of 32GB / s, so that the first artificial intelligence processor processes the preset task under the current operating environment parameters. When the first artificial intelligence processor processes the preset task under the current operating environment parameters, the hardware monitoring tool CNMON running on the artificial intelligence processor obtains the first test result when the first artificial intelligence processor processes the above preset task under the current operating environment. The entire implementation process can realize the early debugging and testing process of the target chip.
[0197] By implementing the embodiments of the present application, a test environment can be determined according to the device information of the target chip, and debugging and testing of the target chip can be implemented based on the test environment.
[0198] In one possible implementation, the processor can also be used to obtain the second device information of the target chip, and determine the second test environment according to the second device information of the target chip; wherein, when the second device information is different from the first device information, the second test environment is different from the first test environment; thereafter, the second test environment is sent to the cloud device, and after receiving the second test environment, the cloud device sets the current operating environment parameters of the first artificial intelligence processor according to the second test environment, so that the first artificial intelligence processor processes the preset task under the current operating environment parameters. At the same time, the second test result of the artificial intelligence processor processing the preset task under the current operating environment parameters is obtained through the hardware monitoring program running on the artificial intelligence processor, and the second test result is sent to the processor.
[0199] By implementing the embodiments of the present application, it is possible to simulate the test environment of multiple different types of target chips on the same artificial intelligence processor, and then implement the early debugging and testing process of the terminal-side artificial intelligence chip based on the determined test environment.
[0200] Furthermore, if Figure 5C FIG. 1 is a flow chart of another testing method provided by the present application. The method is applied to a processor and includes:
[0201] Step S501): Acquire first device information of a target chip;
[0202] Step S502): determining a first test environment according to first device information of the target chip;
[0203] Step S503): Send the first test environment to the cloud device to configure the current operating environment parameters of the artificial intelligence processor in the cloud device so that the current operating environment parameters of the artificial intelligence processor are consistent with the first device information of the target chip.
[0204] It should be emphasized that Figure 4 All relevant technical solutions shown are applicable to Figure 5C The technical solution shown will not be described in detail here.
[0205] In the above embodiments, only the case where the software development platform runs on a cloud device is used as an example to illustrate the specific implementation process. As recorded above, the software development platform of the present application can also run on a local computer device. When the software development platform runs on a local computer device, the configuration process of the operating environment parameters of the artificial intelligence processor of the cloud device is basically the same as the above embodiments, and the details can be found in the above description.
[0206] The above describes the test method of the embodiment of the present application. Figure 6-Figure 11 , describing the cloud device, computer device and test system of an embodiment of the present application.
[0207] Figure 6 The schematic diagram of the structure of the cloud device of the embodiment of the present application is shown, and the cloud device 60 may at least include:
[0208] A receiving unit 600 is used to receive a first test environment to determine current operating environment parameters of the artificial intelligence processor;
[0209] The setting unit 602 is used to set the current operating environment parameters of the artificial intelligence processor according to the first test environment, so that the current operating environment parameters of the artificial intelligence processor are consistent with the first device information of the target chip.
[0210] In one possible implementation, the cloud device 60 may further include:
[0211] The MCU unit is used to set the current operating environment of the artificial intelligence processor according to the acquired value of at least one first register and the acquired value of at least one second register.
[0212] In one possible implementation, based on Figure 3 The application scenarios shown are as follows: Figure 7 As shown, the embodiment of the present application further provides a cloud device 70 , which may include at least: an MLU 710 , a receiver 720 , a receiver 730 , a transmitter 740 and an MCU 750 .
[0213] Among them, MLU710, memory 720, receiver 730 and transmitter 840 communicate with each other through an internal connection path. The memory 720 is used to store instructions, and the MLU710 is used to execute the instructions stored in the memory 720 to control the receiver 730 to receive signals and control the transmitter 740 to send signals.
[0214] The receiver 730 is used to receive the first test environment to determine the current operating environment parameters of the artificial intelligence processor MLU710;
[0215] MCU750, used for setting the current operating environment parameters of the MLU710 in the cloud device according to the first test environment, so that the current operating environment parameters of the MLU710 are consistent with the first device information of the target chip;
[0216] The MLU 710 is also used to process preset tasks under the determined current operating environment parameters.
[0217] In one possible implementation, based on Figure 2 The application scenarios shown are as follows: Figure 8 As shown, the embodiment of the present application further provides a cloud-side device 80, which may include at least: a processor 810, a memory 820, a receiver 830, a transmitter 840, and an MLU 850. The processor 810, the memory 820, the receiver 830, the transmitter 840, and the MLU 850 communicate with each other through an internal connection path, the memory 820 is used to store instructions, and the processor 810 and / or the MLU 850 is used to execute the instructions stored in the memory 820 to control the receiver 830 to receive signals and control the transmitter 840 to send signals.
[0218] The processor 810 is used to obtain first device information of the target chip;
[0219] The processor 810 is further configured to determine a first test environment according to the first device information of the target chip;
[0220] The processor 810 is further configured to send the first test environment to the artificial intelligence processor (MLU850) to determine current operating environment parameters of the artificial intelligence processor (MLU850);
[0221] The processor 810 is further configured to set the current operating environment parameters of the artificial intelligence processor (MLU850) in the cloud device according to the first test environment, so that the current operating environment parameters of the artificial intelligence processor (MLU850) are consistent with the first device information of the target chip;
[0222] MLU850 is also used to process preset tasks under the current operating environment parameters.
[0223] Fig. 9 The schematic diagram of the structure of the local computer device provided in the embodiment of the present application is shown, and the computer device 90 may at least include:
[0224] An acquisition unit 900 is used to acquire first device information of a target chip;
[0225] A determining unit 902 is configured to determine a first test environment according to first device information of the target chip;
[0226] The sending unit 904 is used to send the first test environment to the artificial intelligence processor to determine the current operating environment parameters of the artificial intelligence processor.
[0227] In one possible implementation, the computer device 90 may further include:
[0228] A receiving unit is used to receive a first test result when the artificial intelligence processor processes the preset task under the current operating environment; wherein the first test result is used to indicate the processing performance of the artificial intelligence processor in processing the preset task.
[0229] In one possible implementation, the computer device 90 may further include:
[0230] A re-acquisition unit, configured to re-acquire the first device information of the target chip when the first test result does not meet a preset condition
[0231] In one possible implementation, Fig.10 As shown, the embodiment of the present application further provides a computer device 100 , which may include at least: a processor 1010 , a receiver 1020 , a receiver 1030 , and a transmitter 1040 .
[0232] Among them, the processor 1010, the memory 1020, the receiver 1030 and the transmitter 1040 communicate with each other through an internal connection path. The memory 1020 is used to store instructions, and the artificial intelligence processor 1010 is used to execute the instructions stored in the memory 1020 to control the receiver 1030 to receive signals and control the transmitter 1040 to send signals.
[0233] The processor 1010 is configured to obtain first device information of a target chip;
[0234] The processor 1010 is further configured to determine a first test environment according to first device information of the target chip;
[0235] A transmitter 1040 is used to send the first test environment to the artificial intelligence processor in the cloud device to determine the current operating environment parameters of the artificial intelligence processor;
[0236] Receiver 1030, used to receive a first test result when the artificial intelligence processor processes the preset task under the current operating environment; wherein the first test result is used to indicate the processing performance of the artificial intelligence processor in processing the preset task;
[0237] In one possible implementation manner, the processor 1010 is further configured to reacquire the first device information of the target chip when the first test result does not meet a preset condition.
[0238] Fig.11 The schematic block diagram of the test system 110 provided in the embodiment of the present application is shown, and the test system includes a computer device 1110 and a cloud device 1120. The computer device 1110 includes a processor.
[0239] It can be understood that the specific implementation of the processor and the cloud device in the embodiment of the present application can be referred to the above description and will not be elaborated here.
[0240] By implementing the embodiments of the present application, it is possible to simulate the test environments of multiple target chips that have not yet been taped out on the same artificial intelligence processor, and then implement the early debugging and testing process of the target chip based on the determined test environment.
[0241] It should be understood that the application scenarios to which the methods provided in the embodiments of the present application can be applied are only examples and are not limited to these in practical applications.
[0242] It should also be understood that the first, second, third and various numerical numbers involved in the present application are merely distinctions made for the convenience of description and are not intended to limit the scope of the present application.
[0243] It should be understood that the term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0244] In addition, in each embodiment of the present application, the size of the serial number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0245] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0246] Technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0247] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules and units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0248] The units described as separate components may be physically separated or not, and the components displayed as units may be physical units or not, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0249] In addition, each functional unit involved in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units, and the present application does not limit this.
[0250] The embodiment of the present application also provides a computer storage medium, in which instructions are stored, and when the instructions are executed on a computer or a processor or an MLU, the computer or the processor or the MLU executes one or more steps of the method described in any of the above embodiments. If the components of the above-mentioned device are implemented in the form of software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer product is stored in a computer-readable storage medium.
[0251] The above-mentioned computer-readable storage medium may be an internal storage unit of the cloud-side device or computer device described in the above-mentioned embodiment, such as a hard disk or memory. The above-mentioned computer-readable storage medium may also be an external storage device of the above-mentioned cloud-side device or computer device, such as an equipped plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the above-mentioned computer-readable storage medium may also include both the internal storage unit of the above-mentioned cloud-side device or computer device and an external storage device. The above-mentioned computer-readable storage medium is used to store the above-mentioned computer program and other programs and data required by the above-mentioned cloud-side device or computer device. The above-mentioned computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.
[0252] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
[0253] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0254] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0255] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A testing method, characterized in that: include: Acquire first device information of a target chip; Determine a first test environment according to first device information of the target chip; Sending the first test environment to a cloud device to configure the current operating environment parameters of the artificial intelligence processor in the cloud device so that the current operating environment parameters of the artificial intelligence processor are consistent with the first device information of the target chip; wherein the first device information includes the chip operating environment parameters of the target chip; the chip operating environment parameters include the operating main frequency and memory access bandwidth of the target chip; The first device information also includes the hardware architecture information of the target chip; determining the first test environment according to the first device information of the target chip, and sending the first test environment to the cloud device also includes: The hardware architecture information of the target chip is transmitted to the cloud device so that the cloud device selects an artificial intelligence processor that is compatible with the hardware architecture information of the target chip.
2. The method according to claim 1, characterized in that The method of determining a first test environment according to the first device information of the target chip and sending the first test environment to a cloud device further includes: Determine at least one first register value and at least one second register value according to the chip operating environment parameter; Send the value of the at least one first register and the value of the at least one second register to the cloud device.
3. The method according to claim 1, characterized in that The method further comprises: Receiving a first test result obtained when the artificial intelligence processor processes a preset task under the current operating environment parameters; wherein the first test result is used to indicate the processing performance of the artificial intelligence processor in processing the preset task; If the first test result does not meet the preset condition, the first device information of the target chip is reacquired.
4. The method according to claim 3, characterized in that The first test result includes at least one of a running time of the target chip processing the preset task and a power consumption of the target chip processing the preset task.
5. The method according to claim 1, characterized in that The first test environment includes the main frequency of the target chip, the memory access bandwidth of the target chip and the computing power of the target chip; The operating main frequency of the target chip is less than or equal to the actual main frequency of the artificial intelligence processor; The memory access bandwidth of the target chip is less than or equal to the actual memory access bandwidth of the artificial intelligence processor; The computing power of the target chip is less than or equal to the actual computing power of the artificial intelligence processor.
6. A testing method, characterized in that: The test method is applied to a test system, the test system comprising a processor and a cloud device; the method comprises: The processor acquires first device information of the target chip; the first device information includes chip operating environment parameters of the target chip; the chip operating environment parameters include the operating main frequency and memory access bandwidth of the target chip; The processor determines a first test environment according to first device information of the target chip; The processor sends the first test environment to the cloud device to determine the current operating environment parameters of the artificial intelligence processor in the cloud device; The first device information also includes the hardware architecture information of the target chip, and the processor sends the first test environment to the cloud device, further including: The processor transmits the hardware architecture information of the target chip to the cloud device; The cloud device selects an artificial intelligence processor that is compatible with the hardware architecture information of the target chip, and sets the current operating environment parameters of the artificial intelligence processor according to the first test environment, so that the current operating environment parameters of the artificial intelligence processor are consistent with the first device information of the target chip.
7. The method according to claim 6, characterized in that: The processor determines a first test environment according to first device information of the target chip, and further includes: Determine at least one first register value and at least one second register value according to the chip operating environment parameter; Send the value of the at least one first register and the value of the at least one second register to the cloud device.
8. The method according to claim 6, characterized in that The cloud device sets the current operating environment parameters of the artificial intelligence processor according to the first test environment, and further includes: The MCU of the cloud device sets the current operating environment of the artificial intelligence processor according to the acquired value of at least one first register and the acquired value of at least one second register.
9. The method according to claim 6, characterized in that The method further comprises: The artificial intelligence processor processes the preset task under the current operating environment parameters; The processor receives a first test result when the artificial intelligence processor processes the preset task under the current operating environment; wherein the first test result is used to indicate the processing performance of the artificial intelligence processor in processing the preset task; If the first test result does not meet a preset condition, the processor re-acquires the first device information of the target chip.
10. The method according to claim 6, characterized in that The test system also includes a hardware monitoring tool for monitoring the current operating environment of the artificial intelligence processor; the method also includes: The hardware monitoring tool obtains the first test result and transmits the first test result to the processor.
