Full-stack autonomous controllable artificial intelligence reasoning method and terminal based on Feiteng processor
Through the full-stack independent and controllable artificial intelligence reasoning method based on domestic Feiteng processors, the problem of insufficient processing capabilities and autonomous control in the existing technology is solved, and efficient intelligent management and automated control of new energy power generation equipment is realized, improving the efficiency and intelligent management and automation control of new energy power generation equipment. Operational efficiency and safety.
Patent Information
- Application Number
- CN202411314323.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-02-07
AI Technical Summary
The existing artificial intelligence reasoning terminals have shortcomings in processing capabilities and autonomous controllability, and it is difficult to meet the high-standard demands of new energy power generation equipment for intelligence and automation.
Adopt the full-stack autonomous and controllable artificial intelligence inference method based on domestic Feiteng processors, through hardware initialization, model pruning and compression, model conversion and optimization, model compilation and deployment, data preprocessing, inference execution and inference result post-processing, etc. , improve processing performance and system control capabilities.
It significantly improves processing performance and system control capabilities, can monitor equipment status in real time, analyze and judge intelligently, and discover potential problems in a timely manner, reduce manual inspection and maintenance costs, and improve the overall operating efficiency and safety of the equipment.
Smart Images

Figure CN119398114A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence application technology, and specifically discloses a full-stack autonomous and controllable artificial intelligence reasoning method and terminal based on Feiteng processor, which is suitable for the intelligent and digital construction of new energy and traditional power plants. Background Art
[0002] With the rapid development of new energy power generation technologies such as wind power and photovoltaic power generation, the intelligence and automation of power generation equipment are becoming the core areas of research. The complexity of new energy power generation equipment and the high requirements for real-time monitoring and fault diagnosis make it difficult for traditional control and management systems to meet actual application needs. Therefore, improving the intelligence level of power generation equipment has become a key goal.
[0003] Currently, AI inference terminals face many challenges in terms of processing performance and system autonomy and controllability. Specific issues include:
[0004] (1) Insufficient processing power: Existing AI inference terminals often have limitations in processing power and are unable to efficiently process large amounts of data and complex computing tasks. This limits their application effectiveness in real-time monitoring and complex analysis.
[0005] (2) Poor autonomy and controllability: Domestic edge computing is limited by the fact that most chip design companies rely on foreign IP cores to design chips, which has a certain impact on independent innovation. At present, it is difficult to develop an artificial intelligence software ecosystem for domestic inference computing chips.
[0006] In the construction of new energy and traditional thermal power digital power plants, the demand for intelligent inspection, fault warning and safety control is becoming increasingly urgent. These demands require the system to have the ability to monitor equipment status in real time, intelligently analyze and judge, and respond quickly when abnormalities occur. Traditional technical solutions often cannot meet these high standards.
[0007] In order to meet these challenges, it is particularly important to develop a full-stack autonomous and controllable inference terminal based on the domestic Feiteng processor. As a high-performance processor independently developed by China, the Feiteng processor has obvious advantages in computing power and system control. The inference terminal based on the Feiteng processor can significantly improve the processing performance, and through the autonomous and controllable technical architecture, it can better cope with various complex and unexpected situations.
[0008] Specifically, the inference terminal based on Feiteng processor has significant advantages in the following aspects:
[0009] (1) Performance improvement: Feiteng processors have powerful computing capabilities and can efficiently process large amounts of data and support complex artificial intelligence reasoning tasks, which makes real-time monitoring and data analysis faster and more accurate.
[0010] (2) Intelligent inspection: The inference terminal can monitor the equipment status in real time during the operation of the equipment, perform intelligent analysis and judgment, and timely discover potential problems by analyzing the equipment operation data, thus reducing the frequency and cost of manual inspections.
[0011] (3) Fault warning: The inference terminal based on the Feiteng processor has powerful computing power and intelligent algorithms, which can perform real-time analysis of equipment, predict faults and issue early warnings, which can not only reduce downtime, but also reduce maintenance costs and improve the overall operating efficiency of the equipment.
[0012] (4) Security management and control: The inference terminal can effectively ensure the safe operation of the equipment through comprehensive monitoring and intelligent analysis. The system can detect and respond to potential safety hazards in real time, reducing security risks caused by system problems.
[0013] Based on the above problems, the present invention provides a full-stack autonomous and controllable artificial intelligence reasoning method and terminal based on Feiteng processor. Summary of the invention
[0014] Purpose of the invention: The purpose of the invention is to provide a full-stack autonomous and controllable artificial intelligence reasoning method and terminal based on Feiteng processor to solve the problems existing in the background technology. By improving processing performance and system control capabilities, it can effectively meet the high standards of intelligence and automation of new energy power generation equipment, promote the development and optimization of the new energy industry, and has important application prospects in intelligent power generation equipment.
[0015] Technical solution: The first aspect of the present invention provides a full-stack autonomous and controllable artificial intelligence reasoning method based on Feiteng processor, which includes the following steps: Step A: Hardware initialization, by detecting and initializing the CPU and NPU hardware modules of the Feiteng processor, ensuring the normal operation of each module, and dynamically scheduling resources according to the reasoning task requirements, confirming that the NPU hardware module device driver has been loaded, and checking the connection status of related hardware interfaces; Step B: Model pruning and compression, using pruning technology to remove unimportant neuron connections in the model, reduce the model size, and retain key features; Step C: Model conversion and optimization, based on the model trained by the deep learning framework, through the NCSD provided by Feiteng The K tool chain converts and optimizes the model, transforming it into an IR model suitable for execution on the Feiteng processor; Step D: Model compilation and deployment, using the Feiteng NCSDK compilation tool to compile the optimized IR model into a deployment file suitable for the Feiteng NPU hardware module; Step E: Data preprocessing, receiving data from sensors or external input devices, and performing necessary preprocessing on the data; Step F: Inference execution, inputting the preprocessed data into the model, and using the Feiteng processor's NPU hardware module to accelerate the inference process; Step G: Post-processing of inference results, post-processing the inference results, and the inference terminal can adjust parameters and post-processing processes according to actual needs.
[0016] In the technical solution, the NPU hardware module in step A is not limited to X100 NPU, and the connection status of related hardware interfaces includes but is not limited to sensors, networks and storage devices; in step B, the pruned model is retrained using sparse training technology to ensure the reasoning accuracy of the pruned model, and the quantized model weights are further compressed using weight sharing and Huffman coding technology, which significantly reduces the storage space occupancy and improves the loading and running speed of the model; in step C, the model is quantized, and the 8Bit quantization technology is used to reduce the model calculation complexity. At the same time, the parameter distribution of the model is optimized through K-means clustering to improve the reasoning performance and resource utilization of the model. The deep learning framework includes but is not limited to PyTorch; in step D, an appropriate reasoning engine is selected according to the model requirements to perform the model Loading and deployment, the compiled model includes but is not limited to model files, parameter files, weight files, and the inference engine includes but is not limited to phyNPUEngine or phyAIEngine; the preprocessing in step E includes but is not limited to normalization, data enhancement, and image cropping to ensure that the input data meets the input format requirements of model reasoning; in step F, the inference engine executes the reasoning task by calling the execute() function and returns the result; in step G, the inference result is post-processed, including but not limited to threshold filtering, result labeling and other operations on the detection results. For different power generation scenarios, including but not limited to wind power, photovoltaic, hydropower, and thermal power, the inference terminal can adjust parameters and post-processing processes according to actual needs.
[0017] In the technical solution, in step A, the hardware structure in the hardware initialization includes a Feiteng processor and a sensor interface for data acquisition, and a display interface for outputting reasoning results; wherein, the CPU and NPU hardware modules of the Feiteng processor are initialized as an integrated structure, which is designed with efficient execution of artificial intelligence reasoning tasks as the core and has powerful computing power, while the sensor interface and display interface provide flexible scalability and are suitable for complex power generation scenarios.
[0018] In the technical solution, in step B, the model pruning and compression technology significantly optimizes the storage and computing efficiency of the model through multiple steps; first, the pruning technology reduces the model size and reduces the computational complexity by evaluating the importance of each neuron connection and removing those connections that have little impact on the model output. This process retains the key features in the model and reduces the consumption of redundant computing resources; then, after pruning, the model needs to restore its reasoning accuracy through sparse training to adapt to the new sparse structure, and promotes the model to learn the distribution of sparse weights through regularization technology to further optimize the performance; finally, a scale factor γ is introduced and multiplied by the output of the channel, and then the network weights and these scaling factors are jointly trained, and the channels with small scaling factors are directly pruned to fine-tune the pruned network. The objective function is defined as:
[0019]
[0020] Among them, (x, y) is the training input and target, W is the trainable parameter in the network, g(.) is the penalty term on the scaling factor, that is, L1 regularization, λ is the two-term balance factor, f(.) is the feature extraction network, l is the feature input and target loss, and γ is the scale factor.
[0021] In the technical solution, in step B, in terms of model weight compression, the weight sharing technology reduces the storage requirements of model parameters by mapping multiple weight values to a small number of shared values; first, similar weight values are classified and represented by the same shared values, thereby reducing the use of storage space, and then the quantized weights are further compressed using Huffman coding technology. The quantization process converts the floating-point weight values into low-precision representations (such as 8-bit integers). Finally, Huffman coding is used to generate variable-length codes based on the frequency of occurrence of the weights. High-frequency weights are represented by short codes, and low-frequency weights are represented by long codes, thereby effectively compressing the storage requirements of the model.
[0022] In the technical solution, in step C, the NCSDK tool is used to convert and compile neural network models under various deep learning frameworks into a format that can be run on the Feiteng hardware acceleration platform, and to fully utilize the computing power of various chips on the platform in a heterogeneous computing mode, including NPU hardware modules and Feiteng processor CPU, thereby accelerating the reasoning of the model; its main steps are: 1) converting the model generated by the deep learning framework Pytorch into a model based on phyrelay; 2) optimizing, segmenting, adjusting and histogram analysis of the computational graph based on phyrelay; 3) compiling the optimized model into a model file that can be deployed on the Feiteng NPU.
[0023] In the technical solution, in step D, the inference engine first receives the data from the sensor, then pre-processes it and inputs it into the YOLOv5 model for inference, and quickly returns the detection result through an optimized post-processing process; wherein, the inference engine provides an extended interface, allowing the user to customize the inference process according to needs.
[0024] In the technical solution, the step E, data preprocessing is a key step in deep learning model reasoning, ensuring that the original data can be effectively input into the model; first, data is received from sensors or external input devices, including but not limited to images, audio or sensor readings; then, necessary preprocessing is performed on the data, including normalization operation, scaling the data to the range expected by the model to eliminate the impact of different data scales on the model, and data enhancement, rotating, translating or scaling the image to increase the diversity of the data and improve the generalization ability of the model, as well as image cropping, cropping the image into a standard format that meets the model input size; finally, the quality and consistency of the input data are ensured after preprocessing, so that it meets the input format requirements of the model reasoning, thereby improving the performance and accuracy of the model.
[0025] The second aspect of the present invention provides a terminal, which includes a memory, a processor, and a full-stack autonomous and controllable artificial intelligence reasoning program based on a Feiteng processor stored in the memory and executable on the processor. When the processor executes the full-stack autonomous and controllable artificial intelligence reasoning program based on a Feiteng processor, the steps of the full-stack autonomous and controllable artificial intelligence reasoning method based on a Feiteng processor are implemented.
[0026] The third aspect of the present invention provides a computer-readable storage medium, on which is stored a full-stack autonomous and controllable artificial intelligence reasoning program based on a Feiteng processor. When the full-stack autonomous and controllable artificial intelligence reasoning program based on a Feiteng processor is executed by a processor, the steps of the full-stack autonomous and controllable artificial intelligence reasoning method based on a Feiteng processor are implemented.
[0027] Compared with the prior art, the beneficial effects of the full-stack autonomous and controllable artificial intelligence reasoning method and terminal based on Feiteng processor of the present invention are: optimizing the intelligent management requirements of new energy power generation and traditional power generation, integrating YOLOv5 deep learning algorithm, and performing quantization, pruning and weight compression optimization processing on it, the present invention not only significantly improves the reasoning accuracy, but also effectively reduces the system delay and power consumption. The method has real-time inspection and safety control functions, can efficiently monitor power generation equipment, significantly improves the intelligent level of operation, reduces the unpredictable factors of human operation, thereby improving production efficiency and safety. This innovative solution provides strong technical support for intelligent power generation management. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 It is the overall process structure diagram of the present invention;
[0030] Figure 2 Flowchart for Feiteng X100 NPU usage;
[0031] Figure 3 Deploy a flowchart for the model;
[0032] Figure 4 This is an example of the results of the present invention. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0034] In the description of the present invention, it should be noted that the orientations or positional relationships indicated by the terms "top", "bottom", "one side", "the other side", "front", "back", "middle part", "inside", "top end", "bottom end", etc. are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention; the terms "first", "second", and "third" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance; in addition, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0035] The full-stack autonomous and controllable artificial intelligence reasoning method and terminal based on Feiteng processor of the present invention can integrate domestic autonomous and controllable CPU and NPU, and apply advanced artificial intelligence technology to meet the intelligent needs in the construction of new energy (such as wind power, photovoltaic), hydropower and traditional thermal power digital power plants.
[0036] The reasoning method improves analysis accuracy and reduces latency by designing and optimizing the YOLOv5 algorithm model. The method uses the following technical means:
[0037] Model quantization technology: Optimize the parameters of the YOLOv5 model and retrain the sparsely connected network by pruning unimportant connections. Then, use weight sharing and Huffman coding technology to further compress the quantized weights and codebook, significantly reducing the storage requirements of the model.
[0038] Channel pruning technology: Prune the channels of the YOLOv5 model to reduce the width of the feature map, compress the model structure, and enhance the model's expressiveness and generalization capabilities.
[0039] Based on the domestically produced self-controllable Feiteng processor: It integrates the processing architecture based on the domestic Feiteng X100 NPU, supports the inference optimization of deep learning models such as YOLOv5, and enables the equipment to show higher operating efficiency and safety in scenarios such as safety management and intelligent inspection in various power generation operations.
[0040] In order to achieve the above purpose, Figure 1 , Figure 2 and Figure 3 As shown, the technical solution proposed by the present invention is:
[0041] Step A: Hardware initialization: Ensure that each module works properly by detecting and initializing the CPU and NPU hardware modules of the Feiteng processor, dynamically schedule resources according to the requirements of the inference task, confirm that the NPU hardware module device driver has been loaded, and check the connection status of related hardware interfaces, including sensors, networks, and storage devices.
[0042] The X100 NPU used in the present invention is a component specially used for accelerating neural network calculations. It adopts ASIC design and has a high computing power-to-energy ratio. Its computing power is INT81TOPS and its frequency is 300MHz. It is mainly used for neural network reasoning in the image field and supports common DNN operators such as convolution, transposed convolution, pooling, full connection, and activation.
[0043] Hardware structure: It includes the Feiteng processor (CPU and NPU integrated into one), which is designed with the core of efficiently executing artificial intelligence reasoning tasks and provides powerful computing power; it also includes a sensor interface for data acquisition and a display interface for outputting reasoning results, providing flexible scalability and suitable for complex power generation scenarios.
[0044] Step B: Model pruning and compression: Use pruning technology to remove unimportant neuron connections in the model, reduce the model size, and retain key features; use sparse training technology to retrain the pruned model to ensure the inference accuracy of the pruned model; use weight sharing and Huffman coding technology to further compress the quantized model weights, significantly reduce storage space occupancy, and improve the loading and running speed of the model.
[0045] Model pruning and compression technology significantly optimizes the storage and computing efficiency of the model through multiple steps. First, pruning technology reduces the size of the model and reduces the computational complexity by evaluating the importance of each neuron connection and removing those connections that have little impact on the model output. This process retains the key features in the model and reduces the consumption of redundant computing resources. After pruning, the model needs to restore its reasoning accuracy through sparse training to adapt to the new sparse structure, and promotes the model to learn the distribution of sparse weights through regularization technology to further optimize performance. Finally, the present invention introduces a scale factor γ, which is multiplied by the output of the channel, and then jointly trains the network weights and these scaling factors, directly prunes the channels with small scaling factors, and fine-tunes the pruned network.
[0046] In particular, the objective function of the present invention is defined as:
[0047]
[0048] Among them, (x, y) is the training input and target, W is the trainable parameter in the network, g(.) is the penalty term on the scaling factor, that is, L1 regularization, λ is the two-term balance factor, f(.) is the feature extraction network, l is the feature input and target loss, and γ is the scale factor.
[0049] In terms of model weight compression, weight sharing technology reduces the storage requirements of model parameters by mapping multiple weight values to a small number of shared values. Specifically, similar weight values are classified and represented by the same shared value, thereby reducing the use of storage space; then, Huffman coding technology further compresses the quantized weights; the quantization process converts the floating-point weight values into low-precision representations (such as 8-bit integers), and then uses Huffman coding to generate variable-length codes based on the frequency of occurrence of the weights, so that high-frequency weights are represented by short codes and low-frequency weights are represented by long codes, thereby effectively compressing the storage requirements of the model.
[0050] Step C: Model conversion and optimization: Based on the model trained by the deep learning framework (PyTorch), the NCSDK tool chain provided by Phytium is used to convert and optimize the model into an intermediate representation (IR) file suitable for execution on the Phytium processor. The model is quantized, and 8-bit quantization technology is used to reduce the computational complexity of the model. At the same time, the parameter distribution of the model is optimized through K-means clustering to improve the inference performance and resource utilization of the model.
[0051] The NCSDK (Neural Compute Software Development Kit) tool is used to convert and compile neural network models under various deep learning frameworks into a format that can run on the Feiteng hardware acceleration platform, and to fully utilize the computing power of various chips on the platform in a heterogeneous computing mode, including NPU hardware modules, GPU hardware modules, and CPU hardware modules, thereby accelerating the reasoning of the model. Its main steps are: 1) Convert the model generated by the deep learning framework Pytorch into a model based on phyrelay; 2) Optimize, split, adjust, and analyze the histogram of the computational graph based on phyrelay; 3) Compile the optimized model into a model file that can be deployed on the Feiteng NPU hardware module.
[0052] Step D: Model compilation and deployment: Use the compilation tool of Feiteng NCSDK to compile the optimized IR model into a deployment file suitable for the Feiteng NPU hardware module, and select the appropriate inference engine (such as phyNPUEngine or phyAIEngine) according to the model requirements to load and deploy the model; the compiled model includes model files, parameter files, weight files, etc.
[0053] Inference engine: In actual applications, the inference engine first receives data from sensors, pre-processes it and inputs it into the YOLOv5 model for inference, and quickly returns the detection results through an optimized post-processing process. It also provides an extension interface to allow users to customize the inference process according to their needs.
[0054] Step E: Data preprocessing: Receive data from sensors or external input devices and perform necessary preprocessing on the data (such as normalization, data enhancement, image cropping, etc.) to ensure that the input data meets the input format requirements of the model reasoning.
[0055] Data preprocessing is a key step in deep learning model reasoning, ensuring that the raw data can be effectively input into the model. First, data is received from sensors or external input devices, which may include images, audio, or sensor readings. Then, the data is preprocessed as necessary, including normalization operations to scale the data to the range expected by the model to eliminate the impact of different data scales on the model; data augmentation, such as rotating, translating, or scaling images, to increase data diversity and improve the generalization ability of the model; and image cropping, cropping the image into a standard format that meets the model input size. Finally, these preprocessing steps ensure the quality and consistency of the input data so that it meets the input format requirements for model reasoning, thereby improving the performance and accuracy of the model.
[0056] Step F: Inference execution: Input the preprocessed data into the model, use the NPU of the Feiteng processor to accelerate the inference process, and the inference engine executes the inference task by calling the execute() function and returns the result.
[0057] Perform synchronous or asynchronous reasoning based on task requirements to ensure efficient use of hardware resources and reduce reasoning latency.
[0058] Step G: Post-processing of inference results: Post-process the inference results, including threshold filtering of detection results, result labeling and other operations. For different power generation scenarios (such as wind power, photovoltaic, hydropower, and thermal power), the inference terminal can adjust parameters and post-processing processes according to actual needs.
[0059] The present invention effectively improves the inference accuracy and reduces the system delay and power consumption by introducing the YOLOv5 deep learning algorithm and performing quantization, pruning and weight compression optimization. The method and terminal are particularly suitable for the intelligent management of new energy power generation and traditional power generation, and can realize real-time inspection and safety control of power generation equipment, improve the intelligent level of operation, reduce the uncertainty caused by human operation, and improve production efficiency and safety.
[0060] Figure 4 This is an application example of the full-stack autonomous and controllable artificial intelligence reasoning method and terminal based on Feiteng processor of the present invention.
[0061] It should be noted that, in this article, terms such as "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0062] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A full-stack autonomous and controllable artificial intelligence reasoning method based on Feiteng processor, characterized by: The following steps are included: Step A: Hardware initialization, by detecting and initializing the CPU and NPU hardware modules of the Feiteng processor, ensuring that each module works normally, dynamically scheduling resources according to the requirements of the inference task, confirming that the NPU hardware module device driver has been loaded, and checking the connection status of related hardware interfaces; Step B: Model pruning and compression: Use pruning technology to remove unimportant neuron connections in the model, reduce the model size, and retain key features; Step C: Model conversion and optimization: Based on the model trained by the deep learning framework, the model is converted and optimized through the NCSDK tool chain provided by Phytium, and converted into an IR model suitable for execution on the Phytium processor; Step D: Model compilation and deployment: Use the compilation tool of Feiteng NCSDK to compile the optimized IR model into a deployment file suitable for Feiteng NPU hardware module; Step E: Data preprocessing, receiving data from sensors or external input devices and performing necessary preprocessing on the data; Step F: Inference execution, input the preprocessed data into the model and use the NPU hardware module of the Feiteng processor to accelerate the inference process; Step G: Post-processing of inference results. The inference results are post-processed, and the inference terminal can adjust parameters and post-processing procedures according to actual needs.
2. The full-stack autonomous and controllable artificial intelligence reasoning method based on Feiteng processor according to claim 1 is characterized in that: The NPU hardware module in step A includes but is not limited to X100 NPU, and the connection status of related hardware interfaces, including but not limited to sensors, networks and storage devices; In step B, the pruned model is retrained using sparse training technology to ensure the reasoning accuracy of the pruned model, and the quantized model weights are further compressed using weight sharing and Huffman coding technology, which significantly reduces storage space usage and improves the loading and running speed of the model; In step C, a model quantization operation is performed, and 8-bit quantization technology is used to reduce the model calculation complexity. At the same time, the parameter distribution of the model is optimized by K-means clustering to improve the reasoning performance and resource utilization of the model. The deep learning framework includes but is not limited to PyTorch; In the step D, an appropriate inference engine is selected according to the model requirements to load and deploy the model, the compiled model includes but is not limited to the model file, parameter file, weight file, and the inference engine includes but is not limited to phyNPUEngine or phyAIEngine; The preprocessing in step E includes but is not limited to normalization, data enhancement, and image cropping to ensure that the input data meets the input format requirements of the model reasoning; In step F, the inference engine executes the inference task by calling the execute() function and returns the result; In step G, the inference results are post-processed, including but not limited to threshold filtering, result labeling and other operations on the detection results. For different power generation scenarios including but not limited to wind power, photovoltaic, hydropower, and thermal power, the inference terminal can adjust parameters and post-processing procedures according to actual needs.
3. The full-stack autonomous and controllable artificial intelligence reasoning method based on Feiteng processor according to claim 1 or 2 is characterized in that: In step A, the hardware structure in the hardware initialization includes a Feiteng processor and a sensor interface for data acquisition, as well as a display interface for outputting inference results.
4. The full-stack autonomous and controllable artificial intelligence reasoning method based on Feiteng processor according to claim 1 or 2 is characterized in that: In step B, the model pruning and compression technology significantly optimizes the storage and computing efficiency of the model through multiple steps; First, pruning technology reduces the size of the model and reduces computational complexity by evaluating the importance of each neuron connection and removing those connections that have little impact on the model output. This process retains the key features of the model and reduces the consumption of redundant computing resources. Then, after pruning, the model needs to restore its reasoning accuracy through sparse training to adapt to the new sparse structure, and use regularization techniques to promote the model to learn the distribution of sparse weights to further optimize performance; Finally, a scale factor γ is introduced and multiplied by the output of the channel. Then the network weights and these scaling factors are jointly trained, and the channels with small scaling factors are directly pruned to fine-tune the pruned network. The objective function is defined as: Among them, (x, y) is the training input and target, W is the trainable parameter in the network, g(.) is the penalty term on the scaling factor, that is, L1 regularization, λ is the two-term balance factor, f(.) is the feature extraction network, l is the feature input and target loss, and γ is the scale factor.
5. The full-stack autonomous and controllable artificial intelligence reasoning method based on Feiteng processor according to claim 4 is characterized in that: In step B, in terms of model weight compression, the weight sharing technology reduces the storage requirements of model parameters by mapping multiple weight values to a small number of shared values; First, similar weight values are classified and represented by the same shared value. Then, Huffman coding technology is used to further compress the quantized weights. The quantization process converts the floating-point weight values into low-precision representations. Finally, Huffman coding is used to generate variable-length codes based on the frequency of occurrence of the weights. High-frequency weights are represented by short codes, and low-frequency weights are represented by long codes.
6. The full-stack autonomous and controllable artificial intelligence reasoning method based on Feiteng processor according to claim 1 or 2 is characterized in that: In step C, the NCSDK tool is used to convert and compile neural network models under various deep learning frameworks into a format that can be run on the Feiteng hardware acceleration platform, and to fully utilize the computing power of various chips on the platform, including NPU hardware modules and CPUs, in a heterogeneous computing mode, thereby accelerating the reasoning of the model; The main steps are: 1) Convert the model generated by the deep learning framework Pytorch into a model based on phyrelay; 2) Optimize, split, adjust and analyze histogram of computational graphs based on phyrelay; 3) Compile the optimized model into a model file that can be deployed on Feiteng NPU.
7. The full-stack autonomous and controllable artificial intelligence reasoning method based on Feiteng processor according to claim 1 or 2 is characterized in that: In step D, the inference engine first receives the data from the sensor, then pre-processes it and inputs it into the YOLOv5 model for inference, and quickly returns the detection results through an optimized post-processing process; The inference engine provides an extended interface, allowing users to customize the inference process according to their needs.
8. The full-stack autonomous and controllable artificial intelligence reasoning method based on Feiteng processor according to claim 1 or 2 is characterized in that: Step E, data preprocessing is a key step in deep learning model reasoning, ensuring that the original data can be effectively input into the model; First, receiving data from sensors or external input devices, including but not limited to images, audio, or sensor readings; Then, the data is preprocessed as necessary, including normalization to scale the data to the range expected by the model to eliminate the impact of different data scales on the model, data augmentation to rotate, translate or scale the image to increase data diversity and improve the generalization ability of the model, and image cropping to crop the image to a standard format that meets the model input size; Finally, the quality and consistency of the input data are ensured after preprocessing, so that it meets the input format requirements for model reasoning.
9. A terminal, characterized in that: The terminal includes a memory, a processor, and a full-stack autonomous and controllable artificial intelligence reasoning program based on a Feiteng processor stored in the memory and executable on the processor. When the processor executes the full-stack autonomous and controllable artificial intelligence reasoning program based on a Feiteng processor, the steps of the full-stack autonomous and controllable artificial intelligence reasoning method based on a Feiteng processor as described in any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a full-stack autonomous and controllable artificial intelligence reasoning program based on the Feiteng processor. When the full-stack autonomous and controllable artificial intelligence reasoning program based on the Feiteng processor is executed by the processor, the steps of the full-stack autonomous and controllable artificial intelligence reasoning method based on the Feiteng processor as described in any one of claims 1-8 are implemented.
Citation Information
Cited By
Full-stack NPU system supporting multi-stage fault mitigation mechanism
CN120256212A