System for performing unary functions using range-specific coefficient sets
The system addresses the challenge of implementing unary functions with floating-point inputs by using range-specific coefficients in power series approximations, enhancing computational efficiency and precision.
Patent Information
- Application Number
- JP2020106689
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-08-30
- Filing Date
- 2020-06-22
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2040-06-22
AI Technical Summary
Existing processors face difficulties in efficiently implementing unary functions with floating-point numbers due to the non-uniform unit of least precision, making it challenging to use look-up tables effectively.
A system utilizing a set of power series approximations with range-specific coefficients, where the input floating-point value is compared to continuous ranges, and a set of coefficients is selected based on the identified range to compute the unary function.
Enables efficient and accurate implementation of unary functions for floating-point inputs by reducing the complexity of look-up table indexing and improving computational precision.
Smart Images

Figure 0007586459000001 
Figure 0007586459000002 
Figure 0007586459000003
Abstract
Description
[Technical field]
[0001] The present disclosure relates generally to the field of computer development, and more specifically to data processing. [Background technology]
[0002] A processor may execute a unary function that takes one argument as input and produces an output. Examples of unary functions include transcendental functions (e.g., tanh, log2, exp2, sigmoid), irrational functions (e.g., sqrt, 1 / sqrt), and common rational functions (e.g., 1 / x) that are useful in machine learning and neural networks. Some unary functions of an input value (x) are not easily implemented using basic arithmetic operations such as addition, subtraction, and multiplication. [Brief description of the drawings]
[0003] [Figure 1] 1 illustrates a system for performing a unary function using range-specific coefficient sets in accordance with certain embodiments. [Diagram 2] 1 illustrates multiple ranges for a unary function according to certain embodiments. [Diagram 3] 1 illustrates a first arithmetic engine in accordance with a particular embodiment. [Figure 4] 1 illustrates a second arithmetic engine in accordance with certain embodiments. [Diagram 5] 1 illustrates a first flow for performing a unary function using range-specific coefficient sets according to certain embodiments. [Figure 6] 1 illustrates a second flow for performing a unary function using range-specific coefficient sets in accordance with certain embodiments. [Figure 7] 1 illustrates an exemplary field programmable gate array (FPGA) in accordance with certain embodiments. [Figure 8A] FIG. 2 is a block diagram illustrating both an exemplary in-order pipeline and an exemplary register renaming out-of-order issue / execution pipeline in accordance with certain embodiments. [Figure 8B]1 is a block diagram illustrating both an exemplary embodiment of an in-order architecture core and an exemplary register renaming out-of-order issue / execution architecture core to be included in a processor in accordance with certain embodiments. [Figure 9A] 1 illustrates a block diagram of a more specific exemplary in-order core architecture, one of several logic blocks in a chip (potentially including other cores of the same and / or different types), in accordance with a particular embodiment. [Figure 9B] 1 illustrates a block diagram of a more specific exemplary in-order core architecture, one of several logic blocks in a chip (potentially including other cores of the same and / or different types), in accordance with a particular embodiment. [Figure 10] FIG. 1 is a block diagram of a processor that may have two or more cores, may have an integrated memory controller, and may have integrated graphics, in accordance with certain embodiments. [Figure 11] FIG. 1 is a block diagram of an exemplary computer architecture in accordance with certain embodiments. [Figure 12] FIG. 1 is a block diagram of an exemplary computer architecture in accordance with certain embodiments. [Figure 13] FIG. 1 is a block diagram of an exemplary computer architecture in accordance with certain embodiments. [Figure 14] FIG. 1 is a block diagram of an exemplary computer architecture in accordance with certain embodiments. [Figure 15] 1 is a block diagram contrasting the use of a software instruction converter to convert binary instructions in a source instruction set to binary instructions in a target instruction set in accordance with certain embodiments.
[0004] Like reference numbers and designations in the various drawings indicate like elements. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0005] Unary functions may be implemented in whole or in part using look-up tables (LUTs) present in the processor. In some systems, LUTs may provide the additional flexibility needed to implement customized functions. Some processors may provide multiple different tabulated functions (e.g., functions that may utilize lookups based on inputs) selectable via an instruction field. When the unit of least precision (ULP) is uniform (e.g., all inputs provided to the function have the same ULP), the LUT may be relatively easy to index. For example, an index into the LUT may simply be the right-shifted input value, and the output for the function may be the value present at that location in the LUT, or a linear interpolation between the selected value and the next value. However, in processors that utilize floating-point (FP) numbers as inputs, the ULPs are not uniform, making tabulated functions much more difficult to implement. Due to the variability of the ULP for FP inputs, simply right-shifting the input is generally not a viable approach to determine the LUT index.
[0006] Various embodiments of the present disclosure provide a robust solution for performing unary functions with FP numbers as input. In certain embodiments of the present disclosure, the unary functions are realized by a set of power series approximations spaced consecutively over the possible values for the input. For example, the result of a table aggregation function is a power series approximation (e.g., a0+a1x+a2x 2where x is the input value (potentially being manipulated) and a0, a1, and a2 are coefficients from the LUT. In certain embodiments, the coefficients are determined by a two-step process. First, the input FP value is compared to a series of ranges. The start value of each range may be any FP number, and the end value of a particular range is an FP value that is 1 ULP less than the start value of the next range. Second, once the range of input values is determined, a coefficient set (e.g., a0, a1, and a2) is selected based on the offset of the input value within the range (thus different ranges may be associated with different sets of coefficients, and different sections of a range may be associated with different sets of coefficients). The number of coefficient sets per range is flexible (e.g., 0 to N, where N is any suitable integer) and in some embodiments may be uniformly distributed numerically across the range (although non-uniform distribution is also possible). The coefficient set is then used with the input value x to calculate the result of the unary function. As will be explained in more detail below, some functions may have one or more ranges that do not utilize coefficients or are otherwise optimized based on the characteristics of the function.
[0007] As mentioned above, the input of the unary function may be a FP number. In various embodiments, any suitable FP number may be used, and the FP number may include a sign (also called a mantissa) and an exponent bit. The FP number may further include a sign bit. As various examples, the FP number may follow a minifloat format (e.g., an 8-bit format), a half-precision floating point format (FP16), a Brain Floating Point format (bfloat16), a single-precision floating point format (FP32), a double-precision floating point format (FP64), or other suitable FP format.
[0008] FIG. 1 illustrates a system 100 for performing a unary function using a set of range-specific coefficients according to certain embodiments. In the illustrated embodiment, the system 100 includes a central processing unit (CPU) 102 coupled to a matrix processing unit 104. The matrix processing unit 104 includes a memory 106 and an arithmetic engine 108 (in the illustrated embodiment, the memory 106 is within the arithmetic engine). The memory includes a control register 110 and a lookup table 112. The arithmetic engine 108 is operable to access the lookup table 112 to obtain the range-specific coefficients and perform the unary function according to the configuration of the control register 110. In various embodiments, the CPU 102 can execute code and send instructions and inputs to the matrix processing unit 104, which can execute the instructions and send results back to the CPU 102. In various embodiments, the CPU 102 may request execution of a unary function by the matrix processing unit 104, and the request may be passed by the matrix processing unit 104 to the arithmetic engine 108, or the CPU 102 may request some other operation, and the matrix processing unit 104 may determine that a unary function should be performed to perform the requested operation, and may instruct the arithmetic engine 108 to perform the unary function. In various embodiments, the system 100 may allow a user to program the control registers 110 to define functions via any suitable interface.
[0009] Although processor 100 illustrates a particular embodiment, other embodiments are contemplated herein. For example, in some embodiments, arithmetic engine 108 is not included in a matrix processing unit, but is included in a different type of processor (e.g., CPU 102 or another processor).
[0010] Each of the processors in system 100 (e.g., CPU 102, matrix processing unit 104, or other processors including arithmetic engine 108) may include a microprocessor, embedded processor, digital signal processor (DSP), network processor, handheld processor, application processor, co-processor, system on a chip (SOC), or other device that executes code and / or performs other processing operations.
[0011] CPU 102 may include one or more processing elements (e.g., cores). In one embodiment, a processing element refers to circuitry that supports software threads. Examples of hardware processing elements include thread units, thread slots, threads, process units, contexts, context units, logical processors, hardware threads, cores, and / or any other element capable of maintaining a processor state, such as an execution state or architectural state. In other words, in one embodiment, a processing element refers to any hardware capable of independently associating with code, such as a software thread, an operating system, an application, or other code.
[0012] A core may refer to logic located on an integrated circuit that can maintain independent architectural states, where each independently maintained architectural state is associated with at least some dedicated execution resources. A hardware thread may refer to any logic located on an integrated circuit that can maintain independent architectural states, where the independently maintained architectural states share access to the execution resources. As can be seen from the figure, when certain resources are shared and others are dedicated to architectural states, the lines between the names of hardware threads and cores overlap. However, often times, cores and hardware threads are viewed by the operating system as individual logical processors, and the operating system can schedule operations on each logical processor individually.
[0013] In various embodiments, the processing elements that may be included in a processor may further include one or more arithmetic logic units (ALUs), floating point units (FPUs), caches, instruction pipelines, interrupt handling hardware, registers, or other hardware that facilitates the operation of the processing elements.
[0014] The matrix processing unit 104 may include circuitry to perform functions to accelerate calculations associated with matrices (e.g., for deep learning applications). In various embodiments, the matrix processing unit 104 may perform one or more of vector-vector, matrix-vector, and matrix-matrix operations. In certain embodiments, the matrix processing unit 104 may perform element-wise operations on matrices, such as one or more of multiplication and division, addition and subtraction, logical operators (e.g., |, &, ^, ~), arithmetic and logical shifts, comparison operators (>, <, ==, !=), random number generation, and programmable functions. In some embodiments, the matrix processing unit 104 may further perform operations over elements of matrices, such as one or more of maximum and index in row / column / matrix, minimum and index in row / column / matrix, and sum over row / column / matrix.
[0015] The arithmetic engine 108 comprises circuitry to perform one or more unary functions. In various embodiments, the arithmetic engine 108 may be operable to perform binary functions (e.g., functions that perform an operation based on two inputs). In a particular embodiment, the arithmetic engine 108 is operable to perform binary functions on input data before matrix multiplication by the matrix processing unit 104, and to perform binary and unary functions on output data after matrix multiplication has been performed. In a particular embodiment, the arithmetic engine may process 32 bfloat16 elements or 16 FP32 elements per cycle in an element-by-element manner, although in other embodiments the arithmetic engine may be adapted to process other numbers of elements per cycle.
[0016] The arithmetic engine 108 may include a memory 106. In other embodiments, the arithmetic engine 108 may access a memory 106 that is not part of the arithmetic engine 108. The memory 106 may include any non-volatile and / or volatile memory. The memory 106 may include any suitable type of memory and is not limited to a particular speed, technology, or form factor memory in the various embodiments. In the illustrated embodiment, the memory 106 includes a control register 110 and a lookup table 112. In other embodiments, the control register 110 and the lookup table 112 may be stored in separate memories.
[0017] The lookup table 112 may include coefficient sets for one or more unary functions. For example, for a first unary function, the lookup table 112 may include multiple table entries, each entry may include coefficients for a respective portion of a range of input values for the first unary function. Thus, a first table entry for the first unary function may include a set of coefficients to be used when the input values for the function are within a first portion of the first input value range, a second entry for the first unary function may include a different set of coefficients to be used when the input values for the function are within a second portion of the first input value range, and so on. Similarly, the lookup table 112 may include a separate set of coefficients for a second range of the first function, another set of coefficients for a third range of the first function, and so on. Similarly, the lookup table 112 may include separate sets of coefficients for other functions. In various embodiments, the entries may store compressed or uncompressed coefficients.
[0018] The coefficients may be used to define a power series that is used to calculate an output value of the monomial function based on the input value. In a particular embodiment, the power series is a0+a1x+a2x 2where x is an input value and a0, a1, and a2 are a set of coefficients retrieved from the lookup table 112. In other embodiments, a different power series may be used. For example, the power series may be a0+a1x+a2x 2 +a3x 3 Similar power series of higher orders may be used, but the footprint of the arithmetic engine 108 increases as the power series becomes more complex due to the additional logic required to calculate the output and the increased number of coefficients that must be stored in the lookup table 112.
[0019] The number of ranges and corresponding entries stored in the lookup table may vary depending on the complexity of the unary function: for example, highly optimized functions may consume very few entries (e.g., 16 or fewer coefficient sets), while curved and non-symmetric functions (e.g., sigmoids) may utilize significantly more entries (e.g., about 90 coefficient sets).
[0020] FIG. 2 illustrates multiple ranges of the unary function tanh according to certain embodiments. In some embodiments, each of the illustrated ranges (202, 204, 206, 208, and 210) can be associated with one or more coefficient sets (each range may utilize any suitable number of coefficient sets, and different ranges may have different numbers of coefficient sets). Each section of the region (a section is illustrated as the area containing the input values between two thin vertical lines) may be governed by a different coefficient set. In various embodiments, the sections within a range are the same size. For example, one coefficient set may apply to x values from -2.0 to -1.8, the next coefficient set may apply to x values from -1.8 to -1.6, and so on.
[0021] In general, the sampling density (i.e., the number of coefficient sets per unit of input value domain) is higher in ranges with higher nonlinearity. Thus, the number of coefficient sets used for ranges 204 and 208 is much higher than the number of coefficient sets used in the other ranges. Because range 202 asymptotically approaches -1 (i.e., has a constant output value of -1 over the range of input values), the entire range is (a0 + a1x + a2x 2 (assuming a power series of the form x = -1, a1 = 0, and a2 = 0) may be utilized. Similarly, since range 210 is asymptotic to 1, a single set of coefficients a0 = 1, a1 = 0, and a2 = 0 may be utilized for the entire range. Range 206 is linear, and thus a single set of coefficients a0 = 0, a1 = 1, and a2 = 0 may likewise be utilized, such that in this range the output expression is simply x (i.e., the output is equal to the input).
[0022] The ranges shown in FIG. 2 are merely illustrative. In other implementations, the unary function may be divided into more or fewer regions. Further optimizations may be made to reduce the number of coefficients stored, as described below. For example, since the tanh function is symmetric about the origin, the coefficient set of range 208 may be reused for range 204 (with an appropriate sign change), and thus an input value that falls into range 204 may result in a lookup of the coefficient set associated with range 208. As another example, in regions where the output value is a constant (e.g., 202 and 210) or where the output value is equal to the input value (e.g., 206), the range may be associated with a mode that specifies the output value, and the lookup table 112 does not need to be accessed when the function is evaluated with an input within that range. Thus, such regions may be realized without storing the associated coefficient set. Alternatively, such regions may be realized according to the above examples utilizing coefficient sets.
[0023] 1, memory 106 further includes a number of control registers 110. These control registers define the operation of each of the unary functions implemented by arithmetic engine 108. Examples of possible control registers are defined below, however, this disclosure encompasses any suitable variations of these or other control registers to implement the functionality described herein. The actual number of bits in each register may vary depending on the particular implementation. In particular embodiments, each function implemented is associated with a respective set of registers dedicated to that function.
[0024] Enable Register - This register can be set to enable the function. In a particular embodiment, when this register is not set and a request to execute the function is received, the output value is set to not a number (NaN).
[0025] Number of Ranges Register - This register defines the number of ranges that are enabled for the function. Three bits may be used for this register as the number of ranges is limited to eight, although other embodiments may allow more or fewer ranges. When a function is enabled, at least one range is valid. Each function may have an associated Number of Ranges register.
[0026] Range Mode Register - This register specifies the mode of the range, and thus there may be multiple of these registers, each corresponding to a different range of the function. In a particular embodiment, the modes available for selection are lookup, constant, and identity. Lookup mode specifies that a table lookup should be performed and the resulting power series should be calculated to produce the output of the function. Identity mode specifies that the output value will be equal to the input value (thus no lookup needs to be performed). Constant mode specifies that a particular constant (which may be stored in the control register 110 or one of the other locales) is returned as the output value (thus no lookup needs to be performed).
[0027] Start Value Register - This register specifies the start value of a range (which may be inclusive, for example), where the start value is the lowest input value x in the range. There may be multiple of these registers, each corresponding to a different range of the function. In a particular embodiment, the start value is in FP32 format, although other formats described herein or elsewhere may be used. The start value register may allow for the determination of which range an input value falls into (e.g., an FP input value may be compared to various start values to determine which ranges include the input value).
[0028] Base Address Register - This register specifies the base address of the table entry in the lookup table that is allocated to a particular range. Hence there may be multiple of these registers, each corresponding to a different range of the function. The base address may be used together with the position of the input value within the range to determine the address of the associated table entry that contains the corresponding set of coefficients.
[0029] Offset Value Register - This register stores an offset value (e.g., a pre-calculated integer value provided by a user) that is used to derive the offset of an input value within a range. In one embodiment, the pre-calculated integer value may be subtracted from the input value to determine the offset of the input value into the range. Thus, the offset value may be the start of the range in integer form. There may be multiple of these registers, each corresponding to a different range of the function. In certain embodiments, when the range is set to constant mode, a constant (or a pointer to a constant) may be stored in the offset value register instead of the offset value.
[0030] Exponent Span Register - This register stores a value representing the exponent "span" of the range (e.g., the maximum possible exponent value for an input value that falls in the range, since in some cases the range may span multiple exponents). When the function utilizes a reduction operation, this value may be zero, since the input is normalized to a number between 1 and 2 before the lookup. The value stored in the Exponent Span Register may allow input values within the range to be converted to the same exponent, so that an offset value (which may be an integer) may be applied to any of the input values, regardless of whether they have different exponent values. There may be multiple of these registers, each corresponding to a different range of the function.
[0031] Shift Register - This register stores a value that represents the amount of shift to be applied to the offset of an input value within a range (e.g., the value obtained after subtracting the offset value from the input value). In some embodiments, this value may be provided by a user. In certain embodiments, this value is based on the number of coefficient sets in the range. For example, 2 zThe value written into the shift register may be z, where z represents the number of coefficient sets in the range, and the actual shift amount is determined by subtracting z from another number y (e.g., indicating the number of bits that represent the mantissa or normalized mantissa). There may be multiple of these registers, each corresponding to a different range of the function.
[0032] Symmetry Mode Register - This register specifies the symmetry of the function. For example, the symmetry mode may be none, y-axis, or origin. Some unary functions (e.g., some deep learning functions) have symmetry, so instead of storing a set of coefficients for the corresponding negative and positive ranges, a single set may be stored for both ranges. When the symmetry mode is none, no symmetry optimization is applied. When the symmetry mode is y-axis, the function may be evaluated using the absolute value of the input values. When the symmetry mode is origin, the function may be evaluated using the absolute value of the input values, and then the sign of the output is inverted if the original input was negative to generate the final output. Each function may have its own symmetry mode register.
[0033] In particular embodiments, the value of this register (or other registers) may specify some other custom mode for the function. For example, a neg_as_nan mode may specify that if the input value is negative, no lookup should be performed and NaN should be returned as output (such a mode may be useful, for example, when the function is sqrt(x), or other functions that do not operate on negative numbers).
[0034] Special Case Registers - These registers may specify whether special case handling should be applied when certain input values for the function are received (e.g., exactly zero, +infinity, or -infinity). For example, for a particular input value, the special case register may specify that no special handling should be applied, or that a cached predefined constant should be returned as the output value without performing a lookup. Alternatively, the special case register may specify that NaN should be returned (e.g., when the function is a reciprocal operation and the input is 0).
[0035] Function Mode Register - Specifies function specific optimizations (if any). For example, some well-known functions (e.g., sqrt(x), 1 / x, 1 / sqrt(x), log2(x), 2 x ), the exponent of the result (or a value very close to it) can be algorithmically derived with reasonably trivial additional logic (e.g., 8-bit integer addition). In such cases, the lookup operations and power series calculations can be restricted to cover the input mantissa (so the input value can be reduced to a value between 1 and 2 via a reduction operation), or to cover other portions of the input value, which can dramatically reduce the number of lookup table entries required for the function. In some circumstances, the function mode may override other modes specified via control registers (e.g., for the function 1 / x, symmetric mode may be forced to the origin regardless of the symmetric mode setting). The operation of function-specific optimizations is described in more detail in conjunction with FIG. 4.
[0036] Compression Mode - This register specifies the decompression algorithm for the lookup table entries (if the coefficients are compressed in the lookup table). In a particular embodiment, two compression modes are used: a first compression mode limits the range of the coefficients but produces a precise output, while a second compression mode does not constrain the range of the coefficients, thus allowing full range floating point input at the expense of a less precise output. In a particular embodiment, each entry in the lookup table contains data for three coefficients that are decompressed (e.g., from 64 bits to 96 bits) according to the specified decompression algorithm.
[0037] 3 illustrates an arithmetic engine 300 according to a particular embodiment. The arithmetic engine 300 may include any of the characteristics of the arithmetic engine 108, and vice versa. In the illustrated embodiment, the arithmetic engine 300 includes two stages of fused multiply-adders (FMAs) 302 and 304. Each stage has N FMAs, where N is any suitable integer, and each FMA can operate on a separate input value x (e.g., an element of a vector or matrix), such that N independent LUTs can be processed in parallel (e.g., via a single instruction, multiple data (SIMD) approach).
[0038] In the illustrated embodiment, the power series realized is a0+a1x+a2x 2 which is equivalent to a result denoted as (a0+(a1+a2x)*x). The LUT coefficients 306 are obtained from the lookup table 112. The input x and the coefficients a1+a2 are fed into a first stage to produce an intermediate result (a1+a2x). This intermediate result is then fed into a second stage along with the input x and the coefficient a0 to produce the final result.
[0039] Although a particular embodiment is shown, other embodiments may include any other suitable circuitry for computing a power series result. For example, circuitry other than an FMA may be used. As noted above, other embodiments may evaluate different power series. For example, another stage of FMA may be added to the arithmetic engine 300 to compute the power series a0+a1x+a2x 2 +a3x 3 In general, an arithmetic engine 108 including an N-stage FMA may calculate output values according to a power series for powers of N.
[0040] FIG. 4 illustrates an arithmetic engine 400 according to a particular embodiment. The arithmetic engine 400 may include any of the characteristics of the arithmetic engine 108, and vice versa. The illustrated arithmetic engine 400 includes a unary engine 402 and a binomial engine 404. In various embodiments, the unary engine 402 may include dedicated circuitry for performing unary functions, and the binomial engine 404 may include circuitry that may support unary and binomial functions (although not shown, the inputs to the single precision (SP) FMAs 406 and 408 may be further combined with other inputs when performing binomial functions). In other embodiments, the illustrated components may be included in any suitable arithmetic engine or other system or device (e.g., the components illustrated in the binomial engine 404 need not necessarily be included in the binomial engine).
[0041] In one embodiment, the unary engine 402 may generate coefficients (a0, a1, and a2 in this embodiment) and perform optimizations specified by the control registers described above. In the illustrated embodiment, the unary engine 402 may include a lookup table 410 (which may have any of the characteristics of lookup table 112). Although not shown, the unary engine 402 may further include control registers (e.g., any of the control registers 110).
[0042] In the illustrated embodiment, the unary engine 402 further includes a control module 412. The control module 412 may receive an input value x and an indication of a unary function to be performed on x. The control module 412 may access a control register (csr) to determine how to process the input. For example, the control module 412 may determine which range the input value corresponds to (e.g., by comparing the input value to one or more start value registers associated with the unary function). The control module 412 may further determine range-specific behavior. For example, the control module 412 may determine whether a lookup should be performed. If a lookup should be performed, the control module 412 calculates an address (denoted as a "table index") into the LUT 410 based on the input value x and the information available in the control register. This address is passed to the LUT 410, and the corresponding coefficient is retrieved from the LUT 410. The control module 412 may further be operable to retrieve a constant or other value (e.g., NaN) when no lookup is performed (e.g., when the input falls into a range that has a single output), or to output the input value (or to instruct the post-processing module 414 to do so) when a control register specifies identity mode for the range.
[0043] In some embodiments, the control module 412 may determine whether a reduction operation should be performed. For example, as described above, for some functions, the exponent of the result may be easily calculated, and thus a power series may simply operate on the mantissa of the input value (or other reduced portion of the input value) as opposed to the entire input value. When the control module 412 determines that a reduction operation should be performed, the control module 412 may extract a reduced value (e.g., the mantissa) from the input value and output the reduced value as x'. The exponent (e.g., the actual exponent of the input x, or an exponent based on a multiplier applied to the input x to reduce the input x to a value between 1 and 2, for example) and sign of the input may further be output by the control module 412 as "sideband data". In some embodiments, the sideband data may include any suitable information (e.g., an indication of a unary function, or an indication of an operation to be performed on the exponent and / or sign) that enables the post-processing module 414 to calculate the final exponent and sign. In some embodiments, the sideband data may include information indicating that the output should be converted to a particular value (e.g., NaN when the output is not valid, such as when the function is square root and the input value is negative).
[0044] When the control module 412 determines that a reduction operation should not be performed, the control module 412 may output the input value x as x' (the sideband data may be omitted or set to a value indicating the absence of sideband data).
[0045] FMAs 406 and 408 may operate in a similar manner as described above with respect to FMAs 302 and 304, regardless of whether x' is the actual input value or a reduced input value. Although FMAs 406 and 408 are shown as single precision FMAs, the FMAs may be configured to operate with any suitable number format. The output of FMA 408 may be provided to a post-processing module 414 for any processing to be performed before the final output value is output by arithmetic engine 400.
[0046] In various embodiments, the arithmetic engine 400 may be capable of performing unary functions on multiple different input formats. For example, when operating on input values in a shorter format (e.g., bfloat16), the input values may be upconverted to a longer format (e.g., FP32), and the same circuit FMA may be used when the input values arrive in the longer format. If a shorter format is desired for output, the arithmetic engine 400 may downconvert the results inline (e.g., via post-processing module 414).
[0047] In various embodiments, denormals and NaNs may be handled by the arithmetic engine in any suitable manner. For example, denormalized input values may be converted to 0 (e.g., +0) before processing, and final results in denormalized ranges may be flushed to signed 0 (unless the selected range is in constant mode and a constant has been programmed into the denormalized value). As another example, input NaN values may be quieted and propagated to the result as necessary. Quiet NaNs of actual indeterminate type may be generated for various invalid processing cases (e.g., when the input value does not fall within a defined range portion).
[0048] 5 illustrates a flow 500 for performing a unary function using range-specific coefficient sets according to certain embodiments. In various embodiments, the flow may be performed by the arithmetic engine 108 and / or other suitable logic including circuitry.
[0049] At 502, an identification of a function and an input value x are received. At 504, a determination is made as to whether a special case applies to the input value. For example, a register may be checked to see if the input value matches a value for which a special case applies (e.g., exactly zero, +infinity, or infinity). If a special case applies, the corresponding special value is output at 506 and the flow ends. If a special case does not apply, the flow moves to 508.
[0050] At 508, a determination is made as to whether a reduction should be applied to the input value. If subtraction is to be applied, the input value is reduced at 510. In a particular embodiment, this involves extracting the mantissa of the input value and placing the exponent and sign of the input value into the sideband data for subsequent processing. After the reduction (or if no reduction is to be performed), flow proceeds to 512.
[0051] At 512, a range of the function is identified based on the input values. At 514, the mode of the identified range is determined. If the mode is identity mode, the input value is output at 516 and the flow ends. If the mode is constant mode, the associated constant is retrieved and output at 518 and the flow ends.
[0052] If the mode is lookup mode, a lookup is performed at 520. This may include determining an address of a lookup table based on the start address of the range and the offset of the input value within the range. The lookup may return a set of coefficients. At 522, a power series defined by the coefficients is calculated for the input value. The result is output at 524 and the flow ends.
[0053] 6 illustrates a flow 600 for performing a unary function using a range-specific coefficient set according to a particular embodiment. 602 includes storing a plurality of entries, each entry of the plurality of entries associated with a portion of a range of input values, each entry of the plurality of entries including a coefficient set that defines a power series approximation. 604 includes selecting a first entry of the plurality of entries based on determining that the floating-point input value is within the portion of the range of input values associated with the first entry. 606 includes calculating an output value by evaluating the power series approximation defined by the coefficient set of the first entry at the floating-point input value.
[0054] The flows described in Figures 2-6 are merely representative of operations that may occur in particular embodiments. In other embodiments, additional operations may be performed. Various embodiments of the present disclosure contemplate any suitable signaling mechanism that achieves the functionality described herein. Some of the operations depicted in Figures 2-6 may be repeated, combined, modified, or omitted where appropriate. Additionally, operations may be performed in any suitable order without departing from the scope of a particular embodiment.
[0055] The following figures detail example architectures and systems for implementing the above embodiments. For example, the matrix processing unit 104 and / or the arithmetic engine 108 may be included in or coupled to any of the processors or systems listed below. In some embodiments, one or more of the hardware components and / or instructions described above are emulated or implemented as software modules, as described in more detail below.
[0056] 7 illustrates a field programmable gate array (FPGA) 700 according to a particular embodiment. In a particular embodiment, the arithmetic engine 108 may be implemented by the FPGA 700 (e.g., the functionality of the arithmetic engine 108 may be implemented by a circuit of operational logic 704). The FPGA may be a semiconductor device that includes configurable logic. The FPGA may be programmed via a data structure (e.g., a bitstream) having any suitable format that defines how the logic of the FPGA should be configured. The FPGA may be reprogrammed any number of times after the FPGA is manufactured.
[0057] In the illustrated embodiment, the FPGA 700 includes configurable logic 702, arithmetic logic 704, a communications controller 706, and a memory controller 710. The configurable logic 702 may be programmed to implement one or more kernels. A kernel may include configured logic of the FPGA that may receive one or more sets of inputs, process the set of inputs using configured logic, and provide one or more sets of outputs. A kernel may perform any appropriate type of processing. In various embodiments, a kernel may include a prefix decoder engine. Some FPGAs 700 may be limited to executing a single kernel at a time, while other FPGAs may be capable of executing multiple kernels simultaneously. The configurable logic 702 may include any appropriate logic, such as any appropriate type of logic gate (e.g., AND gate, XOR gate) or combination of logic gates (e.g., flip-flops, look-up tables, adders, multipliers, multiplexers, demultiplexers). In some embodiments, the logic is configured (at least in part) through programmable interconnects between logic components of the FPGA.
[0058] The operational logic 704 may access data structures that define the kernels, configure the configurable logic 702 based on the data structures, and perform other operations of the FPGA. In some embodiments, the operational logic 704 may write control bits to memory (e.g., non-volatile flash memory or SRAM-based memory) of the FPGA 700 based on the data structures, which operate to configure the logic (e.g., by activating or deactivating certain interconnects between portions of the configurable logic). The operational logic 704 may include any suitable logic (which may be implemented in configurable logic or fixed logic), such as one or more memory devices including any suitable type of memory (e.g., random access memory (RAM)), one or more transceivers, clock circuits, one or more processors located on the FPGA, one or more controllers, or other suitable logic.
[0059] Communications controller 706 may enable FPGA 700 to communicate with other components of the computer system (e.g., a compression engine) (e.g., to receive commands to compress a data set). Memory controller 710 may enable the FPGA to read data (e.g., operands or results) from or write data to memory of the computer system. In various embodiments, memory controller 710 may include a direct memory access (DMA) controller.
[0060] Processor cores may be realized in different ways, for different purposes, and in different processors. For example, implementations of such cores may include 1) a general purpose in-order core targeted for general purpose computing, 2) a high performance general purpose out-of-order core targeted for general purpose computing, and 3) a specialized core targeted primarily for graphics and / or scientific (throughput) computing. Implementations of different processors may include 1) a CPU including one or more general purpose in-order cores targeted for general purpose computing and / or one or more general purpose out-of-order cores targeted for general purpose computing, and 2) a coprocessor including one or more specialized cores targeted primarily for graphics and / or scientific (throughput). Such different processors result in different computer system architectures, which may include 1) a coprocessor on a separate chip from the CPU, 2) a coprocessor on a separate die in the same package as the CPU, 3) a coprocessor on the same die as the CPU (in which case such a coprocessor is sometimes referred to as dedicated logic, such as integrated graphics and / or scientific (throughput) logic, or a dedicated core), and 4) a system-on-chip that may include a CPU (sometimes referred to as an application core or application processor), the coprocessors described above, and additional functionality, on the same die. Next, an exemplary core architecture is described, followed by a description of an exemplary processor and computer architecture.
[0061] FIG. 8A is a block diagram illustrating both an exemplary in-order pipeline and an exemplary register renaming out-of-order issue / execution pipeline according to an embodiment of the present disclosure. FIG. 8B is a block diagram illustrating both an exemplary embodiment of an in-order architecture core to be included in a processor according to an embodiment of the present disclosure and an exemplary register renaming out-of-order issue / execution architecture core. The solid lined boxes in FIG. 8A-8B indicate the in-order pipeline and in-order core, and the optional additional dashed lined boxes indicate the register renaming out-of-order issue / execution pipeline and core. The out-of-order aspects will be described assuming that the in-order aspects are a subset of the out-of-order aspects.
[0062] In FIG. 8A , the processor pipeline 800 includes a fetch stage 802, a length decode stage 804, a decode stage 806, an allocation stage 808, a renaming stage 810, a scheduling (also known as dispatch or issue) stage 812, a register read / memory read stage 814, an execution stage 816, a write back / memory write stage 818, an exception handling stage 822, and a commit stage 824.
[0063] 8B shows a processor core 890 including a front end unit 830 coupled to an execution engine unit 850, both of which are coupled to a memory unit 870. Core 890 may be a reduced instruction set computing (RISC) core, a complex instruction set computing (CICS) core, a very long instruction word (VLIW) core, or a hybrid or alternative core type. As yet another option, core 890 may be a special purpose core, such as, for example, a network or communication core, a compression and / or decompression engine, a co-processor core, a general purpose computing graphics processing unit (GPGPU) core, a graphics core, etc.
[0064] The front-end unit 830 includes a branch prediction unit 832 coupled to an instruction cache unit 834, which is coupled to an instruction translation lookaside buffer (TLB) 836, which is coupled to an instruction fetch unit 838, which is coupled to a decode unit 840. The decode unit 840 (or decoder) may decode instructions and generate as output one or more micro-operations, microcode entry points, microinstructions, other instructions, or other control signals that are decoded from or otherwise reflect or are derived from the original instruction. The decode unit 840 may be implemented using a variety of different mechanisms. Examples of suitable mechanisms include, but are not limited to, lookup tables, hardware implementations, programmable logic arrays (PLAs), microcode read-only memory (ROM), etc. In one embodiment, core 890 includes a microcode ROM or other medium that stores microcode for particular macro instructions (e.g., in decode unit 840 or otherwise within front end unit 830). Decode unit 840 is coupled to a rename / allocator unit 852 within execution engine unit 850.
[0065] The execution engine units 850 include a rename / allocator unit 852 coupled to a retirement unit 854 and a set of one or more scheduler units 856. The scheduler units 856 represent any number of different schedulers including reservations stations, central instruction window, etc. The scheduler units 856 are coupled to physical register file units 858. Each of the physical register file units 858 represents one or more physical register files, different ones of which store one or more different data types, such as scalar integer, scalar floating point, packed integer, packed floating point, vector integer, vector floating point, status (e.g., an instruction pointer, which is the address of the next instruction to be executed), etc. In one embodiment, the physical register file units 858 include a vector register unit, a write mask register unit, and a scalar register unit. These register units may provide architectural vector registers, vector mask registers, and general purpose registers. The physical register files unit 858 is overlapped by a retirement unit 854 to illustrate the various ways in which register renaming and out-of-order execution may be achieved (e.g., using a reorder buffer and retirement register file, using a future file, a history buffer, and a retirement register file, using a register map and register pools, etc.). The retirement unit 854 and the physical register files unit 858 are coupled to an execution cluster 860. The execution cluster 860 includes a set of one or more execution units 862 and a set of one or more memory access units 864. The execution units 862 may perform various operations (e.g., shift, add, subtract, multiply) on various types of data (e.g., scalar floating point, packed integer, packed floating point, vector integer, vector floating point). Some embodiments may include multiple execution units dedicated to a particular function or set of functions, while other embodiments may include multiple execution units with only one execution unit or all performing all functions.Scheduler unit 856, physical register file unit 858, and execution cluster 860 are shown as possibly multiple because certain embodiments create separate pipelines for certain types of data / operations (e.g., a scalar integer pipeline, a scalar floating point / packed integer / packed floating point / vector integer / vector floating point pipeline, and / or a memory access pipeline, each with its own scheduler unit, physical register file unit, and / or execution cluster, where a separate memory access pipeline results in a particular embodiment where only the execution cluster of this pipeline has a memory access unit 864). Furthermore, it should be understood that if separate pipelines are used, one or more of these pipelines may be out-of-order issue / execution and the rest in-order.
[0066] The set of memory access units 864 is coupled to a memory unit 870, which includes a data TLB unit 872 coupled to a data cache unit 874 coupled to a level 2 (L2) cache unit 876. In one exemplary embodiment, the memory access units 864 may include a load unit, a store address unit, and a store data unit, each of which is coupled to the data TLB unit 872 in the memory unit 870. The instruction cache unit 834 is further coupled to a level 2 (L2) cache unit 876 in the memory unit 870. The L2 cache unit 876 is coupled to one or more other levels of cache and ultimately to the main memory.
[0067] By way of example, an exemplary register renaming out-of-order issue / execution core architecture may implement a pipeline 800 as follows: 1) instruction fetch 838 performs fetch and length decoding stages 802 and 804, 2) decode unit 840 performs decode stage 806, 3) rename / allocator unit 852 performs allocation stage 808 and renaming stage 810, 4) scheduler unit 856 performs schedule stage 812, 5) physical register file unit 858 and memory unit 870 perform register read / memory read stage 814, execution cluster 860 performs execution stage 816, 6) memory unit 870 and physical register file unit 858 perform writeback / memory write stage 818, 7) various units may be involved in exception handling stage 822, and 8) retirement unit 854 and physical register file unit 858 perform commit stage 824.
[0068] Core 890 may support one or more instruction sets, including the instructions described herein (e.g., the x86 instruction set (with some extensions added in newer versions), the MIPS instruction set from MIPS Technologies of Sunnyvale, Calif., the ARM instruction set from ARM Holdings of Sunnyvale, Calif. (with any further extensions such as NEON). In one embodiment, core 890 includes logic to support packed data instruction set extensions (e.g., AVX1, AVX2), allowing operations used by many multimedia applications to be performed using packed data.
[0069] It will be appreciated that a core may support multithreading (executing two or more parallel sets of operations or threads) and may do so in a variety of ways, including time sliced multithreading, simultaneous multithreading (where a single physical core provides a logical core for each of the threads that the physical core is multithreading simultaneously), or a combination thereof (e.g., time sliced fetching and decoding followed by simultaneous multithreading, such as Intel® Hyper-Threading Technology).
[0070] Although register renaming is described in the context of out-of-order execution, it should be understood that register renaming may also be used in in-order architectures. Also, while the illustrated embodiment of the processor includes separate instruction and data cache units 834 / 874 and a shared L2 cache unit 876, alternative embodiments may have a single internal cache for both instructions and data, such as a level 1 (L1) internal cache, or multiple levels of internal cache. In some embodiments, the system may include a combination of an internal cache and an external cache that is external to the core and / or processor. Alternatively, all of the cache may be external to the core and / or processor.
[0071] 9A-9B show block diagrams of a more specific exemplary in-order core architecture, which may be one of several logic blocks in a chip (potentially including other cores of the same and / or different types) that communicate over a high bandwidth interconnect network with some fixed functional logic, memory I / O interfaces, and other necessary I / O logic depending on the application.
[0072] FIG. 9A is a block diagram of a single processor core, with connections to an on-die interconnect network 902, and a local subset of a level 2 (L2) cache 904, according to various embodiments. In one embodiment, an instruction decoder 900 supports the x86 instruction set with packed data instruction set extension. An L1 cache 906 allows low latency access to cache memory for the scalar and vector units. In one embodiment (which simplifies the design), the scalar unit 908 and the vector unit 910 use separate register sets (scalar registers 912 and vector registers 914, respectively), and data transferred between them is written to memory and then read back from the level 1 (L1) cache 906, although alternative embodiments may use different approaches (e.g., using a single register set, or including a communication path that allows data to be transferred between the two register files without being written and read back).
[0073] The local subset of the L2 cache 904 is part of a global L2 cache that is divided into separate local subsets (in some embodiments, one per processor core). Each processor core has a direct access path to its own local subset of the L2 cache 904. Data read by a processor core is stored in its L2 cache subset 904 and is quickly accessible in parallel with other processor cores accessing their own local L2 cache subsets. Data written by a processor core is stored in its own L2 cache subset 904 and is flushed from other subsets when necessary. The ring network ensures coherency of shared data. The ring network is bidirectional, allowing agents such as processor cores, L2 caches, and other logic blocks to communicate with each other within the chip. In a particular embodiment, each ring data path is 1012 bits wide per direction.
[0074] Figure 9B is an expanded view of a portion of the processor core in Figure 9A, according to an embodiment. Figure 9B includes an L1 data cache 906A (part of the L1 cache 906), and further details regarding a vector unit 910 and vector registers 914. Specifically, the vector unit 910 is a 16-wide vector processing unit (VPU) that executes one or more of integer, single precision float, and double precision float instructions (see 16-wide ALU 928). The VPU supports swizzling of register inputs by a swizzle unit 920, numeric conversion by numeric convert units 922A-922B, and duplication of memory inputs by a duplication unit 924. A write mask register 926 allows for predicating of the resulting vector writes.
[0075] 10 is a block diagram of a processor 1000 that may have two or more cores, may have an integrated memory controller, and may have integrated graphics, according to various embodiments. The solid lined box in FIG. 10 illustrates a processor 1000 with a single core 1002A, a system agent 1010, and a set of one or more bus controller units 1016, while an optional additional dashed lined box illustrates an alternative processor 1000 with multiple cores 1002A-N, a set of one or more integrated memory controller units 1014 in the system agent unit 1010, and dedicated logic 1008.
[0076] Thus, different implementations of processor 1000 may include: 1) a CPU where special purpose logic 1008 is integrated graphics and / or scientific (throughput) logic (which may include one or more cores) and cores 1002A-N are one or more general purpose cores (e.g., general purpose in-order cores, general purpose out-of-order cores, or a combination of the two), 2) a coprocessor where cores 1002A-N are multiple special purpose cores primarily targeted at graphics and / or scientific (throughput), and 3) a coprocessor where cores 1002A-N are multiple general purpose in-order cores. Thus, processor 1000 may be a general purpose processor, coprocessor, or special purpose processor, such as a network or communication processor, a compression and / or decompression engine, a graphics processor, a GPGPU (general purpose graphics processing unit), a high throughput many integrated core (MIC) coprocessor (e.g., including 30 or more cores), an embedded processor, or other fixed or configurable logic that performs logical operations. The processor may be implemented on one or more chips. The processor 1000 may be a part of and / or may be implemented on one or more substrates using any of a number of process technologies, such as, for example, BiCMOS, CMOS, or NMOS.
[0077] In various embodiments, a processor may include any number of processing elements, which may be symmetric or asymmetric. In one embodiment, a processing element refers to hardware or logic that supports a software thread. Examples of hardware processing elements include thread units, thread slots, threads, process units, contexts, context units, logical processors, hardware threads, cores, and / or any other element that can hold a processor state, such as an execution state or architectural state. In other words, in one embodiment, a processing element refers to any hardware that can be independently associated with code, such as a software thread, an operating system, an application, or other code. A physical processor (or processor socket) typically refers to an integrated circuit that potentially includes any number of other processing elements, such as cores or hardware threads.
[0078] A core may refer to logic located on an integrated circuit that can maintain independent architectural states, where each independently maintained architectural state is associated with at least some dedicated execution resources. A hardware thread may refer to any logic located on an integrated circuit that can maintain independent architectural states, where the independently maintained architectural states share access to the execution resources. As can be seen, when certain resources are shared and others are dedicated to architectural states, the lines between the names of hardware threads and cores overlap. However, often times, cores and hardware threads are seen by the operating system as individual logical processors, and the operating system can individually schedule operations on the individual logical processors.
[0079] The memory hierarchy includes one or more levels of cache within the cores, a set of one or more shared cache units 1006, and an external memory (not shown) coupled to a set of integrated memory controller units 1014. The set of shared cache units 1006 may include one or more mid-level caches, such as level 2 (L2), level 3 (L3), level 4 (L4), or other levels of cache, a last level cache, and / or combinations thereof. In one embodiment, a ring-based interconnect unit 1012 interconnects the dedicated logic (e.g., integrated graphics logic) 1008, the set of shared cache units 1006, and the system agent unit 1010 / integrated memory controller unit 1014, although alternative embodiments may use any number of well-known techniques for interconnecting such units. In one embodiment, coherency is maintained between the one or more cache units 1006 and the cores 1002A-N.
[0080] In some embodiments, one or more of the cores 1002A-N are capable of multithreading. The system agent 1010 includes components that coordinate and operate the cores 1002A-N. The system agent unit 1010 may include, for example, a power control unit (PCU) and a display unit. The PCU may be or may include the logic and components necessary to regulate the power state of the cores 1002A-N and the dedicated logic 1008. The display unit is responsible for driving one or more externally connected displays.
[0081] The cores 1002A-N may be homogeneous or heterogeneous in terms of architectural instruction sets, i.e., two or more of the cores 1002A-N may be capable of executing the same instruction set, while other cores may be capable of executing only a subset of that instruction set or a different instruction set.
[0082] 11-14 are block diagrams of exemplary computer architectures. Other system designs and configurations known in the art for laptops, desktops, handheld PCs, personal digital assistants, engineering workstations, servers, network devices, network hubs, switches, embedded processors, digital signal processors (DSPs), graphics devices, video game devices, set-top boxes, microcontrollers, cell phones, portable media players, handheld devices, and various other electronic devices are also suitable for performing the methods described in this disclosure. In general, a wide variety of systems or electronic devices that can incorporate the processors and / or other execution logic disclosed herein are generally suitable.
[0083] 11 illustrates a block diagram of a system 1100 according to one embodiment of the disclosure. The system 1100 may include one or more processors 1110, 1115 coupled to a controller hub 1120. In one embodiment, the controller hub 1120 includes a graphics memory controller hub (GMCH) 1190 and an input / output hub (IOH) 1150 (which may be on separate chips or on the same chip), where the GMCH 1190 includes a memory and graphics controller coupled to the memory 1140 and the coprocessor 1145, and the IOH 1150 couples the input / output (I / O) devices 1160 to the GMCH 1190. Alternatively, one or both of the memory and graphics controller are integrated within the processor (as described herein), where the memory 1140 and the coprocessor 1145 are directly coupled to the processor 1110, and the controller hub 1120 is a single chip including the IOH 1150.
[0084] An optional additional processor 1115 is shown in dashed lines in Figure 11. Each processor 1110, 1115 may include one or more of the processing cores described herein and may be some version of the processor 1000.
[0085] The memory 1140 may be, for example, dynamic random access memory (DRAM), phase change memory (PCM), other suitable memory, or any combination thereof. The memory 1140 may store any suitable data, such as data used by the processors 1110, 1115 to provide the functionality of the computer system 1100. For example, data associated with or files accessed by programs executed by the processors 1110, 1115 may be stored in the memory 1140. In various embodiments, the memory 1140 may store data and / or sequences of instructions used or executed by the processors 1110, 1115.
[0086] In at least one embodiment, the controller hub 1120 communicates with the processors 1110, 1115 via a multi-drop bus such as a Front Side Bus (FSB), a point-to-point interface such as a Quick Path Interconnect (QPI), or a similar connection 1195.
[0087] In one embodiment, coprocessor 1145 is a special purpose processor, such as, for example, a high throughput MIC processor, a network or communication processor, a compression and / or decompression engine, a graphics processor, a GPGPU, an embedded processor, etc. In one embodiment, controller hub 1120 may include an integrated graphics accelerator.
[0088] There may be a wide range of differences between the physical resources 1110, 1115 in terms of a spectrum of metrics of merit including architectural, microarchitectural, thermal, power consumption characteristics, and the like.
[0089] In one embodiment, the processor 1110 executes instructions that control general types of data processing operations. Embedded within the instructions may be coprocessor instructions. The processor 1110 recognizes these coprocessor instructions as being of a type that should be executed by the attached coprocessor 1145. Thus, the processor 1110 issues these coprocessor instructions (or control signals representing the coprocessor instructions) on a coprocessor bus or other interconnect to the coprocessor 1145. The coprocessor 1145 accepts and executes the received coprocessor instructions.
[0090] 12 illustrates a block diagram of a first more specific exemplary system 1200 according to one embodiment of the present disclosure. As shown in FIG. 12, the multiprocessor system 1200 is a point-to-point interconnect system and includes a first processor 1270 and a second processor 1280 coupled via a point-to-point interconnect 1250. Each of the processors 1270 and 1280 may be some version of the processor 1000. In one embodiment of the present disclosure, the processors 1270 and 1280 are the processors 1110 and 1115, respectively, and the coprocessor 1238 is the coprocessor 1145. In another embodiment, the processors 1270 and 1280 are the processors 1110 and 1145, respectively.
[0091] Processors 1270 and 1280 are shown to include integrated memory controller (IMC) units 1272 and 1282, respectively. Processor 1270 further includes point-to-point (P-P) interfaces 1276 and 1278 as part of its bus controller unit, and similarly, second processor 1280 includes P-P interfaces 1286 and 1288. Processors 1270, 1280 may exchange information over point-to-point (P-P) interface 1250 using P-P interface circuits 1278, 1288. As shown in FIG. 12, IMCs 1272 and 1282 couple the processors to their respective memories, i.e., memory 1232 and memory 1234, which may be portions of main memory locally attached to the respective processors.
[0092] Processors 1270, 1280 may each exchange information with chipset 1290 via respective P-P interfaces 1252, 1254 using point-to-point interface circuits 1276, 1294, 1286, 1298. Chipset 1290 may optionally exchange information with coprocessor 1238 via high performance interface 1239. In one embodiment, coprocessor 1238 is a special purpose processor, such as, for example, a high throughput MIC processor, a network or communication processor, a compression and / or decompression engine, a graphics processor, a GPGPU, an embedded processor, etc.
[0093] A shared cache (not shown) may be included within either processor or external to both processors but connected to the processors via the P-P interconnect so that when the processors are placed in a low power mode, local cache information of either or both processors may be stored in the shared cache.
[0094] Chipset 1290 may be coupled to a first bus 1216 via an interface 1296. In one embodiment, first bus 1216 may be a bus such as a Peripheral Component Interconnect (PCI) bus, or a PCI Express bus or other third generation I / O interconnect bus, although the scope of the disclosure is not so limited.
[0095] As shown in FIG. 12, various I / O devices 1214 may be coupled to the first bus 1216 along with a bus bridge 1218 that couples the first bus 1216 to a second bus 1220. In one embodiment, one or more additional processors 1215, such as a co-processor, a high throughput MIC processor, a GPGPU, an accelerator (e.g., a graphics accelerator or a digital signal processing (DSP) unit), a field programmable gate array, or any other processor, are coupled to the first bus 1216. In one embodiment, the second bus 1220 may be a low pin count (LPC) bus. Various devices may be coupled to the second bus 1220, including, in one embodiment, a keyboard and / or mouse 1222, a communication device 1227, and a storage unit 1228, such as a disk drive or other mass storage device, that may contain instructions / code and data 1230. Additionally, audio I / O 1224 may be coupled to the second bus 1220. It is noted that other architectures are contemplated by this disclosure, for example, instead of the point-to-point architecture of Figure 12, the system may implement a multi-drop bus or other such architecture.
[0096] Figure 13 shows a block diagram of a second, more specific, exemplary system 1300 according to one embodiment of the present disclosure. Like elements in Figures 12 and 13 have like reference numbers, and certain aspects of Figure 12 have been omitted from Figure 13 to avoid obscuring other aspects of Figure 13.
[0097] Figure 13 shows that the processors 1270, 1280 may include integrated memory and I / O control logic ("CL") 1272, 1282, respectively. Thus, the CL 1272, 1282 includes an integrated memory controller unit and includes I / O control logic. Figure 13 shows that not only are the memories 1232, 1234 coupled to the CL 1272, 1282, but also that the I / O devices 1314 are coupled to the control logic 1272, 1282. The legacy I / O devices 1315 are coupled to the chipset 1290.
[0098] FIG. 14 illustrates a block diagram of a SoC 1400 according to an embodiment of the present disclosure. Similar elements in FIG. 10 have similar reference numbers. Also, the dashed boxes are optional features in a more advanced SoC. In FIG. 14, the interconnect unit 1402 is coupled to an application processor 1410 including a set of one or more cores 1002A-N and a shared cache unit 1006, a system agent unit 1010, a bus controller unit 1016, an integrated memory controller unit 1014, a set of one or more coprocessors 1420 that may include integrated graphics logic, an image processor, an audio processor, and a video processor, a static random access memory (SRAM) unit 1430, a direct memory access (DMA) unit 1432, and a display unit 1440 that couples to one or more external displays. In one embodiment, the coprocessors 1420 include special purpose processors such as, for example, network or communication processors, compression and / or decompression engines, GPGPUs, high throughput MIC processors, embedded processors, etc.
[0099] In some cases, an instruction converter may be used to convert instructions from a source instruction set to a target instruction set. For example, the instruction converter may translate (e.g., using static binary translation, dynamic binary translation including dynamic compilation), transform, emulate, or otherwise convert the instructions into one or more other instructions to be processed by the core. The instruction converter may be implemented in software, hardware, firmware, or a combination thereof. The instruction converter may be on-processor, off-processor, or partly on-processor and partly off-processor.
[0100] FIG. 15 is a block diagram contrasting the use of a software instruction converter to convert binary instructions in a source instruction set to binary instructions in a target instruction set according to an embodiment of the present disclosure. In the illustrated embodiment, the instruction converter is a software instruction converter, but alternatively, the instruction converter may be implemented in software, firmware, hardware, or various combinations thereof. FIG. 15 illustrates that a program in a high-level language 1502 may be compiled using an x86 compiler 1504 to generate x86 binary code 1506 that may be natively executed by a processor having at least one x86 instruction set core 1516. A processor having at least one x86 instruction set core 1516 represents any processor that can perform substantially the same functions as an Intel processor having at least one x86 instruction set core by compatibly executing or otherwise processing (1) a substantial portion of the instruction set of an Intel x86 instruction set core, or (2) object code versions of applications or other software targeted to run on an Intel processor having at least one x86 instruction set core, to achieve substantially the same results as an Intel processor having at least one x86 instruction set core. x86 compiler 1504 represents a compiler operable to generate x86 binary code 1506 (e.g., object code) that is executable, with or without further linkage processing, on a processor 1516 having at least one x86 instruction set core. Similarly, Figure 15 illustrates that a program in a high-level language 1502 may be compiled using an alternative instruction set compiler 1508 to generate alternative instruction set binary code 1510 that may be executed natively by a processor 1514 without at least one x86 instruction set core (e.g., a processor having a core that executes the MIPS instruction set from MIPS Technologies of Sunnyvale, Calif. and / or the ARM instruction set from ARM Holdings of Sunnyvale, Calif.).The instruction converter 1512 is used to convert the x86 binary code 1506 into code that can be natively executed by a processor without an x86 instruction set core 1514. This converted code is unlikely to be identical to the alternative instruction set binary code 1510 because an instruction converter capable of this would be difficult to create, but the converted code achieves common operations and is composed of instructions from the alternative instruction set. Thus, the instruction converter 1512 represents software, firmware, hardware, or a combination thereof that allows a processor or other electronic device without an x86 instruction set processor or core to execute the x86 binary code 1506 through emulation, simulation, or other process.
[0101] A design may go through various stages from creation to simulation to fabrication. Data representing the design may represent the design in multiple ways. First, the hardware may be represented using a Hardware Description Language (HDL) or other functional description language, so as to be useful in simulation. Additionally, a circuit level model with logic and / or transistor gates may be generated at some stages of the design process. Furthermore, most designs reach at some stage a level of data representing the physical placement of various devices in the hardware model. If conventional semiconductor fabrication techniques are used, the data representing the hardware model may be data specifying the presence or absence of various features on different mask layers for the masks used to produce the integrated circuit. In some implementations, such data may be stored in a database file format, such as Graphics Data System II (GDS II), Open Artwork System Interchange Standard (OASIS), or a similar format.
[0102] In some implementations, software-based hardware models, as well as HDL and other functional description language objects, may include register transfer language (RTL) files, among other examples. Such objects may be machine parsable, such that a design tool can accept an HDL object (or model), parse the HDL object for attributes of the described hardware, and determine a physical circuit and / or on-chip layout from the object. The output of the design tool can be used in the manufacture of a physical device. For example, the design tool can determine the configuration of various hardware and / or firmware elements from the HDL object, such as bus widths, registers (including sizes and types), memory blocks, physical link paths, fabric topology, among other attributes that would be implemented to realize the system modeled in the HDL object. Design tools may include tools that determine the topology and fabric configuration of systems-on-chips (SoCs) and other hardware devices. In some examples, the HDL objects can be used as a basis for developing models and design files that can be used by manufacturing equipment to manufacture the described hardware. In fact, the HDL objects themselves may be provided as input to manufacturing system software that results in the manufacture of the described hardware.
[0103] In any representation of the design, the data representing the design may be stored on any form of machine-readable medium. Memory, or magnetic or optical storage devices such as disks, may be machine-readable media that store such information transmitted via light or radio waves modulated or otherwise generated to transmit the information. When an electrical carrier wave indicating or carrying the code or design is transmitted, to the extent that copying, buffering, or retransmission of the electrical signal occurs, a new copy is made. Thus, a communications provider or network provider may at least temporarily store articles, such as information encoded in a carrier wave, that embody the techniques of embodiments of the present disclosure on a tangible machine-readable medium.
[0104] In various embodiments, a medium storing a representation of the design may be provided to a manufacturing system (e.g., a semiconductor manufacturing system capable of manufacturing integrated circuits and / or related components). The design representation may instruct the system to manufacture a device capable of performing any combination of the functions described above. For example, the design representation may instruct the system as to which components to manufacture, how the components should be joined together, where the components should be placed on the device, and / or other suitable specifications for the device to be manufactured.
[0105] Thus, one or more aspects of at least one embodiment may be implemented by representative instructions stored on a machine-readable medium that represent various logic within a processor, which, when read by the machine, causes the machine to produce logic that performs the techniques described herein. Such representations, often referred to as "IP cores," may be stored on non-transitory, tangible, machine-readable media and supplied to various customers or manufacturing facilities for loading into fabrication machines that produce the logic or processors.
[0106] The embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of such implementation approaches. The embodiments of the present disclosure may be implemented as a computer program or program code running on a programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0107] Program code, such as code 1230 shown in Figure 12, may be applied to the input instructions to perform the functions described herein and to generate output information. The output information may be applied to one or more output devices, in known fashion. For purposes of this application, a processing system includes any system that has a processor, such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0108] The program code may be implemented in a high level procedural or object oriented programming language to communicate with a processing system. The program code may also be implemented in assembly or machine language, as desired. Indeed, the mechanisms described herein are not limited in scope to any particular programming language. In various embodiments, the language may be a compiled or interpreted language.
[0109] The above-described method, hardware, software, firmware, or code embodiments may be realized by instructions or codes stored on a machine-accessible, machine-readable, computer-accessible, or computer-readable medium that is executable (or otherwise accessible) by a processing element. A machine-accessible / readable medium includes any mechanism that provides (i.e., stores and / or transmits) information in a form readable by a machine, such as a computer or electronic system. For example, machine-accessible media include random access memory (RAM), such as static RAM (SRAM) or dynamic RAM (DRAM), ROM, magnetic or optical storage media, flash memory devices; electrical storage devices; optical storage devices; acoustic storage devices; other forms of storage devices that hold information received from a non-transitory (propagation) signal (e.g., carrier wave, infrared signal, digital signal), and the like, which should be distinguished from non-transitory media from which information may be received.
[0110] The instructions used to program the logic to execute the embodiments of the present disclosure may be stored in memory within the system, such as DRAM, cache, flash memory, or other storage device. Additionally, the instructions may be distributed over a network or using other computer readable media. Thus, a machine readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including, but not limited to, floppy diskettes, optical disks, compact disks, read-only memories (CD-ROMs) and magneto-optical disks, read-only memories (ROMs), random access memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or tangible machine readable storage devices used to transmit information over the Internet via electrical, optical, acoustic, or other forms of propagated signals (e.g., carrier waves, infrared signals, digital signals, etc.). Accordingly, machine-readable media includes any type of tangible machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).
[0111] Any suitable logic may be used to implement any of the functionality of various components, such as the CPU 102, matrix processing unit 104, arithmetic engine 104, memory 106, FMAs 302, 304, 406, and 408, control module 412, lookup table 112 or 410, control register 110, post-processing module 414, FPGA 700, other components described herein, or any subcomponents of any of these components. "Logic" may refer to hardware, firmware, software, and / or combinations of each for performing one or more functions. As an example, logic may include hardware, such as a microcontroller or processor, associated with a non-transitory medium that stores code adapted to be executed by the microcontroller or processor. Thus, in one embodiment, reference to logic refers to hardware that is specifically configured to recognize and / or execute code held on the non-transitory medium. Additionally, in another embodiment, the use of logic refers to a non-transitory medium that includes code specifically adapted to be executed by a microcontroller to perform a predetermined operation. As can be inferred, in yet another embodiment, the term logic (in this example) may refer to a combination of hardware and non-transitory media. In various embodiments, logic may include a microprocessor or other processing element operable to execute software instructions, discrete logic such as an application specific integrated circuit (ASIC), a programmed logic device such as a field programmable gate array (FPGA), a memory device containing instructions, a combination of logic devices (e.g., as found on a printed circuit board), or other suitable hardware and / or software. Logic may include one or more gates or other circuit components, which may be realized, for example, by transistors. In some embodiments, logic may be embodied completely as software. Software may be embodied as a software package, code, instructions, instruction sets, and / or data recorded on a non-transitory computer-readable storage medium.Firmware may be embodied as code, instructions or instruction sets, and / or data hard-coded (e.g., non-volatile) into a memory device. Logical boundaries that are often depicted as separate typically vary and potentially overlap. For example, first and second logic may share hardware, software, firmware, or a combination thereof, while potentially retaining some independent hardware, software, or firmware.
[0112] Use of the phrases "to" or "configured to" refers, in one embodiment, to arranging, placing together, manufacturing, offering for sale, importing, and / or designing an apparatus, hardware, logic, or element to perform a specified or determined task. In this example, an apparatus or element thereof that is not in operation is still "configured" to perform said specified task if it is designed, coupled, and / or interconnected to perform said specified task. As a purely illustrative example, a logic gate may provide a 0 or a 1 during operation. However, a logic gate that is "configured to" provide an enable signal to a clock does not include every potential logic gate that may provide a 1 or a 0. Instead, a logic gate is one that is coupled in some way that, during operation, its output of 1 or 0 enables the clock. Again, note that use of the term "configured to" does not require operation, but instead focuses on the potential state of the apparatus, hardware, and / or element, in which the apparatus, hardware, and / or element is designed to perform a particular task when the apparatus, hardware, and / or element is in operation.
[0113] Additionally, in one embodiment, use of the phrases "capable of" and / or "operable to" refers to any device, logic, hardware, and / or element designed to enable use of the device, logic, hardware, and / or element in a particular manner. As noted above, in one embodiment, use of capable of or operable to refers to the underlying state of the device, logic, hardware, and / or element, where the device, logic, hardware, and / or element is not operating but is designed to enable use of the device in a particular manner.
[0114] Value, as used herein, includes any known representation of a number, state, logical state, or binary logical state. Often, the use of logic levels, logical values, or logical values, referred to as ones and zeros, simply represents a binary logical state. For example, a one refers to a high logic level and a zero refers to a low logic level. In one embodiment, a storage cell, such as a transistor or flash cell, may be capable of holding a single logical value or multiple logical values. However, other value representations in computer systems have been used. For example, the decimal number 10 may be represented as a binary value of 1010 and the hexadecimal character A. Thus, a value includes any representation of information that can be held in a computer system.
[0115] Additionally, a state may be represented by a value or a portion of a value. As an example, a first value, such as a logical one, may represent a default or initial state, and a second value, such as a logical zero, may represent a non-default state. Additionally, the terms reset and set, in one embodiment, refer to default and updated values or states, respectively. For example, a default value potentially includes a high logical value, i.e., reset, while an updated value potentially includes a low logical value, i.e., set. It is noted that any combination of values may be utilized to represent any number of states.
[0116] The following examples pertain to embodiments according to the present specification. Example 1 is a processor including: a memory storing a plurality of entries, each entry of the plurality of entries associated with a portion of a range of input values, each entry of the plurality of entries including a set of coefficients defining a power series approximation; and an arithmetic engine including circuitry for selecting a first entry of the plurality of entries based on a determination that a floating-point input value is within a portion of a range of input values associated with the first entry, and for calculating an output value by evaluating the power series approximation defined by the set of coefficients of the first entry at the floating-point input value.
[0117] Example 2 may include the subject matter of example 1, in which the arithmetic engine selects a second entry from the plurality of entries based on a determination that a second floating-point input value is within a portion of a range of input values associated with the second entry, and calculates a second output value by evaluating a power series approximation defined by a set of coefficients of the second entry at the second floating-point input value.
[0118] Example 3 may include the subject matter of any one of examples 1-2, wherein the evaluated power series approximation is a0+a1x+a2x 2 where x is the floating-point input value, and a0, a1, and a2 are the coefficient set of the first entry.
[0119] Example 4 may include the subject matter of any one of Examples 1-3, wherein the range is a first range of a plurality of ranges, and the arithmetic engine determines that the floating-point input value is within the first range by comparing the floating-point input value to a plurality of starting values of the plurality of ranges.
[0120] Example 5 may include the subject matter of example 4, wherein the memory stores a second plurality of entries, each entry of the second plurality of entries associated with a portion of a range of second input values, and each entry of the second plurality of entries includes a set of coefficients defining a power series approximation.
[0121] Example 6 may include the subject matter of any one of Examples 1-5, and wherein the selection of the first entry is further based on a determination that the request specifies a first unary function among a plurality of unary functions executable by the arithmetic engine.
[0122] Example 7 may include the subject matter of example 6, wherein the arithmetic engine is further configured to extract a mantissa from a second floating-point input in response to a request specifying a second one of the plurality of unary functions and evaluate a power series approximation on the extracted mantissa excluding an exponent and a sign of the second floating-point input, the power series approximation being defined by coefficients retrieved from the memory based on the second floating-point input.
[0123] Example 8 may include the subject matter of any one of Examples 1-7, wherein the arithmetic engine determines that the second floating-point input value corresponds to a special case and outputs a value corresponding to the special case.
[0124] Example 9 may include the subject matter of any one of Examples 1-8, wherein the range is a first range of a plurality of ranges associated with a unary function, and the arithmetic engine determines that a second floating-point input is within a second range of the plurality of ranges, determines that the second range is designated to operate in a constant mode, and outputs a constant associated with the second range as a second output value.
[0125] Example 10 may include the subject matter of any one of Examples 1-9, wherein the range is a first range of a plurality of ranges associated with a unary function, and the arithmetic engine determines that a second floating-point input is within a second range of the plurality of ranges, determines that the second range is designated to operate in an identity mode, and outputs the second floating-point input as a second output value.
[0126] Example 11 is a method that includes storing a plurality of entries, each entry of the plurality of entries associated with a portion of a range of input values, each entry of the plurality of entries including a set of coefficients defining a power series approximation; selecting a first entry of the plurality of entries based on a determination that a floating-point input value is within the portion of a range of input values associated with the first entry; and calculating an output value by evaluating the power series approximation defined by the set of coefficients of the first entry at the floating-point input value.
[0127] Example 12 may include the subject matter of Example 11, further including: selecting a second entry from the plurality of entries based on a determination that a second floating-point input value is within a portion of a range of input values associated with the second entry; and calculating a second output value by evaluating a power series approximation defined by a set of coefficients of the second entry at the second floating-point input value.
[0128] Example 13 may include the subject matter of any one of examples 11-12, wherein the evaluated power series approximation is a0+a1x+a2x 2 where x is the floating-point input value, and a0, a1, and a2 are the coefficient set of the first entry.
[0129] Example 14 may include the subject matter of any one of Examples 11-13, and further includes determining that the floating-point input value is within the first range by comparing the floating-point input value to a plurality of starting values of the plurality of ranges, the range being a first range of a plurality of ranges.
[0130] Example 15 may include the subject matter of Example 14, further including storing a second plurality of entries, each entry of the second plurality of entries associated with a portion of a range of second input values, each entry of the second plurality of entries including a set of coefficients defining a power series approximation.
[0131] Example 16 may include the subject matter of any one of Examples 11-15, wherein the selection of the first entry is further based on a determination that the request specifies a first unary function among a plurality of unary functions executable by the arithmetic engine.
[0132] Example 17 may include the subject matter of example 16, and further including: extracting a mantissa from a second floating-point input in response to a request specifying a second unary function of the plurality of unary functions; and evaluating a power series approximation on the extracted mantissa excluding an exponent and a sign of the second floating-point input, the power series approximation being defined by coefficients derived based on the second floating-point input.
[0133] Example 18 may include the subject matter of any one of Examples 11 to 17, and further includes determining that the second floating-point input value corresponds to a special case; and outputting a value corresponding to the special case.
[0134] Example 19 may include the subject matter of any one of Examples 11-18, and further includes determining that the range is a first range of a plurality of ranges associated with a unary function and that a second floating-point input is within a second range of the plurality of ranges; determining that the second range is designated to operate in a constant mode; and outputting a constant associated with the second range as a second output value.
[0135] Example 20 may include the subject matter of any one of Examples 11-19, and further includes determining that the range is a first range of a plurality of ranges associated with a unary function and that a second floating-point input is within a second range of the plurality of ranges; determining that the second range is designated to operate in an identity mode; and outputting the second floating-point input as a second output value.
[0136] Example 21 is a system that includes a first memory including a plurality of configuration registers that specify a configuration of a plurality of unary functions; a second memory that stores a plurality of entries associated with a first unary function of the plurality of unary functions, each entry of the plurality of entries associated with a portion of a range of input values, each entry of the plurality of entries including a set of coefficients defining a power series approximation; and an arithmetic engine that selects a first entry of the plurality of entries based on a determination that a floating-point input value is within the portion of a range of input values associated with the first entry, and calculates an output value by evaluating the power series approximation defined by the set of coefficients of the first entry at the floating-point input value.
[0137] Example 22 may include the subject matter of example 21, wherein the second memory stores a second plurality of entries associated with a second unary function of the plurality of unary functions, each entry of the second plurality of entries associated with a portion of a range of second input values, and each entry of the second plurality of entries includes a set of coefficients defining a power series approximation.
[0138] Example 23 may include the subject matter of any one of examples 21-22, further including a matrix processing unit including the arithmetic engine.
[0139] Example 24 may include the subject matter of any one of examples 21-23, wherein the arithmetic engine includes a plurality of fused multiply-adders that evaluate the power series approximation.
[0140] Example 25 may include the subject matter of any one of Examples 21-24, and further includes a battery communicatively coupled to a processor including the arithmetic engine, a display communicatively coupled to the processor, or a network interface communicatively coupled to the processor.
[0141] References herein to "one embodiment" or "one embodiment" mean that a particular feature, structure, or characteristic described in connection with an embodiment is included in at least one embodiment of the present disclosure. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification do not necessarily refer to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0142] In the foregoing specification, a detailed description has been given with reference to certain exemplary embodiments. It will be apparent, however, that various modifications and changes may be made thereto without departing from the broader spirit and scope of the present disclosure as set forth in the appended claims. The specification and drawings should therefore be interpreted in an illustrative and not a restrictive sense. Moreover, the use of the foregoing embodiment and other exemplary language does not necessarily refer to the same embodiment or the same example, but may refer to different and distinct embodiments, as well as potentially the same embodiment.
Claims
1. a memory storing a plurality of entries, each entry of the plurality of entries associated with a portion of a range of input values, each entry of the plurality of entries including a set of coefficients defining a power series approximation; selecting a first entry from the plurality of entries based on determining that the floating-point input value is within a portion of a range of input values associated with the first entry; Calculating an output value by evaluating a power series approximation defined by the first entry's set of coefficients at the floating-point input value. an arithmetic engine including a circuit; Including, the selection of the first entry is further based on a determination that the request specifies a first unary function of a plurality of unary functions executable by the arithmetic engine; The arithmetic engine comprises: extracting a mantissa from a second floating-point input value in response to a request specifying a second one of the plurality of unary functions; a processor for evaluating a power series approximation for the extracted mantissa excluding an exponent and a sign of the second floating-point input value, the power series approximation being defined by a set of coefficients retrieved from the memory based on the second floating-point input value.
2. The arithmetic engine comprises: selecting a second entry from the plurality of entries based on determining that a third floating-point input value is within a portion of a range of input values associated with the second entry; calculating a second output value by evaluating a power series approximation defined by the set of coefficients of the second entry at the third floating-point input value; The processor of claim 1 .
3. The evaluated power series approximation is a 0 +a 1 x+a 2 x 2 where x is the floating-point input value, and a 0 , a 1 , and a 2 The processor of claim 1 , wherein: is the coefficient set of the first entry.
4. 2. The processor of claim 1, wherein the range is a first range of a plurality of ranges, and the arithmetic engine determines that the floating-point input value is within the first range by comparing the floating-point input value to a plurality of starting values of the plurality of ranges.
5. 5. The processor of claim 4, wherein the memory stores a second plurality of entries, each entry of the second plurality of entries associated with a portion of a range of second input values, and each entry of the second plurality of entries includes a set of coefficients defining a power series approximation.
6. The processor of claim 1 , wherein the arithmetic engine determines that a third floating-point input value corresponds to a special case and outputs a value corresponding to the special case.
7. The range is a first range of a plurality of ranges associated with a unary function, and the arithmetic engine: determining that a third floating-point input value is within a second range of the plurality of ranges; determining that the second range is designated to operate in a constant mode; outputting a constant associated with the second range as a second output value; The processor of claim 1 .
8. The range is a first range of a plurality of ranges associated with a unary function, and the arithmetic engine: determining that a third floating-point input value is within a second range of the plurality of ranges; determining that the second range is designated to operate in identity mode; outputting the third floating-point input value as a second output value; The processor of claim 1 .
9. storing a plurality of entries, each entry of the plurality of entries associated with a portion of a range of input values, each entry of the plurality of entries including a set of coefficients defining a power series approximation; selecting a first entry from the plurality of entries based on a determination that the floating-point input value is within a portion of a range of input values associated with the first entry; calculating an output value by evaluating a power series approximation defined by the coefficient set of the first entry at the floating-point input value; Including, the selection of the first entry is further based on a determination that the request specifies a first unary function of a plurality of unary functions executable by an arithmetic engine; The arithmetic engine comprises: extracting a mantissa from a second floating-point input value in response to a request specifying a second one of the plurality of unary functions; evaluating a power series approximation for the extracted mantissa excluding an exponent and a sign of the second floating-point input value, the power series approximation being defined by a set of coefficients of an entry selected from the plurality of entries based on the second floating-point input value.
10. selecting a second entry from the plurality of entries based on a determination that a third floating point input value is within a portion of a range of input values associated with the second entry; calculating a second output value by evaluating a power series approximation defined by the second entry's coefficient set at the third floating-point input value; The method of claim 9 further comprising:
11. The evaluated power series approximation is a 0 +a 1 x+a 2 x 2 where x is the floating-point input value, and a 0 , a 1 , and a 2 The method of claim 9 , wherein: x is the coefficient set of the first entry.
12. 10. The method of claim 9, further comprising: storing a second plurality of entries, each entry of the second plurality of entries associated with a portion of a range of second input values, each entry of the second plurality of entries including a set of coefficients defining a power series approximation.
13. a first memory including a plurality of configuration registers for specifying configurations of a plurality of unary functions; a second memory storing a plurality of entries associated with a first one of the plurality of unary functions, each entry of the plurality of entries associated with a portion of a range of input values, each entry of the plurality of entries including a set of coefficients defining a power series approximation; selecting a first entry from the plurality of entries based on determining that the floating-point input value is within a portion of a range of input values associated with the first entry; Calculating an output value by evaluating a power series approximation defined by the first entry's set of coefficients at the floating-point input value. An arithmetic engine; Including, the selection of the first entry is further based on a determination that the request specifies a first unary function of a plurality of unary functions executable by the arithmetic engine; The arithmetic engine comprises: extracting a mantissa from a second floating-point input value in response to a request specifying a second one of the plurality of unary functions; evaluating a power series approximation for the extracted mantissa excluding the exponent and sign of the second floating-point input value, the power series approximation being defined by a set of coefficients retrieved from the second memory based on the second floating-point input value.
14. 14. The system of claim 13, wherein the second memory stores a second plurality of entries associated with a third unary function of the plurality of unary functions, each entry of the second plurality of entries associated with a portion of a range of second input values, and each entry of the second plurality of entries includes a set of coefficients defining a power series approximation.
15. The system of claim 13 further comprising a matrix processing unit that includes the arithmetic engine.
16. The system of claim 13 , wherein the arithmetic engine includes a plurality of fused multiply-adders that evaluate the power series approximation.
17. 14. The system of claim 13, further comprising: a battery communicatively coupled to a processor including the arithmetic engine; a display communicatively coupled to the processor; or a network interface communicatively coupled to the processor.
18. means for storing a plurality of entries, each entry of said plurality of entries associated with a portion of a range of input values, each entry of said plurality of entries including a set of coefficients defining a power series approximation; means for selecting a first entry from the plurality of entries based on a determination that the floating-point input value is within a portion of a range of input values associated with the first entry; means for calculating an output value by evaluating a power series approximation defined by the first entry's set of coefficients at the floating point input value; Including, the selection of the first entry is further based on a determination that the request specifies a first unary function of a plurality of unary functions executable by an arithmetic engine; The arithmetic engine comprises: extracting a mantissa from a second floating-point input value in response to a request specifying a second one of the plurality of unary functions; evaluating a power series approximation for the extracted mantissa excluding the exponent and sign of the second floating-point input value, the power series approximation being defined by a set of coefficients retrieved from the means for storing based on the second floating-point input value.
19. means for selecting a second entry from the plurality of entries based on a determination that a third floating point input value is within a portion of a range of input values associated with the second entry; means for calculating a second output value by evaluating a power series approximation defined by the second set of coefficients of the second entry at the third floating point input value; 20. The system of claim 18, further comprising:
20. The evaluated power series approximation is a 0 +a 1 x+a 2 x 2 where x is the floating-point input value, and a 0 , a 1 , and a 2 The system of claim 18 , wherein: is the coefficient set of the first entry.
21. 20. The system of claim 18, further comprising: means for storing a second plurality of entries, each entry of the second plurality of entries associated with a portion of a range of second input values, each entry of the second plurality of entries including a set of coefficients defining a power series approximation.
Citation Information
Patent Citations
Polynominal matrix processor and its method
JP1998111865A
Data processor, data processing method and arithmetic control program
JP2006323710A
Computing device, computing method and computer program
JP2018092294A
Converting mathematical functions to power series
US20040044710A1
Piecewise polynomial evaluation instruction
US20180081634A1
