Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
EFFICIENT LOOK-UP TABLE BASED FUNCTIONS FOR ARTIFICIAL INTELLIGENCE (AI) ACCELERATOR
Document Type and Number:
WIPO Patent Application WO/2023/229602
Kind Code:
A1
Abstract:
A method for approximating an activation function, the method including: receiving an input value of the activation function; determining that the input value is within a range, the range includes a set of non-uniform intervals; determining a selected interval from among the set of non-uniform intervals including the input value; retrieving, by a hardware accelerator, from a look-up table (LUT) associated with a type of the activation function, values of one or more quadratic interpolation parameters associated with the selected interval; performing a quadratic interpolation on the input value to approximate the input value using the values of the one or more quadratic interpolation parameters; and determining a first approximated output of the activation function based on a result of the quadratic interpolation performed on the input value.

Inventors:
BOONSTRA JOHANNES (US)
Application Number:
PCT/US2022/031198
Publication Date:
November 30, 2023
Filing Date:
May 26, 2022
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
SYNOPSYS INC (US)
International Classes:
G06F17/17; G06N3/048; G06N3/063
Foreign References:
EP3961514A12022-03-02
Other References:
BRUGUERA J D ET AL: "High-Speed Function Approximation Using a Minimax Quadratic Interpolator", IEEE TRANSACTIONS ON COMPUTERS, IEEE, USA, vol. 54, no. 3, 31 March 2005 (2005-03-31), pages 304 - 318, XP011125910, ISSN: 0018-9340, DOI: 10.1109/TC.2005.52
Attorney, Agent or Firm:
CHAKRABARTI, Amrita (US)
Download PDF:
Claims:
THE CLAIMS

What is claimed is:

1. A method for approximating an activation function, the method comprising: receiving an input value of the activation function; determining that the input value is within a range, the range comprises a set of non-uniform intervals; determining a selected interval from among the set of non-uniform intervals comprising the input value; retrieving, by a hardware accelerator, from a look-up table (LUT) associated with a type of the activation function, values of one or more quadratic interpolation parameters associated with the selected interval; performing a quadratic interpolation on the input value to approximate the input value using the values of the one or more quadratic interpolation parameters; and determining a first approximated output of the activation function based on a result of the quadratic interpolation performed on the input value.

2. The method of claim 1 , wherein a Remez minimax algorithm is used to determine a non-uniform distribution of the set of non-uniform intervals.

3. The method of claims 1 or 2, wherein the determining the selected interval from the set of non-uniform intervals is based on one or more of most significant bits (MSB) of the input value and two’s complement encoded input value.

4. The method of claim 1 , wherein the LUT associated with the activation function comprises the values of the one or more quadratic interpolation parameters for each interval from among the set of non-uniform intervals.

5. The method of claims 1 or 4, wherein the hardware accelerator stores a plurality of LUTs comprising parameters associated with quadratic interpolation ranges of a plurality of activation functions.

6. The method of claim 5, wherein the plurality of LUTs are implemented as flip-flops in the hardware accelerator.

7. The method of claim 1 , further comprising: determining, by the hardware accelerator, that the input value is within one or more linear extrapolation ranges, the one or more linear extrapolation ranges do not overlap with the range; determining, by the hardware accelerator, offset values and slopes of the activation function for each of the one or more linear extrapolation ranges; performing, by the hardware accelerator, a linear extrapolation on the input value to approximate the input value using the offset values and the slopes of the activation function for each of the one or more linear extrapolation ranges; and determining, by the hardware accelerator, a second approximated output of the activation function based on a result of the linear extrapolation performed on the input value.

8. The method of claim 7, wherein the input value is shifted by power of two factors within a range of representable values in a fixed point representation of the second approximated output of the activation function.

9. A system for approximating an activation function, the system comprising: a bit shifter configured to receive an input value of the activation function and perform a shift operation on the input value to compute most significant bits (MSBs) of the input value; a first device configured to determine if the input value is within a range comprising a set of non-uniform intervals, and determine a selected interval from among the set of non-uniform intervals comprising the input value based on the MSBs of the input value; a second device configured to retrieve from a look-up table (LUT) associated with the activation function, values of one or more quadratic interpolation parameters associated with the selected interval; one or more multiply-accumulate-scale circuits configured to perform a quadratic interpolation on the input value to approximate the input value using the values of the one or more quadratic interpolation parameters, and to determine a first approximated output of the activation function based on a result of the quadratic interpolation performed on the input value.

10. The system of claim 9, wherein the system comprises a hardware accelerator and/or an electronic circuit configured by a hard macro intellectual property (IP).

11. The system of claim 10, wherein the hardware accelerator stores a plurality of LLITs comprising parameters associated with quadratic interpolation ranges of a plurality of activation functions.

12. The system of claim 11 , wherein the plurality of LLITs are implemented as flip-flops in the hardware accelerator.

13. The system of claim 9, wherein Remez minimax algorithm is used to determine non-uniform distribution of the set of non-uniform intervals.

14. The system of claims 9 or 13, wherein the determining the selected interval from among the set of non-uniform intervals is based on one or more of most significant bits (MSB) of the input value and two’s complement encoded input value.

15. The system of claim 9, wherein the LUT associated with the activation function comprises the values of the one or more quadratic interpolation parameters for each interval from among the set of non-uniform intervals.

16. The system of claim 9, further comprising: a third device configured to determine offset values and slopes of the activation function for each of one or more linear extrapolation ranges based on the first device determining that the input value is within the one or more linear extrapolation ranges, the one or more linear extrapolation ranges do not overlap with the range, wherein the one or more multiply-accumulate-scale circuits are further configured to perform a linear extrapolation on the input value to approximate the input value using the offset values and the slopes of the activation function for each of the one or more linear extrapolation ranges, and to determine a second approximated output of the activation function based on a result of the linear extrapolation performed on the input value.

17. The system of claim 16, wherein the input value is shifted by power of two factors within a range of representable values in a fixed point representation of the second approximated output of the activation function.

18. A non-transitory computer readable medium comprising stored representation of an accelerator circuit, which when synthesized by a processor, cause the processor to synthesize a structure of an electronic circuit configured to: receive an input value of an activation function; determine that the input value is within a range, the range comprises a set of non-uniform intervals; determine a selected interval from among the set of non-uniform intervals comprising the input value; retrieve from a look-up table (LUT) associated with the activation function, values of one or more quadratic interpolation parameters associated with the selected interval; perform a quadratic interpolation on the input value to approximate the input value using the values of the one or more quadratic interpolation parameters; and determine a first approximated output of the activation function based on a result of the quadratic interpolation performed on the input value.

19. The non-transitory computer readable medium of claim 18, wherein the input value is shifted by power of two factors within a range of representable values in a fixed point representation of the first approximated output of the activation function.

