Parallel table lookup method and device supporting nonlinear function extension function

By partitioning nonlinear functions in memory and storing linear function coefficients, combined with multi-format data conversion and parallel table lookup methods, the problem of low resource utilization in vector computation is solved, achieving efficient vector table lookup and pipeline performance optimization.

CN115328553BActive Publication Date: 2026-04-17JIANGNAN INST OF COMPUTING TECH
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGNAN INST OF COMPUTING TECH
Filing Date
2022-08-24
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing technologies, piecewise linear fitting methods for nonlinear functions require a large number of floating-point operations and scalar conversions in vector computation, resulting in low resource utilization, poor pipeline performance, and poor programming friendliness.

Method used

By employing a lookup table combined with piecewise linear fitting, the nonlinear function is divided into intervals and the coefficients of the linear function are stored. Through multi-format data conversion and parallel table lookup methods, the transformation of the dependent variable into the in-table offset is quickly realized, thereby improving the efficiency of vector calculation.

Benefits of technology

It enables fast conversion of dependent variables to in-table offsets on ordinary single-port or dual-port memory, improves the utilization of vector computing structures and general-purpose register resources, optimizes pipeline performance, supports multiple data format conversions, and achieves efficient parallel table lookup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115328553B_ABST
    Figure CN115328553B_ABST
Patent Text Reader

Abstract

The application discloses a parallel look-up table method and device supporting nonlinear function expansion function, and relates to the technical field of artificial intelligence, which comprises the following steps: dividing a nonlinear function into several intervals, and representing the function value in each interval by a linear function, wherein the linear function coefficients are stored in a look-up table, and the look-up table is located in local storage; performing multi-format data conversion, expanding and shifting to a predetermined decimal point position according to the data format field in the function type indicator and the format of the input source operand; obtaining the above data placement rule, calculating the in-table offset address of parallel look-up table; adding the vector query base address and the in-table offset address to obtain the storage address of the element to be accessed. The application can quickly realize the conversion from the dependent variable to the in-table offset on the ordinary single-port or double-port memory, and realize the vector look-up table method, improve the utilization rate of the vector calculation structure, general register and other resources, and thus optimize the pipeline performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a parallel table lookup method and apparatus that supports the expansion of nonlinear functions. Background Technology

[0002] Instruction-driven vector computation structures can provide powerful parallel computing support for fields such as deep neural learning. In deep learning and other fields, various nonlinear functions place higher demands on the accuracy, range, and fitting error of fitting methods. Piecewise linear fitting methods combine table lookup and multiplication operations, which, compared to methods such as directly looking up function values ​​or Taylor series expansion, can better balance fitting accuracy, storage overhead, and computational overhead.

[0003] Among them, the nonlinear function can be expressed as a piecewise linear function Y=aX+b (Y0= a0X0+b0, Y1=a1X1+b1, …, Y…) by using the piecewise linear fitting method. n =a n X n +b n ), based on the provided dependent variable X i The corresponding parameter 'a' can be obtained through a table lookup operation. i b i Y is finally obtained through multiplication and addition operations. i Based on the precision and range of the dependent variable, piecewise linear functions require corresponding segmented table construction to store the parameter 'a'. i b i The same dependent variable X i Different nonlinear function parameter tables may correspond to different in-table offsets. Currently, piecewise linear fitting methods require a large number of similar scalar in-table offset address conversion operations and scalar table lookup operations, which greatly limits the efficiency of vector calculation instructions.

[0004] In existing technologies, the conversion from a floating-point dependent variable Xi to an offset address within the table generally requires floating-point and integer multiplication and addition operations. These operations are frequent, incur significant power consumption, and hinder the efficient utilization of vector operation structures, making them a major bottleneck restricting the performance of table lookup operations. Furthermore, programmers must explicitly perform the conversion from Xi to the offset address within the table during program design, resulting in poor programming friendliness.

