Bank-balanced sparse activation feature maps for neural network models

The bank-balanced sparse activation feature map technique addresses DNNs' high computational costs by segmenting activation maps into balanced banks, enhancing efficiency on edge devices.

JP7572753B2Active Publication Date: 2024-10-24MOFFETT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2023520074
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-09-30
Filing Date
2021-09-17
Publication Date
2024-10-24
Estimated Expiration
2041-09-17

AI Technical Summary

Technical Problem

Deep neural networks (DNNs) face high computational costs due to large model parameters, memory consumption, and computationally expensive vector representations, hindering their use in energy-constrained edge devices like mobile phones and surveillance cameras.

Method used

Implementing a bank-balanced sparse activation feature map approach in DNNs, where activation feature maps are segmented into multiple banks with balanced sparsity, reducing the number of non-zero elements in each bank, thereby decreasing arithmetic operations and memory requirements.

Benefits of technology

This method significantly reduces computational load and memory usage, enabling efficient DNN operation on resource-constrained devices while maintaining performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007572753000003
    Figure 0007572753000003
  • Figure 0007572753000004
    Figure 0007572753000004
  • Figure 0007572753000005
    Figure 0007572753000005
Patent Text Reader

Abstract

Embodiments disclose a bank-balanced sparse activation neural network model and a method for generating the bank-balanced sparse activation neural network model. According to one embodiment, a neural network sparsification engine determines a first deep neural network (DNN) model having two or more hidden layers. The engine determines a bank size, a bank layout, and a target sparsity. The engine segments an activation feature map into multiple banks based on the bank size and the bank layout. The engine generates a second DNN model by increasing the sparsity for each bank of the activation feature map based on the target sparsity, and the second DNN model is used for inference.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS This application claims the benefit of priority to U.S. Non-provisional Patent Application No. 17 / 038,557, filed September 30, 2020, the disclosure of which is incorporated herein by reference in its entirety.

[0002] FIELD OF THE DISCLOSURE Embodiments of the present disclosure relate generally to artificial intelligence. More particularly, embodiments of the present disclosure relate to methods and systems for bank-balanced sparse activation feature maps for deep neural network models. [Background technology]

[0003] Deep Neural Networks (DNNs) have become a widely used technique in artificial intelligence (AI) for extracting high-level information from lower-level data such as images, videos, audio, text, etc. However, the high computational cost of DNNs inhibits their use in applications with tight budgets regarding energy consumption, storage space, or latency tolerance, especially on edge devices such as mobile phones and surveillance cameras.

[0004] The computational cost of DNN models comes from various sources. First, DNN model parameters can be on the order of millions or tens of millions, resulting in enormous storage costs and inhibiting storage of DNN model parameters in memory space. Second, the number of neurons in a DNN model can consume a large amount of memory space and require billions of arithmetic operations during execution. Third, search engines based on vector representations generated by neural networks, such as face comparison engines, can be computationally expensive, in part due to the high-dimensional dense vector representations (embeddings) of DNNs. Summary of the Invention

[0005] Embodiments of the present disclosure are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings in which like reference symbols indicate similar elements and in which: [Brief description of the drawings]

[0006] [Figure 1] FIG. 1 is a block diagram illustrating an example deep neural network (DNN) model with bank-balanced sparse activation feature maps, according to one embodiment. [Figure 2A] FIG. 2 is a block diagram illustrating a neural network sparsification engine according to one embodiment. [Figure 2B] FIG. 2 is a block diagram illustrating a neural network sparsification engine according to one embodiment. [Diagram 3] FIG. 1 is a block diagram illustrating layers of a DNN model according to one embodiment. [Figure 4] FIG. 1 is a block diagram illustrating activation feature map sparsification by updating weights for layers of a DNN model, according to one embodiment. [Figure 5A] FIG. 1 is a block diagram illustrating bank-balanced sparse activation tensors for a layer of a DNN, according to one embodiment. [Figure 5B] FIG. 13 is a block diagram illustrating another example of bank-balanced sparse activation tensors for a layer of a DNN model, in accordance with one embodiment. [Figure 6] FIG. 2 is a block diagram illustrating a two-dimensional activation tensor according to one embodiment. [Figure 7] 1A-1C are block diagrams illustrating three examples of bank configurations for three-dimensional activation tensors, according to some embodiments. [Figure 8] 1 is a flow diagram illustrating a process for generating a bank-balanced sparse DNN, according to one embodiment. [Figure 9] 1 is a flow diagram illustrating a method according to one embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0007] Various embodiments and aspects of the present disclosure will be described with reference to the details discussed below, and the accompanying drawings illustrate various embodiments. The following description and drawings are illustrative of the present disclosure and should not be construed as limiting the present disclosure. Numerous specific details are described to provide a thorough understanding of the various embodiments of the present disclosure. However, in some instances, well-known or conventional details are not described to provide a concise discussion of the embodiments of the present disclosure.