20. The non-transitory computer readable medium of claim 18, wherein the electronic circuit is further configured to: determine that the input value is within one or more linear extrapolation ranges, the one or more linear extrapolation ranges do not overlap with the range; determ ine offset values and slopes of the activation function for each of the one or more linear extrapolation ranges; perform a linear extrapolation on the input value to approximate the input value using the offset values and the slopes of the activation function for each of the one or more linear extrapolation ranges; and determine a second approximated output of the activation function based on a result of the linear extrapolation performed on the input value.

Description:
EFFICIENT LOOK-UP TABLE BASED FUNCTIONS FOR ARTIFICIAL INTELLIGENCE (Al) ACCELERATOR

Inventors:

Johannes (Joep) Boonstra

TECHNICAL FIELD

[0001] The present application generally relates to an artificial intelligence (Al) accelerator system. More particularly, the present disclosure relates to a system and method for providing an efficient look-up table based function for an Al accelerator.

BACKGROUND

[0002] An artificial intelligence (Al) and/or machine learning (ML) accelerator is a high-performance parallel computation machine that is specifically designed for the efficient processing of Al workloads like neural networks. Given that processing speed and scalability are two key demands from Al applications, Al accelerators (e.g., a neural network processing unit) play a critical role in delivering the near-instantaneous results that make these applications valuable.

[0003] The above information in the Background section is only for enhancement of understanding of the background of the technology and therefore it should not be construed as admission of existence or relevancy of the prior art.

SUMMARY

[0004] This summary is provided to introduce a selection of features and concepts of embodiments of the present disclosure that are further described below in the detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to be used in limiting the scope of the claimed subject matter. One or more of the described features may be combined with one or more other described features to provide a workable device.

[0005] In one or more embodiments, a method for approximating an activation function includes: receiving an input value of the activation function; determining that the input value is within a range, the range includes a set of non-uniform intervals; determining a selected interval from among the set of non-uniform intervals including the input value; retrieving, by a hardware accelerator, from a look-up table (LUT) associated with a type of the activation function, values of one or more quadratic interpolation parameters associated with the selected interval; performing a quadratic interpolation on the input value to approximate the input value using the values of the one or more quadratic interpolation parameters; and determining a first approximated output of the activation function based on a result of the quadratic interpolation performed on the input value.

[0006] In one or more embodiments, a Remez minimax algorithm is used to determine a non-uniform distribution of the set of non-uniform intervals. In one or more embodiments, the determining the selected interval from among the set of non-uniform intervals is based on one or more of most significant bits (MSB) of the input value and/ or two’s complement encoded input value. In one or more embodiments, the LUT associated with the activation function includes the values of the one or more quadratic interpolation parameters for each interval from among the set of non-uniform intervals. In one or more embodiments, the hardware accelerator stores a plurality of LLITs including parameters associated with quadratic interpolation ranges of a plurality of activation functions.

[0007] In one or more embodiments, the plurality of LLITs are implemented as flipflops in the hardware accelerator. In one or more embodiments, method further includes: determining, by the hardware accelerator, that the input value is within one or more linear extrapolation ranges, the one or more linear extrapolation ranges do not overlap with the range; determining, by the hardware accelerator, offset values and slopes of the activation function for each of the one or more linear extrapolation ranges; performing, by the hardware accelerator, a linear extrapolation on the input value to approximate the input value using the offset values and the slopes of the activation function for each of the one or more linear extrapolation ranges; and determining, by the hardware accelerator, a second approximated output of the activation function based on a result of the linear extrapolation performed on the input value. In one or more embodiments, the input value is shifted by power of two factors within a range of representable values in a fixed point representation of the second approximated output of the activation function.

[0008] In one or more embodiments, a system for approximating an activation function includes: a bit shifter configured to receive an input value of the activation function and perform a shift operation on the input value to compute most significant bits (MSBs) of the input value; a first device configured to determine if the input value is within a range including a set of non-uniform intervals, and determine a selected interval from among the set of non-uniform intervals including the input value based on the MSBs of the input value; a second device configured to retrieve from a look-up table (LUT) associated with the activation function, values of one or more quadratic interpolation parameters associated with the selected interval; one or more multiply- accumulate-scale circuits configured to perform a quadratic interpolation on the input value to approximate the input value using the values of the one or more quadratic interpolation parameters, and to determine a first approximated output of the activation function based on a result of the quadratic interpolation performed on the input value. [0009] In one or more embodiments, the system includes a hardware accelerator and/or an electronic circuit configured by a hard macro intellectual property (IP). In one or more embodiments, the hardware accelerator stores a plurality of LLITs including parameters associated with quadratic interpolation ranges of a plurality of activation functions. In one or more embodiments, the plurality of LLITs are implemented as flip-flops in the hardware accelerator. In one or more embodiments, Remez minimax algorithm is used to determine non-uniform distribution of the set of non-uniform intervals.

[0010] In one or more embodiments, the determining the selected interval from set of non-uniform intervals is based on one or more of most significant bits (MSB) of the input value and two’s complement encoded input value. In one or more embodiments, the LUT associated with the activation function includes the values of the one or more quadratic interpolation parameters for each interval from among the set of non-uniform intervals.

[0011] In one or more embodiments, the system further includes: a third device configured to determine offset values and slopes of the activation function for each of one or more linear extrapolation ranges based on the first device determining that the input value is within the one or more linear extrapolation ranges, the one or more linear extrapolation ranges do not overlap with the range, wherein the one or more multiply- accumulate-scale circuits are further configured to perform a linear extrapolation on the input value to approximate the input value using the offset values and the slopes of the activation function for each of the one or more linear extrapolation ranges, and to determine a second approximated output of the activation function based on a result of the linear extrapolation performed on the input value. In one or more embodiments, the input value is shifted by power of two factors within a range of representable values in a fixed point representation of the second approximated output of the activation function.

[0012] In one or more embodiments, a non-transitory computer readable medium including stored representation of an accelerator circuit, which when synthesized by a processor, cause the processor to synthesize a structure of an electronic circuit configured to: receive an input value of an activation function; determine that the input value is within a range, the range includes a set of non-uniform intervals; determine a selected interval from among the set of non-uniform intervals including the input value; retrieve from a look-up table (LUT) associated with the activation function, values of one or more quadratic interpolation parameters associated with the selected interval; perform a quadratic interpolation on the input value to approximate the input value using the values of the one or more quadratic interpolation parameters; and determine a first approximated output of the activation function based on a result of the quadratic interpolation performed on the input value.

[0013] In one or more embodiments, the input value is shifted by power of two factors within a range of representable values in a fixed point representation of the first approximated output of the activation function. In one or more embodiments, the electronic circuit is further configured to: determine that the input value is within one or more linear extrapolation ranges, the one or more linear extrapolation ranges do not overlap with the range; determine offset values and slopes of the activation function for each of the one or more linear extrapolation ranges; perform a linear extrapolation on the input value to approximate the input value using the offset values and the slopes of the activation function for each of the one or more linear extrapolation ranges; and determine a second approximated output of the activation function based on a result of the linear extrapolation performed on the input value.

BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The disclosure will be understood more fully from the detailed description given below and from the accompanying figures of embodiments of the disclosure. The figures are used to provide knowledge and understanding of embodiments of the disclosure and do not limit the scope of the disclosure to these specific embodiments. Furthermore, the figures are not necessarily drawn to scale.

[0015] FIG. 1 illustrates different non-linear activation functions used in Al or ML.

[0016] FIG. 2 illustrates a piece-wise approximation method of activation functions for an Al accelerator according to one embodiment of the disclosure.

[0017] FIGS. 3A-3B illustrate an Al accelerator or an IP core to perform the present piece-wise approximation method discussed with respect to FIG. 2 according to one embodiment of the disclosure. For example, FIGS. 3A-3B illustrate a function in an Al accelerator (e.g., a neural network processing unit) to perform the present piece-wise approximation method discussed with respect to FIG. 2.

[0018] FIGS. 4-6 illustrate example applications of the piece-wise approximation method discussed with respect to FIG. 2 according to some embodiments of the disclosure.

[0019] FIG. 7 depicts a flowchart of various processes used during the design and manufacture of an integrated circuit in accordance with some embodiments of the present disclosure. [0020] FIG. 8 depicts a diagram of an example computer system in which embodiments of the present disclosure may operate. For example, one or more embodiments, the process of FIG. 7 may be performed in a neural network processing unit of FIG. 8 and the neural network processing unit of FIG. 8 includes the Al accelerator of FIGS. 3A-3B.

DETAILED DESCRIPTION

[0021] Aspects of the present disclosure relate to a system and method for providing efficient look-up table based functions for an artificial intelligence (Al) accelerator.

[0022] An artificial intelligence (Al) and/or machine learning (ML) accelerator (e.g., a neural network processing unit) is a high-performance parallel computation machine that is specifically designed for the efficient processing of Al workloads like neural networks. Given that processing speed and scalability are two key demands from Al applications, Al accelerators play a critical role in delivering the near-instantaneous results that make these applications valuable. Al accelerators can be 100-1 ,000 times more efficient than general-purpose compute machines. Because of the high speed in computing data that Al accelerators offer, Al accelerators lower the latency of the time that it takes to come up with an answer. This low latency is especially important in safety-critical applications like advanced driver assistance systems (ADAS), where every second counts. Al accelerators make it possible to achieve a level of performance speed enhancement that can be almost equal to the number of cores involved. The heterogeneous architecture of the Al accelerator accommodates multiple specialized processors to support specific tasks, providing the computational performance that Al applications demand.

[0023] There are currently two distinct Al accelerator spaces, namely, the data center and the edge. Data centers, particularly hyperscale data centers, require massively scalable compute architectures. By delivering more compute, memory, and communication bandwidth, an Al accelerator in data centers can support Al research at dramatically faster speeds and scalability compared with other architectures. The edge represents the other end of the spectrum. Here, energy efficiency is the key and the real estate is limited, as the intelligence is distributed at the edge of the network rather than a more centralized location. Al accelerator intellectual property (IP) is integrated into edge system-on-chip (SoC) devices which, no matter how small, deliver the near-instantaneous results needed for, e.g., interactive programs that run on smartphones or for industrial robotics. [0024] State-of-the-art artificial intelligence (Al) and/or machine learning (ML) applications rely on various types of non-linear activation functions (e.g., ReLU, Sigmoid, Tanh, Swish, and the like). In a neural network, an activation function may be configured to determine if a neuron of the neural network should be activated. For example, the activation function of a neural network may determine whether the neuron’s input to the neural network is required for an operation by the neural network. For example, the activation function may derive output from a set of input values fed to a node (or a layer) of a neural network. In some cases, these non-linear activation functions exhibit non-linear behavior in a limited range and linear behavior outside the limited range. For example, for input values less than -8, the tanh function returns (e.g., possibly quantized) values close to -1 , and for input values greater than +8, the tanh function returns (e.g., possibly quantized) values close to +1 . However, for input values in the range [-8,8], the tanh function exhibits non-linear behavior, which is strongest around 0. Therefore, tanh may be linear for input values less than -8 and input values more than +8, however, for the limited range of input values between [- 8,8], tanh may be non-linear.

[0025] For example, FIG. 1 illustrates different types of non-linear activation functions (e.g., Mish, Tanh, ReLU, Sigmoid, Leaky ReLU, SoftPlus, Bent Identity, and Swish) used in Al or ML that exhibit non-linear behavior in a limited range and linear behavior outside the limited range. The linear and non-linear portions of the activation functions (e.g., Mish, Tanh, ReLU, Sigmoid, Leaky ReLU, SoftPlus, Bent Identity, and Swish) are also identified in FIG. 1. As shown in FIG. 1 , the non-linear activation functions (e.g., Mish, Tanh, ReLU, Sigmoid, Leaky ReLU, SoftPlus, Bent Identity, and Swish) shown in FIG. 1 exhibit non-linear behavior for a limited range and the nonlinear behavior of the activation functions may be strongest around 0 crossing. However, the non-linear activation functions (e.g., Mish, Tanh, ReLU, Sigmoid, Leaky ReLU, SoftPlus, Bent Identity, and Swish) shown in FIG. 1 exhibit linear behavior towards negative infinity and positive infinity outside the limited range where they exhibit non-linear behavior.

[0026] The set of activation functions in Al is not limited to the set depicted in FIG. 1 and will be growing over time. All these activation function approximate a linear function for large negative values and positive values, as illustrated by the left and right ellipses in FIG. 1 . For example, tanh(x) will converge to +1 for large positive input values and -1 for negative input values towards negative infinity ; the swish(x) function will converge to a*x (e.g., “x” is an input and “a” is a constant (e.g., a real number or a complex number)) for large positive values and 0 for negative input values towards - infinity. However, around input value 0 (or some other input value) these functions exhibit non-linear behavior, as depicted by the middle ellipse in the diagram. Nonlinearity of these functions may be stronger in some intervals than in other intervals.

[0027] The Al and/or ML interference hardware accelerators require efficient approximation of non-linear activation functions that exhibit non-linear behavior in a limited range and linear behavior outside the limited range, to save silicon area, while maintaining high accuracy and operating frequency. In Al and/or ML applications, an Al accelerator may use different activation functions based on the application. The activation functions used in Al or ML applications may be differentiable activation functions to enable gradient descent training approaches for computing the parameters of the Al or ML models based on training data. Flexibility in the Al accelerator architecture may be required to make use of new activation functions that emerge over time. Differentiable activation functions may also make possible to have high throughput in Al accelerators (e.g., because gradient descent is easier to perform when using differentiable activation functions).