[0005] In current general-purpose processors, due to memory port limitations, the lookup function of matching vector calculation instructions is usually completed by using multiple shift and load operations. After obtaining the offset address in the table, each element lookup corresponds to three operations: shifting the offset value in the table from the specific instruction field to the lower bit; sending a normal load instruction to obtain the element lookup result; and shifting the lookup result to the higher bit.

[0006] In the aforementioned operations of the prior art, the parallel lookup operation for extending the saturation function requires repeated floating-point operations and vector-scalar conversions, which significantly consumes the resources of the arithmetic unit and general-purpose registers, hindering the efficient utilization of pipeline performance.

[0007] Therefore, it is essential to design parallel lookup methods that support nonlinear function expansion, both for improving resource utilization and optimizing pipeline performance. Summary of the Invention

[0008] The purpose of this invention is to provide a parallel lookup table method and apparatus that supports the expansion of nonlinear functions. It can quickly convert the dependent variable into the offset in the table on a general single-port or dual-port memory and implement a vector lookup table method, thereby improving the utilization of vector computing structures, general-purpose registers and other resources, and thus optimizing pipeline performance.

[0009] According to a first aspect of the present invention, a parallel lookup table method supporting nonlinear function expansion is proposed, comprising:

[0010] The nonlinear function is divided into several intervals, and the function value in each interval is represented by a linear function. The coefficients of the linear function are stored in a lookup table, which is located in local storage.

[0011] Perform multi-format data conversion, expand and shift the data to the predetermined decimal position according to the data format field in the function type indicator and the format of the input source operands;

[0012] Obtain the above data placement rules and calculate the table offset address for parallel table lookup;

[0013] The vector lookup base address and the offset address within the table are added together to obtain the storage address of the element to be accessed.

[0014] Furthermore, storing the coefficients of the linear function in a lookup table specifically includes:

[0015] Obtain the signed offset address within the lookup table;

[0016] Calculate the linear coefficients and write them into the lookup table.

[0017] Furthermore, when performing multi-format data conversion, the data formats include: unsigned and / or signed word and / or double-word integers, half-precision and / or single-precision and / or double-precision format data.

[0018] Furthermore, based on the data format field in the function type indicator, the format of the input source operands is expanded and shifted to the predetermined decimal position, specifically including:

[0019] Get the function type indicator;

[0020] Obtain the format of the input source operands, i.e., the required precision and numerical range of the dependent variable xi;

[0021] The data in the function type indicator is converted according to different formats to obtain a signed binary fixed-point number, which is then shifted to the predetermined decimal point position.

[0022] Furthermore, based on the data placement rules, the intra-table offset address for parallel table lookups is calculated, specifically including:

[0023] Based on the function type field in the function type indicator and the fixed-point result obtained from the multi-format data conversion logic, the table offset address for parallel table lookup is calculated.

[0024] Furthermore, based on the function type field in the function type indicator and the fixed-point result obtained from the multi-format data conversion logic, the intra-table offset address for parallel table lookup is calculated, specifically including:

[0025] Configure the function type field in the function type indicator;

[0026] Configure the function type indicator based on the range of values ​​of the dependent variable of interest and the accuracy of the fitting error of the objective function.

[0027] Calculate the offset address within the table for parallel table lookup.

[0028] Furthermore, the vector lookup base address and the offset address within the table are added together to obtain the storage address of the element to be accessed, specifically including:

[0029] Access the memory, obtain the values ​​of each element, and concatenate the vector lookup results;

[0030] Write the vector lookup result to the specified target register.

[0031] According to a second aspect of the present invention, a parallel table lookup device supporting nonlinear function expansion is provided, comprising:

[0032] The segmentation module divides the nonlinear function into several intervals, and the function value in each interval is represented by a linear function. The coefficients of the linear function are stored in a lookup table, which is located in local storage.

[0033] Data conversion module: Performs multi-format data conversion, expands and shifts the data to the predetermined decimal position according to the data format field in the function type indicator, based on the format of the input source operands;

[0034] Calculation module: Obtain the above data placement rules and calculate the table offset address for parallel table lookup;

[0035] Vector query module: The vector query base address and the offset address in the table are added together to obtain the storage address of the element to be accessed.

