Bias-based FMAC device and method
The bias-based FMAC device dynamically adjusts bias values to match AI data patterns, enhancing computational efficiency and accuracy in AI operations by optimizing exponent and mantissa processing.
Patent Information
- Application Number
- PCT/KR2026/004550
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-05-23
- Filing Date
- 2026-03-20
- Publication Date
- 2026-11-26
Smart Images

Figure KR2026004550_26112026_PF_FP_ABST
Abstract
Description
Bias-based FMAC device and method
[0001] The present invention relates to a floating-point operation optimization technique for artificial intelligence operations, and more specifically, to a bias-based FMAC device and method that improves operation accuracy and speed by variably adjusting the bias according to the data pattern of the artificial intelligence operation.
[0002]
[0003] Floating-point operations in computer systems are essential for scientific calculations, signal processing, and artificial intelligence (AI) model computations. In particular, as the volume of Multiply and Accumulate (MAC) operations in AI computations increases exponentially, efficient Floating Point Multiply and Accumulate (FMAC) computation technology is required. Generally, floating-point operations follow the IEEE 754 standard and represent numbers using a sign, exponent, and mantissa. Existing FMAC devices represent the exponent using a fixed bias value defined in the IEEE 754 standard; while this method has the advantage of simplifying the computation structure, it has limitations that degrade computational efficiency and accuracy in certain data patterns.
[0004] Since existing FMAC computation structures utilize a fixed bias method, a problem may arise where they fail to provide optimized floating-point representations in various artificial intelligence computing environments. In particular, weights and input data used in neural network computations tend to be distributed within a specific range of values, and this data distribution is determined after the training process. However, because existing FMAC structures cannot adjust bias values to match data patterns in specific application fields, it is difficult to improve computational performance through the optimization of exponential representations.
[0005] Recently, as AI models require high-speed computation, FMAC computation technology capable of applying variable bias has become necessary. While the existing IEEE 754 standard sets bias values symmetrically and fixedly, asymmetric bias adjustment techniques are required because AI computation is likely to be performed intensively within specific value ranges. Furthermore, with the introduction of low-precision floating-point computation methods such as FP16 and FP8 to accelerate AI computation, technology capable of applying bias optimized for specific application fields—rather than the existing static bias method—is becoming essential.
[0006] If bias in FMAC calculations can be variably adjusted based on AI training data, hardware efficiency can be maximized while maintaining computational accuracy. In particular, for floating-point operations used in AI models, learning specific operation patterns and applying the optimal bias can improve the efficiency of exponential representation and enhance computation speed.
[0007] Korean Published Patent No. 10-2023-0078963 relates to a method and apparatus for computation in the fields of chips and artificial intelligence within the field of computer technology, comprising the steps of: obtaining a plurality of first fixed points and a plurality of first exponents in a binary representation corresponding to a plurality of first floating points and a plurality of second floating points in a binary representation corresponding to a plurality of second floating points, based on a plurality of first floating points of a first vector input to the computation apparatus, wherein the plurality of first floating points correspond one-to-one with a plurality of second floating points, and each fixed point among the plurality of first fixed points and the plurality of second fixed points includes a sign bit and a first preset quantity of fixed point number bits; and obtaining a fixed point multiplication value and a corresponding fixed point multiplication exponent of each first fixed point among the plurality of first fixed points and a second fixed point corresponding to the first fixed point. The method includes the step of obtaining a fixed-point dot product calculation result of a first vector and a second vector based on a fixed-point product exponent corresponding to each fixed-point multiplication value among a plurality of fixed-point multiplication values corresponding to a plurality of first fixed-point points; and the step of obtaining a floating-point dot product calculation result of a floating-point data format corresponding to the fixed-point dot product calculation result based on the fixed-point dot product calculation result.
[0008]
[0009] [Prior Art Literature]
[0010] [Patent Literature]
[0011] Korean Published Patent No. 10-2023-0078963 (June 5, 2023)
[0012]
[0013] One embodiment of the present invention aims to provide a bias-based FMAC device and method capable of optimizing the expression of the exponent part by variably adjusting the bias according to the data pattern of the artificial intelligence operation.
[0014] One embodiment of the present invention aims to provide a bias-based FMAC device and method that can improve computational efficiency and accuracy by asymmetrically setting the positive and negative regions of the exponent during FMAC computation.
[0015] One embodiment of the present invention aims to provide a bias-based FMAC device and method that can improve computation speed and maximize hardware resource utilization by applying an optimal floating-point representation scheme for artificial intelligence computation.
[0016]
[0017] Among the embodiments, the bias-based FMAC device includes: a bias exponent processing module that receives a bias that can be variably set according to artificial intelligence computation or external input or fixed according to an application field, applies the bias to a target for computation to generate a bias exponent, performs exponent processing on the bias exponent, and outputs a bias exponent result; a mantissa multiplication processing module that receives a mantissa for the target for computation, performs mantissa processing, and outputs a mantissa result; a mantissa addition processing module that performs a shift addition operation on the mantissa result and outputs a shift addition result; and a variable floating point processing module that performs a regular shift operation based on the shift addition result to output a regular shift result, and exponentiates the bias exponent result according to the regular shift result to output a bias-applied FMAC (Floating Point Multiply and Accumulate) result.
[0018] The above bias index processing module can generate the bias index part by adjusting the bias to asymmetrically express the negative and positive parts of the index part.
[0019] The above bias index processing module can dynamically set the bias based on the data pattern according to the above artificial intelligence operation.
[0020] The above bias index processing module can automatically readjust the bias to maintain an optimal index expression when the bias exceeds a predefined optimal range.
[0021] The above bias index processing module can add the bias during the addition process of the first and second bias index parts among the first to third bias index parts constituting the bias index section, and obtain the difference in index between the result of the addition process and the third bias index part.
[0022] The above-mentioned mantissa multiplication processing module performs a multiplication process for the first and second mantissa parts among the first to third mantissa parts constituting the mantissa part, receives the difference in exponents from the above-mentioned bias exponent processing module, and can determine the part with a relatively large exponent and the part with a relatively small exponent among the third mantissa parts based on the result of the multiplication process.
[0023] The mantissa addition processing module can generate the shift addition result by performing an alignment shift operation on a part with a relatively small exponent input from the mantissa multiplication processing module and performing addition on the aligned shift part and the part with a relatively large exponent.
[0024] The variable floating point processing module can perform the exponent adjustment on the exponent difference received from the bias exponent processing module, the result of the leading zero count operation on the shift addition result, and the result of the regular shift operation rounded up.
[0025] Among the embodiments, a bias-based FMAC method performed in a bias-based FMAC device comprises: a bias input that can be variably set according to artificial intelligence computation or external input or fixed according to an application field, a bias input that applies the bias to a target for computation to generate a bias exponent part, and performs exponent processing on the bias exponent part to output a bias exponent part result; a mantissa multiplication processing step that receives a mantissa part for the target for computation and performs mantissa processing to output a mantissa part result; a mantissa addition processing step that performs a shift addition operation on the mantissa part result to output a shift addition result; and a variable floating point processing step that performs a regular shift operation based on the shift addition result to output a regular shift result, and exponentiates the bias exponent part result according to the regular shift result to output a bias-applied FMAC (Floating Point Multiply and Accumulate) result.
[0026] Among the embodiments, in an artificial intelligence computing system including a bias-based FMAC (Floating Point Multiply and Accumulate) device, the bias-based FMAC device comprises: a bias exponent processing module that receives a bias which can be variably set according to artificial intelligence computing or external input or fixed according to an application field, applies the bias to a target of computation to generate a bias exponent, performs exponent processing on the bias exponent, and outputs a bias exponent result; a mantissa multiplication processing module that receives a mantissa for the target of computation and performs mantissa processing to output a mantissa result; a mantissa addition processing module that performs a shift addition operation on the bias exponent result and the mantissa result to output a shift addition result; and a variable floating point processing module that performs a regular shift operation based on the shift addition result to output a regular shift result, and outputs a bias-applied FMAC result by exponentiating the bias exponent result according to the regular shift result.
[0027]
[0028] The disclosed technology may have the following effects. However, this does not mean that a specific embodiment must include all of the following effects or only the following effects; therefore, the scope of the rights of the disclosed technology should not be understood as being limited by this.
[0029] A bias-based FMAC device and method according to one embodiment of the present invention can optimize the expression of the exponent part by variably adjusting the bias according to the data pattern of the artificial intelligence operation.
[0030] A bias-based FMAC device and method according to one embodiment of the present invention can improve computational efficiency and accuracy by asymmetrically setting the positive and negative regions of the exponent part during FMAC computation.
[0031] A bias-based FMAC device and method according to one embodiment of the present invention can improve computation speed and maximize hardware resource utilization by applying an optimal floating-point representation method for artificial intelligence computation.
[0032]
[0033] Figure 1 is a diagram illustrating the processing structure of a traditional FMAC (Floating Point Multiply and Accumulate) operation.
[0034] FIG. 2 is a drawing illustrating a bias-based FMAC device according to one embodiment of the present invention.
[0035] Figure 3 is a diagram illustrating the configuration of the bias-based FMAC device of Figure 2.
[0036] FIG. 4 is a flowchart illustrating the functional configuration of a bias-based FMAC device according to the present invention.
[0037] FIG. 5 is a diagram illustrating the process of converting FP32 (32-bit floating-point) data into FP16 (16-bit floating-point) based on a bias-based FMAC device according to one embodiment of the present invention.
[0038] FIGS. 6 and 7 are drawings illustrating an experimental process for verifying the function of a bias-based FMAC device according to an embodiment of the present invention.
[0039]
[0040] The description of the present invention is merely an example for structural or functional explanation, and therefore the scope of the present invention should not be interpreted as being limited by the examples described in the text. That is, since the examples are subject to various modifications and may take various forms, the scope of the present invention should be understood to include equivalents capable of realizing the technical concept. Furthermore, the objectives or effects presented in the present invention do not imply that a specific example must include all of them or only such effects; therefore, the scope of the present invention should not be understood as being limited by them.
[0041] Meanwhile, the meaning of the terms described in this application should be understood as follows.
[0042] Terms such as "first," "second," etc., are intended to distinguish one component from another, and the scope of rights shall not be limited by these terms. For example, the first component may be named the second component, and similarly, the second component may be named the first component.
[0043] When it is stated that one component is "connected" to another component, it should be understood that it may be directly connected to that other component, or that there may be other components in between. Conversely, when it is stated that one component is "directly connected" to another component, it should be understood that there are no other components in between. Meanwhile, other expressions describing the relationships between components, such as "between" and "exactly between," or "adjacent to" and "directly adjacent to," should be interpreted in the same way.
[0044] A singular expression should be understood to include a plural expression unless the context clearly indicates otherwise, and terms such as "include" or "have" are intended to specify the existence of the implemented features, numbers, steps, actions, components, parts, or combinations thereof, and should be understood not to preclude the existence or addition of one or more other features, numbers, steps, actions, components, parts, or combinations thereof.
[0045] In each step, identifiers (e.g., a, b, c, etc.) are used for convenience of explanation and do not describe the order of the steps; the steps may occur differently from the specified order unless a specific order is clearly indicated in the context. That is, the steps may occur in the same order as specified, may be performed substantially simultaneously, or may be performed in the reverse order.
[0046] The present invention may be implemented as computer-readable code on a computer-readable recording medium, and the computer-readable recording medium includes all types of recording devices in which data that can be read by a computer system is stored. Examples of computer-readable recording media include ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc. Additionally, the computer-readable recording medium may be distributed across networked computer systems, so that computer-readable code can be stored and executed in a distributed manner.
[0047] Unless otherwise defined, all terms used herein have the same meaning as generally understood by those skilled in the art to which this invention pertains. Terms defined in commonly used dictionaries should be interpreted as having meanings consistent with the context of the relevant technology and should not be interpreted as having an ideal or overly formal meaning unless explicitly defined in this application.
[0048]
[0049] Figure 1 is a diagram illustrating the processing structure of a traditional FMAC (Floating Point Multiply and Accumulate) operation.
[0050] Referring to Fig. 1, a typical processing structure for FMAC (Floating Point Multiply and Accumulate) operations can be divided into a preparation stage for exponent and mantissa operations, a mantissa alignment and addition operation stage, and an exponent correction and final operation stage, and operations can be performed independently on the exponent and mantissa.
[0051] First, in the preparation step for exponent and mantissa operations, the three input floating-point numbers (A, B, and C) can be separated into an exponent part (A_e, B_e, and C_e) and a mantissa part (A_f, B_f, and C_f), and exponent and mantissa operations can be performed respectively. In the preparation step for exponent and mantissa operations, the exponent operation can be performed to add A_e and B_e with a bias value applied (Exp Add) and generate an intermediate exponent value. Here, since the IEEE 754 standard stores the bias value added for exponent representation, each exponent contains the same bias value. Therefore, when adding each exponent, the bias value is applied redundantly, and accordingly, a process of subtracting the bias once after adding the two exponents may be required.
[0052] Subsequently, the exponent and mantissa operation preparation step can calculate the difference between C_e and the intermediate exponent value (Exp Difference) and utilize it in the mantissa alignment (Alignment Shift) process. For example, the difference in exponent values can be used as a reference value for performing a Shift Right operation when aligning a mantissa with a smaller exponent to a larger exponent, thereby ensuring correct alignment during mantissa addition operations. Additionally, the exponent and mantissa operation preparation step can perform a multiplication operation between mantissas A_f and B_f in the mantissa operation, compare with C_f, transfer the mantissa with the larger exponent to the Add operation of the mantissa alignment and addition operation step, and transfer the mantissa with the smaller exponent to the alignment operation (Alignment shift).
[0053] Next, in the mantissa alignment and addition operation step, alignment shift and addition operations can be performed using the exponent difference and mantissa data received from the exponent and mantissa operation preparation step. In the mantissa alignment and addition operation step, alignment of the mantissa can be performed using the exponent difference value calculated in the exponent and mantissa operation preparation step, and alignment operations can be performed by performing a shift operation on the mantissa with the smaller exponent. In the mantissa alignment and addition operation step, an intermediate mantissa result can be generated by adding the aligned mantissas, and the generated intermediate mantissa result value can be transmitted to the exponent correction and final operation step.
[0054] In the exponential adjustment and final operation step, normalization, rounding, and exponential adjustment operations can be performed to output the final floating-point value. Here, the exponential adjustment and final operation step can determine the position of the significant bit by searching for the location of the leading 1 in the addition result using the Leading Zero Count (LZC) technique. Then, based on the LZC information, the exponential adjustment and final operation step can perform a process of adjusting the exponent according to the optimal floating-point representation of the operation result; for example, a normalization shift can be performed to match the significant digits of the mantissa, and an increment to round operation can be performed to maintain the precision of the floating-point representation. Here, the normalization shift is performed based on the result of the Leading Zero Count (LZC) and corresponds to a process to maintain the position of the most significant 1 in the floating-point representation. In addition, Increment to Round can be a process designed to reduce computational errors and maintain accuracy by correcting the result after normalization based on floating-point precision.
[0055] The exponent correction and final operation step performs exponent correction by adjusting the exponent value by reflecting the exponent value and LZC result passed in the exponent and mantissa operation preparation step, combines the final calculated sign, exponent, and mantissa to convert to the IEEE 754 floating-point format, and includes an exception handling process to generate a correct result value.
[0056]
[0057] FIG. 2 is a drawing illustrating a bias-based FMAC device according to one embodiment of the present invention.
[0058] Referring to FIG. 2, a bias-based FMAC device (100) can disclose a method for adjusting the bias value of the exponent part to match the characteristics of the neural network parameter value.
[0059] A bias-based FMAC device (100) can apply a modified bias value set by a user after adding the first and second bias parts (A_e_m, B_e_m) during an exponent addition operation. Here, the first and second bias exponent parts A_e_m and B_e_m may correspond to the exponent values of input floating-point numbers A and B, respectively, and the modified bias may correspond to a bias value that the user can directly set according to a specific application field. That is, the bias-based FMAC device (100) can perform optimized floating-point operations by applying a modified bias to the bias exponent values of input floating-point numbers instead of using fixed bias values determined in the existing IEEE 754 standard. Here, since duplicate bias values are included when performing the bias exponent addition operation, the bias-based FMAC device (100) can perform a process of additionally correcting the bias by considering the adjusted bias after the exponent addition operation.
[0060] In one embodiment, the bias-based FMAC device (100) can perform an exponent difference operation by calculating the difference with the third bias exponent C_e_m after the exponent addition operation, and perform an alignment operation and mantissa alignment based on the exponent difference value. The bias-based FMAC device (100) can generate an intermediate operation result by performing an alignment shift operation on the mantissa with a smaller exponent based on the exponent difference result and performing an add operation on the aligned mantissa. Here, the bias-based FMAC device (100) can generate an alignment criterion to match the mantissa with a smaller exponent to the mantissa with a larger exponent based on the exponent difference, and can determine an appropriate shift size in the alignment operation based on the exponent difference.
[0061] In one embodiment, a bias-based FMAC device (100) can optimize a floating-point representation by using a Leading Zero Count (LZC) to find the significant digits of the mantissa and performing a Normalization Shift. Then, the bias-based FMAC device (100) can finally perform bias adjustment through an exponent correction step and convert the bias adjustment result into an IEEE 754 floating-point format and output it. After the exponent adjustment step, the bias-based FMAC device (100) can perform a rounding operation to maintain the precision of the floating-point operation during the IEEE 754 format conversion process.
[0062] In conclusion, the bias-based FMAC device (100) can perform floating-point operations optimized for a specific application field by applying a user-specified adjusted bias, unlike the method of adjusting the exponent using a fixed IEEE 754 bias value after exponent addition in the existing FMAC structure. Through this, the bias-based FMAC device (100) can optimize computational precision and improve computational efficiency in a specific neural network computation environment, and in particular, by applying an adjusted bias, it can reduce precision beyond what is necessary and perform operations optimized for the neural network parameter range, thereby allowing for reduced hardware area and reduced power consumption compared to the existing FMAC structure.
[0063]
[0064] Figure 3 is a diagram illustrating the configuration of the bias-based FMAC device of Figure 2.
[0065] Referring to FIG. 3, the bias-based FMAC device (100) may include a bias exponent processing module (310), a mantissa multiplication processing module (330), a mantissa addition processing module (350), a variable floating point processing module (370), and a control module (390).
[0066] The bias-based FMAC device (100) does not need to include all of the above functional configurations simultaneously, and depending on each embodiment, some of the above configurations may be omitted, or some or all of the above configurations may be selectively included. Additionally, the bias-based FMAC device (100) may be implemented as an independent module that selectively includes some of the above configurations, and the bias-based FMAC method according to the present invention may be performed through the interoperability between each module. The operation of each configuration is described in detail below.
[0067]
[0068] The bias index processing module (310) can receive a bias that can be variably set according to artificial intelligence computation or external input, or fixed according to the application field, apply the bias to the computation target to generate a bias index, and perform index processing on the bias index to output a bias index result. Here, the bias may correspond to a value added to optimize a specific computation method or data representation by adjusting the reference point of the computation. Additionally, when receiving external input including image brightness, noise level, computation mode settings, and characteristic information of the artificial intelligence model, the bias may be variably adjusted according to the distribution characteristics of the external input data, and is not necessarily limited thereto, it may be fixed to maintain a constant range of index representation according to the application field including image recognition and speech recognition.
[0069] Additionally, the bias exponent may correspond to an exponent value adjusted to maintain an optimal floating-point representation by correcting the exponent value of the operation target, and may be expressed, for example, as A_e_m, B_e_m, and C_e_m. The operation target may correspond to a data element to which an exponent operation is performed by applying a bias, and may correspond, for example, to input data in the form of floating-point numbers (e.g., A, B, and C). The bias exponent processing module (310) may extract the exponent of the operation target and determine the bias value according to the artificial intelligence operation. For example, the bias exponent processing module (310) may provide the exponent and mantissa information of the floating-point numbers extracted from the operation target as input to an artificial intelligence model to perform learning on operation patterns including the distribution of the exponent of the operation target, operation frequency, and error occurrence pattern. The bias index processing module (310) can lower the bias to 110 if a specific index range (e.g., -10 to 10) is used more frequently than a preset reference index value (e.g., 127) in the artificial intelligence learning results, and conversely, if a large index value is used more frequently than the reference index value (e.g., 200 to 1000), the bias can be raised to 250.
[0070] Additionally, the bias index processing module (310) can perform a calculation process to maintain an optimal index representation based on the bias index. For example, the bias index processing module (310) can check the bias index after applying the bias and analyze the size difference between the bias index of the calculation target to perform an alignment calculation. Additionally, the bias index processing module (310) can perform automatic correction on the index value to prevent overflow and underflow of the bias index, and for example, if the index value becomes too large (e.g., greater than 255) or too small (e.g., 0 or less) after applying the bias, it can perform automatic correction to adjust the bias index value. In one embodiment, the bias index processing module (310) can output a bias index result as a final index value after applying the bias to the calculation target and performing index processing.
[0071] In one embodiment, the bias exponent processing module (310) can generate a bias exponent by adjusting the bias to asymmetrically represent the negative and positive parts of the bias exponent. Here, the bias exponent processing module (310) can dynamically adjust the bias value by considering the computation environment, including the distribution of the exponent value of the computation target, computation load, and precision requirements. For example, the bias exponent processing module (310) can dynamically adjust the bias exponent by analyzing the distribution of the exponent value of the computation target based on an artificial intelligence model, deriving a computation pattern, and predicting a bias value suitable for the corresponding computation pattern. That is, the bias exponent processing module (310) can determine the optimal bias value based on the computation pattern of the computation target and adjust the expression range of the bias exponent.
[0072] Additionally, the bias exponent processing module (310) can adjust the bias to set the ranges of negative and positive numbers in the bias exponent, respectively. For example, the bias exponent processing module (310) can increase the expression range of small numbers and decrease the expression range of large numbers as needed in a specific operation environment. That is, the bias exponent processing module (310) can adjust the bias to match the exponent range frequently used in actual operations. For example, if more bias exponents corresponding to negative numbers are needed in a specific operation environment, the negative range can be expanded, and if more bias exponents corresponding to positive numbers are needed, the positive range can be expanded, not necessarily limited to this.
[0073] In one embodiment, the bias index processing module (310) can dynamically set the bias based on data patterns resulting from artificial intelligence computation. Here, the bias index processing module (310) can adjust the bias to maximize computation efficiency and accuracy in a specific computation environment by performing an evaluation of the index value distribution and computation pattern of the computation target. For example, the bias index processing module (310) can collect past computation records of the computation targets (A, B, C, etc.) and analyze the index value distribution and index value change patterns of the computation targets to collect data patterns including computation load and performance indicators (computation speed, accuracy, power consumption, etc.) occurring in a specific computation environment. The bias index processing module (310) can provide the collected data patterns as input to an artificial intelligence model to evaluate changes in computation performance according to various bias value settings and derive the optimal bias setting for the computation target. For example, the bias index processing module (310) can analyze the distribution of the index values of the target of calculation and evaluate the change in the calculation speed, accuracy, and error rate in a specific calculation environment.
[0074] In one embodiment, the bias exponent processing module (310) can dynamically adjust the bias in real time by applying a bias adjustment rule to the exponent value distribution and the computation environment of the computation target. Here, the bias adjustment rule may correspond to a computation method that sets the optimal bias based on the exponent value distribution of the computation target, but is not necessarily limited thereto; it may correspond to a method for deriving the optimal bias derived by an artificial intelligence model, including bias optimization according to changes in the computation environment, analysis of computation performance in specific computation patterns, and an adaptive bias adjustment technique for minimizing the cost of exponential alignment computation and improving computation accuracy. For example, the bias exponent processing module (310) can perform bias adjustment that improves computation accuracy and minimizes the cost of alignment computation by analyzing the exponent value pattern of the computation target and predicting the optimal bias based on an artificial intelligence model. The bias exponent processing module (310) can evaluate changes in computation speed and accuracy when applying bias according to the exponent value distribution by providing the range of exponent values that frequently appear in specific computation patterns (e.g., AI weighting computation and physical simulation, etc.) as training data to the artificial intelligence model. The bias index processing module (310) can derive an optimal bias value based on the distribution of index values based on an artificial intelligence model and apply bias adjustment rules to enable dynamic adjustment in real time.
[0075] In one embodiment, the bias exponent processing module (310) can automatically readjust the bias to maintain an optimal exponent representation when the bias exceeds a predefined optimal range. For example, the bias exponent processing module (310) can determine that the optimal range has been exceeded and perform bias readjustment if an overflow or underflow occurs in the exponent value of the operation target when a specific bias is applied. Here, if an underflow occurs because the exponent value of the operation target is too small, the bias exponent processing module (310) can readjust the bias to be lower than the existing bias. Conversely, if an overflow occurs because the exponent value of the operation target is too large, the bias exponent processing module (310) can adjust to process an unexpressible exponent value by applying a bias higher than the existing bias. In addition, the bias index processing module (310) can optimize computation performance by newly setting the bias value through a real-time bias adjustment function when the index value pattern of the computation target changes rapidly during the artificial intelligence computation process and exceeds a predefined optimal range.
[0076] In one embodiment, the bias index processing module (310) can continuously monitor the range of the index value of the currently input operation target and detect cases where it exceeds a specific threshold. For example, the bias index processing module (310) can continuously monitor the range of the index value of the currently input operation target (A, B, C, etc.) during the artificial intelligence operation process and check whether the current bias value has deviated from the optimal range by comparing it with the data pattern learned by the artificial intelligence model. The bias index processing module (310) can determine the bias readjustment method by calculating an optimal bias value that can maintain operation accuracy and efficiency based on the artificial intelligence model and increasing or decreasing the bias. The bias index processing module (310) can update the bias index unit (e.g., A_e_m, B_e_m, and C_e_m) by adjusting the bias according to the bias readjustment method and applying it to the bias index unit of the operation target.
[0077] In one embodiment, the bias index processing module (310) can add a bias during the addition process of the first and second bias index parts among the first to third bias index parts constituting the bias index part, and obtain the difference in index between the result of the addition process and the third bias index part. Here, the bias index processing module (310) can apply a bias to each of the first to third bias index parts to convert the index value of the operation target and then perform an optimized index operation. The bias index processing module (310) can perform an addition operation on the first and second bias index parts (A_e, B_e) for the first bias index part and apply an additional bias value to correct for duplicate bias application during the addition operation, and here, the additionally applied bias value can be determined in advance according to precision.
[0078] Next, the bias index processing module (310) can perform an exponential sorting operation by calculating the difference between the sum result (230) of the first and second bias index parts and the third bias index part (C_e). Here, the bias index processing module (310) can calculate the difference between the sum result (230) of the first and second bias index parts and the third bias index part (C_e) and perform a sorting operation based on the exponential difference. For example, if the exponential difference between the sum result (230) of the first and second bias index parts and the third bias index part (C_e) is greater than a certain standard, the bias index processing module (310) can correct the exponential difference by sorting the mantissa before performing the mantissa operation, for example, if the exponential difference value is 119, the third bias index part can be adjusted upward or the mantissa can be moved to sort. The bias exponent processing module (310) can perform a final operation by correcting the exponent difference and then transmitting the value to the mantissa multiplication processing module (330). That is, the bias exponent processing module (310) can optimize the exponent operation by applying an additional bias during the addition process of the first and second bias exponent parts constituting the bias exponent.
[0079] In one embodiment, the bias exponent processing module (310) can optimize the exponent operation by additionally applying a bias during the addition process of the first and second bias exponent parts. For example, the bias exponent processing module (310) can generate a bias exponent by extracting the exponent values of the operation targets (A, B) and applying a bias set based on artificial intelligence operation. For example, if the original exponent value of operation target A is 3, the exponent value of B is 5, and the exponent value of C is 1, the bias exponent processing module (310) can convert each bias exponent to A_e_m = 113, B_e_m = 115, and C_e_m = 111 when the bias value is set to 110.
[0080] Subsequently, the bias exponent processing module (310) can perform an addition operation on the first and second bias exponent parts (A_e_m, B_e_m) to obtain an addition result of 113 + 115 = 228. Additionally, the bias exponent processing module (310) can adjust the final value to 230 by adding a bias value of 2 to the addition value to perform bias adjustment during the operation process. Through this process, the bias exponent processing module (310) can optimize the exponent operation by applying bias and adjust the operation so that more stable floating-point operations are performed during the operation process.
[0081] The mantissa multiplication processing module (330) can receive a mantissa for the operation target, perform mantissa processing, and output a mantissa result. Here, the mantissa may correspond to a part that stores a valid part of an actual number in floating-point operations. Additionally, the mantissa result may correspond to a mantissa value that maintains an optimized floating-point representation after the mantissa processing operation is completed. The mantissa multiplication processing module (330) can receive a mantissa for the operation target and perform mantissa operations including alignment, multiplication, addition, normalization, and rounding operations by reflecting the difference in exponents. For example, the mantissa multiplication processing module (330) may perform a alignment operation by right-shifting the smaller exponent value to match the exponent value when there is an exponent difference between mantissas, and is not limited to this; it may perform a rounding operation to maintain the optimal number of bits after mantissa operation, or optimize operation performance by truncation if the size of the mantissa exceeds a certain standard. The mantissa multiplication processing module (330) may perform mantissa processing to generate a mantissa result and utilize the generated mantissa result to output the final floating-point result in FMAC operation.
[0082] In one embodiment, the mantissa multiplication processing module (330) performs a multiplication process for the first and second mantissa parts among the first to third mantissa parts constituting the mantissa part, receives the difference in exponents from the bias exponent processing module (310), and can determine the result of the multiplication process and the parts with relatively larger and relatively smaller exponents among the third mantissa parts. Here, the mantissa multiplication processing module (330) can perform a multiplication operation on the first and second mantissa parts (e.g., A_f, B_f) among the mantissa parts of the operation target (e.g., A, B, and C). In floating-point operations, since the mantissa part must be aligned before the operation if the exponent values of each number are different, the mantissa multiplication processing module (330) can receive the difference in exponents from the bias exponent processing module (310), determine the result of the multiplication process and the parts with relatively larger and relatively smaller exponents among the third mantissa parts, and perform a alignment operation. Here, the mantissa multiplication processing module (330) can perform a sorting operation by shifting the mantissa with a relatively small exponent value and perform addition and multiplication operations based on the sorted mantissa to generate a final mantissa result. Here, the mantissa result may correspond to an optimized floating-point mantissa value after undergoing the sorting and operation process, and may correspond to, for example, a normalized mantissa value used to perform the final FMAC (Floating Point Multiply and Accumulate) operation.
[0083] The mantissa addition processing module (350) can perform a shift addition operation on the mantissa result and output a shift addition result. The mantissa addition processing module (350) can generate a final shift addition result by receiving the mantissa result from the mantissa multiplication processing module (330) and then performing a shift addition operation that takes into account the difference in exponents between the received mantissa results. For example, if the exponent of one of at least two mantissa results is relatively small, the mantissa addition processing module (350) can shift the value with the smaller exponent to the right and sort it before performing the shift addition operation, and then perform the shift addition operation based on the sorted mantissa. Additionally, when multiple mantissa results that are not exponent-sorted are input, the mantissa with the smaller exponent is shifted to the right to align with the larger exponent before performing the shift addition operation, and then the shift addition operation is performed based on the aligned mantissa.
[0084] In one embodiment, the mantissa addition processing module (350) can generate a shift addition result by performing an alignment shift operation on a part with a relatively small exponent input from the mantissa multiplication processing module (330) and performing addition on the aligned shift part and the part with a relatively large exponent. Here, the mantissa addition processing module (350) can generate a final shift addition result by finding a part with a relatively small exponent among the mantissa values input from the mantissa multiplication processing module (330), performing an alignment shift operation, and performing a shift addition operation based on the aligned mantissa. First, the mantissa addition processing module (350) can perform a alignment operation by comparing the exponent values of each operation target and shifting the mantissa with a small exponent to the right. Afterwards, the mantissa addition processing module (350) can perform shift addition operations on the aligned mantissas and perform normalization and rounding operations so that the result of the shift operation can maintain an optimal floating-point representation.
[0085] The variable floating point processing module (370) can output a normal shift result by performing a normal shift operation based on the shift addition result and output a bias applied FMAC (Floating Point Multiply and Accumulate) result by adjusting the bias exponent result according to the normal shift result. Here, FMAC may correspond to an operation method that simultaneously performs multiplication and accumulation addition in floating point operations. The variable floating point processing module (370) can convert the mantissa into an optimized state by performing a normal shift operation based on the mantissa and exponent in the shift addition result. For example, the variable floating point processing module (370) can generate an optimized normalized mantissa by detecting the leading zero of the mantissa and shifting the mantissa to the left or right based on the leading zero. Additionally, the variable floating point processing module (370) can generate a final FMAC result by adjusting the exponent value of the bias exponent result according to the normalized mantissa, and, for example, can maximize the accuracy of the FMAC operation and improve the operation speed by determining the optimal exponent representation by performing an operation with the number of shifted bits of the normalized mantissa and the exponent value of the bias exponent.
[0086] The control module (390) controls the overall operation of the bias-based FMAC device (100) and can manage the control flow or data flow between the bias exponent processing module (310), the mantissa multiplication processing module (330), the mantissa addition processing module (350), and the variable floating point processing module (370).
[0087]
[0088] FIG. 4 is a flowchart illustrating the functional configuration of a bias-based FMAC device according to the present invention.
[0089] Referring to FIG. 4, the bias-based FMAC device (100) can receive a bias that can be variably set according to artificial intelligence computation or external input or fixed according to the application field in the bias exponent processing module (310), apply the bias to the target of computation to generate a bias exponent, and perform exponent processing on the bias exponent to output a bias exponent result (step S410). The bias-based FMAC device (100) can receive a mantissa for the target of computation in the mantissa multiplication processing module (330), perform mantissa processing to output a mantissa result (step S430).
[0090] The bias-based FMAC device (100) can output a shift addition result by performing a shift addition operation on the mantissa result in the mantissa addition processing module (350) (step S450). The bias-based FMAC device (100) can output a regular shift result by performing a regular shift operation based on the shift addition result in the variable floating point processing module (370) and output a bias-applied FMAC (Floating Point Multiply and Accumulate) result by adjusting the bias exponent result according to the regular shift result (step S470).
[0091]
[0092] FIG. 5 is a diagram illustrating the process of converting FP32 (32-bit floating-point) data into FP16 (16-bit floating-point) based on a bias-based FMAC device according to one embodiment of the present invention.
[0093] Referring to FIG. 5, the bias-based FMAC device (100) can convert the FP32 mantissa according to the FP16 precision (step S510). Here, the bias-based FMAC device (100) can determine the FP16 mantissa value by rounding the FP32 mantissa value according to the FP16 precision, and if an overflow occurs during the rounding process, it can ensure the accuracy of the operation by adding 1 to the FP32 exponent value to adjust the exponent value while maintaining precision within the expression range of FP16.
[0094] Next, the bias-based FMAC device (100) can convert the bias value of the FP32 exponent part according to FP16 (step S520). For example, the bias-based FMAC device (100) can convert the bias value of the FP32 exponent part according to FP16 by adding the bias value of FP32 to the exponent part value of FP32 and subtracting the adjusted bias value of FP16 in order to change the bias value of the FP32 exponent part to the adjusted bias value of FP16.
[0095] The bias-based FMAC device (100) can apply the converted FP32 exponent as an FP16 exponent following the performance of the bias exponent conversion (step S530). Here, the bias-based FMAC device (100) can prevent overflow and underflow that may occur during the exponent conversion process by adjusting the bias value during the process of converting the FP32 exponent value to an FP16 exponent value and applying an exponent value optimized to fit the expression range of FP16. The bias-based FMAC device (100) can perform an overflow and underflow check on the FP16 exponent value adjusted during the exponent conversion process to check whether the converted FP16 exponent value exceeds the expression range (step S540).
[0096] A bias-based FMAC device (100) can adjust the FP16 value if an overflow or underflow occurs during the exponential conversion process. For example, if an overflow occurs, the bias-based FMAC device (100) can set the FP16 value to a maximum value to maintain the operation result within the maximum range that FP16 can represent and prevent operation errors. Additionally, if an underflow occurs, the bias-based FMAC device (100) can set the FP16 value to a minimum value to clip a small value that exceeds the representation limit of FP16 to the minimum representable value, thereby preventing the operation from terminating abnormally. Here, clipping may correspond to a method of maintaining the exponential value within a defined representation range, and for example, may correspond to a process of limiting the exponential value to a set maximum value or minimum value if the exponential value exceeds a specific range or falls below a minimum value.
[0097] The bias-based FMAC device (100) can determine the final FP16 value by combining the sign bit, exponent, and mantissa and output the FP16 value (step S560). Here, the bias-based FMAC device (100) can maintain the accuracy of the operation result and ensure operation stability by applying clipping after checking for overflow and underflow and optimizing the floating-point representation by normalizing the converted FP16 exponent and mantissa.
[0098]
[0099] FIGS. 6 and 7 are drawings illustrating an experimental process for verifying the function of a bias-based FMAC device according to an embodiment of the present invention.
[0100] In FIGS. 6 and 7, a comparison and analysis with a traditional MAC unit were performed to verify the function of a bias-based FMAC device (100).
[0101] Next, an RTL simulator including the ModelSim (Mentor graphics) tool was used to simulate the test case data generated through Berkeley testFloat in Fig. 6. Here, Berkeley testFloat can be considered a tool for verifying the implementation results of floating-point arithmetic according to IEEE standards. The simulation method was performed as follows. First, test case data for MAC operations was generated in the Berkeley tool. Then, the test module was executed using the test case data generated through the RTL simulator, and the results were verified by comparing them with the output generated by the Berkeley tool. Xilinx Vivado design suite was used to synthesize and implement the written RTL code. Here, Xilinx Vivado design suite can be considered a comprehensive design tool for FPGA (Field-Programmable Gate Array) and SoC (System on Chip) design.
[0102] In FIG. 7, the synthesis result of the bias-based FMAC device (100) proposed in the present invention is compared with the Vivado MAC unit. Here, the target FPGA chip corresponds to the Xilinx Artix-7 200T, and the synthesis was performed with the operating speed set to 125 MHz. (A) is the bias-based FMAC device (100) proposed in the present invention, and (B) and (C) may correspond to MACs generated through the Xilinx Vivado IP catalog. Here, (B) is a case generated by optimizing performance with a delay of 3, and (C) is a case generated by optimizing resources with a delay of 3.
[0103] When comparing resource utilization, for compositing, (A) showed a reduction of 7.29% in LUT and 17.96% in Flip-Flop compared to (B), and a reduction of -1.74% in LUT and 44.17% in Flip-Flop compared to (C). Additionally, for implementation, (A) showed a reduction of 6.9% in LUT and 17.96% in Flip-Flop compared to (B), and a reduction of -0.14% in LUT and 44.17% in Flip-Flop compared to (C). Through this, it can be confirmed that (A) is more advantageous than (B) and (C) when comparing the resource utilization of LUT and Flip-Flop, and in particular, it is very advantageous in terms of hardware resource utilization as Flip-Flop usage is significantly reduced.
[0104]
[0105] Although the present invention has been described above with reference to preferred embodiments, those skilled in the art will understand that various modifications and changes can be made to the invention without departing from the spirit and scope of the invention as described in the following claims.
[0106]
[0107] [Explanation of the symbol]
[0108] 100: Bias-based FMAC device
[0109] 310: Bias Index Processing Module
[0110] 330: Mantissa multiplication processing module
[0111] 350: Mantissa addition processing module
[0112] 370: Variable Floating Point Processing Module
[0113] 390: Control Module
Claims
1. A bias index processing module that receives a bias that can be variably set according to artificial intelligence computation or external input or fixed according to an application field, applies the bias to a computation target to generate a bias index, performs index processing on the bias index, and outputs a bias index result; A mantissa multiplication processing module that receives a mantissa for the above-mentioned operation target, performs mantissa processing, and outputs a mantissa result; A mantissa addition processing module that performs a shift addition operation on the above mantissa result and outputs a shift addition result; and A bias-based FMAC device comprising a variable floating point processing module that performs a regular shift operation based on the above shift addition result to output a regular shift result, and outputs a bias-applied FMAC (Floating Point Multiply and Accumulate) result by exponentiating the above bias exponent result according to the above regular shift result.
2. In paragraph 1, the bias index processing module is A bias-based FMAC device characterized by generating the bias exponent by adjusting the bias to asymmetrically express the negative and positive parts of the exponent.
3. In paragraph 2, the bias index processing module is A bias-based FMAC device characterized by dynamically setting the bias based on a data pattern according to the above artificial intelligence operation.
4. In paragraph 1, the bias index processing module A bias-based FMAC device characterized by automatically readjusting the bias to maintain an optimal exponential expression when the bias exceeds a predefined optimal range.
5. In paragraph 1, the bias index processing module A bias-based FMAC device characterized by adding the bias during the addition process of the first and second bias index parts among the first to third bias index parts constituting the bias index part, and calculating the difference in index between the result of the addition process and the third bias index part.
6. In paragraph 1, the mantissa multiplication processing module is A bias-based FMAC device characterized by performing a multiplication process for the first and second singular parts among the first to third singular parts constituting the singular part, receiving the difference in exponents from the bias exponent processing module, and determining the part with a relatively large exponent and the part with a relatively small exponent among the third singular parts based on the result of the multiplication process.
7. In paragraph 1, the mantissa addition processing module is A bias-based FMAC device characterized by performing an alignment shift operation on a part with a relatively small exponent input from the mantissa multiplication processing module, and performing addition on the alignment shift part and the part with a relatively large exponent to generate the shift addition result.
8. In paragraph 1, the variable floating point processing module A bias-based FMAC device characterized by performing the exponent adjustment on the exponent difference received from the bias exponent processing module, the result of the leading zero count operation on the shift addition result, and the result of the regular shift operation rounded.
9. In a bias-based FMAC method performed in a bias-based FMAC device, A bias index processing step that receives a bias that can be variably set according to artificial intelligence computation or external input or fixed according to the application field, applies the bias to a computation target to generate a bias index part, performs index processing on the bias index part, and outputs a bias index part result; A mantissa multiplication processing step that receives a mantissa for the above operation target, performs mantissa processing, and outputs a mantissa result; A mantissa addition processing step that performs a shift addition operation on the above mantissa result and outputs a shift addition result; and A bias-based FMAC method comprising a variable floating point processing step that performs a regular shift operation based on the above shift addition result to output a regular shift result, and outputs a bias-applied FMAC (Floating Point Multiply and Accumulate) result by exponentiating the above bias exponent part result according to the above regular shift result.
10. An artificial intelligence computing system including a bias-based FMAC (Floating Point Multiply and Accumulate) device, The above bias-based FMAC device A bias index processing module that receives a bias that can be variably set according to artificial intelligence computation or external input or fixed according to the application field, applies the bias to a computation target to generate a bias index part, performs index processing on the bias index part, and outputs a bias index part result; A mantissa multiplication processing module that receives a mantissa for the above-mentioned operation target, performs mantissa processing, and outputs a mantissa result; A mantissa addition processing module that performs a shift addition operation on the bias exponent result and the mantissa result to output a shift addition result; and An artificial intelligence computation system comprising a variable floating point processing module that performs a regular shift operation based on the above shift addition result to output a regular shift result, and outputs a bias applied FMAC result by adjusting the bias exponent result according to the above regular shift result.