[0008] References herein to "one embodiment" mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present disclosure. The appearances of the phrase "in one embodiment" in various places in the specification do not necessarily all refer to the same embodiment.

[0009] The following definitions apply to the elements and operations described herein. These definitions are intended to help illustrate embodiments of the present disclosure and are not meant to be construed as limiting.

[0010] Acceleration - Refers to modifying a DNN to reduce the number of arithmetic operations required to compute a DNN function.

[0011] Bank-balanced sparse weights - A sparsity pattern in which weights are balanced across one or more banks such that the number of non-zero weight elements in each bank is identical. Bank-balanced sparsity is applied to the weights of layers in a DNN model.

[0012] Bank-balanced sparse activation - A sparsity pattern that is balanced across one or more banks of feature maps such that the number of non-zero output activation elements in each bank is the same. Bank-balanced sparsity is applied to the output activation feature maps of layers in a DNN model.

[0013] Deep Neural Network (DNN) Model - A Deep Neural Network (DNN) model is a composite function that consists of several layers of basic functions, each of which takes as input the output of the previous layer and computes a new set of outputs. The output of each layer is called a neuron, and if the neuron has a non-zero value, it is activated (or active), otherwise it is deactivated (or inactive).

[0014] Objective Function - Refers to the function that is optimized during training by measuring how well a DNN performs on a particular task in relation to a particular training dataset.

[0015] Sparsification - Refers to the method of training a DNN (i.e., adjusting the parameters of the DNN) so that the number of activated neurons is significantly smaller than the total number of neurons (i.e., at least half the size, and usually less than a quarter of the size).

[0016] Tensor - refers to a data structure, such as a vector or matrix of any dimension, for storing parameters of a neural network.

[0017] An embodiment discloses a bank-balanced sparse activation neural network model and a method for generating the bank-balanced sparse activation neural network model. According to one aspect, a neural network sparsification engine determines a first deep neural network (DNN) model having two or more hidden layers. The engine determines a bank size, a bank layout, and a target sparsity. The engine segments an activation feature map into multiple banks based on the bank size and the bank layout. The engine generates a second DNN model by increasing the sparsity for each bank of the activation feature map based on the target sparsity, and the second DNN model is used for inference.

[0018] According to a second aspect, a bank-balanced sparse activation deep neural network (DNN) model is disclosed. The bank-balanced sparse activation DNN model includes an input layer, one or more hidden layers, and an output layer, the one or more hidden layers are disposed between the input layer and the output layer, and each hidden layer will output a bank-balanced sparse activation feature map. The bank-balanced sparse activation DNN model is generated by determining a first DNN model having one or more hidden layers, determining a bank size, a bank layout, and a target sparsity, segmenting the activation feature map into multiple banks based on the bank size and the bank layout, and generating a second DNN model as a bank-balanced sparse activation DNN model by increasing the sparsity for each bank of the activation feature map based on the target sparsity, and the second DNN model is used for inference.

[0019] FIG. 1 is a block diagram illustrating an exemplary deep neural network (DNN) model with bank-balanced sparse activation feature maps, according to one embodiment. With reference to FIG. 1, the DNN model 100 includes a deep neural network model with one or more internal / hidden layers 101-103 disposed between an input layer 111 and an output layer 113. Each of the internal layers 101-103 may have one or more tensors of weights / biases (not shown) and activation functions (not shown), which when multiplied with the input feature maps 111, 123-125 generate output activation feature maps 123-125, 113 for the respective layers. Here, the one or more output activation feature maps are bank-balanced sparse feature maps (bank-balanced sparse feature maps are discussed further below). Types of DNN models include, but are not limited to, traditional NNs in which each layer is fully connected to the previous layer and the next layer, partially connected DNNs, recurrent NNs, long short-term memory (LSTM) DNN models, and the like. Although some embodiments may be described in conjunction with the DNN of FIG. 1, this should not be construed as limiting the scope of types of DNN models.