[0036] According to a third aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method steps of any of the first aspects described above.

[0037] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method steps of any one of the first aspects described above.

[0038] The beneficial effects of this invention are as follows:

[0039] This invention provides a parallel lookup table method and apparatus that supports nonlinear function extension. It can quickly convert the dependent variable to the offset in the table on a general single-port or dual-port memory and implement a vector lookup table method, thereby improving the utilization of vector computing structures, general-purpose registers and other resources, and thus optimizing pipeline performance.

[0040] It supports conversion logic from multiple data formats to fixed-point data. This logic can support format conversion from unsigned / signed word / double word integers and half-precision / single-precision / double-precision data to fixed-point data, and can support function fitting for multiple variable data.

[0041] Parallel processing of in-table offset conversion logic, which can simultaneously convert multiple fixed-point data into in-table offsets based on the range of dependent variable values ​​and the fitting error accuracy of the objective function;

[0042] The vector lookup method, which efficiently utilizes vector operation structures, implements vector lookup instructions that match vector calculation instructions, and can effectively maximize the peak performance of the system through parallel operations. Attached Figure Description

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention. In these drawings, similar reference numerals are used to denote similar elements. The drawings described below are some embodiments of the invention, but not all embodiments. Other drawings will be readily available to those skilled in the art based on these drawings without any inventive effort.

[0044] Figure 1 This is a flowchart of a parallel table lookup method supporting nonlinear function expansion according to an embodiment of the present invention;

[0045] Figure 2 This is a schematic diagram of the module connection of a parallel table lookup device that supports nonlinear function expansion according to an embodiment of the present invention. Detailed Implementation

