Method and system for calculating multiplication and method for calculating dot product and convolution
By using lookup table accelerator to retrieve the product or dot product of floating point operands in artificial intelligence systems, the problem of inefficiency of multiplication and matrix multiplication in the prior art is solved, and a significant improvement in performance has been achieved.
Patent Information
- Application Number
- CN201910016966.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-03-08
- Filing Date
- 2019-01-08
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2039-01-08
AI Technical Summary
Existing artificial intelligence systems have limited performance when performing multiplication or matrix multiplication, resulting in inefficient computing.
The lookup table accelerator is used to retrieve the decimal part or dot product of the product of two floating point operands, and the symmetry and zero jump of the lookup table are improved by using the approximation and multiplication, forming addresses and searching results from the lookup table.
It significantly improves the efficiency of floating point multiplication and other operations, and improves the overall performance of the system.
Smart Images

Figure CN110032708B_ABST
Abstract
Description
[0001] [CROSS-REFERENCE TO RELATED APPLICATIONS]
[0002] This application claims priority to and the rights of U.S. Provisional Patent Application No. 62 / 615,334, filed on January 9, 2018, and entitled “SOFTWARE DEFINED LOOKUP COMPUTING AI ACCELERTOR SYSTEM ARCHITECTURE,” the entire contents of which are incorporated herein by reference. Technical Field
[0003] One or more aspects of embodiments according to the present invention relate to computing, and more particularly, to a system and method for accelerating computing using one or more lookup tables. Background Art
[0004] Various operations used by artificial intelligence systems, including neural network systems, may utilize operations such as multiplication and matrix multiplication, and the time consumed by each multiplication or the time consumed by the matrix multiplication can significantly affect the overall performance of the system.
[0005] Therefore, there is a need for a system and method for efficiently performing calculations such as multiplication or matrix multiplication. Summary of the invention
[0006] Aspects of various embodiments of the present invention relate to a computational accelerator using a lookup table. The accelerator can accelerate floating-point multiplication by retrieving a fractional portion of a product of two floating-point operands from a lookup table or by retrieving a product of two floating-point operands from a lookup table, or the accelerator can retrieve a dot product of a floating-point vector from a lookup table. The accelerator can be implemented in a three-dimensional storage assembly. The accelerator can use approximation, symmetry of a multiplication lookup table, and zero skipping to improve performance.
[0007] According to an embodiment of the present invention, a method for calculating the product of a first floating-point number and a second floating-point number is provided, the method comprising: forming an address from the following factors: a first factor, the first factor being a factor of the first floating-point number, and a second factor, the second factor being a factor of the second floating-point number; and retrieving the product of the first factor and the second factor from a position in a lookup table, the position being identified by the address.
[0008] In one embodiment, the first factor is a fractional portion of the first floating point number, and the second factor is a fractional portion of the second floating point number.
[0009] In one embodiment, the method includes calculating the exponent of the product of the first floating point number and the second floating point number as the sum of the exponent of the first floating point number and the exponent of the second floating point number minus a left shift number equal to the number of leading zeros in the 2n-bit product of the following two: a first number formed by appending a leading 1 to the first factor and a second number formed by appending a leading 1 to the second factor, where: n is 1 plus the bit length of the first factor.
[0010] In one embodiment, the method includes determining the left shift number using digital logic circuitry.
[0011] In one embodiment, the method includes retrieving the left shift number from a location in a lookup table identified by the address.
[0012] In one embodiment, forming the address includes concatenating a portion of the first factor and a portion of the second factor.
[0013] In one embodiment, the concatenating the portion of the first factor and the portion of the second factor comprises concatenating the portion of the first factor and the portion of the second factor in sequence according to respective values of the portion of the first factor and the portion of the second factor.
[0014] In one embodiment, the portion of the first factor is the entire first factor and the portion of the second factor is the entire second factor.
[0015] In one embodiment, the portion of the first factor is: smaller than the entire first factor and is a continuous subset of the bits of the first factor including the most significant bit of the first factor; and the portion of the second factor is: smaller than the entire second factor and is a continuous subset of the bits of the second factor including the most significant bit of the second factor.
[0016] In one embodiment, the first factor is the entire first floating point number, and the second factor is the entire second floating point number.
[0017] In one embodiment, the method includes creating the lookup table, the creating including: calculating elements of the lookup table; and storing the elements in a memory.
[0018] According to an embodiment of the present invention, a system for calculating the product of a first floating-point number and a second floating-point number is provided, the system comprising: a processing circuit, and a memory, the processing circuit being configured to: form an address from the following factors: a first factor of the first floating-point number, and a second factor of the second floating-point number; and retrieve the product of the first factor and the second factor from a position identified by the address in a lookup table, the lookup table being stored in the memory.
[0019] In one embodiment, the system includes: a stack formed by two or more memory chips; and a logic chip including the processing circuit.
[0020] In one embodiment, the first factor is a fractional portion of the first floating point number, and the second factor is a fractional portion of the second floating point number.
[0021] In one embodiment, forming the address includes concatenating a portion of the first factor and a portion of the second factor.
[0022] In one embodiment, the concatenating the portion of the first factor and the portion of the second factor comprises concatenating the portion of the first factor and the portion of the second factor in sequence according to respective values of the portion of the first factor and the portion of the second factor.
[0023] In one embodiment, the portion of the first factor is the entire first factor and the portion of the second factor is the entire second factor.
[0024] In one embodiment, the portion of the first factor is: smaller than the entire first factor and is a continuous subset of the bits of the first factor including the most significant bit of the first factor; and the portion of the second factor is: smaller than the entire second factor and is a continuous subset of the bits of the second factor including the most significant bit of the second factor.
[0025] In one embodiment, the first factor is the entire first floating point number, and the second factor is the entire second floating point number.
[0026] According to an embodiment of the present invention, a method for calculating a dot product of a first floating-point vector and a second floating-point vector is provided, the method comprising: forming an address from the following elements: a first element of the first floating-point vector, a second element of the first floating-point vector, a first element of the second floating-point vector, and a second element of the second floating-point vector; and retrieving the dot product from a position identified by the address in a lookup table.
[0027] In one embodiment, each of the following is an 8-bit floating point number: the first element of the first floating point vector, the second element of the first floating point vector, the first element of the second floating point vector, and the second element of the second floating point vector.
[0028] According to an embodiment of the present invention, a method for calculating the convolution of a first floating-point matrix and a second floating-point matrix is provided, the method comprising: creating a lookup table containing the results of the matrix convolution operation; forming an address from the following elements: elements of the first matrix, and elements of the second matrix; and retrieving the convolution of the first floating-point matrix and the second floating-point matrix from a position in the lookup table, the position being identified by the address. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] These and other features and advantages of the present invention will be appreciated and understood with reference to the specification, claims and drawings, in which:
[0030] Figure 1 is a block diagram illustrating floating point multiplication according to an embodiment of the present invention.
[0031] Figure 2 is a diagram of a lookup table according to an embodiment of the present invention.
[0032] Figure 3 is a block diagram illustrating floating point multiplication according to an embodiment of the present invention.
[0033] Figure 4 is a diagram of a scalable accelerator architecture according to an embodiment of the present invention.
[0034] [Explanation of Symbols]
[0035] 110: XOR circuit;
[0036] 120: multiplier;
[0037] 130: Normalization circuit;
[0038] 210: Lookup table;
[0039] 405: CPU;
[0040] 410: storage stack;
[0041] 415: front-end controller;
[0042] 420: logic chip;
[0043] 425: A stack formed by memory chips;
[0044] A: first operand;
[0045] B: The second operand. DETAILED DESCRIPTION
[0046] The detailed description described below in conjunction with the accompanying drawings is intended as an explanation of an exemplary embodiment of a computing accelerator using a lookup table provided according to the present invention, rather than being intended to represent the only form in which the present invention can be constructed or utilized. The description sets forth the features of the present invention in conjunction with the illustrated embodiments. However, it should be understood that the same or equivalent functions and structures can be achieved by different embodiments that are also intended to be included within the scope of the present invention. As shown elsewhere herein, the same element numbers are intended to indicate the same elements or features.
[0047] Reference Figure 1 , multiplying two floating point numbers (or "operands") may involve several steps. Each floating point number may include a sign bit, an exponent (which may be a signed integer), and a fraction. For example, in the IEEE standard 754 floating point representation, a floating point number may be represented by 32 bits, one of which is the sign bit of the floating point number, eight bits are the exponent of the floating point number (represented as a signed (2's complement) integer), and 23 bits are the fraction (or "fractional portion") of the floating point number. The fraction may be an unsigned number with an implicit leading 1. The bit sequence consisting of a fraction with a leading 1 appended to the left (i.e., where the implicit leading 1 is explicitly appended) may be referred to herein as an "augmented fraction".
[0048] In this representation, a floating-point number may represent a number whose fixed-point representation may be formed by appending a leading 1 bit to the left of the fractional portion, placing a decimal point (i.e., a binary point) to the right of the leading 1, shifting the number left (i.e., shifting the decimal point right) a number of bit positions equal to the exponent (or if the exponent is negative, shifting the number right (i.e., shifting the decimal point left) a number of bit positions equal to the opposite of the value of the exponent), and then changing the sign of the resulting fixed-point number if the sign bit of the floating-point representation is 1.
[0049] For the sake of Figure 1 As shown, two floating point operands are multiplied, and exclusive or (XOR) circuit 110 can be used to combine the sign bits of the two floating point numbers, and the exponents of the two floating point numbers can be added (i.e., using signed addition, or as shown in FIG. Figure 1 As shown in FIG. 1 , the decimals of the two floating point numbers may be multiplied by multiplier 120 using unsigned addition with appropriate bias. Before the decimals are multiplied, an implicit leading 1 may be appended to the left of the decimals of the two floating point numbers to form two augmented decimals corresponding to the decimals of the two floating point numbers, respectively.
[0050] The product of the augmented fraction and the sum of the exponents may then be normalized by normalization circuit 130 to form the exponent and fraction of the product of the two floating point numbers. If the product of the augmented fractions is not zero, normalization may involve forming the product as a 2n-bit unsigned integer (n being the bit width of each of the augmented fractions) of the augmented fraction, discarding any leading zeros from the product of the augmented fractions, discarding a number of least significant bits from the product of the augmented fractions so that the number of bits remaining after the discarding is n, and deleting leading ones to form the fraction of the floating point product (of the two floating point operands). The fraction of the floating point product may be referred to as the "normalized product" of the fractions of the two floating point operands (or equivalently, the "normalized product" of the augmented fractions of the two floating point operands). The exponent may then be adjusted, if necessary, by subtracting the "left shift number" from the exponent to compensate for the discarding of any leading zeros from the product of the augmented fractions. The left shift number may be equal to the number of leading zeros in the product of the augmented fractions. In each case, this number of leading zeros (or "number of leading zeros") may be 1 or 0. If the product of the augmented fractions is 0, normalization may involve setting the fraction of the floating-point product to 0 and setting the exponent of the floating-point product equal to the sum of the exponents of the operands.
[0051] Processing the fractions of two floating point operands to form the fraction of a floating point product of the two floating point operands may be performed by a lookup table. Figure 2 A lookup table 210 is shown containing the product A×B in the cell at a row corresponding to the value of the first operand A and a column corresponding to the value of the second operand B. For example, for a cell having 2 23 =8,388,608 possible values of the 23-bit fractional portion, an 8,388,608×8,388,608 lookup table may be used, where each row corresponds to one of the 8,388,608 possible values of the fractional portion of the first floating-point operand, and each column corresponds to one of the 8,388,608 possible values of the fractional portion of the second floating-point operand. The table may be created by storing in each cell the normalized product of the following fractional values: (i) the fractional value corresponding to the row in which the cell is located, and (ii) the fractional value corresponding to the column in which the cell is located.
[0052] In an operation, the decimal of the product of two floating-point operands may be "looked up" (i.e., read from a table) by forming an address from: (i) the decimal of a first floating-point number, and (ii) the decimal of a second floating-point number, the address being the address of a cell containing the decimal of the product of the two floating-point operands. For example, the table may be stored in a memory of a processing circuit having a memory (or equivalently, in a memory connected to the processing circuit) as a one-dimensional array, the first 8,388,608 elements of the one-dimensional array being the first row of the table, the next 8,388,608 elements of the one-dimensional array being the second row of the table, and so on. If each decimal stored in the table occupies one address (for example, if the width of the memory is 32 bits and the width of the decimals is 23 bits and the remaining 9 bits are unused or used for another purpose), then the address can be simply formed by concatenating the bits of the decimal of the first floating point number with the bits of the decimal of the second floating point number to form an address (which is an unsigned integer with twice as many bits as either of the two decimals).
[0053] This method can also be used to multiply floating point numbers in different floating point representations with different decimal lengths. In this case, the table can be rectangular rather than square. For example, if the first floating point number is a single precision (32-bit) floating point number with 23 decimal digits and the second floating point number is a double precision (64-bit) floating point number with 52 decimal digits, the table can have 8,388,608 rows and 2 52 columns.
[0054] In some embodiments, the size of the table can be reduced by a factor of about two by concatenating the two decimals in order according to their respective values (e.g., with the larger being first (i.e., in the more significant bits of the address) and the smaller being second (i.e., in the less significant bits of the address)) for each lookup (utilizing the commutative law of multiplication). In such a case, a portion of the lookup table (corresponding to a triangular region of the lookup table if the lookup table is drawn as a square two-dimensional data structure) may be unused and available for other purposes, or such memory portions may not be implemented (i.e., may not exist) if suitable memory circuitry is used. In other embodiments, the table may be stored as a set of rows of unequal length (e.g., monotonically increasing or monotonically decreasing), and the address of the cell corresponding to the decimal being looked for may be calculated accordingly.
[0055] Reference Figure 3 If half-precision (16-bit) floating point representation (with 10 decimal places) is used for both operands, the size of the lookup table can be only 1024×1024, with each cell storing 10 decimal places.
[0056] In some embodiments, performance improvements may be achieved by not performing multiplications where either operand is 0, for example, by shunting both floating point operands of any pair to a bypass unit when either operand is 0.
[0057] In some embodiments, an improvement in performance may be achieved by using approximations. This may be achieved, for example, by truncating the decimal of the first floating-point operand and the decimal of the second floating-point operand and forming an address from the truncated decimals that identifies a cell in a correspondingly smaller table. Truncation of each of the decimals may involve using only a portion of the decimal, the portion consisting of a proper subset of the bits of the decimal, the subset being a contiguous subset that includes the most significant bits of the decimal.
[0058] In some embodiments, rather than using the lookup table only to determine the fractional product of two floating point operands, the lookup table may be employed to find the floating point product of two floating point operands. For example, if half-precision (16-bit) floating point representation is used for both operands, 2 16 ×2 16 (ie, 65,536×65,536) lookup table, each cell of which contains the 16-bit product of: (i) the floating point number corresponding to the row in which the cell is located, and (ii) the floating point number corresponding to the column in which the cell is located.
[0059] As used herein, "factor" of a floating point number means (i) the fractional portion of the floating point number, or (ii) the entire floating point number, and embodiments in which the product of the factor of a first floating point number and the factor of a second floating point number is looked up in a lookup table may be: (i) an embodiment in which the product of the two floating point operands is calculated by looking up the product of the fractional portions of the two floating point operands in a lookup table, or (ii) an embodiment in which the product of the two floating point operands is calculated by looking up the product of the two floating point operands in a lookup table.
[0060] In some embodiments where the product of the fractional parts of the two floating-point operands is calculated by looking up the product of the fractional parts in a lookup table, a lookup table (e.g., a lookup table in parallel with the lookup table used to find the product of the fractional parts, or the same lookup table) may also be used to obtain the left shift number (where each cell may have a bit width greater than the width of the product of the fractional parts, and one or more additional bits may be used to store the left shift number). In other embodiments, the left shift number may be calculated by a suitable logic circuit (e.g., a circuit having 2n inputs and one or more outputs for outputting the left shift number, where n is the length of the fractional part of each of the first floating-point number and the second floating-point number).
[0061] In some embodiments, other operations such as dot products or matrix convolutions may be performed using a lookup table. For example, if each element of each of the two 2×1 vectors is represented as a quarter precision (8-bit) floating point representation, then the vector can be represented by a 2×1 vector with 8 bits. 32 (approximately 4 billion) units (2 16 Rows and 2 16 The dot product of the two 2x1 vectors is computed by performing a single lookup in a lookup table having 1x2 columns (two columns). In such an embodiment, four elements (two elements in each of the two two-element vectors) may be concatenated to form a 32-bit address for the lookup table cell containing the dot product. As used herein, the term "matrix" encompasses vectors (i.e., a vector may be viewed as a 1xn matrix or an nx1 matrix).
[0062] Reference Figure 4 In some embodiments, an accelerator using an embodiment of the present invention is located on a card. The components on the card include an accelerator card based on a peripheral component interconnect express (PCIe) or a dynamic random access memory (DRAM) interface, a direct memory access (DMA) engine, an interface controller with flow control, and a power controller. The central processing unit (CPU) 405 acts as a front-end host, thereby providing, for example, heterogeneous integration with a graphics processing unit (GPU) or a field programmable gate array (FPGA) (the graphics processing unit or field programmable gate array may be located on other cards). It can be as follows Figure 4 As shown, system scaling is achieved, where multiple storage stacks 410 support a central processor 405 (or a graphics processor, a field programmable gate array, or an application specific integrated circuit (ASIC)). A central scheduler distributes tasks among the multiple storage stacks 410, collects results, and calculates the final results.
[0063] Each storage stack 410 may include a front-end controller 415, a three-dimensional storage assembly including a logic chip 420 (e.g., a high-bandwidth memory (HBM) logic die) and a stack 425 formed of memory chips. Accumulation and other functions may be implemented on the logic chip in conjunction with the central processor 405. The logic chip 420 may decode controller commands and issue internal micro-operations to initiate lookup-based calculations. The cache memory and cache controller may be implemented as a subsystem (also on the logic chip 420), such as in a static random access memory (SRAM) on the logic die. The cache memory may be a static random access memory or an embedded dynamic random access memory.
[0064] The memory interface may be a synchronous high bandwidth memory interface with a single-step protocol having a deterministic timing specification. The memory interface may use a synchronous transaction interface or a two-step transaction interface (between the logic chip 420 and the stack 425 formed by the memory chips). In another embodiment, the memory interface is asynchronous and has a two-step protocol to use transaction commands with physical layer (PHY) modifications made to the new transaction pins.
[0065] The library application programming interface (API) may include an application framework modified in an instruction set that can be recognized by a host processor (e.g., CPU 405). This application programming interface can be used to enable CPU 405 to use an accelerator card. The execution of functions in the application programming interface can be scheduled on logic chip 420 using an instruction set architecture (ISA).
[0066] The control flow may proceed as follows. A program may register specific properties of a calculation to be performed. The program may then load a pre-computed table at a specified address range. This flow may enable operand-based lookups during runtime; exception handling may also be included in the lookup table. Floating point exceptions may include, for example, invalid operations, division by zero, underflow, overflow, and inexactness. The lookup table allows exceptions to be handled while the table itself is being programmed. Specifically, a software control algorithm may avoid the filling of such incorrect values that would be filled into the lookup table when it is programmed. Lookup tables may be used to calculate expensive results. The logic chips 420 in each storage stack 410 may be programmed to accelerate different operations of each. For example, in Figure 4In the system shown, a first logic chip 420 (of the two logic chips 420 shown) can be programmed to perform floating point multiplication (and a suitable lookup table can be stored in a stack 425 of memory chips associated with the first logic chip 420), and a second logic chip 420 (of the two logic chips 420 shown) can be programmed to calculate dot products (and a suitable lookup table can be stored in a stack 425 of memory chips associated with the second logic chip 420). The application framework can then directly utilize the results produced by the accelerator.
[0067] As used herein, a "portion" of a number represented by a bit sequence (e.g., a floating point number, or a fractional portion of a floating point number, or an integer) is the entire bit sequence or a contiguous proper subset of the bit sequence. As used herein, the "product" of two fractional portions of two corresponding floating point operands is the fractional portion of a floating point number (presenting the same floating point representation as each of the two operands) resulting from the floating point multiplication of the two operands. If the two operands present different floating point representations (e.g., floating point representations with unequal fractional lengths), the "product" of the two fractional portions is the fraction of the floating point product expressed in the floating point representation (of the floating point representations of the two operands) with the shorter fractional portion.
[0068] It should be understood that, in general, the product of two floating point numbers (represented as a floating point number with the same precision as one of the operands) will be an approximation, since normalization will cause some non-zero bits to be discarded. Thus, the "product" of two floating point operands means either (i) the exact product of the two floating point numbers (e.g., if truncation causes only zero bits to be discarded), or (ii) the approximate product of the two floating point numbers.
[0069] The term "processing circuit" is used herein to mean any combination of hardware, firmware, and software used to process data or digital signals. Processing circuit hardware may include, for example, an application-specific integrated circuit (ASIC), a general or dedicated central processing unit (CPU), a digital signal processor (DSP), a graphics processing unit (GPU), and a programmable logic device (such as a field programmable gate array (FPGA)). In the processing circuit used herein, each function is performed by hardware configured (i.e., hardwired) to perform the function, or by more general hardware (such as a central processing unit) configured to execute instructions stored in a non-temporary storage medium. The processing circuit may be fabricated on a single printed circuit board (PCB) or distributed on several interconnected printed circuit boards. The processing circuit may include other processing circuits; for example, the processing circuit may include two processing circuits interconnected on a printed circuit board, namely a field programmable gate array and a central processing unit.
[0070] It should be understood that although the terms "first", "second", "third", etc. may be used herein to describe various elements, components, regions, layers and / or sections, these elements, components, regions, layers and / or sections should not be limited by these terms. These terms are only used to distinguish one element, component, region, layer or section from another element, component, region, layer or section. Therefore, without departing from the spirit and scope of the present inventive concept, the first element, first component, first region, first layer or first section described herein may be referred to as the second element, second component, second region, second layer or second section.
[0071] For ease of description, spatially relative terms such as "beneath", "below", "lower", "under", "above", "upper", etc. may be used herein to describe the relationship of one element or feature shown in the figures to another element or features. It should be understood that such spatially relative terms are intended to encompass different orientations of the device in use or operation in addition to the orientation depicted in the figures. For example, if the device in the figure is turned over, the elements described as being "below" or "beneath" or "under" other elements or features will be oriented to be "above" the other elements or features. Therefore, the exemplary terms "below" and "under" can encompass both orientations of above and below. The device may have other orientations (e.g., rotated 90 degrees or other orientations), and the spatially relative descriptors used herein should be interpreted accordingly. In addition, it will also be understood that when a layer is referred to as being 'between' two layers, it can be the only layer between the two layers, or one or more intervening layers may also be present.
[0072] The terms used herein are used only to illustrate specific embodiments and are not intended to limit the inventive concept. As used herein, the terms "substantially", "about" and similar terms are used as approximate terms rather than as terms of degree, and are intended to take into account the inherent deviations of the measured or calculated values that will be recognized by a person of ordinary skill in the art. As used herein, the term "major component" refers to a component that is present in a composition or product in an amount greater than the amount of any other single component in the composition, polymer or product. In contrast, the term "primary component" refers to a component that constitutes at least 50% or more by weight of a composition, polymer or product. As used herein, the term "major portion" means at least half of each item when applied to multiple items.
[0073] As used herein, the singular forms "a" and "an" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the terms "comprises and / or comprising" used in this specification specify the presence of stated features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items. When preceding a series of elements, such as "at least one of" Expressions such as "of" modify the entire series of elements and do not modify the individual elements in the series. In addition, "may" used when describing an embodiment of the inventive concept refers to "one or more embodiments of the inventive concept." In addition, the term "exemplary" is intended to refer to an example or illustration. As used herein, the terms "use," "using," and "used" may be considered synonymous with the terms "utilize," "utilizing," and "utilized," respectively.
[0074] It should be understood that when an element or layer is referred to as being "on," "connected to," "coupled to," or "adjacent to" another element or layer, the element or layer may be directly on, directly connected to, directly coupled to, or directly adjacent to the other element or layer, or one or more intervening elements or layers may be present. In contrast, when an element or layer is referred to as being "directly on," "directly connected to," "directly coupled to," or "immediately adjacent to" another element or layer, there are no intervening elements or layers.
[0075] Any numerical range described herein is intended to include all sub-ranges with the same numerical precision that are included in the range. For example, the range "1.0 to 10.0" is intended to include all sub-ranges between the minimum value 1.0 and the maximum value 10.0 (and including the minimum value 1.0 and the maximum value 10.0) (i.e., having a minimum value equal to or greater than 1.0 and a maximum value equal to or less than 10.0), for example, 2.4 to 7.6. Any maximum numerical limit described herein is intended to include all lower numerical limits included therein, and any minimum numerical limit described in this specification is intended to include all higher numerical limits included therein.
[0076] Although exemplary embodiments of a computing accelerator using a lookup table have been specifically described and illustrated herein, many modifications and variations will be apparent to those skilled in the art. Therefore, it should be understood that a computing accelerator using a lookup table constructed in accordance with the principles of the present invention may be implemented in ways other than those specifically described herein. The present invention is further defined in the following claims and their equivalents.
Claims
1. A method for calculating the product of a first floating-point number and a second floating-point number, the method include: The address is formed from the following factors: a first factor, the first factor being a factor of the first floating point number, and a second factor, the second factor being a factor of the second floating-point number; as well as retrieving the product of the first factor and the second factor from a location in a lookup table, the location being identified by the address, wherein the address is formed by concatenating the first factor and the second factor based on determining that the larger of the first factor and the second factor is a more significant bit in the address and the smaller of the first factor and the second factor is a less significant bit in the address, and Each cell of the lookup table stores a normalized product, the normalized product being a fraction of a floating point product. 2 . The method of claim 1 , wherein the first factor is a fractional portion of the first floating point number, and the second factor is a fractional portion of the second floating point number.
3. The method according to claim 2, wherein the first floating-point number and the second floating-point number are in the same representation form, the method further comprising calculating the exponent of the product of the first floating-point number and the second floating-point number as follows: The sum of the exponent of the first floating point number and the exponent of the second floating point number minus The number of left shifts equal to the number of leading zeros in the 2n-bit product of: A first number formed by appending a leading 1 to the first factor, and a second number formed by appending a leading 1 to the second factor, in: n is 1 plus the bit length of the first factor. The method of claim 3 , further comprising determining the left shift number using a digital logic circuit.
5. The method of claim 3, further comprising retrieving the left shift number from a location in the lookup table identified by the address.
6. The method according to claim 2, wherein the address is formed include: A portion of the first factor and a portion of the second factor are concatenated.
7. The method according to claim 6, wherein the concatenating the portion of the first factor and the portion of the second factor comprises concatenating the portion of the first factor and the portion of the second factor in sequence according to respective values of the portion of the first factor and the portion of the second factor.
8. The method of claim 6, wherein the portion of the first factor is the entire first factor and the portion of the second factor is the entire second factor.
9. The method according to claim 6, in: The portion of the first factor is: is smaller than the entire first factor, and a contiguous subset of the bits of the first factor including the most significant bit of the first factor; and The portion of the second factor is: is less than the entire second factor, and A contiguous subset of the bits of the second factor comprising a most significant bit of the second factor.
10. The method of claim 1, wherein the first factor is the entire first floating point number and the second factor is the entire second floating point number.
11. The method according to claim 1, further comprising creating the lookup table, wherein the creating include: Calculating elements of the lookup table; as well as The element is stored in memory.
12. A system for calculating the product of a first floating point number and a second floating point number, the system include: processing circuitry, and Memory, The processing circuit is configured to: The address is formed from the following factors: a first factor of the first floating point number, and a second factor of the second floating point number; as well as retrieving a product of the first factor and the second factor from a location in a lookup table identified by the address, the lookup table being stored in the memory, wherein the address is formed by concatenating the first factor and the second factor based on determining that the larger of the first factor and the second factor is a more significant bit in the address and the smaller of the first factor and the second factor is a less significant bit in the address, and Each cell of the lookup table stores a normalized product, the normalized product being a fraction of a floating point product.
13. The system of claim 12, wherein the system is implemented in a three-dimensional storage assembly, the three-dimensional storage assembly include: A stack formed by two or more memory chips; as well as A logic chip comprising the processing circuit.
14. The system of claim 12, wherein the first factor is a fractional portion of the first floating point number and the second factor is a fractional portion of the second floating point number.
15. The system of claim 14, wherein the address is formed include: A portion of the first factor and a portion of the second factor are concatenated.
16. The system of claim 15, wherein concatenating the portion of the first factor with the portion of the second factor comprises concatenating the portion of the first factor with the portion of the second factor in sequence according to respective values of the portion of the first factor and the portion of the second factor.
17. The system of claim 15, wherein the portion of the first factor is the entire first factor and the portion of the second factor is the entire second factor.
18. The system according to claim 15, in: The portion of the first factor is: is smaller than the entire first factor, and a contiguous subset of the bits of the first factor including the most significant bit of the first factor; and The portion of the second factor is: is less than the entire second factor, and A contiguous subset of the bits of the second factor comprising a most significant bit of the second factor.
19. The system of claim 12, wherein the first factor is the entire first floating point number and the second factor is the entire second floating point number.
20. A method for calculating the dot product of a first floating point vector and a second floating point vector, the method include: The address is formed from the following elements: the first element of the first floating-point vector, the second element of the first floating-point vector, the first element of the second floating point vector, and a second element of the second floating-point vector; as well as retrieving the dot product from a lookup table at a location identified by the address, wherein the address is formed by concatenating the first element and the second element of the first floating point vector with the first element and the second element of the second floating point vector based on determining that the larger of the first floating point vector and the second floating point vector is a more significant bit in the address and the smaller of the first floating point vector is a less significant bit in the address, and Each cell of the lookup table stores a normalized product, the normalized product being a fraction of a floating point product.
21. The method of claim 20, wherein each of the following is an 8-bit floating point number: the first element of the first floating-point vector, said second element of said first floating-point vector, the first element of the second floating point vector, and The second element of the second floating point vector.
22. A method for calculating the convolution of a first floating point matrix and a second floating point matrix, the method include: Create a lookup table containing the results of the matrix convolution operation; The address is formed from the following elements: elements of the first floating-point matrix, and elements of the second floating-point matrix; as well as retrieving the convolution of the first floating point matrix and the second floating point matrix from a location in the lookup table, the location being identified by the address, wherein the address is formed by concatenating the elements of the first floating point matrix and the elements of the second floating point matrix based on determining that the larger of each element of the first floating point matrix and the corresponding element of the second floating point matrix is a more significant bit in the address and the smaller of each element of the first floating point matrix and the corresponding element of the second floating point matrix is a less significant bit in the address, and Each cell of the lookup table stores a normalized product, the normalized product being a fraction of a floating point product.
