# US 2025/0156180 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/0156180 A1
- Document ID: US20250156180A1
- Status: Published application
- Kind: A1
- Application number: 18/389,394
- 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: Weijun Zhang; Hengchang Xiong; Yu Hu; Yuanxiang Guo; Jiang Jiang; Chia-Lin Lu
- Web page: https://patentgrep.com/patent/US20250156180A1

## 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: a storage module, configured to store first and second lookup tables; a lookup table circuit, configured to output, in response to respective index values of data elements and based on the first lookup table, exponential function values corresponding to the data elements; and output, in response to an index value of an addition operation result and based on the second lookup table, a reciprocal corresponding to the addition operation result; an adder, configured to obtain the addition operation result by adding the exponential function values for the lookup table circuit; and a multiplier, configured to output a multiplication operation result of an exponential function value of an ith data element and the reciprocal of the addition operation result, to obtain a Softmax function value of the ith data element.

## Claims

### Claim 1

A hardware acceleration circuit, comprising:
a storage module, configured to store a first lookup table and a second lookup table;
a lookup table circuit, configured to output, in response to respective index values of a plurality of data elements in a data set and based on the first lookup table, a plurality of exponential function values corresponding to the plurality of data elements; and output, in response to an index value of an addition operation result and based on the second lookup table, a reciprocal corresponding to the addition operation result;
an adder, configured to output the addition operation result to the lookup table circuit, wherein the addition operation result is a result obtained by performing an addition operation on the plurality of exponential function values; and
a multiplier, configured to output a multiplication operation result of an exponential function value of an ith data element in the plurality of data elements and the reciprocal, to obtain a Softmax function value of the ith data element.

### Claim 2 (depends on 1)

The hardware acceleration circuit according to claim 1, wherein
the exponential function value is data whose bit width is N1 bits, the addition operation result is data whose bit width is N2 bits, and an index value of the addition operation result is data whose bit width is N3 bits, wherein, N1 and N3 are less than N2; and
the hardware acceleration circuit further comprises: a first conversion circuit, configured to convert, based on an index value conversion parameter, the addition operation result to the index value of the addition operation result.

### Claim 3 (depends on 2)

The hardware acceleration circuit according to claim 2, wherein
the storage module comprises a static storage module;
the index value conversion parameter is stored in the static storage module; and
the index value conversion parameter is determined, by collecting statistics on Gaussian distribution data of a plurality of addition operation results of a plurality of sample data sets, according to the Gaussian distribution data.

### Claim 4 (depends on 2)

The hardware acceleration circuit according to claim 2, further comprising:
an index value conversion parameter obtaining circuit, configured to determine and output, based on the addition operation result, the index value conversion parameter, wherein
the first conversion circuit is configured to convert, based on the index value conversion parameter, the addition operation result to the corresponding index value; and
the outputting, by the lookup table circuit based on the second lookup table, a reciprocal corresponding to the addition operation result is specifically: outputting, based on a selected second lookup table, the reciprocal corresponding to the addition operation result, wherein the second lookup table is a second lookup table that corresponds to the index value conversion parameter and that is of a plurality of candidate second lookup tables.

### Claim 5 (depends on 4)

The hardware acceleration circuit according to claim 4, wherein
the storage module comprises a static storage module, and the plurality of candidate second lookup tables are stored in the static storage module; or
the storage module comprises a dynamic storage module, and the selected second lookup table is stored in the dynamic storage module.

### Claim 6 (depends on 1)

The hardware acceleration circuit according to claim 1, wherein
the storage module comprises a first storage area and a second storage area, the first lookup table is stored in the first storage area, and the second lookup table is stored in the second storage area;
the lookup table circuit comprises:
a first basic lookup table circuit unit, comprising a first logic circuit, a first input end group, a first control end group, and a first output end group, wherein the first input end group is connected to the first storage area; the first logic circuit is configured to: output, in response to an index value of the ith data element in the data set input from the first control end group, a corresponding exponential function value from the first output end group; and
a second basic lookup table circuit unit, comprising a second logic circuit, a second input end group, a second control end group, and a second output end group, wherein the second input end group is connected to the second storage area; the second logic circuit is configured to: output, in response to the index value of the addition operation result input from the second control end group, the corresponding reciprocal from the second output end group,
wherein the first basic lookup table circuit unit is N0 input and N1 output, and the second basic lookup table circuit unit is N3 input and N4 output, wherein a value range of N0, N1, N3, and N4 is [8, 32].

### Claim 7 (depends on 1)

