An online algorithm evaluation device and method
Through the online algorithm evaluation device, the master-slave FPGA chip structure is used to collect and analyze algorithm execution information, which solves the problem that the existing technology cannot accurately analyze the power consumption and acceleration effect of the algorithm on the FPGA, and realizes multi-faceted evaluation and evaluation of multiple algorithms. Optimal algorithm selection.
Patent Information
- Application Number
- CN202211510116.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-11-29
AI Technical Summary
Existing devices cannot accurately analyze and compare the power consumption, acceleration effect, and prediction accuracy of multiple artificial intelligence algorithms of the same type when running on FPGA, and there is a lack of efficient methods to solve this problem.
An online algorithm evaluation device is designed, including a master FPGA chip and multiple slave FPGA chips. The algorithm execution process information is collected through the information collection module, and the online analysis module is used for analysis and analysis to extract algorithm energy consumption, efficiency and model characteristics. Compare different algorithms to determine the optimal one.
It realizes multi-faceted analysis of multiple algorithms, accurately determines the running results, power consumption and efficiency, reduces interference in the algorithm execution process, and helps select suitable algorithms to improve the adaptability of FPGA chips.
Smart Images

Figure CN115827409B
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence and digital electronic technology, and in particular to an online algorithm evaluation device and method. Background Art
[0002] In recent years, with the rapid development of artificial intelligence algorithms and the requirements for algorithm lightweight and running speed, more artificial intelligence algorithms are deployed to FPGA for operation. However, the existing devices for debugging simulation models cannot accurately analyze and compare the power consumption, algorithm acceleration effect and algorithm prediction accuracy of multiple algorithms of the same type when running on FPGA, and there is no efficient method to solve this problem. Summary of the invention
[0003] In view of the above analysis, an embodiment of the present invention aims to provide an online algorithm evaluation device and method to solve the problem that the prior art cannot accurately analyze the power consumption, algorithm acceleration effect and prediction accuracy of the same type of algorithms when the algorithm runs on FPGA.
[0004] In one aspect, an embodiment of the present invention provides an online evaluation device and method, the device comprising a master FPGA chip and n slave FPGA chips; wherein n is greater than or equal to 2;
[0005] The n slave FPGA chips are respectively used to run n algorithms to be evaluated, and each of the algorithms to be evaluated acts on the same sample set;
[0006] The main FPGA chip includes an information acquisition module and an online analysis module; wherein,
[0007] The information collection module is used to collect and package the execution process information of the algorithm to be evaluated when it is executed on each of the slave FPGA chips;
[0008] The online analysis module is used to parse the package information, extract the data of the corresponding execution process of each algorithm to be evaluated based on the parsed data, analyze and compare the algorithm energy consumption, algorithm efficiency, and algorithm model characteristics of each algorithm to be evaluated, and obtain the optimal algorithm.
[0009] Furthermore, the execution process information includes execution time, execution result, execution current and voltage, and algorithm log information;
[0010] The information collection module includes an external interface unit, a timer unit and a data packet encapsulation unit;
[0011] The external interface unit includes an execution time interface, an execution result interface, an execution current and voltage interface, and an algorithm log interface, which are respectively used to connect to the execution time interface, execution result interface, execution current and voltage interface, and algorithm log interface of each slave FPGA chip;
[0012] The timer unit has an input end connected to each interface of the external interface unit and an output end connected to the data packet encapsulation unit, and is used to provide a timestamp required for each sample in the sample set during the execution of each algorithm to be evaluated;
[0013] The data packet encapsulation unit is used to encapsulate the execution time, execution result, execution current and voltage, and algorithm log information according to the definition, and send them to the online analysis module.
[0014] Further, each slave FPGA chip execution time interface includes 1 start pin and 1 end pin, the slave FPGA chip start pin is in input mode, and the slave FPGA chip end pin is in output mode, which are respectively used to receive a start signal sent by the master FPGA chip and send a calculation end signal to the master FPGA chip;
[0015] The master FPGA chip includes a plurality of start pins and a plurality of end pins, wherein the start pins are in output mode and the end pins of the master FPGA chip are in input mode; they are respectively used to send a start signal to the slave FPGA chip and receive a calculation end signal sent by the slave FPGA chip;
[0016] The start pin and the end pin of the slave FPGA chip are respectively connected to the start pin and the end pin of the master FPGA chip.
[0017] Furthermore, the data packet encapsulation unit includes packet area 1, packet area 2, packet area 3 and packet area 4; respectively used to package execution time, execution result, current voltage and algorithm log; each packet area includes a packet header, data and a packet tail;
[0018] The packet header includes a timestamp, an algorithm category, and an information category of execution process information;
[0019] The timestamp is used to record the occurrence time of each state value of each algorithm to be evaluated.
[0020] Further, the data packet encapsulation unit also includes a data packet buffer area;
[0021] The data packet buffer area is used to buffer the data packets encapsulated in the packet area, and transmit the data packets to the online analysis module through a direct access memory access mode DMA.
[0022] Furthermore, the online analysis module includes a data packet receiving module, a data packet parsing module, a data analysis module and an algorithm comparison and analysis module;
[0023] The data packet receiving module is used to receive data packets transmitted from the data packet buffer area;
[0024] The data packet parsing module is used to parse the data packets received by the data packet receiving module, extract the data corresponding to the execution process according to the parsed data, and aggregate the data belonging to the same algorithm;
[0025] The data analysis module is used to analyze the algorithm energy consumption, algorithm efficiency, and algorithm model characteristics of the summarized algorithms to be evaluated, and send the analysis results to the algorithm comparison and analysis module;
[0026] The algorithm comparison and analysis module compares the algorithms to be evaluated to obtain the optimal algorithm based on the analysis results.
[0027] Further, the algorithm energy consumption analysis includes: analyzing the real-time power and peak power of each algorithm to be evaluated based on current and voltage;
[0028] The algorithm efficiency analysis includes: analyzing the execution time of each algorithm to be evaluated according to the timestamps of the start signal and the end signal;
[0029] The algorithm model characteristic analysis includes: analyzing the prediction results of each algorithm to be evaluated based on the execution results and the algorithm log;
[0030] The algorithm log includes the execution process and results of the algorithm to be evaluated on each sample in the sample set.
[0031] Furthermore, the information online analysis module also includes a data storage module and a data display module;
[0032] The data storage module is used to store the data parsed and summarized by the data packet parsing module according to the algorithm category;
[0033] The data display module is used to display the execution results and power consumption of each algorithm to be evaluated in a graphical manner.
[0034] Furthermore, each slave FPGA chip is connected to the same DC regulated power supply via a small resistor with the same resistance in series, and the voltage and current acquisition pins of each slave FPGA chip are connected to the external interface unit via an AD converter.
[0035] Furthermore, an online algorithm evaluation method comprises the following steps:
[0036] Collecting execution process information of each algorithm to be evaluated through hardware devices;
[0037] Packaging and caching the execution process information to obtain a data packet, and then transmitting it to the software unit;
[0038] The software unit receives the data packet and aggregates the data belonging to the same algorithm; performs algorithm energy consumption, algorithm efficiency, and algorithm model characteristic analysis on each algorithm to be evaluated; and compares each algorithm to be evaluated to obtain the optimal algorithm.
[0039] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0040] 1. This application uses multiple algorithms to be evaluated to calculate the same test sample set, and compares and analyzes the model characteristics of multiple algorithms to be evaluated to determine which algorithm has the best operating results;
[0041] 2. This application separates the execution process of the algorithm to be evaluated on the FPGA from the analysis of the execution process of the algorithm to be evaluated, and embeds the relevant data of the execution process and the data analysis process into a single FPGA chip to minimize the interference with the algorithm execution process;
[0042] 3. This application not only focuses on the analysis of the execution results of the algorithm to be evaluated on the FPGA chip, but also focuses on the algorithm energy consumption analysis and algorithm efficiency analysis, to achieve a multi-faceted analysis of the algorithm to be evaluated, so as to facilitate the selection of a more adaptable algorithm to be evaluated from the FPGA chip.
[0043] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.
[0045] Figure 1 This is a schematic diagram of the overall technical solution of this application;
[0046] Figure 2 This is a schematic diagram of the information collection module;
[0047] Figure 3 It is a schematic diagram of the online analysis module;
[0048] Figure 4 Schematic diagram of power supply for master and slave FPGA chips. DETAILED DESCRIPTION
[0049] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0050] A specific embodiment of the present invention discloses an online algorithm evaluation device, such as Figure 1 As shown; including a master FPGA chip and n slave FPGA chips; wherein n is greater than or equal to 2;
[0051] One of the slave FPGA chips is used to run one algorithm to be evaluated, and n of the slave FPGA chips are used to run n different algorithms to be evaluated; each of the algorithms to be evaluated acts on the same sample set; wherein the sample set includes multiple samples and the standard result corresponding to each sample.
[0052] The main FPGA chip includes an information acquisition module and an online analysis module; wherein,
[0053] The information collection module is used to collect and package the execution process information of each algorithm to be evaluated when it is executed on each slave FPGA chip;
[0054] The online analysis module is used to parse the package information, extract the data of the corresponding execution process of each algorithm to be evaluated based on the parsed data, analyze and compare the algorithm energy consumption, algorithm efficiency, and algorithm model characteristics of each algorithm to be evaluated, and obtain the optimal algorithm.
[0055] Specifically, the online algorithm evaluation device is a hardware-software combination device, the information acquisition module is a hardware device, and the online analysis module is a software module; the hardware module connects to the slave FPGA chip running the algorithm to be evaluated through the GPIO interface and AD interface of the programmable logic controller and the serial port, and collects the parameters of the algorithm to be evaluated on the slave FPGA chip; the software module is the ARM on the main FPGA chip, the ARM processor is embedded with a QT application, and the ARM processor displays and analyzes the collected information in real time and performs analysis. The sample set includes the correct label of the sample.
[0056] Specifically, the number of slave FPGA chips cannot be infinite, and is limited by the number of pins of the master FPGA chip. Figure 1 The system includes two slave FPGA chips, which are used to run the AI algorithm 1 and AI algorithm 2 to be evaluated.
[0057] Further, such as Figure 2 As shown, the execution process information includes execution time, execution result, execution current and voltage, and algorithm log information;
[0058] The information collection module includes an external interface unit, a timer unit and a data packet encapsulation unit;
[0059] The external interface unit includes an execution time interface, an execution result interface, an execution current and voltage interface, and an algorithm log interface, which are respectively used to connect the execution time interface, execution result interface, execution current and voltage interface, and algorithm log interface of each slave FPGA chip; specifically, the execution time interface of the slave FPGA chip is specifically a switch quantity interface, which is used to output the start signal and the end signal of the algorithm to be evaluated on the slave FPGA chip; the execution result interface is a serial port interface, which is used to output the execution result of the algorithm to be evaluated on the sample set, and the execution result is the correctness percentage obtained by comparing the result after the algorithm to be evaluated in the slave FPGA chip acts on all samples in the sample set with the correct label of the sample set, that is, the standard result; the execution current and voltage interface is an AD interface, which is used to output the voltage and current signal of the slave FPGA chip during the execution of the algorithm to be evaluated; the voltage value of the slave FPGA chip is collected by the AD converter of the main FPGA chip, and the real-time current value of the slave FPGA is calculated based on the resistance value of the slave FPGA series resistor; the algorithm log interface is a serial port interface, which is used to output the execution process and result information of calculating each sample during the execution of the algorithm to be evaluated.
[0060] The timer unit has an input end connected to each interface of the external interface unit and an output end connected to the data packet encapsulation unit, and is used to provide a timestamp required for each sample in the sample set during the execution of the algorithm to be evaluated;
[0061] The data packet encapsulation unit is used to encapsulate the execution time, execution result, execution current and voltage, and algorithm log according to the definition, and send them to the online analysis module;
[0062] Furthermore, the data packet encapsulation unit includes packet area 1, packet area 2, packet area 3 and packet area 4; respectively used to package execution time, execution result, current voltage and algorithm log; each packet area includes a packet header, data and a packet tail;
[0063] The packet header includes a timestamp, an algorithm category, and an information category of execution process information;
[0064] The timestamp is used to mark the data execution order at each important computing stage.
[0065] Specifically, the external interface unit of the master FPGA chip is connected to the corresponding external interface of the slave FPGA chip; the hardware interface is divided into four areas, and each area is responsible for collecting separate information.
[0066] Specifically, the timer unit is connected to the execution time interface to record the start time and end time of each algorithm to be evaluated, that is, to obtain the running time of the entire algorithm to be evaluated on the sample set;
[0067] The timer unit is connected to the execution result interface and is used to provide a timestamp when each algorithm to be evaluated completes the execution of the sample set, that is, when the execution result is output, to mark the time corresponding to the calculation result of the sample set;
[0068] The timer unit is connected to the execution current and voltage interface to record the current and voltage at each moment, so as to facilitate the later calculation of real-time power and peak power;
[0069] The timer unit is connected to the algorithm log interface to record the prediction results of each sample in the prediction sample set of the algorithm to be evaluated, and provide it with a timestamp to mark the order of sample data, so as to facilitate subsequent analysis and comparison of the speed of prediction of each sample by the algorithm to be evaluated.
[0070] Specifically, the master FPGA chip monitors the signal of each slave FPGA chip at all times. When a signal is transmitted from the slave FPGA chip, the master FPGA chip continues to transmit the data of each execution process to the data packet encapsulation module for encapsulation.
[0071] Specifically, during the data packet encapsulation process, the interface of the main FPGA chip is used to determine which execution process information the data belongs to, and to determine which algorithm to be evaluated execution process the data is generated from. The data is processed at the header and the tail, and is packaged according to the data format defined by the header flag, timestamp, algorithm category, information category of the execution process information, data, and tail flag. After packaging, it is cached in the data packet buffer area, and the data packet is transferred to the information online analysis module through DMA (direct memory access) through the data packet buffer area for analysis and parsing.
[0072] Further, each slave FPGA chip execution time interface includes 1 start pin and 1 end pin, the slave FPGA chip start pin is in input mode, and the slave FPGA chip end pin is in output mode, which are respectively used to receive a start signal sent by the master FPGA chip and send a calculation end signal to the master FPGA chip;
[0073] The master FPGA chip includes a plurality of start pins and a plurality of end pins, wherein the start pins are in output mode and the end pins of the master FPGA chip are in input mode; they are respectively used to send a start signal to the slave FPGA chip and receive a calculation end signal sent by the slave FPGA chip;
[0074] The start pin and the end pin of the slave FPGA chip are respectively connected to the start pin and the end pin of the master FPGA chip.
[0075] Specifically, the information acquisition module mainly collects information through a customized hardware interface, the slave FPGA chip has a fixed single-row interface, the master FPGA chip has customized n-row interfaces, and the n-row interfaces customized by the master FPGA chip are respectively connected to the customized hardware interfaces on the slave FPGA chip through connecting lines;
[0076] Specifically, the signals during the algorithm execution process are respectively led from the FPGA chip to the signal receiving area specified by the interface, including the algorithm start start signal and the algorithm end signal, the algorithm execution output result signal and the algorithm output log signal.
[0077] Specifically, the start pin of the slave FPGA chip is connected to the start pin of the master FPGA chip, so as to ensure that the algorithms on the n slave FPGA chips are driven and executed at the same time, and to ensure that the test environment and other conditions of the n algorithms to be evaluated are almost the same; the end pin of the slave FPGA chip is connected to the end pin of the master FPGA chip, so as to transmit the end signal to the end pin of the master FPGA chip through the end pin of the slave FPGA chip when the execution of the n algorithm models to be evaluated is completed. During the execution of the algorithm to be evaluated, a timer unit is started inside the master FPGA chip, and a time signal is saved after receiving the signal indicating the end of the execution of each algorithm to be evaluated. Finally, the time signals of the n algorithms to be evaluated are transmitted to the data packet encapsulation module for encapsulation.
[0078] Further, the data packet encapsulation unit also includes a data packet buffer area;
[0079] The data packet buffer area is used to buffer the data packets encapsulated in the packet area and transmit them to the online analysis module through the data transmission line.
[0080] Specifically, when there is data in the data packet buffer, data packet transmission is performed and a first-in-first-out rule is implemented; this is used to solve the problem of data accumulation caused by a fast packet speed.
[0081] Further, such as Figure 3 As shown, the online analysis module includes a data packet receiving module, a data packet parsing module, a data analysis module and an algorithm comparison and analysis module;
[0082] The data packet receiving module is used to receive data packets transmitted from the data packet buffer area;
[0083] The data packet parsing module is used to parse the data packets received by the data packet receiving module, extract the data corresponding to the execution process according to the parsed data, and aggregate the data belonging to the same algorithm;
[0084] The data analysis module is used to analyze the algorithm energy consumption, algorithm efficiency, and algorithm model characteristics of each algorithm to be evaluated after data aggregation, and send the analysis results to the algorithm comparison and analysis module;
[0085] The algorithm comparison and analysis module compares the algorithms to be evaluated to obtain the optimal algorithm based on the analysis results.
[0086] Specifically, after receiving each complete data packet, the data packet parsing module parses the data, extracts the data according to the defined data format, and aggregates the execution time, execution result, current and voltage, and algorithm log data belonging to the same algorithm to be evaluated.
[0087] Specifically, the data analysis module analyzes the data of n algorithms to be evaluated at the same time, applies the n algorithms to be evaluated to the same sample set data, and determines, based on the execution results of the n algorithms to be evaluated and the real-time analysis of the algorithm logs, which algorithm to be evaluated has a short execution time, low power consumption, and a calculation result that is closer to the standard result and has a higher prediction accuracy for the same sample set.
[0088] Furthermore, the algorithm energy consumption analysis includes: analyzing the real-time power and peak power of each algorithm to be evaluated based on current and voltage; specifically, calculating the power value corresponding to each moment through the current and voltage obtained at each moment, and then obtaining the peak power.
[0089] The algorithm efficiency analysis includes: analyzing the execution time of each algorithm to be evaluated according to the timestamps of the start signal and the end signal;
[0090] The algorithm model characteristic analysis includes: analyzing the prediction results of each algorithm to be evaluated based on the execution results and the algorithm log;
[0091] The algorithm log includes the execution process and results of the sample to be evaluated algorithm for each sample calculation. The prediction results of each algorithm to be evaluated are compared by comparing the percentage of the execution results.
[0092] Furthermore, the information online analysis module also includes a data storage module and a data display module;
[0093] The data storage module is used to store the data parsed and summarized by the data packet parsing module according to the algorithm category;
[0094] The data display module is used to display the execution results and power consumption of each algorithm to be evaluated in a graphical manner.
[0095] Further, such as Figure 4As shown, each slave FPGA chip is connected to the same DC regulated power supply through a small resistor with the same resistance in series, and the end pin of each slave FPGA chip is connected to the external interface unit through an AD converter.
[0096] Specifically, the n slave FPGA chips are connected to the same DC regulated power supply to ensure consistent power supply driving specifications, and an AD converter is used in the external interface unit of the main FPGA chip to collect the real-time input voltage value of the slave FPGA chip. The real-time current of the slave device is obtained based on Ohm's law and the voltage value collected by the AD converter and the series resistance.
[0097] Example 2
[0098] On the other hand, an online algorithm evaluation method comprises the following steps:
[0099] S1. Collecting the execution process information of each algorithm to be evaluated through a hardware device;
[0100] S2, encapsulating and caching the execution process information to obtain a data packet, and then transmitting the data packet to the software unit;
[0101] S3, the software unit receives the data packet and aggregates the data belonging to the same algorithm; performs algorithm energy consumption, algorithm efficiency, and algorithm model characteristic analysis on each algorithm to be evaluated; and compares each algorithm to be evaluated to obtain the optimal algorithm.
[0102] Specifically, based on the above-mentioned online algorithm evaluation device, the execution process information of the algorithm to be evaluated on the FPGA chip is collected through the external interface unit and sent to the data packet encapsulation unit;
[0103] The data packet encapsulation unit encapsulates each execution process information according to the definition, obtains the encapsulated packet and caches it;
[0104] The data packets in the cache unit are transmitted to the data packet receiving module via the data transmission line;
[0105] The data packet receiving module sends the data packet to the data packet parsing module;
[0106] The data packet parsing module parses the data packet and extracts the data corresponding to the execution process according to the definition, and aggregates the data belonging to the same algorithm and sends it to the data analysis module;
[0107] The data analysis module analyzes the algorithm energy consumption, algorithm efficiency, and algorithm model characteristics of the summarized algorithms to be evaluated, and sends the analysis results to the algorithm comparison and analysis module;
[0108] The algorithm comparison and analysis module compares the algorithms to be evaluated to obtain the optimal algorithm based on the analysis results.
[0109] Compared with the prior art, the online algorithm evaluation device and method provided in this embodiment calculates the same test sample set through multiple algorithms to be evaluated, and compares and analyzes the model characteristics of multiple algorithms to be evaluated to determine which algorithm has the best running result; the application separates the execution process of the algorithm to be evaluated on the FPGA from the analysis of the execution process of the algorithm to be evaluated, and embeds the relevant data of the execution process and the data analysis process into a single FPGA chip to minimize the interference with the algorithm execution process; the application not only focuses on the analysis of the execution results of the algorithm to be evaluated on the FPGA chip, but also focuses on the algorithm energy consumption analysis and algorithm efficiency analysis, realizes a multi-faceted analysis of the algorithm to be evaluated, and facilitates the selection of a more adaptable algorithm to be evaluated from the FPGA chip.
[0110] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0111] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. An online algorithm evaluation device, It is characterized in that It includes a master FPGA chip and n slave FPGA chips; wherein n is greater than or equal to 2; The n slave FPGA chips are respectively used to run n algorithms to be evaluated, and each of the algorithms to be evaluated acts on the same sample set; The main FPGA chip includes an information acquisition module and an online analysis module; wherein, The information collection module is used to collect and encapsulate the execution process information of the algorithm to be evaluated when it is executed on each of the slave FPGA chips; wherein the execution process information includes execution time, execution result, execution current and voltage, and algorithm log information; The information collection module includes an external interface unit, a timer unit and a data packet encapsulation unit; The external interface unit includes an execution time interface, an execution result interface, an execution current and voltage interface, and an algorithm log interface, which are respectively used to connect to the execution time interface, execution result interface, execution current and voltage interface, and algorithm log interface of each slave FPGA chip; The timer unit has an input end connected to each interface of the external interface unit and an output end connected to the data packet encapsulation unit, and is used to provide a timestamp required for each sample in the sample set during the execution of each algorithm to be evaluated; The data packet encapsulation unit is used to encapsulate the execution time, execution result, execution current and voltage, and algorithm log information according to the definition, and send them to the online analysis module; Each slave FPGA chip execution time interface includes a start pin and an end pin, the start pin of the slave FPGA chip is in input mode, and the end pin of the slave FPGA chip is in output mode, which are respectively used to receive a start signal sent by the master FPGA chip and send a calculation end signal to the master FPGA chip; The master FPGA chip includes a plurality of start pins and a plurality of end pins, wherein the start pins are in output mode and the end pins of the master FPGA chip are in input mode; they are respectively used to send a start signal to the slave FPGA chip and receive a calculation end signal sent by the slave FPGA chip; The start pin and the end pin of the slave FPGA chip are respectively connected to the start pin and the end pin of the master FPGA chip; The data packet encapsulation unit includes packet area 1, packet area 2, packet area 3 and packet area 4; respectively used to package execution time, execution result, current voltage and algorithm log; each packet area includes a packet header, data and a packet tail; The packet header includes a timestamp, an algorithm category, and an information category of execution process information; The timestamp is used to record the occurrence time of each state value of each algorithm to be evaluated; The data packet encapsulation unit also includes a data packet buffer area; The data packet buffer area is used to buffer the data packets encapsulated in the packet area and transmit the data packets to the online analysis module through a direct access memory access mode DMA; The online analysis module is used to parse the package information, extract the data of the corresponding execution process of each algorithm to be evaluated based on the parsed data, analyze and compare the algorithm energy consumption, algorithm efficiency, and algorithm model characteristics of each algorithm to be evaluated, and obtain the optimal algorithm.
2. The online algorithm evaluation device according to claim 1, It is characterized in that The online analysis module includes a data packet receiving module, a data packet parsing module, a data analysis module and an algorithm comparison and analysis module; The data packet receiving module is used to receive data packets transmitted from the data packet buffer area; The data packet parsing module is used to parse the data packets received by the data packet receiving module, extract the data corresponding to the execution process according to the parsed data, and aggregate the data belonging to the same algorithm; The data analysis module is used to analyze the algorithm energy consumption, algorithm efficiency, and algorithm model characteristics of the summarized algorithms to be evaluated, and send the analysis results to the algorithm comparison and analysis module; The algorithm comparison and analysis module compares the algorithms to be evaluated to obtain the optimal algorithm based on the analysis results.
3. The online algorithm evaluation device according to claim 1, It is characterized in that The algorithm energy consumption analysis includes: analyzing the real-time power and peak power of each algorithm to be evaluated based on current and voltage; The algorithm efficiency analysis includes: analyzing the execution time of each algorithm to be evaluated according to the timestamps of the start signal and the end signal; The algorithm model characteristic analysis includes: analyzing the prediction results of each algorithm to be evaluated based on the execution results and the algorithm log; The algorithm log includes the execution process and results of the algorithm to be evaluated on each sample in the sample set.
4. The online algorithm evaluation device according to claim 3, It is characterized in that The information online analysis module also includes a data storage module and a data display module; The data storage module is used to store the data parsed and summarized by the data packet parsing module according to the algorithm category; The data display module is used to display the execution results and power consumption of each algorithm to be evaluated in a graphical manner.
5. The online algorithm evaluation device according to claim 4, It is characterized in that The slave FPGA chips are connected to the same DC regulated power supply via small resistors with the same resistance in series, and the voltage and current acquisition pins of the slave FPGA chips are connected to the external interface unit via an AD converter.
6. An online algorithm evaluation method based on the online algorithm evaluation device according to any one of claims 1 to 5, It is characterized in that The following steps are involved: Collecting execution process information of each algorithm to be evaluated through hardware devices; Packaging and caching the execution process information to obtain a data packet, and then transmitting it to the software unit; The software unit receives the data packet and aggregates the data belonging to the same algorithm; performs algorithm energy consumption, algorithm efficiency, and algorithm model characteristic analysis on each algorithm to be evaluated; and compares each algorithm to be evaluated to obtain the optimal algorithm.