[0028] One or more embodiments of the present disclosure use a combination of reprogrammable, non-uniform piece-wise quadratic and linear approximation to approximate activation functions for AI/ML applications. In other words, one or more embodiments of the present disclosure describe a piece-wise approximation method of the activation functions for AI/ML. In the present approximation method, quadratic interpolation is used to approximate the region or the interval (e.g., a non-linear interval) of the activation function that exhibit non-linear behavior, linear extrapolation is used for input values less than the smallest interval boundary and for input values greater than the largest interval boundary.

[0029] In the present approximation method, the quadratic interpolation is used along with a look-up table (LUT) for fast and efficient calculation. In order to perform the quadratic interpolation to approximate the non-linear region of the activation function, the non-linear interval of the activation function is divided into non-uniform intervals to ensure limited look-up table sizes and efficient software and hardware implementation, as LUT may store the interpolation coefficient values for each of the limit values of the non-uniform intervals.

[0030] In one or more embodiments of the present disclosure, the piece-wise approximation technique may be implemented in a semiconductor intellectual property core (SIP core) or an IP core or in hardware as a hard macro IP or netlist IP, where intervals and interpolation coefficients for the quadratic interpolation may be stored in a lookup table (LUT), where the LUT may store intervals and interpolation coefficients corresponding to multiple different functions, and may also be reprogrammed to support multiple additional functions while sharing a single hardware implementation. In such a case, high accuracy is achieved for quantized inputs and outputs, and reprogrammable tables may be complemented by commonly used tables fixed in hardware of the IP core or hard macro IP or netlist IP. For example, an Al accelerator may be configured with the IP core or hard macro IP incorporating the present piece- wise approximation technique to approximate non-linear region of the activation functions for Al and/or ML.

[0031] In one or more embodiments, the piece-wise approximation method of the present disclosure may offer an efficient solution to the traditional approximation methods of the activation functions used in AI/ML by reducing the amount of calculation required in traditional approximation methods by performing quadratic interpolation in the region or the interval of the activation function that exhibit nonlinear behavior, and using linear extrapolation elsewhere.

[0032] The piece-wise approximation method of the present disclosure may be implemented in hardware as a hard macro IP or netlist IP (e.g., in edge inference engines), and may occupy a small silicon area and offer high throughput. The LLITs that are used for quadratic interpolation in the piece-wise approximation method of the present disclosure are small in size and therefore may be implemented as flip-flops, enabling single instruction, multiple data (SIMD) execution of the activation function computation. The implementation of the piece-wise approximation method of the present disclosure may be flexible because the LLITs may be reprogrammable using software. Further, if required by the activation function, continuity of the first order derivative can be guaranteed by using piece-wise quadratic interpolation, so, gradient decent training of the AI/ML may be possible. Also, the non-uniform distribution of interpolation intervals that is used in the present piece-wise approximation method may ensure a high accuracy of the activation function output. Moreover, the piece- wise approximation method of the present disclosure may be used to approximate functions other than activation functions of a neural network.

[0033] FIG. 2 illustrates a piece-wise approximation method of activation functions of neural network for an Al accelerator, according to one embodiment of the disclosure. [0034] In the method of FIG. 2, at 210, an input value x is received.

[0035] Next at 215, an Al accelerator (e.g., a hardware accelerator) or a hard macro IP (e.g., an electronic circuit configured by a hard macro (IP)) incorporating the present piece-wise approximation method 200 may determine if the input value x is within a quadratic interpolation range. In other words, at 215, an Al accelerator or a hard macro IP incorporating the present piece-wise approximation method 200 may determine if the input value x is within the boundaries of a set of intervals I during which the activation function exhibits non-linear behavior. [0036] For example, if it is assumed that there is the set of intervals I and a set of associated limit values L :{lo, h, IN}, for an input x of the activation function, quadratic interpolation will be performed in an interval i if:

[0037] 3 i, i e 1 1 h < x < li+i (1 )

[0038] In other words, the quadratic interpolation is performed to approximate the input x using the parameters of interval i if the input value x is within the boundaries of the set of intervals I, exclusive the right boundary (e.g., Io x < IN-I) (for example, for each non-uniform interval, the right boundary is included in the next interval, however, an input value cannot be included in two intervals). Otherwise, linear interpolation is performed to approximate the input x (e.g., for x < Io and for x > IN-I).

[0039] In one or more embodiments, the set of intervals I may be the intervals during which the activation function exhibits non-linear behavior. In one or more embodiments, it may be assumed that the set of intervals I incorporates a set of non- uniform intervals, where i represents an interval in the set of intervals I.

[0040] In one or more embodiments, in order to determine the set of intervals I, the linear and non-linear regions of the activation function may be identified and associated limit values for linear and non-linear regions of the activation function are defined.

[0041] If at 215, it is determined that the input value x is within the boundaries of the set of intervals I, exclusive the right boundary, at 220, the Al accelerator or the hard macro IP may determine the interval i from among the set of intervals I that includes the value of the input x.

[0042] For an interval i in the set of intervals I, quadratic interpolation of input x is based on the expression:

[0043] y = ai + bi x + d x 2 (2)

[0044] In other words, quadratic interpolation in interval i is characterized by the parameters ai, bi, Ci.

[0045] Next, at 225, the value of the parameters ai, bi, Ci associated with the interval i that includes the input x (or input key x) are retrieved from a LUT associated with the input activation function (e.g., a LUT associated with a type of the input activation function). The LUT associated with the type of input activation function incorporates the value of the parameters ai, bi, Ci for each interval i in the set of intervals I. In the LUT, i may also indicate the index of the LUT, e.g., i = lookup (x). The LUT associated with the activation function may be stored in the Al accelerator or a hard macro IP.

[0046] In one or more embodiments, one or more memory devices in the Al accelerator or the hard macro IP may store a plurality of LUTs including the coefficients for quadratic interpolation for the non-linear regions of the different activation functions. In one or more embodiments, a plurality of LUTs including the coefficients for quadratic interpolation for the non-linear regions of the different activation functions may be determined (e.g., manually by human analysis of the functions or by a processor) and stored in the LUT before the activation function is approximated. The values stored in the LUT may be fixed (e.g., hardcoded in the hard macro) or the macro may define a programmable LUT so that a user can later on program the LUT with limits and coefficients for approximating other functions.

[0047] In order to determine the LUT, the interval during which the activation function exhibits non-linear behavior (e.g., the set of intervals I) is divided into non- uniform intervals. For example, the set of intervals I incorporates a set of non-uniform intervals, where i represents an interval in the set of intervals I. Using non-uniform distribution of interpolation intervals ensures a uniform accuracy of the activation function output. For example, in one or more embodiments, Remez minimax algorithm may be used to determine non-uniform distribution of interpolation intervals to minimize approximation error and improve accuracy.

