IP Library Granted Patent US 12687965
Granted Patent B1
US 12687965 · App. 19/040,794 · Granted Jul 21, 2026

Method and system for approximating activation function with floating point format type using a table

Inventor: Ulf Hanebutte (Gig Harbor, WA)
Assignee: Marvell Asia Pte Ltd
G06F3/0611G06F3/0659G06F3/0673
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12687965
App. No.
19/040,794
Granted
Jul 21, 2026
Kind
B1
Abstract

A method includes storing a first/second set of biased exponents associated with a first/second plurality of input floating point data respectively in a memory. The first set of biased exponents defines a positive piecewise linear range associated with a positive piecewise linear approximation region of a function. The second set of biased exponents defines a negative piecewise linear range associated with a negative piecewise linear approximation region of the function. The positive/negative piecewise linear approximation regions include a first/second plurality of subregions respectively. Each subregion of the first and the second plurality of subregions includes at least one or more linear approximations. The method includes storing indices data for mapping each linear approximation with each subregion of the first and the second plurality of subregions to a unique index value. An offset and a slope for each of the unique index value are stored.

Claims (77)

1 . A system, comprising:

a memory configured to store data, wherein the memory includes a first segment and a second segment; and

a processing unit configured to

store a first and a second set of biased exponents associated with a first and a second plurality of input floating point data respectively in the first segment of the memory, wherein the first set of biased exponents defines a positive piecewise linear range associated with a positive piecewise linear approximation region of a function to be processed by the processing unit or another processing unit, wherein the second set of biased exponents defines a negative piecewise linear range associated with a negative piecewise linear approximation region of the function to be processed by the processing unit or another processing unit, wherein the positive piecewise linear approximation region includes a first plurality of subregions, wherein the negative piecewise linear approximation region includes a second plurality of subregions, and wherein each subregion of the first and the second plurality of subregions includes at least one or more linear approximations,

store indices data associated with the first plurality of subregions and the second plurality of subregions in the first segment, wherein the indices data maps a unique index to each linear approximation of the at least one or more linear approximations in the first and the second plurality of subregions; and

store an offset and a slope for each unique index associated with its corresponding linear approximation.

2 . The system of claim 1 , wherein the first segment of the memory stores uint format data type and wherein the second segment of the memory stored a floating point (FP) format data type.

3 . The system of claim 2 , wherein the first and the second plurality of input floating point data are a FP16, and wherein the first segment is an uint8 and wherein the second segment is a FP16.

4 . The system of claim 1 , wherein the first and the second plurality of input floating point (FP) data are one of a FP4, FP8, FP16, FP32, FP9, FP64, or brain FP16 (Bfloat16).

5 . The system of claim 1 , wherein the positive and the negative piecewise linear range are user modifiable.

6 . The system of claim 1 , wherein the processing unit or another processing unit is configured to receive a floating point input data for the function to be processed,

wherein the processing unit or another processing unit is configured to use a sign bit and biased exponent associated with the floating point input data to determine whether the floating point input data is within the positive piecewise linear range or within the negative piecewise linear range, and

wherein the processing unit or another processing unit, in response to determining that the floating point input data is within the positive piecewise linear range or the negative piecewise linear range, is configured to determine a subregion of the positive piecewise linear range or a subregion of the negative piecewise linear range based on the biased exponent, and wherein the processing unit or the another processing unit is further configured to determine an index associated with the floating point input data using a subset of mantissa bits of floating point input data and fetch an offset and a slope associated with the determined index.

7 . The system of claim 6 , wherein the processing unit is configured to calculate an output value for the floating point input data by processing the linear approximation using the offset and the slope associated with the determined index.

8 . The system of claim 1 , wherein the processing unit is configured to store another offset and another slope in the first segment, wherein the another offset and the another slope are associated with a linear approximation for positive floating point data that is not within the positive piecewise linear range.

9 . The system of claim 1 , wherein the processing unit is configured to store another offset and another slope in the first segment, wherein the another offset and the another slop are associated with a linear approximation for negative floating point data that is not within the negative piecewise linear range.

10 . A system, comprising:

a processing unit configured to process data; and

a memory configured to store data, wherein the memory includes a first segment and a second segment,

wherein the processing unit is configured to store biased exponents associated with a first plurality of input floating point data in the first segment, wherein the biased exponents define a piecewise linear range associated with at least one piecewise linear approximation region of a function to be processed by processing unit or another processing unit, wherein the at least one piecewise linear approximation region includes a plurality of subregions,