[0020] 2A-2B are block diagrams illustrating a neural network sparsification engine according to one embodiment. Referring to FIG. 2A-2B, the neural network sparsification engine 200 may generate a bank-balanced sparse DNN model. In one embodiment, the neural network sparsification engine 200 includes inputs: training data and an evaluation metric (e.g., an objective function), a pre-trained DNN model (optional), a number of banks, a sparsity rate, and output: a DNN model with bank-balanced sparse activation feature maps. In one embodiment, the engine 200 may generate a pre-trained DNN model based on the input training data and an evaluation metric (e.g., an objective function).

[0021] In one embodiment, default or initial values ​​are set for bank size, bank layout, and sparseness ratio, e.g., bank size=2, 4, 8, 16; bank layout=column, row, channel; sparseness ratio=20%, 40%, 60%, etc. In another embodiment, the bank size, bank layout, and sparseness ratio are configurable by a user for a device / system having engine 200. In another embodiment, the bank size / layout and sparseness ratio are auto-configurable based on one or more hyper-parameters / type / dimensions of the neural network's tensors. For example, in a natural language processing DNN, the dimensions of the neural network's tensors may be the length of the sentence through word embeddings, i.e., a vector of each word with associated sentiment.

[0022] Here, the number of banks for the first dimension may be determined based on the sentence length dimension, such as number of banks = sentence length div val, where val is a number representing the bank size. The number of banks for the second dimension may be determined based on the word embedding dimension, such as number of banks = word embedding div val, where val is a number representing the bank size. An example of bank balanced activation with bank size = 4 is shown in FIG. 5A, and an example of bank balanced activation with bank size = 2 is shown in FIG. 5B. The sparse ratio may be set to a default value. For example, the sparse ratio may be set to 50% percent. In another embodiment, the sparse ratio may be automatically configured to increase as long as the evaluation metric (objective function) converges without adjusting the weights / biases of the DNN model, for example, as long as the output result is within a predetermined threshold for a predetermined number of iterations.

[0023] Referring to Figure 2B, in one embodiment, the neural network sparsification engine 200 may be implemented as part of a data processing system, a server, a computing system, an edge device, etc. The engine 200 may generate a bank-balanced sparse deep neural network model, such as the model 100 of Figure 1. Referring to Figure 2B, the engine 200 may include modules such as a DNN generator 201, a bank number determiner 202, a target sparsity determiner 203, an activation bank determiner 204, a DNN trainer 205, a sparsifier 206, etc.

[0024] In one embodiment, the DNN generator 201 may generate a DNN model based on one or more training datasets and an objective function. The training data may include input data and output labels for a particular task (e.g., classification, object detection, face recognition, language processing, etc.). In one embodiment, the DNN generator 201 may generate a sparse DNN model based on a pre-trained DNN model. The bank number determiner 202 may determine a bank value / number based on the bank of output activation feature maps, so that the banks are searchable based on the bank number. The target sparsity determiner 203 may determine a target sparsity (20% 40%, 60%, 80%, etc.) for the sparse DNN model. The activation bank determiner 204 may group / split the feature maps into several banks based on the bank size / layout. It should be noted that each neural network layer outputs an activation feature map, and the output activation feature map is the input for the next layer.

[0025] The DNN trainer 205 may train the DNN model by forward and backward propagation, or retrain the DNN model. The sparsifier 206 may apply sparsification to the DNN model by applying sparsification to weights or activation feature maps of any layer of the DNN model. It should be noted that some or all of the modules 201-206 may be implemented in software, hardware, or a combination thereof. For example, such modules may be installed in the storage device 212, loaded into the memory 211, and executed by one or more processors 210. Some of the modules 201-206 may be integrated as an integrated module.

[0026] Figure 3 is a block diagram illustrating layers of a DNN model according to one embodiment. Layer 300 may be a layer from a deep neural network, such as layer 101 in Figure 1. With reference to Figure 3, layer 300 may be represented by y = activation_fn (Wx + b), where x represents an input tensor, y represents an output tensor (or output activation feature map), W represents a tensor of weights, b represents a bias tensor, and activation_fn represents an activation function. Examples of activation functions include ReLU, Sigmoid, tanh, etc.