[0048] In one or more embodiments, the non-uniform distribution of the intervals may be based on the most significant bits (MSB) of the input quantized, e.g., twos- complement encoded input value. For example, the 6 most significant input bits can be used to define the boundaries of 16 non-uniform intervals. In one or more embodiments, each interval is characterized by a left and right limit. An approximation using N intervals requires the definition of N+1 limit values.

[0049] One or more embodiments of the present disclosure describe performing quadratic interpolation only within the non-linear region of the activation function to limit the LUT size. Limited size of the LUT may allow high-speed hardware implementation of the present piece-wise approximation technique, for example, using SIMD, limit the silicon area for storing the LUT, and lower overhead of software reconfiguring tables. Use of quadratic interpolation may also ensure that the resulting approximation is differentiable, which helps in gradient-decent training approaches in AI/ML.

[0050] Therefore, quadratic interpolation is performed on the input x using equation (2).

[0051] To reduce the approximation error in an interpolation range I, a minimax algorithm, like Remez may be used to approximate the function as represented in equation (2) using second-order Chebyshev polynomials.

[0052] The expression of equation (2) can be rewritten relative to the start of the interpolation interval oi:

[0053] y = as' + bi' (x-Oi) + a (x-Oi) 2 (3)

[0054] The rewritten form of equation (2) which is represented in equation (3) may reduce the number of bits in the multiplications in quantized applications. In one or more embodiments, Oi is the left side (e.g., the left boundary) of the interval an interval i in which the quadratic interpolation is performed.

[0055] In one or more embodiments, bi' = bi+2*Ci*Oi ; and a = ai+bi*Oi+Ci* Oi 2

[0056] The equation (3) may be rewritten as a Horner’s series to improve accuracy: [0057] y = as' + (bi' + a (x-Oi)) (x-Oi) (4)

[0058] If it is assumed that d = (x-Oi), equation (4) may be rewritten as:

[0059] y = ai' + (bi' + a d) d (5)

[0060] Quantized version of the above equation (5) may include shift operations, represented by power of two factors within a range of the representable values in a fixed point representation of the approximated output of the activation function (e.g., to ensure the intermediate and final values do not overflow and are of the desired quantization). For example, the input x and the output y are shifted by power of two factors to ensure the intermediate and final values do not overflow and are of the desired quantization. These powers of two (m and mi) may be quantization interval dependent and may be determined by a quantization process. Considering the shift operations represented by the powers of two factors (m and mi), equation (5) may be rewritten as:

[0061] y = ai' + (bi' + a d 2 ni ) d 2 mi (6)

[0062] In equation (1 ) to equation (6), the quadratic interpolation ranges (e.g., the set of intervals I), may be characterized by: 1 ) 1+1 interval limit values (Oi), specifying the left and right boundaries of each of the interpolation intervals, 2) I offset values (ai), 3) I 1 st order derivative values (bi), 4) I 2nd order derivative values (cs), 5) optionally I 1 st order shift values to (mi), and 6) optionally I 2nd order shift values to (ns).

[0063] Next, at 230, quadratic interpolation is performed on the input x using equation (6).

[0064] If at 215, it is determined that the input value x is outside the quadratic interpolation ranges (e.g., the set of intervals I), for example, if the input value x is in the range [-°°, Io) or [IN, °°], at 235, offset values a m in and a ma x for the ranges [-°°, Io) and [IN, °°], and the gradient or slopes bmin and bmax of the activation function for the ranges [-°°, Io) and [IN, °°], respectively, may be determined.

[0065] Next, at 240, linear extrapolation may be performed on the input x to approximate the input x, using the equations:

[0066] y — amin + bmin X (7)

[0067] y — 3max + bmax X (8)

[0068] In equations (7) and (8), min and max represent the left and right ranges. For example, equation (7) may be used to approximate x, if x is between [-°°, Io), and equation (8) may be used to approximate x, if x is between [IN, °°]. In one or more embodiments, assuming min coincides with the left of the left most quadratic interpolation interval (e.g., io) and max coincides with the right of the right most quadratic interpolation intervals (e.g., IN), the equations (7) and (8) can be rewritten as:

[0069] bmin ' (x-oo) (9)

[0070] bmax' (x-oi) (10)

[0071] Here, oo is the left limit of the left most quadratic interpolation interval (e.g., io) and oi is the right limit of the right most quadratic interpolation interval (e.g., i i).

[0072] The quantized version of the above equations may be represented as:

[0075] Quantized version of the above equations (11 ) and (12) may include shift operations (e.g. nmin, n m ax), represented by power of two factors to ensure the intermediate and final values do not overflow and are of the desired quantization. The left and right linear extrapolation ranges may be characterized by: 1 ) the left offset values (amin) and 1st order derivative (bmin), 2) the right offset values (amax) and 1 st order derivative (bmax), 3) optionally the left shift value to (nmin), and 4) optionally the right shift value to (n max).

[0076] In one or more embodiments, amin and amax may represent the offset values for the ranges [-°°, Io) and [IN, °°] of the input x, respectively and bmin and bmax may represent the gradient or slopes of the activation function for the ranges [-°°, Io) and [IN, °°].

[0077] At 245, the approximated output y of the activation function is determined by performing the quadratic interpolation on the input x using equation (6) or linear extrapolation on the input x using the equations (11 ) and (12). In one or more embodiments, the input x and the output y are shifted by power of two factors to ensure the intermediate and final values do not overflow and are of the desired quantization. [0078] FIGS. 3A-3B illustrate an Al accelerator or an IP core to perform the present piece-wise approximation method discussed with respect to FIG. 2. For example, FIGS. 3A-3B illustrate a function in an Al accelerator (e.g., a neural network processing unit) to perform the present piece-wise approximation method discussed with respect to FIG. 2.

[0079] For example, the Al accelerator or IP core 300 includes a bit shifter 310, a device 315 for identifying the interval where the input value belongs, a device 325 for determining the slope of the input activation function in certain intervals for linear interpolation, a device 320 for storing the LLITs associated with one or more activation functions, a multiplexer 330, and two multiply-accumulate-scale devices 335 and 340. It is appreciated that the devices 315, 325, and 320 may be combined together in various combinations, without deviating from the scope of the present disclosure. [0080] In the Al accelerator or IP core 300 of FIG. 3, when an input x is received, a bit shifting operation is performed on the input x. As discussed with respect to FIG. 2, the shift operation may be performed to ensure the intermediate and final values do not overflow and are of the desired quantization. The shift operation may be represented by power of two factors as shown in equation (6). These powers of two (m and mi in equation (6)) may be quantization interval dependent.