wherein the processing unit is configured to store indices data associated with each subregion of the plurality of subregions in the first segment, wherein the indices data associated with the each subregion of the plurality of subregions identify an index associated with a starting subregion of the each subregion of the plurality of subregions and a number of piecewise linear approximations associated with the each subregion of the plurality of subregions,

wherein the processing unit is configured to generate indices based on the indices data, wherein the indices are associated with a number of piecewise linear approximations within the at least one piecewise linear approximation region,

wherein the processing unit is configured to store an offset and a slope for each index of the indices in the second segment, wherein the offset and the slope for the each index is linear approximation for its respective linear approximation region.

11 . The system of claim 10 , wherein the piecewise linear range includes a positive range and a negative range, and wherein one set of biased exponents associated the first plurality of input floating point data is associated with the positive range and wherein another set of biased exponents associated with the first plurality of input floating point data is associated with the negative range, and wherein the piecewise linear range includes a positive piecewise linear range and a negative piecewise linear range.

12 . The system of claim 11 , wherein the indices are associated with the positive piecewise linear range and the negative piecewise linear range.

13 . The system of claim 11 , wherein the processing unit is configured to store at least one offset and one slope in the first segment wherein the at least one offset and one slope are associated with linear approximation of a region within the positive range other than the positive piecewise linear range, and wherein the processing unit is configured to store at least another offset and another slope in the first segment wherein the at least another offset and the another slope are associated with linear approximation of a region within the negative range other than the negative piecewise linear range, wherein the at least one offset and the one slope and the at least another offset and the another slope are stored in the second segment.

14 . The system of claim 10 , wherein the first segment stores data in uint format type and wherein the second segment stores data in a floating point (FP) format type.

15 . The system of claim 14 , wherein the first plurality of input data is a FP16, and wherein the first segment is an uint8 and wherein the second segment is a FP16.

16 . The system of claim 10 , wherein the first plurality of input data is one of a floating point (FP)4, FP8, FP16, FP32, FP9, FP64, or brain FP16 (BFP16).

17 . The system of claim 10 , wherein the piecewise linear range is user modifiable.

18 . The system of claim 10 , wherein the processing unit is configured to receive a floating point input data for the function to be processed,

wherein the processing unit or another processing unit is configured to use a sign bit and biased exponent associated with the floating point input data to determine whether the floating point input data is within the piecewise linear range, and

wherein the processing unit or another processing unit, in response to determining that the floating point input data is within the piecewise linear range, is configured to determine a subregion of the piecewise linear range based on the biased exponent, and wherein the processing unit or the another processing unit is further configured to determine an index associated with the floating point input data using a subset of mantissa bits of floating point input data and fetch an offset and a slope associated with the determined index.

19 . The system of claim 18 , wherein the processing unit is configured to calculate an output value for the floating point input data by processing the linear approximation using the offset and the slope associated with the determined index.

20 . A system comprising:

a processing unit configured to process data; and

a memory configured to store data,

wherein the processing unit is configured to store a first and a second set of biased exponents associated with a first and a second plurality of input floating point data respectively in the memory, wherein the first set of biased exponents defines a positive piecewise linear range associated with a positive piecewise linear approximation region of a function to be processed by processing unit or another processing unit, and wherein the second set of biased exponents defines a negative piecewise linear range associated with a negative piecewise linear approximation region of the function to be processed, wherein the positive piecewise linear approximation region includes a first plurality of subregions, and wherein the negative piecewise linear approximation region includes a second plurality of subregions,

wherein each subregion of the first and the second plurality of subregions includes at least one or more linear approximations,

wherein the processing unit is configured to store indices data for mapping each linear approximation with each subregion of the first and the second plurality of subregions to a unique index value,

wherein the processing unit is configured to store an offset and a slope for each of the unique index value.

21 . The system of claim 20 , wherein the processing unit is configured to store one offset and one slope for a linear approximation associated with positive floating point data that is not within the positive piecewise linear range in the memory, and wherein the processing unit is configured to store another one offset and another one slope for a linear approximation associated with negative floating point data that is not within the negative piecewise linear range in the memory.

22 . The system of claim 20 , wherein the positive and the negative piecewise linear range are user modifiable.