[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention and the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without any creative effort. Furthermore, the design orientation only indicates the relative positional relationship between the components, not the absolute positional relationship.

[0047] Example 1

[0048] like Figure 1 As shown, according to a first aspect of the present invention, a parallel lookup table method supporting nonlinear function expansion is proposed, comprising:

[0049] S101: Divide the nonlinear function into several intervals. The function value in each interval is represented by a linear function. The coefficients of the linear function are stored in a lookup table, which is located in local storage.

[0050] In this embodiment of the invention, step S101 can be equivalent to a lookup table-driven piecewise linear fitting, which divides the nonlinear function into several intervals. The function value in each interval is represented by the linear function Y=aX+b. The values ​​of a and b in each interval may be different. Therefore, there are n intervals, and thus n linear functions, namely Y1=a1X1+b1, Y2=a2X2+b2, ..., Y n =a n X n +b n .

[0051] The coefficients a and b (a total of 2n coefficient values) of these linear functions are stored in lookup tables located in local data memory (LDM) for easy searching.

[0052] This is equivalent to first performing piecewise linear fitting on the nonlinear function. Compared to the ordinary piecewise linear fitting method that uses the intermediate value of each segment as the fitted value of the function for that segment, this invention stores the coefficients of the linear function in a lookup table, making the lookup more convenient and the function solution more accurate.

[0053] Of course, the higher the accuracy of the fitting, the larger the range of the function to be solved, the deeper the required lookup table, and the more local data memory (LDM) capacity is occupied. Therefore, in order to minimize the local storage capacity, the fitting can be performed according to the actual needs of the nonlinear function.

[0054] In this embodiment of the invention, when dividing a nonlinear function into several intervals, and the function value in each interval is represented by a linear function: it is necessary to obtain the signed offset address of the lookup table, calculate the linear coefficients, and write them into the lookup table.

[0055] Specifically, when obtaining the signed offset address within the lookup table: the signed offset address within the lookup table is obtained by converting the input 32-bit single-precision data and / or DP data and / or HP data.

[0056] Furthermore, when calculating the linear coefficients and writing them into the lookup table: based on application requirements, the linear coefficients are pre-calculated, and the writing software writes the linear coefficients into the lookup table; here, application requirements include the type of nonlinear function, the solution range, and the solution accuracy, etc.

[0057] The above describes a method that combines lookup tables and piecewise linear fitting to store piecewise linear functions in a lookup table. Compared to directly using a lookup table to store the function values ​​of multiple corresponding points of a nonlinear function, this embodiment of the invention requires fewer table entries and can still meet the accuracy requirements for function solving.

[0058] S102: Perform multi-format data conversion, expand and shift the data to the predetermined decimal position according to the data format field in the function type indicator and the format of the input source operands;

[0059] In this embodiment of the invention, step S102 can be equivalent to data shifting, that is, according to the data format field in the function type indicator type, the format of the input source operand is expanded and shifted to a predetermined decimal point position, and the decimal point position is fixed.

[0060] Here, based on the data format field in the function type indicator, the input source operands are expanded and shifted to the predetermined decimal position according to their format. Specifically, this includes:

[0061] Get the function type indicator;

[0062] Obtain the format of the input source operands, i.e., the required precision and numerical range of the dependent variable xi;

[0063] The data is converted according to the different formats in the function type indicator to obtain a signed binary fixed-point number, and the data is shifted to the predetermined decimal point position.

[0064] In this embodiment of the invention, when performing multi-format data conversion, the data formats include: unsigned and / or signed words, unsigned and / or signed double-word integers, and half-precision and / or single-precision and / or double-precision format data.

[0065] In other words, it supports conversion logic from multiple data formats to fixed-point data. This logic can support format conversion from unsigned / signed word / double-word integers, half-precision / single-precision / double-precision data to fixed-point data, and can support function fitting of multiple variable data.

[0066] For example, for double-precision floating-point format data in the IEEE 754 standard, the input source operand src first needs to be processed. i Perform normalization number determination, and then determine the operand src based on the input source operand. i The mantissa and the input source operand src i The exponent is implicitly padded with 0 or 1 to the mantissa; then, a signed extension is performed based on the actual sign bit; finally, a signed shift is performed based on the position of the decimal point for double-precision floating-point numbers and specific fixed-point numbers.

[0067] S103: Obtain the above data placement rules and calculate the table offset address for parallel table lookup;

[0068] In this embodiment of the invention, step S103 mainly involves calculating the intra-table offset address for parallel table lookup based on the data conversion logic of step S102.

[0069] In this embodiment of the invention, the table offset address for parallel table lookup is calculated according to the data placement rules. Specifically, this includes: calculating the table offset address for parallel table lookup based on the function type field in the function type indicator and the fixed-point result obtained from the multi-format data conversion logic.

[0070] Here, based on the function type field in the function type indicator and the fixed-point result obtained from the multi-format data conversion logic, the in-table offset address for parallel table lookup is calculated, specifically including:

[0071] Configure the function type field in the function type indicator; the function type field in the function type indicator can be configured to a mode that is oriented towards a wide range of numerical values, or to a mode that is oriented towards high precision of decimals;

[0072] Configure the function type indicator based on the range of values ​​of the dependent variable of interest and the accuracy of the fitting error of the objective function.

[0073] Calculate the offset address within the table for parallel table lookup.

[0074] It should be noted that when the dependent variable has a wide numerical range and the corresponding objective function changes slowly, a configuration method oriented towards a wide numerical range can be used to support the fitting of the objective function. When the dependent variable has a narrow numerical range and the corresponding objective function changes drastically, a configuration method oriented towards high precision for decimal values ​​can be used to fit the objective function. When the dependent variable has a wide numerical range and the corresponding objective function changes drastically, a method of segmented table creation, table lookup, and calculation can be used to fit the objective function.

[0075] S104: The vector query base address and the offset address in the table are added together to obtain the storage address of the element to be accessed.

[0076] In this embodiment of the invention, step S104 is actually a vector query based on the offset address in the table calculated in step S103, which is a parallel table lookup.

[0077] In this embodiment of the invention, the vector query base address and the offset address within the table are added together to obtain the storage address of the element to be accessed, specifically including:

[0078] Access memory, retrieve the values ​​of each element, and concatenate the vector lookup results;

[0079] Write the vector lookup result to the specified target register.

[0080] That is, based on the function type indicator `type` and the input source operand `src` i It can obtain the offset address within the table: disp(type,src) i ), by querying the corresponding a in the base address through the field vector. i Add them together to get the storage address of the element to be accessed.