[0027] FIG. 4 is a block diagram illustrating activation feature map sparsification for a layer of a DNN by updating the weights of the layer, according to one embodiment. The layer 400 may represent the layer 300 of FIG. 3, but with activation pruning (or activation sparsification). With reference to FIG. 4, for activation pruning, one or more activation feature maps (e.g., output y) are set to zero based on the target sparsity. For example, y=activation_fn(Wx+b)·t, where t is a mask for the output tensor for activation_fn(Wx+b) for the layer, "·" is a mathematical element-wise multiplication operation, and y is the output. Here, the weight values ​​401 may be updated, for example W-->W', where W' is the updated weight tensor. Based on the new weight tensor, the activation feature map is y'=activation_fn(W'x+b), where y' is the output activation. Here, an activation-pruned DNN model, e.g., a DNN model with pruned activation tensors (i.e., feature maps) for one or more layers, uses fewer computations (e.g., multiplications and / or additions) for inference, resulting in a faster and more efficient DNN model. Mask t is a binary vector dynamically derived based on inputs x and t, where t is a function of activation_fn(Wx+b).

[0028] An example of a mask t can be obtained by taking the top k entries of each bank of the tensor activation_fn(Wx+b) and setting the elements corresponding to the top k of each bank to 1 and the other elements to 0, resulting in a total of k*number_of_banks nonzero elements.

[0029] In one embodiment, for a DNN model with L layers with output feature maps,

number

number

[0030] FIG. 5A is a block diagram illustrating a bank-balanced sparse activation tensor for a layer of a DNN, according to one embodiment. With reference to FIG. 5A, layer 500 may represent layer 400 of FIG. 4. In one embodiment, layer 500 outputs a dense activation matrix Y1 that represents an activation feature map tensor 501 before activation sparsification. As an example, with bank size=4, bank layout=row, and target sparsity ratio=50%, a sparsification engine (such as engine 200 of FIGS. 2A-2B) may generate a bank-balanced sparse feature map 502 based on feature map 501. Note that sparse activation may achieve hardware acceleration.

[0031] In one embodiment, a feature map 501 is generated by determining the dimension for applying sparsification. Referring to FIG. 5A, in this example, the engine 200 may be automatically configured to apply sparsification to the row dimension as a bank layout. Here, the engine 200 splits each row of the feature map according to the bank size, in this case, bank size=4, resulting in bank1 and bank2. For each bank, the engine 200 ranks the values ​​from maximum to minimum. For example, bank1 has values ​​ranked as 0.8, 0.2, 0.1, -0.4. Based on the target sparsity ratio, the maximum value is selected as the activation value and the rest are set to zero. Here, for a target sparsity ratio of 50%, 0.8 and 0.2 are selected as the activation values ​​for bank1, and the rest of the values ​​are set to zero (i.e., deactivated).

[0032] The engine 200 applies the selection process for the remaining banks for the layer 500 to generate the feature map 502. In one embodiment, the selection is performed incrementally and / or iteratively, e.g., a single activation value is zeroed out from a single bank at a time. In another embodiment, the activation values ​​are zeroed out based on a threshold, e.g., activation values ​​in a bank are set to zero if they are below the threshold. In one embodiment, each bank has a separate threshold.

[0033] FIG. 5B is a block diagram illustrating bank-balanced sparse activation tensors for a layer of a DNN, according to another embodiment. Referring to FIG. 5B, tensor 503 illustrates bank-balanced sparsification applied to the column dimension of tensor 501 (wherein engine 200 may be configured by a user to apply sparsification to the column dimension). Referring to FIG. 5B, each column is split into an upper bank (bank 1) and a lower bank (bank 2) based on bank size / layout, such as bank size=2 and bank layout=column. For each bank, activation values ​​are sorted and the top k activations are kept, and the rest are set to zero.

[0034] For example, based on a target sparsity ratio of 50%, each bank with two activation values ​​is reduced to one activation value (target ratio of 50%) to generate a bank-balanced sparse feature map 503. In one embodiment, the dimension (or component) for sparsifying bank size / layout and / or sparsity ratio may be configured by an operator of the accelerator / processing system / server / edge device using the engine 200. In another embodiment, the dimension, bank size / layout and / or sparsity ratio may be auto-configurable based on the dimension / component or hyperparameters of the tensor 501.

[0035] FIG. 6 is a block diagram illustrating a two-dimensional (2D) activation tensor, according to one embodiment. With reference to FIG. 6, layer 600 may represent layer 500 of FIG. 5A, and tensor 601 may represent tensor 501 of FIG. 5A. With reference to FIG. 6, in one embodiment, layer 600 outputs 2D activation tensor 601. In this case, tensor 601 may be the activation tensor for a natural language processing deep neural network, and tensor 601 includes dimensions: sentence length and hidden dim. Hidden dim may include dimensions for word embeddings, or any other dimension value for a natural language processing deep neural network.