23 . The system of claim 20 , wherein the processing unit or another processing unit is configured to receive a floating point input data for the function to be processed,

wherein the processing unit or another processing unit is configured to use a sign bit and biased exponent associated with the floating point input data to determine whether the floating point input data is within the positive piecewise linear range or within the negative piecewise linear range, and

wherein the processing unit or another processing unit, in response to determining that the floating point input data is within the positive piecewise linear range or the negative piecewise linear range, is configured to determine an index associated with the floating point input data using a subset of mantissa bits of floating point input data and fetch an offset and a slope associated with the determined index.

24 . The system of claim 23 , wherein the processing unit or another processing unit is configured to calculate an output value for the floating point input data by processing the linear approximation using the offset and the slope associated with the determined index.

25 . A method comprising:

storing a first and a second set of biased exponents associated with a first and a second plurality of input floating point data respectively in a memory, wherein the first set of biased exponents defines a positive piecewise linear range associated with a positive piecewise linear approximation region of a function to be processed by processing unit or another processing unit, and wherein the second set of biased exponents defines a negative piecewise linear range associated with a negative piecewise linear approximation region of the function to be processed, wherein the positive piecewise linear approximation region includes a first plurality of subregions, and wherein the negative piecewise linear approximation region includes a second plurality of subregions,

wherein each subregion of the first and the second plurality of subregions includes at least one or more linear approximations;

storing indices data for mapping each linear approximation with each subregion of the first and the second plurality of subregions to a unique index value; and

storing an offset and a slope for each of the unique index value.

26 . The method of claim 25 further comprising:

storing one offset and one slope for a linear approximation associated with positive floating point data that is not within the positive piecewise linear range in the memory; and

storing another one offset and another one slope for a linear approximation associated with negative floating point data that is not within the negative piecewise linear range in the memory.

27 . The method of claim 25 , wherein the positive and the negative piecewise linear range are user modifiable.

28 . The method of claim 25 further comprising:

receiving a floating point input data for the function to be processed;

using a sign bit and biased exponent associated with the floating point input data to determine whether the floating point input data is within the positive piecewise linear range or within the negative piecewise linear range;

in response to determining that the floating point input data is within the positive piecewise linear range or the negative piecewise linear range, determining a subregion of the positive piecewise linear range or a subregion of the negative piecewise linear range based on the biased exponents, and determining an index associated with the floating point input data using a subset of mantissa bits of floating point input data; and

fetching an offset and a slope associated with the determined index.

29 . The method of claim 28 further comprising calculating an output value for the floating point input data by processing the linear approximation using the offset and the slope associated with the determined index.

30 . A system comprising:

a means for storing a first and a second set of biased exponents associated with a first and a second plurality of input floating point data respectively in a memory, wherein the first set of biased exponents defines a positive piecewise linear range associated with a positive piecewise linear approximation region of a function to be processed by processing unit or another processing unit, and wherein the second set of biased exponents defines a negative piecewise linear range associated with a negative piecewise linear approximation region of the function to be processed, wherein the positive piecewise linear approximation region includes a first plurality of subregions, and wherein the negative piecewise linear approximation region includes a second plurality of subregions,

wherein each subregion of the first and the second plurality of subregions includes at least one or more linear approximations;

a means for storing indices data for mapping each linear approximation with each subregion of the first and the second plurality of subregions to a unique index value; and

a means for storing an offset and a slope for each of the unique index value.

31 . The system of claim 30 further comprising:

a means for storing one offset and one slope for a linear approximation associated with positive floating point data that is not within the positive piecewise linear range in the memory; and

a means for storing another one offset and another one slope for a linear approximation associated with negative floating point data that is not within the negative piecewise linear range in the memory.

32 . The system of claim 30 , wherein the positive and the negative piecewise linear range are user modifiable.

33 . The system of claim 30 further comprising:

a means for receiving a floating point input data for the function to be processed;

a means for using a sign bit and biased exponent associated with the floating point input data to determine whether the floating point input data is within the positive piecewise linear range or within the negative piecewise linear range;

a means for determining an index associated with the floating point input data using a subset of mantissa bits of floating point input data in response to determining that the floating point input data is within the positive piecewise linear range or the negative piecewise linear range; and

a means for fetching an offset and a slope associated with the determined index.

34 . The system of claim 33 further comprising calculating an output value for the floating point input data by processing the linear approximation using the offset and the slope associated with the determined index.