The present invention relates generally to the electrical, electronic and computer arts and, more particularly, to in-memory computing (IMC) systems.
In machine learning, a “kernel” is usually used to refer to the kernel trick, a method of using a linear classifier to solve a non-linear problem. More specifically, the kernel itself is usually a similarity function between two inputs, while the kernel method is used to refer to the process of performing linear classification in order to solve a nonlinear task. Kernel functions are widely used in various machine learning models, ranging from simple Support Vector Machines (SVM) to complex deep learning architectures, such as conventional neural network architectures. In order to speed up computation, the kernel functions can be approximated using a random projection, where the vectors of the random projection are drawn from a kernel-specific distribution.
Traditional von Neumann architectures separate the memory and processor units. IMC employs a non-von Neumann architecture which addresses the performance and power bottlenecks caused by the movement of data between the processor and the main memory in traditional von Neumann architectures.
Principles of the invention provide in-memory computing for approximating kernel functions. In one aspect, an exemplary method includes the operations of determining, using a digital processing unit, a probability distribution corresponding to the kernel function; sampling, using the digital processing unit, weights from the determined probability distribution corresponding to the given kernel function; programming, using a digital processing unit, memristive devices of an analog crossbar based on the sampled weights, where each memristive device of the analog crossbar is configured to represent a corresponding weight; performing two matrix-vector multiplication operations on a first analog input and a second analog input using the programmed crossbar; and computing, using the digital processing unit, a dot product on results of the matrix-vector multiplication operations.
In one aspect, a method for approximating a kernel function comprises determining, using a digital processing unit, a probability distribution corresponding to the kernel function; sampling, using the digital processing unit, weights from the determined probability distribution corresponding to the given kernel function; programming, using the digital processing unit, memristive devices of an analog crossbar based on the sampled weights, where each memristive device in the analog crossbar is configured to represent a corresponding weight; determining, using the digital processing unit, the programmed weights of the analog crossbar; calculating, using the digital processing unit, a column-wise standard deviation of the determined programmed weights using digital processing; storing the calculated row-wise standard deviation in a digital processing unit; and correcting, using the digital processing unit, the standard deviation of rows of the analog crossbar using the calculated row-wise standard deviation.
In one aspect, a method for approximating a kernel function comprises, for all weights programmed in an analog crossbar, selecting a device corresponding to one of a negative weight and a positive weight and setting the selected device to zero; for each device not set to zero, applying a plurality of low-amplitude pulses to set a conductance of the corresponding device to a high conductance; and, for each device not set to zero, applying one or more pulses with high-amplitude to decrease the conductance of the corresponding device.
In one aspect, a method for correcting row-wise standard deviation comprises programming, using a digital processing unit, a plurality of devices in an analog crossbar; applying a constant voltage across all rows in the analog crossbar, where each row comprises a device corresponding to a negative weight or a device corresponding to a positive weight; reading, using the digital processing unit, a value via a plurality of analog-to-digital converters; calculating, using the digital processing unit, an L1 norm of a standard Gaussian; and correcting, using the digital processing unit, the row-wise standard deviation by dividing the L1 norm of the standard Gaussian by the read value.
In one aspect, a method for processing an arc-cosine kernel comprises determining, using a digital processing unit, a probability distribution corresponding to an arc-cosine kernel function; sampling, using the digital processing unit, weights from the determined probability distribution corresponding to the arc-cosine kernel function; programming, using the digital processing unit, a plurality of devices of an analog crossbar based on the sampled weights, where each device in the analog crossbar is configured to represent a corresponding weight; performing a matrix-vector multiplication operation using the programmed crossbar array; pre-processing elements of outputs of the matrix-vector multiplication operation; and computing, using the digital processing unit, a dot product on the pre-processed elements of the outputs of the matrix-vector multiplication operation.
In another aspect, an exemplary apparatus includes a programming circuit; an analog crossbar array, coupled to the programming circuit, and having an input and an output; a digital to analog converter coupled to the input of the analog crossbar array; an analog to digital converter coupled to the output of the analog crossbar array; and a digital processing unit coupled to the analog to digital converter. The programming circuit is configured to program weights into the analog crossbar array; the analog crossbar array is configured to perform two matrix vector multiplications with first and second analog inputs obtained from the digital to analog converter, based on the programmed weights; and the digital processing unit is configured to computer a dot product of the outputs of the two matrix vector multiplications corresponding to the first and second inputs, obtained from the analog to digital converter.
As used herein, “facilitating” an action includes performing the action, making the action easier, helping to carry the action out, or causing the action to be performed. Thus, by way of example and not limitation, instructions executing on a processor might facilitate an action carried out by semiconductor fabrication equipment, by sending appropriate data or commands to cause or aid the action to be performed. Where an actor facilitates an action by other than performing the action, the action is nevertheless performed by some entity or combination of entities.
Techniques as disclosed herein can provide substantial beneficial technical effects. Some embodiments may not have these potential advantages and these potential advantages are not necessarily required of all embodiments. By way of example only and without limitation, one or more embodiments may provide one or more of:
Some embodiments may not have these potential advantages and these potential advantages are not necessarily required of all embodiments. These and other features and advantages will become apparent from the following detailed description of illustrative embodiments thereof, which is to be read in connection with the accompanying drawings.
The following drawings are presented by way of example only and without limitation, wherein like reference numerals (when used) indicate corresponding elements throughout the several views, and wherein:
It is to be appreciated that elements in the figures are illustrated for simplicity and clarity. Common but well-understood elements that may be useful or necessary in a commercially feasible embodiment may not be shown in order to facilitate a less hindered view of the illustrated embodiments.
Principles of inventions described herein will be in the context of illustrative embodiments. Moreover, it will become apparent to those skilled in the art given the teachings herein that numerous modifications can be made to the embodiments shown that are within the scope of the claims. That is, no limitations with respect to the embodiments shown and described herein are intended or should be inferred.
The incorporation of kernel methods in machine learning has led to remarkable performance improvements in all areas of machine learning. Most kernels can be computed efficiently, but they often involve non-linearities that make the kernels difficult to split up. For example, the polynomial kernel k(x, y)=(xTy+c)2 is easy to compute but cannot be split up since it is non-linear.
Conventional approaches approximate kernels by randomly projecting the data into a different space and then performing a simple dot product in this space. The distribution from which the vectors of the projection are drawn is dictated by the type of kernel to be approximated. With such an approach, many computations can be split up and substantial performance gains can be attained. Conventional systems, however, perform all kernel operations using a digital processor. In contrast, in one or more exemplary embodiments, parts of the kernel algorithm are implemented using an analog processor. It is noted that an MVM operation has constant time complexity when an analog processor is used. As a result, the computation is much faster and more energy efficient using an analog processor for at least parts of the algorithm.
In one or more exemplary embodiments, kernels are approximated using in-memory computing, leading to computation speed up of many algorithms in machine learning and improvements in energy efficiency. For example, if one or more embodiments are applied to a well-known prior art neural network architecture with six self-attention layers and eight heads each, and dimension d=D=256, about 6 million operations per inference would be saved. This is achieved by sampling vectors from a kernel-specific distribution and programming the vectors into the crossbar array. (In one or more embodiments, the elements of the crossbar are programmed (configured) only once. Once they are programmed, the elements can be used to efficiently perform the MVM operations. This makes the programming cost negligible compared to the cost of constantly performing MVM operations in a digital processor. For example, in a typical low-power, always-on use-case, millions of MVM operations would be performed for one round of programming.) The kernel is then approximated by performing a matrix-vector multiplication operation using IMC and digital post-processing. In general, given a kernel function to be approximated, a probability distribution and scaling functions that are needed to approximate the kernel are inferred using well known techniques. A given number of vectors are then drawn from the specific distribution corresponding to the given kernel function and these vectors are programmed into a crossbar array comprising memristive devices.
In order to then approximate the kernel function evaluated on two vectors, the vectors are first projected into the new space using IMC and then scaling functions are applied in a digital post-processing unit. After the projection of the two vectors, the dot product is computed between the two projected vectors, which is then used as the approximated value of the kernel function.
One or more embodiments allow for multiple ways of programming the random vectors into the crossbar array:
One or more embodiments also ensure that the standard deviations of the vectors are uniform by applying a digital correction of the standard deviation per vector. This can be achieved in two ways:
The application areas can be broadly classified in accordance with the computational precision that is required. Scientific computing, where very high precision is required, is at one end of the spectrum while stochastic computing that relies on imprecision is at the other end. Areas, such as signal processing (SP), machine learning (ML) and optimization, are in the middle. As illustrated in
(1) time complexity and exploits analog storage capability and Kirchhoff s circuits laws. It is also possible to implement MVM with the matrix transpose. In one example embodiment, a digital-to-analog converter (DAC) 204 converts input vectors to analog form for input to a crossbar array 208 of compute-in-memory devices 224 that implements an analog MVM operation. The result of the MVM operation is then provided to a dot product unit 216 after conversion to digital form by analog-to-digital converter 212. The dot product unit 216 computes an inner product of the Wx and Wy outputs of the crossbar array 208 to generate output 220. The skilled artisan will be familiar with the design of crossbar arrays 208. The dot product unit 216 (and the units 520) may be implemented to perform dot products using a digital processing unit, a microprocessor, a field-programmable gate array, dedicated digital circuitry, and the like, as would be appreciated by the skilled artisan, given the teachings herein.
Shift-invariant kernel: A kernel function k is shift-invariant if k(x, y)=k(x−y). In other words, it does not matter what x, y are if the distance remains the same. (Note that shift-invariance does not imply symmetry. Example: k(x−y)=x−y, but most of the time, the kernel is symmetric, e.g., k(x−y)=(x−y)2.)
Bochner's theorem: A continuous kernel k(x, y)=k(x−y) (i.e., also shift-invariant) on is positive-definite if and only if k(x−y) is the Fourier transform of a non-negative measure.
Positive-definiteness of a function: A function k is positive-definite if the matrix A, given by Ai,j=k(xi−xj) for n inputs x1, . . . , xn∈, is symmetric (if working in
) and positive semi-definite, i.e., ∀x: xTAx≥0. (From that, it is taken that k must also be symmetric, i.e., k(x, y)=k(y, x).)
From Bochner's theorem: For a symmetric, shift-invariant kernel k that is properly scaled, the Fourier transform is a proper probability distribution:
with zω(x)=√{square root over (2)} cos(ωTx+b) where the term z(x)ωTzω(y) is an unbiased estimate of k(x−y). The variance is too high, however, when only one value is considered. In one example embodiment, a draw from p(ω) is performed D times and a vector
is calculated. The result is that zω(x)Tzω(y) is an unbiased, low-variance estimate of k(x−y), where k(x−y) is the Fourier transform of the non-negative measure p(ω) (which is used to sample ω). Most kernels used in practice can be approximated by z(x)Tz(y), where:
Given a kernel k(x, y), functions h: →
, ƒ1, . . . , ƒl:
→
and probability distribution p(ω), where these are chosen such that:
where D=l·m, ω˜p(ω), and k(x, y)≈z(x)Tz(y), m weight vectors ωi are drawn and programmed into a crossbar array comprising resistive memory devices 224. The transformation z: →
is then done as follows:
via a look-up table or a digital processing unit, and multiply it with the output, thus approximating the kernel function k(x, y).
The Gram matrix: consider the matrix G where Gi,j is given by any inner product <xi,xj> where xi∈. Given N samples, this matrix has shape N×N and therefore scales quadratically in the training set size. The matrix is symmetric and positive semi-definite, meaning that GT=G and ∀x,xTGx≥0.
SVM: The Support Vector Machine creates a linear decision boundary with a maximum margin to provide the most general classifier for a set of linearly separable points.
Kernel-SVM: The kernelized SVM is used for classifying data that is not linearly separable with the help of kernels. For training, it uses the Gram matrix K, where Ki,j=k(xi, xj) with a kernel function k.
The well-known Kernel “trick” is a widely used technique in machine learning. This “trick” recognizes that every kernel can be expressed as a dot product in a (potentially) very high dimensional space: k(x, y)=<z(x), z(y)>. One goal is to work in that space without explicitly calculating z(x). The idea is to make sure that z(x) only appears in the form of a dot product. If that is the case, k(x, y) can always be used and z(x) does not need to be explicitly calculated.
Kernel-SVMs implicitly allow the calculation in a high-dimensional space.
Inference in Kernel-SVMs: As will be appreciated by the skilled artisan, given a new point y that needs to be predicted, the prediction can be computed as ƒ(y)=Σi=1Ncik(xi, y) which has time complexity (Nd) where N are the number of training samples and d is the dimension of the data. This is particularly disadvantageous if many of the values ci are non-zero.
Inference in Approximated-Kernel-SVMs: As will be appreciated by the skilled artisan, here, the prediction can be computed as follows: ƒ(y)=Σi=1Ncik(xI, y)≈Σi−1Nciz(xi)Tz(y)=(Σi=1Nciz(xi)Tz(y)=wTz(y). Assuming that the complexity for calculating z(y) is in (Dd), the final complexity is
(d+Dd). It should be noted that, generally, D<<N.
It is noted that the transformation z(y) is, according to the above, a matrix-vector multiplication followed by scaling and multiplying with h(z). The matrix at hand is ω where each row ωi was drawn from a kernel-specific distribution p(ω) and the input vector is y. By performing this operation using IMC, the complexity is reduced to (d) because the MVM operation using IMC has complexity
(1).
Consider a network architecture for various tasks, e.g., seq2seq translation, with a sequence of N (referred to as the sequence length) tokens of dimension d. The transformer operates on the sequence at once, i.e., there is no sequential processing. The main pillar of the transformer is the attention layer: given input X∈ the input is transformed into Q, K, V using linear transformations WQ, WK, WV, respectively. These transformations can be performed using IMC, as the matrices are static. The input is then pushed through the attention mechanism:
The matrices Q, K, V are all dynamic and therefore, none of the matrix-matrix multiplications can be performed using IMC. The skilled artisan will be generally familiar with such transformations, and, given the teachings herein, can adapt appropriate known techniques to implement one or more embodiments.
Problem with the Transformer: The computation
is in (N2d) because the attention matrix A=exp(QKT)∈
needs to be calculated explicitly. The problem is that the computational complexity scales quadratically with the sequence length and, therefore, many applications requiring long input sequences are not possible.
Conventional techniques solve this problem by approximating the exponential in the softmax using random features (i.e., projecting them onto another space and then doing the dot product later; see also description above). Precisely, A=exp(QKT) where Ai,j=exp(qiTki) and where qi denotes the i-th row vector of Q. The identity
and that the term
is a shift-invariant kernel (Gaussian kernel) that can be approximated are noted. The function exp (xTy) is therefore approximated using
This transformation is denoted with z(x).
Using the transformation z(x), the Attention layer can be rewritten to z(Q)z(K)TV and it is noted that the softmax disappeared. The order of computation is now free to be selected and the N2 attention matrix does not have to be explicitly computed anymore. The new computation is z(Q)(z(K)TV) where the brackets indicate the order. Note that z(Q)∈, z(K)∈
, V∈
.
The space and time complexity of the Transformer is (N2d),
(N2+Nd). The space and time complexity of a typical conventional neural network architecture is
(NDd),
(ND+Nd+Dd). The transformations z(Q/K) require 2×NDd extra computations. Using IMC, each individual transformation of a vector q/ki is in
(1) and the number of required operations reduces to 2×N. 2×Dd many operations per attention head are therefore saved. With, for example, six self-attention layers and eight heads each, and dimension d=D=256 , approximately 6 million operations per inference would be saved.
In the following, assume the MVM is W*x; columns are referred to if the MVM is carried out as such: xT*W. If the kernel to be approximated is the Gaussian kernel, the distribution from which the weights are drawn is a simple Gaussian, i.e., the rows ω are drawn according to ω˜(0, Id). Each row of the matrix ω should have the same standard deviation (std). This embodiment illustrates options to achieve this.
Program device conductances in the analog crossbar 562.
Each device 224 in the analog crossbar 562 is organized in a differential manner. This means that every weight g is represented by a differential pair (g+, g−) so that g=g+−g−. The conductance value of these devices 224 can be changed by applying specific current pulses with varying length and amplitude. For example, applying single pulses with high amplitude will set the device 224 into a low conductance state.
In one example embodiment, iterative programming is used for setting individual devices 224 to target conductances. This method works by iteratively reading the conductance of a device 224 and applying a current pulse to the device 224, until the read conductance is matches the target conductance (optionally, within some range, which can be determined heuristically as known by the skilled artisan).
In one example embodiment, using a standard personal computer (PC), a matrix is generated where the elements are drawn from a Gaussian distribution. The rows in this matrix can be orthogonalized by, for example, the Gram-Schmidt algorithm. Iterative programming is then used to program the weights into the crossbar array 562. Since iterative programming also introduces imprecisions, standard deviation (std) correction of the programmed row-wise weights may still need to be performed (in one or more embodiments, the Gaussian weights that were drawn in floating point on a PC are programmed into the crossbar array 562; however, the standard deviation of the programmed row-wise weights might still need correction).
Advantages of the above technique include that other matrices, such as orthonormal ones, may be used since the weights can be sampled on a digital processing unit 508 and that the matrices are guaranteed to follow a true Gaussian since they are generated in a digital processing unit 508. Costs include that high-resolution ADCs are required for reading the programmed conductances (unless linear regression is used for determining the weights) and that the programming of the analog crossbar 562 can be time consuming. In one or more embodiments, read circuitry includes, essentially, the ADC with included circuits that generate the input read voltages.
When devices 224 are set to high conductance values, they naturally follow a Gaussian distribution. In one example embodiment, for every differential pair, one device 224 that will be programmed (i.e., either the device 224 corresponding to a negative weight or the device 224 corresponding to a positive weight) is chosen. For these devices 224, many low-amplitude pulses are applied to set them to high conductance (called a SET operation) to ensure uniformity of the devices 224. For these devices 224, a smaller number of pulses (such as one) that decreases the conductance are applied in a uniform manner.
For the device 224 not set to zero, a smaller number (such as one) of pulses with high amplitude are applied to decrease the conductance (operation 812). In one example embodiment, the pulse is applied in parallel to all devices 224 of the analog crossbar 562. As noted below, the variations in the inherent characteristics of the devices 224 of the analog crossbar 562 result in a Gaussian distribution of the conductance values resulting from operation 812. The determination of the number of pulses and the amplitude of the pulses to attain specified conductances is, in and of itself, well known in the art. It is noted that in one or more embodiments, the analog crossbar 562 is not programmed with specific values for the weights; rather, the variations in the inherent characteristics of the devices 224 are relied upon to provide the Gaussian distribution. Operations of the method 800 may be performed by the analog crossbar 562, the digital processing unit 508, and the programming circuit 558, under control of, for example, digital control circuitry in any one or more of 508 and 558, a separate digital control circuit, or the like.
Advantages of the above technique include that only one iteration of programming of the analog crossbar 562 is required (excluding the initial SET operation) and no read circuitry is required. Costs include that weight distribution may not be exactly Gaussian (due to the variations in the inherent characteristics of the devices 224) and a limitation resulting from the distribution and magnitude that is generated by applying one pulse. The latter is ultimately a result of the characteristics of the devices. If too many pulses are applied and the conductance decreases too much, the distribution is no longer Gaussian. When it is Gaussian, then sometimes the high conductances lead to high currents which leads to non-linearities in the ADC.
In one example embodiment, the approximation of the conductances is read using read-circuitry and the row-wise standard deviation {circumflex over (σ)}i is computed. Since an MVM operation is a linear operation, the output (ωx)i can be divided by {circumflex over (σ)}i to obtain the unit standard deviation. Advantages include the precise computation of the standard deviation. Costs include an imprecise approximation of true conductances, and the technique requires periphery for reading the approximate conductances.
In one example embodiment, linear regression on the MVM output results is used to infer the programmed conductances with high precision. As in option 1, the standard deviation is computed, and the output is scaled. Advantages include a more precise estimate of the programmed conductances. Costs include the relatively expensive linear regression that needs to be performed in an external computer.
In one example embodiment, for the devices 224 in the crossbar array 562 corresponding to positive weights, a constant voltage is applied across all rows and read values of the ADCs 570. This is equivalent to doing an MVM operation with an input vector of all ones: y+=G+1. The i-th entry in y+ now holds the sum of the devices 224 in the crossbar array 562 corresponding to positive weights of the i-th row in G+. The same is done for G−.
The sum y++y− now is the vector that holds the row-wise L1-Norm of the G matrix. Note that this is only the case when, for all differential pairs, there is always one device 224 that is programmed to 0; otherwise, the calculation would use |g+|+|g−| rather than |g|.
For a Gaussian vector with fixed size, zero mean, and standard deviation=d, the L1-Norm is approximately always the same. Denote this by η and, given the calculated L1-Norm of the i-th row of G, denoted by ζ, the output (Gx)i can be scaled by
to approximately achieve the target standard deviation d. Advantages of the above technique include that no read circuitry is required since the calibration relies only on performing an MVM operation, and the technique is fast and efficient. Costs include imprecision from the MVM operation, such as imprecision introduced from using the L1-Norm to correct for the standard deviation. This assumes that the devices 224 follow a true Gaussian distribution with uniform initial standard deviation across the row.
In addition to Gaussian kernels, arc-cosine kernels can be closely connected to neural networks, which include feature spaces that mimic the sparse, non-negative, distributed representations of single-layer threshold networks. For arc-cosine kernels, the probability distribution p(ω) is the Gaussian distribution, but the element-wise activation transformations ƒ1, . . . ƒl are different. This powerful class of kernels enables the effective implementation of their simple activation functions near-crossbar array without digital processing: when using zeroth-order arc-cosine kernel, the only activation function is the Heaviside step function, i.e., ƒ1(ωiTx)=0.5(1+sign(ωiTx)). In one example embodiment, it is implemented directly with an analog comparator that eliminates the need for an ADC and digital processing.
When using a first-order arc-cosine kernel, the only activation function is ReLU, i.e., ƒ1(ωiTx)=max{0, ωiTx} which is simpler to compute than the sine and cosine activations used in Gaussian kernels. Advantages of the above technique include no need for a digital post-processing unit (LDPU) when using an analog comparator; and simple digital hardware when the zero-check is performed. Costs include that only arc-cosine kernels can be approximated.
Given the discussion thus far, it will be appreciated that, in general terms, an exemplary method include operations of determining, using a digital processing unit 558, a probability distribution corresponding to the kernel function; sampling, using the digital processing unit 558, weights from the determined probability distribution corresponding to the given kernel function; programming, using a digital processing unit 558, memristive devices 224 of an analog crossbar 562 based on the sampled weights, where each memristive device 224 of the analog crossbar 562 is configured to represent a corresponding weight; performing two matrix-vector multiplication operations on a first analog input and a second analog input using the programmed crossbar 562; and computing, using the digital processing unit 558, a dot product on results of the matrix-vector multiplication operations.
In one example embodiment, the first analog input is designated as x and the second analog input is designated as y, the method further comprising converting an input vector x to the analog input x and converting an input vector y to the analog input y by a digital-to-analog converter 566, and inputting the analog input x and the analog input y to the analog crossbar 562.
In one example embodiment, using read circuitry, programmed conductances of the analog crossbar 562 corresponding to each vector of weights are estimated; standard deviations are calculated using digital processing; and the standard deviations values are used to correct for variations.
In one example embodiment, using in-memory computing, a vector-wise L1 norm of the weights is computed using a single matrix-vector multiplication operation, where an input vector of the analog crossbar 562 is constant, by performing a dot product of weights with a vector of all ones, where the weights are all positive; a ratio between the computed vector-wise L1 norm of the weights and a measured L1 norm is computed; and the vector-wise standard deviation is corrected using the ratio.
In one example, a method 700 for approximating a kernel function comprises determining, using a digital processing unit 558, a probability distribution corresponding to the kernel function; sampling, using the digital processing unit 558, weights from the determined probability distribution corresponding to the given kernel function (operation 704); programming, using the digital processing unit 558, memristive devices 224 of an analog crossbar 562 based on the sampled weights, where each memristive device 224 in the analog crossbar 562 is configured to represent a corresponding weight (operation 708); determining, using the digital processing unit 558, the programmed weights of the analog crossbar 562 (operation 712, 716); calculating, using the digital processing unit 558, a column-wise standard deviation of the determined programmed weights using digital processing (operation 720); storing the calculated row-wise standard deviation in a digital processing unit 508 (operation 724); and correcting, using the digital processing unit 558, the standard deviation of rows of the analog crossbar 562 using the calculated row-wise standard deviation.
In one example embodiment, the programmed weights are determined by reading the programmed weights using read-circuitry (operation 712).
In one example embodiment, the programmed weights are determined by performing linear regression on output results of a corresponding matrix-vector multiplication operation (operation 716).
In one aspect, a method for approximating a kernel function comprises, for all weights programmed in an analog crossbar 562, selecting a device 224 corresponding to one of a negative weight and a positive weight and setting the selected device 224 to zero (operation 804); for each device 224 not set to zero, applying a plurality of low-amplitude pulses to set a conductance of the corresponding device 224 to a high conductance (operation 808); and, for each device 224 not set to zero, applying one or more pulses with high-amplitude to decrease the conductance of the corresponding device 224 (operation 812).
In one example embodiment, using read-circuitry, approximations of the conductances are read; a row-wise standard deviation {circumflex over (σ)}i is computed; and an output (ωx)i is divided by the row-wise standard deviation {circumflex over (σ)}i to derive a unit standard deviation.
In one example embodiment, programmed conductances of the analog crossbar 562 are inferred by performing linear regression on outputs of a corresponding matrix-vector multiplication operation; a row-wise standard deviation {circumflex over (σ)}i is computed; and an output (ωx)i is divided by the row-wise standard deviation {circumflex over (σ)}i to derive a unit standard deviation.
In one aspect, a method 1000 for correcting row-wise standard deviation comprises programming, using a digital processing unit 558, a plurality of devices 224 in an analog crossbar 562 (operation 1004); applying a constant voltage across all rows in the analog crossbar 562, where each row comprises a device 224 corresponding to a negative weight or a device 224 corresponding to a positive weight (operation 1008); reading, using the digital processing unit 558, a value via a plurality of analog-to-digital converters 570 (operation 1012); calculating, using the digital processing unit 558, an L1 norm of a standard Gaussian (operation 1016); and correcting, using the digital processing unit 558, the row-wise standard deviation by dividing the L1 norm of the standard Gaussian by the read value (operation 1020).
In one aspect, a method 900 for processing an arc-cosine kernel comprises determining, using a digital processing unit 558, a probability distribution corresponding to an arc-cosine kernel function; sampling, using the digital processing unit 558, weights from the determined probability distribution corresponding to the arc-cosine kernel function; programming, using the digital processing unit 558, a plurality of devices 224 of an analog crossbar 562 based on the sampled weights, where each device 224 in the analog crossbar 562 is configured to represent a corresponding weight; performing a matrix-vector multiplication operation using the programmed crossbar array 562 (operation 904); pre-processing elements of outputs of the matrix-vector multiplication operation (operation 908, 912); and computing, using the digital processing unit 558, a dot product on the pre-processed elements of the outputs of the matrix-vector multiplication operation (operation 916).
In one example embodiment, the pre-processing comprises calculating a Heaviside step function on each element of the output of the matrix-vector multiplication operation using an analog comparator (operation 908).
In one example embodiment, the pre-processing further comprises determining, using the digital processing unit 558, for each element in the output of the matrix-vector multiplication operation, whether the output is smaller than or equal to zero; and setting, using the digital processing unit 558, in response to the output being smaller than or equal to zero, the output to zero (operation 912).
In another aspect, referring to
One or more embodiments can be used for a variety of practical applications; for example, once the weights are set, inferencing can be carried out using the kernel approximations. The inference could be, for example, any machine learning application such as recognizing one or more objects, controlling an industrial robot or steering an autonomous vehicle based on the recognition.
As noted above, in one example embodiment, using a standard personal computer (PC), a matrix is generated where the elements are drawn from a Gaussian distribution. Discussion of
Various aspects of the present disclosure are described by narrative text, flowcharts, block diagrams of computer systems and/or block diagrams of the machine logic included in computer program product (CPP) embodiments. With respect to any flowcharts, depending upon the technology involved, the operations can be performed in a different order than what is shown in a given flowchart. For example, again depending upon the technology involved, two operations shown in successive flowchart blocks may be performed in reverse order, as a single integrated step, concurrently, or in a manner at least partially overlapping in time.
A computer program product embodiment (“CPP embodiment” or “CPP”) is a term used in the present disclosure to describe any set of one, or more, storage media (also called “mediums”) collectively included in a set of one, or more, storage devices that collectively include machine readable code corresponding to instructions and/or data for performing computer operations specified in a given CPP claim. A “storage device” is any tangible device that can retain and store instructions for use by a computer processor. Without limitation, the computer readable storage medium may be an electronic storage medium, a magnetic storage medium, an optical storage medium, an electromagnetic storage medium, a semiconductor storage medium, a mechanical storage medium, or any suitable combination of the foregoing. Some known types of storage devices that include these mediums include: diskette, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), static random access memory (SRAM), compact disc read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanically encoded device (such as punch cards or pits/lands formed in a major surface of a disc) or any suitable combination of the foregoing. A computer readable storage medium, as that term is used in the present disclosure, is not to be construed as storage in the form of transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide, light pulses passing through a fiber optic cable, electrical signals communicated through a wire, and/or other transmission media. As will be understood by those of skill in the art, data is typically moved at some occasional points in time during normal operations of a storage device, such as during access, de-fragmentation or garbage collection, but this does not render the storage device as transitory because the data is not transitory while it is stored.
Refer now to
Computing environment 100 contains an example of an environment for the execution of at least some of the computer code involved in performing appropriate methods, as seen at 200. In addition to block 200, computing environment 100 includes, for example, computer 101, wide area network (WAN) 102, end user device (EUD) 103, remote server 104, public cloud 105, and private cloud 106. In this embodiment, computer 101 includes processor set 110 (including processing circuitry 120 and cache 121), communication fabric 111, volatile memory 112, persistent storage 113 (including operating system 122 and block 200, as identified above), peripheral device set 114 (including user interface (UI) device set 123, storage 124, and Internet of Things (IoT) sensor set 125), and network module 115. Remote server 104 includes remote database 130. Public cloud 105 includes gateway 140, cloud orchestration module 141, host physical machine set 142, virtual machine set 143, and container set 144.
COMPUTER 101 may take the form of a desktop computer, laptop computer, tablet computer, smart phone, smart watch or other wearable computer, mainframe computer, quantum computer or any other form of computer or mobile device now known or to be developed in the future that is capable of running a program, accessing a network or querying a database, such as remote database 130. As is well understood in the art of computer technology, and depending upon the technology, performance of a computer-implemented method may be distributed among multiple computers and/or between multiple locations. On the other hand, in this presentation of computing environment 100, detailed discussion is focused on a single computer, specifically computer 101, to keep the presentation as simple as possible. Computer 101 may be located in a cloud, even though it is not shown in a cloud in
PROCESSOR SET 110 includes one, or more, computer processors of any type now known or to be developed in the future. Processing circuitry 120 may be distributed over multiple packages, for example, multiple, coordinated integrated circuit chips. Processing circuitry 120 may implement multiple processor threads and/or multiple processor cores. Cache 121 is memory that is located in the processor chip package(s) and is typically used for data or code that should be available for rapid access by the threads or cores running on processor set 110. Cache memories are typically organized into multiple levels depending upon relative proximity to the processing circuitry. Alternatively, some, or all, of the cache for the processor set may be located “off chip.” In some computing environments, processor set 110 may be designed for working with qubits and performing quantum computing.
Computer readable program instructions are typically loaded onto computer 101 to cause a series of operational steps to be performed by processor set 110 of computer 101 and thereby effect a computer-implemented method, such that the instructions thus executed will instantiate the methods specified in flowcharts and/or narrative descriptions of computer-implemented methods included in this document (collectively referred to as “the inventive methods”). These computer readable program instructions are stored in various types of computer readable storage media, such as cache 121 and the other storage media discussed below. The program instructions, and associated data, are accessed by processor set 110 to control and direct performance of the inventive methods. In computing environment 100, at least some of the instructions for performing the inventive methods may be stored in block 200 in persistent storage 113.
Computer readable program instructions are typically loaded onto computer 101 to cause a series of operational steps to be performed by processor set 110 of computer 101 and thereby effect a computer-implemented method, such that the instructions thus executed will instantiate the methods specified in flowcharts and/or narrative descriptions of computer-implemented methods included in this document (collectively referred to as “the inventive methods”). These computer readable program instructions are stored in various types of computer readable storage media, such as cache 121 and the other storage media discussed below. The program instructions, and associated data, are accessed by processor set 110 to control and direct performance of the inventive methods. In computing environment 100, at least some of the instructions for performing the inventive methods may be stored in block 200 in persistent storage 113.
COMMUNICATION FABRIC 111 is the signal conduction path that allows the various components of computer 101 to communicate with each other. Typically, this fabric is made of switches and electrically conductive paths, such as the switches and electrically conductive paths that make up busses, bridges, physical input/output ports and the like. Other types of signal communication paths may be used, such as fiber optic communication paths and/or wireless communication paths.
VOLATILE MEMORY 112 is any type of volatile memory now known or to be developed in the future. Examples include dynamic type random access memory (RAM) or static type RAM. Typically, volatile memory 112 is characterized by random access, but this is not required unless affirmatively indicated. In computer 101, the volatile memory 112 is located in a single package and is internal to computer 101, but, alternatively or additionally, the volatile memory may be distributed over multiple packages and/or located externally with respect to computer 101.
PERSISTENT STORAGE 113 is any form of non-volatile storage for computers that is now known or to be developed in the future. The non-volatility of this storage means that the stored data is maintained regardless of whether power is being supplied to computer 101 and/or directly to persistent storage 113. Persistent storage 113 may be a read only memory (ROM), but typically at least a portion of the persistent storage allows writing of data, deletion of data and re-writing of data. Some familiar forms of persistent storage include magnetic disks and solid state storage devices. Operating system 122 may take several forms, such as various known proprietary operating systems or open source Portable Operating System Interface-type operating systems that employ a kernel. The code included in block 200 typically includes at least some of the computer code involved in performing the inventive methods.
PERIPHERAL DEVICE SET 114 includes the set of peripheral devices of computer 101. Data communication connections between the peripheral devices and the other components of computer 101 may be implemented in various ways, such as Bluetooth connections, Near-Field Communication (NFC) connections, connections made by cables (such as universal serial bus (USB) type cables), insertion-type connections (for example, secure digital (SD) card), connections made through local area communication networks and even connections made through wide area networks such as the internet. In various embodiments, UI device set 123 may include components such as a display screen, speaker, microphone, wearable devices (such as goggles and smart watches), keyboard, mouse, printer, touchpad, game controllers, and haptic devices. Storage 124 is external storage, such as an external hard drive, or insertable storage, such as an SD card. Storage 124 may be persistent and/or volatile. In some embodiments, storage 124 may take the form of a quantum computing storage device for storing data in the form of qubits. In embodiments where computer 101 is required to have a large amount of storage (for example, where computer 101 locally stores and manages a large database) then this storage may be provided by peripheral storage devices designed for storing very large amounts of data, such as a storage area network (SAN) that is shared by multiple, geographically distributed computers. IoT sensor set 125 is made up of sensors that can be used in Internet of Things applications. For example, one sensor may be a thermometer and another sensor may be a motion detector.
NETWORK MODULE 115 is the collection of computer software, hardware, and firmware that allows computer 101 to communicate with other computers through WAN 102. Network module 115 may include hardware, such as modems or Wi-Fi signal transceivers, software for packetizing and/or de-packetizing data for communication network transmission, and/or web browser software for communicating data over the internet. In some embodiments, network control functions and network forwarding functions of network module 115 are performed on the same physical hardware device. In other embodiments (for example, embodiments that utilize software-defined networking (SDN)), the control functions and the forwarding functions of network module 115 are performed on physically separate devices, such that the control functions manage several different network hardware devices. Computer readable program instructions for performing the inventive methods can typically be downloaded to computer 101 from an external computer or external storage device through a network adapter card or network interface included in network module 115.
WAN 102 is any wide area network (for example, the internet) capable of communicating computer data over non-local distances by any technology for communicating computer data, now known or to be developed in the future. In some embodiments, the WAN 102 may be replaced and/or supplemented by local area networks (LANs) designed to communicate data between devices located in a local area, such as a Wi-Fi network. The WAN and/or LANs typically include computer hardware such as copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and edge servers.
END USER DEVICE (EUD) 103 is any computer system that is used and controlled by an end user (for example, a customer of an enterprise that operates computer 101), and may take any of the forms discussed above in connection with computer 101. EUD 103 typically receives helpful and useful data from the operations of computer 101. For example, in a hypothetical case where computer 101 is designed to provide a recommendation to an end user, this recommendation would typically be communicated from network module 115 of computer 101 through WAN 102 to EUD 103. In this way, EUD 103 can display, or otherwise present, the recommendation to an end user. In some embodiments, EUD 103 may be a client device, such as thin client, heavy client, mainframe computer, desktop computer and so on.
REMOTE SERVER 104 is any computer system that serves at least some data and/or functionality to computer 101. Remote server 104 may be controlled and used by the same entity that operates computer 101. Remote server 104 represents the machine(s) that collect and store helpful and useful data for use by other computers, such as computer 101. For example, in a hypothetical case where computer 101 is designed and programmed to provide a recommendation based on historical data, then this historical data may be provided to computer 101 from remote database 130 of remote server 104.
PUBLIC CLOUD 105 is any computer system available for use by multiple entities that provides on-demand availability of computer system resources and/or other computer capabilities, especially data storage (cloud storage) and computing power, without direct active management by the user. Cloud computing typically leverages sharing of resources to achieve coherence and economies of scale. The direct and active management of the computing resources of public cloud 105 is performed by the computer hardware and/or software of cloud orchestration module 141. The computing resources provided by public cloud 105 are typically implemented by virtual computing environments that run on various computers making up the computers of host physical machine set 142, which is the universe of physical computers in and/or available to public cloud 105. The virtual computing environments (VCEs) typically take the form of virtual machines from virtual machine set 143 and/or containers from container set 144. It is understood that these VCEs may be stored as images and may be transferred among and between the various physical machine hosts, either as images or after instantiation of the VCE. Cloud orchestration module 141 manages the transfer and storage of images, deploys new instantiations of VCEs and manages active instantiations of VCE deployments. Gateway 140 is the collection of computer software, hardware, and firmware that allows public cloud 105 to communicate through WAN 102.
Some further explanation of virtualized computing environments (VCEs) will now be provided. VCEs can be stored as “images.” A new active instance of the VCE can be instantiated from the image. Two familiar types of VCEs are virtual machines and containers. A container is a VCE that uses operating-system-level virtualization. This refers to an operating system feature in which the kernel allows the existence of multiple isolated user-space instances, called containers. These isolated user-space instances typically behave as real computers from the point of view of programs running in them. A computer program running on an ordinary operating system can utilize all resources of that computer, such as connected devices, files and folders, network shares, CPU power, and quantifiable hardware capabilities. However, programs running inside a container can only use the contents of the container and devices assigned to the container, a feature which is known as containerization.
PRIVATE CLOUD 106 is similar to public cloud 105, except that the computing resources are only available for use by a single enterprise. While private cloud 106 is depicted as being in communication with WAN 102, in other embodiments a private cloud may be disconnected from the internet entirely and only accessible through a local/private network. A hybrid cloud is a composition of multiple clouds of different types (for example, private, community or public cloud types), often respectively implemented by different vendors. Each of the multiple clouds remains a separate and discrete entity, but the larger hybrid cloud architecture is bound together by standardized or proprietary technology that enables orchestration, management, and/or data/application portability between the multiple constituent clouds. In this embodiment, public cloud 105 and private cloud 106 are both part of a larger hybrid cloud.
One or more embodiments of the invention, or elements thereof, can thus be implemented in the form of an apparatus including a memory and at least one processor that is coupled to the memory and operative to perform exemplary method steps.
It should be noted that any of the methods described herein can include an additional step of providing a system comprising distinct software modules embodied on a computer readable storage medium; the modules can include, for example, any or all of the appropriate elements depicted in the block diagrams and/or described herein; by way of example and not limitation, any one, some or all of the modules/blocks and or sub-modules/sub-blocks described. The method steps can then be carried out using the distinct software modules and/or sub-modules of the system, as described above, executing on one or more hardware processors. Further, a computer program product can include a computer-readable storage medium with code adapted to be implemented to carry out one or more method steps described herein, including the provision of the system with the distinct software modules.
One example of user interface that could be employed in some cases is hypertext markup language (HTML) code served out by a server or the like, to a browser of a computing device of a user. The HTML is parsed by the browser on the user's computing device to create a graphical user interface (GUI).
The descriptions of the various embodiments of the present invention have been presented for purposes of illustration, but are not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the embodiments, the practical application or technical improvement over technologies found in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.