[0081] The device 315 may determine if the input value x is within the boundaries of the set of intervals I, exclusive the right boundary, as discussed with respect to equation (1 ). The set of intervals I may be the intervals during which the activation function exhibits non-linear behavior. In one or more embodiments, it may be assumed that the set of intervals I incorporates a set of non-uniform intervals, where i represents an interval in the set of intervals. In one or more embodiments, a subset of the MSBs of the input x is inputted to the device 315 because the non-uniform distribution of the intervals may be based on the most significant bits of the input quantized (e.g., x_msb), twos-complement encoded input value. For example, the 6 most significant input bits can be used to define the boundaries of 16 non-uniform intervals.

[0082] If the module 315 determines that the input x is within the boundaries of the set of intervals I, quadratic interpolation is performed to approximate the input x using the parameters of interval i that represents an interval in the set of intervals I.

[0083] The device 315 also determines the interval i from among the set of intervals I that includes the value of the input x.

[0084] Next, from device 320, the value of the parameters ai, bi, d associated with the interval i that includes the input x (or input key x) are retrieved from a LUT to perform quadratic interpolation of input x based on equation (2) or equation (6). The LUT associated with the activation function may be stored in the device 320 or in another memory or storage unit of the Al accelerator or hard macro IP 300.

[0085] Once the parameters ai, bi, Ci for performing quadratic interpolation of the input x are retrieved from the LUT, the multiplexer 330 may select the input of the multiplexer 330 that is connected to the output of the module 320 (e.g., when the quadratic interpolation is performed, there may not be any output from the module 325). The multiplexer 330 outputs the parameters ai, bi, Ci from the module 320 and the multiply-accumulate-scale modules 335 and 340 performs quadratic interpolation of the input x based on the equations (5) and (6). For example, in one or more embodiments, the multiply-accumulate-scale module 335 may perform the operation (bi' + Cid) as shown in equation (5) and the multiply-accumulate-scale module 340 may determine the value of the output y by multiplying the output from the multiply- accumulate-scale module 335 with “d” and then adding the result with the value of the parameter ai.

[0086] In one or more embodiments, the output y may be shifted (e.g., see equation (6)) to ensure the intermediate and final values do not overflow and are of the desired quantization.

[0087] However, if the module 315 determines that the input x is not within the boundaries of the set of intervals I, for example, if the input value x is outside the quadratic interpolation ranges, i.e., x is in the ranges [-°°, Io) and [IN, °°], linear extrapolation is used to approximate the input x, using the equations (7) and (8).

[0088] In such a case, the device 325 determines the offset values amin and amax for the ranges [-°°, Io) and [IN+I , °°] of the input x, respectively, and the gradient or slopes bmin and bmax of the activation function for the ranges [-°°, Io) and [IN+I , °°], respectively.

[0089] Once the parameters amin or amax and bmin or bmax are determined, the multiplexer 330 outputs the parameters amin or amax and bmin Or bmax and the multiply- accumulate-scale modules 335 and 340 perform linear interpolation of the input x based on the equations (9) and (10). For example, in one or more embodiments, the multiply-accumulate-scale module 335 may perform the operation (bmin' (x-oo)) as shown in equation (9) or the operation (bmax' (x-oi)) as shown in equation (10), and the multiply-accumulate-scale module 340 may determine the value of the output y by adding the output from the multiply-accumulate-scale module 335 with “amin'” or “amax'”. [0090] In one or more embodiments, the output y may be shifted (e.g., see equations (11 ) and (12)) to ensure the intermediate and final values do not overflow and are of the desired quantization.

[0091] FIG. 3B includes all the components of FIG. 3A, except the second multiply- accumulate-scale module 340. In FIG. 3B, the multiply-accumulate-scale module 335 performs all the calculations that were performed by the multiply-accumulate-scale modules 335 and 340 in FIG 3A, for example, in two stages. For example, in the system of FIG. 3B, during the first round of calculation, the multiply-accumulate-scale module 335 may perform the calculations that were performed by the multiply- accumulate-scale module 335 of FIG. 3A. The output of the first round of calculations performed by the multiply-accumulate-scale module 335 are feed back to the multiply- accumulate-scale module 335 via the demultiplexer 345, and during the second round of operations, the multiply-accumulate-scale module 335 may perform the calculations that were performed by the multiply-accumulate-scale module 340 of FIG. 3A.

[0092] In other words, instead of having two multiply-accumulate-scale modules 335 and 340, as shown in FIG. 3A, only one of the multiply-accumulate-scale modules 335 and 340 may be re-used to perform all the calculation for approximation of the input x. For example, in the embodiment of FIG. 3B, after performing the first multiply- accumulate-scale operations by the multiply-accumulate-scale module 335, a first result is fed back to the multiply-accumulate-scale module 335 as input, via the demultiplexer 345. Then, a second multiply-accumulate-scale operation is performed by the module 335 based on the first result and the result of the second multiply- accumulate-scale operation may output as a second result via the demultiplexer 345, which may be the final result of the approximation of input x. In one or more embodiments, the demultiplexer 345 may select a first output port that is connected to the input of the multiply-accumulate-scale module 335, to output the first result, and the demultiplexer 345 may select a second output port that is connected to the input of the multiply-accumulate-scale module 335, to output the second result or the final result of the approximation of input x.

[0093] For example, in FIG. 4, quadratic interpolation is used to approximate the activation function tanh during the interval [-8, 8) (where tanh exhibits non-linear behavior) using the method discussed with respect to FIG. 2. For example, the interval [-8, 8) may be divided into a plurality of non-uniform intervals (e.g., the set of intervals I) and the input x may be approximated using a LUT incorporating the values of the parameters for each interval i of the set of intervals I using the equations (1 ) to (6). However, linear extrapolation is used to approximate the activation function tanh for the intervals [-°°, -8) and [8, °°] using the equations (7) to (12). In this case, the value of amin' is -1 and the value of amax' is +1 . However, the values of both bmin' and bmax' may be zero.

[0094] For example, in FIG. 5, quadratic interpolation is used to approximate the activation function sigmoid during the interval [-16, 16) (where sigmoid exhibits nonlinear behavior) using the method discussed with respect to FIG. 2. For example, the interval [-16, 16) may be divided into a plurality of non-uniform intervals (e.g., the set of intervals I) and the input x may be approximated using a LUT incorporating the values of the parameters for each interval i of the set of intervals I using the equations (1 ) to (6). However, linear extrapolation is used to approximate the activation function sigmoid for the intervals [-°°, -16) and [16, °°] using the equations (7) to (12). In this case, the value of amin' is -1 and the value of amax' is +1 . However, the values of both bmin' and bmax' may be zero.

[0095] For example, in FIG. 6, quadratic interpolation is used to approximate the activation function swish during the interval [-5, 3) (where swish exhibits non-linear behavior) using the method discussed with respect to FIG. 2. For example, the interval [-5, 3) may be divided into a plurality of non-uniform intervals (e.g., the set of intervals I) and the input x may be approximated using a LUT incorporating the values of the parameters for each interval i of the set of intervals I using the equations (1 ) to (6). However, linear extrapolation is used to approximate the activation function swish for the intervals [-°°, -5) and [3, °°] using the equations (7) to (12). In this case, the value of amin' is 0, the value of amax' is 0, and the value of bmin' is also 0. However, the value of bmax' is variable in the interval [3, °°],

[0096] One or more embodiments of the present disclosure describe a piece-wise approximation method of the activation functions for AI/ML. In the approximation method of the present disclosure, quadratic interpolation is used to approximate the region or the interval (e.g., a non-linear interval) of the activation function that exhibit non-linear behavior, linear extrapolation is used for input values less than the smallest interval boundary and for input values greater than the largest interval boundary. In the approximation method of the present disclosure, the quadratic interpolation is used along with a look-up table (LUT) for fast and efficient calculation. In order to perform the quadratic interpolation to approximate the non-linear region of the activation function, the non-linear interval of the activation function is divided into non-uniform intervals to ensure limited look-up table sizes and efficient software and hardware implementation, as LUT may store the interpolation coefficient values for each of the limit values of the non-uniform intervals.

[0097] FIG. 7 illustrates an example set of processes 700 used during the design, verification, and fabrication of an article of manufacture such as an integrated circuit to transform and verify design data and instructions that represent the integrated circuit. Each of these processes can be structured and enabled as multiple modules or operations. The term ‘EDA’ signifies the term ‘Electronic Design Automation.’ These processes start with the creation of a product idea 710 with information supplied by a designer, information which is transformed to create an article of manufacture that uses a set of EDA processes 712. When the design is finalized, the design is taped- out 734, which is when artwork (e.g., geometric patterns) for the integrated circuit is sent to a fabrication facility to manufacture the mask set, which is then used to manufacture the integrated circuit. After tape-out, a semiconductor die is fabricated 736 and packaging and assembly processes 738 are performed to produce the finished integrated circuit 740.

[0098] Specifications for a circuit or electronic structure may range from low-level transistor material layouts to high-level description languages. A high-level of representation may be used to design circuits and systems, using a hardware description language (‘HDL’) such as VHDL, Verilog, SystemVerilog, SystemC, MyHDL or OpenVera. The HDL description can be transformed to a logic-level register transfer level (‘RTL’) description, a gate-level description, a layout-level description, or a mask-level description. Each lower representation level that is a more detailed description adds more useful detail into the design description, for example, more details for the modules that include the description. The lower levels of representation that are more detailed descriptions can be generated by a computer, derived from a design library, or created by another design automation process. An example of a specification language at a lower level of representation language for specifying more detailed descriptions is SPICE, which is used for detailed descriptions of circuits with many analog components. Descriptions at each level of representation are enabled for use by the corresponding systems of that layer (e.g., a formal verification system). A design process may use a sequence depicted in Fig. 7. The processes described by be enabled by EDA products (or EDA systems).

[0099] During system design 714, functionality of an integrated circuit to be manufactured is specified. The design may be optimized for desired characteristics such as power consumption, performance, area (physical and/or lines of code), and reduction of costs, etc. Partitioning of the design into different types of modules or components can occur at this stage.

[0100] During logic design and functional verification 716, modules or components in the circuit are specified in one or more description languages and the specification is checked for functional accuracy. For example, the components of the circuit may be verified to generate outputs that match the requirements of the specification of the circuit or system being designed. Functional verification may use simulators and other programs such as testbench generators, static HDL checkers, and formal verifiers. In some embodiments, special systems of components referred to as ‘emulators’ or ‘prototyping systems’ are used to speed up the functional verification.

[0101] During synthesis and design for test 718, HDL code is transformed to a netlist. In some embodiments, a netlist may be a graph structure where edges of the graph structure represent components of a circuit and where the nodes of the graph structure represent how the components are interconnected. Both the HDL code and the netlist are hierarchical articles of manufacture that can be used by an EDA product to verify that the integrated circuit, when manufactured, performs according to the specified design. The netlist can be optimized for a target semiconductor manufacturing technology. Additionally, the finished integrated circuit may be tested to verify that the integrated circuit satisfies the requirements of the specification.

[0102] During netlist verification 720, the netlist is checked for compliance with timing constraints and for correspondence with the HDL code. During design planning 722, an overall floor plan for the integrated circuit is constructed and analyzed for timing and top-level routing.

[0103] During layout or physical implementation 724, physical placement (positioning of circuit components such as transistors or capacitors) and routing (connection of the circuit components by multiple conductors) occurs, and the selection of cells from a library to enable specific logic functions can be performed. As used herein, the term ‘cell’ may specify a set of transistors, other components, and interconnections that provides a Boolean logic function (e.g., AND, OR, NOT, XOR) or a storage function (such as a flipflop or latch). As used herein, a circuit ‘block’ may refer to two or more cells. Both a cell and a circuit block can be referred to as a module or component and are enabled as both physical structures and in simulations. Parameters are specified for selected cells (based on ‘standard cells’) such as size and made accessible in a database for use by EDA products.

[0104] During analysis and extraction 726, the circuit function is verified at the layout level, which permits refinement of the layout design. During physical verification 728, the layout design is checked to ensure that manufacturing constraints are correct, such as DRC constraints, electrical constraints, lithographic constraints, and that circuitry function matches the HDL design specification. During resolution enhancement 730, the geometry of the layout is transformed to improve how the circuit design is manufactured.

[0105] During tape-out, data is created to be used (after lithographic enhancements are applied if appropriate) for production of lithography masks. During mask data preparation 732, the ‘tape-out’ data is used to produce lithography masks that are used to produce finished integrated circuits.

[0106] A storage subsystem of a computer system (such as computer system 800 of FIG. 8) may be used to store the programs and data structures that are used by some or all of the EDA products described herein, and products used for development of cells for the library and for physical and logical design that use the library.

[0107] FIG. 8 illustrates an example machine of a computer system 800 within which a set of instructions, for causing the machine to perform any one or more of the methodologies discussed herein, may be executed. In alternative implementations, the machine may be connected (e.g., networked) to other machines in a LAN, an intranet, an extranet, and/or the Internet. The machine may operate in the capacity of a server or a client machine in client-server network environment, as a peer machine in a peer-to-peer (or distributed) network environment, or as a server or a client machine in a cloud computing infrastructure or environment.

[0108] The machine may be a personal computer (PC), a tablet PC, a set-top box (STB), a Personal Digital Assistant (PDA), a cellular telephone, a web appliance, a server, a network router, a switch or bridge, or any machine capable of executing a set of instructions (sequential or otherwise) that specify actions to be taken by that machine. Further, while a single machine is illustrated, the term "machine" shall also be taken to include any collection of machines that individually or jointly execute a set (or multiple sets) of instructions to perform any one or more of the methodologies discussed herein.

[0109] The example computer system 800 includes a processing device 802, a main memory 804 (e.g., read-only memory (ROM), flash memory, dynamic random access memory (DRAM) such as synchronous DRAM (SDRAM), a static memory 806 (e.g., flash memory, static random access memory (SRAM), etc.), and a data storage device 818, which communicate with each other via a bus 830.

[0110] Processing device 802 represents one or more processors such as a microprocessor, a central processing unit, or the like. More particularly, the processing device may be complex instruction set computing (CISC) microprocessor, reduced instruction set computing (RISC) microprocessor, very long instruction word (VLIW) microprocessor, or a processor implementing other instruction sets, or processors implementing a combination of instruction sets. Processing device 802 may also be one or more special-purpose processing devices such as an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a digital signal processor (DSP), network processor, or the like. The processing device 802 may be configured to execute instructions 826 for performing the operations and steps described herein.

[0111] The computer system 800 may further include a network interface device 908 to communicate over the network 820. The computer system 800 also may include a video display unit 810 (e.g., a liquid crystal display (LCD) or a cathode ray tube (CRT)), an alphanumeric input device 812 (e.g., a keyboard), a cursor control device 814 (e.g., a mouse), a graphics processing unit 822, a signal generation device 816 (e.g., a speaker), graphics processing unit 822, video processing unit 828, and audio processing unit 932. In one or more embodiments, the computer system 800 may also include a neural network processing unit 842. In one or more embodiments, the process of FIG. 7 may be performed in the neural network processing unit 842 and the neural network processing unit 842 may include the Al accelerator 300 of FIGS. 3A- 3B.

[0112] The data storage device 818 may include a machine-readable storage medium 824 (also known as a non-transitory computer-readable medium) on which is stored one or more sets of instructions 826 or software embodying any one or more of the methodologies or functions described herein. The instructions 826 may also reside, completely or at least partially, within the main memory 804 and/or within the processing device 802 during execution thereof by the computer system 800, the main memory 804 and the processing device 802 also constituting machine-readable storage media. [0113] In some implementations, the instructions 826 include instructions to implement functionality corresponding to the present disclosure. While the machine- readable storage medium 824 is shown in an example implementation to be a single medium, the term "machine-readable storage medium" should be taken to include a single medium or multiple media (e.g., a centralized or distributed database, and/or associated caches and servers) that store the one or more sets of instructions. The term "machine-readable storage medium" shall also be taken to include any medium that is capable of storing or encoding a set of instructions for execution by the machine and that cause the machine and the processing device 802 to perform any one or more of the methodologies of the present disclosure. The term "machine-readable storage medium" shall accordingly be taken to include, but not be limited to, solid-state memories, optical media, and magnetic media.

[0114] Some portions of the preceding detailed descriptions have been presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory. These algorithmic descriptions and representations are the ways used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. An algorithm may be a sequence of operations leading to a desired result. The operations are those requiring physical manipulations of physical quantities. Such quantities may take the form of electrical or magnetic signals capable of being stored, combined, compared, and otherwise manipulated. Such signals may be referred to as bits, values, elements, symbols, characters, terms, numbers, or the like.

[0115] It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the present disclosure, it is appreciated that throughout the description, certain terms refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage devices.

[0116] The present disclosure also relates to an apparatus for performing the operations herein. This apparatus may be specially constructed for the intended purposes, or it may include a computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a computer readable storage medium, such as, but not limited to, any type of disk including floppy disks, optical disks, CD-ROMs, and magnetic-optical disks, read-only memories (ROMs), random access memories (RAMs), EPROMs, EEPROMs, magnetic or optical cards, or any type of media suitable for storing electronic instructions, each coupled to a computer system bus.

[0117] The algorithms and displays presented herein are not inherently related to any particular computer or other apparatus. Various other systems may be used with programs in accordance with the teachings herein, or it may prove convenient to construct a more specialized apparatus to perform the method. In addition, the present disclosure is not described with reference to any particular programming language. It will be appreciated that a variety of programming languages may be used to implement the teachings of the disclosure as described herein.

[0118] The present disclosure may be provided as a computer program product, or software, that may include a machine-readable medium having stored thereon instructions, which may be used to program a computer system (or other electronic devices) to perform a process according to the present disclosure. A machine- readable medium includes any mechanism for storing information in a form readable by a machine (e.g., a computer). For example, a machine-readable (e.g., computer- readable) medium includes a machine (e.g., a computer) readable storage medium such as a read only memory ("ROM"), random access memory ("RAM"), magnetic disk storage media, optical storage media, flash memory devices, etc.

[0119] The detailed description set forth below in connection with the appended drawings is intended as a description of some example embodiments of a system and method for efficient look-up table based functions for an Al accelerator provided in accordance with the present disclosure and is not intended to represent the only forms in which the present disclosure may be constructed or utilized. The description sets forth the features of the present disclosure in connection with the illustrated embodiments. It is to be understood, however, that the same or equivalent functions and structures may be accomplished by different embodiments that are also intended to be encompassed within the scope of the disclosure. As denoted elsewhere herein, like element numbers are intended to indicate like elements or features.

[0120] It will be understood that, although the terms “first”, “second”, “third”, etc., may be used herein to describe various elements, components, regions, layers and/or sections, these elements, components, regions, layers and/or sections should not be limited by these terms. These terms are only used to distinguish one element, component, region, layer or section from another element, component, region, layer or section. Thus, a first element, component, region, layer or section discussed herein could be termed a second element, component, region, layer or section, without departing from the scope of the present disclosure.

[0121] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. As used herein, the terms “substantially,” “about,” and similar terms are used as terms of approximation and not as terms of degree, and are intended to account for the inherent deviations in measured or calculated values that would be recognized by those of ordinary skill in the art.

[0122] As used herein, the singular forms “a” and “an” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” and/or “comprising”, when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. As used herein, the term “and/or” includes any and all combinations of one or more of the associated listed items. Expressions such as “at least one of,” when preceding a list of elements, modify the entire list of elements and do not modify the individual elements of the list. Further, the use of “may” when describing embodiments of the present disclosure refers to “one or more embodiments of the present disclosure”. Also, the term “exemplary” is intended to refer to an example or illustration. As used herein, the terms “use,” “using,” and “used” may be considered synonymous with the terms “utilize,” “utilizing,” and “utilized,” respectively.

[0123] In the foregoing disclosure, implementations of the disclosure have been described with reference to specific example implementations thereof. It will be evident that various modifications may be made thereto without departing from the broader spirit and scope of implementations of the disclosure as set forth in the following claims. Where the disclosure refers to some elements in the singular tense, more than one element can be depicted in the figures and like elements are labeled with like numerals. The disclosure and drawings are, accordingly, to be regarded in an illustrative sense rather than a restrictive sense.