Device for computing an inner product
Abstract
A device for computing an inner product includes a data memory, an inverted index memory (IIM), a weight mapping table, a controller, a pre-accumulator, and a multiplier-accumulate (MAC) module. The data memory stores data groups. Each data group includes data values. The IIM stores a data address and a corresponding weight index value of each data group in the data memory. The weight mapping table stores a weight value corresponding to the weight index value. The controller and the IIM drive the data memory to sequentially output the data values of the data groups and drive the mapping table to sequentially output weight values. The pre-accumulator accumulates the data values of each data group to generate accumulation values. The MAC module computes the accumulation and the weight value that correspond to each data group based on a distributive law, thereby generating an inner product value.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A device for computing an inner product comprising:
a data memory configured to store a plurality of data groups, wherein each of the plurality of data groups comprises data values; an inverted index memory (IIM) configured to store a data address and a corresponding weight index value of each of the plurality of data groups in the data memory; a weight mapping table configured to store a weight value corresponding to the weight index value; a controller electrically connected to the data memory, the IIM, and the weight mapping table, wherein the controller is configured to sequentially obtain the data addresses and the corresponding weight index values of the plurality of data groups from the IIM, thereby driving the data memory to sequentially output the data values of the plurality of data groups and driving the weight mapping table to sequentially output the weight values corresponding to the weight index values; a pre-accumulator electrically connected to the data memory, wherein the pre-accumulator is configured to receive and accumulate the data values of each of the plurality of data groups to generate accumulation values; and a multiplier-accumulate (MAC) module electrically connected to the pre-accumulator and the weight mapping table, wherein the MAC module is configured to receive the accumulation value and the weight value that correspond to each of the plurality of data groups, and configured to perform multiplication and accumulation on the accumulation value and the weight value that correspond to each of the plurality of data groups based on a distributive law, thereby generating an inner product value.
2 . The device for computing an inner product according to claim 1 , wherein the IIM is configured to store the data address and the corresponding weight index value of each of the plurality of data groups based on variable length coding.
3 . The device for computing an inner product according to claim 1 , wherein the weight values corresponding to the plurality of data groups comprise positive values and negative values, and the IIM is configured to store corresponding the data addresses in an order of from the positive values to the negative values.
4 . The device for computing an inner product according to claim 3 , wherein the IIM is configured to store corresponding the data addresses in an order of from a smallest the negative value to a largest the negative value, and the data address corresponding to the smallest the negative value is closer to the data address corresponding to the positive value than the data address corresponding to the largest the negative value.
5 . The device for computing an inner product according to claim 1 , wherein the MAC module includes:
a multiplier electrically connected to the pre-accumulator and the weight mapping table, wherein the multiplier is configured to receive and multiply the accumulation value and the weight value that correspond to each of the plurality of data groups, thereby generating product values; and an accumulator electrically connected to the multiplier and configured to receive and accumulate the product values, thereby generating the inner product value.
6 . The device for computing an inner product according to claim 5 , wherein the accumulator is further electrically connected to a function processor, and the function processor is configured to perform an activation function, a rounding function, or a saturation function on the inner product value.
7 . The device for computing an inner product according to claim 1 , wherein the inner product value is applied to a neural network, a filter, or a related computation.
8 . A device for computing an inner product comprising:
a data memory configured to store a plurality of data groups, wherein each of the plurality of data groups comprises data values; an inverted index memory (IIM) configured to store a data address and a corresponding weight value of each of the plurality of data groups in the data memory; a controller electrically connected to the data memory and the IIM, wherein the controller is configured to sequentially obtain the data addresses and the corresponding weight values of the plurality of data groups from the IIM, thereby driving the data memory to sequentially output the data values of the plurality of data groups and to sequentially output the weight values corresponding to the plurality of data groups; a pre-accumulator electrically connected to the data memory, wherein the pre-accumulator is configured to receive and accumulate the data values of each of the plurality of data groups to generate accumulation values; and a multiplier-accumulate (MAC) module electrically connected to the pre-accumulator and the controller, wherein the MAC module is configured to receive the accumulation value and the weight value that correspond to each of the plurality of data groups, and configured to perform multiplication and accumulation on the accumulation value and the weight value that correspond to each of the plurality of data groups based on a distributive law, thereby generating an inner product value.
9 . The device for computing an inner product according to claim 8 , wherein the IIM is configured to store the data address and the corresponding weight value of each of the plurality of data groups based on variable length coding.
10 . The device for computing an inner product according to claim 8 , wherein the weight values corresponding to the plurality of data groups comprise positive values and negative values, and the IIM is configured to store corresponding the data addresses in an order of from the positive values to the negative values.
11 . The device for computing an inner product according to claim 10 , wherein the IIM is configured to store corresponding the data addresses in an order of from a smallest the negative value to a largest the negative value, and the data address corresponding to the smallest the negative value is closer to the data address corresponding to the positive value than the data address corresponding to the largest the negative value.
12 . The device for computing an inner product according to claim 8 , wherein the MAC module includes:
a multiplier electrically connected to the pre-accumulator and the controller, wherein the multiplier is configured to receive and multiply the accumulation value and the weight value that correspond to each of the plurality of data groups, thereby generating product values; and an accumulator electrically connected to the multiplier and configured to receive and accumulate the product values, thereby generating the inner product value.
13 . The device for computing an inner product according to claim 12 , wherein the accumulator is further electrically connected to a function processor, and the function processor is configured to perform an activation function, a rounding function, or a saturation function on the inner product value.
14 . The device for computing an inner product according to claim 8 , wherein the inner product value is applied to a neural network, a filter, or a related computation.Join the waitlist — get patent alerts
Track US2024126508A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.