[0081] This invention provides a parallel lookup table method that supports the expansion of nonlinear functions. It can quickly convert the dependent variable into the offset in the table on a general single-port or dual-port memory and implement a vector lookup table method, thereby improving the utilization of vector computing structures, general-purpose registers and other resources, and thus optimizing pipeline performance.

[0082] It supports conversion logic from multiple data formats to fixed-point data. This logic can support format conversion from unsigned / signed word / double word integers and half-precision / single-precision / double-precision data to fixed-point data, and can support function fitting for multiple variable data.

[0083] Parallel processing of in-table offset conversion logic, which can simultaneously convert multiple fixed-point data into in-table offsets based on the range of dependent variable values ​​and the fitting error accuracy of the objective function;

[0084] The vector lookup method, which efficiently utilizes vector operation structures, implements vector lookup instructions that match vector calculation instructions, and can effectively maximize the peak performance of the system through parallel operations.

[0085] Example 2

[0086] like Figure 2 As shown, according to a second aspect of the present invention, a parallel lookup table apparatus supporting nonlinear function expansion is provided, comprising:

[0087] The segmentation module divides the nonlinear function into several intervals, and the function value in each interval is represented by a linear function. The coefficients of the linear function are stored in a lookup table, which is located in local storage.

[0088] Data conversion module: Performs multi-format data conversion, expands and shifts the data to the predetermined decimal position according to the data format field in the function type indicator, based on the format of the input source operands;

[0089] Calculation module: Obtain the above data placement rules and calculate the table offset address for parallel table lookup;

[0090] Vector query module: The vector query base address and the offset address in the table are added together to obtain the storage address of the element to be accessed.

[0091] It is understood that the apparatus provided in the embodiments of the present invention is applicable to the method described in Embodiment 1, and the specific functions of each module can be referred to the above method flow, which will not be repeated here.

[0092] Example 3

[0093] According to a third aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method steps of the first embodiment described above.

[0094] The electronic device is used to implement the method described in Embodiment 1. The electronic device may include: at least one central processing unit, at least one network interface, a control interface, a memory, and at least one communication bus.

[0095] The communication bus is used to enable communication and information exchange between the various components.

[0096] The network interface may include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0097] The control interface is used to output control operations according to instructions.

[0098] The central processing unit (CPU) may include one or more processing cores. The CPU connects to various parts of the terminal via various interfaces and lines, and executes instructions, programs, code sets, or instruction sets stored in memory, as well as accessing data stored in memory, to perform various functions of the terminal and process data according to the method described in Embodiment 1.

[0099] The memory may include random access memory (RAM) or read-only memory. Optionally, the memory may include non-transitory computer-readable storage medium. The memory can be used to store instructions, programs, code, code sets, or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the methods described in Embodiment 1 above, etc.; the data storage area may store data involved in the various method embodiments above, etc.

[0100] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in Embodiment 1 above. The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, microdrives, as well as magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.

[0101] This invention provides a parallel lookup table method and apparatus that supports nonlinear function extension. It can quickly convert the dependent variable to the offset in the table on a general single-port or dual-port memory and implement a vector lookup table method, thereby improving the utilization of vector computing structures, general-purpose registers and other resources, and thus optimizing pipeline performance.

[0102] It supports conversion logic from multiple data formats to fixed-point data. This logic can support format conversion from unsigned / signed word / double word integers and half-precision / single-precision / double-precision data to fixed-point data, and can support function fitting for multiple variable data.

[0103] Parallel processing of in-table offset conversion logic, which can simultaneously convert multiple fixed-point data into in-table offsets based on the range of dependent variable values ​​and the fitting error accuracy of the objective function;

[0104] The vector lookup method, which efficiently utilizes vector operation structures, implements vector lookup instructions that match vector calculation instructions, and can effectively maximize the peak performance of the system through parallel operations.

[0105] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0106] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0107] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between devices or units may be electrical or other forms.