[0036] FIG. 7 is a block diagram illustrating a three-dimensional (3D) activation tensor, according to one embodiment. With reference to FIG. 7, layer 700 may represent layer 500 of FIG. 5A, and tensor 701 may represent tensor 501 of FIG. 5A. With reference to FIG. 7, in one embodiment, layer 700 outputs 3D activation tensor 701. In this case, tensor 701 may be an activation tensor for an image recognition / classification deep neural network, where tensor 701 includes dimensions height, width, and channel. For example, a red-green-blue (RGB) image includes channels red, green, and blue, where each channel includes an image of size height×width. In an RGB image with depth, the channels may include red, green, blue, and depth. Different layers of a neural network may generate activation outputs with different numbers of channels, height, and / or width dimensions.

[0037] Referring to FIG. 7, in one embodiment, banks may be auto-configured based on the number of color channels for each activation feature map. Here, each channel (e.g., channel 711) may be considered as a bank, and the top k values ​​may be selected from each bank based on the target sparsity ratio to generate bank-balanced sparse activations. In another embodiment, the banks may be auto-configured or configured by an operator. In another embodiment, a channel may be split into several banks (e.g., channel 712 is split into four banks). Then, the top k values ​​may be selected from each bank based on the target sparsity ratio to generate bank-balanced sparse activations. In another embodiment, several channels may be combined as one bank (e.g., bank 713 includes two or more channels). Similarly, the top k values ​​may be selected from each bank based on the target sparsity ratio to generate bank-balanced sparse activations. Although two-dimensional and three-dimensional activation tensors are shown, the activation tensors may be of any dimension, e.g., 4, 5, 6, etc.

[0038] FIG. 8 is a flow diagram illustrating a process for generating a bank-balanced sparse DNN according to an embodiment. Process 800 may be implemented by processing logic, which may include software, hardware, or a combination thereof. For example, process 800 may be implemented by the neural network sparsification engine 200 of FIG. 2A, such as an accelerator, processor, server, edge device, host system having engine 200. Referring to FIG. 8, at block 801, processing logic receives training data and an objective function for a neural network model. The training data may include one or more data sets for neural network training. The training data may be a set of examples used to fit neural network model parameters (e.g., weights and bias connections between neurons of the neural network model). The objective function describes an inference goal (e.g., classification, object recognition task) and may include an evaluation criterion for determining how well the network model parameters fit the training data for a particular goal.

[0039] At block 802, the processing logic obtains a DNN model (e.g., a first DNN model) and a checkpoint. The DNN model may be obtained by performing training on an objective function using training data, or the DNN model may be a pre-trained DNN model. The checkpoint may include a checkpoint with an accuracy percentage (e.g., 89%) for a particular task when a particular training dataset is applied to the DNN model. In one embodiment, the target sparsity ratio may be automatically reconfigured based on the checkpoint. For example, the target sparsity ratio may be initially set to 80%, and if a sparsified DNN model generated based on the target sparsity with the target sparsity ratio maintains an accuracy percentage for a particular task within a predetermined threshold for the checkpoint, the target sparsity is automatically increased to generate the next sparsified DNN model. The automatic reconfiguration of the target sparsity ratio may be iterative. In this manner, the target sparsity may be automatically selected for the DNN for optimal acceleration.

[0040] At block 803, the processing logic obtains one or more bank sizes / layouts (to derive the number of banks) and a target sparsity value. The bank size / layout / target sparsity may be specified for each layer of the DNN individually, or the same bank size / layout / sparsity may be applied to each layer of the DNN model. In one embodiment, the bank size / layout derives a number of banks that are divisible by the tensor dimension of the activation tensor of the DNN model. The target sparsity value may be a percentage value such as 40%, 50%, 60%, etc. At block 803, the processing logic further divides the activation feature map (e.g., the output of a layer) into several banks based on the bank size / layout. The processing logic then determines a sparsity ratio for each bank.

[0041] At block 804, the processing logic evaluates whether the target sparsity is reached based on the sparsity ratio for each bank. If so, the process proceeds to block 805, where the DNN model is output as a bank-balanced sparse activation DNN model (e.g., the second DNN model). If not, the processing logic proceeds to block 806. At block 806, the processing logic determines whether the objective function converges. In one embodiment, the objective function converges if the change in the last predetermined number of iterations is within a predetermined threshold. For example, in the last 10 iterations, the modified DNN model produces an output within a 0.1% threshold range. If the objective function output is within the predetermined threshold range, e.g., converges, the processing logic proceeds to block 807. If the objective function cannot converge, the processing logic proceeds to block 808.

