Bit sparse neural network optimization
Bit-level pruning of neural network weights and activations addresses the efficiency challenges in deep learning, enhancing inference accuracy and reducing power consumption in mobile devices by dynamically pruning activation data during inference.
Patent Information
- Application Number
- GB2023009594
- Authority / Receiving Office
- GB · GB
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-07-11
- Filing Date
- 2023-06-26
- Publication Date
- 2024-09-18
- Estimated Expiration
- 2043-06-26
AI Technical Summary
Deep learning neural networks face challenges in power and storage efficiency due to high calculation requirements, particularly in mobile devices, as lower bit-width quantization and higher sparsity in weight and activation data lead to decreased inference accuracy.
The approach involves bit-level pruning of neural network weights and activations, using a bit-pruning unit to dynamically prune activation data during inference, reducing power consumption by minimizing bit-level switching.
This method enhances the efficiency of neural network inference processes by reducing power consumption while maintaining inference accuracy through optimized bit-level pruning strategies.
Smart Images

Figure 00000001_0000 
Figure 00000002_0000 
Figure 00000003_0000
Abstract
Description
13 02 24 BACKGROUND
[0001] The present disclosure relates to computer systems. More particularly, the present disclosure relates to machine learning and neural network systems. 5
[0002] Machine learning in general, and deep learning in particular, such as deep neural networks (DNNs), convolutional neural networks (CNNs), etc., are popular solutions to a wide array of challenging classification, recognition and regression problems. However, many artificial neural networks (ANN) models require a large number of calculations involving a large number of weights and activations, which 10 presents a significant challenge with respect to access, storage and performance, particularly for mobile and other power or storage-constrained devices.
[0003] To execute deep learning inference workloads more efficiently, neural network models may be quantized and pruned at the granularity of the element values of the weight and / or activation data (i.e., at the word level). For example, during neural 15 network training, weight values may be quantized from floating point (or higher-precision integer) to 8-bit integer, and then pruned to 50% sparsity (i.e., 50% of the weight values are set to zero). A similar approach may be applied to activation values during neural network training, which requires dynamic quantization and pruning of the activation values during inference. 20
[0004] Unfortunately, lower bit-width quantization (e.g., integers less than 8-bits) and higher-sparsity word-level pruning (e.g., greater than 50% sparsity) undesirably decreases inference accuracy. BRIEF DESCRIPTION OF THE DRAWINGS 13 02 24
[0005] FIG. 1 depicts an ANN, in accordance with embodiments of the present disclosure.
[0006] FIG. 2 depicts a CNN, in accordance with embodiments of the present 5 disclosure.
[0007] FIG. 3A depicts convolutional layer calculation for a CNN, FIG. 3B depicts a converted convolutional layer calculation for a CNN, and FIG. 3C depicts a converted input data matrix, in accordance with an embodiment of the present disclosure. 0
[0008] FIG. 4 depicts a data flow diagram for a multiply-and-accumulate (MAC) array.
[0009] FIG. 5 depicts a power consumption contour graph, in accordance with an embodiment of the present disclosure.
[0010] FIG. 6 depicts a bit-pruning unit (BPU), in accordance with an 15 embodiment of the present disclosure. [0011 ] FIGS. 7A to 7L depict the generation of the mask of the first set bit for different input data values, in accordance with an embodiment of the present disclosure.
[0012] FIG. 8 depicts parallel prefix logic to generate the mask of the first set bit, in accordance with an embodiment of the present disclosure. 20
[0013] FIGS. 9A to 9L depict the generation of the mask of the first set bit for different input data values, in accordance with an embodiment of the present disclosure. 13 02 24
[0014] FIG. 10 depicts a block diagram of system, in accordance with an embodiment of the present disclosure. DETAILED DESCRIPTION
[0015] Embodiments of the present disclosure will now be described with 5 reference to the drawing figures, in which like reference numerals refer to like parts throughout.
[0016] Embodiments of the present disclosure address quantization and pruning of neural network data from a novel perspective. Instead of conventional quantization and pruning at the weight or activation element level (i.e., the word level), embodiments of the 0 present disclosure advantageously prune the bits of each weight and activation element (i.e., the bit level), which reduces the density of effective “set” bits in weight and activation data, which, advantageously, reduces the power consumption of the neural network inference process by reducing the degree of bit-level switching during inference.
[0017] Generally, weight data are quantized and “bit-pruned” during neural network 15 training and the resulting weights are used during inference. In many embodiments, activation data are quantized and bit-pruned during neural network training, and then dynamically quantized and bit-pruned during inference. Embodiments of the present disclosure also provide a bit-pruning unit (BPU) to dynamically prune activation data during inference. 20
[0018] In one embodiment, a method includes training a neural network, based on training data, to generate a trained neural network, the neural network including weights, the training including quantizing the weights to generate quantized weights, 13 02 24 each quantized weight including a number of bits set to 1, and pruning, based on the number of bits set to 1, the quantized weights to generate bit-pruned weights, each bit pruned weight including a smaller number of bits set to 1 than the respective quantized weight, where the trained neural network includes the bit-pruned weights. 5
[0019] An ANN models the relationships between input data or signals and output data or signals using a network of interconnected nodes that is trained through a learning process. The nodes are arranged into various layers, including, for example, an input layer, one or more hidden layers, and an output layer. The input layer receives input data, such as, for example, image data, and the output layer generates output 10 data, such as, for example, a probability that the image data contains a known object. Each hidden layer provides at least a partial transformation of the input data to the output data. A DNN has multiple hidden layers in order to model complex, nonlinear relationships between input data and output data.
[0020] In a fully-connected, feedforward ANN, each node is connected to all of 15 the nodes in the preceding layer, as well as to all of the nodes in the subsequent layer. For example, each input layer node is connected to each hidden layer node, each hidden layer node is connected to each input layer node and each output layer node, and each output layer node is connected to each hidden layer node. Additional hidden layers are similarly interconnected. Each connection has a weight value, and each 20 node has an activation function, such as, for example, a linear function, a step function, a sigmoid function, a tanh function, a rectified linear unit (ReLU) function, etc., that determines the output of the node based on the weighted sum of the inputs to the node. The input data propagates from the input layer nodes, through respective connection 13 02 24 weights to the hidden layer nodes, and then through respective connection weights to the output layer nodes.
[0021] More particularly, at each input node, input data is provided to the activation function for that node, and the output of the activation function is then 5 provided as an input data value to each hidden layer node. At each hidden layer node, the input data value received from each input layer node is multiplied by a respective connection weight, and the resulting products are summed or accumulated into an activation value that is provided to the activation function for that node. The output of the activation function is then provided as an input data value to each output layer node. 10 At each output layer node, the output data value received from each hidden layer node is multiplied by a respective connection weight, and the resulting products are summed or accumulated into an activation value that is provided to the activation function for that node. The output of the activation function is then provided as output data. Additional hidden layers may be similarly configured to process data. 15
[0022] FIG. 1 depicts ANN 10, in accordance with an embodiment of the present disclosure.
[0023] ANN 10 includes input layer 20, one or more hidden layers 30, 40, 50, etc., and output layer 60. Input layer 20 includes one or more input nodes 21, 22, 23, etc. Hidden layer 30 includes one or more hidden nodes 31, 32, 33, 34, 35, etc. 20 Hidden layer 40 includes one or more hidden nodes 41, 42, 43, 44, 45, etc. Hidden layer 50 includes one or more hidden nodes 51, 52, 53, 54, 55, etc. Output layer 60 includes one or more output nodes 61, 62, etc. Generally, ANN 10 includes N hidden layers, input layer 20 includes “i” nodes, hidden layer 30 includes “j” nodes, hidden 13 02 24 layer 40 includes “k” nodes, hidden layer 50 includes “m” nodes, and output layer 60 includes “o” nodes.
[0024] In one embodiment, N equals 3, i equals 3, j, k and m equal 5 and o equals 2 (depicted in FIG. 1). Input node 21 is coupled to hidden nodes 31 to 35, input 5 node 22 is coupled to hidden nodes 31 to 35, and input node 23 is coupled to hidden nodes 31 to 35. Hidden node 31 is coupled to hidden nodes 41 to 45, hidden node 32 is coupled to hidden nodes 41 to 45, hidden node 33 is coupled to hidden nodes 41 to 45, hidden node 34 is coupled to hidden nodes 41 to 45, and hidden node 35 is coupled to hidden nodes 41 to 45. Hidden node 41 is coupled to hidden nodes 51 10 to 55, hidden node 42 is coupled to hidden nodes 51 to 55, hidden node 43 is coupled to hidden nodes 51 to 55, hidden node 44 is coupled to hidden nodes 51 to 55, and hidden node 45 is coupled to hidden nodes 51 to 55. Hidden node 51 is coupled to output nodes 61 and 62, hidden node 52 is coupled to output nodes 61 and 62, hidden node 53 is coupled to output nodes 61 and 62, hidden node 54 is coupled to output 15 nodes 61 and 62, and hidden node 55 is coupled to output nodes 61 and 62.
[0025] Many other variations of input, hidden and output layers are clearly possible, including hidden layers that are locally-connected, rather than fully-connected, to one another.
[0026] Training an ANN includes optimizing the connection weights between 20 nodes by minimizing the prediction error of the output data until the ANN achieves a particular level of accuracy. One method is backpropagation, or backward propagation of errors, which iteratively and recursively determines a gradient descent with respect to 13 02 24 the connection weights, and then adjusts the connection weights to improve the performance of the network.
[0027] A multi-layer perceptron (MLP) is a fully-connected ANN that has an input layer, an output layer and one or more hidden layers. MLPs may be used for natural 5 language processing applications, such as machine translation, speech recognition, etc. Other ANNs include recurrent neural networks (RNNs), long short-term memories (LSTMs), sequence-to-sequence models that include an encoder RNN and a decoder RNN, shallow neural networks, etc.
[0028] A CNN is a variation of an MLP that may be used for classification or 10 recognition applications, such as image recognition, speech recognition, etc. A CNN has an input layer, an output layer and multiple hidden layers including convolutional layers, pooling layers, normalization layers, fully-connected layers, etc. Each convolutional layer applies a sliding dot product or cross-correlation to an input volume, applies an activation function to the results, and then provides the activation or output 15 volume to the next layer. Convolutional layers typically use the ReLU function as the activation function. In certain embodiments, the activation function is provided in a separate activation layer, such as, for example, a ReLU layer. A pooling layer reduces the dimensions of the output volume received from the preceding convolutional layer, and may calculate an average or a maximum over small clusters of data, such as, for 20 example, 2x2 matrices. In certain embodiments, a convolutional layer and a pooling layer may form a single layer of a CNN. The fully-connected layers follow the convolutional and pooling layers, and include a flatten layer and a classification layer, followed by a normalization layer that includes a normalization function, such as the 13 02 24 SoftMax function. The output layer follows the last fully-connected layer; in certain embodiments, the output layer may include the normalization function.
[0029] FIG. 2 depicts CNN 100, in accordance with an embodiment of the present disclosure. CNN 100 includes input layer 120, one or more hidden layers, such 5 as convolutional layer 130-1, pooling layer 130-2, hidden (flatten) layer 140, hidden (classification) layer 150, etc., and output layer 160. Many other variations of input, hidden and output layers are contemplated.
[0030] Input layer 120 includes one or more input nodes 121, etc., that present the input data, such as a color image, as an input volume to the first convolutional layer, 10 e.g., convolutional layer 130-1. The input volume is a three-dimensional matrix that has a height (1st dimension or number of rows), a width (2nd dimension or number of columns) and a depth (3rd dimension). For example, input data that represent a color image are presented as an input volume that is 512 pixels x 512 pixels x 3 channels (red, green, blue); other input volume dimensions may also be used, such as 32x32x3, 15 64x64x3, 128x128x3, etc., 32x32x1, 64x64x1, 128x128x1, 512x512x1, etc.
[0031] Convolutional layer 130-1 is locally-connected to input layer 120, and includes a plurality of nodes that are connected to local regions in the input volume (not depicted for clarity). For a CNN that uses a standard convolution, each node computes a dot product between the node’s weights and the respective local region of the input 20 volume. An activation function is then applied to the results of each convolution calculation to produce an output volume that is provided as an input volume to the subsequent layer. The activation function may be applied by each convolutional layer node or by the nodes of a subsequent locally-connected ReLU layer. 13 02 24
[0032] Pooling layer 130-2 is locally-connected to convolutional layer 130-1, and includes a plurality of nodes that are connected to local regions in the input volume (not depicted for clarity). Pooling layer 130-2 also produces an output volume that is provided as the input volume to the subsequent layer, such as, for example, another 5 convolutional layer 130-1, a flatten layer 140, etc. In certain embodiments, convolutional layer 130-1 and pooling layer 130-2 form a single hidden layer 130. Similarly, in certain embodiments, convolutional layer 130-1, a ReLU layer and pooling layer 130-2 form a single hidden layer 130. Generally, the output volumes of the convolutional and pooling layers may be described as feature maps, and one or more 10 single hidden layers 130 form a feature learning portion of CNN 100.
[0033] Hidden layer 140 is a “flatten” layer that is locally-connected to pooling layer 130-2, and includes one or more hidden (flatten) nodes 141, 142, 143, 144, 145, etc. Hidden (flatten) layer 140 “flattens” the output volume produced by the preceding pooling layer 130-2 into a column vector, which is provided to the subsequent, 15 fully-connected hidden layer 150.
[0034] Hidden layer 150 is a classification layer that is fully-connected to hidden (flatten) layer 140, and includes one or more hidden (classification) nodes 151, 152, 153, 154, 155, etc.
[0035] Output layer 160 includes one or more output nodes 161, 162, etc., and 20 is fully-connected to hidden (classification) layer 150. Fully-connected output layer 160 receives the classification results output by hidden (classification) layer 150, and each node outputs a predicted class score. A normalization function, such as a SoftMax function, may be applied to the predicted class scores by output layer 160, or, 13 02 24 alternatively, by an additional layer interposed between hidden (classification) layer 150 and output layer 160.
[0036] Similar to ANNs, training a CNN includes optimizing the connection weights between nodes by minimizing the prediction error of the output data until the 5 CNN achieves a particular level of accuracy. As noted above, backpropagation may be used to iteratively and recursively determines a gradient descent with respect to the connection weights, and then adjusts the connection weights to improve the performance of the network. Matrix multiplication operations, and, more particularly, multiply-and-accumulate (MAC) operations, are used extensively by CNNs, as well as 10 other ANNs.
[0037] Typically, native convolution operations are not performed by a CNN due to the complicated dataflow and expensive datapaths that are usually required. Instead, native convolution operations are converted into generic matrix multiplication (GEMM) operations, and then the GEMM operations are executed more efficiently using 15 optimized software libraries for a processor or specialized hardware, such as, for example, a matrix multiply accelerator (MMA), a neural processing unit (NPU), a graphics processing unit (GPU), a digital signal processor (DSP), etc.
[0038] FIG. 3A depicts convolutional layer calculation 200 for a CNN, in accordance with an embodiment of the present disclosure. 20
[0039] Input feature maps 204 include four channels and one input data matrix for each channel, i.e., input data matrices 2041, 2042, 2043 and 2044. Filter 202 includes four filter or weight sets 2021, 2022, 2023 and 2024, and each filter or weight set includes four weight matrices, one weight matrix for each channel. Output feature 13 02 24 maps 206 include four channels and one output data matrix for each filter or weight set, i.e., output data matrices 2061, 2062, 2063 and 2064. Convolutional layer calculation 200 convolves filter 202 with input feature maps 204 to produce output feature maps 206. 5
[0040] Generally, input data matrices 2041, 2042, 2043 and 2044 form an input tensor, each weight set 2021, 2022, 2023 and 2024 forms a weight tensor, and output data matrices 2061, 2062, 2063 and 2064 form an output tensor. In this embodiment, each tensor has a height (1st dimension or number of rows), a width (2nd dimension or number of columns) and a depth (3rd dimension). The depth of the input tensor is equal 10 to the number of channels, the depth of each weight tensor is equal to the number of channels, and the depth of the output tensor is equal to the number of weight tensors (i.e., weight sets). While particular dimensions for the tensors and matrices have been selected for clarity of illustration and explanation, embodiments of the present disclosure are not so limited. 15
[0041] In one embodiment, input data matrix 2041 is a 5x5 matrix (i.e., 5 rows and 5 columns) associated with the first channel and includes activations a1i, a12, a13, a14, a15, a16, a1?, a1s, a19, a1io, a1n, a1i2, a1i3, a1i4, a1is, a1i6, a1i?, a1is, a1i9, a12o, a12i, a122, a123, a124 and a125. Input data matrix 2042 is a 5x5 matrix associated with the second channel and includes activations a2i, a22, a23, a24, a2s, a26, a2?, a2s, a29, a2w, 20 a2n, a2i2, a2i3, a2i4, a2is, a2ie, a2i?, a2is, a2w, a22o, a22i, a222, a223, a224 and a225. Input data matrix 2043 is a 5x5 matrix associated with the third channel and includes activations a3i, a32, a33, a34, a3s, a36, a37, a3s, a39, a3io, a3n, a3i2, a3i3, a3i4, a3is, a3ie, a3i7, a3i8, a3i9, a32o, a32i, a322, a323, a324 and a325. Input data matrix 2044 is a 5x5 matrix 13 02 24 associated with the fourth channel and includes activations a4i, a42, a43, a44, a4s, a46, a4?, a48, a49, a4io, a4n, a4i2, a4i3, a4i4, a4i5, a4i6, a4v, a4i8, a4i9, a42o, a42-i, a422, a423, a424 and a425.
[0042] In this embodiment, weight set 2021 includes four weight matrices 20211, 5 20212, 20213 and 20214. Weight matrix 2021i is a 2x2 matrix (i.e., 2 rows and 2 columns) associated with the first channel, and includes weights w1i, w12, w13 and w14. Weight matrix 20212 is a 2x2 matrix associated with the second channel, and includes weights w15, w16, w1? and w18. Weight matrix 20213 is a 2x2 matrix associated with the third channel, and includes weights w19, w1w, w1n and w1i2. Weight matrix 20214 is a 2x2 10 matrix associated with the fourth channel, and includes weights w1i3, w1i4, w1is and W116.
[0043] Weight set 2022 includes four weight matrices 2022i, 20222, 20223 and 20224. Weight matrix 2022i is a 2x2 matrix associated with the first channel, and includes weights w2i, w22, w23 and w24. Weight matrix 20222 is a 2x2 matrix associated 15 with the second channel, and includes weights w2s, w26, w2? and w2s. Weight matrix 20223 is a 2x2 matrix associated with the third channel, and includes weights w29, w2w, w2n and w2i2. Weight matrix 20224 is a 2x2 matrix associated with the fourth channel, and includes weights w2i3, w2i4, w2is and w2ie.
[0044] Weight set 2023 includes four weight matrices 2023i, 20232, 20233 and 20 20234. Weight matrix 2023i is a 2x2 matrix associated with the first channel, and includes weights w3i, w32, w33 and w34. Weight matrix 20232 is a 2x2 matrix associated with the second channel, and includes weights w3s, w36, w3? and w3s. Weight matrix 20233 is a 2x2 matrix associated with the third channel, and includes weights w39, w3w, 13 02 24 w3n and w3i2. Weight matrix 20234 is a 2x2 matrix associated with the fourth channel, and includes weights w3i3, w3i4, w3i5 and w3ie.
[0045] Weight set 2024 includes four weight matrices 2024i, 20242, 20243 and 20244. Weight matrix 2024i is a 2x2 matrix associated with the first channel, and 5 includes weights w4i, w\ w43 and w44. Weight matrix 20242 is a 2x2 matrix associated with the second channel, and includes weights w4s, w46, w4? and w4s. Weight matrix 20243 is a 2x2 matrix associated with the third channel, and includes weights w49, w4w, w4n and w4i2. Weight matrix 20244 is a 2x2 matrix associated with the fourth channel, and includes weights w4i3, w4u, w4is and w4w. 10
[0046] In this embodiment, output data matrix 2061 is a 4x4 matrix associated with weight set 2021 and includes activations o1i, o12, o13, o14, o15, o16, o1?, o1s, o19, o1io, o1n, o1i2, o1i3, o1i4, o1i5 and o1i6. Output data matrix 2062 is a 4x4 matrix associated with weight set 2022 and includes activations o2i, o22, o23, o24, o2s, o26, o2?, o2s, o29, o2io, o2n, o2i2, o2i3, o2i4, o2i5 and o2i6. Output data matrix 2063 is a 4x4 matrix associated 15 with weight set 2023 and includes activations o3i, o32, o33, o34, o3s, o36, o3?, o3s, o39, o3io, o3n, o3i2, o3i3, o3i4, o3i5 and o3i6. Output data matrix 2064 is a 4x4 matrix associated with weight set 2024 and includes activations o4i, o42, o43, o44, o4s, o46, o4?, o4s, o49, o4io, o4n, o4i2, o4i3, o4i4, o4i5 and o4i6.
[0047] For ease of explanation, each input data matrix 2041, 2042, 2043 and 2044 20 may be divided into four quadrants. The first quadrant spans the top (first) row and the second row, the second quadrant spans the second row and the third row, the third quadrant spans the third row and the fourth row, and the fourth quadrant spans the fourth row and the fifth (bottom) row. The first quadrant for input data matrix 2041 (a1qi), 13 02 24 the first quadrant for input data matrix 2042 (a2qi), the first quadrant for input data matrix 2043 (a3qi), and the first quadrant for input data matrix 2044 (a4qi) are depicted; the remaining three quadrants for each input data matrix are not depicted for clarity.
[0048] First quadrant a1qi includes elements a1i, a12, a13, a14, a1s, a16, a1?, a1s, 5 a19 and a1w, from which four blocks of elements are formed, i.e., a first block (a11, a12, a16 and a1?), a second block (a12, a13, a1? and a1s), a third block (a13, a14, a1s and a1g), and a fourth block (a14, a1s, a1g and a1w). First quadrant a2qi includes elements a2i, a22, a23, a24, a25, a26, a2?, a2s, a2g and a2w, from which four blocks of elements are formed, i.e., a first block (a2i, a22, a26 and a2?), a second block (a22, a23, a2? and a2s), a third 10 block (a23, a24, a2s and a2g), and a fourth block (a24, a2s, a2g and a2w). First quadrant a3qi includes elements a3i, a32, a33, a34, a3s, a36, a3?, a3s, a3g and a3io, from which four blocks of elements are formed, i.e., a first block (a3i, a32, a36 and a3?), a second block (a32, a33, a3? and a3s), a third block (a33, a34, a3s and a3g), and a fourth block (a34, a3s, a3g and a3w). First quadrant a4qi includes elements a4i, a42, a43, a44, a4s, a46, a4?, a4s, a4g 15 and a4w, from which four blocks of elements are formed, i.e., a first block (a4i, a42, a46 and a4?), a second block (a42, a43, a47 and a4s), a third block (a43, a44, a4s and a4g), and a fourth block (a44, a4s, a4g and a4w).
[0049] Second quadrant a1q2 includes elements a16, a17, a1s, a1g, a1w, a1n, a1i2, a1i3, a1i4 and a1is, from which four blocks of elements are formed, i.e., a first block (a16, 20 a17, a1n and aM, a second block (a17, a1s, a1i2 and a1is), a third block (a1s, a1g, a1i3 and a1i4), and a fourth block (a1g, a1io, 3¼ and a1is). Second quadrant a2q2 includes elements a26, a27, a2s, a2g, a2w, a2n, a2i2, a2i3, a2u and a2is, from which four blocks of elements are formed, i.e., a first block (a26, a27, a2n and a2i2), a second block (a27, a2s, 13 02 24 a2i2 and a2is), a third block (a2s, a29, a2n and a2i4), and a fourth block (a29, a2™, a2i4 and a2ib). Second quadrant a3q2 includes elements a36, a3?, a3s, a39, a3w, a3n, a3i2, a3i3, a3i4 and a3i5, from which four blocks of elements are formed, i.e., a first block (a36, a3?, a3n and a3i2), a second block (a3?, a3s, a3i2 and a3i3), a third block (a3s, a39, a3i3 and a3i4), 5 and a fourth block (a39, a3io, a3u and a3is). Second quadrant a4q2 includes elements a46, a4?, a48, a49, a4w, a4n, a4i2, a4i3, a4u and a4is, from which four blocks of elements are formed, i.e., a first block (a46, a4?, a4n and a4i2), a second block (a4?, a4s, a4i2 and a4is), a third block (a4s, a49, a4n and a4i4), and a fourth block (a49, a4w, a4u and a4is).
[0050] Third quadrant a1q3 includes elements a1n, a1i2, a1i3, a1i4, a1is, a1i6, a1i7, 10 a1i8, a119 and a12o, from which four blocks of elements are formed, i.e., a first block (a1n, a1i2, a1i6 and a1i7), a second block (a1i2, a113, a1i7 and a1is), a third block (a1i3, a1i4, a1is and a1ig), and a fourth block (a1i4, a1is, a1i9 and a12o). Third quadrant a2q3 includes elements a2n, a2i2, a2i3, a2i4, a2is, a2ie, a2i7, a2is, a2w and a22o, from which four blocks of elements are formed, i.e., a first block (a2n, a2i2, a2ie and a2i7), a second block (a2i2, 15 a2i3, a2v and a2is), a third block (a2i3, a2i4, a2is and a2ig), and a fourth block (a2i4, a2is, a2i9 and a22o). Third quadrant a3q3 includes elements a3n, a3i2, a3i3, a3i4, a3is, a3ie, a3i7, a3i8, a3w and a32o, from which four blocks of elements are formed, i.e., a first block (a3i 1, a3i2, a3i6 and a3i7), a second block (a3i2, a3i3, a3v and a3is), a third block (a3i3, a3i4, a3i8 and a3ig), and a fourth block (a3i4, a3is, a3ig and a32o). Third quadrant a4q3 20 includes elements a4n, a4i2, a4i3, a4i4, a4is, a4ie, a4i7, a4is, a4w and a42o, from which four blocks of elements are formed, i.e., a first block (a4n, a4i2, a4w and a4i7), a second block (a4i2, a4i3, a4v and a4is), a third block (a4i3, a4i4, a4is and a4w), and a fourth block (a4i4, a4i5, a4w and a42o). 13 02 24
[0051] Fourth quadrant a1q4 includes elements a1i6, a1-,?, a1i8, a1i9, a12o, a12i, a122, a123, a124 and a125, from which four blocks of elements are formed, i.e., a first block (a1i6, a1i7, a12i and a122), a second block (a1i7, a1is, a122 and a123), a third block (a1is, a1i9, a123 and a124), and a fourth block (a1i9, a12o, a124 and a12s). Fourth quadrant a2q4 5 includes elements a2ie, a2i7, a2is, a2i9, a22o, a22i, a222, a223, a224 and a225, from which four blocks of elements are formed, i.e., a first block (a2ie, a2i7, a22i and a222), a second block (a2i7, a2i8, a222 and a223), a third block (a2is, a2w, a223 and a224), and a fourth block (a2w, a22o, a224 and a22s). Fourth quadrant a3q4 includes elements a3ie, a3i7, a3is, a3i9, a32o, a32i, a322, a323, a324 and a325, from which four blocks of elements are formed, i.e., a 10 first block (a3ie, a3i7, a32i and a322), a second block (a3i7, a3is, a322 and a323), a third block (a3i8, a3i9, a323 and a324), and a fourth block (a3i9, a32o, a324 and 3¾. Fourth quadrant a4q4 includes elements a4ie, a4i7, a4is, a4w, a42o, a42i, a422, a423, a424 and a425, from which four blocks of elements are formed, i.e., a first block (a4ie, a4i7, a42i and a422), a second block (a4i7, a4is, a422 and a423), a third block (a4is, a4w, a423 and a424), 15 and a fourth block (a4w, a42o, a424 and a42s).
[0052] Output feature maps 206 may also be divided into four quadrants; in this case, each quadrant spans all four output data matrices 2061, 2062, 2063 and 2064. The first quadrant spans the top (first) row of each output data matrix, the second quadrant spans the second row of each output data matrix, the third quadrant spans the third row 20 of each output data matrix, and the fourth quadrant spans the fourth (bottom) row of each output data matrix. The first quadrant for output feature maps 206 (oqi), is depicted; the remaining three quadrants are not depicted for clarity. 13 02 24
[0053] First quadrant oqi includes o1i, o12, o13, o14, o2i, o22, o23, o24, o3i, o32, o33, o34, o4i, o42, o43 and o44. Second quadrant oq2 includes o15, o16, oS, o1s, o25, o26, oS, oS, o35, oS, oS, o38, o45, o46, o47 and o4s. Third quadrant oq3 includes o19, o1w, o1n, 0S2, oS, o2w, o2i 1, o2i2, o39, o3w, o3i 1, o3i2, o49, o4w, o4h and o4i2. Fourth quadrant oq4 5 includes o1i3, o1i4, o1i5, 0¼. o2i3, o2i4, 0S5, o2ie, o3i3, o3i4, 0S5, o3ie, o4i3, o4i4, o4is and O416.
[0054] Generally, each output element within output data matrices 2061, 2062, 2063 and 2064 is the sum of the dot products of one of the weight sets 2021, 2022, 2023 and 2024 and a block of activation elements within a particular quadrant of input data 10 matrices 2041, 2042, 2043 and 2044.
[0055] The calculation of the output elements in quadrant oqi follows.
[0056] Output element o1i of output data matrix 2061 is the sum of the dot products of weight set 2021 and the first block of activation elements within first quadrants a1qi, a2qi, a3qi and a4qi of input data matrices 2041, 2042, 2043 and 2044, 15 respectively. The first block of activation elements within first quadrants a1qi, a2qi, a3qi and a4qi includes a1i, a12, a16 and aS; a2i, a22, a26 and aS; a3i, a32, a36 and aS; and a4i, a42, a46 and aS, respectively.
[0057] More particularly, the following dot products are summed to generate output element oS: the dot product of the first weight matrix of weight set 2021 and the 20 first block of quadrant a1qi (i.e., wS • a1i + wS • a12 + wS • aS + w14 • aS), the dot product of the second weight matrix of weight set 2021 and the first block of quadrant a2qi (i.e., wS • a2i + wS • aS + wS • aS + wS • aS), the dot product of the third weight matrix of weight set 2021 and the first block of quadrant a3qi (i.e., wS • a3i + wSo • aS + 13 02 24 w1n • a36 + w1i2 • a3?), and the dot product of the fourth weight matrix of weight set 2021 and the first block of quadrant a4qi (i.e., w1i3 • a4i + w1i4 • a42 + w1i5 • a46 + w1i6 • a4?).
[0058] Similarly, output element o2i of output data matrix 2062 is the sum of the dot products of weight set 2022 and the first block of activation elements within first 5 quadrants a1qi, a2qi, a3qi and a4qi of input data matrices 2041, 2042, 2043 and 2044, respectively. Output element o3i of output data matrix 2063 is the sum of the dot products of weight set 2023 and the first block of activation elements within first quadrants a1qi, a2qi, a3qi and a4qi of input data matrices 2041, 2042, 2043 and 2044, respectively. And, output element o4i of output data matrix 2064 is the sum of the dot 10 products of weight set 2024 and the first block of activation elements within first quadrants a1qi, a2qi, a3qi and a4qi of input data matrices 2041, 2042, 2043 and 2044, respectively.
[0059] Output element o12 of output data matrix 2061 is the sum of the dot products of weight set 2021 and the second block of activation elements within the first 15 quadrants a1qi, a2qi, a3qi and a4qi of input data matrices 2041, 2042, 2043 and 2044, respectively. The second block of activation elements within the first quadrants a1qi, a2qi, a3qi and a4qi includes a12, a13, a1? and a1s; a22, a23, a2? and a2s; a32, a33, a3? and a3s; and a42, a43, a4? and a4s, respectively.
[0060] More particularly, the following dot products are summed to generate 20 output element o12: the dot product of the first weight matrix of weight set 2021 and the second block of quadrant a1qi (i.e., w1i • a12 + w12 • a13 + w13 • a1? + w14 • a1s), the dot product of the second weight matrix of weight set 2021 and the second block of quadrant a2qi (i.e., w15 • a22 + w16 • a23 + w1? • a2? + w1s • a2s), the dot product of the 13 02 24 third weight matrix of weight set 2021 and the second block of quadrant a3qi (i.e., w19 • a32 + w1w • a33 + w1n • a3? + w1i2 • a3s), and the dot product of the fourth weight matrix of weight set 2021 and the second block of quadrant a4qi (i.e., w1i3 • a42 + w1i4 • a43 + w1i5 • a4? + w1i6 • a4s). 5 [0061 ] Similarly, output element o22 of output data matrix 2062 is the sum of the dot products of weight set 2022 and the second block of activation elements within first quadrants a1qi, a2qi, a3qi and a4qi of input data matrices 2041, 2042, 2043 and 2044, respectively. Output element o32 of output data matrix 2063 is the sum of the dot products of weight set 2023 and the second block of activation elements within first 10 quadrants a1qi, a2qi, a3qi and a4qi of input data matrices 2041, 2042, 2043 and 2044, respectively. And, output element o42 of output data matrix 2064 is the sum of the dot products of weight set 2024 and the second block of activation elements within the quadrants a1qi, a2qi, a3qi and a4qi of input data matrices 2041, 2042, 2043 and 2044, respectively. 15
[0062] And so on for output elements o13 and o14, o23 and o24, o33 and o34, and o43 and o44 of the first rows of output data matrices 2061, 2062, 2063 and 2064.
[0063] With respect to quadrant oq2, output element o1s of output data matrix 2061 is the sum of the dot products of weight set 2021 and the first block of activation elements within second quadrants a1q2, a2q2, a3q2 and a4q2 of input data matrices 2041, 20 2042, 2043 and 2044, respectively. Output element o2s of output data matrix 2062 is the sum of the dot products of weight set 2022 and the first block of activation elements within second quadrants a1q2, a2q2, a3q2 and a4q2 of input data matrices 2041, 2042, 2043 and 2044, respectively. Output element o3s of output data matrix 2063 is the sum of the 13 02 24 dot products of weight set 2023 and the first block of activation elements within second quadrants a1q2, a2q2, a3q2 and a4q2 of input data matrices 2041, 2042, 2043 and 2044, respectively. And, output element o4s of output data matrix 2064 is the sum of the dot products of weight set 2024 and the first block of activation elements within second 5 quadrants a1q2, a2q2, a3q2 and a4q2 of input data matrices 2041, 2042, 2043 and 2044, respectively. And so on for output elements o16, o1? and o18, o26, o2? and o2s, o36, o3? and o38, and o46, o4? and o4s of the second rows of output data matrices 2061, 2062, 2063 and 2064.
[0064] With respect to quadrant oq3, output element o19 of output data matrix 10 2061 is the sum of the dot products of weight set 2021 and the first block of activation elements within third quadrants a1q3, a2q3, a3q3 and a4q3 of input data matrices 2041, 2042, 2043 and 2044, respectively. Output element o29 of output data matrix 2062 is the sum of the dot products of weight set 2022 and the first block of activation elements within third quadrants a1q3, a2q3, a3q3 and a4q3 of input data matrices 2041, 2042, 2043 15 and 2044, respectively. Output element o39 of output data matrix 2063 is the sum of the dot products of weight set 2023 and the first block of activation elements within third quadrants a1q3, a2q3, a3q3 and a4q3 of input data matrices 2041, 2042, 2043 and 2044, respectively. And, output element o49 of output data matrix 2064 is the sum of the dot products of weight set 2024 and the first block of activation elements within third 20 quadrants a1q3, a2q3, a3q3 and a4q3 of input data matrices 2041, 2042, 2043 and 2044, respectively. And so on for output elements o1w, o1n and o1i2, o2w, o2n and o2i2, o3w, o3n and o3i2, and o4w, o4n and o4i2 of the third rows of output data matrices 2061, 2062, 2063 and 2064. 13 02 24
[0065] With respect to quadrant oq4, output element 0½ of output data matrix 2061 is the sum of the dot products of weight set 2021 and the first block of activation elements within fourth quadrants a1q4, a2q4, a3q4 and a4q4 of input data matrices 2041, 2042, 2043 and 2044, respectively. Output element o2i3 of output data matrix 2062 is the 5 sum of the dot products of weight set 2022 and the first block of activation elements within fourth quadrants a1q4, a2q4, a3q4 and a4q4 of input data matrices 2041, 2042, 2043 and 2044, respectively. Output element 0¼ of output data matrix 2063 is the sum of the dot products of weight set 2023 and the first block of activation elements within fourth quadrants a1q4, a2q4, a3q4 and a4q4 of input data matrices 2041, 2042, 2043 and 2044, 10 respectively. And, output element o4i3 of output data matrix 2064 is the sum of the dot products of weight set 2024 and the first block of activation elements within third quadrants a1q4, a2q4, a3q4 and a4q4 of input data matrices 2041, 2042, 2043 and 2044, respectively. And so on for output elements o1i4, o1is and o1i6, o2i4, o2is and o2ie, o3i4, o3i5 and o3ie, and o4i4, o4is and 0% of the fourth rows of output data matrices 2061, 15 2062, 2063 and 2064
[0066] FIG. 3B depicts converted convolutional layer calculation 210 for a CNN, while FIG. 3C depicts converted input data matrix 214, in accordance with an embodiment of the present disclosure.
[0067] In one embodiment, the convolutional layer calculations for CNNs may be 20 converted into GEMM operations for processing by one or more MMAs. Convolution layer calculation 200 is converted into a GEMM operation by converting filters 202 into converted weight matrix 212, converting input feature maps 204 into converted input data matrix 214, and then multiplying converted weight matrix 212 and converted input 13 02 24 data matrix 214 to generate converted output data matrix 216. Because simple matrix multiplication is performed rather than a convolution operation, each output element within converted output data matrix 216 is the dot product of one row of converted weight matrix 212 and one column of converted input data matrix 214. Converted 5 output data matrix 216 is then reformed into output feature maps 206.
[0068] Converted weight matrix 212 is a 4x16 matrix, and includes converted weight sets 2121, 2122, 2123 and 2124 Weight set 2021 is flattened to form converted weight set 2121, i.e., the first row, and includes weights w1i, w12, w13, w14, w1s, w16, w17, w18, w19, w1w, w1n, w1i2, w1i3, w1i4, w1i5 and w1i6. Weight set 2022 is flattened to form 10 converted weight set 2122, i.e., the second row, and includes weights w2i, w22, w23, w24, w25, w26, w2?, w28, w29, w2w, w2h, w2i2, w2i3, w2i4, w2is and w2i6. Weight set 2023 is flattened to form converted weight set 2123, i.e., the third row, and includes weights w3i, w32, w33, w34, w35, w36, w3?, w38, w39, w3w, w3h, w3i2, w3i3, w3i4, w3is and w3i6. And, weight set 2024 is flattened to form converted weight set 2124, i.e., the fourth row, and 15 includes weights w4i, w42, w43, w\ w4s, w46, w47, w4s, w49, w4w, w4n, w4i2, w4n, w4u, w4i5 and w4w.
[0069] Converted input data matrix 214 is a 16x16 matrix, and includes the blocks of each quadrant of input data matrices 2041, 2042, 2043 and 2044, i.e., quadrants a1qi, a1q2, a1q3, a1q4, a2qi, a2q2, a2q3, a2q4, a3qi, a3q2, a3q3, a3q4, a4qi, a4q2, a4q3 20 and a4q4, respectively. Generally, each block is flattened to form a portion of a single column of converted input data matrix 214.
[0070] More particularly, the first column of converted input matrix 214 includes the first blocks from quadrants a1qi, a2qi, a3qi and a4qi, i.e., activations a1i, a12, a16, a17, 13 02 24 a2-,, a22, a26, a2?, a3-,, a32, a36, a3?, a4-,, a42, a4s, and a4?. The second column of converted input matrix 214 includes the second blocks from quadrants a1qi, a2qi, a3qi and a4qi, i.e., activations a12, a13, a1?, a1s, a22, a23, a2?, a2s, a32, a33, a3?, a3s, a42, a43, a4?, and a4s. The third column of converted input matrix 214 includes the third blocks from quadrants a1qi, 5 a2qi, a3qi and a4qi, i.e., activations a13, a14, a1s, a19, a23, a24, a2s, a29, a33, a34, a3s, a39, a43, a44, a48, and a4g. And, the fourth column of converted input matrix 214 includes the fourth blocks from quadrants a1qi, a2qi, a3qi and a4qi, i.e., activations a14, a1s, a19, a1w, a24, a25, a29, a2io, a34, a3s, a39, a3w, a44, a4s, a49, and a4w.
[0071] The remaining columns of converted input data matrix 214 are formed in 10 a similar manner. The fourth to the eighth columns are formed from the blocks of quadrants a1q2, a2q2, a3q2 and a4q2, the ninth to the twelfth columns are formed from the blocks of quadrants a1q3, a2q3, a3q3 and a4q3, and the thirteenth to the sixteenth columns are formed from the blocks of quadrants a1q4, a2q4, a3q4 and a4q4.
[0072] Converted output data matrix 216 is a 4x16 matrix, and includes flattened 15 versions of output data matrices 2061, 2062, 2063 and 2064, i.e., converted output data matrices 2161, 2162, 2163 and 2164 Converted output data matrix 216 may also be arranged into four quadrants oqi, oq2, oq3 and oq4, which include the same output elements as the four quadrants oqi, oq2, oq3 and oq4 of output feature maps 206.
[0073] The calculation of the output elements in the first row of quadrant oqi of 20 converted output data matrix 216 follows.
[0074] Output element o1i is the dot product of the first row of converted weight matrix 212, i.e., converted weight set 2121, and the first column of converted input data matrix 214. More particularly, output element o1i is equal to w1i • a1i + w12 • a12 + w13 • 13 02 24 a16 + w14 • a1? + w15 • a2i + w16 • a22 + w17 • a26 + w18 • a2? + w19 • a3i + w1w • a32 + w1n • a36 + w1i2 • a3? + w1i3 • a4i + w1i4 • a42 + w1is • a46 + w1i6 • a47. As shown above, output element o1i of converted output data matrix 216 is equal to output element o1i of output feature maps 206. 5
[0075] Output element o12 is the dot product of the first row of converted weight matrix 212, i.e., converted weight set 2121, and the second column of converted input data matrix 214. More particularly, output element o12 is equal to w1i • a12 + w12 • a13 + w13 • a17 + w14 • a18 + w15 • a22 + w16 • a23 + w17 • a27 + w18 • a28 + w19 • a32 + w1w • a33 + w1n • a37 + w1i2 • a38 + w1i3 • a42 + w1i4 • a43 + w1is • a47 + w1i6 • a4s. As shown above, 10 output element o12 of converted output data matrix 216 is equal to output element o12 of output feature maps 206.
[0076] Output element o13 is the dot product of the first row of converted weight matrix 212, i.e., converted weight set 2121, and the third column of converted input data matrix 214. More particularly, output element o13 is equal to w1i • a13 + w12 • a14 + w13 • 15 a18 + w14 • a19 + w15 • a23 + w16 • a24 + w17 • a2s + w18 • a29 + w19 • a33 + w1w • a34 + w1n • a38 + w1i2 • a39 + w1i3 • a43 + w1i4 • a44 + w1is • a4s + w1i6 • a4g. As shown above, output element o13 of converted output data matrix 216 is equal to output element o13 of output feature maps 206.
[0077] Output element o14 is the dot product of the first row of converted weight 20 matrix 212, i.e., converted weight set 2121, and the fourth column of converted input data matrix 214. More particularly, output element o14 is equal to w1i • a14 + w12 • a1s + w13 • a19 + w14 • a1w + w15 • a24 + w16 • a25 + w17 • a29 + w18 • a2w + w19 • a34 + w1io • a3s + w1n • a39 + w1i2 • a3w + w1i3 • a44 + w1i4 • a4s + w1is • a49 + w1i6 • a4w. As shown 13 02 24 above, output element o14 of converted output data matrix 216 is equal to output element o14 of output feature maps 206.
[0078] For the second row of quadrant oqi, output element o2i is the dot product of the second row of converted weight matrix 212, i.e., converted weight set 2122, and 5 the first column of converted input data matrix 214, output element o22 is the dot product of the second row of converted weight matrix 212, i.e., converted weight set2122, and the second column of converted input data matrix 214, output element o23 is the dot product of the second row of converted weight matrix 212, i.e., converted weight set 2122, and the third column of converted input data matrix 214, and output element o24 is 10 the dot product of the second row of converted weight matrix 212, i.e., converted weight set 2122, and the fourth column of converted input data matrix 214.
[0079] For the third row of quadrant oqi, output element o3i is the dot product of the third row of converted weight matrix 212, i.e., converted weight set 2123, and the first column of converted input data matrix 214, output element o32 is the dot product of 15 the third row of converted weight matrix 212, i.e., converted weight set 2123, and the second column of converted input data matrix 214, output element o33 is the dot product of the third row of converted weight matrix 212, i.e., converted weight set 2123, and the third column of converted input data matrix 214, and output element o34 is the dot product of the third row of converted weight matrix 212, i.e., converted weight set2123, 20 and the fourth column of converted input data matrix 214.
[0080] For the fourth row of quadrant oqi, output element o4i is the dot product of the fourth row of converted weight matrix 212, i.e., converted weight set 2124, and the first column of converted input data matrix 214, output element o42 is the dot product of 13 02 24 the fourth row of converted weight matrix 212, i.e., converted weight set 2124, and the second column of converted input data matrix 214, output element o43 is the dot product of the fourth row of converted weight matrix 212, i.e., converted weight set2124, and the third column of converted input data matrix 214, and output element o44 is the dot 5 product of the fourth row of converted weight matrix 212, i.e., converted weight set 2124, and the fourth column of converted input data matrix 214.
[0081] The elements of the quadrants oq2, oq3 and oq4 are calculated in a similar manner.
[0082] FIG. 4 depicts data flow diagram 220 for MAC array 218. 0
[0083] As noted above, GEMM operations may be implemented in one or more MMAs, which are dedicated ANN hardware accelerators that include one or more arrays of MAC units. In this embodiment, MAC array 218 is a systolic, output stationary array that implements converted convolution operation 210 using a 4x4 array of MAC units mi, m2, m3, m4, ms, me, m?, ms, mg, mio, mu, mi2, mi3, mu, mis and mie. The 15 orientation of transposed converted weight matrix 222, transposed converted input data matrix 224, and transposed converted output data matrix 226 relative to MAC array 218 simplifies illustration; other orientations are also contemplated.
[0084] Each MAC unit calculates a dot product, between a row of converted weight matrix 212 and a column of converted input data matrix 214, to generate an 20 element of converted output data matrix 216. Generally, a MAC unit includes, inter alia, a multiplier, an adder and a storage register. Each MAC unit is reset by clearing or zeroing its storage register prior to, or at the start of, a new dot product calculation. 13 02 24
[0085] Generally, the rows from converted weight matrix 212 are read from local memory, enter MAC array 218 at the first row of MAC units mi, m2, m3 and m4, and propagate one MAC unit down at the beginning of each processing cycle. Similarly, the columns from converted input data matrix 214 are read from local memory, enter MAC 5 array 218 at the first column of MAC units rm, ms, mg and m-13, and propagate one MAC unit to the right at the beginning of each processing cycle.
[0086] The dot product calculations performed by MAC unit rm for the blocks of the first quadrants a1qi, a2qi, a3qi and a4qi of converted input data matrix 214 are discussed in detail below, while the dot product calculations performed by the remaining 10 MAC units of MAC array 218 are summarized below.
[0087] MAC unit rm calculates the dot product of the first row of converted weight matrix 212 (i.e., converted weight set 2121) and the first column of converted input data matrix 214 to generate element o1i of converted output data matrix 216. During the processing cycle 1, MAC unit rm receives ai and w1i from local memory, 15 multiplies ai and w1i to generate an intermediate product, adds the intermediate product to the value stored in the storage register (i.e., 0), and stores the accumulated result back in the storage register. During processing cycle 2, MAC unit rm transmits ai to MAC unit m2 and w1i to MAC unit ms, receives 82 and w12 from local memory, multiplies 82 and w12 to generate an intermediate product, adds the intermediate product to the 20 value stored in the storage register, and stores the accumulated result back in the storage register.
[0088] During processing cycle 3, MAC unit rm transmits 82 to MAC unit m2 and w12 to MAC unit ms, receives as and w13 from local memory, multiplies as and w13 to 13 02 24 generate an intermediate product, adds the intermediate product to the value stored in the storage register, and stores the accumulated result back in the storage register. During processing cycle 4, MAC unit rm transmits ae to MAC unit m2 and w13 to MAC unit ms, receives a? and w14 from the local memory, multiplies a? and w14 to generate an 5 intermediate product, adds the intermediate product to the value stored in the storage register, and stores the accumulated result back in the storage register.
[0089] Processing cycles 5 through 16 multiply and accumulate the remaining 12 elements of the first row of converted weight matrix 212 and the first column of converted input data matrix 214. At the end of the processing cycle 16, MAC unit rm 10 outputs element o1i.
[0090] The remainder of the first row of MAC array 218 includes MAC units m2, m3 and nu
[0091] After an initial delay of one processing cycle, MAC unit m2 receives weights from the first delay register ffi and input data from MAC unit rm, transmits 15 weights to MAC unit me and input data to MAC unit m3, and calculates the dot product of the second row of converted weight matrix 212 (i.e., converted weight set 2122) and the first column of converted input data matrix 214 to generate element o2i of converted output data matrix 216. The initial delay of one processing cycle allows the delay pipeline (i.e., delay register ffi) to be filled with weights transferred from memory, and 20 the input data to become available from MAC unit rm. At the end of the processing cycle 17, MAC unit m2 outputs element o2i.
[0092] After an initial delay of two processing cycles, MAC unit m3 receives weights from the second delay register ff2 and input data from MAC unit m2, transmits 13 02 24 weights to MAC unit m? and input data to MAC unit nu, and calculates the dot product of the third row of converted weight matrix 212 (i.e., converted weight set 2123) and the first column of converted input data matrix 214 to generate element o3i of converted output data matrix 216. The initial delay of two processing cycles allows the delay 5 pipeline (i.e., delay registers ffi and ff2) to be filled with weights transferred from memory, and the input data to become available from MAC unit m2. At the end of processing cycle 18, MAC unit m3 outputs element o3i.
[0093] After an initial delay of three processing cycles, MAC unit m4 receives weights from the third delay register ffs and input data from MAC unit m3, transmits 10 weights to MAC unit ms, and calculates the dot product of the fourth row of converted weight matrix 212 (i.e., converted weight set 2124) and the first column of converted input data matrix 214 to generate element o4i of converted output data matrix 216. The initial delay of three processing cycles allows the delay pipeline (i.e., delay registers ffi, ff2 and ff3) to be filled with weights transferred from memory, and the input data to 15 become available from MAC unit m3. At the end of processing cycle 19, MAC unit nu outputs element o4i.
[0094] The second row of MAC array 218 includes MAC units ms, me, m? and ms.
[0095] After an initial delay of one processing cycle, MAC unit ms receives 20 weights from MAC unit rm and input data from a first delay register ffi, transmits weights to MAC unit mg and input data to MAC unit me, and calculates the dot product of the first row of converted weight matrix 212 (i.e., converted weight set 2121) and the second column of converted input data matrix 214 to generate element 0½ of converted output 13 02 24 data matrix 216. The initial delay of one processing cycle allows the delay pipeline (i.e., delay register ffi) to be filled with input data transferred from memory, and the weights to become available from MAC unit rm. At the end of processing cycle 17, MAC unit ms outputs element o12. 5
[0096] After an initial delay of two processing cycles, MAC unit me receives weights from MAC unit m2 and input data from MAC unit ms, transmits weights to MAC unit m-io and input data to MAC unit m?, and calculates the dot product of the second row of converted weight matrix 212 (i.e., converted weight set 2122) and the second column of converted input data matrix 214 to generate element o22 of converted output 10 data matrix 216. The initial delay of two processing cycles allows the weights to become available from MAC unit m2, and the input data to become available from MAC unit ms. At the end of processing cycle 18, MAC unit me outputs element o22.
[0097] After an initial delay of three processing cycles, MAC unit m? receives weights from MAC unit m3 and input data from MAC unit me, transmits weights to MAC 15 unit mu and input data to MAC unit ms, and calculates the dot product of the third row of converted weight matrix 212 (i.e., converted weight set 2123) and the second column of converted input data matrix 214 to generate element 0¾ of converted output data matrix 216. The initial delay of three processing cycles allows the weights to become available from MAC unit m3, and the input data to become available from MAC unit me. At the 20 end of processing cycle 19, MAC unit m? outputs element o32.
[0098] After an initial delay of four processing cycles, MAC unit ms receives weights from MAC unit mu and input data from MAC unit rm, transmits weights to MAC unit mi2, and calculates the dot product of the fourth row of converted weight matrix 212 13 02 24 (i.e., converted weight set 2124) and the second column of converted input data matrix 214 to generate element o42 of converted output data matrix 216. The initial delay of four processing cycles allows the weights to become available from MAC unit m4, and the input data to become available from MAC unit rm. At the end of processing cycle 5 20, MAC unit ms outputs element o42.
[0099] The third row of MAC array 218 includes MAC units mg, mw, mu and mi2.
[0100] After an initial delay of two processing cycles, MAC unit mg receives weights from MAC unit ms and input data from a second delay register ff2, transmits weights to MAC unit mis and input data to MAC unit mw, and calculates the dot product 10 of the first row of converted weight matrix 212 (i.e., converted weight set 2121) and the third column of converted input data matrix 214 to generate element o13 of converted output data matrix 216. The initial delay of two processing cycles allows the delay pipeline (i.e., delay registers ffi and ff2) to be filled with input data transferred from memory, and the weights to become available from MAC unit ms. At the end of 15 processing cycle 18, MAC unit mg outputs element o13.
[0101] After an initial delay of three processing cycles, MAC unit mw receives weights from MAC unit me and input data from MAC unit mg, transmits weights to MAC unit mi4 and input data to MAC unit mu, and calculates the dot product of the second row of converted weight matrix 212 (i.e., converted weight set 2122) and the third 20 column of converted input data matrix 214 to generate element 0¾ of converted output data matrix 216. The initial delay of three processing cycles allows the weights to become available from MAC unit me, and the input data to become available from MAC unit mg. At the end of processing cycle 19, MAC unit mw outputs element o23. 13 02 24
[0102] After an initial delay of four processing cycles, MAC unit mu receives weights from MAC unit m? and input data from MAC unit mw, transmits weights to MAC unit mw and input data to MAC unit mw, and calculates the dot product of the third row of converted weight matrix 212 (i.e., converted weight set 2123) and the third column of 5 converted input data matrix 214 to generate element o33 of converted output data matrix 216. The initial delay of four processing cycles allows the weights to become available from MAC unit m?, and the input data to become available from MAC unit mw. At the end of processing cycle 20, MAC unit mu outputs element o33.
[0103] After an initial delay of five processing cycles, MAC unit mw receives 10 weights from MAC unit ms and input data from MAC unit mu, transmits weights to MAC unit mw, and calculates the dot product of the fourth row of converted weight matrix 212 (i.e., converted weight set 2124) and the third column of converted input data matrix 214 to generate element o43 of converted output data matrix 216. The initial delay of five processing cycles allows the weights to become available from MAC unit ms, and the 15 input data to become available from MAC unit mu. At the end of processing cycle 21, MAC unit mw outputs element o43.
[0104] The fourth row of MAC array 218 includes MAC units mw, m-u, mw and mw.
[0105] After an initial delay of three processing cycles, MAC unit mw receives 20 weights from MAC unit mg and input data from a third delay register ffs, transmits input data to MAC unit mi4, and calculates the dot product of the first row of converted weight matrix 212 (i.e., converted weight set 2121) and the fourth column of converted input data matrix 214 to generate element o14 of converted output data matrix 216. The initial 13 02 24 delay of three processing cycles allows the delay pipeline (i.e., delay registers ff-i, ff2 and ff3) to be filled with input data transferred from memory, and the weights to become available from MAC unit mg. At the end of processing cycle 19, MAC unit m-i3 outputs element o14. 5
[0106] After an initial delay of four processing cycles, MAC unit m-u receives weights from MAC unit mw and input data from MAC unit m-i3, transmits input data to MAC unit mis, and calculates the dot product of the second row of converted weight matrix 212 (i.e., converted weight set 2122) and the fourth column of converted input data matrix 214 to generate element o24 of converted output data matrix 216. The initial 10 delay of four processing cycles allows the weights to become available from MAC unit m-io, and the input data to become available from MAC unit mi3. At the end of processing cycle 20, MAC unit mi4 outputs element o24.
[0107] After an initial delay of five processing cycles, MAC unit mis receives weights from MAC unit mu and input data from MAC unit m-u, transmits input data to 15 MAC unit m-ie, and calculates the dot product of the third row of converted weight matrix 212 (i.e., converted weight set 2123) and the fourth column of converted input data matrix 214 to generate element o34 of converted output data matrix 216. The initial delay of five processing cycles allows the weights to become available from MAC unit mu, and the input data to become available from MAC unit mi4. At the end of 20 processing cycle 21, MAC unit mis outputs element o34.
[0108] After an initial delay of six processing cycles, MAC unit m-ie receives weights from MAC unit m-i2 and input data from MAC unit mis, and calculates the dot product of the fourth row of converted weight matrix 212 (i.e., converted weight set 13 02 24 2124) and the fourth column of converted input data matrix 214 to generate element o44 of converted output data matrix 216. The initial delay of six processing cycles allows the weights to become available from MAC unit m-i2, and the input data to become available from MAC unit m-is. At the end of processing cycle 22, MAC unit m-i6 outputs 5 element o44.
[0109] After the blocks of the first quadrants a1qi, a2qi, a3qi and a4qi of converted input data matrix 214 have been processed, the next sequence of operations processes the blocks of the second quadrants a1q2, a2q2, a3q2 and a4q2. After the blocks of the second quadrants a1q2, a2q2, a3q2 and a4q2 have been processed, the next sequence of 10 operations processes the blocks of the third quadrants a1q3, a2q3, a3q3 and a4q3. And, after the blocks of the third quadrants a1q3, a2q3, a3q3 and a4q3 have been processed, the final sequence of operations processes the blocks of the fourth quadrants aiq4, a2q4, a3q4 and a4q4. Converted weight matrix 212 is accessed for each sequence of operations.
[0110] As noted above, many machine learning inference applications employ 15 quantized ANNs, such as quantized CNNs, that require high-throughput, low-precision matrix multiplication operations. A conventional ANN has fixed bit-width dot product datapaths, such as, for example, 8 bits, 16 bits, 32 bits, etc. MMAs that support conventional ANNs may be used to support quantized ANNs, and include one or more MAC unit arrays that multiply operands having corresponding fixed bit-widths, such as, 20 for example, 8 bits, 16 bits, 32 bits, etc.
[0111] A sparse, quantized neural network promotes zero values for weight and / or activation elements during neural network training. For example, the weights, {Wi} and activations {ai} are quantized into 8-bits: Wi, as e [-128, 127] (Eq. 1) 13 02 24 and then the pruning process generates as many possible zero values in {Wj} and { ai}. The activations are dynamically quantized and pruned during inference.
[0112] According to the conventional scheme, sparsity is determined at the 5 element (i.e., word) level for a quantized neural network model, i.e., an element has either a zero value or a non-zero value. Embodiments of the present disclosure, however, determine sparsity at the bit level for each element for a quantized neural network model, i.e., an element has a number of bits that are set to zero and a number of bits that are set to one. Generally, elements may have signed or unsigned values. A 10 signed value includes a signed portion (e.g., sign bit) and a magnitude portion (e.g., magnitude bits), and the bit-level sparsity is determined based on the magnitude portion of the signed value. For example, if two 8-bit weights wo and wi have the following values: wo =20= 0x14 = b0001 0100 15 Wi = 39 = 0x27 = b0010 0111 then weights wo and wi contain 6 nonzero bits, and their bit sparsity is (2*8 - 6) I (2*8) = 62.5%. A similar approach can be applied to calculate activation data sparsity as well.
[0113] Embodiments of the present disclosure quantize and prune a neural network to maximize bit sparsity. As noted above, one benefit of this optimization is to 20 reduce the power consumption through minimizing signal toggling in the data path during inference. In one embodiment, the neural network is quantized and pruned during training toward a minimal Hamming Norm, which is a metric that measures how 13 02 24 many bits are set (i.e., how many bits have a value of “1”) in the binary form of the weights and activations. Other metrics are also supported.
[0114] FIG. 5 depicts power consumption contour graph 300, in accordance with an embodiment of the present disclosure. 5
[0115] Power consumption contour graph 300 presents results from an activity-annotated extracted netlist simulation for an NPU that does not include optimizations for bit sparsity. The x-axis represents weight bit density (normalized to 1), the y-axis represents activation bit density (normalized to 1), and the NPU power consumption data values (normalized to 1) are displayed in a color-coded contour map. 0
[0116] For example, data point 301 has a weight bit density of 0.27, an activation bit density of 0.27 and an NPU power consumption value of 0.49, while data point 302 has a weight bit density of 0.14, an activation bit density of 0.14 and an NPU power consumption value of 0.38. The results clearly show that power consumption is significantly reduced as the weight and activation bit densities decrease, such as, for 15 example, from typical values of 27% (e.g., data point 301) to 14% (e.g., data point 302). In this example, the power consumption is reduced by 22% (i.e., 1 - 0.38 / 0.49 = 0.22), which demonstrates the impact of increasing bit sparsity even with an NPU that does not include optimizations for bit sparsity.
[0117] Embodiments of the present disclosure reduce bit densities by gradually 20 promoting zero-bits during neural network quantization aware training (QAT). In many embodiments, the weight bit density may be reduced during neural network QAT based on one or more pruning embodiments described below. 13 02 24
[0118] In certain embodiments, for each weight, each group of “N” consecutive bits that are set to one (“1”) are replaced by three zeros (“0”) and a single bit that is set to one at the next higher bit position. In one embodiment, N is greater than or equal to 3; other embodiments are also supported, such as N is greater than or equal to 2, N 5 is greater than or equal to 4, etc. For example, if two 8-bit weights W2 and W3 have the following values: W2 = 116 = 0x74 = b0111 0100 w3 = 29 = 0x1 D = b0001 1101 then weights W2 and W3 contain 8 nonzero bits, and their bit sparsity is (2*8 - 8) I (2*8) = 10 50%. The pruned values are: W2p = 132 = 0x84 = b1000 0100 w3p = 33 = 0x21 = b0010 0001 then weights W2P and W3P contain 4 nonzero bits, and their bit sparsity is (2*8 - 4) I (2*8) = 75%. 15
[0119] In certain embodiments, for each weight, the maximum number of bits set to one (“1”) is reduced to N. In one embodiment, N is equal to 2; other embodiments are also supported, such as N is equal to 1, N is equal to 3, etc. For example, if two 8-bit weights W2 and W3 have the following values: W2= 116 = 0x74 = b0111 0100 20 w3 — 29 = 0x1 D = b0001 1101 then weights W2 and W3 contain 8 nonzero bits, and their bit sparsity is (2*8 - 8) I (2*8) = 50%. The pruned values are: 13 02 24 W2P = 96 = 0x60 = b0110 0000 w3p = 24 = 0x18 = b0001 1000 then weights W2P and W3P contain 4 nonzero bits, and their bit sparsity is (2*8 - 4) I (2*8) = 75%. 5
[0120] When N is equal to 1, the first set bit (i.e., the first and most significant bit set to “1”) is simply determined. The pruned values for weights W2 and W3 are: w2p = 64 = 0x40 = b0100 0000 w3p= 16 = 0x10 = b0001 0000 and weights W2p and W3P contain 2 nonzero bits, and their bit sparsity is (2*8 - 2) I (2*8) = 10 87.5%.
[0121] In certain embodiments, the average number of bits set to one (“1”) in all the weights is N and is developed by gradually pruning the bits set to one (“1”) that are close to the least significant bit (LSB) in each weight during training. For example, certain weights may have N+1 bits set to one (“1”), other weights may have N-1 bits set 15 to one (“1”), etc. In one embodiment, N is equal to 2; other embodiments are also supported, such as N is equal to 1, N is equal to 3, etc.
[0122] Combinations of these embodiments are also supported, such as, for example, replacing consecutive set bits combined with reducing the number of set bits, etc. 20
[0123] In further embodiments of the present disclosure, weight and activation bit densities may be reduced during neural network QAT based on these pruning embodiments, and the activation bit density may be reduced during inference based on these pruning embodiments. In many embodiments, BPUs dynamically prune activation 38 13 02 24 data during inference; in other embodiments, activation data may be pruned by a local processor, etc.
[0124] For example, an MMA with one or more MAC arrays may include BPUs within each MAC array to prune activation data. In one embodiment, MAC array 218 5 may include a BPU to process the data from each column of converted input data matrix 214 before the activation data enters MAC array 218 at the first column of MAC units mi, ms, mg and m-i3. In other examples, an MMA may include BPUs within a neural network directly implemented or hard-wired into silicon; similarly, an MMA may include BPUs within a neural network directly implemented by one or more FPGAs. Further 10 examples include an NPU with one or more processing engines (PEs) may include BPUs within each PE to prune activation data, a GPU that is configured to execute an ANN may include BPUs, as needed, within each core or processing unit, etc.
[0125] FIG. 6 depicts BPU 400, in accordance with an embodiment of the present disclosure. 15
[0126] Generally, BPU 400 receives an input data value, determines the first (most significant) set bit therein, and outputs a mask value that preserves the first set bit (“1”) and sets the subsequent (less significant) set bits to zero (“0”). BPU 400 includes, inter alia, bitlines 410, 411, 412, 413, 414, 415, 416 and 417, and processing nodes 420, 421, 422, 423, 424, 425 and 426. 20
[0127] In this embodiment, BPU 400 receives an 8-bit input data value over eight bitlines, and outputs an 8-bit mask value over eight bitlines. Bits bo, bi, b2, bs, b4, bs, be, and b? of the input data value are input over bitlines 410, 411, 412, 413, 414, 415, 416 and 417, respectively, and bits Oo, 01, 02, 03, 04, 05, Oe and 07 of the mask 13 02 24 value are output over bitlines 410,411,412,413,414,415,416 and 417, respectively. Bits bo and Oo are the LSBs, while bits b? and 07 are the MSBs.
[0128] Processing node 426 is coupled to bitline 416, bitline 417 and processing node 425. Processing node 425 is coupled to bitline 415, processing node 426 and 5 processing node 424. Processing node 424 is coupled to bitline 414, processing node 425 and processing node 423. Processing node 423 is coupled to bitline 413, processing node 424 and processing node 422. Processing node 422 is coupled to bitline 412, processing node 423 and processing node 421. Processing node 421 is coupled to bitline 411, processing node 422 and processing node 420. Processing 10 node 420 is coupled to bitline 410 and processing node 421.
[0129] In order to generate a mask of the first set bit, processing begins with bit b7 (bitline 417) and flows down to each subsequent bitline.
[0130] For bitline 417, bit b7 is simply output as bit 07. When bit b7 is set to one (“1”), 07 is set to one (“1”) and the remaining bits 06, 05, 04, 03, 02, 01 and Oo are set to 15 zero (“0”) by processing nodes 420, 421, 422, 423, 424, 425 and 426. When bit b7 is set to zero (“0”), 07 is set to zero (“0”) and the remaining bits be, bs, b4, bs, b2, bi and bo are processed by processing nodes 420, 421, 422, 423, 424, 425 and 426 to determine the first set bit.
[0131] Generally, each processing node receives an input bit bi and an input 20 signal pi, and determines and outputs signal p0 and bit Oi, as depicted in FIG. 6. The input signal pi is received from a previous node (poi+1) or bitline (b7). Signal p0 is determined by Equation 2: 13 02 24 and the bit Oi is determined by Equation 3: Oi = ~pi & bi (Eq. 3) where the operator is the bitwise complement, the operator is the bitwise AND, 5 and the “|” is the bitwise OR.
[0132] For bitline 416, processing node 426 receives bit be from bitline 416 and bit b? from bitline 417, generates signal p06 using Equation 2 and bit oe using Equation 3, outputs bit Oe along bitline 416, and outputs signal p06 to processing node 425. 0
[0133] For bitline 415, processing node 425 receives bit bs from bitline 415 and signal p06 from processing node 426, generates signal p05 using Equation 2 and bit 05 using Equation 3, outputs bit 05 along bitline 415, and outputs signal p05 to processing node 424.
[0134] For bitline 414, processing node 424 receives bit b4from bitline 414 and 15 signal p05 from processing node 425, generates signal p04 using Equation 2 and bit 04 using Equation 3, outputs bit 04 along bitline 414, and outputs signal p04 to processing node 423.
[0135] For bitline 413, processing node 423 receives bit bs from bitline 413 and signal p04 from processing node 424, generates signal p03 using Equation 2 and bit 03 20 using Equation 3, outputs bit 03 along bitline 413, and outputs signal p03 to processing node 4220. 13 02 24
[0136] For bitline 412, processing node 422 receives bit b2 from bitline 412 and signal p03 from processing node 423, generates signal p02 using Equation 2 and bit 02 using Equation 3, outputs bit 02 along bitline 412, and outputs signal p02 to processing node 421. 5
[0137] For bitline 411, processing node 421 receives bit bi from bitline 411 and signal p02 from processing node 422, generates signal p01 using Equation 2 and bit 01 using Equation 3, outputs bit 01 along bitline 411, and outputs signal p01 to processing node 420.
[0138] For bitline 410, processing node 420 receives bit bo from bitline 410 and 10 signal p01 from processing node 421, generates bit 0O1 using Equation 3, and outputs bit Oo along bitline 410.
[0139] While BPU 400 processes an 8-bit data value, such as an 8-bit activation value, other size data values are also supported by simply adding or removing bitlines and nodes. 15
[0140] In other embodiments, the most significant N set bits may be determined by cascading BPUs 400 spatially, or by performing N iterations sequentially using a single BPU 400. For example, to determine the second set bit of the top N set bits, the mask value output by the first BPU 400 is converted to its complement value and then combined with the input data value, using a bitwise AND, to generate an intermediate 20 data value in which the first set bit has been changed to zero (“0”) and the subsequent bits have been preserved, i.e., either ones (‘Ts) or zeros (“0”s). 13 02 24
[0141] In certain embodiments, the intermediate data value is input to a second BPU 400, and the mask value output by the second BPU 400 identifies the second set bit (i.e., the second set bit is set to one and the remaining bits are set to zero). The mask value output by the second BPU 400 is then combined with the mask value output 5 by the first BPU 400, using a bitwise OR, to generate a final mask value that identifies the two most significant set bits (i.e., the first two set bits are set to one and the remaining bits are set to zero). And so on, if desired, for each additional set bit. In this manner, the most significant N set bits may be identified and retained during pruning, where N is 2, 3, 4, etc. 10
[0142] In other embodiments, the intermediate data value is input back to the first BPU 400 for a second iteration, and the mask value output by the first BPU 400 identifies the second set bit (i.e., the second set bit is set to one and the remaining bits are set to zero). The mask value output by the first BPU 400 after the second iteration is then combined with the mask value output by the first BPU 400 after the first iteration, 15 using a bitwise OR, to generate a final mask value that identifies the two most significant set bits (i.e., the first two set bits are set to one and the remaining bits are set to zero). And so on, if desired, for each additional set bit. In this manner, the most significant N set bits may be identified and retained during pruning, where N is 2, 3, 4, etc. 20
[0143] FIGS. 7 A to 7L depict the generation of the mask of the first set bit for different input data values, in accordance with an embodiment of the present disclosure.
[0144] FIG. 7A depicts the calculation of the mask (first set bit orfsb) value, i.e., b1000 0000, from the input data value, i.e., b1111 1111, using Equations 2 and 3. The 13 02 24 values of bi, pi, ~pi, p0 and Oi are depicted for each bit bi, and the input value for pi is indicated by an arrow for bits be, be, b4, be, b2, bi and bo.
[0145] FIG. 7B depicts the calculation of the mask (fsb) value, i.e., b0100 0000, from the input data value, i.e., b0111 1111, using Equations 2 and 3. FIG. 7C depicts 5 the calculation of the mask (fsb) value, i.e., b0010 0000, from the input data value, i.e., b0011 1111, using Equations 2 and 3. FIG. 7D depicts the calculation of the mask (fsb) value, i.e., b0001 0000, from the input data value, i.e., b0001 1111, using Equations 2 and 3. FIG. 7E depicts the calculation of the mask (fsb) value, i.e., bOOOO 1000, from the input data value, i.e., bOOOO 1111, using Equations 2 and 3. FIG. 7F depicts the 10 calculation of the mask (fsb) value, i.e., bOOOO 0100, from the input data value, i.e., bOOOO 0111, using Equations 2 and 3. FIG. 7G depicts the calculation of the mask (fsb) value, i.e., bOOOO 0010, from the input data value, i.e., bOOOO 0011, using Equations 2 and 3. FIG. 7H depicts the calculation of the mask (fsb) value, i.e., bOOOO 0001, from the input data value, i.e., bOOOO 0001, using Equations 2 and 3. FIG. 7I depicts the 15 calculation of the mask (fsb) value, i.e., bOOOO 0000, from the input data value, i.e., bOOOO 0000, using Equations 2 and 3 (for completeness).
[0146] FIG. 7J depicts the calculation of the mask (fsb) value, i.e., b1010 1010, from the input data value, i.e., b1000 0000, using Equations 2 and 3. FIG. 7K depicts the calculation of the mask (fsb) value, i.e., b0100 0000, from the input data value, i.e., 20 bO101 0101, using Equations 2 and 3. FIG. 7L depicts the calculation of the mask (fsb) value, i.e., b0010 0000, from the input data value, i.e., b0011 1100, using Equations 2 and 3. 13 02 24
[0147] FIG. 8 depicts BPU 402, in accordance with an embodiment of the present disclosure.
[0148] As described above, BPU 402 receives an input data value, determines the first (most significant) set bit therein, and outputs a mask value that preserves the 5 first set bit (“1”) and sets the subsequent (less significant) set bits to zero (“0”). BPU 400 includes, inter alia, bitlines 410, 411, 412, 413, 414, 415, 416 and 417, and processing nodes 4201, 4202, 4203, 4211, 4211, 4221, 4221, 423, 4241, 4241, 425 and 426.
[0149] In this embodiment, BPU 402 receives an 8-bit input data value over 10 eight bitlines, and outputs an 8-bit mask value over eight bitlines. Bits bo, bi, b2, bs, b4, bs, be, and b? of the input data value are input over bitlines 410, 411, 412, 413, 414, 415, 416 and 417, respectively, and bits Oo, o-i, 02, 03, 04, 05, Oe and 07 of the mask value are output over bitlines 410, 411, 412, 413, 414, 415, 416 and 417, respectively. Bits bo and Oo are the LSBs, while bits b7 and 07 are the MSBs. 15
[0150] Processing node 426 is coupled to bitline 416, bitline 417, processing node 425 and processing node 4242. Processing node 425 is coupled to bitline 415 and processing node 426. Processing node 4241 is coupled to bitline 414 and bitline 415. Processing node 4242 is coupled to bitline 414 and processing nodes 426, 423, 4222, 4212 and 4203. Processing node 423 is coupled to bitline 413 and processing node 20 4242. Processing node 4221 is coupled to bitline 412 and bitline 413. Processing node 4222 is coupled to bitline 412 and processing node 4242. Processing node 4211 is coupled to bitline 411 and processing node 4221. Processing node 4212 is coupled to bitline 411 and processing node 4242. Processing node 4201 is coupled to bitline 410 13 02 24 and bitline 411. Processing node 4202 is coupled to bitline 411 and processing node 4221. Processing node 4203 is coupled to bitline 410 and processing node 4242.
[0151] In order to generate a mask of the first set bit, processing begins with bit b? (bitline 417) and flows down to each subsequent bitline. 5
[0152] For bitline 417, bit b? is simply output as bit 07. When bit b7 is set to one (“1”), 07 is set to one (“1”) and the remaining bits 06, 05, 04, 03, 02, 01 and Oo are set to zero (“0”) by processing nodes 420, 421, 422, 423, 424, 425 and 426. When bit b7 is set to zero (“0”), 07 is set to zero (“0”) and the remaining bits be, bs, b4, bs, b2, bi and bo are processed by processing nodes 420, 421, 422, 423, 424, 425 and 426 to determine 10 the first set bit.
[0153] For bitline 416, processing node 426 receives bit be from bitline 416 and bit b7 from bitline 417, generates signal p06 using Equation 2 and bit oe using Equation 3, outputs bit Oe along bitline 416, and outputs signal p06 to processing nodes 425 and 4242. 15
[0154] For bitline 415, processing node 425 receives bit bsfrom bitline 415 and signal p06 from processing node 426, generates bit 05 using Equation 3, and outputs bit 05 along bitline 415.
[0155] For bitline 414, processing node 4241 receives bit b4 from bitline 414 and bit bs from bitline 415, generates bit 041 using Equation 3, and outputs bit 041 along 20 bitline 414' to processing node 4242. Processing node 4242 receives bit b4 from bitline 414 and bit 041 from processing node 4241, generates signal p04 using Equation 2 and bit 042 using Equation 3, combines bit 041 and bit 042 using a bitwise AND to generate bit 13 02 24 04, outputs bit 04 along bitline 414, and outputs signal p04 to processing nodes 423, 4222, 4212 and 4203
[0156] For bitline 413, processing node 423 receives bit bsfrom bitline 413 and signal p04 from processing node 4242, generates bit 03 using Equation 3, and outputs bit 5 03 along bitline 413.
[0157] For bitline 412, processing node 4221 receives bit b2 from bitline 412 and bit bs from bitline 413, generates signal p02 using Equation 2 and bit 021 using Equation 3, outputs signal p02 to processing nodes 4211 and 4202, and outputs bit 021 along bitline 412' to processing node 4222. Processing node 4222 receives bit b2 from 10 bitline 412 and bit 021 from processing node 4221, generates bit 022 using Equation 3, combines bit 021 and bit 022 using a bitwise AND to generate bit 02, outputs bit 02 along bitline 414.
[0158] For bitline 411, processing node 4211 receives bit bi from bitline 411 and signal p02 from processing node 4221, generates bit O11 using Equation 3, and outputs 15 bit O11 along bitline 411' to processing node 4212. Processing node 4212 receives bit bi from bitline 411 and bit O11 from processing node 4211, generates bit 012 using Equation 3, combines bit O11 and bit 012 using a bitwise AND to generate bit 01, outputs bit 01 along bitline 414.
[0159] For bitline 410, processing node 4201 receives bit bo from bitline 410 and 20 bit bi from bitline 411, generates bit Oo1 using Equation 3, and outputs bit Oo1 along bitline 410' to processing node 4203. Processing node 4202 receives bit bo from bitline 410 and signal p02 from processing node 4221, generates bit Oo2 using Equation 3, and outputs bit Oo2 along bitline 410j to processing node 4203. Processing node 4203 13 02 24 receives bit bo from bitline 410, bit Oo1 from processing node 4201 and bit Oo2 from processing node 4202, generates bit Oo3 using Equation 3, combines bit Oo1, bit o-i2 and bit Oo3 using a bitwise AND to generate bit Oo, outputs bit Oo along bitline 410.
[0160] While BPU 402 processes an 8-bit data value, such as an 8-bit activation 5 value, other size data values are also supported by simply adding or removing bitlines and nodes.
[0161] FIGS. 9A to 9L depict the generation of the mask of the first set bit for different input data values, in accordance with an embodiment of the present disclosure.
[0162] FIG. 9A depicts the calculation of the mask (first set bit orfsb) value, i.e., 0 b1000 0000, from the input data value, i.e., b1111 1111, using Equations 2 and 3. The values of bi, pi, ~pi, p0, Oij and Oi are depicted for each bit bi, and the input value for pi is indicated by an arrow for bits be, bs, b41 (processing node 4241), b42 (processing node 4242), be, b21 (processing node 4221), b22 (processing node 4222), b-i1 (processing node 4211), bi2 (processing node 4212), bo1 (processing node 4201), bo2 (processing node 15 4202) and bo3 (processing node 4203).
[0163] FIG. 9B depicts the calculation of the mask (fsb) value, i.e., b0100 0000, from the input data value, i.e., bO111 1111, using Equations 2 and 3. FIG. 9C depicts the calculation of the mask (fsb) value, i.e., b0010 0000, from the input data value, i.e., b0011 1111, using Equations 2 and 3. FIG. 9D depicts the calculation of the mask (fsb) 20 value, i.e., b0001 0000, from the input data value, i.e., b0001 1111, using Equations 2 and 3. FIG. 9E depicts the calculation of the mask (fsb) value, i.e., bOOOO 1000, from the input data value, i.e., bOOOO 1111, using Equations 2 and 3. FIG. 9F depicts the calculation of the mask (fsb) value, i.e., bOOOO 0100, from the input data value, i.e., 13 02 24 bOOOO 0111, using Equations 2 and 3. FIG. 9G depicts the calculation of the mask (fsb) value, i.e., bOOOO 0010, from the input data value, i.e., bOOOO 0011, using Equations 2 and 3. FIG. 9H depicts the calculation of the mask (fsb) value, i.e., bOOOO 0001, from the input data value, i.e., bOOOO 0001, using Equations 2 and 3. FIG. 9I depicts the 5 calculation of the mask (fsb) value, i.e., bOOOO 0000, from the input data value, i.e., bOOOO 0000, using Equations 2 and 3 (for completeness).
[0164] FIG. 9J depicts the calculation of the mask (fsb) value, i.e., b1010 1010, from the input data value, i.e., b1000 0000, using Equations 2 and 3. FIG. 9K depicts the calculation of the mask (fsb) value, i.e., b0100 0000, from the input data value, i.e., 10 bO101 0101, using Equations 2 and 3. FIG. 9L depicts the calculation of the mask (fsb) value, i.e., b0010 0000, from the input data value, i.e., b0011 1100, using Equations 2 and 3.
[0165] As seen by inspection, BPUs 400 and 402 produce the same mask values for each input data value. 15
[0166] For small-scale neural networks directly implemented or hard-wired into silicon, a field-programmable gate array (FPGA), etc., such as, for example, tinyML applications, etc., embodiments of the present disclosure advantageously reduce silicon area and power consumption in proportion to bit density. This is possible because any bit positions with zero bits in a given weight does not require any computations at all, 20 and, therefore, physical hardware is not needed, implemented or programmed.
[0167] FIG. 10 depicts a block diagram of system 700, in accordance with an embodiment of the present disclosure. 13 02 24
[0168] System 700 executes, inter alia, the trained neural network during inference. In some embodiments, system 700 may also train the neural network; in other embodiments, one or more higher-performance computers train the neural network, such as a computer with multiple, multi-core CPUs, one or more NPUs and / or 5 GPUs, etc.
[0169] Computer 702 includes bus 710 coupled to one or more processors 720, memory 730, I / O interfaces 740, display interface 750, and one or more communication interfaces 760. In many embodiments, computer 702 also includes one or more special processors, such as, for example, MMAs 770, NPUs 772, GPUs 774, etc. Generally, 10 I / O interfaces 740 are coupled to I / O devices 742 using a wired or wireless connection, display interface 750 is coupled to display 752, and communication interface 760 is connected to network 762 using a wired or wireless connection.
[0170] Bus 710 is a communication system that transfers data between processor 720, memory 730, I / O interfaces 740, display interface 750, communication 15 interface 760, MMA 770, NPU 772 and GPU 774, as well as other components not depicted in FIG. 10. Power connector 712 is coupled to bus 710 and a power supply (not shown).
[0171] Processor 720 includes one or more general-purpose or applicationspecific microprocessors that executes instructions to perform control, computation, 20 input / output, etc. functions for computer 702. Processor 720 may include a single integrated circuit, such as a micro-processing device, or multiple integrated circuit devices and / or circuit boards working in cooperation to accomplish the functions of processor 720. In addition, processor 720 may execute computer programs or 13 02 24 modules, such as operating system 732, software modules 734, etc., stored within memory 730. For example, software modules 734 may include an machine learning application, an ANN application, a CNN application, etc.
[0172] Generally, storage element or memory 730 stores instructions for 5 execution by processor 720 and data. Memory 730 may include a variety of non-transitory computer-readable medium that may be accessed by processor 720. In various embodiments, memory 730 may include volatile and nonvolatile medium, nonremovable medium and / or removable medium. For example, memory 730 may include any combination of random access memory (RAM), dynamic RAM (DRAM), static RAM 10 (SRAM), read only memory (ROM), flash memory, cache memory, and / or any other type of non-transitory computer-readable medium.
[0173] Memory 730 contains various components for retrieving, presenting, modifying, and storing data. For example, memory 730 stores software modules that provide functionality when executed by processor 720. The software modules include 15 operating system 732 that provides operating system functionality for computer 702. Software modules 734 provide various functionality, such as image classification using convolutional neural networks, etc. Data 736 may include data associated with operating system 732, software modules 734, etc.
[0174] I / O interfaces 740 are configured to transmit and / or receive data from 20 I / O devices 742. I / O interfaces 740 enable connectivity between processor 720 and I / O devices 742 by encoding data to be sent from processor 720 to I / O devices 742, and decoding data received from I / O devices 742 for processor 720. Generally, data may be sent over wired and / or wireless connections. For example, I / O interfaces 740 may 13 02 24 include one or more wired communications interfaces, such as USB, Ethernet, etc., and / or one or more wireless communications interfaces, coupled to one or more antennas, such as WiFi, Bluetooth, cellular, etc.
[0175] Generally, I / O devices 742 provide input to computer 702 and / or output 5 from computer 702. As discussed above, I / O devices 742 are operably connected to computer 702 using a wired and / or wireless connection. I / O devices 742 may include a local processor coupled to a communication interface that is configured to communicate with computer 702 using the wired and / or wireless connection. For example, I / O devices 742 may include a keyboard, mouse, touch pad, joystick, etc. 10
[0176] Display interface 750 is configured to transmit image data from computer 702 to monitor or display 752.
[0177] Communication interface 760 is configured to transmit data to and from network 762 using one or more wired and / or wireless connections. Network 762 may include one or more local area networks, wide area networks, the Internet, etc., which 15 may execute various network protocols, such as, for example, wired and / or wireless Ethernet, Bluetooth, etc. Network 762 may also include various combinations of wired and / or wireless physical layers, such as, for example, copper wire or coaxial cable networks, fiber optic networks, Bluetooth wireless networks, WiFi wireless networks, CDMA, FDMA and TDMA cellular wireless networks, etc. 20
[0178] MMA 770 is configured to multiply matrices and generate output matrices to support various applications implemented by software modules 734, such as, for example, machine learning applications, artificial neural network applications, etc. Similarly, NPU 772 and GPU 774 are generally configured, inter alia, to execute at least 13 02 24 a portion of an artificial neural network to support various applications implemented by software modules 734.
[0179] As described above, weight data are quantized and bit-pruned during neural network training and the resulting weights are used during inference. In many 5 embodiments, activation data are also quantized and bit-pruned during neural network training, and then dynamically quantized and bit-pruned during inference.
[0180] During inference, input data are provided to the trained neural network, which generates at least one prediction. In many embodiments, the input data is sensor data, and the prediction(s) are provided as input data to an autonomous or semi- 10 autonomous process, such as, for example, a navigation and control process for a vehicle, airplane, ship, etc., a traffic prediction and control process, a robotic surgical process, an image recognition process, a speech recognition process, a language translation process, etc. The sensor data are environmental or other data collected by sensors or subsystems coupled to the inference computer, or provided to the inference 15 computer through one or more communication channels. The sensor data may include, for example, camera image data, microphone audio data, accelerometer data, micro-electromechanical system (MEMS) sensor data, light detection and ranging (LIDAR) data, global positioning system (GPS) data, robot element (i.e., arm, joint, finger, etc.) position, velocity and acceleration data, etc. 20
[0181] The embodiments described herein are combinable.
[0182] In one embodiment, a method includes training a neural network, based on training data, to generate a trained neural network, the neural network including weights, the training including quantizing the weights to generate quantized weights, 13 02 24 each quantized weight including a number of bits set to 1, and pruning, based on the number of bits set to 1, the quantized weights to generate bit-pruned weights, each bit pruned weight including a smaller number of bits set to 1 than the respective quantized weight, where the trained neural network includes the bit-pruned weights. 5
[0183] In another embodiment of the method, the method further includes executing the trained neural network, based on input data, to generate at least one prediction.
[0184] In another embodiment of the method, pruning the quantized weights includes for each quantized weight: replacing each sequence of N consecutive bits set 10 to 1 with a sequence of N consecutive bits set to zero, and setting the bit in the next highest bit position relative to each sequence of N consecutive bits to 1; and N is greater than 1.
[0185] In another embodiment of the method, pruning the quantized weights includes, for each quantized weight, reducing the number of bits set to 1 to N; and N is 15 greater than 0.
[0186] In another embodiment of the method, pruning the quantized weights includes: determining an average number of the bits set to 1 in the quantized weights, and reducing the number of the bits set to 1 in each quantized weight to reduce an average number of bits set to 1 to N; and N is greater than zero. 20
[0187] In another embodiment of the method, training the neural network and executing the trained neural network include: quantizing activations to generate quantized activations, each quantized activation including a number of bits set to 1; and 13 02 24 pruning, based on the number of bits set to 1, the quantized activations to generate bit-pruned activations, each bit pruned activation including a smaller number of bits set to 1 than the respective quantized activation.
[0188] In another embodiment of the method, pruning the quantized activations 5 includes for each quantized activation: replacing each sequence of N consecutive bits set to 1 with a sequence of N consecutive bits set to zero, and setting the bit in the next highest bit position relative to each sequence of N consecutive bits to 1; and N is greater than 1.
[0189] In another embodiment of the method, pruning the quantized activations 10 includes, for each quantized activation, reducing the number of bits set to 1 to N; and N is greater than 0.
[0190] In another embodiment of the method, pruning the quantized activations includes: determining an average number of the bits set to 1 in the quantized activation, and reducing the number of the bits set to 1 in each quantized activation to reduce an 15 average number of bits set to 1 to N; and N is greater than zero.
[0191] In another embodiment of the method, the input data is sensor data, and the method further comprises executing an autonomous or semi-autonomous process based, at least in part, on the prediction.
[0192] In one embodiment, a system includes processing circuitry configured to: 20 execute, based on input data, a neural network to generate at least one prediction, the neural network including bit-pruned weights, said execute including: quantize activations to generate quantized activations, each quantized activation including a number of bits 13 02 24 set to 1, and prune, based on the number of bits set to 1, the quantized activations to generate bit-pruned activations, each bit-pruned activation including a smaller number of bits set to 1 than the respective quantized activation.
[0193] In another embodiment of the system, the processing circuitry includes a 5 plurality of bit-pruning units (BPUs), and each BPU is configured to prune a quantized activation.
[0194] In another embodiment of the system, prune the quantized activations includes for each quantized activation: replace each sequence of N consecutive bits set to 1 with a sequence of N consecutive bits set to zero, and set the bit in the next highest 10 bit position relative to each sequence of N consecutive bits to 1; and N is greater than 1.
[0195] In another embodiment of the system, prune the quantized activations includes, for each quantized activation, reduce the number of bits set to 1 to N; and N is greater than 0.
[0196] In another embodiment of the system, prune the quantized activations 15 includes: determine an average number of the bits set to 1 in the quantized activation, and reduce the number of the bits set to 1 in each quantized activation to reduce an average number of bits set to 1 to N; and N is greater than zero.
[0197] In another embodiment of the system, the system further includes at least one sensor, coupled to the processing circuitry, configured to generate and transmit 20 sensor data to the processing circuitry, and the processing circuitry is further configured to execute an autonomous or semi-autonomous process based, at least in part, on the prediction. 13 02 24
[0198] Disclosed herein is a bit-pruning unit (BPU) that includes a plurality of bitlines, including a most significant bitline and a number of less significant bitlines, each bitline configured to receive a different bit of an input data value; and a plurality of processing nodes, at least one processing node coupled to each less significant bitline, 5 each processing node configured to: receive a first input bit from the respective less significant bitline, receive a second input bit from a more significant bitline or a processing node coupled to a more significant bitline, and generate, based on the first and second input bits, an output bit, where the output bits from the processing nodes form a mask value that identifies a first set bit of the input data value. 10
[0199] One or more processing nodes of the BPU are configured to: generate, based on the first and second input bits, the second input bit for one or more processing nodes coupled to less significant bitlines.
[0200] Each less significant bitline of the BPU is coupled to one processing node; the second input of a first processing node is coupled to the most significant 15 bitline; and the second input of each remaining processing node is coupled to the processing node coupled to an immediately more significant bitline. [0201 ] A first portion of the less significant bitlines of the BPU are coupled to a single processing node; a second portion of the less significant bitlines are coupled to two processing nodes; and a third portion of the less significant bitlines are coupled to 20 three processing nodes.
[0202] The BPU is one of a cascade of N BPUs that are configured to identify the N most significant set bits of the input data value. 13 02 24
[0203] A first intermediate input data value has the first set bit of the input data value set to zero; each bitline is configured to receive a different bit of the first intermediate input data value; and the output bits from the processing nodes form an intermediate mask value that identifies a second set bit of the input data value. 5
[0204] N-1 intermediate mask values identify N-1 significant set bits of the input data value based on N-1 intermediate input data values; and the mask value and the N-1 intermediate mask values are combined to form a final mask value that identifies the N most significant set bits of the input data value.
[0205] While implementations of the disclosure are susceptible to embodiment in 10 many different forms, there is shown in the drawings and will herein be described in detail specific embodiments, with the understanding that the present disclosure is to be considered as an example of the principles of the disclosure and not intended to limit the disclosure to the specific embodiments shown and described. In the description above, like reference numerals may be used to describe the same, similar or 15 corresponding parts in the several views of the drawings.
[0206] In this document, relational terms such as first and second, top and bottom, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. The terms “comprises,” “comprising,” “includes,” 20 “including,” “has,” “having,” or any other variations thereof, are intended to cover a nonexclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. An 13 02 24 element preceded by “comprises ...a” does not, without more constraints, preclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0207] Reference throughout this document to “one embodiment,” “certain 5 embodiments,” “an embodiment,” “implementation(s),” “aspect(s),” or similar terms means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present disclosure. Thus, the appearances of such phrases or in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular 10 features, structures, or characteristics may be combined in any suitable manner in one or more embodiments without limitation.
[0208] The term “or” as used herein is to be interpreted as an inclusive or meaning any one or any combination. Therefore, “A, B or C” means “any of the following: A; B; C; A and B; A and C; B and C; A, B and C.” An exception to this 15 definition will occur only when a combination of elements, functions, steps or acts are in some way inherently mutually exclusive. Also, grammatical conjunctions are intended to express any and all disjunctive and conjunctive combinations of conjoined clauses, sentences, words, and the like, unless otherwise stated or clear from the context. Thus, the term “or” should generally be understood to mean “and / or” and so forth. References 20 to items in the singular should be understood to include items in the plural, and vice versa, unless explicitly stated otherwise or clear from the text.
[0209] Recitation of ranges of values herein are not intended to be limiting, referring instead individually to any and all values falling within the range, unless 13 02 24 otherwise indicated, and each separate value within such a range is incorporated into the specification as if it were individually recited herein. The words “about,” “approximately,” or the like, when accompanying a numerical value, are to be construed as indicating a deviation as would be appreciated by one of ordinary skill in the art to 5 operate satisfactorily for an intended purpose. Ranges of values and / or numeric values are provided herein as examples only, and do not constitute a limitation on the scope of the described embodiments. The use of any and all examples, or exemplary language (“e.g.,” “such as,” “for example,” or the like) provided herein, is intended merely to better illuminate the embodiments and does not pose a limitation on the scope of the 10 embodiments. No language in the specification should be construed as indicating any unclaimed element as essential to the practice of the embodiments.
[0210] For simplicity and clarity of illustration, reference numerals may be repeated among the figures to indicate corresponding or analogous elements. Numerous details are set forth to provide an understanding of the embodiments 15 described herein. The embodiments may be practiced without these details. In other instances, well-known methods, procedures, and components have not been described in detail to avoid obscuring the embodiments described. The description is not to be considered as limited to the scope of the embodiments described herein.
[0211] In the following description, it is understood that terms such as “first,” 20 “second,” “top,” “bottom,” “up,” “down,” “above,” “below,” and the like, are words of convenience and are not to be construed as limiting terms. Also, the terms apparatus, device, system, etc. may be used interchangeably in this text.
[0212] The many features and advantages of the disclosure are apparent from the detailed specification, and, thus, it is intended by the appended claims to cover all such features and advantages of the disclosure which fall within the scope of the disclosure. Further, since numerous modifications and variations will readily occur to 5 those skilled in the art, it is not desired to limit the disclosure to the exact construction and operation illustrated and described, and, accordingly, all suitable modifications and equivalents may be resorted to that fall within the scope of the disclosure. 13 02 24
Claims
13 02 241. A method, comprising:training a neural network, based on training data, to generate a trained neural network, the neural network including weights, the training including:5 quantizing the weights to generate quantized weights, each quantizedweight including a number of bits set to 1, andpruning, based on the number of bits set to 1, the quantized weights to generate bit-pruned weights, each bit-pruned weight including a smaller number of bits set to 1 than the respective quantized weight,10 where the trained neural network includes the bit-pruned weights.
2. The method according to claim 1, where:said pruning the quantized weights includes for each quantized weight:replacing each sequence of N consecutive bits set to 1 with a sequence of N consecutive bits set to zero, and15 setting the bit in the next highest bit position relative to each sequence ofN consecutive bits to 1; andN is greater than 1.
3. The method according to claim 1, where:said pruning the quantized weights includes, for each quantized weight, reducing20 the number of bits set to 1 to N; andN is greater than 0.
4. The method according to claim 1, where: said pruning the quantized weights includes:13 02 24determining an average number of the bits set to 1 in the quantizedweights, and5 reducing the number of the bits set to 1 in each quantized weight toreduce an average number of bits set to 1 to N; andN is greater than zero.
5. The method according to claim 1, where said training the neural network includes:10 quantizing activations to generate quantized activations, each quantizedactivation including a number of bits set to 1; andpruning, based on the number of bits set to 1, the quantized activations to generate bit-pruned activations, each bit-pruned activation including a smaller number of bits set to 1 than the respective quantized activation.15 6. The method according to claim 5, where:said pruning the quantized activations includes for each quantized activation:replacing each sequence of N consecutive bits set to 1 with a sequence ofN consecutive bits set to zero, andsetting the bit in the next highest bit position relative to each sequence of20 N consecutive bits to 1; andN is greater than 1.
7. The method according to claim 5, where:said pruning the quantized activations includes, for each quantized activation,13 02 24reducing the number of bits set to 1 to N; andN is greater than 0.5 8. The method according to claim 5, where:said pruning the quantized activations includes:determining an average number of the bits set to 1 in the quantized activation, andreducing the number of the bits set to 1 in each quantized activation to10 reduce an average number of bits set to 1 to N; andN is greater than zero.
9. The method according to claim 1, further comprising:executing the trained neural network, based on input data from one or moresensors, to generate at least one prediction, including:15 quantizing activations to generate quantized activations, each quantizedactivation including a number of bits set to 1, andpruning, based on the number of bits set to 1, the quantized activations to generate bit-pruned activations, each bit pruned activation including a smaller number of bits set to 1 than the respective quantized activation; and20 executing an autonomous or semi-autonomous process based, at least in part,on the prediction.
10. A system, comprising:processing circuitry configured to:13 02 24execute, based on input data, a neural network to generate at least one prediction, the neural network including bit-pruned weights, said execute5 including:quantize activations to generate quantized activations, eachquantized activation including a number of bits set to 1, andprune, based on the number of bits set to 1, the quantized activations to generate bit-pruned activations, each bit-pruned10 activation including a smaller number of bits set to 1 than therespective quantized activation.
11. The system according to claim 10, where the processing circuitry includes a plurality of bit-pruning units (BPUs), and each BPU is configured to prune a quantized activation.15 12. The system according to claim 11, where:said prune the quantized activations includes for each quantized activation:replace each sequence of N consecutive bits set to 1 with a sequence ofN consecutive bits set to zero, andset the bit in the next highest bit position relative to each sequence of N 20 consecutive bits to 1; andN is greater than 1.13 02 2413. The system according to claim 11, where:said prune the quantized activations includes, for each quantized activation, reduce the number of bits set to 1 to N; andN is greater than 0.5 14. The system according to claim 11, where:said prune the quantized activations includes:determine an average number of the bits set to 1 in the quantizedactivation, andreduce the number of the bits set to 1 in each quantized activation to10 reduce an average number of bits set to 1 to N; andN is greater than zero.
15. The system according to claim 10, further comprising:at least one sensor, coupled to the processing circuitry, configured to generate and transmit sensor data to the processing circuitry,15 where the processing circuitry is further configured to execute an autonomous orsemi-autonomous process based, at least in part, on the prediction.
Citation Information
Patent Citations
Neural network model compression method and device
CN111582471A
Neural network regularization bit serial calculation compression method and device
CN113902109A