[0108] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0109] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0110] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0111] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0112] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0113] The foregoing description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Those skilled in the art will readily conceive of embodiments of this disclosure upon considering the specification and practicing the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described herein. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.

Claims

1. A parallel look-up table method supporting a non-linear function extension function, characterized by, include: The nonlinear function is divided into several intervals, and the function value in each interval is represented by a linear function. The coefficients of the linear function are stored in a lookup table, which is located in local storage. Perform multi-format data conversion, expand and shift the data to the predetermined decimal position according to the data format field in the function type indicator and the format of the input source operands; Obtain the above data placement rules and calculate the table offset address for parallel table lookup; The vector lookup base address and the offset address within the table are added together to obtain the storage address of the element to be accessed; in: When performing multi-format data conversion, the data formats include: unsigned and / or signed word and / or double word integers, half-precision and / or single-precision and / or double-precision format data; Based on the data format field in the function type indicator, the input source operands are expanded and shifted to the predetermined decimal position according to their format. Specifically, this includes: Get the function type indicator; Obtain the format of the input source operands, i.e., the required precision and numerical range of the dependent variable xi; The data in the different formats specified in the function type indicator is converted to obtain a signed binary fixed-point number, which is then shifted to the predetermined decimal point position. Based on the data placement rules, the table offset address for parallel table lookup is calculated, specifically including: Configure the function type field in the function type indicator; Configure the function type indicator based on the range of values ​​of the dependent variable of interest and the accuracy of the fitting error of the objective function. Calculate the offset address within the table for parallel table lookup; That is, the table offset address for parallel table lookup is calculated based on the function type field in the function type indicator and the fixed-point result obtained from the multi-format data conversion logic.

2. The parallel table lookup method supporting non-linear function extension function according to claim 1, wherein, The coefficients of the linear function are stored in a lookup table, specifically including: Obtain the signed offset address within the lookup table; Calculate the linear coefficients and write them into the lookup table.

3. The parallel table lookup method supporting non-linear function extension function according to claim 1, wherein, The vector lookup base address and the offset address within the table are added together to obtain the storage address of the element to be accessed, specifically including: Access the memory, obtain the values ​​of each element, and concatenate the vector lookup results; Write the vector lookup result to the specified target register.

4. A parallel look-up table device supporting a non-linear function extension function, characterized by, include: The segmentation module divides the nonlinear function into several intervals, and the function value in each interval is represented by a linear function. The coefficients of the linear function are stored in a lookup table, which is located in local storage. Data conversion module: Performs multi-format data conversion, expands and shifts the data to the predetermined decimal position according to the data format field in the function type indicator, based on the format of the input source operands; Calculation module: Obtain the above data placement rules and calculate the table offset address for parallel table lookup; Vector query module: The vector query base address and the offset address in the table are added together to obtain the storage address of the element to be accessed; in: In the data conversion module, when performing multi-format data conversion, the data formats include: unsigned and / or signed word and / or double word integers, half-precision and / or single-precision and / or double-precision format data; In the data conversion module, based on the data format field in the function type indicator, the input source operands are expanded and shifted to the predetermined decimal position according to their format. Specifically, this includes: Get the function type indicator; Obtain the format of the input source operands, i.e., the required precision and numerical range of the dependent variable xi; The data in the different formats specified in the function type indicator is converted to obtain a signed binary fixed-point number, which is then shifted to the predetermined decimal point position. In the calculation module, based on the data placement rules, the offset address within the table for parallel table lookup is calculated, specifically including: Configure the function type field in the function type indicator; Configure the function type indicator based on the range of values ​​of the dependent variable of interest and the accuracy of the fitting error of the objective function. Calculate the offset address within the table for parallel table lookup; That is, the table offset address for parallel table lookup is calculated based on the function type field in the function type indicator and the fixed-point result obtained from the multi-format data conversion logic.

5. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of a parallel table lookup method that supports nonlinear function extension as described in any one of claims 1 to 3.

6. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of a parallel table lookup method that supports nonlinear function extension as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Operation device and method

    CN109523020A