[0042] At block 807, the processing logic increases the sparsity of the activation feature map for each layer. Here, the activation feature map sparsity is increased by zeroing out activation values ​​or removing activation values ​​from the bank. For example, referring to FIG. 5A, row 1 of bank 1 has activation values ​​0.2, 0.1, -0.4, and 0.8. The sparsity is increased by removing -0.4 for a 75% sparsity ratio. In one embodiment, activation values ​​are removed from the bank of a layer while keeping the layer bank-balanced. In one embodiment, a threshold may be set for the bank, and the threshold may be gradually adjusted to gradually remove activation values ​​that are below the threshold. In one embodiment, the sparsity is increased by removing activation values ​​from each bank of each layer of the DNN model. Once the sparsity is increased, the processing logic then proceeds to block 804 to determine whether the target sparsity has been reached for the layer / DNN model.

[0043] At block 808, if the objective function fails to converge (e.g., the change in the last predetermined number of iterations is outside a predetermined threshold range), the processing logic forward propagates the DNN model based on the objective function. Here, input data (e.g., a subset of the training data) is fed forward through the DNN model. Each hidden layer accepts input data, processes the input data, and passes an output to the next subsequent layer. In one embodiment, the calculated weights / biases and outputs for each layer are stored and used for backpropagation.

[0044] At block 809, processing logic backpropagates the DNN model. Here, processing logic calculates layer output values ​​backwards through the network to calculate gradients (e.g., differences for output values ​​from forward propagation). In one embodiment, processing logic loops topologically backwards through the layers starting from the final layer to calculate the derivative of the final layer output for each layer. In this manner, processing logic may determine which weight / bias values ​​are responsible for the majority of errors, and weights / biases may be updated based on such determination. Once the weight / bias values ​​are updated, processing logic proceeds to block 806. In one embodiment, processing logic iteratively or incrementally specifies the DNN model as indicated by blocks 804 and 806-809 until the DNN model reaches the target sparsity.

[0045] FIG. 9 is a flow diagram illustrating a method according to an embodiment. The process 900 may be implemented by processing logic, which may include software, hardware, or a combination thereof. For example, the process 900 may be implemented by the neural network sparsification engine 200 of FIG. 2A, or an accelerator, processor, server, edge device, or host system having the engine 200. Referring to FIG. 9, at block 901, the processing logic determines a first deep neural network (DNN) model having one or more hidden layers. At block 902, the processing logic determines a bank size, a bank layout, and a target sparsity. At block 903, the processing logic groups the activation feature maps into several banks based on the bank size and the bank layout. At block 904, the processing logic generates a second DNN model by increasing the sparsity for each bank of the activation feature maps based on the target sparsity, and the second DNN model is used for inference.

[0046] In one embodiment, the second DNN model is generated by gradually increasing the sparsity for each bank of activation feature maps until the bank of activation feature maps reaches a target sparsity, and retraining the second DNN model to ensure that the second DNN model converges in response to increasing the sparsity for the bank of activation feature maps. In one embodiment, grouping the activation feature maps includes grouping the activation feature maps into several banks based on a bank layout, e.g., a row or column dimension of the activation tensor for a layer of the first DNN model if the activation tensor is a two-dimensional tensor, and grouping the activation feature maps into several banks based on a channel dimension or a row or column dimension (e.g., a bank layout) of the activation tensor for a layer of the first DNN model if the activation tensor is a three-dimensional or higher dimensional tensor.

[0047] In one embodiment, retraining the second DNN model includes calculating an output for the objective function by forward propagation, and updating weight parameters for each hidden layer of the DNN model by backward propagation based on the calculated output. In one embodiment, the second DNN model is a bank-balanced sparse DNN model.

[0048] In one embodiment, the second DNN model is a dynamic DNN model, and the weight parameters of the second DNN model for the first inference are different from the weight parameters for the second inference. In one embodiment, the sparsity for each activation feature map block is gradually increased by retaining the top k values ​​from each bank and gradually zeroing out the remaining values ​​for the bank, where k is 1 or greater.

