Model deployment method based on pruning compression in edge device
By analyzing the hardware architecture and building a joint constraint set on edge devices, dynamically generating an upper limit on the network layer compression ratio, reserving redundant weight blocks in key layers, and optimizing pruning parameters in real time, the resource constraints and environmental adaptability issues of model deployment on edge devices are resolved, achieving model adaptability and continuous optimization.
Patent Information
- Application Number
- CN202511127140.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-08-13
AI Technical Summary
When deploying deep neural network models on edge devices, existing technologies face problems such as excessive inference latency, memory overflow, and excessive power consumption. In addition, pruning decisions are separated from deployment and operation, making it difficult to adapt to environmental changes and data drift, resulting in continuous performance degradation.
By analyzing the hardware architecture of edge devices, building a joint constraint set, dynamically generating the upper limit of the network layer compression ratio, reserving redundant weight blocks in the key layer, perceiving the deployment environment in real time, triggering the online fine-tuning mechanism to optimize the pruning parameters, and achieving model adaptation and performance optimization.
It effectively avoids the risk of model crash, ensures compliance with resource constraints, provides space for performance adjustment, reduces performance repair costs, and improves the flexibility and stability of model deployment.
Smart Images

Figure CN120633749A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of edge computing and relates to a model deployment method based on pruning compression in an edge device. Background Art
[0002] With the widespread adoption of artificial intelligence in edge computing scenarios, the high computational complexity and parameter count of deep neural network models are constrained by the limited computing power, storage capacity, and power consumption budget of edge devices. Deploying unoptimized raw models directly can lead to issues such as excessive inference latency, memory overflows, and excessive power consumption, resulting in service interruptions or device anomalies.
[0003] Model pruning technology reduces computational load by removing redundant parameters and structural units, and has become a core optimization tool for edge model deployment. Existing technologies primarily achieve compression through pruning pre-trained models, but still suffer from the following drawbacks: 1. Existing technologies often use static compression strategies, such as fixed compression ratios or global thresholds, and fail to effectively dynamically adjust pruning intensity based on the actual hardware configuration of edge devices and the internal topological characteristics of the model. This can easily lead to over-compression of the model's critical paths or inability to respond to changes in resource constraints during device runtime.
[0004] 2. After the existing technology model is compressed and deployed on edge devices, the structure becomes rigid and cannot adapt to changes in the runtime environment and data drift, resulting in continuous degradation of online performance and difficulty in recovery.
[0005] 3. Existing technologies separate pruning decisions from deployment and maintenance, lacking an iterative optimization path for pruning parameters based on online performance feedback. This can easily lead to the need for full redeployment when performance degradation occurs. Summary of the Invention
[0006] In view of this, in order to solve the problems raised in the above background technology, a model deployment method based on pruning compression in edge devices is proposed.
[0007] The purpose of the present invention can be achieved through the following technical solutions: The present invention provides a model deployment method based on pruning compression in an edge device, including: parsing the hardware architecture configuration of the target edge device, and constructing a joint constraint condition set including computing power, storage capacity and power consumption thresholds.
[0008] According to the joint constraint condition set and the inter-layer dependency of the model to be deployed, the upper limit of the compression ratio of each network layer of the model to be deployed is determined as the pruning boundary parameter.
[0009] A hybrid pruning operation is performed on the model to be deployed based on the pruning boundary parameters, and redundant weight blocks are reserved at key network layers.
[0010] The pruned model is compiled to adapt to the deployment and operation requirements of the target edge device. After the model is deployed, the operational interference characteristics of the deployment environment are perceived in real time during operation.
[0011] When the operation interference feature reaches a preset accuracy threat threshold, an online fine-tuning mechanism is triggered to update the redundant weight block parameters, and the pruning boundary parameters are iteratively optimized based on the fine-tuning performance feedback data.
[0012] Compared with the existing technology, the beneficial effects of the present invention are as follows: (1) The present invention dynamically generates the upper limit of the compression ratio of each network layer by comprehensively considering the hardware configuration constraints of the target edge device and the inter-layer dependencies of the model to be deployed, thereby avoiding the risk of model crash caused by the static pruning strategy of the existing technology and effectively promoting compliance with resource constraints, thereby ensuring that the inference task will not exceed the limit.
[0013] (2) The present invention actively reserves redundant weight blocks in the key network layer, which not only satisfies the current deployment constraints through pruning, but also reserves performance adjustment space for subsequent dynamic load changes of edge devices, thereby achieving continuous adaptation and performance optimization of the model on resource-constrained edge devices.
[0014] (3) The present invention identifies over-compression layers based on redundant weight block update data to provide feedback for down-adjustment optimization references, thereby achieving closed-loop optimization of pruning parameters and real-time performance, significantly reducing the time cost and resource consumption of performance repair, and improving the flexibility and stability of model deployment in edge devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. 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 creative work.
[0016] Figure 1 The present invention is a flowchart of the steps for implementing the method.
[0017] Figure 2 This is a logic flow chart of compiling the pruned model according to the present invention.
[0018] Figure 3 This is a logic flow chart of fine-tuning of redundant weight blocks according to the present invention. DETAILED DESCRIPTION
[0019] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0020] See also Figure 1 As shown, the present invention provides a model deployment method based on pruning compression in an edge device, including: S11. parsing the hardware architecture configuration of the target edge device and constructing a joint constraint condition set including computing power, storage capacity and power consumption threshold.
[0021] In a preferred embodiment of the present invention, the hardware architecture configuration parsing process of the target edge device includes: calling the number of cores and main frequency parameters of the device processor, determining the single-core floating-point operation peak value based on the processor architecture characteristics, generating the multi-core effective floating-point operation peak value through multi-core parallel efficiency calibration, and converting it into computing power constraint parameters to define the upper limit of the number of floating-point operations that can be executed per second during the inference process of the model to be deployed.
[0022] It should be noted that the above-mentioned multi-core parallel efficiency calibration process includes: calling the target edge device processor microarchitecture parameters, which at least include the processor cache hit rate, branch prediction accuracy and parallel acceleration ratio, and using the cumulative calculation results of the indicators in the microarchitecture parameters as calibration data, which are superimposed on the single-core floating-point operation peak to generate the multi-core effective floating-point operation peak.
[0023] An exemplary implementation of converting the multi-core effective floating-point operation peak into a computing capacity constraint parameter is to multiply the multi-core effective floating-point operation peak by a preset heat dissipation adjustment coefficient, wherein the heat dissipation adjustment coefficient is dynamically set according to the heat dissipation capacity of the device and its value range is To ensure that computing power constraints meet the long-term stable operation requirements of the equipment.
[0024] The physical address mapping table of the device's memory management unit is read to obtain the total physical capacity of the dynamic random access memory. Combined with the actual read and write bandwidth of the memory, a storage capacity constraint parameter is generated to define the upper limit of the memory allowed to be occupied by the model to be deployed.
[0025] It should be noted that the above-mentioned storage capacity constraint parameter can be determined as the inverse of the product of the total physical capacity of the dynamic random access memory and the actual read and write bandwidth of the memory. The basis for this is that high bandwidth can partially compensate for the defects of small-capacity devices, while large capacity can alleviate the pressure of low-bandwidth devices. The inverse of the product of the two can quantify the effective load capacity of the storage unit.
[0026] Retrieve the idle state basic power consumption data and fully loaded state peak power consumption data recorded in the device power consumption log, map the power threshold constraint parameters based on the state deviation, and define the upper limit of sustainable power consumption during the inference process of the model to be deployed.
[0027] It should be noted that the power threshold constraint parameter mapping process is as follows: the absolute difference between the basic power consumption and the peak power consumption is used as the allocable power consumption margin, and the allocable power consumption margin is superimposed with the preset proportional coefficient to map the upper limit of the sustainable power consumption of the model. The preset proportional coefficient is associated with the redundancy of the device heat dissipation design to ensure that the power consumption is constrained within the thermal safety boundary of the device, and its value range can also be For example, the preset proportional coefficient of forced air cooling equipment relative to natural heat dissipation equipment is higher.
[0028] S12. According to the joint constraint set and the inter-layer dependencies of the model to be deployed, determine the upper limit of the compression ratio of each network layer of the model to be deployed as a pruning boundary parameter.
[0029] In a preferred embodiment of the present invention, the inter-layer dependency relationship of the model to be deployed includes the following: mapping the network layer of the model to be deployed into nodes, mapping the inter-layer data flow into directed edges, and generating a directed acyclic graph.
[0030] The nonlinear dependency path in the directed acyclic graph is identified according to the special connection relationship between nodes of the residual connection and the cross-layer jump connection.
[0031] It should be noted that the above-mentioned cross-layer jump connection refers to a connection relationship between a node and another node that is separated by at least one network layer and has a direct connection edge. The residual connection refers to a connection relationship that contains an identity mapping branch. The identification of nonlinear dependency paths is mainly achieved by traversing the cross-layer jump connection edges of each node and the mapping branch edges in the residual connection.
[0032] The dependency sensitivity strength of each node relative to its successor node is quantified through reverse gradient propagation simulation, and the dependency sensitivity strength is planned to a corresponding dependency sensitivity level according to a preset division rule. The dependency sensitivity level includes low, medium or high.
[0033] It should be noted that the specific process of simulating and quantifying the dependency sensitivity strength of each node relative to its successor node through reverse gradient propagation includes: starting backpropagation based on the model training loss function, calculating the partial derivative of each node output with respect to its successor node input layer by layer through the chain rule, using the absolute value of the partial derivative as the benchmark for the influence strength of the node on its successor node, taking the average of the absolute values of the partial derivatives under multiple samples, and generating a dependency sensitivity strength value.
[0034] The model training loss function is an optimization objective function predefined in the model training stage, and its form is determined according to the task type. For example, the classification task uses the cross entropy loss, and the regression task uses the mean square error loss.
[0035] The preset division rule content includes the dependency sensitivity strength intervals corresponding to each dependency sensitivity level, which can be obtained by counting the dependency sensitivity strengths of all nodes on the test set to fit the cumulative distribution function and dividing the intervals according to the natural inflection points of the function.
[0036] In a preferred embodiment of the present invention, the process of determining the upper limit of the compression ratio of each network layer of the model to be deployed includes: decomposing the joint constraint condition set into a subset of joint constraint conditions for each network layer according to the computing intensity, parameter redundancy and power consumption sensitivity attributes of each network layer, and determining the initial compression ratio upper limit based on the subset.
[0037] It should be noted that the process of decomposing the subset of joint constraints of the above-mentioned network layers includes: counting the number of floating-point operations of unit input data of each network layer, and using the proportion of floating-point operations as the computing intensity distribution ratio to decompose the computing power constraint parameters.
[0038] The L1 norm sparsity rate of the weights of each network layer is calculated to evaluate the parameter redundancy. The storage capacity constraint parameters are allocated according to the redundancy ratio to generate the maximum compressible parameter amount of each network layer.
[0039] The inference power consumption ratio of each network layer is measured at the reference frequency, and the power threshold constraint parameters are allocated according to the power consumption ratio to generate the allowable power consumption increment of each network layer.
[0040] The initial compression ratio upper limit is modified, and the modification includes: i. if the network layer is a mapping node of a nonlinear dependent path, then the initial compression ratio upper limit thereof is reduced according to a preset adjustment amplitude.
[0041] ii. If there are high-level dependency sensitivity nodes in the subsequent nodes of the network layer, the upper limit of the initial compression ratio will be lowered in a step-by-step manner according to the number of subsequent high-level dependency sensitivity nodes.
[0042] It should be noted that the above-mentioned step-by-step reduction rule can be exemplarily referred to the following content: when the number of subsequent high-level dependency sensitivity nodes is 0, the initial compression ratio upper limit is maintained unchanged.
[0043] When the quantity is 1, it is reduced according to the first preset reduction ratio.
[0044] When the quantity is greater than or equal to 2, it is reduced according to the second preset reduction ratio.
[0045] The second preset reduction ratio is greater than the first preset reduction ratio, and the range of the first and second reduction ratios can be .
[0046] iii. If the network layer satisfies both conditions i and ii, the preset adjustment amplitude of condition i shall be applied first.
[0047] It is worth noting that the downward correction ratio of condition i is usually greater than that of condition ii. The reason is that pruning nodes on nonlinear dependent paths will cause the model structure to break, and its risk is higher than that of single-point accuracy degradation.
[0048] Bind the corrected initial compression ratio upper limit to the corresponding network layer to determine the compression ratio upper limit of each network layer of the model to be deployed.
[0049] The embodiment of the present invention dynamically generates the upper limit of the compression ratio of each network layer by comprehensively considering the hardware configuration constraints of the target edge device and the inter-layer dependencies of the model to be deployed, avoiding the risk of model crash caused by the static pruning strategy in the existing technology, and effectively promoting compliance with resource constraints, thereby ensuring that the inference task will not exceed the limit.
[0050] S13. Perform a hybrid pruning operation on the to-be-deployed model based on the pruning boundary parameters, and reserve redundant weight blocks on the key network layer.
[0051] In a preferred embodiment of the present invention, the hybrid pruning operation is performed on the model to be deployed based on the pruning boundary parameters, including: evaluating the gradient characteristics of each structural unit in the model to be deployed through a verification loss function, marking the structural units whose gradient characteristics meet the preset influence conditions as protected structural units, and forcibly retaining them during the hybrid pruning process.
[0052] It should be noted that the above-mentioned preset influencing conditions specifically refer to the preset multiples by which the gradient characteristics exceed the average level of similar structures.
[0053] Contribution determination is performed on the remaining unlabeled structural units, structural units with low contribution attributes in each network layer are identified and their structural type identifiers are obtained, wherein the structural type identifiers include convolution kernels, neurons or output channels.
[0054] It should be noted that the above-mentioned contribution determination of the remaining unlabeled structural units is an adaptive type determination process, specifically: performing a feature map reconstruction error test on the convolution kernel to generate a first contribution score, performing activation sparsity analysis on the neurons to generate a second contribution score, and calculating the output tensor norm of the output channel to generate a third contribution score.
[0055] Select a preset sensitivity coefficient based on the structure type. If the contribution score is lower than the mean of the structural units on the same layer minus the preset sensitivity coefficient times the standard deviation, it is determined to be a low contribution unit.
[0056] Based on the pruning boundary parameters, structural units with low contribution attributes in each network layer are selectively removed to construct multiple groups of hybrid pruning schemes. The optimal pruning scheme is screened out and executed through accuracy verification. The optimal pruning scheme is the pruning scheme with the least impact on model accuracy.
[0057] It should be noted that the above accuracy verification process is as follows: select a representative sample subset from the complete verification set, perform pruned model inference and calculate the comprehensive performance score of task adaptation, quantify the similarity of feature distribution between the pruned model and the original model at each layer, fuse the performance score and feature fidelity to generate the final verification score, and map the accuracy based on the final verification score.
[0058] In a preferred embodiment of the present invention, reserving redundant weight blocks in key network layers includes: identifying key network layers that undertake main feature extraction functions through norm indicators accumulated by reverse gradient propagation simulation.
[0059] It should be noted that the above-mentioned key network layer identification process is as follows: extract the maximum dependency sensitivity strength within the layer and calculate the density of the proportion of highly sensitive nodes in the layer, linearly weight the two to generate the layer sensitivity index, arrange the network layers in descending order according to the sensitivity index, detect the inflection point position where the relative change rate of the sensitivity index falls below the preset threshold, and mark all layers before the inflection point position as key network layers.
[0060] When performing a hybrid pruning operation on the key network layer, some low-contribution structural units that should be removed according to the pruning boundary parameters are retained, or new structural units with the same type identifier as the original structural unit and an initial parameter value of zero are configured in the position of the removed structural units.
[0061] During initial deployment, the retained or newly added structural units are inactive, and data flow is only passed in forward reasoning.
[0062] S14. Compile the pruned model to adapt to the deployment and operation requirements of the target edge device. After the model is deployed, it perceives the operational interference characteristics of the deployment environment in real time during operation.
[0063] Reference Figure 2 As shown, in a preferred embodiment of the present invention, the compilation of the pruned model includes the following: scanning the computational graph structure of the pruned model, identifying mergeable continuous operator sequences and performing equivalent fusion.
[0064] Match the fused and unfused operators to the native instruction set of the target edge device hardware accelerator.
[0065] Perform storage format conversion on operator weight data to adapt to the parallel computing architecture of the target device.
[0066] The matching hardware instructions are organized according to the computational graph data flow, and compiled to generate binary files that can be directly loaded and executed.
[0067] In a preferred embodiment of the present invention, the operational interference characteristics of the real-time perception deployment environment include the following: statistical characteristic data of the model input data is periodically collected, including the mean, variance and distribution divergence of the input data relative to the training data set.
[0068] Synchronously collect the operating characteristic data of the target edge device, including processor load rate, available memory capacity and device temperature parameters.
[0069] The statistical feature data and the operating feature data are combined into a current state vector, a multidimensional offset value of the current state vector relative to a preset reference state vector is calculated, and the multidimensional offset value is mapped into a threat indicator that characterizes the potential damage degree of current environmental interference to the model output accuracy.
[0070] It should be noted that the above-mentioned preset benchmark state vector is derived from a combination of typical characteristic data collected during the initial stable operation phase of the device during deployment or in a standard laboratory test environment, namely, the statistical characteristic data of the above-mentioned model input data and the operating characteristic data of the target edge device. This benchmark represents the reference state under expected normal operating conditions.
[0071] It should also be noted that the specific process of mapping the above-mentioned multidimensional offset value into a threat indicator includes: formulating a threshold table representing each element in the state vector based on historical fault data, wherein each element includes an offset value interval corresponding to its offset normal state, offset warning state and offset risk state, preset threat factors corresponding to the offset normal state, offset warning state and offset risk state, and retrieving the preset threat factors corresponding to each element in the multidimensional offset value of the current state vector relative to the preset reference state vector with reference to the threshold table, and giving each element a preset influence weight based on industry experience to carry out linear weighted processing to obtain a threat indicator.
[0072] S15. When the operation interference feature reaches a preset accuracy threat threshold, trigger the online fine-tuning mechanism to update the redundant weight block parameters, and iteratively optimize the pruning boundary parameters based on the fine-tuning performance feedback data.
[0073] It should be noted that the preset accuracy threat threshold is dynamically adjusted according to the maximum allowable accuracy decay rate of the model on the validation set.
[0074] Reference Figure 3 As shown, in a preferred embodiment of the present invention, the redundant weight block fine-tuning process includes: pausing the model inference task and activating the writable state of the redundant weight block reserved for the key network layer.
[0075] Based on the current input data, the loss value is calculated using predefined self-supervision rules.
[0076] It should be noted that the above-mentioned current input data specifically refers to the input data cache when the model inference task is suspended. The specific process of calculating the loss value through the predefined self-supervision rule is to calculate the reconstruction error between the output of the redundant weight block and the original input data in the preset feature dimension.
[0077] Constrain the backpropagation path to redundant weight block memory areas in the computational framework to generate local gradients.
[0078] It should be noted that the above-mentioned local gradient implementation process is as follows: the physical memory address range of the redundant block is pre-registered in the computing framework. During backpropagation, the framework only calculates and stores the gradient within this address range, and the gradients in other areas are forced to be zero. The gradient write permission is restricted through hardware instructions or memory management units to ensure that the gradient only updates the redundant weight block parameters. Examples of computing frameworks include TensorRT and ONNX Runtime.
[0079] The redundant weight block parameters are updated in situ using an optimization algorithm. After the update is completed, the redundant weight block is locked in read-only mode and reloaded to the main model to resume the inference task.
[0080] It should be added that the above optimization algorithm can be implemented through an optimizer, such as SGD with a fixed learning rate or a pre-compiled Rprop rule.
[0081] The embodiment of the present invention actively reserves redundant weight blocks in the key network layer, which not only meets the current deployment constraints through pruning, but also reserves performance adjustment space for subsequent dynamic load changes of edge devices, thereby realizing continuous adaptation and performance optimization of the model on resource-constrained edge devices.
[0082] In a preferred embodiment of the present invention, the iterative optimization of pruning boundary parameters includes: recording the update amplitude, update frequency and accuracy gain of each key network layer redundant weight block.
[0083] The compression degree is quantified according to the update amplitude and the update frequency, and the over-compression layer is determined based on the correlation between the compression degree and the accuracy gain.
[0084] It should be noted that the above-mentioned method for quantifying the degree of compression can be exemplified as follows: performing ratio operations on the update frequency and update amplitude with their corresponding preset benchmark values, and accumulating the ratio operation results to obtain a specific compression degree value, wherein the preset benchmark value can be obtained through experimental calibration to retrieve the minimum standard that meets the core function or accuracy requirements.
[0085] The process of determining an over-compression layer is as follows: iterate the compression degree and precision gain during each fine-tuning of the redundant weight blocks of the key network layer to construct a fitting curve of compression degree-precision gain, and determine the slope value by derivation of the curve. When the slope of the precision gain decreasing with the compression degree exceeds the preset sensitivity threshold, the layer is marked as an over-compression layer, and based on the slope value and the inter-layer dependency weight, the pruning boundary down-adjustment coefficient of the layer is obtained through linear weighted fusion as a precision sensitivity correction factor, where the inter-layer dependency weight is specifically the ratio of the output channel of the over-compression layer to the total output channels of the model. The inter-layer dependency weight is relatively small relative to the linear distribution weight of the slope value, and the two can be exemplified as 0.2 and 0.8.
[0086] Analyze the precision sensitivity correction factor of the over-compression layer and use it as a reference for optimizing the downward adjustment of the pruning boundary parameters of this layer.
[0087] The embodiment of the present invention identifies over-compression layers based on redundant weight block update data to provide feedback on their downward optimization reference, thereby achieving closed-loop optimization of pruning parameters and real-time performance, significantly reducing the time cost and resource consumption of performance repair, and improving the flexibility and stability of model deployment in edge devices.
[0088] The above contents are merely examples and explanations of the concept of the present invention. Those skilled in the art may make various modifications or additions to the described specific embodiments or replace them in a similar manner. As long as they do not deviate from the concept of the invention or exceed the scope defined by the present invention, they should all fall within the scope of protection of the present invention.
Claims
1. A model deployment method based on pruning compression in edge devices, characterized in that: include: Analyze the hardware architecture configuration of the target edge device and build a joint constraint set including computing power, storage capacity and power consumption threshold; Determining, based on the joint constraint set and the dependencies between the layers of the model to be deployed, an upper limit on the compression ratio of each network layer of the model to be deployed as a pruning boundary parameter; Performing a hybrid pruning operation on the to-be-deployed model based on the pruning boundary parameters and reserving redundant weight blocks at key network layers; Compile the pruned model to adapt to the deployment and operation requirements of the target edge device. After the model is deployed, it can perceive the operational interference characteristics of the deployment environment in real time during operation. When the operation interference feature reaches a preset accuracy threat threshold, an online fine-tuning mechanism is triggered to update the redundant weight block parameters, and the pruning boundary parameters are iteratively optimized based on the fine-tuning performance feedback data.
2. The model deployment method based on pruning compression in an edge device according to claim 1, characterized in that: The hardware architecture configuration parsing process of the target edge device includes: The core number and main frequency parameters of the device processor are called, and the single-core floating-point operation peak is determined based on the processor architecture characteristics. The multi-core parallel efficiency calibration is used to generate the multi-core effective floating-point operation peak, which is converted into a computing capacity constraint parameter to define the upper limit of the floating-point operations that can be performed per second during the inference process of the model to be deployed. Read the physical address mapping table of the device's memory management unit to obtain the total physical capacity of the dynamic random access memory, and generate a storage capacity constraint parameter based on the actual read and write bandwidth of the memory to define the upper limit of the memory allowed to be occupied by the model to be deployed; Retrieve the idle state basic power consumption data and fully loaded state peak power consumption data recorded in the device power consumption log, map the power threshold constraint parameters based on the state deviation, and define the upper limit of sustainable power consumption during the inference process of the model to be deployed.
3. The model deployment method based on pruning compression in an edge device according to claim 2, characterized in that: The inter-layer dependencies of the model to be deployed include the following: Map the network layers of the model to be deployed into nodes and the data flows between layers into directed edges to generate a directed acyclic graph. Identifying nonlinear dependency paths in the directed acyclic graph based on special connection relationships between nodes of residual connections and cross-layer jump connections; The dependency sensitivity strength of each node relative to its successor node is quantified through reverse gradient propagation simulation, and the dependency sensitivity strength is planned to a corresponding dependency sensitivity level according to a preset division rule. The dependency sensitivity level includes low, medium or high.
4. The model deployment method based on pruning compression in an edge device according to claim 3, characterized in that: The process of determining the upper limit of the compression ratio of each network layer of the model to be deployed includes: Decomposing the joint constraint set into subsets of joint constraints for each network layer according to the computational intensity, parameter redundancy, and power consumption sensitivity attributes of each network layer, and determining an initial compression ratio upper limit based on the subsets; Modifying the initial compression ratio upper limit, the modification comprising: i. if the network layer is a mapping node of a nonlinear dependent path, reducing its initial compression ratio upper limit by a preset adjustment amplitude; ii. If there are high-level dependency sensitivity nodes among the subsequent nodes in the network layer, the upper limit of the initial compression ratio will be lowered in a step-by-step manner according to the number of subsequent high-level dependency sensitivity nodes; iii. If the network layer satisfies both conditions i and ii, the preset adjustment amplitude of condition i shall take precedence; Bind the corrected initial compression ratio upper limit to the corresponding network layer to determine the compression ratio upper limit of each network layer of the model to be deployed.
5. The model deployment method based on pruning compression in an edge device according to claim 1, characterized in that: The performing a hybrid pruning operation on the to-be-deployed model based on the pruning boundary parameter includes: The gradient characteristics of each structural unit in the model to be deployed are evaluated by the verification loss function. The structural units whose gradient characteristics meet the preset influence conditions are marked as protected structural units and forcibly retained during the hybrid pruning process. Perform contribution determination on the remaining unlabeled structural units, identify structural units with low contribution attributes in each network layer and obtain their structural type identification, wherein the structural type identification includes convolution kernel, neuron or output channel; Based on the pruning boundary parameters, structural units with low contribution attributes in each network layer are selectively removed to construct multiple groups of hybrid pruning schemes. The optimal pruning scheme is screened out and executed through accuracy verification. The optimal pruning scheme is the pruning scheme with the least impact on model accuracy.
6. The model deployment method based on pruning compression in an edge device according to claim 3, characterized in that: The reserved redundant weight blocks in the key network layer include: Through the norm indicators accumulated by the back gradient propagation simulation, the key network layers responsible for the main feature extraction function are identified; When performing a hybrid pruning operation on the key network layer, retaining some low-contribution structural units that should be removed according to the pruning boundary parameters, or configuring new structural units with the same type identifier as the original structural unit and an initial parameter value of zero in the position of the removed structural units; During initial deployment, the retained or newly added structural units are inactive, and data flow is only passed in forward reasoning.
7. The model deployment method based on pruning compression in an edge device according to claim 1, characterized in that: The compiled and pruned model includes the following: Scan the computational graph structure of the pruned model, identify mergeable continuous operator sequences, and perform equivalent fusion; Match the fused and unfused operators with the native instruction set of the target edge device hardware accelerator; Perform storage format conversion on operator weight data to adapt to the parallel computing architecture of the target device; The matching hardware instructions are organized according to the computational graph data flow, and compiled to generate binary files that can be directly loaded and executed.
8. The model deployment method based on pruning compression in an edge device according to claim 1, characterized in that: The operational interference characteristics of the real-time perception deployment environment include the following: Periodically collect statistical characteristic data of the model input data, including the mean, variance, and distribution divergence of the input data relative to the training data set; Synchronously collect operational characteristic data of target edge devices, including processor load rate, available memory capacity, and device temperature parameters; The statistical feature data and the operating feature data are combined into a current state vector, a multidimensional offset value of the current state vector relative to a preset reference state vector is calculated, and the multidimensional offset value is mapped into a threat indicator that characterizes the potential damage degree of current environmental interference to the model output accuracy.
9. The model deployment method based on pruning compression in an edge device according to claim 1, characterized in that: The redundant weight block fine-tuning process includes: Pause the model inference task and activate the writable state of the redundant weight blocks reserved for the key network layer; Based on the current input data, the loss value is calculated through predefined self-supervision rules; Constrain the backpropagation path to the redundant weight block memory area in the computational framework to generate local gradients; The redundant weight block parameters are updated in situ using an optimization algorithm. After the update is completed, the redundant weight block is locked in read-only mode and reloaded to the main model to resume the inference task.
10. The model deployment method based on pruning compression in an edge device according to claim 1, characterized in that: The iterative optimization of pruning boundary parameters includes: Record the update amplitude, update frequency and accuracy gain of the redundant weight blocks of each key network layer; quantifying the degree of compression according to the update amplitude and the update frequency, and determining an over-compression layer based on a correlation between the degree of compression and the accuracy gain; Analyze the precision sensitivity correction factor of the over-compression layer and use it as a reference for optimizing the downward adjustment of the pruning boundary parameters of this layer.
Citation Information
Patent Citations
Model structured pruning method and device based on edge computing architecture
CN118070868A
Multistage compression collaborative optimization neural network deployment method and device based on memristor and storage medium
CN120354904A
Light-weight large-model intelligent customer service deployment method for edge calculation
CN120386534A
Model pruning method and apparatus based on adjacent convolutions, and storage medium
WO2023024407A1
Model processing method, federated learning method, and related device
WO2023279975A1
Cited By
Internet of Things data processing method and system based on large model
CN120956797A
Suspension control-oriented lightweight neural network model deployment and real-time calculation method
CN121189393A
Model adaptive compression method applied to edge reasoning and rack-mounted AI edge reasoning terminal
CN121212230A
Model adaptive compression method applied to edge inference and rack-mounted ai edge inference terminal
CN121212230B
Model end-side batch deployment and intelligent operation and maintenance method and system in autonomous controllable environment
CN121996256A