Structured pruning method and system based on lottery hypothesis
Through the structured pruning method and weight playback technology based on the lottery hypothesis, a sparse subnet with 2:4 structure is generated, and the sparse tensor core of Ampere architecture GPU is used to accelerate the inference of deep neural networks, solving the problem of resource-constrained devices on resource-constrained devices The problem of low model deployment efficiency achieves efficient image recognition tasks.
Patent Information
- Application Number
- CN202411258136.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-06
AI Technical Summary
The prior art is difficult to effectively deploy deep neural network models on resource-constrained devices, especially due to irregular data access and low computing efficiency caused by model pruning.
A structured pruning method based on the lottery hypothesis is adopted to generate a sparse subnet with a 2:4 structure by randomly initializing and iterating amplitude pruning, and the inference acceleration is used by weight playback technology and the sparse tensor core of Ampere architecture GPU.
It realizes efficient image recognition task inference on resource-constrained devices. Although the accuracy has been reduced, the inference speed has been doubled, meeting the efficient deployment needs in resource-constrained environments.
Smart Images

Figure CN119089965A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of artificial intelligence model compression, and in particular relates to a structured pruning method and system based on lottery hypothesis. Background Art
[0002] Deep Neural Network (DNN) has made breakthrough progress in application fields such as image recognition, natural language processing, autonomous driving, intelligent security, and competitive games. However, in pursuit of higher model accuracy, the scale of DNN models is getting larger and the computational complexity is getting higher, which hinders its efficient deployment (inference) on resource-constrained devices. How to achieve hardware-deployable, accurate, and efficient lightweight DNN for resource-constrained devices has become a key scientific problem that needs to be solved for DNN application. Solving this problem will provide a theoretical basis and technical guarantee for building high-quality DNN applications, which has important research significance and broad application prospects.
[0003] The Lottery Ticket Hypothesis was first proposed by Jonathan Frankle and Michael Carbin in 2018 and is an important theory in the field of deep learning. The hypothesis states that in a large randomly initialized neural network, there are certain specific subnetworks - likened to "winning lottery tickets" that can achieve the same or even better performance as the original network if they are trained independently while retaining their original initialization weights. The core contribution of the Lottery Ticket Hypothesis is that it provides a theoretical basis for network pruning, that is, by iterative pruning and retaining favorable initialization states, these efficient subnetworks can be effectively identified and trained, thereby optimizing the computational efficiency and performance of the model. This theory not only helps to understand parameter and structural redundancy in deep neural networks, but also promotes the deployment and application of models in resource-constrained environments.
[0004] In the deployment (inference) phase of DNN, due to the limited computing power of resource-constrained devices, pre-trained large models usually cannot be deployed directly, and the model must be lightweighted. First, it is necessary to solve the problem of incompatibility between the model compression algorithm and the target device capabilities. Existing studies have shown that model pruning technology can reduce the number of computational operations and model size while ensuring accuracy, thereby theoretically achieving lightweight DNN. However, pruning brings huge challenges to the deployment of lightweight DNN on real hardware. Specifically, unstructured pruning will lead to irregular data access, and its substantial acceleration effect cannot be reflected on real hardware. The way to alleviate this problem is to focus on the target device and impose constraints in the design process of the model compression algorithm so that the compressed model can be deployed on the target device. How to combine the architectural characteristics of the existing target hardware to make its specific hardware give full play to the sparse network reasoning ability has always been one of the main challenges of structured pruning of neural networks. This structured pruning method based on the lottery hypothesis has certain guiding significance for the lightweighting of neural networks. Summary of the invention
[0005] The purpose of the present invention is to provide a structured pruning method and system based on the lottery hypothesis to solve the above problems.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] A structured pruning method based on the lottery ticket hypothesis, comprising:
[0008] For the target neural network model, image recognition is used as the task, and the weight matrix parameters are randomly initialized;
[0009] Based on the randomly initialized neural network obtained, the dense neural network is pruned into a sparse sub-network with a 2:4 structure using an iterative amplitude pruning method;
[0010] Based on the neural network structure of the sparse sub-network, the parameters of the corresponding sparse sub-network structure in the randomly initialized dense neural network are migrated to the sparse sub-network using the weight playback method to obtain the migrated sparse sub-network;
[0011] The migrated sparse sub-network is trained. During the training process, the migrated sparse sub-network is kept in accordance with the 2:4 structure and 50% sparsity, and a converged sparse sub-network is obtained through training.
[0012] Migrate the obtained sparse sub-network to a graphics card server with an Ampere architecture GPU to obtain a migrated sparse sub-network model;
[0013] Based on the migrated sparse sub-network model, the sparsetensor core in the Ampere architecture GPU graphics card server is used to accelerate reasoning and obtain the final sparse sub-network recognition result.
[0014] A further improvement of the present invention is that the target neural network model uses a resnet-18 or resnet-50 model, and all parameters in the neural network model are randomly initialized using a uniform distribution.
[0015] A further improvement of the present invention is that, based on the randomly initialized neural network obtained, an iterative amplitude pruning method is used to prune the dense neural network into a sparse sub-network conforming to the 2:4 structure, as follows:
[0016]
[0017] Among them, w and w pruned are the weights before and after pruning, respectively. th is the pruning threshold, and parameters below the threshold are pruned.
[0018] A further improvement of the present invention is that the weight playback method is a technology for preserving network performance.
[0019] A further improvement of the present invention is that when the obtained sparse subnetwork is migrated to a GPU graphics card server with an Ampere architecture, the torch.save function in the pytorch framework is used. In the graphics card server, the model.load_state_dict function in the PyTorch framework is used to load the saved model parameters into the model object.
[0020] A further improvement of the present invention is that, based on the migrated sparse sub-network model, when using the sparse tensor core in the Ampere architecture GPU graphics card server for reasoning acceleration, the sparse tensor core in the Ampere architecture GPU graphics card server has the ability of sparse matrix multiplication, and at least one of the two data matrices participating in the sparse matrix multiplication calculation satisfies the 2:4 structured sparsity. The pruned matrix is compressed by calling the cusparseLtSpMMACompress interface in the cuSPARSELt sparse matrix multiplication optimization library, and then the cusparseLtMatmul interface is called to perform sparse matrix multiplication operations.
[0021] A structured pruning system based on the lottery ticket hypothesis, comprising:
[0022] The model initialization module is used to randomly initialize the weight matrix parameters of the target neural network model with image recognition as the task;
[0023] A model pruning module is used to prune a dense neural network into a sparse sub-network with a 2:4 structure based on the randomly initialized neural network obtained using an iterative amplitude pruning method;
[0024] The parameter migration module is used for the neural network structure based on the sparse sub-network. The weight playback method is used to migrate the parameters of the corresponding sparse sub-network structure in the randomly initialized dense neural network to the sparse sub-network to obtain the migrated sparse sub-network.
[0025] The model training module is used to train the migrated sparse sub-network. During the training process, the migrated sparse sub-network is kept in accordance with the 2:4 structure and 50% sparsity, and a converged sparse sub-network is obtained through training.
[0026] A model migration module is used to migrate the obtained sparse sub-network to a graphics card server with an Ampere architecture GPU to obtain a migrated sparse sub-network model;
[0027] The inference module is used to accelerate inference based on the migrated sparse sub-network model using the sparse tensor core in the Ampere architecture GPU graphics card server to obtain the final sparse sub-network recognition result.
[0028] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a structured pruning method based on the lottery ticket hypothesis.
[0029] Compared with the prior art, the present invention has at least the following beneficial technical effects:
[0030] When using the resnet-50 model to perform classification tasks on the cifar-10 dataset, although the sparse subnetwork's inference top1 accuracy of 94.63% is about 1% lower than the dense neural network's accuracy of 95.51%, because the sparse subnetwork meets the 2:4 structure, the sparse tensor core computing unit in the Ampere architecture GPU can be used, which doubles the theoretical inference speed.
[0031] The present invention discloses a structured pruning method based on the lottery hypothesis, which generates a structured sparse subnetwork by randomly initializing and iteratively pruning the weights of the target neural network model, migrates the pruned weights to a new dense network using the weight playback technology, and performs a small amount of training to obtain a converged sparse neural network, migrates the trained model to a server equipped with an Ampere architecture GPU, and uses its sparse tensor core to accelerate reasoning to achieve efficient image recognition task reasoning. This method targets resource-constrained computing platforms, the structure and characteristics of neural networks, and combines the architectural characteristics of Ampere architecture GPU devices to combine neural network pruning with the lottery hypothesis, efficiently prunes the neural network, and ultimately achieves efficient reasoning. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 The figure is a flow chart of a structured pruning method based on the lottery hypothesis of the present invention.
[0033] Figure 2 This is a structural block diagram of a structured pruning system based on the lottery hypothesis of the present invention. DETAILED DESCRIPTION
[0034] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present invention. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.
[0035] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0036] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0037] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0038] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0039] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0040] The present invention proposes a structured pruning method based on the lottery ticket hypothesis, which generates a structured sparse subnetwork by randomly initializing and iteratively pruning the weights of the target neural network model. The pruned weights are migrated to a new dense network using weight playback technology, and a small amount of training is performed to obtain a converged sparse neural network. The trained model is migrated to a server equipped with an Ampere architecture GPU, and its Sparse Tensor Core is used for inference acceleration to achieve efficient image recognition task inference.
[0041] See also Figure 1 The present invention provides a structured pruning method based on the lottery hypothesis, comprising the following steps:
[0042] Step 1: Based on the actual usage scenario, that is, image recognition business is selected. The target neural network uses the resnet-18 or resnet-50 model. The convolutional layer and linear layer of the target neural network are randomly initialized in the range of [-1, 1] using a random initialization method that conforms to the uniform distribution.
[0043] Step 2: Using the neural network model and data set constrained by step 1, the iterative amplitude pruning method can iteratively assign weights with smaller amplitudes in the neural network weight matrix to zero.
[0044]
[0045] Among them, a preset threshold th is used to identify and prune the neural network weights w that are considered unimportant, and all weights less than th will be set to zero. To achieve this, during the forward propagation process, a Boolean mask matrix is first generated, which is consistent with the size of the weight matrix to be pruned and is used to determine which weights will be retained. In this way, the forward output of the network is obtained by multiplying the weight matrix with the mask matrix.
[0046] During the back-propagation process, some weights become zero due to the masking operation. This change is non-differentiable, which means that the traditional gradient update method cannot be directly applied to these zeroed weights. To solve this problem, the straight-through estimator (STE) idea is used to implement approximate gradient update. During the forward propagation, the original weight matrix w is firstly pruned to obtain w pruned ; Then compare it with the input X of the lth layer l Perform sparse matrix multiplication to obtain the output of the lth layer (also the input of the l+1th layer), that is, X l+1 =w pruned X l During back propagation, according to the derivative chain rule, we first calculate the derivative of the loss function L with respect to the output of the lth layer: Then calculate Finally, when updating the gradient, we refer to the STE idea and use As An approximate estimate of ), use the gradient descent algorithm to directly update w approximately:
[0047]
[0048] Where η is the learning rate. Based on this, the gradient of the entire sparse model can be updated, alleviating the problem that the sparse model cannot be trained.
[0049] In practice, even though the weights are zeroed in the forward pass, they are still allowed to receive gradient updates during the backward pass. This is achieved by treating the pruned weights as weights in the forward pass and using their gradients in the backward pass.
[0050] For actual deployment, hardware support for efficient sparse matrix operations is required. Now, Ampere architecture GPUs have such capabilities. Using its _x001D_sparse tensor core, it can process 2:4 structured sparse matrix multiplication, that is, a matrix in which at least two of any four consecutive elements are zero. By adopting 2:4 structured pruning, the storage and computing requirements of the network can be optimized, while inference acceleration can be achieved on Ampere architecture GPUs, thereby improving the operating efficiency and performance of the entire model;
[0051] Step 3, using the neural network pruned by the iterative amplitude pruning method obtained in step 2, the performance of the neural network is retained by the weight rewinding technique. Although pruning helps to reduce the size of the neural network, it may reduce the accuracy of the neural network because important information may be discarded during the pruning process. To overcome this challenge, the weight rewinding technique is introduced. The weight rewinding method is a technique used to retain network performance. During the pruning process of the neural network, some connections or parameters are removed to reduce the complexity and computational cost of the network. However, pruning may cause network performance to deteriorate because the pruned network may lose some important information. To solve this problem, the weight rewinding technique is proposed. In the weight rewinding technique, the parameters corresponding to the sparse subnetwork structure in the randomly initialized dense neural network are migrated to the sparse subnetwork. The essence of this technique is to retain the good performance of the network during the pruning process by backing up and restoring the state of the network. In this way, it can be ensured that the pruned network still maintains high performance and retains important information while removing redundant connections. The main purpose of weight replay technology is to retain the performance of the network as much as possible while pruning, so as to better deal with the performance degradation problem that may be caused by network pruning.
[0052] Step 4, use the neural network after replaying the weights obtained in step 3 to train it. In this process, the hyperparameters (including the learning rate) are reset to the starting stage of training. The learning rate adopts a warm-up strategy, which is a method of gradually increasing the learning rate at the beginning of training to avoid instability caused by too high a learning rate in the early stage of training, which helps the network find the appropriate optimization rhythm during the adjustment period. By adopting a structured sparsity of 2:4 and a total sparsity of 50%, combined with forward propagation and back propagation based on the straight-through estimator strategy, the network can effectively converge in fewer training cycles to form an optimized and stable sparse neural network. The network retains important information while reducing redundant connections, thereby having higher computational efficiency and smaller model size. This method not only optimizes the training process, but also ensures that the network maintains good performance even after sparsification.
[0053] Step 5. Use the converged sparse neural network obtained in step 4 to migrate the converged sparse neural network to a server with an Ampere architecture GPU graphics card. Here, the torch.save function in the pytorch framework is used. This function allows the state dictionary of the model to be saved to a file. This state dictionary contains all the learnable parameters of the model and their current values. In the graphics card server, the model.load_state_dict function in the PyTorch framework can be used to load the saved model parameters into the model object. This function will restore the parameter values to the corresponding model object based on the saved state dictionary, so that the model object is consistent with the sparse neural network trained previously.
[0054] Step 6, use the sparse neural network model successfully migrated in step 5, and use the sparse tensor core in the Ampere architecture GPU for inference. At present, the sparse tensor core of the Ampere architecture GPU has the ability to perform sparse matrix multiplication, but it requires that at least one of the two data matrices involved in the sparse matrix multiplication calculation meets the 2:4 structured sparsity (that is, 2 of the 4 consecutive values are 0). After the above structured pruning, the sparse neural network model has met the 2:4 structure, and the pruned matrix can be compressed by calling the cusparseLtSpMMACompress interface in the cuSPARSELt sparse matrix multiplication optimization library, and then calling the cusparseLtMatmul interface to perform sparse matrix multiplication operations. In this way, the Sparse Tensor Core of the Ampere architecture GPU can be fully utilized to perform efficient sparse matrix multiplication operations.
[0055] After completing the above steps, we have obtained a solution for pruning and actually deploying the neural network model, which can be used to configure the inference service on the resource-constrained computing platform. This concludes the structured pruning method based on the lottery ticket hypothesis for resource-constrained computing platforms.
[0056] Example 1
[0057] When using the resnet-50 model to perform classification tasks on the cifar-10 dataset, although the sparse subnetwork's inference top1 accuracy of 94.63% is about 1% lower than the dense neural network's accuracy of 95.51%, because the sparse subnetwork meets the 2:4 structure, the sparse tensor core computing unit in the Ampere architecture GPU can be used, which doubles the theoretical inference speed.
[0058] See also Figure 2The present invention provides a structured pruning system based on the lottery hypothesis, comprising:
[0059] The model initialization module is used to randomly initialize the weight matrix parameters of the target neural network model with image recognition as the task;
[0060] A model pruning module is used to prune a dense neural network into a sparse sub-network with a 2:4 structure based on the randomly initialized neural network obtained using an iterative amplitude pruning method;
[0061] The parameter migration module is used for the neural network structure based on the sparse sub-network. The weight playback method is used to migrate the parameters of the corresponding sparse sub-network structure in the randomly initialized dense neural network to the sparse sub-network to obtain the migrated sparse sub-network.
[0062] The model training module is used to train the migrated sparse sub-network. During the training process, the migrated sparse sub-network is kept in accordance with the 2:4 structure and 50% sparsity, and a converged sparse sub-network is obtained through training.
[0063] A model migration module is used to migrate the obtained sparse sub-network to a graphics card server with an Ampere architecture GPU to obtain a migrated sparse sub-network model;
[0064] The inference module is used to accelerate inference based on the migrated sparse sub-network model using the sparse tensor core in the Ampere architecture GPU graphics card server to obtain the final sparse sub-network recognition result.
[0065] The present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a structured pruning method based on the lottery hypothesis are described.
[0066] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0067] The present application is described with reference to the flowcharts and / or block diagrams of the methods, systems and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or multiple boxes.
[0068] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0069] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0070] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the attached claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved.
[0071] In addition, it should be understood that although this specification is described in accordance with the implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation modes that can be understood by those skilled in the art. The above content is only to illustrate the technical idea of the present invention, and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution according to the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A structured pruning method based on the lottery hypothesis, characterized in that: include: For the target neural network model, image recognition is used as the task, and the weight matrix parameters are randomly initialized; Based on the randomly initialized neural network obtained, the dense neural network is pruned into a sparse sub-network with a 2:4 structure using an iterative amplitude pruning method; Based on the neural network structure of the sparse sub-network, the weight playback method is used to migrate the parameters of the corresponding sparse sub-network structure in the randomly initialized dense neural network to the sparse sub-network to obtain the migrated sparse sub-network; The migrated sparse sub-network is trained. During the training process, the migrated sparse sub-network is kept in accordance with the 2:4 structure and 50% sparsity, and a converged sparse sub-network is obtained through training. Migrate the obtained sparse sub-network to a graphics card server with an Ampere architecture GPU to obtain a migrated sparse sub-network model; Based on the migrated sparse sub-network model, the sparse tensorcore in the Ampere architecture GPU graphics card server is used to accelerate reasoning and obtain the final sparse sub-network recognition result.
2. A structured pruning method based on the lottery hypothesis according to claim 1, characterized in that: The target neural network model uses the ResNet-18 or ResNet-50 model, and all parameters in the neural network model are randomly initialized using uniform distribution.
3. A structured pruning method based on lottery hypothesis according to claim 1, characterized in that: Based on the randomly initialized neural network obtained, the iterative amplitude pruning method is used to prune the dense neural network into a sparse sub-network with a 2:4 structure, as follows: Among them, w and w pruned are the weights before and after pruning, respectively. th is the pruning threshold, and parameters below the threshold are pruned.
4. A structured pruning method based on lottery hypothesis according to claim 1, characterized in that: The weight replay method is a technique used to preserve network performance.
5. A structured pruning method based on lottery hypothesis according to claim 1, characterized in that: When migrating the obtained sparse subnetwork to a GPU graphics card server with the Ampere architecture, use the torch.save function in the pytorch framework. In the graphics card server, use the model.load_state_dict function in the PyTorch framework to load the saved model parameters into the model object.
6. A structured pruning method based on lottery hypothesis according to claim 1, characterized in that: Based on the migrated sparse sub-network model, when using the sparse tensor core in the Ampere architecture GPU graphics card server for inference acceleration, the sparse tensor core in the Ampere architecture GPU graphics card server has the ability of sparse matrix multiplication. At least one of the two data matrices involved in the sparse matrix multiplication calculation satisfies the 2:4 structured sparsity. The pruned matrix is compressed by calling the cusparseLtSpMMACompress interface in the cuSPARSELt sparse matrix multiplication optimization library, and then the cusparseLtMatmul interface is called to perform sparse matrix multiplication operations.
7. A structured pruning system based on the lottery hypothesis, characterized in that: include: The model initialization module is used to randomly initialize the weight matrix parameters of the target neural network model with image recognition as the task; A model pruning module is used to prune a dense neural network into a sparse sub-network with a 2:4 structure based on the randomly initialized neural network obtained using an iterative amplitude pruning method; The parameter migration module is used for the neural network structure based on the sparse sub-network. The weight playback method is used to migrate the parameters of the corresponding sparse sub-network structure in the randomly initialized dense neural network to the sparse sub-network to obtain the migrated sparse sub-network. The model training module is used to train the migrated sparse sub-network. During the training process, the migrated sparse sub-network is kept in accordance with the 2:4 structure and 50% sparsity, and a converged sparse sub-network is obtained through training. A model migration module is used to migrate the obtained sparse sub-network to a graphics card server with an Ampere architecture GPU to obtain a migrated sparse sub-network model; The inference module is used to accelerate inference based on the migrated sparse sub-network model using the sparse tensor core in the Ampere architecture GPU graphics card server to obtain the final sparse sub-network recognition result.
8. A structured pruning system based on the lottery hypothesis according to claim 7, characterized in that: In the model initialization module, the target neural network model uses the resnet-18 or resnet-50 model, and all parameters in the neural network model are randomly initialized using uniform distribution.
9. A structured pruning system based on the lottery hypothesis according to claim 7, characterized in that: In the model pruning module, based on the randomly initialized neural network obtained, the iterative amplitude pruning method is used to prune the dense neural network into a sparse sub-network with a 2:4 structure, as follows: Among them, w and w pruned are the weights before and after pruning, respectively. th is the pruning threshold, and parameters below the threshold are pruned.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a structured pruning method based on the lottery ticket hypothesis according to any one of claims 1 to 6.
Citation Information
Cited By
Image data processing method and system based on lightweight sparse neural network
CN121190950A
