CN-122018852-A - Data accumulating method, accumulator, chip and computer readable storage medium
Abstract
The application discloses a data accumulation method, an accumulator, a chip and a computer readable storage medium. The data accumulation method comprises the steps of obtaining first sequence data and second sequence data, wherein the first sequence data comprises a plurality of first sequence numbers which are sequentially arranged, the second sequence data comprises a plurality of second sequence numbers which are sequentially arranged, extracting the first sequence numbers from the first sequence data according to a preset first jump point step length, extracting the second sequence numbers from the second sequence data according to a preset second jump point step length, wherein at least one jump point step length of the first jump point step length and the second jump point step length is larger than 1, carrying out item-by-item operation on the first sequence numbers and the second sequence numbers based on a preset operation rule, and accumulating operation results. The technical scheme of the application can effectively reduce the data storage capacity during calculation and reduce the waste of resources.
Inventors
- ZENG JINGHONG
Assignees
- 北杉集成电路(深圳)有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251210
Claims (10)
- 1. A data accumulation method, characterized in that the data accumulation method comprises: Acquiring first sequence data and second sequence data, wherein the first sequence data comprises a plurality of first sequence numbers which are sequentially arranged, and the second sequence data comprises a plurality of second sequence numbers which are sequentially arranged; extracting a first sequence number from the first sequence data according to a preset first jump point step length; Extracting a second sequence number from the second sequence data according to a preset second jumping step length, wherein at least one jumping step length of the first jumping step length and the second jumping step length is larger than 1; and carrying out item-by-item operation on the first sequence number and the second sequence number based on a preset operation rule, and accumulating operation results.
- 2. The data accumulation method of claim 1 wherein the first and second skip steps are positive integers.
- 3. The method of claim 1, wherein the first skip step size and the second skip step size are fractional values, and wherein the fractional step size values are either integer or rounded to a carry method to obtain integer values.
- 4. The data accumulation method as in claim 1 wherein prior to the step of acquiring the first sequence data and the second sequence data, comprising: And respectively performing step length setting, jump point direction setting, jump point starting point position setting and jump point mode setting on the first jump point step length and the second jump point step length, wherein the jump point mode setting comprises a unidirectional mode and a cyclic mode.
- 5. The method of claim 4, wherein the skip point direction includes a forward skip point and a reverse skip point, the forward skip point is a skip point selection number sequentially from a start end to an end of the sequence, and the reverse skip point is a skip point selection number sequentially from the end of the sequence to the start end; under the circulation mode, when the jump point is selected to exceed the tail end of the sequence, continuously selecting data from the starting end of the sequence; in the unidirectional mode, when the jump point is selected to exceed the end of the sequence, data selection is stopped.
- 6. The method of claim 1, wherein the predetermined operation rule is one of integer multiplication, floating point multiplication, or polynomial operation of multi-point data.
- 7. The data accumulation method of claim 1, wherein the first skip step size is equal to the second skip step size or the first skip step size is unequal to the second skip step size.
- 8. An accumulator, wherein the accumulator comprises a first storage group and a second storage group; The first storage group is used for storing first sequence data, the first storage group comprises a plurality of first storage points, the first sequence data comprises a plurality of first sequence numbers, and one first storage point stores one first sequence number; the second storage group is used for storing second sequence data, the second storage group comprises a plurality of second storage points, the second sequence data comprises a plurality of second sequence numbers, and one second storage point stores one second sequence number; The accumulator is configured to accumulate the first sequence number and the second sequence number using the data accumulation method according to any one of claims 1 to 7.
- 9. A chip comprising an accumulator for accumulating data using the data accumulation method according to any one of claims 1 to 7.
- 10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the data accumulation method according to any one of claims 1 to 7.
Description
Data accumulating method, accumulator, chip and computer readable storage medium Technical Field The present invention relates to the field of chip technologies, and in particular, to a data accumulation method, an accumulator, a chip, and a computer readable storage medium. Background In the chip technical field, multiply-accumulate operation is widely used as a core operation mode. However, conventional multiply-accumulate accumulators only support a point-wise multiply-accumulate operation for two sets of sequences. When facing the multi-scene functional requirement, the resource occupation problem is caused. On one hand, in order to realize different functions, a plurality of groups of independent parameter data are required to be stored, on the other hand, even if the parameter data have a large number of repetitions, the fixed mode of point-by-point multiplication and addition still requires to completely store all the parameters, and redundant storage of the repeated data cannot be avoided. Therefore, the memory occupation of the chip is increased, and the memory resource and the operation resource in the chip are wasted seriously. Disclosure of Invention Aiming at the defects in the prior art, the invention provides a data accumulation method which can effectively reduce the data storage amount during calculation and reduce the waste of resources. The application provides a data accumulation method, which comprises the following steps: Acquiring first sequence data and second sequence data, wherein the first sequence data comprises a plurality of first sequence numbers which are sequentially arranged, and the second sequence data comprises a plurality of second sequence numbers which are sequentially arranged; extracting a first sequence number from the first sequence data according to a preset first jump point step length; Extracting a second sequence number from the second sequence data according to a preset second jumping step length, wherein at least one jumping step length of the first jumping step length and the second jumping step length is larger than 1; and carrying out item-by-item operation on the first sequence number and the second sequence number based on a preset operation rule, and accumulating operation results. In one aspect, the first skip step size and the second skip step size are both positive integers. In one aspect, the first skip step size and the second skip step size are fractional values, and the fractional step size values are either integer or rounded to carry to obtain integer values. In one aspect, prior to the step of acquiring the first sequence data and the second sequence data, the method comprises: And respectively performing step length setting, jump point direction setting, jump point starting point position setting and jump point mode setting on the first jump point step length and the second jump point step length, wherein the jump point mode setting comprises a unidirectional mode and a cyclic mode. In one aspect, the skip point direction includes a forward skip point and a reverse skip point, the forward skip point is a skip point selection number sequentially from a start end to an end of the sequence, and the reverse skip point is a skip point selection number sequentially from the end of the sequence to the start end; under the circulation mode, when the jump point is selected to exceed the tail end of the sequence, continuously selecting data from the starting end of the sequence; in the unidirectional mode, when the jump point is selected to exceed the end of the sequence, data selection is stopped. In one aspect, the preset operation rule is one of integer multiplication, floating point multiplication or polynomial operation of multi-point data. In one aspect, the first skip step size is equal to the second skip step size, or the first skip step size is unequal to the second skip step size. In addition, in order to solve the above problems, the present application also provides an accumulator including a first storage group and a second storage group; The first storage group is used for storing first sequence data, the first storage group comprises a plurality of first storage points, the first sequence data comprises a plurality of first sequence numbers, and one first storage point stores one first sequence number; the second storage group is used for storing second sequence data, the second storage group comprises a plurality of second storage points, the second sequence data comprises a plurality of second sequence numbers, and one second storage point stores one second sequence number; the accumulator is configured to accumulate the first sequence number and the second sequence number using a data accumulation method as described above. In addition, in order to solve the above problems, the present application also provides a chip including an accumulator for accumulating data using the data accumulating method as described above. In addition, in