The hardware acceleration circuit according to claim 1, wherein
the storage module comprises a first storage area, configured to store the first lookup table and the second lookup table in a time-sharing manner; or the storage module comprises a first storage area and a second storage area, the first lookup table is stored in the first storage area, and the second lookup table is stored in the second storage area;
the lookup table circuit comprises:
a first basic lookup table circuit unit, comprising a first logic circuit, a first input end group, a first control end group, and a first output end group, wherein the first input end group is connected to the storage module, and the first logic circuit configured to: output, in response to an index value of the ith data element input from the first input end group and based on the first lookup table, the exponential function value corresponding to the ith data element from the first output end group in a first period of time, and output, in response to the index value of the addition operation result input from the first input end group and based on the second lookup table, the reciprocal corresponding to the addition operation result from the first output end group in a second period of time after the first period of time,
wherein the first basic lookup table circuit unit is in an N0-input and N1-output status; or
wherein the first basic lookup table circuit unit further comprises a status control end group, configured to input a first status control signal in the first period of time and input a second status control signal in the second period of time, to configure the basic lookup table circuit unit into an N0-input and N1-output status in the first period of time and an N3-input and N4-output status in the second period of time, at least one of a pair of N0 and N3 and a pair of N1 and N4 is not equal.

### Claim 8 (depends on 2)

The hardware acceleration circuit according to claim 2, further comprising:
a second conversion circuit, configured to convert, based on the index value conversion parameter, the multiplication operation result from data whose bit width is N4 bits to a Softmax function value whose bit width is N5 bits, wherein N4 is greater than N5.

### Claim 9 (depends on 2)

The hardware acceleration circuit according to claim 2, 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, to obtain the data set comprising the plurality of data elements; and
a third conversion unit, configured to convert the plurality of data elements to a plurality of index values corresponding to the first lookup table.

### Claim 10 (depends on 1)

The hardware acceleration circuit according to claim 1, wherein
the exponential function value, the addition operation result, the multiplication operation result, and the reciprocal of the addition operation result are fixed-point integers.

### Claim 11 (depends on 1)

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

### Claim 12

A data processing acceleration method, comprising:
obtaining, based on a first lookup table, a plurality of exponential function values corresponding to a plurality of data elements in a data set;
obtaining an addition operation result of the plurality of exponential function values;
obtaining, based on a second lookup table, a reciprocal corresponding to the addition operation result; and
obtaining a multiplication operation result of an exponential function value of an ith data element in the plurality of data elements and the reciprocal corresponding to the addition operation result, to obtain a Softmax function value of the ith data element.

### Claim 13 (depends on 12)

The method according to claim 12, wherein the reciprocal corresponding to the addition operation result is obtained, based on the second lookup table, by:
converting, based on an index value conversion parameter, the addition operation result from data whose bit width is N2 bits to an index value whose bit width is N3 bits, wherein N3 is less than N2; and
obtaining, based on the second lookup table and the index value of the addition operation result, the reciprocal corresponding to the addition operation result.

### Claim 14 (depends on 13)

The method according to claim 13, further comprising:
writing the index value conversion parameter into a static storage module through a compiler; and
determining the index value conversion parameter by collecting statistics on Gaussian distribution data of a plurality of addition operation results of a plurality of sample data sets, according to the Gaussian distribution data.

### Claim 15 (depends on 13)

The method according to claim 13, further comprising:
determining, based on the addition operation result, the index value conversion parameter;
wherein the reciprocal corresponding to the addition operation result is obtained, based on the second lookup table and the index value of the addition operation result, by:
determining a selected second lookup table corresponding to the index value conversion parameter from a plurality of candidate second lookup tables; and
obtaining, based on the selected second lookup table and the index value of the addition operation result, the reciprocal corresponding to the addition operation result.

### Claim 16 (depends on 15)

The method according to claim 15, further comprising:
writing the plurality of candidate second lookup tables into a static storage module through a compiler; and/or
loading the selected second lookup table into a dynamic storage module.

### Claim 17 (depends on 12)

The method according to claim 12, wherein
before the obtaining, based on a first lookup table, a plurality of exponential function values corresponding to a plurality of data elements in a data set, the method further comprises: performing a subtraction operation on 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; and/or
after the obtaining a multiplication operation result of an exponential function value of an ith data element in the plurality of data elements and the reciprocal, the method further comprises: converting, based on an index value conversion parameter, the multiplication operation result from data whose bit width is N4 bits to data whose bit width is N5 bits, wherein N4 is greater than N5.

### Claim 18 (depends on 12)

The method according to claim 12, wherein
the exponential function value, the addition operation result, the multiplication operation result, and the reciprocal of the addition operation result are fixed-point integers; and
a bit width value range of the exponential function value and the reciprocal is [8, 32].

### Claim 19 (depends on 12)

The method according to claim 12, wherein the method is used for implementing a Softmax function layer of a neural network, and 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 20 (depends on 12)

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 12.