[0049] In one embodiment, a bank-balanced sparse activation deep neural network (DNN) model includes an input layer, one or more hidden layers, and an output layer. The one or more hidden layers are disposed between the input layer and the output layer, and each hidden layer will output a bank-balanced sparse activation feature map. The bank-balanced sparse activation DNN model is generated by determining a first DNN model having one or more hidden layers, determining a bank size, a bank layout, and a target sparsity, grouping the activation feature map into multiple banks based on the bank size and the bank layout, and generating a second DNN model as a bank-balanced sparse activation DNN model by increasing the sparsity for each bank of the activation feature map based on the target sparsity, and the second DNN model is used for inference.

[0050] In one embodiment, the second DNN model is generated by gradually increasing the sparsity for each bank of activation feature maps until the bank of activation feature maps reaches a target sparsity, and retraining the second DNN model to ensure that the second DNN model converges in response to increasing the sparsity for the bank of activation feature maps. In one embodiment, grouping the activation feature maps includes grouping the activation feature maps into several banks based on a row or column dimension of the activation tensor for a layer of the first DNN model when the activation tensor is a two-dimensional tensor, and grouping the activation feature maps into several banks based on a channel dimension or a row or column dimension of the activation tensor for a layer of the first DNN model when the activation tensor is a three-dimensional or higher dimensional tensor.

[0051] In one embodiment, retraining the second DNN model includes calculating an output for the objective function by forward propagation, and updating weight parameters for each hidden layer of the DNN model by backward propagation based on the calculated output. In one embodiment, the second DNN model is a bank-balanced sparse DNN model.

[0052] In one embodiment, the second DNN model is a dynamic DNN model, and the weight parameters of the second DNN model for the first inference are different from the weight parameters for the second inference. In one embodiment, the sparsity for each activation feature map block is gradually increased by retaining the top k values ​​from each bank and gradually zeroing out the remaining values ​​for the bank, where k is 1 or greater.

[0053] It should be noted that some or all of the components illustrated and described above may be implemented in software, hardware, or a combination thereof. For example, such components may be implemented as software installed and stored in a persistent storage device, which may be loaded into memory and executed by a processor (not shown) to perform the processes or operations described throughout this application. Alternatively, such components may be implemented as executable code programmed or embedded in dedicated hardware, such as an integrated circuit (e.g., an application specific IC or ASIC), a digital signal processor (DSP), a field programmable gate array (FPGA), etc., which may be accessed by an application via a corresponding driver and / or operating system. Furthermore, such components may be implemented as specific hardware logic within a processor or processor core as part of an instruction set accessible by a software component via one or more specific instructions.

[0054] Some portions of the preceding detailed description are presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory. These algorithmic descriptions and representations are the way used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. An algorithm is here, and generally, understood to be a self-consistent sequence of operations leading to a desired result. Operations are those requiring physical manipulations of physical quantities.

[0055] It should be noted, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to such quantities. As is apparent from the above discussion, unless otherwise indicated, throughout the description, and in the following claims, discussions using terms such as those set forth in the claims will be understood to refer to operations and processes of a computer system or similar electronic computing device that manipulates and converts data represented as physical (electronic) quantities in the computer system's registers and memories into other data similarly represented as physical quantities in the computer system's memory or registers, or other such information storage, transmission, or display devices.

[0056] The embodiments of the present disclosure also relate to an apparatus for performing the operations herein. Such computer programs are stored in a non-transitory computer-readable medium. A machine-readable medium includes any mechanism for storing information in a form readable by a machine (e.g., a computer). For example, a machine-readable (e.g., computer-readable) medium includes a machine (e.g., computer) readable storage medium (e.g., read-only memory ("ROM"), random access memory ("RAM"), magnetic disk storage media, optical storage media, flash memory devices).

[0057] The processes or methods illustrated in the preceding figures may be implemented by processing logic including hardware (e.g., circuitry, dedicated logic, etc.), software (e.g., embodied on a non-transitory computer-readable medium), or a combination thereof. Although the processes or methods are described above with some sequential operations, it should be understood that some of the described operations may be performed in a different order. Additionally, some operations may be performed in parallel rather than sequentially.

[0058] The embodiments of the present disclosure are not described with reference to any particular programming language, it will be appreciated that a variety of programming languages ​​can be used to implement the teachings of the embodiments of the present disclosure as described herein.

[0059] In the foregoing specification, embodiments of the present disclosure have been described with reference to certain exemplary embodiments thereof. It will be apparent that various modifications may be made thereto without departing from the broader spirit and scope of the present disclosure as set forth in the following claims. The specification and drawings are therefore to be regarded in an illustrative rather than a restrictive sense.

Claims

