# US 2025/0156181 A1 · Hardware acceleration circuit, data processing acceleration method, chip, and accelerator

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0156181 A1
- Document ID: US20250156181A1
- Status: Published application
- Kind: A1
- Application number: 18/389,444
- Filed: 2023-11-14
- Published: 2025-05-15
- Earliest claimed: 2023-11-14
- Assignees: Guangzhou Xiaopeng Autopilot Technology Co., Ltd.
- Applicants: Guangzhou Xiaopeng Autopilot Technology Co., Ltd.
- Inventors: Jiang Jiang; Yuanxiang Guo; Weijun Zhang; Hengchang Xiong; Yu Hu; Chia-Lin Lu
- Web page: https://patentgrep.com/patent/US20250156181A1

## CPC

- G06F 9/3001: {Arithmetic instructions}
- G06F 9/3877: {using a secondary processor, e.g. coprocessor (peripheral processor G06F13/12)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A hardware acceleration circuit, a data processing acceleration method, a chip, and an accelerator are provided. The circuit includes: an exponential function module, configured to obtain a plurality of exponential function values of a plurality of data elements in a data set; an add-subtract module, configured to obtain an addition operation result of the exponential function values; and a natural logarithm function module, configured to obtain a natural logarithm value of the addition operation result, where the add-subtract module is further configured to obtain a subtraction operation result of an ith data element in the data elements and the natural logarithm value; and the exponential function module is further configured to obtain an exponential function value of the subtraction operation result, to obtain a specific function value corresponding to the ith data element. Solutions provided in embodiments of this application facilitate an increase in precision of a non-linear function value.

## Claims

### Claim 1

A hardware acceleration circuit, comprising:
an exponential function module, configured to obtain a plurality of exponential function values of a plurality of data elements in a data set;
an add-subtract module, configured to obtain an addition operation result of the plurality of exponential function values; and
a natural logarithm function module, configured to obtain a natural logarithm value of the addition operation result,
wherein the add-subtract module is further configured to obtain a subtraction operation result of an ith data element in the plurality of data elements and the natural logarithm value; and
wherein the exponential function module is further configured to obtain an exponential function value of the subtraction operation result in order to obtain a specific function value corresponding to the ith data element.

### Claim 2 (depends on 1)

The hardware acceleration circuit according to claim 1, wherein
the natural logarithm function module is further configured to obtain a natural logarithm value corresponding to an exponential function value of the ith data element; and
the add-subtract module is configured to obtain the subtraction operation result of the ith data element and the natural logarithm value by: obtaining a subtraction operation result of the natural logarithm value corresponding to the exponential function value of the ith data element and the natural logarithm value of the addition operation result.

### Claim 3 (depends on 1)

The hardware acceleration circuit according to claim 1, wherein
the exponential function module comprises at least one of a first lookup table module and a fourth lookup table module, the first lookup table module is configured to output, based on a first lookup table, the plurality of exponential function values of the plurality of data elements, and the fourth lookup table module is configured to output, based on a fourth lookup table, the exponential function value corresponding to the subtraction operation result; and
the natural logarithm function module comprises at least one of a second lookup table module and a third lookup table module, the second lookup table module is configured to output, based on a second lookup table, a natural logarithm value corresponding to an exponential function value of the ith data element, and the third lookup table module is configured to output, based on a third lookup table, the natural logarithm value corresponding to the addition operation result.

### Claim 4 (depends on 3)

The hardware acceleration circuit according to claim 3, comprising at least two lookup table modules of the first lookup table module to the fourth lookup table module,
wherein each of the at least two lookup table modules is configured with a basic lookup table circuit unit; or
wherein the at least two lookup table modules share a basic lookup table circuit unit.

### Claim 5 (depends on 3)

The hardware acceleration circuit according to claim 3, comprising at least three lookup table modules of the first lookup table module to the fourth lookup table module,
wherein at least two of the at least three lookup table modules share a first basic lookup table circuit unit, and at least one other of the at least three lookup table modules is configured with a second basic lookup table circuit unit;
wherein the first basic lookup table circuit unit is M1-bit input and M2-bit output, and the second basic lookup table circuit unit is M3-bit input and M4-bit output; and
wherein at least one of a pair of M1 and M3 and a pair of M2 and M4 is not equal.

### Claim 6 (depends on 5)

The hardware acceleration circuit according to claim 5, further comprising a conversion circuit, configured to convert, in response to a status control signal, the addition operation result of the plurality of exponential function values output by the add-subtract module from data whose bit width is N2 bits to data whose bit width is M3 bits, and output the data whose bit width is M3 bits to the second basic lookup table circuit unit; and convert, in response to another status control signal, a subtraction operation result of a first natural logarithm value and a second natural logarithm value output by the add-subtract module from data whose bit width is N2 bits to data whose bit width is M1 bits, and output the data whose bit width is M1 bits to the first basic lookup table circuit unit, wherein M1 and M3 are not equal.

### Claim 7 (depends on 1)

The hardware acceleration circuit according to claim 1, wherein the add-subtract module comprises an adder and a subtracter, the adder is configured to obtain the addition operation result of the plurality of exponential function values, the subtracter is configured to obtain the subtraction operation result of the ith data element and the natural logarithm value of the addition operation result,
wherein the adder and the subtracter are configured independently of each other; or
wherein the adder and the subtracter share an addition operation unit.

### Claim 8 (depends on 1)

The hardware acceleration circuit according to claim 1, further comprising:
a subtracter, configured to output subtraction operation results of a plurality of pieces of initial data in an initial data set and a maximum value in the plurality of pieces of initial data in order to obtain the data set comprising the plurality of data elements.

### Claim 9 (depends on 3)

The hardware acceleration circuit according to claim 3, wherein the first lookup table is NO-bit input and N1-bit output, the third lookup table is N3-bit input and N5-bit output, and the fourth lookup table is N6-bit input and N7-bit output,
wherein values of N0, N1, N3, and N5 to N7 are in a range of [8, 12].

### Claim 10 (depends on 1)

An artificial intelligence chip, comprising the hardware acceleration circuit according to claim 1.

### Claim 11

A data processing acceleration method, comprising:
obtaining a plurality of exponential function values of a plurality of data elements in a data set;
performing an addition operation on the plurality of exponential function values, to obtain an addition operation result;
obtaining a natural logarithm value of the addition operation result;
performing a subtraction operation on an ith data element in the plurality of data elements and the natural logarithm value of the addition operation result to obtain a subtraction operation result of subtracting the natural logarithm value from the ith data element; and
obtaining an exponential function value of the subtraction operation result to obtain a specific function value corresponding to the ith data element.

### Claim 12 (depends on 11)

The method according to claim 11, wherein
the plurality of exponential function values of the plurality of data elements in the data set are obtained by: obtaining, based on a first lookup table, the plurality of exponential function values corresponding to the plurality of data elements in the data set; and
the natural logarithm value of the addition operation result is obtained by: obtaining, based on a third lookup table, the natural logarithm value corresponding to the addition operation result; and
the exponential function value of the subtraction operation result is obtained by: obtaining, based on a fourth lookup table, the exponential function value corresponding to the subtraction operation result.

### Claim 13 (depends on 11)

The method according to claim 11, wherein the subtraction operation on the ith data element in the plurality of data elements and the natural logarithm value of the addition operation result is performed by:
obtaining a natural logarithm value corresponding to an exponential function value of the ith data element; and
performing a subtraction operation on the natural logarithm value corresponding to the exponential function value of the ith data element and the natural logarithm value of the addition operation result.

### Claim 14 (depends on 11)

The method according to claim 11, wherein the subtraction operation on the ith data element in the plurality of data elements and the natural logarithm value of the addition operation result is performed by:
performing a subtraction operation directly on the ith data element in the plurality of data elements and the natural logarithm value of the addition operation result.

### Claim 15 (depends on 11)

The method according to claim 11, wherein
the plurality of exponential function values of the plurality of data elements in the data set are obtained by: obtaining, based on a first lookup table, the plurality of exponential function values corresponding to the plurality of data elements in the data set;
the natural logarithm value of the addition operation result is obtained by: obtaining, based on a third lookup table, the natural logarithm value corresponding to the addition operation result;
the subtraction operation on the ith data element in the plurality of data elements and the natural logarithm value of the addition operation result is performed by: obtaining, based on a second lookup table, a natural logarithm value corresponding to an exponential function value of the ith data element; and performing a subtraction operation on the natural logarithm value corresponding to the exponential function value of the ith data element and the natural logarithm value of the addition operation result; and
the exponential function value of the subtraction operation result is obtained by: obtaining, based on a fourth lookup table, the exponential function value corresponding to the subtraction operation result.

### Claim 16 (depends on 15)

The method according to claim 15, wherein
the first lookup table is NO-bit input and N1-bit output, the second lookup table is N1-bit input and N14-bit output, the third lookup table is N3-bit input and N5-bit output, and the fourth lookup table is N6-bit input and N7-bit output, and
values of N0, N1, and N3 to N7 are in a range of [8, 12].

### Claim 17 (depends on 11)

The method according to claim 11, further comprising:
performing a subtraction operation on each of a plurality of pieces of initial data in an initial data set and a maximum value in the plurality of pieces of initial data, to obtain the data set comprising the plurality of data elements corresponding to the plurality of pieces of initial data.

### Claim 18 (depends on 11)

The method according to claim 11, being configured for implementing a Softmax function layer of a neural network, wherein the neural network is configured to classify to-be-processed data, wherein
the to-be-processed data comprises at least one of voice data, text data, and image data.

### Claim 19 (depends on 11)

An artificial intelligence accelerator, comprising:
a processor; and
a memory, wherein executable code is stored on the memory, and the executable code, when executed by the processor, enables the processor to perform the method according to claim 11.
