Memory for Artificial Neural Network Accelerator
A compute-in-memory (CIM) array module and a method for performing dynamic saturation detection for a CIM array are provided. The CIM array module includes a CIM array, saturation detection units (SDUs) and a controller. The CIM array includes selectable row signal lines, column signal lines and cells. Each cell is located at an intersection of a selectable row signal line and a column signal line, and each cell has a programmable conductance. The SDUs are selectively coupled to at least one column signal line, and each SDU is configured to, for each column signal line, generate an analog signal, and identify the column signal line as a saturated column signal line when a voltage of the analog signal is greater than a saturation threshold voltage, or a current of the analog signal is greater than a saturation threshold current.
Latest Arm Limited Patents:
- TECHNIQUE FOR HANDLING SEALED CAPABILITIES
- Metal routing techniques
- Tininess detection
- Multi-bitcell structure with shared read port
- Apparatus and methods for setting indicator data to indicate whether a group of contiguously addressed information entries in a selected address information table provides a base address indicating a location within a contiguously address region comprising multiple address information tables at a later table level
The present disclosure relates to computer systems. More particularly, the present disclosure relates to computer systems including artificial neural networks (ANNs).
ANNs, such as deep neural networks (DNNs), convolutional neural networks (CNNs), etc., are a popular solution to a wide array of challenging classification, recognition and regression problems. However, many ANNs require a large number of calculations involving a large number of filter weights and activations, which presents a significant challenge with respect to access, storage and performance, particularly for mobile and other power or storage-constrained devices. An ANN hardware accelerator accelerates these calculations, such as, for example, general matrix multiplication (GEMM) operations performed by DNNs, convolution operations performed by CNNs, etc.
CNNs typically do not perform native convolution operations due to the complicated dataflow and expensive datapaths that are required. Instead, native convolution operations are converted into GEMM operations, which are then executed more efficiently by a central processing unit (CPU), a specialized processor, an ANN accelerator that includes systolic, digital multiply-and-accumulate (MAC) arrays or analog arrays, etc. An analog accelerator may include one or more compute-in-memory (CIM) array modules that perform GEMM operations, such as, for example, MAC operations. Each CIM array module includes an analog array and signal processing circuitry that includes digital-to-analog converters (DACs), sample-and-hold (S/H) circuits, analog-to-digital converters (ADCs), etc. A CIM array module may be based on volatile or non-volatile memory (NVM), such as, for example, an NVM crossbar array.
Generally, matrices may be classified as either sparse or dense. Most elements of a sparse matrix have a value of zero, while most elements of a dense matrix have a non-zero value. For the simple matrix multiplication operation C=A·B, when matrix A or matrix B is sparse, most of the matrix calculations will include a value of zero for at least one of the operands, which always results in a product that has a value of zero. When both matrix A and matrix B are sparse, an even greater number of matrix calculations will include a value of zero for at least one of the operands.
Two of the biggest hardware costs for an analog accelerator, in terms of power and area, are the S/H circuit capacitors and the ADCs. Because the size of the capacitors and the resolution of the ADCs are selected to multiply dense matrices, an analog accelerator multiplies sparse matrices very inefficiently due to the large number of operands that have a value of zero. In other words, the size of the capacitors within the S/H circuits is larger, and the resolution of the ADCs is higher, than are needed to multiply sparse matrices.
Embodiments of the present disclosure will now be described with reference to the drawing figures, in which like reference numerals refer to like parts throughout.
Embodiments of the present disclosure provide a CIM array module that advantageously provides iso-accuracy performance using saturation detection units (SDUs) with significantly smaller capacitors than S/H circuit capacitors, and ADCs with significantly smaller resolution.
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 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.
In a fully-connected, feedforward ANN, each node is connected to all of 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 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 weights to the hidden layer nodes, and then through respective connection weights to the output layer nodes.
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 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. 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.
A multi-layer perceptron (MLP) is an ANN that has an input layer, an output layer and one or more hidden layers. MLPs may be used for natural 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.
A CNN is a variation of an MLP that may be used for classification or 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 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 example, 2×2 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 SoftMax function. The output layer follows the last fully-connected layer; in certain embodiments, the output layer may include the normalization function.
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. 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 layer 40 includes “k” nodes, hidden layer 50 includes “m” nodes, and output layer 60 includes “o” nodes. Many variations of input, hidden and output layers are clearly possible, including hidden layers that are locally-connected, rather than fully-connected, to one another.
Training an ANN includes optimizing the connection weights between 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 the connection weights, and then adjusts the connection weights to improve the performance of the network.
Input layer 20 includes one or more input nodes 21, etc., that present the input data, such as a color image, as an input volume to the first convolutional layer, e.g., convolutional layer 30-1. The input volume is a three-dimensional matrix that has a width, a height and a depth. For example, input data that represent a color image may be presented as an input volume that is 512pixels×512pixels×3 channels (red, green, blue); other input volume dimensions may also be used, such as 32×32×3, 64×64×3, 128×128×3, etc., 32×32×1, 64×64×1, 128×128×1, 512×512×1, etc.
Convolutional layer 30-1 is locally-connected to input layer 20, 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 volume to generate one element of an output volume. An activation function and a bias may be applied to each element of the output volume, and the output volume is then provided as the input volume to the next layer. The activation function and bias may be applied by each convolutional layer node or by the nodes of a subsequent locally-connected layer, such as an ReLU layer.
Pooling layer 30-2 is locally-connected to convolutional layer 30-1, and includes a plurality of nodes that are connected to local regions in the input volume (not depicted for clarity). Pooling layer 30-2 also produces an output volume that is provided as the input volume to the subsequent layer, such as, for example, another convolutional layer 30-1, a flatten layer 40, etc. In certain embodiments, convolutional layer 30-1 and pooling layer 30-2 form a single hidden layer 30. Similarly, in certain embodiments, convolutional layer 30-1, a ReLU layer and pooling layer 30-2 form a single hidden layer 30. Generally, the output volumes of the convolutional and pooling layers may be described as output feature maps, and one or more single hidden layers 30 form a feature learning portion of CNN 15.
Hidden layer 40 is a “flatten” layer that is locally-connected to pooling layer 30-2, and includes one or more hidden (flatten) nodes 41, 42, 43, 44, 45, etc. Hidden (flatten) layer 40 “flattens” the output volume produced by the preceding pooling layer 30-2 into a column vector, which is provided to the subsequent, fully-connected hidden layer 50.
Hidden layer 50 is a classification layer that is fully-connected to hidden (flatten) layer 40, and includes one or more hidden (classification) nodes 51, 52, 53, 54, 55, etc.
Output layer 60 includes one or more output nodes 61, 62, etc., and is fully-connected to hidden (classification) layer 50. Fully-connected output layer 60 receives the classification results output by hidden (classification) layer 50, 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 60, or, alternatively, by an additional layer interposed between hidden (classification) layer 50 and output layer 60.
Similar to ANNs, training a CNN includes optimizing the connection weights between nodes by minimizing the prediction error of the output data until the 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, MAC operations, are used extensively by CNNs, as well as other ANNs.
A convolutional layer generally includes M filters, C input channels, C input feature maps (i.e., one input feature map for each input channel) and M output feature maps (i.e., one output feature map for each filter). Each filter has C weight sets (i.e., each filter has a weight set for each input channel), and is convolved across the input feature maps to produce an output feature map corresponding to that filter. Convolutional layers generally require the movement of large amounts of data, generate a significant computational load, and require buffers of considerable size to store intermediate values.
In this embodiment, convolutional layer 30-1 includes four weight matrices or filters 202, i.e., filter 2021, 2022, 2023 and 2024, one input channel, one input feature map 204 and four output feature maps 206, i.e., 2061, 2062, 2063 and 2064. Each filter 202 is convolved across input feature map 204 to produce an output feature map 206 corresponding to that filter, i.e., output feature map 2061 corresponds to filter 2021, output feature map 2062 corresponds to filter 2022, output feature map 2063 corresponds to filter 2023, and output feature map 2064 corresponds to filter 2024. For illustration purposes, each filter 2021, 2022, 2023 and 2024 is a 2×2×1 weight matrix, input feature map 204 is a 5×5×1 input data matrix, and each output feature map 2061, 2062, 2063 and 2064 is a 4×4 output data matrix. In this embodiment, with a stride of 1and no padding, the total number of MAC operations performed by convolution layer operation 200 is (2×2×1)×(4×4)×4 or 256.
For ease of discussion, input feature map 204 may be divided into four overlapping portions or quadrants. The first quadrant (i.e., aq1) includes the first and second rows, i.e., a1, a2, a3, a4, a5 and a6, a7, a8, a9, a10, the second quadrant includes the second and third rows, i.e., a6, a7, a8, a9, a10 and a11, a12, a13, a14, a15, the third quadrant includes the third and fourth rows, i.e., a11, a12, a13, a14, a15 and a16, a17, a18, a19, a20, and the fourth quadrant includes the fourth and fifth rows, i.e., a16, a17, a18, a19, a20 and a21, a22, a23, a24, a25.
Similarly, output feature maps 206 may be divided into four, three dimensional portions or quadrants. The first quadrant (i.e., oq1) includes the first row of each output feature map 2061, 2062, 2063 and 2064, i.e., o11, o12, o13, o14, o21, o22, o23, o24, o31, o32, o33, o34, o41, o42, o43 and o44. The second quadrant (not shown for clarity) includes the second row of each output feature map 2061, 2062, 2063 and 2064, i.e., o15, o16, o17, o18, o25, o26, o27, o28, o35, o36, o37, o38, o45, o46, o47 and o48. The third quadrant (not shown for clarity) includes the third row of each output feature map 2061, 2062, 2063 and 2064, i.e., o19, o110, o111, o112, o29, o210, o211, o212, o39, o310, o311, o312, o49, o410, o411, and o412. The fourth quadrant (not shown for clarity) includes the fourth row of each output feature map 2061, 2062, 2063 and 2064, i.e., o113, o114, o115, o116, o213, o214, o215, o216, o313, o314, o315, o316, o413, o414, o415, and o416. All of the elements from quadrants oq1, oq2, oq3and oq4 are depicted in
The convolution operations performed on the first quadrant (i.e., aq1) of input feature map 204 are now discussed in detail.
For output feature map 2061, element o11 is the dot product of filter 2021 and the first block (i.e., a1, a2, a6 and a7) of the first quadrant aq1of input feature map 204, element o12 is the dot product of filter 2021 and the second block (i.e., a2, a3, a7and a8) of the first quadrant aq1of input feature map 204, element o13 is the dot product of filter 2021 and the third block (i.e., a3, a4, a8 and a9) of the first quadrant aq1of input feature map 204, and o14 is the dot product of filter 2021 and the fourth block (i.e., a4, a5, a9and a10) of the first quadrant aq1of input feature map 204.
More particularly, the dot product of filter 2021 and the first block of the first quadrant aq1 is equal to w11·a1+w12·a2+w13·a6+w14·a7 (i.e., o11). The dot product of filter 2021 and the second block of the first quadrant aq1 is equal to w11·a2+w12·a3+w13·a7+w 14·a8 (i.e., o12). The dot product of filter 2021 and the third block of the first quadrant aq1 is equal to w11·a3+w12·a4+w13·a8+w14·a9 (i.e., o13). The dot product of filter 2021 and the fourth block of the first quadrant aq1 is equal to w11·a4+w12a5+w13·a9+w14 ·a10 (i.e., o14).
For output feature map 2062, element o21 is the dot product of filter 2022 and the first block (i.e., a1, a2, a6 and a7) of the first quadrant aq1 of input feature map 204, output feature map element o22 is the dot product of filter 2022 and the second block (i.e., a2, a3, a7 and a8) of the first quadrant aq1 of input feature map 204, output feature map element o23 is the dot product of filter 2022 and the third block (i.e., a3, a4, a8 and a9) of the first quadrant aq1 of input feature map 204, and output feature map element o24 is the dot product of filter 2022 and the fourth block (i.e., a4, a5, a9 and a10) of the first quadrant aq1 of input feature map 204.
More particularly, the dot product of filter 2022 and the first block of the first quadrant aq1 is equal to w21·a1+w22·a2+w23·a6+w24·a7 (i.e., o21). The dot product of filter 2022 and the second block of the first quadrant aq1 is equal to w21·a2+w22·a3+w23·a7+w24·a8 (i.e., o22). The dot product of filter 2022 and the third block of the first quadrant aq1 is equal to w21·a3+w22·a4+w23·a8+w24·a9 (i.e., o23). The dot product of filter 2022 and the fourth block of the first quadrant aq1 is equal to w21·a4+w22·a5+w23·a9+w24·a10 (i.e., o24).
For output feature map 2063, element o31 is the dot product of filter 2023 and the first block (i.e., a1, a2, a6 and a7) of the first quadrant aq1 of input feature map 204, output feature map element o32 is the dot product of filter 2023 and the second block (i.e., a2, a3, a7 and a8) of the first quadrant aq1 of input feature map 204, output feature map element o33 is the dot product of filter 2023 and the third block (i.e., a3, a4, a8 and a9) of the first quadrant aq1 of input feature map 204, and output feature map element o34 is the dot product of filter 2023 and the fourth block (i.e., a4, a5, a9 and a10) of the first quadrant aq1 of input feature map 204.
More particularly, the dot product of filter 2023 and the first block of the first quadrant aq1 is equal to w31·a1+w32·a2+w33·a6+w34·a7 (i.e., o31). The dot product of filter 2023 and the second block of the first quadrant aq1 is equal to w31·a2+w32·a3+w33·a7+w34·a8 (i.e., o32). The dot product of filter 2023 and the third block of the first quadrant aq1 is equal to w31·a3+w32·a4+w33·a8+w34·a9 (i.e., o33). The dot product of filter 2023 and the fourth block of the first quadrant aq1 is equal to w31·a4+w32·a5+w33·a9+w34·a10 (i.e., o34).
For output feature map 2064, element o41 is the dot product of filter 2024 and the first block (i.e., a1, a2, a6 and a7) of the first quadrant aq1 of input feature map 204, output feature map element o42 is the dot product of filter 2024 and the second block (i.e., a2, a3, a7 and a8) of the first quadrant aq1 of input feature map 204, output feature map element o43 is the dot product of filter 2024 and the third block (i.e., a3, a4, a8 and a9) of the first quadrant aq1 of input feature map 204, and output feature map element o44 is the dot product of filter 2024 and the fourth block (i.e., a4, a5, a9 and a10) of the first quadrant aq1 of input feature map 204.
More particularly, the dot product of filter 2024 and the first block of the first quadrant aq1 is equal to w41·a1+w42·a2+w43·a6+w44·a7 (i.e., o41). The dot product of filter 2024 and the second block of the first quadrant aq1 is equal to w41·a2+w42·a3+w43·a7+w44·a8 (i.e., o42). The dot product of filter 2024 and the third block of the first quadrant aq1 is equal to w41·a3+w42·a4+w43·a8+w44·a9 (i.e., o43). The dot product of filter 2024 and the fourth block of the first quadrant aq1 is equal to w41·a4+w42·a5+w43·a9+w44·a10 (i.e., o44).
The convolution operations performed on the remaining three quadrants of input feature map 204 are done in the same manner. The second quadrant of input feature map 204 also includes four blocks, i.e., the first block of includes a6, a7, a11 and a12, the second block includes a7, a8, a12 and a13, the third block includes a8, a9, a13 and a14, and the fourth block includes a9, a10, a14 and a15. The third quadrant of input feature map 204 also includes four blocks, i.e., the first block of includes a11, a12, a16 and a17, the second block includes a12, a13, a17 and a18, the third block includes a13, a14, a18 and a19, and the fourth block includes aid, a15, a19 and a20. The fourth quadrant of input feature map 204 also includes four blocks, i.e., the first block of includes a16, a17, a21and a22, the second block includes a17, a18, a22 and a23, the third block includes a18, a19, a23 and a24, and the fourth block includes a19, a20, a24 and a25.
For the second quadrant of output feature map 2061, element o15 is the dot product of filter 2021 and the first block of the second quadrant of input feature map 204, element o16 is the dot product of filter 2021 and the second block of the second quadrant of input feature map 204, element o17 is the dot product of filter 2021 and the third block of the second quadrant of input feature map 204, and element o18 is the dot product of filter 2021 and the fourth block of the second quadrant of input feature map 204. For the second quadrant of output feature map 2062, elements o25, o26, o27, and o28 are calculated in the same manner using filter 2022. For the second quadrant of output feature map 2063, elements o35, o36, o37, and o38 are calculated in the same manner using filter 2023. For the second quadrant of output feature map 2064, elements o45 , o46, o47, and o48 are calculated in the same manner using filter 2024.
For the third quadrant of output feature map 2061, element o19 is the dot product of filter 2021 and the first block of the third quadrant of input feature map 204, element o110 is the dot product of filter 2021 and the second block of the third quadrant of input feature map 204, element o111 is the dot product of filter 2021 and the third block of the third quadrant of input feature map 204, and element o112 is the dot product of filter 2021 and the fourth block of the third quadrant of input feature map 204. For the third quadrant of output feature map 2062, elements o29, o210, o211, and o212 are calculated in the same manner using filter 2022. For the third quadrant of output feature map 2063, elements o39, o310, 0311, and o312 are calculated in the same manner using filter 2023. For the third quadrant of output feature map 2064, elements o49, o410, o411, and o412 are calculated in the same manner using filter 2024.
For the fourth quadrant of output feature map 2061, element o113 is the dot product of filter 2021 and the first block of the fourth quadrant of input feature map 204, element o114 is the dot product of filter 2021 and the second block of the fourth quadrant of input feature map 204, element o115 is the dot product of filter 2021 and the third block of the fourth quadrant of input feature map 204, and element o116 is the dot product of filter 2021 and the fourth block of the fourth quadrant of input feature map 204. For the fourth quadrant of output feature map 2062, elements o213, o214, o215, and o216 are calculated in the same manner using filter 2022. For the fourth quadrant of output feature map 2063, elements o313, o314, o315, and o316 are calculated in the same manner using filter 2023. For the fourth quadrant of output feature map 2064, elements o413, o414, o415, and o416 are calculated in the same manner using filter 2024.
An activation function and a bias may be applied to each element of output feature maps 206, which are then provided as the input feature maps 204 to the next layer. An activation function and bias may be applied after each element of output feature maps 206 is calculated, after all of the elements of output feature maps 206 are calculated, or by a subsequent locally-connected layer, such as an ReLU layer.
Similar to the fully-connected layer calculations for ANNs, convolution operations may be recast as generic matrix multiplication (GEMM) operations, and implemented in an ANN hardware accelerator using one or more arrays of MAC units, an analog accelerator with one or more CIM array modules, etc. The filter weights and activations (i.e., input feature maps or IFMs) for the convolution operation are converted into an expanded format (e.g., IM2COL format), and then processed as GEMM operations by the ANN hardware accelerator to generate output feature maps (OFMs).
In this embodiment, convolution layer operation 200 has been converted into a simple matrix multiplication operation by converting filter 202 into converted weight matrix 212, converting input feature map 204 into converted input data matrix 214, and converting output feature maps 206 into converted output data matrix 216. Converted weight matrix 212 (4×4) and converted input data matrix 214 (4×16) are multiplied to generate converted output data matrix 216 (4×16), which includes output data sets 2161, 2162, 2163 and 2164 (each 1×16). Output data sets 2161, 2162, 2163 and 2164 are then reformed into output feature maps 2061, 2062, 2063 and 2064 (each 4×4), respectively.
Converted weight matrix 212 includes converted weight sets 2121, 2122, 2123 and 2124. Converted weight set 2121 includes the elements of filter 2021, i.e., w11, w12, w13 and w14 arranged in a single (first) row. Converted weight set 2122 includes the elements of filter 2022, i.e., w21, w22, w23 and w24 flattened into a single (second) row. Converted weight set 2123 includes the elements of filter 2023, i.e., w31, w32, w33 and w34flattened into a single (third) row. Converted weight set 2124 includes the elements of filter 2024, i.e., w41, w42, w43 and w44 flattened into a single (fourth) row.
Converted input data matrix 214 includes the elements of input feature map 204 recast as a larger matrix that implements the convolution operation as a simple matrix multiplication operation. Due to the mechanics of the convolution operation (discussed above), certain elements of input feature map 204 are duplicated once, twice or three times to generate converted output data matrix 216. Generally, each row of converted weight matrix 212 is a filter, each column of converted input data matrix 214 is a block of input data upon which each filter operates, and each dot product calculation, i.e., the multiplication of each row by each column, generates a different element of converted output data matrix 216.
For ease of discussion, converted input data matrix 214 may be divided into four portions or quadrants, i.e., aq1, aq2, aq3 and aq4, and converted output data matrix 216 may be divided into four portions or quadrants, i.e., oq1, oq2, oq3 and oq4.
The first quadrant aq1 of converted input data matrix 214 includes the four blocks of the first quadrant of input feature map 204, each block arranged as a column.
Similarly, the second quadrant aq2 of converted input data matrix 214 includes the four blocks of the second quadrant of input feature map 204, each block arranged as a column. The third quadrant aq3 of converted input data matrix 214 includes the four blocks of the third quadrant of input feature map 204, each block arranged as a column. And, the fourth quadrant aq4 of converted input data matrix 214 includes the four blocks of the fourth quadrant of input feature map 204, each block arranged as a column.
More particularly, the first column of the first quadrant aqi of converted input data matrix 214 includes elements a1, a2, a6 and a7, which are the same elements in the same sequence (i.e., row-major order) as the first block of the first quadrant of input feature map 204. The second column of the first quadrant aq1 of converted input data matrix 214 includes elements a2, a3, a7 and a8, which are the same elements in the same sequence (i.e., row-major order) as the second block of the first quadrant of input feature map 204. The third column of the first quadrant aq1 of converted input data matrix 214 includes elements a3, a4, a8 and a9, which are the same elements in the same sequence (i.e., row-major order) as the third block of the first quadrant of input feature map 204. The fourth column of the first quadrant aq1 of converted input data matrix 214 includes elements a4, a5, a9 and a10, which are the same elements in the same sequence (i.e., row-major order) as the fourth block of the first quadrant of input feature map 204. And so on for quadrants aq2, aq3 and aq4 of converted input data matrix 214.
The first row of the first quadrant oq1 of converted output data matrix 216 includes elements o11, o12, o13 and o14, which are the same elements in the same sequence as the first row of the first quadrant of output feature map 2061. The second row of the first quadrant oq1 of converted output data matrix 216 includes elements 021, o22, o23 and o24, which are the same elements in the same sequence as the first row of the first quadrant of output feature map 2062. The third row of the first quadrant oq1 of converted output data matrix 216 includes elements o31, o32, o33 and o34, which are the same elements in the same sequence as the first row of the first quadrant of output feature map 2063. The fourth row of the first quadrant oq1 of converted output data matrix 216 includes elements o41, o42, o43 and o44, which are the same elements in the same sequence as the first row of the first quadrant of output feature map 2064. And so on for quadrants oq2 , oq3 and oq4 of converted output data matrix 216.
To generate the first quadrant oq1 of converted output data matrix 216, converted weight matrix 212 and the first quadrant aq1 of converted input data matrix 214 are multiplied together. For the first row of the first quadrant oq1, element o11 is the dot product of the first row of converted weight matrix 212 and the first column of converted input data matrix 214, i.e., o11 is equal to w11·a1+w12·a2+w13·a6+w14·a7. Element o12 is the dot product of the first row of converted weight matrix 212 and the second column of converted input data matrix 214, i.e., o12 is equal to w11·a2+w12·a3+w13·a7+w14·a8. Element o13 is the dot product of the first row of converted weight matrix 212 and the third column of converted input data matrix 214, i.e., o13 is equal to w11·a3+w12·a4+w13·a8+w14·a9. Element o14 is the dot product of the first row of converted weight matrix 212 and the fourth column of converted input data matrix 214, i.e., o14 is equal to w11·a4+w12·a5+w13·a5+w14a10. The elements of the second, third and fourth rows the first quadrant oq1 of converted output data matrix 216, i.e., elements o21, o22, o23, o24, o31, o32, o33, o34. o41, o42, o43 and o44, are calculated in the same manner using the second, third and fourth rows of converted weight matrix 212, respectively.
To generate the second quadrant oq2 of converted output data matrix 216, converted weight matrix 212 and the second quadrant aq2 of converted input data matrix 214 are multiplied together. For the first row of the second quadrant oq2, element o15 is the dot product of the first row of converted weight matrix 212 and the fifth column of converted input data matrix 214, i.e., o15 is equal to w11·a6+w12·a7+w13·a11+w14·a12. Element o16 is the dot product of the first row of converted weight matrix 212 and the sixth column of converted input data matrix 214, i.e., o16 is equal to w11·a7+w12·a8+w13·a9+w14·a13. Element o17 is the dot product of the first row of converted weight matrix 212 and the seventh column of converted input data matrix 214, i.e., 017 is equal to w11·a8+w12·a9+w13·a13+w14·a14. Element o18 is the dot product of the first row of converted weight matrix 212 and the eighth column of converted input data matrix 214, i.e., o18 is equal to w11·a9+w12a12+w13·a14+w14·a15. The elements of the second, third and fourth rows the second quadrant oq2 of converted output data matrix 216, i.e., elements o25, o26, o27, o28, o35. o36, o37, o38, o45, o46, o47 and o48, are calculated in the same manner using the second, third and fourth rows of converted weight matrix 212, respectively.
To generate the third quadrant oq3 of converted output data matrix 216, converted weight matrix 212 and the third quadrant aq3of converted input data matrix 214 are multiplied together. For the first row of the third quadrant oq3, element o19 is the dot product of the first row of converted weight matrix 212 and the ninth column of converted input data matrix 214, i.e., o19 is equal to w11·a11+w12·a12+w13·a16+w14·a17. Element o110 is the dot product of the first row of converted weight matrix 212 and the 10th column of converted input data matrix 214, i.e., o110 is equal to w11·a12+w12·a13+w13·a17+w14·a8. Element o111 is the dot product of the first row of converted weight matrix 212 and the 11th column of converted input data matrix 214, i.e., o111 is equal to w11·a13+w12·a14+w13·a18+w14·a19. Element o112 is the dot product of the first row of converted weight matrix 212 and the 12th column of converted input data matrix 214, i.e., 0112 is equal to w11·a14+w12·a15+w13·a19+w14·a20. The elements of the second, third and fourth rows the third quadrant oq3 of converted output data matrix 216, i.e., elements o29, o210, o211, o212, o39, o310, o311, o312, o49, o410, o411 and o412, are calculated in the same manner using the second, third and fourth rows of converted weight matrix 212, respectively.
To generate the fourth quadrant oq4 of converted output data matrix 216, converted weight matrix 212 and the fourth quadrant aq4 of converted input data matrix 214 are multiplied together. For the first row of the fourth quadrant oq4, element o113 is the dot product of the first row of converted weight matrix 212, and the 13thcolumn of converted input data matrix 214, i.e., o113 is equal to w11·a16+w12·a17+w13·a21+w14·a22. Element o114 is the dot product of the first row of converted weight matrix 212 and the 14th column of converted input data matrix 214, i.e., o114 is equal to w11·a17+w1 2·a18+w13·a22+w14·a23. Element o115 is the dot product of the first row of converted weight matrix 212 and the 15th column of converted input data matrix 214, i.e., o115 is equal to w11·a18+w12·a19+w13·a23+w14·a24. Element o116 is the dot product of the first row of converted weight matrix 212 and the 16th column of converted input data matrix 214, i.e., o116 is equal to w11·a19+w12·a20+w13·a24+w14·a25.
The elements of the second, third and fourth rows the fourth quadrant oq4 of converted output data matrix 216, i.e., elements o213, o214, o215, o216, o313, o314, o315, o316, o413, o414 , o415 and o416, are calculated in the same manner using the second, third and fourth rows of converted weight matrix 212, respectively.
In another embodiment, converted weight matrix 212 and converted input data matrix 214 may be transposed and the order of multiplication reversed to generate the transpose of converted output data matrix 216, in accordance with the matrix properties of A·B=C and (A·B)T=BT·AT=CT.
GEMM operations may be implemented in an analog accelerator that includes one or more CIM array modules 300. Each CIM array module 300 includes signal processing circuitry and CIM array 320 that performs analog MAC operations. In this example, converted convolution operation 210 may be implemented by CIM array module 300.
The signal processing circuitry for CIM array module 300 includes, inter alia, DACs 310 (i.e., DAC1, DAC2, DAC3 and DAC4), S/H circuits 330 (i.e., S/H1, S/H2, S/H3 and S/H4), and ADCs 340 (i.e., ADC1, ADC2, ADC3 and ADC4). CIM array 320 includes four bit lines (BLs) or column signal lines 322, i.e., column signal lines 3221, 3222, 3223 and 3224, four word lines (WLs) or row signal lines 324, i.e., row signal lines 3241, 3242, 3243 and 3244, and sixteen cells 326, one disposed at each intersection of column signal lines 322 and row signal lines 324. DACs 310 are coupled to row signal lines 324, S/H circuits 330 are coupled to column signal lines 322, and ADCs 340 are coupled to S/H circuits 330 via sampled signal lines 332 (i.e., sampled signal lines 3321, 3322, 3323 and 3324).
Each cell 326 includes a programmable volatile or non-volatile element, such as, for example, random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), phase change memory (PCM), resistive random access memory (RRAM), magnetic RAM (MRAM), correlated electron RAM (CeRAM), etc. CIM array 320 leverages a combination of Ohm's law and Kirchhoff's current law to implement analog MAC operations in parallel. According to Ohm's law, the application of a voltage across cell 326 generates a current that is proportional to the voltage across cell 326 divided by the programmed resistance of cell 326. Since conductance (in siemens) is the reciprocal of resistance (in ohms), the application of a voltage across cell generates a current that is proportional to the product of the conductance of the cell 326 and the voltage across cell 326. According to Kirchhoff's current law, currents from cells 326 in the same column of CIM array 320 combine to generate an accumulated current (i.e., the sum of the products generated by cells 326 in that column, ii). Thus, CIM array 320 implements analog MAC operations in parallel through the combination of Ohm's law and Kirchhoff's current law, and, in this example, each column of cells 326 calculates a dot product, between a row of converted weight matrix 212 and a column of converted input data matrix 214, to generate an element of converted output data matrix 216.
In many embodiments, the programmable element within each cell 326 includes a resistive switching element that has a low-resistance state (LRS), e.g., Ron, and a high-resistance state (HRS), e.g., Roff. Due to the wide separation between the
LRS and the HRS, each cell may be programmed to encode a discrete, linearly-separated conductance value. Weights w11, w12, w13, w14, w21, w22,w23, w24, w31, w32, w33, w34, w41, w42, w43and w44 are converted to conductances g11, g12, g13, g14, g21, g22, g23, g24, g31, g32, g33, g34, g41, g42, g43 and g44, respectively, an cells 326 are programmed with these conductance values.
The calculation of the elements of the first column of converted output data matrix 216, i.e., elements o11, o21, o31 and o41, are discussed in detail below. The remaining columns of converted output data matrix 216 are calculated in the same manner.
Element o11 is the dot product of the first row of converted weight matrix 212 and the first column of converted input data matrix 214, i.e., o11 is equal to w11·a1+w12·a2+w13·a6 l +w14·a7, which is equivalent to g11·v1+g12·v2+g13·v3+g14·v4. Element o21 is the dot product of the second row of converted weight matrix 212 and the first column of converted input data matrix 214, i.e., o21 is equal to w21·a1+w22·a2+w23·a6+w24·a7, which is equivalent to g21·v1+g22·v2+g23·v3+g24·v4. Element o31 is the dot product of the third row of converted weight matrix 212 and the first column of converted input data matrix 214, i.e., o31 is equal to w31·a1+w32·a2+w33·a6+w34·a7, which is equivalent to g31·v1+g32·v2+g33·v3+g34·v4. Element o41 is the dot product of the fourth row of converted weight matrix 212 and the first column of converted input data matrix 214, i.e., o41 is equal to w41·a1+w42·a2+w43·a6+w44·a7, which is equivalent to g41·v1+g4 2·v2+g43·v3+g44·v4.
During the first processing cycle, the elements of the first column of converted input data matrix 214, i.e., activations a1, a2, a6 and a7, are input to DACs 310, converted into analog signals (i.e., voltage levels), and the respective voltages v1, v2, v3 and v4 are applied along row signal lines 324. BL signal currents i1, i2, i3 and i4, are generated in column signal lines 3221, 3222, 3223 and 3224, respectively, based on the voltages of each row signal line 324 and the conductances of each respective cell 326. BL signals BL1, BL2, BL3, and BL4 are sampled by S/H circuits 3301, 3302, 3303 and 3304, output over sampled signal lines 3321, 3322, 3323 and 3324, and then digitized by ADCs 3401, 3402, 3403 and 3404 to generate the elements of the first column of converted output data matrix 216.
An activation function and a bias may be applied to each element of the converted output data matrix to generate the elements of output feature maps 206, which are then provided as input feature maps 204 to the next layer. The activation function and bias may be applied after each element of the converted output data matrix is calculated, after all of the elements of the converted output data matrix are calculated, or by a subsequent locally-connected layer, such as an ReLU layer.
As discussed above, activations are input to DACs 310, converted into analog signals (i.e., voltage levels), and the respective voltages are applied along row signal lines 324. In many embodiments, each activation is a digital amplitude value that is converted by DAC 310 into an analog voltage that has a corresponding amplitude value. In these embodiments, DACs 310 are integrated circuits (ICs), such as, for example, metal oxide semiconductor (MOS) mixed-signal ICs that include both analog and digital circuits. In other embodiments, each activation is a digital value that represents the duty cycle, D, of a pulse width modulated (PWM) signal that has a period, T. In these embodiments, DACs 310 include an electronic component that generates a PWM signal, such as a microcontroller, field programmable gate array (FPGA), complex programmable logic device (CPLD), etc., and a low pass, RC filter. The duty cycle value of the PWM signal is converted by DAC 310 into an analog voltage that has a corresponding amplitude value.
As discussed above, one of the biggest hardware costs for an analog accelerator is the capacitor used within each S/H circuit 330, which must be sized to discharge the maximum current, imax, that may be generated on each column signal line 322. Generally, the maximum value for a dot product calculation is produced when each weight has a maximum value, wmax, and each activation has a maximum value, amax. Accordingly, max is generated when each cell 326 on a column signal line 322 is programmed to a maximum conductance value, gmax, that is proportional to a maximum weight value, wmax, and the respective DAC 310 outputs a maximum voltage value, vmax, that is proportional to a maximum activation value, amax. In other words, if gmax Vmaxgenerates the maximum current for a single cell 236, icell, then imax may be expressed as n ·icell, where n is the number of cells 326 that are on the column signal line 322.
The speed or rate at which the capacitor within the S/H circuit 330 is discharged is directly related to the amount of current generated by the dot product calculation for a column signal line 322, i.e., the higher the current generated by the dot product calculation the faster the capacitor discharges. Generally, the size of the capacitor may be given by Equation 1:
C ∝imax*tdischarge=n*icell*tdischarge Eq. 1
where C is the capacitance of the capacitor, and tdischarge is the capacitor discharge time.
In addition to properly sizing the capacitor in each S/H circuit 330, each ADC 340 must have a resolution, in bits, that accommodates the number of possible voltage levels engendered by imax.
Unfortunately, when C is sized based on i max, a very large area overhead is created which overprovisions CIM array 320 when converted input data matrix 214 and converted weight matrix 212 are sparse matrices. For example, if converted input data matrix 214 has 50% sparsity and converted weight matrix 212 has 50% sparsity, then, at most, only 50% (i.e., n/2) of cells 326 will generate a current for a dot product calculation on any particular column signal line 322. On average, only about 25% (i.e., n/4) of cells 326 will generate a current for a dot product calculation on any particular column signal line 322.
Consequently, an analog accelerator multiplies sparse matrices very inefficiently due to the large number of activations and weights that have a value of zero. In other words, the predetermined size of the capacitors within S/H circuits 330 is larger, and the predetermined resolution of ADCs 340 is higher, than are needed to multiply sparse matrices.
Embodiments of the present disclosure provide a CIM array module that advantageously provides iso-accuracy performance using saturation detection units (SDUs) with significantly smaller capacitors than S/H circuit capacitors, and ADCs with significantly smaller resolution.
Generally, CIM array module 302 includes the same components as CIM array module 300. Advantageously, S/H circuits 330 have significantly smaller capacitors, and ADCs 340 have significantly smaller resolution. Controller 304, AND gates 315 (i.e., AND1, AND2, AND3 and AND4), and other processing circuitry (not depicted for clarity) have been added. The functionality of CIM array module 302 is described with respect to the
CIM array module 400 includes signal processing circuitry and CIM array 320 that performs analog MAC operations. For example, converted convolution operation 210 may be implemented by CIM array module 400. Generally, CIM array 320 is a 4×4 array; other array sizes are also supported by the present disclosure, such as, for example, 8×8, 16×16, etc.
The signal processing circuitry for CIM array module 400 includes controller 410, AND gates 415 (i.e., AND1, AND2, AND3 and AND4), DACs 310 (i.e., DAC1, DAC2, DAC3 and DAC4), SDUs 430 (i.e., SDU1, SDU2, SDU3 and SDU4), and ADCs 340 (i.e., ADC1, ADC2, ADC3 and ADC4). As discussed above, CIM array 320 includes four bit lines (BLs) or column signal lines 322, i.e., column signal lines 3221, 3222, 3223 and 3224, four word lines (WLs) or row signal lines 324, i.e., row signal lines 3241, 3242, 3243 and 3244, and sixteen cells 326, one disposed at each intersection of column signal lines 322 and row signal lines 324. DACs 310 are coupled to row signal lines 324, SDUs 430 are coupled to column signal lines 322, and ADCs 340 are coupled to SDUs 430 via sampled signal lines 332 (i.e., sampled signal lines 3321, 3322, 3323 and 3324).
In other embodiments, SDUs 430 may be shared, and each SDU 430 may be coupled to two or more column signal lines 414 by a multiplexer that is coupled to controller 410. For example, two SDUs 430 may be coupled to CIM array 320 rather than four SDUs 430. One SDU 430, e.g., SDU1, may be coupled to column signal lines 3221 and 3222, while another SDU 430, e.g., SDU2, may be coupled to column signal lines 3223 and 3224. Processing is correspondingly distributed over two processing cycles, rather than a single processing cycle, using this SDU multiplexing example. In another example, one SDU 430 may be coupled to CIM array 320 rather than four SDUs 430. One SDU 430, e.g., SDU1, may be coupled to column signal lines 3221, 3222, 3223 and 3224, and processing is correspondingly distributed over four processing cycles, rather than a single processing cycle, using this SDU multiplexing example. Other numbers of multiplexed SDUs 430 are also contemplated. Controller 410 provides the control signals to the multiplexers necessary to connect a particular column signal line 322 to a respective SDU 430 during each processing cycle.
Generally, DACs 310 are optional. In those embodiments that do not include DACs 310, voltage levels proportional to the input data are applied directly to AND gates 415.
Controller 410 is coupled to AND gates 415 via enable signal lines 412, and to SDUs 430 via SDU control signal lines 414 and saturation signal lines 432, i.e., saturation signal lines 4321, 4322, 4323 and 4324. During normal cycles, controller 410 transmits an enable signal to a set of AND gates 415 to provide a set of input data to
DACs 310. In many embodiments, the set of AND gates 415 includes all of the AND gates 415. In other embodiments, the set of AND gates 415 may include less than all of the AND gates 415, such as, for example, 64 AND gates 415 out of a total of 256 AND gates 415.
During partial summation cycles, controller 410 transmits an enable signal to certain AND gates 415 to allow a portion of the input data to be provided to certain DACs 310, and transmits a disable signal to the remaining DACs 310 to prevent the remaining input data from being provided to the remaining DACs 310, as discussed in more detail below. In addition to sampling and outputting BL signals BL1, BL2, BL3, and BL4 over sampled signal lines 3321, 3322, 3323 and 3324 to ADCs 340, SDUs 430 also receive SDU control signals from controller 410 over SDU control signal lines 414, and a reference voltage signal, Vref, over reference signal line 434. The reference voltage signal, Vref, is the saturation threshold voltage. Each SDU 430 also outputs a saturation voltage signal, Vsat, over saturation signal lines 432 to controller 410.
Generally, generation of the reference voltage signal, Vref, over reference signal line 434 is optional. In those embodiments that do not include reference signal line 434, each SDU 430 generates Vref internally. Additionally, in certain embodiments, SDUs 430 do not sample BL signals BL1, BL2, BL3, and BL4 but simply transmit these analog signals over sampled signal lines 3321, 3322, 3323 and 3324 to ADCs 340. In these embodiments, SDUs 430 either receive a reference current signal, Iref, over reference signal line 434 or generate the reference current signal, Iref, internally. SDUs 430 identify when a current of the analog signal is greater than a saturation threshold current, i.e., the reference current signal, Iref.
For sparse matrices, a capacitor size, Csat, may be advantageously selected that supports less than the maximum current, imax, that may be discharged for dense matrices. For example, when converted input data matrix 214 and converted weight matrix 212 have 50% sparsity, the maximum current that may be discharged on each column signal line 322 is imax/2, while the average current that may be discharged on each column signal line 322 is imax/4. Selecting a capacitor size, Csat, that supports imax/2 may still overprovision CIM array 320 because imax/2 will only be occasionally generated by 50% sparse matrices.
Instead, the capacitor size, Csat, may be selected to support less than imax/2 but more than imax/4, which represents most of the currents that are generated by 50% sparse matrices. However, because the maximum current that may be required to be discharged on each column signal line 322 is imax/2, an SDU 430 will saturate when presented with this situation. In other words, an SDU 430 with a capacitor size that supports a maximum current that is less than imax/2 will not be able to discharge enough current to generate imax/2, which, unfortunately, introduces error into the sampled signal output over sampled signal lines 3321, 3322, 3323 and 3324 to ADC 340.
The teachings of the present disclosure are applicable to other sparsity values, such as, for example, 20%, 25%, 35%, 60%, 75%, etc.
In the embodiment depicted in
For dense matrices with 0% sparsity, the maximum current generated by any column signal line 322 is 4, which requires an ADC resolution of 3-bits. For example, for column signal line 3221, a1=a2=a6=a7=amax, w11=w12=w13=w14=wmax, v1=v2=v3=v4=vmax=1, and g11=g12=g13=g14=gmax=1. For matrices with 50% sparsity, the maximum current generated by any column signal line 322 is 2 , which requires an ADC resolution of 2-bits. For example, for column signal line 3221, a1=a2=amax and a6=a7=0, w11=w12=wmax=1and w13=w14=0, v1=v2=vmax=1 and v3=v4=0, and g11=g12=gmax=1 and g13=g14=0. As discussed above, because the maximum current value of 2 is only occasionally generated, the capacitor size, Csat, may be selected to support a current value of 1 (as well as 0), which represents most of the currents that are generated by this example. In certain embodiments, a 1-bit resolution ADC may be used, such as, for example, an inverter or a sense amplifier.
In one embodiment, the value of the capacitor size, Csat, may be selected to support a current of imax/3, i.e., 4/3, which less than imax/2 but more than imax/4. In terms of n, i.e., the number of cells 236 per column signal line 322, Csat may be selected to support n/3, i.e., 4/3. In other words, the capacitor size, Csat, supports current values of 1 and 0, but does not support the maximum current value of 2 which will saturate SDUs 430, e.g., SDU 4301. Advantageously, the resolution of ADCs 340, e.g., ADC1, may be reduced to 1 bit.
In order to properly determine a saturated current value of 2, SDUs 430, e.g., SDU 4301, output a saturation signal along saturation signal lines 432, e.g., saturation signal line 4321, to controller 410 during a normal cycle. The saturation signal indicates that the dot product calculation on a particular column signal line 322, e.g., column signal line 3221, must be performed again by apportioning the dot product calculation into two partial summation cycles, each of which calculates 50% of the dot product. For this example, the first partial summation cycle calculates the dot product between a1·w11=v1·g11=vmax·gmax=1·1=1, while the second partial summation cycle calculates the dot product between a2·w12=v2·g12=vmax·gmax=1·1=1. The two dot products are then digitally combined, downstream of ADC 3401, to generate the correct value of 2, and the next normal cycle then commences.
More particularly, when controller 410 receives a saturation signal from an SDU 430, e.g., SDU 4301, controller 410 determines which row signal lines 324 received the vmax signals based on the input data to DACs 310. During the first partial summation cycle, controller 410 transmits a disable signal to the AND gates 315 for the remaining DACs 310, e.g., DAC2, DAC3 and DAC4, and the dot product for the first row signal line 324, e.g., row signal line 3241, is determined, i.e., 1. During the second partial summation cycle, controller 410 transmits a disable signal to the AND gate 315 for the first DAC 310, e.g., DAC1, and transmits an enable signal to the AND gate 315 for the second DAC 310, e.g., DAC2, and the dot product for the second row signal line 324, e.g., row signal line 3242, is determined, i.e., 1. Generally, during each partial summation cycle, controller 410 transmits either an enable signal or a disable signal to each AND gate 415 to explicitly set the state of each AND gate 415.
Referring back to
During the first partial summation cycle, controller 410 transmits a disable signal to the AND gates 315 for the remaining DACs 310, e.g., DAC2, DAC3 and DAC4, and the dot products for the first row signal lines 324, e.g., row signal line 3241, are determined, i.e., 1. During the second partial summation cycle, controller 410 transmits a disable signal to the AND gate 315 for the first DAC 310, e.g., DAC1, and transmits an enable signal to the AND gate 315 for the fourth DAC 310, e.g., DAC4, and the dot products for the fourth row signal line 324, e.g., row signal line 3244, are determined, i.e., 1.
In another embodiment, CIM array 320 is an 8×8 array. In this embodiment, eight elements of a weight matrix and eight elements of an input data matrix are multiplied together to generate one element of a converted output matrix. Again, for purposes of discussion only, the values for the voltages vi and conductances gij will be simplified to binary values; other values are, or course, supported by the present disclosure. In this context, the maximum voltage, vmax, and the maximum conductance, gmax, are 1.
For dense matrices with 0% sparsity, the maximum current generated by any column signal line 322 is 8, which requires an ADC resolution of 4-bits. For matrices with 50% sparsity, the maximum current generated by any column signal line 322 is 4, which requires an ADC resolution of 3-bits. As discussed above, because the maximum current value of 4 is only occasionally generated, the capacitor size, Csat, may be selected to support a current value of 3 (as well as 2, 1 and 0), which represents most of the currents that are generated by this embodiment.
As described above, the value of the capacitor size, Csat, may be selected to support a current of imax/3, i.e., 8/3, which less than imax/2 but more than imax/4. In terms of n, i.e., the number of cells 236 per column signal line 322, Csat may be selected to support n/3, i.e., 8/3. In another embodiment, the value of the capacitor size, Csat, may be selected to support a current of 1.2·imax/3, which less than imax/2 but more than imax/4. In other words, the capacitor size, Csat, supports current values of 3, 2, 1 and0, but does not support the maximum current value of 4 which will saturate SDUs 430. Advantageously, the resolution of ADCs 340 may be reduced to 2 bits.
Generally, with respect to CIM array module 302, the processing circuitry detects the number of ones in the input vector, and, if the number of ones in the input data will induce saturation, the processing circuitry divides the processing cycle into multiple partial summation cycles based on a maximum number of ones allowed in each partial summation cycle, similar to the methods described above. Controller 304 transmits enable and disable signals to AND gates 315 based on the specific requirements of each partial summation cycle.
At 510, controller 304 transmits enable signals, via enable signal lines 312, to AND gates 315. At 520, the processing circuitry determines whether the input data will induce saturation by “activating” a number of row signal lines 324 that exceeds a predetermined number of allowable row signal lines 324. When the processing circuitry determines that saturation will be induced, flow proceeds to 530. At 530, controller 304 transmits a disable signal to one of more AND gates 315, and flow proceeds to 540. At 540, a reduced number of row signal lines 324 are activated, and the initial partial summation cycle begins at 550. The reduced number of row signal lines 324 that are activated may be a fraction, such as, for example, ½, ¼, etc., a percentage, etc. The remaining partial summation cycles are then executed at 560.
SDU 430 includes switches 441, 442, 443 and 444, capacitor 445 and differential amplifier or comparator 446. Capacitor 445 has a size of Csat, as discussed above. The input of switch 441 is coupled to voltage rail 440, which supplies Vdd. The input of switch 442 is coupled to one of the column signal lines 322, i.e., column signal line 322i. Capacitor 445 is coupled to the outputs of switches 441 and 442, and to the inputs of switches 443 and 444. Comparator 446 has a first input, a second input and an output. The first input is coupled to the output of switch 443, the second input is coupled to reference signal line 434, and the output is coupled to one of the saturation signal lines 432, i.e., saturation signal line 432i. The inputs of switches 443 and 444 are coupled to the output of switch 442 and capacitor 445, the output of switch 443 is coupled to the first input of comparator 446, and the output of switch 444 is coupled to one of the sampled signal lines 332, i.e., sampled signal lines 332i.
In other words, capacitor 445 is selectively coupled to a respective column signal line 322i and a respective sampled signal line 332′, and comparator 446 is selectively coupled to a respective column signal line 322i and coupled to reference signal line 434 and a respective saturation signal line 432i .
SDU 430 has two operating phases that are controlled by controller 410, i.e., a pre-charge phase and a sample phase. During the pre-charge phase, switches 442, 443 and 444 are open, and switch 441 is closed which connects capacitor 445 to voltage rail 440 to pre-charge capacitor 445 to Vdd. During the sample phase, switch 441 is open, and switches 442, 443 and 444 are closed which couples column signal line 322to capacitor 445 to function as a current source because Vdd is greater than vmax, couples column signal line 322 i to sampled signal line 332i to provide a voltage level for one of the ADCs 340, i.e., ADC 340i, and couples column signal line 322 i to the first input of comparator 446 to provide a voltage level for comparison to the reference voltage signal Vref in order to detect saturation. The use of the terms input and output with respect to switch 442 is a matter of convenience and does not necessarily indicate the direction of current flow.
During the sample phase, the voltage level provided to sampled signal line 332′ starts at Vdd and decreases therefrom. Because the discharge current from capacitor 445 is equal to Csat ·dVi/dt, i.e., the capacitance multiplied by the change in voltage over time, ADC 340i simply measures the time, tADC, for the voltage level Vi on sampled signal line 332i to decrease from Vdd to a threshold voltage, Vthreshold, which is greater than vmax. Accordingly, the speed or rate at which capacitor 445 is discharged, as determined by ADCi, is directly related to the amount of current generated by the dot product calculation for column signal line 322i.
To detect saturation during the sample phase, the voltage level provided to sampled signal line 332i is also provided to the first input of comparator 446, which compares this voltage to the voltage level of the reference voltage signal Vref, which is the saturation threshold voltage. The reference voltage signal Vref begins at Vdd and decreases at a rate that represents the maximum current that is supported by the capacitor size, Csat. Accordingly, when the voltage level V, on sampled signal line 332′ decreases at a rate that is slower than the reference voltage signal Vref, then the amount of current generated by the dot product calculation for column signal line 322i is supported and no saturation is present. Conversely, when the voltage level V, on sampled signal line 332i decreases at a rate that is faster than the reference voltage signal Vref, then the amount of current generated by the dot product calculation for column signal line 322i is not supported and saturation is present. In other words, the reference voltage signal Vref has a voltage level that indicates a saturation threshold of the capacitor.
In this embodiment, the reference voltage signal Vref is provided over reference signal line 434. In other embodiments, the reference voltage signal Vref may be generated internally by SDUs 430. In certain embodiments, SDUs 430 may detect saturation by comparing the current of analog signals BL1, BL2, BL3, and BL4 to a reference current signal Iref, which may be provided over reference signal line 434 or generated internally by SDUs 430, as discussed above.
CIM array module 405 includes signal processing circuitry and CIM array 420 that performs analog MAC operations. For example, converted convolution operation 210 may be implemented by CIM array module 400. Generally, CIM array 420 is a 4×4 array; other array sizes are also supported by the present disclosure, such as, for example, 8×8, 16×16, etc.
The signal processing circuitry for CIM array module 405 includes controller 410, AND gates 415 (i.e., AND1, AND2, AND3 and AND4), DACs 310 (i.e., DAC1, DAC2, DAC3 and DAC4), SDUs 430 (i.e., SDU1, SDU2, SDU3 and SDU4), SRU 450, and ADCs 340 (i.e., ADC1, ADC2, ADC3 and ADC4). CIM array 420 includes four bit lines (BLs) or column signal lines 322, i.e., column signal lines 3221, 3222, 3223 and 3224, four word lines (WLs) or row signal lines 324, i.e., row signal lines 3241, 3242, 3243 and 3244, sixteen cells 326, one disposed at each intersection of column signal lines 322 and row signal lines 324, a reference column signal line 422, four reference row signal lines 424, i.e., reference row signal lines 4241, . . . , 4244, and four reference cells 426 disposed at each intersection of reference column signal line 422 and reference row signal lines 424. DACs 310 are coupled to row signal lines 324, SDUs 430 are coupled to column signal lines 322, SRU 450 is coupled to reference column signal line 422, and ADCs 340 are coupled to SDUs 430 via sampled signal lines 332 (i.e., sampled signal lines 3321, 3322, 3323 and 3324). In other embodiments, SDUs 430 may be shared, as discussed above.
Controller 410 is coupled to AND gates 415 via enable signal lines 412, and to SDUs 430 via SDU control signal lines 414 and saturation signal lines 432, i.e., saturation signal lines 4321, 4322, 4323 and 4324, and to SRU 450 via SDU control signal lines 414. During normal processing cycles, controller 410 transmits a close switch control signal to each AND gate 415 to provide all of the input data to DACs 310. During partial summation cycles, controller 410 transmits a close switch control signal to certain AND gates 415 to allow a portion of the input data to be provided to certain DACs 310, and transmits an open switch control signal to the remaining DACs 310 to prevent the remaining input data from being provided to the remaining DACs 310, as discussed above. In addition to sampling and outputting BL signals BLi, BL2, BL3, and BL4 over sampled signal lines 3321, 3322, 3323 and 3324 to ADCs 340, SDUs 430 also receive control signals from controller 410 over SDU control signal lines 414, and a reference voltage signal, Vref, over reference signal line 434, that is generated by SRU 450. Each SDU 430 also outputs a saturation voltage signal, Vsat, over saturation signal lines 432 to controller 410.
In one embodiment, a voltage of vmax is provided to reference row signal lines 4241, . . . , 4244, and the conductance value gref at each cell 326 is selected so that these four elements generate the maximum current that is supported by the capacitor size, Csat. In another embodiment, a voltage of vmax is provided to reference row signal lines 4241, . . . , 4244, a number of reference cells 426 are programmed with a conductance value of gmax, and the remaining reference cells 426 are programmed with a conductance value of 0 to generate the maximum current that is supported by the capacitor size, Csat. For the 50% sparsity example discussed above, 2 reference cells 426 are programmed with a conductance value of gmax, and 2 reference cells 426 are programmed with a conductance value of 0.
Generally, the operation of CIM array module 405 is the same as CIM array module 400, with the addition of the in situ generation of the reference voltage signal, Vref.
SRU 450 includes switches 441, 442 and 444, and capacitor 445. In one embodiment, capacitor 445 has a size of Csat, as discussed above. The input of switch 441 is coupled to voltage rail 440, which supplies Vdd. The input of switch 442 is coupled to reference column signal line 422. Capacitor 445 is coupled to the outputs of switches 441 and 442, and to the input of switch 444. The input of switch 444 is coupled to the outputs of switches 441 and 442 and capacitor 445, while the output of switch 444 is coupled to reference signal line 434.
SRU 450 has two operating phases that are controlled by controller 410, i.e., a pre-charge phase and a sample phase. During the pre-charge phase, switches 442 and 444 are open, and switch 441 is closed which connects capacitor 445 to voltage rail 440 to pre-charge capacitor 445 to Vdd. During the sample phase, switch 441 is open, and switches 442 and 444 are closed which couples reference column signal line 422 to capacitor 445 to function as a current source, and couples reference column signal line 422 to reference signal line 434 to provide the reference voltage signal Vref to the SDUs 430.
During the sample phase, the voltage level provided to reference signal line 434 starts at Vdd and decreases therefrom. Because the conductance value gref at each cell 326 is selected so that these four elements generate the maximum current that is supported by the capacitor size, Csat, the reference voltage signal Vref is generated in situ.
Computer 102 includes communication bus 110 coupled to one or more processors 120, memory 130, I/O interfaces 140, display interface 150, one or more communication interfaces 160 and one or more ANN accelerators 170. Generally, I/O interfaces 140 are coupled to I/O devices 142 using a wired or wireless connection, display interface 150 is coupled to display 152, and communication interface 160 is connected to network 162 using a wired or wireless connection.
Communication bus 110 is a communication system that transfers data between processor 120, memory 130, I/O interfaces 140, display interface 150, communication interface 160, ANN accelerator 170, as well as other components not depicted. Power connector 112 is coupled to communication bus 110 and a power supply (not shown).
Processor 120 includes one or more general-purpose or application-specific microprocessors that executes instructions to perform control, computation, input/output, etc. functions for computer 102. Processor 120 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 120. In addition, processor 120 may execute computer programs or modules, such as operating system 132, software modules 134, etc., stored within memory 130. For example, software modules 134 may include an ML application, an ANN application, a CNN application, etc.
Generally, storage element or memory 130 stores instructions for execution by processor 120 and data. Memory 130 may include a variety of non-transitory computer-readable medium that may be accessed by processor 120. In various embodiments, memory 130 may include volatile and nonvolatile medium, non-removable medium and/or removable medium. For example, memory 130 may include any combination of RAM, DRAM, SRAM, read only memory (ROM), flash memory, cache memory, and/or any other type of non-transitory computer-readable medium.
Memory 130 contains various components for retrieving, presenting, modifying, and storing data. For example, memory 130 stores software modules that provide functionality when executed by processor 120. The software modules include operating system 132 that provides operating system functionality for computer 102. Software modules 134 provide various functionality, such as image classification using convolutional neural networks, etc. Data 136 may include data associated with operating system 132, software modules 134, etc.
I/O interfaces 140 are configured to transmit and/or receive data from I/O devices 142. I/O interfaces 140 enable connectivity between processor 120 and I/O devices 142 by encoding data to be sent from processor 120 to I/O devices 142, and decoding data received from I/O devices 142 for processor 120. Generally, data may be sent over wired and/or wireless connections. For example, I/O interfaces 140 may 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.
Generally, I/O devices 142 provide input to computer 102 and/or output from computer 102. As discussed above, I/O devices 142 are operably connected to computer 102 using a wired and/or wireless connection. I/O devices 142 may include a local processor coupled to a communication interface that is configured to communicate with computer 102 using the wired and/or wireless connection. For example, I/O devices 142 may include a keyboard, mouse, touch pad, joystick, etc.
Display interface 150 is configured to transmit image data from computer 102 to monitor or display 152.
Communication interface 160 is configured to transmit data to and from network 162 using one or more wired and/or wireless connections. Network 162 may include one or more local area networks, wide area networks, the Internet, etc., which may execute various network protocols, such as, for example, wired and/or wireless Ethernet, Bluetooth, etc. Network 162 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.
ANN accelerator 170 is configured to execute machine learning models, such as, for example, ANNs, CNNs, RNNs, etc., in support of various applications embodied by software modules 134. Generally, ANN accelerator 170 may include one or more processing engines (PEs) 180. Generally, ANN accelerator 170 receives input data from memory 130 over communication bus 110, and transmits output data to memory 130 over communication bus 110.
ANN accelerator 170 also includes controller 172, communications bus interface 174, and one or more non-volatile and/or volatile memories 176, such as, for example, ROM, flash memory, SRAM, DRAM, etc. Controller 172 is coupled to communication bus interface 174, memory 176 and one or more PEs 180, and generally controls the functionality, data flow, etc., of ANN accelerator 170. Memory 176 is coupled to communication bus interface 174 and PEs 180, and stores, inter alia, ANN weights and activations. Each PE 180 may include one or more CIM array modules Mi, such as, for example, CIM array module 400, CIM array module 405, etc.
Computer system 100 may be an embedded system or device that does not include certain elements depicted in
The functionality at 610 is performed at CIM array 320, 420, and the functionality at 620 to 630 is performed at for each column signal line.
At 610, voltage levels are received. As discussed above, CIM array 320, 420 includes row signal lines 324, column signal lines 322 and cells 326. Each row signal line 324 is configured to receive one of the voltage levels, each column signal line 322 is coupled to an SDU 430, each cell 326 is located at an intersection of a row signal line 324 and a column signal line 322, and each cell 326 has a programmable conductance.
At 620, an analog signal is generated based on the voltage levels applied to row signal lines 324 and the programmable conductances of cells 326 of a respective column signal line 322.
At 630, the column signal line is identified as a saturated column signal line when a voltage of the analog signal is greater than a saturation threshold voltage, or a current of the analog signal is greater than a saturation threshold current.
The embodiments described herein are combinable.
In one embodiment, a method for performing dynamic saturation detection for a CIM array includes providing a plurality of voltage levels to a CIM array including a plurality of selectable row signal lines, a plurality of column signal lines and a plurality of cells, each selectable row signal line configured to receive one of the voltage levels, each cell located at an intersection of a row signal line and a column signal line, each cell having a programmable conductance; and, for each column signal line, generating an analog signal based on the voltage levels received by the selectable row signal lines and the programmable conductances of the cells of the column signal line, and identifying the column signal line as a saturated column signal line when a voltage of the analog signal is greater than a saturation threshold voltage, or a current of the analog signal is greater than a saturation threshold current.
In another embodiment of the method, identifying the column signal line is performed by a plurality of saturation detection units (SDUs), each SDU is selectively coupled to at least one column signal line, and the method further includes, at each SDU, receiving the saturation threshold voltage or saturation threshold current over a reference signal line, or generating the saturation threshold voltage or the saturation threshold current.
In another embodiment of the method, the voltage levels provided to the CIM array are based on input data values, identifying the column signal line includes generating a saturation signal, and the method further includes, during a normal cycle, selecting a set of selectable row signal lines, generating a set of analog signals based on the set of selectable row signal lines, when a saturation signal is generated by at least one SDU, determining, based on the input data values, the saturation signal and the set of selectable row signal lines, an initial subset of selectable row signal lines and a subsequent subset of selectable row signal lines different from the initial subset of selectable row signal lines, and performing an initial partial summation cycle and a subsequent partial summation cycle; during the initial partial summation cycle, selecting the initial subset of selectable row signal lines, and deselecting the subsequent subset of selectable row signal lines; and, during the subsequent partial summation cycle, selecting the subsequent subset of selectable row signal lines, and deselecting the initial subset of selectable row signal lines.
In another embodiment of the method, the method further includes, during the initial partial summation cycle, generating an initial subset of analog signals based on the initial subset of selectable row signal lines, and converting the initial subset of analog signals into initial output data; and, during the subsequent partial summation cycle, generating a subsequent subset of analog signals based on the subsequent subset of selectable row signal lines, converting the subsequent subset of analog signals into subsequent output data, and combining the initial output data and the subsequent output data to generate final output data.
In another embodiment of the method, the voltage levels provided to the CIM array are based on input data values, said identifying the column signal line includes generating a saturation signal, and the method further includes, during a normal cycle, selecting a set of selectable row signal lines, generating a set of analog signals based on the set of selectable row signal lines, when a saturation signal is generated by at least one SDU, determining, based on the input data values, the saturation signal and the set of selectable row signal lines, at least two unique sets of selectable row signal lines, and performing a partial summation cycle for each unique set of selectable row signal lines; during each partial summation cycle, selecting one of the unique sets of selectable row signal lines, deselecting all other unique sets of selectable row signal lines, generating a set of analog signals based on the selected unique set of selectable row signal lines, and converting the set of analog signals into partial output data; and, after a last partial summation cycle, combining the partial output data for each partial summation cycle to generate final output data.
In another embodiment of the method, the CIM array includes a reference column signal line, a plurality of reference row signal lines and a plurality of reference cells, where each reference cell is located at an intersection of a reference row signal line and the reference column signal line, where each reference cell has a programmable conductance, and where the method further includes, at a saturation reference unit (SRU), generating an analog signal based on a voltage level provided to the reference row signal lines and the programmable conductances of the reference cells of the reference column signal line; generating, based on the analog signal, the saturation threshold voltage or the saturation threshold current; and outputting, over the reference signal line, the saturation threshold voltage or the saturation threshold current.
In another embodiment of the method, the voltage level provided to the reference row signal lines is equal to or greater than a maximum voltage level provided to the CIM array.
In another embodiment of the method, the method further includes programming all of the reference cells to a conductance value between a minimum conductance value and a maximum conductance value; or programming a first set of reference cells to a maximum conductance value, and programming a second set of reference cells to a minimum conductance value.
In another embodiment of the method, the voltage levels are provided to the CIM array by a plurality of digital-to-analog converters (DACs), said converting the set of analog signals into output data is performed by a plurality of analog-to-digital converters (ADCs), each ADC is coupled to a respective SDU, and the method further includes, at the CIM array, programming the conductance of each cell to represent one element of a sparse weight matrix; at each DAC, receiving an input data value representing one element of a input data matrix, converting the input data value to a voltage level, and providing the voltage level to a respective row signal line; and, at each ADC, receiving an analog signal from a respective SDU, the analog signal proportional to a dot product of one row or column of the sparse weight matrix and one column or row of the input data matrix, and generating, based on the analog signal, an output data value representing one element of an output data matrix.
In another embodiment of the method, the input data matrix or the sparse weight matrix has a sparsity of about 50% or more.
In another embodiment of the method, each SDU includes a capacitor that has a capacitance less than a predetermined capacitance; and each ADC having a resolution less than a predetermined resolution.
In one embodiment, a CIM array module includes a CIM array, including a plurality of selectable row signal lines, a plurality of column signal lines and a plurality of cells, each selectable row signal line configured to receive a voltage level, each cell disposed at an intersection of a row signal line and a column signal line, each cell having a programmable conductance; and a plurality of saturation detection units (SDUs), each SDU selectively coupled to at least one column signal line, each SDU configured to, for each column signal line, generate an analog signal based on the voltage levels received by the selectable row signal lines and the programmable conductances of the cells of the column signal line, and identify the column signal line as a saturated column signal line when a voltage of the analog signal is greater than a saturation threshold voltage, or a current of the analog signal is greater than a saturation threshold current.
In another embodiment of the CIM array module, each SDU is configured to receive the saturation threshold voltage or saturation threshold current over a reference signal line; or generate the saturation threshold voltage or the saturation threshold current.
In another embodiment of the CIM array module, the voltage levels received by the CIM array are based on input data values, said identify the column signal line includes generate a saturation signal, and the CIM array module further comprises a controller, coupled to the selectable row signal lines, configured to, during a normal cycle, select a set of selectable row signal lines, generate a set of analog signals based on the set of selectable row signal lines, when a saturation signal is generated by at least one SDU, determine, based on the input data values, the saturation signal and the set of selectable row signal lines, an initial subset of selectable row signal lines and a subsequent subset of selectable row signal lines different from the initial subset of selectable row signal lines, and perform an initial partial summation cycle and a subsequent partial summation cycle; during the initial partial summation cycle, select the initial subset of selectable row signal lines, and deselect the subsequent subset of selectable row signal lines; and, during the subsequent partial summation cycle, select the subsequent subset of selectable row signal lines, and deselect the initial subset of selectable row signal lines.
In another embodiment of the CIM array module, during the initial partial summation cycle, the SDUs are configured to generate an initial subset of analog signals based on the initial subset of selectable row signal lines, and a plurality of analog-to-digital converters (ADCs), coupled to the SDUs, are configured to convert the initial subset of analog signals into initial output data; and, during the subsequent partial summation cycle, the SDUs are configured to generate a subsequent subset of analog signals based on the subsequent subset of selectable row signal lines, the ADCs are configured to convert the subsequent subset of analog signals into subsequent output data, and the controller is configured to combine the initial output data and the subsequent output data to generate final output data.
In another embodiment of the CIM array module, the CIM array module further includes a controller coupled to the selectable row signal lines; and a plurality of analog-to-digital converters (ADCs) coupled to the SDUs, where the voltage levels received by the CIM array are based on input data values; where identify the column signal line includes generate a saturation signal; where, during a normal cycle, the controller is configured to select a set of selectable row signal lines, when a saturation signal is generated by at least one SDU, determine, based on the input data values, the saturation signal and the set of selectable row signal lines, at least two unique sets of selectable row signal lines, and perform a partial summation cycle for each unique set of selectable row signal lines; where, during each partial summation cycle, the controller is configured to select one of the unique sets of selectable row signal lines, and deselect all other unique sets of selectable row signal lines; the SDUs are configured to generate a set of analog signals based on the selected unique set of selectable row signal lines; and the ADCs are configured to convert the set of analog signals into partial output data; and, where, after a last partial summation cycle, the controller is configured to combine the partial output data for each partial summation cycle to generate final output data.
In another embodiment of the CIM array module, the CIM array includes a reference column signal line, a plurality of reference row signal lines and a plurality of reference cells; each reference cell is located at an intersection of a reference row signal line and the reference column signal line; each reference cell has a programmable conductance; and the CIM array module further includes a saturation reference unit (SRU) configured to generate an analog signal based on a voltage level received by the reference row signal lines and the programmable conductances of the reference cells of the reference column signal line, generate, based on the analog signal, the saturation threshold voltage or the saturation threshold current, and output, over the reference signal line, the saturation threshold voltage or the saturation threshold current.
In another embodiment of the CIM array module, the voltage level received by the reference row signal lines is equal to a maximum voltage level received by the CIM array.
In another embodiment of the CIM array module, all of the reference cells are programmed to a conductance value between a minimum conductance value and a maximum conductance value; or a first set of reference cells is programmed to a maximum conductance value, and a second set of reference cells is programmed to a minimum conductance value.
In another embodiment of the CIM array module, the voltage levels received by the CIM array are provided by a plurality of digital-to-analog converters (DACs); the conductance of each cell of the CIM array is programmed to represent one element of a sparse weight matrix; each DAC is configured to receive an input data value representing one element of a input data matrix, convert the input data value to a voltage level, and provide the voltage level to a respective row signal line; and each ADC is configured to receive an analog signal from a respective SDU, the analog signal proportional to a dot product of one row or column of the sparse weight matrix and one column or row of the input data matrix, and generate, based on the analog signal, an output data value representing one element of an output data matrix.
In another embodiment of the CIM array module, the input data matrix or the sparse weight matrix has a sparsity of about 50% or more.
In another embodiment of the CIM array module, each SDU includes a capacitor that has a capacitance less than a predetermined capacitance; and each ADC having a resolution less than a predetermined resolution.
While implementations of the disclosure are susceptible to embodiment in 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 corresponding parts in the several views of the drawings.
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,” “including,” “has,” “having,” or any other variations thereof, are intended to cover a non-exclusive 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 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.
Reference throughout this document to “one embodiment,” “certain 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 features, structures, or characteristics may be combined in any suitable manner in one or more embodiments without limitation.
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 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 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.
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 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 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 embodiments. No language in the specification should be construed as indicating any unclaimed element as essential to the practice of the embodiments.
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 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.
In the following description, it is understood that terms such as “first,” “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.
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 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.
Claims
1. A method for performing dynamic saturation detection for a compute-in-memory (CIM) array, comprising:
- providing a plurality of voltage levels to a CIM array including a plurality of selectable row signal lines, a plurality of column signal lines and a plurality of cells, each selectable row signal line configured to receive one of the voltage levels, each cell located at an intersection of a row signal line and a column signal line, each cell having a programmable conductance;
- for each column signal line: generating an analog signal based on the voltage levels received by the selectable row signal lines and the programmable conductances of the cells of the column signal line; and identifying the column signal line as a saturated column signal line when a voltage of the analog signal is greater than a saturation threshold voltage, or a current of the analog signal is greater than a saturation threshold current.
2. The method of claim 1, where said identifying the column signal line is performed by a plurality of saturation detection units (SDUs), each SDU is selectively coupled to at least one column signal line, and the method further comprises:
- at each SDU: receiving the saturation threshold voltage or saturation threshold current over a reference signal line; or generating the saturation threshold voltage or the saturation threshold current.
3. The method of claim 2, where the voltage levels provided to the CIM array are based on input data values, said identifying the column signal line includes generating a saturation signal, and the method further comprises:
- during a normal cycle: selecting a set of selectable row signal lines, generating a set of analog signals based on the set of selectable row signal lines, when a saturation signal is generated by at least one SDU, determining, based on the input data values, the saturation signal and the set of selectable row signal lines, an initial subset of selectable row signal lines and a subsequent subset of selectable row signal lines different from the initial subset of selectable row signal lines, and performing an initial partial summation cycle and a subsequent partial summation cycle;
- during the initial partial summation cycle: selecting the initial subset of selectable row signal lines, and deselecting the subsequent subset of selectable row signal lines; and
- during the subsequent partial summation cycle: selecting the subsequent subset of selectable row signal lines, and deselecting the initial subset of selectable row signal lines.
4. The method of claim 3, further comprising: during the initial partial summation cycle:
- generating an initial subset of analog signals based on the initial subset of selectable row signal lines, and
- converting the initial subset of analog signals into initial output data; and during the subsequent partial summation cycle:
- generating a subsequent subset of analog signals based on the subsequent subset of selectable row signal lines,
- converting the subsequent subset of analog signals into subsequent output data, and
- combining the initial output data and the subsequent output data to generate final output data.
5. The method of claim 2, where the voltage levels provided to the CIM array are based on input data values, said identifying the column signal line includes generating a saturation signal, and the method further comprises:
- during a normal cycle: selecting a set of selectable row signal lines, generating a set of analog signals based on the set of selectable row signal lines, when a saturation signal is generated by at least one SDU, determining, based on the input data values, the saturation signal and the set of selectable row signal lines, at least two unique sets of selectable row signal lines, and performing a partial summation cycle for each unique set of selectable row signal lines; during each partial summation cycle: selecting one of the unique sets of selectable row signal lines, deselecting all other unique sets of selectable row signal lines, generating a set of analog signals based on the selected unique set of selectable row signal lines, and converting the set of analog signals into partial output data; and after a last partial summation cycle, combining the partial output data for each partial summation cycle to generate final output data.
6. The method of claim 2, where the CIM array includes a reference column signal line, a plurality of reference row signal lines and a plurality of reference cells, where each reference cell is located at an intersection of a reference row signal line and the reference column signal line, where each reference cell has a programmable conductance, and where the method further comprises:
- at a saturation reference unit (SRU): generating an analog signal based on a voltage level provided to the reference row signal lines and the programmable conductances of the reference cells of the reference column signal line; generating, based on the analog signal, the saturation threshold voltage or the saturation threshold current; and outputting, over the reference signal line, the saturation threshold voltage or the saturation threshold current.
7. The method of claim 6, further comprising:
- programming all of the reference cells to a conductance value equal to or greater than a minimum conductance value and less than or equal to a maximum conductance value; or
- programming a first set of reference cells to a maximum conductance value, and programming a second set of reference cells to a minimum conductance value.
8. The method of claim 5, where the voltage levels are provided to the CIM array by a plurality of digital-to-analog converters (DACs), said converting the set of analog signals into output data is performed by a plurality of analog-to-digital converters (ADCs), each ADC is coupled to a respective SDU, and the method further comprises:
- at the CIM array: programming the conductance of each cell to represent one element of a sparse weight matrix;
- at each DAC: receiving an input data value representing one element of a input data matrix, converting the input data value to a voltage level, and providing the voltage level to a respective row signal line; and at each ADC: receiving an analog signal from a respective SDU, the analog signal proportional to a dot product of one row or column of the sparse weight matrix and one column or row of the input data matrix, and
- generating, based on the analog signal, an output data value representing one element of an output data matrix.
9. The method of claim 8, where the input data matrix or the sparse weight matrix has a sparsity of about 50% or more.
10. The method of claim 9, where:
- each SDU includes a capacitor that has a capacitance less than a predetermined capacitance; and
- each ADC having a resolution less than a predetermined resolution.
11. A compute-in-memory (CIM) array module, comprising:
- a CIM array, including a plurality of selectable row signal lines, a plurality of column signal lines and a plurality of cells, each selectable row signal line configured to receive a voltage level, each cell disposed at an intersection of a row signal line and a column signal line, each cell having a programmable conductance; and
- a plurality of saturation detection units (SDUs), each SDU selectively coupled to at least one column signal line, each SDU configured to: for each column signal line: generate an analog signal based on the voltage levels received by the selectable row signal lines and the programmable conductances of the cells of the column signal line; and identify the column signal line as a saturated column signal line when a voltage of the analog signal is greater than a saturation threshold voltage, or a current of the analog signal is greater than a saturation threshold current.
12. The CIM array module of claim 11, where each SDU is configured to:
- receive the saturation threshold voltage or saturation threshold current over a reference signal line; or
- generate the saturation threshold voltage or the saturation threshold current.
13. The CIM array module of claim 12, where the voltage levels received by the CIM array are based on input data values, said identify the column signal line includes generate a saturation signal, and the CIM array module further comprises a controller, coupled to the selectable row signal lines, configured to:
- during a normal cycle: select a set of selectable row signal lines, generate a set of analog signals based on the set of selectable row signal lines, when a saturation signal is generated by at least one SDU, determine, based on the input data values, the saturation signal and the set of selectable row signal lines, an initial subset of selectable row signal lines and a subsequent subset of selectable row signal lines different from the initial subset of selectable row signal lines, and perform an initial partial summation cycle and a subsequent partial summation cycle;
- during the initial partial summation cycle: select the initial subset of selectable row signal lines, and deselect the subsequent subset of selectable row signal lines; and during the subsequent partial summation cycle: select the subsequent subset of selectable row signal lines, and deselect the initial subset of selectable row signal lines.
14. The CIM array module of claim 13, where:
- during the initial partial summation cycle: the SDUs are configured to generate an initial subset of analog signals based on the initial subset of selectable row signal lines, and a plurality of analog-to-digital converters (ADCs), coupled to the SDUs, are configured to convert the initial subset of analog signals into initial output data; and
- during the subsequent partial summation cycle: the SDUs are configured to generate a subsequent subset of analog signals based on the subsequent subset of selectable row signal lines, the ADCs are configured to convert the subsequent subset of analog signals into subsequent output data, and the controller is configured to combine the initial output data and the subsequent output data to generate final output data.
15. The CIM array module of claim 12, further comprising:
- a controller coupled to the selectable row signal lines; and
- a plurality of analog-to-digital converters (ADCs) coupled to the SDUs,
- where the voltage levels received by the CIM array are based on input data values;
- where said identify the column signal line includes generate a saturation signal;
- where, during a normal cycle, the controller is configured to: select a set of selectable row signal lines, when a saturation signal is generated by at least one SDU, determine, based on the input data values, the saturation signal and the set of selectable row signal lines, at least two unique sets of selectable row signal lines, and perform a partial summation cycle for each unique set of selectable row signal lines;
- where, during each partial summation cycle: the controller is configured to select one of the unique sets of selectable row signal lines, and deselect all other unique sets of selectable row signal lines; the SDUs are configured to generate a set of analog signals based on the selected unique set of selectable row signal lines; and the ADCs are configured to convert the set of analog signals into partial output data; and
- where, after a last partial summation cycle, the controller is configured to combine the partial output data for each partial summation cycle to generate final output data.
16. The CIM array module of claim 12, where the CIM array includes a reference column signal line, a plurality of reference row signal lines and a plurality of reference cells, where each reference cell is located at an intersection of a reference row signal line and the reference column signal line, where each reference cell has a programmable conductance, and where the CIM array module further comprises a saturation reference unit (SRU) configured to:
- generate an analog signal based on a voltage level received by the reference row signal lines and the programmable conductances of the reference cells of the reference column signal line;
- generate, based on the analog signal, the saturation threshold voltage or the saturation threshold current; and
- output, over the reference signal line, the saturation threshold voltage or the saturation threshold current.
17. The CIM array module of claim 16, where:
- all of the reference cells are programmed to a conductance value equal to or greater than a minimum conductance value and less than or equal to a maximum conductance value; or
- a first set of reference cells is programmed to a maximum conductance value, and a second set of reference cells is programmed to a minimum conductance value.
18. The CIM array module of claim 14, where:
- the voltage levels received by the CIM array are provided by a plurality of digital-to-analog converters (DACs);
- the conductance of each cell of the CIM array is programmed to represent one element of a sparse weight matrix;
- each DAC is configured to: receive an input data value representing one element of a input data matrix, convert the input data value to a voltage level, and provide the voltage level to a respective row signal line; and each ADC is configured to: receive an analog signal from a respective SDU, the analog signal proportional to a dot product of one row or column of the sparse weight matrix and one column or row of the input data matrix, and generate, based on the analog signal, an output data value representing one element of an output data matrix.
19. The CIM array module of claim 18, where the input data matrix or the sparse weight matrix has a sparsity of about 50% or more.
20. The CIM array module of claim 18, where:
- each SDU includes a capacitor that has a capacitance less than a predetermined capacitance; and
- each ADC having a resolution less than a predetermined resolution.
Type: Application
Filed: Apr 28, 2021
Publication Date: Nov 3, 2022
Applicant: Arm Limited (Cambridge)
Inventors: Teyuh Alice Chou (Ann Arbor, MI), Mudit Bhargava (Austin, TX), Supreet Jeloka (Austin, TX), Fernando Garcia Redondo (Cambridge), Paul Nicholas Whatmough (Cambridge, MA)
Application Number: 17/242,721