Method for Compressing Neural Network Model, Computer System, and Storage Medium
By introducing quantifiable regularization losses and iterative network retraining processes, the quantization efficiency of weight coefficients is optimized, and the compression requirements of deep neural network models in storage and computing are solved, and efficient deployment on mobile devices and chips is achieved.
Patent Information
- Application Number
- CN202011448780.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-10-19
- Filing Date
- 2020-12-09
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2040-12-09
AI Technical Summary
The existing deep neural network models have great demands in storage and computing, and are difficult to effectively deploy on mobile devices and chips, and require more efficient compression methods.
By introducing quantifiable regularization loss and iterative network retraining process, the quantization efficiency of weight coefficients is optimized, and different loss functions are introduced at different times using the iterative optimization process, combining quantization and entropy encoding and decoding technology to compress the neural network model.
Significantly reduces the size of the deep neural network model, maintains original performance, and improves deployment efficiency on mobile devices and chips.
Smart Images

Figure CN113052309B_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to U.S. Provisional Patent Application No. 62 / 954,472 filed in the U.S. Patent and Trademark Office on December 28, 2019, and U.S. Patent Application No. 17 / 073,602 filed in the U.S. Patent and Trademark Office on October 19, 2020, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present disclosure relates generally to the field of data processing, and more particularly to neural networks. Background Art
[0004] The International Organization for Standardization (ISO) / International Electrotechnical Commission (IEC) Moving Picture Experts Group (MPEG) (JTC 1 / SC 29 / WG 11) has been actively exploring potential requirements for the standardization of future video codec technologies for visual analysis and understanding. In 2015, ISO adopted the Compact Descriptors for Visual Search (CDVS) standard as a standard for still images, which extracts feature representations for image similarity matching. The CDVS standard, listed as Part 15 of MPEG 7 and ISO / IEC 15938-15 and finalized in 2018, extracts global and local feature descriptors for video clips, both manually designed and based on deep neural networks (DNNs). The success of DNNs in a wide range of video applications, such as semantic classification, object detection / recognition, object tracking, and video quality enhancement, has created a strong demand for compressed DNN models. Summary of the Invention
[0005] The embodiments of the present disclosure relate to a method, system, and computer-readable storage medium for compressing a neural network model, which can achieve a significantly compressed neural network model.
[0006] According to one aspect, a method for compressing a neural network model is provided. The method may include reshaping a multidimensional tensor corresponding to a set of weight coefficients associated with a neural network, identifying a subset of weight coefficients from the set of weight coefficients, and compressing the neural network model based on the identified set of weight coefficients.
[0007] According to another aspect, a computer system for compressing a neural network model is provided. The computer system may include at least one processor, at least one computer-readable memory, at least one computer-readable tangible storage device, and program instructions stored on at least one of the at least one storage device, the program instructions being executed by the at least one processor via the at least one memory, whereby the computer system performs the method. The method may include reshaping a multidimensional tensor corresponding to a set of weight coefficients associated with a neural network, identifying a subset of weight coefficients from the set of weight coefficients, and compressing the neural network model based on the identified set of weight coefficients.
[0008] According to yet another aspect, a computer-readable medium for compressing a neural network model is provided. The computer-readable medium may include at least one computer-readable storage device and program instructions stored in at least one tangible storage device, the program instructions being executable by a processor. The program instructions are executable by the processor to perform a method comprising reshaping a multidimensional tensor corresponding to a set of weight coefficients associated with a neural network, identifying a subset of weight coefficients from the set of weight coefficients, and compressing a model of the neural network based on the identified set of weight coefficients.
[0009] Through the method, system and computer-readable storage medium for compressing a neural network model provided by the embodiments of the present disclosure, quantizability regularization can be used to improve the efficiency of further compressing the learned weight coefficients, thereby achieving a significantly compressed neural network model. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] These and other objects, features, and advantages will become apparent from the following detailed description of illustrative embodiments when read in conjunction with the accompanying drawings. Since the drawings are intended to facilitate a clear understanding by those skilled in the art in conjunction with the detailed description, the various features of the drawings are not drawn to scale. In the drawings:
[0011] Figure 1 illustrates a networked computer environment according to at least one embodiment;
[0012] Figure 2 is a block diagram of a neural network model compression system according to at least one embodiment;
[0013] Figure 3 An operational flow diagram illustrating steps performed by a program for compressing a neural network model in accordance with at least one embodiment;
[0014] Figure 4 According to at least one embodiment Figure 1 a block diagram of the internal and external components of a computer and server depicted in;
[0015] Figure 5 According to at least one embodiment, Figure 1 A block diagram of an exemplary cloud computing environment for a computer system depicted in ; and
[0016] Figure 6 According to at least one embodiment Figure 5 A block diagram of the functional layers of an exemplary cloud computing environment. DETAILED DESCRIPTION
[0017] Detailed embodiments of the claimed structures and methods are disclosed herein; however, it is understood that the disclosed embodiments are merely illustrative of the claimed structures and methods that may be implemented in various forms. However, these structures and methods may be implemented in many different forms and should not be construed as limited to the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided to make this disclosure clear and complete and to fully convey the scope to those skilled in the art. In the description, details of well-known features and techniques may be omitted to avoid unnecessarily obscuring the presented embodiments.
[0018] The present disclosure relates generally to the field of data processing, and more particularly to neural networks. The exemplary embodiments described below provide systems, methods, and computer programs for compressing neural network models. Thus, some embodiments have the ability to improve computational performance by allowing for improved compression efficiency of learned weight coefficients, which can significantly reduce the size of deep neural network models.
[0019] As mentioned earlier, ISO / IEC MPEG (JTC 1 / SC 29 / WG 11) has been actively exploring potential needs for standardization of future video coding and decoding technologies for visual analysis and understanding. In 2015, ISO adopted the CDVS standard as a standard for still images, which extracts feature representations for image similarity matching. The CDVS standard was listed as Part 15 of MPEG 7 and ISO / IEC 15938-15 and was finalized in 2018. The standard extracts global and local, manually designed and DNN-based feature descriptors for video clips. The success of DNNs in a large number of video applications such as semantic classification, object detection / recognition, object tracking, and video quality enhancement has put forward a strong demand for compressed DNN models.
[0020] Therefore, MPEG is actively working on the Coded Representation of Neural Network standard (NNR), which encodes DNN models to save storage and computation. There are several methods for learning compact DNN models. The goal is to remove unimportant weight coefficients, and it is assumed that the smaller the value of the weight coefficients, the less important they are. Several network pruning methods have been proposed to explicitly achieve this goal by adding sparsity-promoting regularization terms to the network training objectives or greedily removing network parameters. From the perspective of compressing DNN models, after learning the compact network model, the weight coefficients can be further compressed by quantization followed by entropy encoding and decoding. Such further compression process can significantly reduce the storage size of the DNN model, which is essential for deploying the model on mobile devices, chips, etc.
[0021] A quantizability regularization loss can be used to improve quantization efficiency. An iterative network retraining / correction process is used to jointly optimize the original training objective and the quantizability regularization loss, ensuring that the learned network weight coefficients maintain the original performance and are suitable for further compression through quantization and entropy encoding and decoding. The methods, computer systems, and computer-readable media discussed herein can be applied to compress the original pre-trained DNN model. It can also serve as an additional processing module to further compress any pruned DNN model.
[0022] The present disclosure proposes a method for compressing a DNN model using quantizability regularization in an iterative network retraining / fine-tuning framework. Quantizability regularization can improve the efficiency of further compressing the learned weight coefficients, which can significantly reduce the size of the DNN model. Through the iterative retraining process, the target training objectives can be maintained to pursue quantization efficiency. The iterative retraining process also provides the flexibility of introducing different losses at different times, so that the system can focus on different goals during the optimization process. Data sets with different data forms can be used. The input / output data is typically a 4D tensor, which can be a real video clip, an image, or an extracted feature map.
[0023] Various aspects are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer-readable media according to various embodiments. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0024] Now refer to Figure 1, a functional block diagram of a networked computer environment shows a neural network model compression system 100 (hereinafter referred to as the "system") for compressing a neural network model based on quantizability regularization. It should be understood that Figure 1 This is merely an illustration of one embodiment and is not meant to imply any limitations on the environments in which different embodiments may be implemented. Many modifications to the depicted environments may be made based on design and implementation requirements.
[0025] System 100 may include a computer 102 and a server computer 114. Computer 102 may communicate with server computer 114 via a communication network 110 (hereinafter referred to as the "network"). Computer 102 includes a processor 104 and a software program 108 stored on a data storage device 106 and is capable of interfacing with a user and communicating with server computer 114. Figure 4 As discussed, computer 102 may include internal components 800A and external components 900A, respectively, and server computer 114 may include internal components 800B and external components 900B, respectively. Computer 102 may be, for example, a mobile device, a phone, a personal digital assistant, a netbook, a laptop, a tablet computer, a desktop computer, or any type of computing device capable of running programs, accessing a network, and accessing a database.
[0026] As the following combination Figure 5 and Figure 6 As discussed, the server computer 114 may also operate in a cloud computing service model, such as Software as a Service (SaaS), Platform as a Service (PaaS), or Infrastructure as a Service (IaaS). The server computer 114 may also be located in a cloud computing deployment model, such as a private cloud, a community cloud, a public cloud, or a hybrid cloud.
[0027] The server computer 114 for compressing the neural network model can run a quantifiable regularization program 116 (hereinafter referred to as "the program") that interacts with the database 112. Figure 3 The method of the quantifiable regularization program is explained in more detail. In one embodiment, computer 102 can operate as an input device including a user interface, and program 116 can be primarily executed on server computer 114. In an alternative embodiment, program 116 can be primarily executed on at least one computer 102, while server computer 114 can be used to process and store data used by program 116. It should be noted that program 116 can be a stand-alone program or can be integrated into a larger quantifiable regularization program.
[0028] However, it should be noted that in some instances, processing of program 116 may be shared in any proportion between computers 102 and server computers 114. In another embodiment, program 116 may operate on more than one computer, server computer, or some combination of computers and server computers, such as multiple computers 102 communicating with a single server computer 114 via network 110. In another embodiment, for example, program 116 may operate on multiple server computers 114 communicating with multiple client computers via network 110. Alternatively, the program may run on a network server that communicates with the server and multiple client computers via the network.
[0029] The network 110 may include a wired connection, a wireless connection, a fiber optic connection, or some combination thereof. In general, the network 110 may be any combination of connections and protocols that support communication between the computer 102 and the server computer 114. The network 110 may include various types of networks, such as, for example, a local area network (LAN), a wide area network (WAN) (e.g., the Internet), a telecommunications network (e.g., a public switched telephone network (PSTN)), a wireless network, a public switched network, a satellite network, a cellular network (e.g., a fifth generation (5G) network, a long-term evolution (LTE) network, a third generation (3G) network, a code division multiple access (CDMA) network, etc.), a public land mobile network (PLMN), a metropolitan area network (MAN), a private network, an ad hoc network, an intranet, a fiber-based network, etc., and / or combinations of these or other types of networks.
[0030] Figure 1 The number and arrangement of devices and networks shown are provided as examples. In practice, there may be additional devices and / or networks, fewer devices and / or networks, different devices and / or networks, or different Figure 1 The devices and / or networks shown have differently arranged devices and / or networks. Figure 1 Two or more of the devices shown may be implemented in a single device, or Figure 1The single device shown may be implemented as multiple distributed devices. Additionally or alternatively, one set of devices (eg, at least one device) of system 100 may perform at least one function that is described as being performed by another set of devices of system 100.
[0031] Now refer to Figure 2 , describes a neural network model compression system 200. The neural network model compression system 200 can be used as a framework for an iterative learning process. The neural network model compression system 200 may include a calculation index order module 202, a quantization module 204, and a retraining module 206. The retraining module 206 may include other modules such as a network forward calculation module 208, a calculation data loss module 210, a calculation gradient module 212, and a backpropagation and weight update module 214.
[0032] Let D = {(x, y)} represent a dataset that assigns target y to input x. Let Θ = {w} represent the set of weight coefficients of the DNN. The goal of neural network training can be to learn the optimal set of weight coefficients Θ* so that the loss £(D|Θ) can be minimized. For example, in previous network pruning methods, the loss £(D|Θ) has two parts: the empirical data loss £ D (D|Θ) and sparsity-promoting regularization loss R (Θ): £(D|Θ)=λ D £ D (D|Θ)+λ R £ R (Θ),
[0033] where λ D andλ R is a hyperparameter used to balance the contribution of data loss and regularization loss.
[0034] Sparsity promotes regularization loss to place regularization on the entire weight coefficient, and the resulting sparse weights have a weak relationship with inference efficiency or computational acceleration. From another perspective, after pruning, the sparse weights can be further subjected to another network training process, where an optimal set of weight coefficients can be learned, which can improve the quantization efficiency of further model compression.
[0035] Therefore, the quantizability regularization loss £ can be calculated Q (D|Θ), such that:
[0036] £(D|Θ)=λ D £ D (D|Θ)+λQ £ Q (Θ),
[0037] Among them, λ D and λ Q is a hyperparameter that balances the contributions of data loss and quantization loss. By jointly optimizing £(D|Θ), we can obtain the optimal set of weight coefficients for the quantization and encoding / decoding processes, which significantly improves compression. Furthermore, the quantization regularization loss considers how convolution operations are fundamental to the GEMM matrix multiplication process, resulting in quantized weight coefficients that significantly speed up computation.
[0038] For both learning effectiveness and learning efficiency, an iterative optimization process can be further used for training. The weight coefficients that meet the desired design structure can be fixed. The non-fixed portion of the weight coefficients can be updated by backpropagating the training loss. By iteratively performing these two steps, more and more weights can be gradually fixed, and the joint loss can be effectively gradually optimized.
[0039] Furthermore, since each layer can be compressed individually, Q (D|Θ) can be further written as:
[0040]
[0041] Among them, L Q (W j ) is the quantization loss defined on the jth layer; N can be the total number of layers for which the quantization loss is measured; W j Represents the weight coefficient of the jth layer. Since L of each layer can be calculated independently Q (W j ), it is understood that script j may be omitted without loss of generality.
[0042] For each network layer, its weight coefficient W is (c i ,k1,k2,k3,c o ). The input of the layer is a general 5-dimensional (5D) tensor of size (h i ,w i ,d i ,c i ), and the output of the layer can be a 4-dimensional (4D) tensor A of size (h o ,w o ,d o ,c o ) of 4D tensor B of size c i , k1, k2, k3, c o 、h i 、w i d i 、ho 、w o d o is an integer greater than or equal to 1. When the size c i , k1, k2, k3, c o 、h i 、w i d i 、h o 、w o d o When any of the values is 1, the corresponding tensor is reduced to a lower dimension. Each item in each tensor can be a floating point number. Let M represent a 5D binary mask of the same size as W, where each item in M is a binary number 0 / 1, which is used to indicate whether the corresponding weight coefficient is pruned or retained. M is introduced to be associated with W to deal with the case where W comes from a pruned DNN model. When W can come from the original unpruned pre-trained model, all items in M take the value of 1. The output B is calculated by the convolution operation ⊙ based on A, M and W:
[0043]
[0044] Parameter h i 、w i and d i (h0, w o and d o ) is the height, weight, and depth of the input tensor A (output tensor B). Parameter c i (c o ) is the number of input (output) channels. Parameters k1, k2, and k3 are the sizes of the convolution kernels corresponding to the height axis, weight axis, and depth axis, respectively. That is, for each output channel v = 1, ..., c o , which can be described as a convolution of size (c i ,k1,k2,k3) is the 4D weight tensor Wv.
[0045] It is understood that the order of summation can be changed. In at least one embodiment, the 5D weight tensor can be reshaped to a size of (c i ,c o ,k) 3D tensor, where k = k1·k2·k3. The order of the reshape indices along the k axis can be determined by the reshape algorithm in the reshape process.
[0046] The desired structure of the weight coefficients can be designed by considering two aspects. The structure of the weight coefficients is consistent with the basic GEMM matrix multiplication process of how the convolution operation is implemented, so as to speed up the inference calculation using the learned weight coefficients. The structure of the weight coefficients can help improve the efficiency of quantization and entropy coding. In one embodiment, the block-wise structure of the weight coefficients in each layer can be used in the 3D reshaped weight tensor. Specifically, the 3D tensor can be partitioned into (g i ,g o ,g k ) blocks, and all coefficients within the block have the same value. In this way, one value can be used to represent the entire block in the quantization process, which produces high efficiency. Given this desired structure, during the iteration, the part of the weight coefficients that need to be fixed can be determined. For example, the variance of the weights within each block can be calculated, and when the variance is less than a set threshold, the weights within the block are set to the mean of the block. A neural network training process can be performed to update the remaining non-fixed weight coefficients through a backpropagation mechanism. The threshold can be a pre-set hyperparameter, or can be changed (e.g., reduced) so that more weights are gradually fixed during training for later iterations.
[0047] Using a pre-trained DNN model with weight coefficients W and mask M, the pre-trained DNN model can be a pruned sparse model or an unpruned non-sparse model, the order of the index I(W) = [i0, ..., i k ], so as to reshape the weight coefficient W and the mask M by the calculation index order module 202, where k=k1·k2·k3 can be the reshaped 3D tensor of the weight W. In one embodiment, I(W) can be determined by roughly predicting the quantization loss of the reshaped weight. For a size of (g i ,g o ,g k ) of the p-th 3D block b in the reshaped 3D tensor of the weight W p ,mean p and N p It can represent the mean and L of the weight coefficients within the block N Norm. For example, the L2 norm is the variance of the weight coefficients within the block. L N The norm reflects the use of the mean p The error e(b p For each possible way of reordering the indices to generate a 3D tensor of weights W, we can calculate the weights by averaging the e(b p) to calculate the total error of the quantization performed, and I(W) may be the one with the smallest total error. When k may be small, an exhaustive search for the optimal I(W) may be performed. For large k, other methods may be used to find a suboptimal I(W). It will be appreciated that substantially any method may be used to determine I(W).
[0048] After obtaining the order of index I(W) to reshape the weight coefficients, the goal is to find the updated optimal weight coefficient set W*, weight mask M* and weight quantization mask Q* by iteratively minimizing the total loss. For the t-th iteration, there are the current weight coefficient W(t-1), mask M(t-1) and weight quantization mask Q(t-1). The quantized weight coefficient W is calculated by the quantization module 204. Q (t) and the new quantization mask Q(t). In the quantization module 204, the size of the reshaped 3D weight tensor W using the reordered index I(W) is (g i ,g o ,g k )’s p-th 3D block b p , we can calculate L N Norm N p , the L N Norm N p Can reflect the use of mean mean p Represents the quantization error e(b p ). All 3D blocks of the reshaped 3D weight tensor can be calculated based on their quantization error (L N norm) in ascending order, and the r(t) block at the top is quantized and fixed. That is, the fixed block b p The weight coefficient of W(t) in is set to mean p , and set the corresponding entries in the quantization mask Q(t) to 1. This will produce the quantized weight coefficients W Q (t) and the corresponding quantization mask Q(t).
[0049] Given a training dataset D = {(x, y)}, where D can be the same as the original dataset D0 = {(x0, y0)}, a pre-trained weight coefficient W is obtained based on the original dataset. D can also be a dataset different from D0, but with the same data distribution as the original dataset D. After obtaining the quantized weight coefficient W Q (t) and the corresponding quantization mask Q(t), the system undergoes a retraining process to adjust the non-fixed weight coefficients. Specifically, the network forwarding calculation module 208 uses the current weight coefficient W Q (t), passing each input x through the current network to produce an estimated output Based on the ground truth annotation y and the estimated output The data loss calculation module 210 calculates the data loss £ D (D|Θ). The data loss G(W Q (t)). The automatic gradient calculation method used by deep learning frameworks (such as tensorflow or pytorch) can be used here to calculate G(W Q (t)). Based on the gradient G(W Q (t)) and quantization mask Q(t), the back propagation and weight update module 214 can be used to update W through BP Q The retraining module 206 may include an iterative process, so that multiple iterations may be used to update W Q The system 200 can move to the next iteration t+1, where, given a new quantization ratio r(t+1), the system 200 can move to the next iteration t+1, where, based on W Q (t) and I(W), the new quantization weight coefficient W can be calculated through the quantization process Q (t+1) and the corresponding quantization mask Q(t+1), and the system proceeds to the next iteration.
[0050] During each iteration, the value of the quantization ratio r(t) increases as t increases, so that more and more weight coefficients are quantized and fixed throughout the iterative learning process.
[0051] Now refer to Figure 3 , depicts an operational flow diagram illustrating the steps of a method 300 for compressing a neural network model. In some embodiments, the computer 102 ( Figure 1 ) and server computer 114 ( Figure 1 ) to execute Figure 3 In some embodiments, the process may be performed by another device or a group of devices. Figure 3 The at least one process block of the present invention is that the other device or group of devices is separate from or includes the computer 102 and the server computer 114.
[0052] At 302 , method 300 includes reshaping a multidimensional tensor corresponding to a set of weight coefficients associated with a neural network.
[0053] At 304 , method 300 includes identifying a subset of weight coefficients from the set of weight coefficients.
[0054] In some embodiments, identifying the subset of weight coefficients from the set of weight coefficients includes: quantizing the set of weight coefficients; and selecting the subset of weight coefficients that minimizes a quantizability regularization loss value, wherein the quantizability regularization loss value corresponds to a data loss value and a quantization loss value, and the data loss value and the quantization loss value are associated with the quantized set of weight coefficients.
[0055] In some embodiments, the minimized quantizability regularization loss value is back-propagated, and the neural network is trained according to the back-propagated minimized quantizability regularization loss value.
[0056] In some embodiments, the minimized quantizability regularization loss value is back-propagated, and at least one weight coefficient in the subset of weight coefficients is fixed according to the back-propagated minimized quantizability regularization loss value.
[0057] In some embodiments, a gradient and a quantization mask associated with the subset of weight coefficients are determined, and at least one non-fixed weight coefficient in the subset of weight coefficients is updated based on the determined gradient and the quantization mask.
[0058] In some embodiments, the subset of weight coefficients is compressed by quantizing and entropy coding the subset of weight coefficients.
[0059] In some embodiments, compression is performed separately on each layer of the neural network.
[0060] At 306 , method 300 includes compressing the model of the neural network based on the identified subset of weight coefficients.
[0061] I understand. Figure 3 This is merely an illustration of one embodiment and does not imply any limitation on how different embodiments may be implemented. Many modifications to the depicted environment may be made based on design and implementation requirements.
[0062] Through the method, system and computer-readable storage medium for compressing a neural network model provided by the embodiments of the present disclosure, quantizability regularization can be used to improve the efficiency of further compressing the learned weight coefficients, thereby achieving a significantly compressed neural network model.
[0063] Figure 4 According to an exemplary embodiment Figure 1 400. It should be understood that Figure 4 This is merely an illustration of one embodiment and is not meant to imply any limitations on the environments in which different embodiments may be implemented. Many modifications to the depicted environments may be made based on design and implementation requirements.
[0064] Computer 102 ( Figure 1 ) and server computer 114 ( Figure 1 ) may include Figure 4 Respective sets of internal components 800A, 800B and external components 900A, 900B are shown. Each of the sets of internal components 800 includes at least one processor 820, at least one computer-readable RAM 822, and at least one computer-readable ROM 824 on at least one bus 826, at least one operating system 828, and at least one computer-readable tangible storage device 830.
[0065] The processor 820 is implemented in hardware, firmware, or a combination of hardware and software. The processor 820 is a central processing unit (CPU), a graphics processing unit (GPU), an accelerated processing unit (APU), a microprocessor, a microcontroller, a digital signal processor (DSP), a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), or another type of processing component. In some embodiments, the processor 820 includes at least one processor that can be programmed to perform a function. The bus 826 includes components that allow communication between internal components 800A and 800B.
[0066] Server computer 114 ( Figure 1 ) on at least one operating system 828, software program 108 ( Figure 1 ) and quantizability regularizer 116( Figure 1 ) are stored in at least one respective computer-readable tangible storage device 830 for execution by at least one respective processor 820 via at least one respective RAM 822 (which typically includes cache memory). Figure 4 In the illustrated embodiment, each computer-readable tangible storage device 830 is a magnetic disk storage device of an internal hard drive. Alternatively, each computer-readable tangible storage device 830 is a semiconductor memory device such as ROM 824, EPROM, flash memory, optical disk, magneto-optical disk, solid-state disk, compact disk (CD), digital versatile disk (DVD), floppy disk, cartridge, magnetic tape, and / or another type of non-volatile computer-readable tangible storage device that can store computer programs and digital information.
[0067] Each set of internal components 800A, 800B also includes a R / W drive or interface 832 to read from or write to at least one portable computer readable tangible storage device 936 (e.g., a CD-ROM, DVD, memory stick, tape, magnetic disk, optical disk, or semiconductor storage device). Figure 1 ) and quantizability regularization 116( Figure 1 )) can be stored on at least one respective portable computer-readable tangible storage device 936, read via a respective R / W drive or interface 832, and loaded into a respective hard drive 830.
[0068] Each set of internal components 800A, 800B also includes a network adapter or interface 836 (e.g., a TCP / IP adapter card), a wireless Wi-Fi interface card, or a 3G, 4G, or 5G wireless interface card or other wired or wireless communication link. The server computer 114 (e.g., the server computer 114 can be connected to the server computer 114 from an external computer via a network (e.g., the Internet, a local area network, or other wide area network) and a corresponding network adapter or interface 836. Figure 1 ) on the software program 108 ( Figure 1 ) and quantizability regularizer 116( Figure 1 ) is downloaded to computer 102( Figure 1 ). From the network adapter or interface 836, the software program 108 and the scalability regularizer 116 on the server computer 114 are loaded into the corresponding hard drive 830. The network may include copper wire, fiber optics, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers.
[0069] Each set of external components 900A, 900B may include a computer display monitor 920, a keyboard 930, and a computer mouse 934. External components 900A, 900B may also include a touch screen, a virtual keyboard, a touchpad, a pointing device, and other human-computer interface devices. Each set of internal components 800A, 800B also includes a device driver 840 to interface with the computer display monitor 920, the keyboard 930, and the computer mouse 934. The device driver 840, the R / W driver or interface 832, and the network adapter or interface 836 comprise hardware and software (stored in the storage device 830 and / or ROM 824).
[0070] It should be understood in advance that although the present disclosure includes a detailed description of cloud computing, the embodiments of the teachings cited herein are not limited to cloud computing environments. Instead, some embodiments can be implemented in conjunction with any other type of computing environment now known or later developed.
[0071] Cloud computing is a service delivery model for enabling convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, network bandwidth, servers, processing, memory, storage, applications, virtual machines, and services) that can be rapidly provisioned and released with minimal management effort or interaction with the service provider. The cloud model can include at least five characteristics, at least three service models, and at least four deployment models.
[0072] Features are as follows:
[0073] On-demand self-service: Cloud users can automatically and unilaterally provision computing capabilities, such as server time and network storage, as needed without manual interaction with the service provider.
[0074] Broad network access: Functionality is available over a network and accessed through standard mechanisms that facilitate use with heterogeneous thin or thick client platforms (e.g., mobile phones, laptops, and PDAs).
[0075] Resource pooling: A provider's computing resources can be pooled together through a multi-tenant model to serve multiple consumers, dynamically allocating and reallocating different physical and virtual resources based on demand. Generally, consumers cannot control or know the exact location of the provided resources, but can specify the location at a higher level of abstraction (e.g., country, state, or data center), thus achieving location independence.
[0076] Rapid elasticity: In some cases, capabilities can be provisioned quickly and elastically, and in some cases, automatically scaled out quickly and released quickly to scale in quickly. To the user, the capabilities available for provisioning often appear to be unlimited and can be purchased in any quantity at any time.
[0077] Measured service: A cloud system automatically controls and optimizes resource usage by leveraging metering capabilities at a level of abstraction appropriate to the type of service (e.g., storage, processing, bandwidth, and active user accounts). Resource usage can be monitored, controlled, and reported, providing transparency to both the provider and the user of the service being used.
[0078] The service model is as follows:
[0079] Software as a Service (SaaS): The functionality provided to consumers is the use of the provider's applications running on the cloud infrastructure. Applications are accessed from a variety of client devices through a thin client interface such as a web browser (e.g., web-based email). Users neither manage nor control the underlying cloud infrastructure, including the network, servers, operating systems, storage, or even individual application functionality, except for potential restrictions on user-specific application configuration settings.
[0080] Platform as a Service (PaaS): The functionality provided to consumers is to deploy applications they create or acquire onto cloud infrastructure. These applications are built using programming languages and tools supported by the provider. Users neither manage nor control the underlying cloud infrastructure, including networks, servers, operating systems, or storage, but do have control over deployed applications and may also have control over the configuration of the application hosting environment.
[0081] Infrastructure as a Service (IaaS): The functionality provided to consumers is to provide processing, storage, networking, and other basic computing resources, enabling consumers to deploy and run arbitrary software, including operating systems and applications, on them. Users neither manage nor control the underlying cloud infrastructure, but have control over the operating system, storage, deployed applications, and may have limited control over select network components (for example, host firewalls).
[0082] The deployment model is as follows:
[0083] Private cloud: Cloud infrastructure is run solely for an organization. It can be managed by that organization or a third party and can exist on-premises or off-premises.
[0084] Community cloud: The cloud infrastructure is shared by several organizations and supports a specific community with common concerns (e.g., mission, security requirements, policies, and compliance considerations). It can be managed by the organization or a third party and can exist on-premises or off-premises.
[0085] Public cloud: Cloud infrastructure is available to the public or a large industry group and is owned by the organization that sells the cloud services.
[0086] Hybrid cloud: A cloud infrastructure composed of two or more clouds (private, community, or public) that remain unique entities but are bound together by standardized or proprietary technologies that enable data and application portability (e.g., cloud explosion with inter-cloud load balancing).
[0087] Cloud computing environments are service-oriented with a focus on statelessness, low coupling, modularity, and semantic interoperability. The core of cloud computing is the infrastructure consisting of a network of interconnected nodes.
[0088] refer to Figure 5 , depicts an exemplary cloud computing environment 500. As shown, the cloud computing environment 500 includes at least one cloud computing node 10, with which a local computing device used by a cloud user can communicate, such as, for example, a personal digital assistant (PDA) or a cellular phone 54A, a desktop computer 54B, a laptop computer 54C and / or an automobile computer system 54N. The cloud computing nodes 10 can communicate with each other. They can be physically or virtually grouped in at least one network (not shown), such as a private cloud, a community cloud, a public cloud or a hybrid cloud or a combination thereof as described above. This allows the cloud computing environment 500 to provide infrastructure as a service, platform as a service and / or software as a service, without the cloud consumer needing to maintain resources on a local computing device. It should be understood that Figure 5 The types of computing devices 54A-N shown in FIG are intended to be exemplary only, and cloud computing node 10 and cloud computing environment 500 may communicate with any type of computerized device via any type of network and / or network addressable connection (e.g., using a web browser). Figure 6 , showing a cloud computing environment 500 ( Figure 5 ) provides a set of functional abstraction layers 600. It should be understood in advance that Figure 6 The components, layers, and functions shown in the figure are merely exemplary, and the embodiments are not limited thereto. As shown in the figure, the following layers and corresponding functions are provided:
[0089] The hardware and software layer 60 includes hardware components and software components. Examples of hardware components include: host 61; server 62 based on Reduced Instruction Set Computer (RISC) architecture; server 63; blade server 64; storage device 65; and network and networking components 66. In some embodiments, software components include network application server software 67 and database software 68.
[0090] Virtualization layer 70 provides an abstraction layer from which the following examples of virtual entities can be provided: virtual servers 71 ; virtual storage 72 ; virtual networks 73 , including virtual private networks; virtual applications and operating systems 74 ; and virtual clients 75 .
[0091] In one example, the management layer 80 may provide the functionality described below. Resource provisioning 81 provides dynamic acquisition of computing resources and other resources for performing tasks within a cloud computing environment. When resources are utilized in a cloud computing environment, metering and pricing 82 tracks the cost of resource usage and provides billing and invoicing for the consumption of these resources. In one example, these resources may include application software licenses. Security provides authentication for cloud users and tasks, as well as protection of data and other resources. User portal 83 provides access to the cloud computing environment for users and system administrators. Service level management 84 provides cloud computing resource allocation and management to meet the required service levels. Service level agreement (SLA) planning and implementation 85 provides for the pre-arrangement and procurement of cloud computing resources in anticipation of future demand according to the SLA.
[0092] The workload layer 90 provides examples of functionality that can utilize a cloud computing environment. Examples of workloads and functionality that can be provided from this layer include: mapping and navigation 91; software development and lifecycle management 92; virtual classroom instruction delivery 93; data analytics processing 94; transaction processing 95; and scalability regularization 96. Scalability regularization 96 can compress neural network models based on scalability regularization.
[0093] Some embodiments may be directed to systems, methods, and / or computer-readable media at any possible level of technical detail integration.The computer-readable media may include computer-readable non-volatile storage media having computer-readable program instructions for causing a processor to perform operations.
[0094] A computer-readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of computer-readable storage media includes the following: a portable computer floppy disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device such as a punched card or raised structure in a groove having instructions recorded thereon, and any suitable combination of the foregoing. As used herein, computer-readable storage media is not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., light pulses through a fiber optic cable), or electrical signals transmitted through wires.
[0095] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to a corresponding computing / processing device, or downloaded to an external computer or external storage device via a network (e.g., the Internet, a local area network, a wide area network, and / or a wireless network). The network can include copper transmission cables, optical transmission fibers, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in a computer-readable storage medium within the corresponding computing / processing device.
[0096] The computer readable program code / instructions for performing the operations may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, configuration data for an integrated circuit, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages (such as SmallTalk, C++, etc.) and procedural programming languages (such as the "C" programming language or similar programming languages). The computer readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN)), or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits including (for example) programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs) can execute computer-readable program instructions by utilizing state information of the computer-readable program instructions to personalize the electronic circuits and thereby perform various aspects or operations of the present disclosure.
[0097] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine, so that the instructions, which are executed by the processor of the computer or other programmable data processing device, create a method for implementing the functions / actions specified in the block or blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, which can direct the computer, programmable data processing device, and / or other equipment to operate in a specific manner so that the computer-readable storage medium storing the instructions includes such an article of manufacture, which includes instructions for implementing various aspects of the functions / operations specified in the block or blocks of the flowchart and / or block diagram.
[0098] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to perform a series of operational steps on the computer, other programmable apparatus, or other device to produce a computer-implemented process, such that the instructions executed on the computer, other programmable apparatus, or other device implement the functions / operations specified in the box or boxes of the flowchart and / or block diagram.
[0099] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architectures, functions, and operations of the systems, methods, and computer-readable media according to various embodiments. In this regard, each block in the flowchart or block diagram may represent a module, fragment, or portion of an instruction that includes at least one executable instruction for implementing a specified logical function. The method, computer system, and computer-readable media may include additional blocks, fewer blocks, different blocks, or blocks arranged differently from those depicted in the accompanying drawings. In some alternative embodiments, the functions indicated in the blocks may not be performed in the order indicated in the accompanying drawings. For example, two blocks shown in succession may actually be performed simultaneously or substantially simultaneously, or the blocks may sometimes be performed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart illustration, as well as the combination of blocks in the block diagram and / or flowchart illustration, may be implemented by a hardware-based dedicated system that performs a specified function or operation or a combination of dedicated hardware and computer instructions.
[0100] Obviously, the systems and / or methods described herein can be implemented in various forms of hardware, firmware, or a combination of hardware and software. The actual dedicated control hardware or software code that implements these systems and / or methods is not limited to these embodiments. Therefore, the operation and behavior of the systems and / or methods are described herein without reference to specific software code - it should be understood that software and hardware can be designed based on the description herein to implement the systems and / or methods.
[0101] Elements, actions or instructions used herein should not be interpreted as critical or necessary unless explicitly described as such. In addition, as used herein, the articles "a" and "an" are intended to include at least one project and can be used interchangeably with "at least one". In addition, as used herein, the term "group" is intended to include at least one project (e.g., related projects, unrelated projects, a combination of related projects and unrelated projects, etc.), and can be used interchangeably with "at least one". When only one project is meant, the term "one" or similar language is used. In addition, as used herein, the terms "has", "have", "having" etc. are intended to be open terms. Further, the phrase "according to" is intended to mean "at least in part according to", unless otherwise explicitly stated.
[0102] The description of the various aspects and embodiments has been presented for illustrative purposes, but the description is not intended to be exhaustive or limited to the disclosed embodiments. Although combinations of features are referenced in the claims and / or disclosed in the specification, these combinations are not intended to limit the disclosure of possible implementations. In fact, many of these features can be combined in ways not specifically listed in the claims and / or disclosed in the specification. Although each dependent claim listed below may be directly dependent on only one claim, the disclosure of possible implementations includes each dependent claim in combination with every other claim in the claim group. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, the practical application, or improvements over technology found in the marketplace, or to enable those of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for compressing a neural network model, characterized in that: include: For each network layer in the deep neural network model, a weight tensor having a first dimension is reshaped into a reshaped weight tensor having a second dimension, the second dimension being smaller than the first dimension; wherein the reshaped weight tensor is based on the number of input channels c i , number of output channels c o and reshape the weight tensor along the k-axis to determine the size (c i , c o ,k), k=k1·k2·k3, where the parameters k1, k2, and k3 correspond to the sizes of the convolution kernels of the height axis, weight axis, and depth axis, respectively, c i , c o , k1, k2, k3 are integers greater than or equal to 1; For the network layer in the deep neural network model, partitioning the reshaped weight tensor into a plurality of blocks; For the network layer in the deep neural network model, averaging the weight coefficients in each of the blocks to obtain a mean value of the weight coefficients of each block, and calculating a quantization error of each of the blocks; For the network layer in the deep neural network model, sorting all the blocks in ascending order according to the quantization error of each block; For the network layer in the deep neural network model, the weight coefficient in each block in the top r(t) block is set to the mean of the weight coefficients of the block, and the corresponding item in the quantization mask is set to 1 to generate a quantized weight coefficient and a corresponding quantization mask; wherein r(t) is a preset quantization ratio; updating at least one of the remaining non-fixed weight coefficients using a back-propagation mechanism based on a gradient associated with the quantized weight coefficient and a quantization mask; Each network layer in the deep neural network model is compressed separately, wherein the input data and output data of each network layer of the deep neural network model are 4D tensors, and the 4D tensors are video clips or images.
2. A volatile computer-readable medium, characterized in that A computer program for compressing a neural network model is stored thereon, the computer program being used to cause at least one computer processor to execute the method according to claim 1.
3. A server computer, characterized in that: The method comprises a processor and a memory; the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the method according to claim 1.
Citation Information
Patent Citations
Quantization for DNN accelerators
US20190340499A1