1. A method for generating a deep neural network (DNN) model, executed by one or more processors, comprising: determining a first deep neural network (DNN) model having one or more hidden layers; determining a bank size, a bank layout, and a target sparsity; grouping a plurality of activation feature maps into a plurality of banks based on the bank size and the bank layout; generating a second DNN model by increasing sparsity for each bank of activation feature maps based on the target sparsity, the second DNN model being used for inference; The method includes:

2. Generating the second DNN model comprises: for each bank of activation feature maps, gradually increasing the sparsity for the bank of activation feature maps until the bank of activation feature maps reaches the target sparsity; retraining the second DNN model to ensure that the second DNN model converges in response to increasing the sparsity for the bank of activation feature maps; The method of claim 1 , comprising:

3. Grouping the activation feature maps If the activation tensor is a two-dimensional (2D) tensor, grouping the activation feature maps into multiple banks based on a row or column dimension of the activation tensor for a layer of the first DNN model; or If the activation tensor is a three or more dimensional tensor, grouping the activation feature maps into multiple banks based on a channel dimension, a row dimension, or a column dimension of the activation tensor for a layer of the first DNN model. The method of claim 1 , comprising:

4. Retraining the second DNN model comprises: Computing an output for the objective function by forward propagation; updating weight parameters for each hidden layer of the DNN model by backpropagation based on the calculated output; The method of claim 2 , comprising:

5. The method of claim 1 , wherein the second DNN model is a bank-balanced sparse DNN model.

6. The method of claim 1 , wherein the second DNN model is a dynamic DNN model, and weight parameters of the second DNN model for a first inference are different from weight parameters for a second inference.

7. 2. The method of claim 1 , wherein the sparsity for each activation feature map block is gradually increased by retaining the top k values ​​from each bank and gradually zeroing out the remaining values ​​for the bank, where k is greater than or equal to 1.

8. A non-transitory machine-readable medium storing instructions that, when executed by the one or more processors, cause the one or more processors to perform any of the methods described in claims 1 to 7.

9. An input layer; one or more hidden layers; an output layer, the one or more hidden layers being disposed between the input layer and the output layer, each hidden layer outputting a plurality of bank-balanced sparse activation feature maps; and A program for causing a computer to generate a bank-balanced sparse activation deep neural network (DNN) model comprising: one or more processors of said computer, determining a first DNN model having one or more hidden layers; Determine the bank size, bank layout, and target sparsity; grouping the activation feature maps into a plurality of banks based on the bank size and the bank layout; A program that generates a second DNN model as the bank-balanced sparse activation DNN model by increasing sparsity for each bank of an activation feature map based on the target sparsity, wherein the bank-balanced sparse activation DNN model is generated by performing an operation in which the second DNN model is used for inference.

10. Generating the second DNN model comprises: for each bank of activation feature maps, gradually increasing the sparsity for the bank of activation feature maps until the bank of activation feature maps reaches the target sparsity; retraining the second DNN model to ensure that the second DNN model converges in response to increasing the sparsity for the bank of activation feature maps; The program according to claim 9 .

11. Grouping the activation feature maps If the activation tensor is a two-dimensional (2D) tensor, grouping the activation feature maps into multiple banks based on a row or column dimension of the activation tensor for a layer of the first DNN model; or If the activation tensor is a three or more dimensional tensor, grouping the activation feature maps into multiple banks based on a channel dimension, a row dimension, or a column dimension of the activation tensor for a layer of the first DNN model. The program according to claim 9 .

12. Retraining the second DNN model comprises: Computing an output for the objective function by forward propagation; updating weight parameters for each hidden layer of the DNN model by backpropagation based on the calculated output; The program according to claim 10 .

13. The program of claim 9 , wherein the second DNN model is a bank-balanced sparse DNN model.

14. 10. The program of claim 9, wherein the second DNN model is a dynamic DNN model, and weight parameters of the second DNN model for the first inference are different from weight parameters for the second inference.

15. 10. The program of claim 9, wherein the sparsity for each activation feature map block is gradually increased by retaining the top k values ​​from each bank and gradually zeroing out the remaining values ​​for the bank, where k is greater than or equal to 1.

Citation Information

Patent Citations

  • Systems and methods for deep convolutional network-based classification of cell images and videos

    JP2018514844A

  • Forced Sparsity for Classification

    JP2018527677A

  • Dynamic adaptation of deep neural networks

    US20200134461A1

  • Structured Sparsity Guided Training In An Artificial Neural Network

    US20200279133A1