CN109074334A - Data processing method, equipment, dma controller and computer readable storage medium - Google Patents
Data processing method, equipment, dma controller and computer readable storage medium Download PDFInfo
- Publication number
- CN109074334A CN109074334A CN201780022803.9A CN201780022803A CN109074334A CN 109074334 A CN109074334 A CN 109074334A CN 201780022803 A CN201780022803 A CN 201780022803A CN 109074334 A CN109074334 A CN 109074334A
- Authority
- CN
- China
- Prior art keywords
- configuration
- dma
- feature vector
- input feature
- configuration information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/28—Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Biophysics (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Navigation (AREA)
- Image Processing (AREA)
Abstract
A kind of data processing method, equipment, dma controller and computer readable storage medium, the described method includes: generating the first DMA according to the characteristic information of input feature vector figure reads configuration information and the first DMA write configuration information, and determine that the 2nd DMA reads configuration information and the second DMA write configuration information (201);Configuration information is read according to the first DMA, reads data from the input feature vector figure;According to the first DMA write configuration information, the data of reading are exported and give arithmetic logic (202);The operation result that configuration information reads arithmetic logic is read according to the 2nd DMA;According to the second DMA write configuration information, by the operation result storage of reading to output characteristic pattern (203).Using this method, the data-moving in CNN can be realized by dma controller, do not needed to realize the data-moving in CNN by CPU, to mitigate CPU burden, more efficiently moving data, and then played the effect for accelerating CNN operation, while also failure is not active.
Description
Technical field
The present invention relates to technical field of image processing, more particularly, to a kind of data processing method, equipment, DMA (Direct
Memory Access, direct memory access) controller and computer readable storage medium.
Background technique
In machine learning, CNN (Convolutional Neural Network, convolutional neural networks) is a kind of feedforward
Neural network, its artificial neuron can respond the surrounding cells in a part of coverage area, have for large-scale image procossing
There is outstanding performance.CNN is the neural network of a multilayer, and every layer is made of multiple two-dimensional surfaces, and each plane is by multiple independences
Neuron composition.Generally, CNN can be made of convolutional layer and pond layer, and the effect of convolutional layer is the various of extraction image
Feature, the effect of pond layer are to carry out feature extraction twice to primitive character signal to be greatly reduced to reduce feature resolution
Training parameter, and the degree of model over-fitting can be mitigated.In addition, the special construction that CNN is shared with its local weight, reduces net
The complexity of network, the especially image of multidimensional input vector can directly input this feature of network, avoid feature extraction and
The complexity of data reconstruction in assorting process, thus be used widely.
A variety of data-moving tasks involved in CNN, data-moving task by CPU (Central Processing Unit,
Central processing unit) it realizes, data-moving efficiency is lower, increases excessive burden to CPU.
Summary of the invention
The present invention provides data processing method, equipment, dma controller and computer readable storage medium.
First aspect present invention provides a kind of data processing method, is applied to dma controller, comprising:
The first DMA is generated according to the characteristic information of input feature vector figure and reads configuration information and the first DMA write configuration information, and really
Fixed 2nd DMA reads configuration information and the second DMA write configuration information;
Configuration information is read according to the first DMA, reads data from the input feature vector figure;According to the first DMA
Configuration information is write, the data of reading are exported to arithmetic logic;
The operation result that configuration information reads arithmetic logic is read according to the 2nd DMA;It is configured according to second DMA write
Information, by the operation result storage of reading to output characteristic pattern.
Second aspect of the present invention provides a kind of data processing method, is applied to dma controller, comprising:
The first DMA, which is generated, according to the characteristic information of the first input feature vector figure reads configuration information and the first DMA write configuration information,
The 2nd DMA is generated according to the characteristic information of the second input feature vector figure and reads configuration information and the second DMA write configuration information, and determines the
Three DMA read configuration information and third DMA write configuration information;
Configuration information is read according to the first DMA, reads the first data from the first input feature vector figure;According to described first
DMA write configuration information exports the first data of reading to arithmetic logic;
Configuration information is read according to the 2nd DMA, reads the second data from the second input feature vector figure;According to described second
DMA write configuration information exports the second data of reading to arithmetic logic;
The operation result that configuration information reads the arithmetic logic is read according to the 3rd DMA;According to the third DMA write
Configuration information, by the operation result storage of reading to output characteristic pattern.
Third aspect present invention provides a kind of dma controller, and the dma controller is used for:
The first DMA is generated according to the characteristic information of input feature vector figure and reads configuration information and the first DMA write configuration information, and really
Fixed 2nd DMA reads configuration information and the second DMA write configuration information;
Configuration information is read according to the first DMA, reads data from the input feature vector figure;According to the first DMA
Configuration information is write, the data of reading are exported to arithmetic logic;
The operation result that configuration information reads arithmetic logic is read according to the 2nd DMA;It is configured according to second DMA write
Information, by the operation result storage of reading to output characteristic pattern.
Fourth aspect present invention provides a kind of dma controller, and the dma controller is used for:
The first DMA, which is generated, according to the characteristic information of the first input feature vector figure reads configuration information and the first DMA write configuration information,
The 2nd DMA is generated according to the characteristic information of the second input feature vector figure and reads configuration information and the second DMA write configuration information, and determines the
Three DMA read configuration information and third DMA write configuration information;
Configuration information is read according to the first DMA, reads the first data from the first input feature vector figure;According to described first
DMA write configuration information exports the first data of reading to arithmetic logic;
Configuration information is read according to the 2nd DMA, reads the second data from the second input feature vector figure;According to described second
DMA write configuration information exports the second data of reading to arithmetic logic;
The operation result that configuration information reads the arithmetic logic is read according to the 3rd DMA;According to the third DMA write
Configuration information, by the operation result storage of reading to output characteristic pattern.
Fifth aspect present invention, provides a kind of data processing equipment, and the data processing equipment includes:
Memory, for storing program code;Dma controller works as said program code for calling said program code
It is performed, realizes the data processing method of preceding claim.
Sixth aspect present invention provides a kind of computer readable storage medium, is stored on computer readable storage medium
Several computer instructions, the computer instruction, which is performed, realizes above-mentioned data processing method.
Based on the above-mentioned technical proposal, in the embodiment of the present invention, the data-moving in CNN can be realized by dma controller, no
It needs to realize the data-moving in CNN by CPU, to mitigate CPU burden, more efficiently moving data, and then plays and accelerate CNN
The effect of operation, while also failure is not active.
Detailed description of the invention
It, below will be to the present invention in order to clearly illustrate the embodiment of the present invention or technical solution in the prior art
Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below
Attached drawing is only some embodiments recorded in the present invention for those of ordinary skill in the art can also be according to this hair
These attached drawings of bright embodiment obtain other attached drawings.
Figure 1A-Fig. 1 G is the operation principle schematic diagram of dma controller;
Fig. 2A-Fig. 2 I is the schematic diagram that Pooling operation is carried out to input feature vector figure;
Fig. 3 A- Fig. 3 F is the schematic diagram that Element-wise operation, BN operation are carried out to input feature vector figure;
Fig. 4 is one embodiment block diagram of data processing equipment.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.In addition, in the absence of conflict, in following embodiment and embodiment
Feature can be combined with each other.
Terminology used in the present invention is not intended to limit the present invention merely for the sake of for the purpose of describing particular embodiments.The present invention
It is also intended to the "an" of singular used in claims, " described " and "the" including most forms, unless up and down
Text clearly shows that other meanings.It should be appreciated that term "and/or" used herein refers to comprising one or more associated
Any or all possible combination for listing project.
Although may describe various information using term first, second, third, etc. in the present invention, these information are not answered
It is limited to these terms.These terms are used to for same type of information being distinguished from each other out.For example, not departing from the scope of the invention
In the case of, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information.Depend on
In context, in addition, used word " if " can be construed to " ... when ", alternatively, " when ... ", alternatively,
" in response to determination ".
The embodiment of the present invention proposes that a kind of data processing method, this method can be applied to dma controller.It, can in CNN
It to realize data-moving by dma controller, does not need to realize data-moving by CPU, to mitigate CPU burden, more efficiently remove
Data are moved, and then play the effect for accelerating CNN operation.
Dma controller is a kind of peripheral hardware in internal system moving data, allows to hand between the hardware device of friction speed
Data are changed, the operation of this data-moving is not rely on CPU, and dma controller can interrupt instruction by DMA and need by CPU
The data of reason are in place.In addition, CPU only needs to establish DMA transfer, responding DMA interrupts, and handles dma controller and move
The data of internal storage.
For single DMA transfer process, it is possible to specify 1 source address, 1 destination address and stride length, this stride
Length is stride information, and after each write operation, the sum of current address and stride length are next time to be treatedlyly
Location, this transmission with " normal " stride length are known as 1D transmission.
Referring to shown in Figure 1A, dma controller writes the data into first mesh after first source address A1 reading data
Address B1.Then, source address A1 is added into stride length 1, obtains second source address A2, destination address B1 is added into stride
Length 1, obtains second destination address B2, and dma controller writes the data into destination address after source address A2 reading data
B2, and so on.
Referring to shown in Figure 1B, dma controller writes the data into first mesh after first source address A1 reading data
Address B1.Then, source address A1 is added into stride length 2, obtains second source address A2, destination address B1 is added into stride
Length 2, obtains second destination address B2, and dma controller writes the data into destination address after source address A2 reading data
B2, and so on.
Compared with Figure 1A, in fig. ib, the stride length 1 of " normal " can be revised as to the stride length 2 of " improper ",
So that 1D transmission can skip certain addresses, increase the flexibility of 1D transmission.
2D transmission is the extension of 1D transmission, is widely used in field of image processing.In 2D transmission process, it can relate to
And following variable: X-direction counts configuration (X_COUNT), X-direction stride configuration (X_STRIDE), Y-direction counting configuration (Y_
COUNT), Y-direction stride configuration (Y_STRIDE).
2D transmission is a nested circulation, and interior loop parameter counts configuration by X-direction and the configuration of X-direction stride determines, outside
Loop parameter counts configuration by Y-direction and the configuration of Y-direction stride determines, 1D transmits the interior circulation of corresponding 2D transmission.X-direction stride
When configuration determines that each x is incremented by, the increased stride length in address;When the configuration of Y-direction stride determines that each y is incremented by, address increases
Stride length;X-direction counts configuration and determines x number of increments;The configuration of Y-direction stride determines y number of increments.Moreover, Y-direction walks
Width configuration can be negative, to allow dma controller address backrush in buffer (buffer area).
Referring to shown in Fig. 1 C- Fig. 1 F, the application scenarios for 1D-to-1D, 1D-to-2D, 2D-to-1D, 2D-to-2D are illustrated
Figure, it is clear that the transmission process of above-mentioned 2D can enrich the application scenarios of DMA.
3D transmission is further expanding for 1D transmission, and can be related to following variable: X-direction counts configuration (X_COUNT), X
Direction stride configures (X_STRIDE), Y-direction counts configuration (Y_COUNT), Y-direction stride configures (Y_STRIDE), Z-direction meter
Number configuration (Z_COUNT), Z-direction stride configuration (Z_STRIDE).Wherein, 3D transmission is triple nested circulations, interior loop ginseng
Number counts configuration by X-direction, the configuration of X-direction stride determines, middle layer loop parameter counts configuration by Y-direction, Y-direction stride is matched
Decision is set, outer loop parameter counts configuration by Z-direction, the configuration of Z-direction stride determines.
Wherein, when the configuration of X-direction stride determines that each x is incremented by, the increased stride length in address;The configuration of Y-direction stride is determined
When fixed each y is incremented by, the increased stride length in address;When the configuration of Z-direction stride determines that each z is incremented by, the increased stride in address
Length;X-direction counts configuration and determines x number of increments;The configuration of Y-direction stride determines y number of increments;Z-direction counts configuration and determines z
Number of increments.Moreover, the configuration of Y-direction stride can be negative, the configuration of Z-direction stride can be negative, to allow in buffer
Middle address backrush.
It is extracted below in conjunction with the matrix of a 2D-to-2D, and the example being rotated by 90 °, the above process is illustrated.Ginseng
As shown in Fig. 1 G, it is assumed that source matrix presses row sequential storage, and initial address A, purpose matrix by rows sequential storage, initial address is
A', then: in data read process, source address A+7, X-direction counting is configured to 4, and X-direction stride is configured to 1, and Y-direction counts
4 are configured to, Y-direction stride is configured to 3, and Z-direction counting is configured to 0, and Z-direction stride is configured to 0.In data writing process, mesh
Address be A'+3, X-direction counting is configured to 4, and X-direction stride is configured to 4, and Y-direction counting is configured to 4, the configuration of Y-direction stride
It is -13, Z-direction counting is configured to 0, and Z-direction stride is configured to 0.
Referring to shown in Fig. 1 G, dma controller can read data from source address 0x1 (i.e. initial address A+7), and will read
Data be written destination address 0x1 (i.e. initial address A'+3).Number is read from source address 0x2 (i.e. the direction 0x1+X stride configuration 1)
According to, and destination address 0x2 (i.e. the direction 0x1+X stride configuration 4) is written into the data of reading.Data are read from source address 0x3, and
Destination address 0x3 is written into the data of reading.Data are read from source address 0x4, and destination address is written into the data of reading
0x4。
By above-mentioned processing, in data read process, is read 4 times in X-direction, that is, reaches X-direction and count configuration 4,
Therefore, a Y is executed, since Y-direction stride is configured to 3, source address 0x4 is added 3, obtains source address 0x5.It is write in data
Enter process, read 4 times in X-direction, that is, reaches X-direction and count configuration 4, therefore, a Y is executed, since Y-direction stride is matched
- 13 are set to, therefore destination address 0x4 is subtracted 13, obtains destination address 0x5.In conclusion data are read from source address 0x5,
And destination address 0x5 is written into the data of reading;Then, data are read from source address 0x6, and purpose is written into the data of reading
Address 0x6.Data are read from source address 0x7, and destination address 0x7 is written into the data of reading.Number is read from source address 0x8
According to, and destination address 0x8 is written into the data of reading.
It is read 4 times in data read process in X-direction by above-mentioned processing, that is, reaches X-direction and count configuration 4, therefore
A Y is executed, in data writing process, is read 4 times in X-direction, that is, reaches X-direction and counts configuration 4, therefore execute primary
Y, and so on, effect is referring to shown in Fig. 1 G.
It in summary it can be seen, as long as providing X-direction counts configuration (X_COUNT), the configuration of X-direction stride (X_STRIDE), Y
Direction counts configuration (Y_COUNT), Y-direction stride configuration (Y_STRIDE), Z-direction counting configuration (Z_COUNT), Z-direction step
Width configures (Z_STRIDE), and dma controller can complete data processing using above-mentioned parameter, i.e. dma controller utilizes data
The parameter of reading process reads data from source address, and using the parameter of data writing process, writes data into destination address.
In convolutional neural networks, data-moving task can be realized using dma controller, and is no longer realized using CPU
Data-moving task.It is the example of the flow chart of above-mentioned data processing method in convolutional neural networks referring to fig. 2 shown in A, it should
Method can be applied to dma controller, and this method may include:
Step 201, the first DMA is generated according to the characteristic information of input feature vector figure and reads configuration information and the configuration of the first DMA write
Information, and determine that the 2nd DMA reads configuration information and the second DMA write configuration information.
Step 202, configuration information is read according to the first DMA, reads data from the input feature vector figure;And according to this first
DMA write configuration information exports the data of reading to arithmetic logic.
Step 203, the operation result that configuration information reads arithmetic logic is read according to the 2nd DMA;And according to the 2nd DMA
Configuration information is write, by the operation result storage of reading to output characteristic pattern.
In the above-described embodiments, input feature vector figure is initial characteristics figure, and dma controller can be read from input feature vector figure
Data, that is, input feature vector figure is as source data.In addition, output characteristic pattern is target signature, dma controller can be by data
It is written to output characteristic pattern.In conclusion dma controller reads data from input feature vector figure, and data are exported to operation
Logic.Then, dma controller can read the operation result of arithmetic logic, and the storage of the operation result of reading is special to output
Sign figure.
Wherein, it is the DMA configuration information for reading data from input feature vector figure that the first DMA, which reads configuration information, therefore,
Configuration information being read according to the first DMA, data are read from input feature vector figure, this reading process, that is, from source address
The process of data is read in (i.e. input feature vector figure).
Wherein, the first DMA write configuration information be for exporting data to the DMA configuration information of arithmetic logic, therefore, can
Data to be exported to arithmetic logic according to the first DMA write configuration information, this writing process, that is, by the data of source address
The process of destination address is written, so that data are moved from input feature vector figure to arithmetic logic, it is special to input by arithmetic logic
The data levied in figure carry out operation.
Wherein, it is that the DMA configuration information for reading data from arithmetic logic therefore can be with that the 2nd DMA, which reads configuration information,
The operation result that configuration information reads arithmetic logic is read according to the 2nd DMA.
Wherein, the second DMA write configuration information is that (i.e. the output of initial construction is special for storing data into output characteristic pattern
Sign figure, in original state, is not written the data of arithmetic logic, in subsequent embodiment, the construction of introduction output characteristic pattern
Journey) DMA configuration information therefore output characteristic pattern can be write data into according to the second DMA write configuration information, this is write
Enter process, that is, by the process of the data write-in destination address of source address, so as to move data from arithmetic logic
To output characteristic pattern.
Wherein, the first DMA reads configuration information, the first DMA write configuration information, the 2nd DMA and reads configuration information, the second DMA write
Configuration information may include that X-direction counts configuration (X_COUNT), X-direction stride configuration (X_STRIDE), Y-direction counting configuration
(Y_COUNT), Y-direction stride configuration (Y_STRIDE), Z-direction count configuration (Z_COUNT), Z-direction stride configuration (Z_
STRIDE)。
Based on the above-mentioned technical proposal, in the embodiment of the present invention, the data-moving in CNN can be realized by dma controller, no
It needs to realize the data-moving in CNN by CPU, to mitigate CPU burden, more efficiently moving data, and then plays and accelerate CNN
The effect of operation, while also failure is not active.
Below in conjunction with concrete application scene, above-mentioned technical proposal is described in detail.It is to be directed under this application scene
The implementation of Pooling (pond layer).Specifically, the effect of Pooling may include: the constant of holding input feature vector figure
Property, this invariance includes translation, rotation and scale;Retain main feature and reduce parameter and calculation amount, prevents over-fitting, mention
High model generalization ability.The most common pondization operation is average pondization and maximum pond, and average pond is for calculating image-region
Average value, and using the average value as the value after pool area, maximum pond, and will for choosing the maximum value of image-region
The maximum value is as the value after pool area.The region of pondization operation can be divided into 2x2,3x3, roi, global etc..Such as Fig. 2 B-
It is convolution kernel size is 3x3 shown in 2G, the pooling schematic diagram that stride (stride) is 2.
If completing the carrying of this sliding window and the output of Pooling result by CPU, CPU will increase dramatically
Burden.Based on this, the carrying of sliding window and the output of Pooling result can be completed by dma controller, to mitigate
The burden of CPU is described in detail below in conjunction with Fig. 2 H.
Step 211, the characteristic information of input feature vector figure is obtained.Wherein, this feature information can include but is not limited to: input
Width W, the height H of characteristic pattern, and the port number N including input feature vector figure.
Wherein, the width of input feature vector figure (i.e. Input Feature Maps) is W, is highly H, port number N is being deposited
Coutinuous store in reservoir, initial address A.Therefore, the characteristic information of input feature vector figure may include including but is not limited to: input
Width W, height H, the port number N of characteristic pattern.
Step 212, the first DMA is generated according to the characteristic information of input feature vector figure and reads configuration information and the configuration of the first DMA write
Information, and determine that the 2nd DMA reads configuration information and the second DMA write configuration information.
Situation one generates the first DMA reading configuration information according to the characteristic information of input feature vector figure, comprising: dma controller can
Configuration is counted to generate X-direction according to the width W of the input feature vector figure;Y-direction meter is generated according to the height H of the input feature vector figure
Number configuration;The configuration of X-direction stride and the configuration of Y-direction stride are generated according to default value (such as 1).In addition, dma controller can be with
Z-direction is generated according to the port number N of the input feature vector figure and counts configuration, and the configuration of Z-direction stride is generated according to default value.
For example, the example that the first DMA reads configuration information may include: that X-direction counts configuration: W;Y-direction counts configuration: H;
X-direction stride configuration: 1;Y-direction stride configuration: 1.In addition, it can also include: Z-direction meter that the first DMA, which reads configuration information,
Number configuration: N;Z-direction stride configuration: 1.
Certainly, it is an example that above-mentioned first DMA, which reads configuration information, reads configuration information with no restrictions to this first DMA,
It can rule of thumb be configured, by taking above-mentioned first DMA reads configuration information as an example.
Situation two generates the first DMA write configuration information according to the characteristic information of input feature vector figure, comprising: dma controller can
Configuration is counted to generate X-direction according to the width W and height H of input feature vector figure;Y-direction counting is generated according to default value to match
It sets, the configuration of X-direction stride and Y-direction stride configure.Alternatively, dma controller can width W, height H according to input feature vector figure
With port number N, generates X-direction and count configuration;And dma controller can generate Y-direction according to default value and count configuration, X
The configuration of direction stride, the configuration of Y-direction stride, Z-direction count configuration, the configuration of Z-direction stride.
For example, the first DMA write configuration information includes: that X-direction counts configuration: W*H;Y-direction, which counts, to be configured: 0;X-direction step
Width configuration: 0;Y-direction stride configuration: 0.Alternatively, the first DMA write configuration information may include: that X-direction counts configuration: W*H*N;Y
Direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;The configuration of Z-direction stride:
0。
Certainly, above-mentioned first DMA write configuration information is example, with no restrictions to this first DMA write configuration information, can be with
It is rule of thumb configured, by taking above-mentioned first DMA write configuration information as an example.
It may include: X-direction counting configuration that situation three, the 2nd DMA, which read configuration information: 1;Y-direction, which counts, to be configured: 0;The side X
It is configured to stride: 0;Y-direction stride configuration: 0.Alternatively, it may include: that X-direction counts configuration: N that the 2nd DMA, which reads configuration information,;Y
Direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;The configuration of Z-direction stride:
0。
Certainly, it is example that above-mentioned 2nd DMA, which reads configuration information, reads configuration information with no restrictions to this 2nd DMA, can be with
It is rule of thumb configured, by taking above-mentioned 2nd DMA reads configuration information as an example.
Situation four, the second DMA write configuration information may include: X-direction counting configuration: 1;Y-direction, which counts, to be configured: 1;The side X
It is configured to stride: 0;Y-direction stride configuration: 0.Alternatively, the second DMA write configuration information may include: that X-direction counts configuration: N;Y
Direction, which counts, to be configured: 1;X-direction stride configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;The configuration of Z-direction stride:
0。
Step 213, configuration information is read according to the first DMA, reads data from the input feature vector figure.
Specifically, dma controller can read configuration information according to the first DMA, from the corresponding starting of input feature vector figure
Address (such as initial address A) starts, and reads each data in the input feature vector figure.
Step 214, according to the first DMA write configuration information, the data of reading are exported to arithmetic logic.
Specifically, dma controller can be according to the first DMA write configuration information, from the corresponding entry address of arithmetic logic
(such as entry address I) starts, and each data of reading are exported to arithmetic logic.
Step 215, the operation result that configuration information reads the arithmetic logic is read according to the 2nd DMA.
Specifically, can produce operation result, for example, operation is patrolled after data of the arithmetic logic to input carry out operation
Collecting, which can be used for, carries out average value operation or maximum operation to continuous W*H data, wherein W and H is respectively input feature vector
The width and height of figure.Therefore, operation result is the corresponding average value of continuous W*H data or maximum value.Further,
Dma controller can read configuration information according to the 2nd DMA, from the corresponding exit address of the arithmetic logic (such as exit address O)
Start, reads each operation result of arithmetic logic generation, such as 1 operation result or N number of operation result.
For example, being highly H, then input feature vector figure has W*H data, arithmetic logic pair if the width of input feature vector figure is W
After continuous W*H data carry out average value operation or maximum operation, an available operation result, and according to second
DMA reads configuration information and reads an operation result since the corresponding exit address of arithmetic logic.In another example if input feature vector
The width of figure is W, is highly H, port number N, then input feature vector figure has W*H*N data, and arithmetic logic is to continuous W*H number
After carrying out average value operation or maximum operation, available N number of operation result, and configuration information is read according to the 2nd DMA,
Since the corresponding exit address of arithmetic logic, N number of operation result is read.
Step 216, according to the second DMA write configuration information, by the operation result storage of reading to output characteristic pattern.Specifically
, dma controller can be according to the second DMA write configuration information, since the initial address of the output characteristic pattern, by reading
The output characteristic pattern is arrived in each operation result storage.
For example, with reference to shown in Fig. 2 I, it is assumed that arithmetic logic is Pooling arithmetic logic, and Pooling arithmetic logic is
Global (entirety) type, and Pooling arithmetic logic is used to carry out average value operation to continuous W*H data.Moreover, output
The width of characteristic pattern is 1, is highly 1, port number N, in memory Coutinuous store, initial address B.In addition, Pooling
The entry address of arithmetic logic is I, exit address O.Based on this, dma controller can realize global by two steps
Pooling operation.
Data in input feature vector figure are exported and give Pooling arithmetic logic, transported by Pooling by the first step, dma controller
It calculates logic and completes the operation averaged, for global pooling, corresponding 1 average value of every W*H input data
Output, the N number of average value of final output.Second step, N number of average value that dma controller exports Pooling arithmetic logic, by suitable
Sequence is stored to output characteristic pattern.In this way, operation is moved by two steps, in addition pooling arithmetic logic, can be achieved with global
The function of pooling.
In one example, before the operation result storage to output characteristic pattern that will be read, it can also determine that input is special
Sign schemes corresponding target DMA configuration information, and constructs output characteristic pattern according to target DMA configuration information.The output of this construction
Characteristic pattern is the output characteristic pattern of original state, and there are no the data in write-in input feature vector figure, which can be
Specific characteristic pattern is also possible to the characteristic pattern of full 0 or 1.In step 216, the output of this construction is exactly stored data into
Characteristic pattern.After all data to be stored to the output characteristic pattern to this construction, so that it may obtain final output feature
Figure.
Wherein, the example of the target DMA configuration information can include but is not limited to: X-direction counts configuration: N;Y-direction meter
Number configuration: 1;X-direction stride configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;Z-direction stride configuration: 0;Its
In, N is the port number of input feature vector figure.
Certainly, above-mentioned target DMA configuration information is an example, with no restrictions to this target DMA configuration information, can be with
Rule of thumb configured, it is herein above state target DMA configuration information for.
Wherein, output characteristic pattern is constructed according to target DMA configuration information, comprising: dma controller construction size is 1*1*M
Output characteristic pattern;Wherein, output characteristic pattern is full 0, initial address B.
Wherein, output characteristic pattern is constructed according to target DMA configuration information, comprising: dma controller is read from designated storage location
Specific style information is taken, and according to target DMA configuration information, constructs output characteristic pattern corresponding with the specific style information.Into
One step, according to target DMA configuration information, construct output characteristic pattern corresponding with the specific style information, comprising: DMA control
Device constructs the output characteristic pattern of full 0 according to the target DMA configuration information.It is, of course, also possible to construct complete 1 output characteristic pattern.
In convolutional neural networks, data-moving task can be realized using dma controller, and is no longer realized using CPU
Data-moving task.It, should referring to shown in Fig. 3 A, being the example of the flow chart of above-mentioned data processing method in convolutional neural networks
Method can be applied to dma controller, and this method may include:
Step 301, the first DMA is generated according to the characteristic information of the first input feature vector figure (a such as first input feature vector figure)
Configuration information and the first DMA write configuration information are read, according to the second input feature vector figure (such as at least one the second input feature vector figure)
Characteristic information generates the 2nd DMA and reads configuration information and the second DMA write configuration information, and determines that the 3rd DMA reads configuration information and the
Three DMA write configuration informations.
Step 302, configuration information is read according to the first DMA, reads the first data from the first input feature vector figure;According to this
First DMA write configuration information exports the first data of reading to arithmetic logic.
Step 303, configuration information is read according to the 2nd DMA, reads the second data from the second input feature vector figure;According to this
Second DMA write configuration information exports the second data of reading to arithmetic logic.
Step 304, the operation result that configuration information reads arithmetic logic is read according to the 3rd DMA;According to the third DMA write
Configuration information, by the operation result storage of reading to output characteristic pattern.
In the above-described embodiments, the first input feature vector figure, the second input feature vector figure are initial characteristics figures, and dma controller can
To read data from the first input feature vector figure, the second input feature vector figure, that is, the first input feature vector figure, the second input feature vector figure
As source data.In addition, output characteristic pattern is target signature, dma controller can write data into output characteristic pattern.It is comprehensive
Upper described, dma controller reads data from the first input feature vector figure, the second input feature vector figure, and data are exported to operation
Logic.Dma controller can read the operation result of arithmetic logic, and the operation result of reading is stored to output characteristic pattern.
Wherein, it is the DMA configuration information for reading data from the first input feature vector figure that the first DMA, which reads configuration information,
Therefore, configuration information can be read according to the first DMA and reads data from the first input feature vector figure, and this reading data mistake
Journey, that is, from source address read data process.
Wherein, it is the DMA configuration information for reading data from the second input feature vector figure that the 2nd DMA, which reads configuration information,
Therefore, configuration information can be read according to the 2nd DMA and reads data from the second input feature vector figure, and this reading data mistake
Journey, that is, from source address read data process.
Wherein, the first DMA write configuration information is for exporting data to the DMA configuration information of arithmetic logic, therefore, root
Data are exported to arithmetic logic according to the first DMA write configuration information, this writing process, is exactly that mesh is written into the data of source address
Address process, it is special to the first input by arithmetic logic to moving data from the first input feature vector figure to arithmetic logic
The data levied in figure carry out operation.
Wherein, the second DMA write configuration information is for exporting data to the DMA configuration information of arithmetic logic, therefore, root
Data are exported to arithmetic logic according to the second DMA write configuration information, this writing process, is exactly that mesh is written into the data of source address
Address process, it is special to the second input by arithmetic logic to moving data from the second input feature vector figure to arithmetic logic
The data levied in figure carry out operation.
Wherein, it is that the DMA configuration information for reading data from arithmetic logic therefore can be with that the 3rd DMA, which reads configuration information,
The operation result that configuration information reads arithmetic logic is read according to the 3rd DMA.
Wherein, third DMA write configuration information is that (i.e. the output of initial construction is special for storing data into output characteristic pattern
Sign figure, in original state, is not written the data of arithmetic logic, in subsequent embodiment, the construction of introduction output characteristic pattern
Journey) DMA configuration information therefore output characteristic pattern can be write data into according to third DMA write configuration information, this is write
Enter process, that is, by the process of the data write-in destination address of source address, so as to move data from arithmetic logic
To output characteristic pattern.
In the above-described embodiments, the first DMA read configuration information, the first DMA write configuration information, the 2nd DMA read configuration information,
Second DMA write configuration information, the 3rd DMA read configuration information, third DMA write configuration information may each comprise but be not limited to: X-direction
Count configuration (X_COUNT), X-direction stride configures (X_STRIDE), Y-direction counts configuration (Y_COUNT), Y-direction stride is matched
Set (Y_STRIDE), Z-direction counts configuration (Z_COUNT), Z-direction stride configuration (Z_STRIDE).
Based on the above-mentioned technical proposal, in the embodiment of the present invention, the data-moving in CNN can be realized by dma controller, no
It needs to realize the data-moving in CNN by CPU, to mitigate CPU burden, more efficiently moving data, and then plays and accelerate CNN
The effect of operation, while also failure is not active.
Below in conjunction with concrete application scene, above-mentioned technical proposal is described in detail.Application scenarios 1, for
The implementation of Element-wise (intelligent element), Element-wise are transported one by one to element each in multilayer feature figure
It calculates, including dot product, addition and subtraction, is maximized, for merging the layer information of two same sizes.It as shown in Figure 3B, is to big
Small two characteristic patterns for W*H*N carry out the schematic diagram of element-wise add operation.If CPU is allowed to complete aforesaid operations,
The burden of CPU can additionally be increased.
Application scenarios 2, for the implementation of BN (Batch normalization, standardize), BN solves reversed biography
Gradient disperse and explosion issues in broadcasting, so that the update of weight is more steady.BN is that the output of a certain layer is normalized,
So that its mean value is 0, variance 1.Moreover, BN is carried out in Channel (channel) dimension, it can by each channel into
Row normalization, if there is n channel, just has n normalization operation.Further, before BN acts on Nonlinear Mapping, i.e., pairStandardize, γ is scale (ratio), and β is shift (variation).It as shown in Figure 3 C, is one to size
The schematic diagram of BN operation is carried out for the input feature vector figure of W*H*N.If it is corresponding to complete input feature vector figure to allow CPU
The operation of scale and shift can then greatly increase the burden of CPU.
Element-wise can be completed for application scenarios 1 based on this by dma controller and operated, to mitigate CPU
Burden.For application scenarios 2, BN can be completed by dma controller and operated, thus offloading the CPU.Below in conjunction with Fig. 3 D
Application scenarios 1,2 are described in detail.
Step 311, the characteristic information of the first input feature vector figure, the characteristic information of the second input feature vector figure are obtained.
For application scenarios 1, it is assumed that there are two input feature vector figures, input feature vector Fig. 1 and input feature vector Fig. 2, input are special
The width for levying Fig. 1 is W, is highly H, port number N, in memory Coutinuous store, initial address A, input feature vector Fig. 2's
Width is W, is highly H, port number N, in memory Coutinuous store, initial address B.Input feature vector Fig. 1 can be made
For the first input feature vector figure, using input feature vector Fig. 2 as the second input feature vector figure.Based on this, the feature of the first input feature vector figure
Information can include but is not limited to: width W, the height H of the first input feature vector figure.It can also include the logical of the first input feature vector figure
Road number N.The characteristic information of second input feature vector figure can include but is not limited to: width W, the height H of the second input feature vector figure.Also
It may include the port number N of the second input feature vector figure.
In application scenarios 1, it is highly H, port number N is continuously deposited in memory that the width for exporting characteristic pattern, which is W,
Storage, initial address C.Arithmetic logic can be Element-wise arithmetic logic, Element-wise arithmetic logic be used for into
Row dot product, addition and subtraction such as are maximized at the operations, for example, when Element-wise type is product (product), then
Element-wise arithmetic logic is for carrying out point multiplication operation, that is to say, that first data of the first input feature vector figure with
First data of the second input feature vector figure carry out multiplying, first operation result are obtained, to the first input feature vector figure
Second data and second data of the second input feature vector figure carry out multiplying, second operation result are obtained, with such
It pushes away.Wherein, the entry address of Element-wise arithmetic logic is I1, I2, exit address O.
For application scenarios 2, it is assumed that there are three input feature vector figures, input feature vector Fig. 1, input feature vector Fig. 2 and input are special
Fig. 3 is levied, it is highly H that the width of input feature vector Fig. 1, which is W, port number N, in memory Coutinuous store, initial address A.
Input feature vector Fig. 2 corresponding with input feature vector Fig. 1 is the γ in BN, i.e. scale parameter, and input feature vector Fig. 2, which can be, to be directed to
The Parameter Map of scale parameter, width 1 are highly 1, port number N, in memory Coutinuous store, initial address B.
Scale parameter is a constant, can rule of thumb be configured, that is to say, that input feature vector Fig. 2 includes N number of scale parameter
Parameter Map.Input feature vector Fig. 3 corresponding with input feature vector Fig. 1 is the β in BN, i.e. shift parameter, input feature vector Fig. 3 can be
For the Parameter Map of shift parameter, width 1 is highly 1, and port number N, Coutinuous store, initial address are in memory
C.Shift parameter is a constant, can rule of thumb be configured, that is to say, that input feature vector Fig. 3 be include N number of shift parameter
Parameter Map.
In conclusion can be using input feature vector Fig. 1 as the first input feature vector figure, by input feature vector Fig. 2 and input feature vector
Fig. 3 is as the second input feature vector figure.Based on this, the characteristic information of the first input feature vector figure can include but is not limited to: first is defeated
Enter width W, the height H of characteristic pattern.It can also include the port number N of the first input feature vector figure.The feature of second input feature vector figure
Information can include but is not limited to: the width 1 of the second input feature vector figure, height 1.It can also include the logical of the second input feature vector figure
Road number N.
In application scenarios 2, it is highly H, port number N is continuously deposited in memory that the width for exporting characteristic pattern, which is W,
Storage, initial address D.Arithmetic logic can be BN arithmetic logic, and BN arithmetic logic is for completing linear transformation.For example, to
Each data of one input feature vector figure carry out linear transformation to the data using following formula:X is that input is special
The data of Fig. 1 are levied, γ is the scale parameter that input feature vector Fig. 2 (i.e. Parameter Map) is provided, and β is input feature vector Fig. 3 (i.e. Parameter Map)
The shift parameter provided, moreover, the continuous W*H data in input feature vector Fig. 1, the same γ of corresponding input feature vector Fig. 2,
And the same β of corresponding input feature vector Fig. 3, i.e. γ and β and W*H data operation.Wherein, Element-wise is transported
The entry address for calculating logic is I1 (corresponding input feature vector Fig. 1), I2 (corresponding input feature vector Fig. 2), I3 (correspond to input feature vector figure
3), exit address O.
Step 312, the first DMA is generated according to the characteristic information of the first input feature vector figure (i.e. input feature vector Fig. 1) and reads configuration
Information and the first DMA write configuration information, according to the second input feature vector figure (i.e. input feature vector Fig. 2 or input feature vector Fig. 3 etc.)
Characteristic information generates the 2nd DMA and reads configuration information and the second DMA write configuration information, and determines that the 3rd DMA reads configuration information and the
Three DMA write configuration informations.
Situation one generates the first DMA reading configuration information according to the characteristic information of the first input feature vector figure, comprising: Ke Yigen
X-direction is generated according to the width W of the first input feature vector figure and counts configuration, and Y-direction is generated according to the height H of the first input feature vector figure
Configuration is counted, and the configuration of X-direction stride and Y-direction stride are generated according to default value (such as 1) and configured.Further, it is also possible to according to
The port number N of first input feature vector figure generates Z-direction and counts configuration, and generates Z-direction stride according to default value (such as 1) and match
It sets.
For example, the example that the first DMA reads configuration information may include: that X-direction counts configuration: W;Y-direction counts configuration: H;
X-direction stride configuration: 1;Y-direction stride configuration: 1.In addition, it can also include: that Z-direction counting is matched that the first DMA, which reads configuration information,
It sets: N;Z-direction stride configuration: 1.
Certainly, it is an example that above-mentioned first DMA, which reads configuration information, reads configuration information with no restrictions to this first DMA,
It can rule of thumb be configured, by taking above-mentioned first DMA reads configuration information as an example.
Situation two generates the first DMA write configuration information according to the characteristic information of the first input feature vector figure, comprising: DMA control
Device can generate X-direction according to the width W and height H of the first input feature vector figure and count configuration;And it is generated according to default value
Y-direction counts configuration, the configuration of X-direction stride and the configuration of Y-direction stride.Alternatively, dma controller can be according to the first input feature vector
Width W, height H and the port number N of figure generate X-direction and count configuration;And Y-direction counting is generated according to default value and is matched
It sets, the configuration of X-direction stride, the configuration of Y-direction stride, Z-direction counts configuration, Z-direction stride configures.
For example, the first DMA write configuration information may include: that X-direction counts configuration: W*H;Y-direction, which counts, to be configured: 0;The side X
It is configured to stride: 0;Y-direction stride configuration: 0.Alternatively, the first DMA write configuration information includes: that X-direction counts configuration: W*H*N;Y
Direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;The configuration of Z-direction stride:
0。
Certainly, above-mentioned first DMA write configuration information is example, with no restrictions to this first DMA write configuration information, can be with
It is rule of thumb configured, by taking above-mentioned first DMA write configuration information as an example.
Wherein, it for application scenarios 1 and application scenarios 2, can be handled using situation one and situation two.
Situation three generates the 2nd DMA reading configuration information according to the characteristic information of the second input feature vector figure, comprising: DMA control
Device can generate X-direction according to the width W of the second input feature vector figure and count configuration;It is raw according to the height H of the second input feature vector figure
It counts and configures at Y-direction;The configuration of X-direction stride and the configuration of Y-direction stride are generated according to default value.In addition, dma controller is also
Z-direction can be generated according to the port number N of the second input feature vector figure count configuration;Z-direction stride is generated according to default value to match
It sets.
For example, the example that the 2nd DMA reads configuration information may include: that X-direction counts configuration: W;Y-direction counts configuration: H;
X-direction stride configuration: 1;Y-direction stride configuration: 1.In addition, it can also include: that Z-direction counting is matched that the 2nd DMA, which reads configuration information,
It sets: N;Z-direction stride configuration: 1.
Certainly, it is an example that above-mentioned 2nd DMA, which reads configuration information, reads configuration information with no restrictions to this 2nd DMA,
It can rule of thumb be configured, by taking above-mentioned 2nd DMA reads configuration information as an example.
Situation four generates the second DMA write configuration information according to the characteristic information of the second input feature vector figure, comprising: DMA control
Device can generate X-direction according to the width W and height H of the second input feature vector figure and count configuration;Y-direction is generated according to default value
Count configuration, the configuration of X-direction stride and the configuration of Y-direction stride.Alternatively, dma controller can be according to the second input feature vector figure
Width W, height H and port number N generate X-direction and count configuration;And Y-direction is generated according to default value and counts configuration, the side X
Configuration, the configuration of Z-direction stride are counted to stride configuration, the configuration of Y-direction stride, Z-direction.
For example, the second DMA write configuration information may include: that X-direction counts configuration: W*H;Y-direction, which counts, to be configured: 0;The side X
It is configured to stride: 0;Y-direction stride configuration: 0.Alternatively, the second DMA write configuration information includes: that X-direction counts configuration: W*H*N;Y
Direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;The configuration of Z-direction stride:
0。
Certainly, above-mentioned second DMA write configuration information is example, with no restrictions to this second DMA write configuration information, can be with
It is rule of thumb configured, by taking above-mentioned second DMA write configuration information as an example.
Wherein, during determining that the 2nd DMA reads configuration information and the second DMA write configuration information, for application scenarios
1, it can be handled using situation three and situation four, and application scenarios 2 are directed to, do not use situation three and situation four to handle, but can
To handle using situation five, situation five is described below.
Situation five is matched according to the characteristic information of the second input feature vector figure generation the 2nd DMA reading configuration information, the second DMA write
Confidence breath, comprising: if the second input feature vector figure be at least one Parameter Map (input feature vector Fig. 2 in such as above-mentioned application scenarios 2 with
Input feature vector Fig. 3), for each Parameter Map, then: the 2nd DMA, which reads configuration information, can include but is not limited to: X-direction counting is matched
It sets: 1;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 1;Y-direction stride configuration: 0.Moreover, the second DMA write configuration information can
To include but is not limited to: X-direction, which counts, to be configured: 1;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 0;The configuration of Y-direction stride:
0.Can include but is not limited to alternatively, the 2nd DMA reads configuration information: X-direction counts configuration: N;Y-direction, which counts, to be configured: 0;The side X
It is configured to stride: 1;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;Z-direction stride configuration: 0.Moreover, the second DMA write is matched
Confidence breath can include but is not limited to: X-direction counts configuration: N;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction
Stride configuration: 0;Z-direction, which counts, to be configured: 0;Z-direction stride configuration: 0.
Certainly, it is example that above-mentioned 2nd DMA, which reads configuration information, reads configuration information with no restrictions to this 2nd DMA, can be with
It is rule of thumb configured, by taking above-mentioned 2nd DMA reads configuration information as an example.
It, with no restrictions to this second DMA write configuration information, can be in addition, above-mentioned second DMA write configuration information is example
It is rule of thumb configured, by taking above-mentioned second DMA write configuration information as an example.
Situation six determines that the 3rd DMA reads configuration information and third DMA write configuration information, comprising: can be according to the first input
The width W and height H of characteristic pattern generate the X-direction that the 3rd DMA is read in configuration information and count configuration;It is generated according to default value
3rd DMA reads the Y-direction in configuration information and counts configuration, the configuration of X-direction stride and the configuration of Y-direction stride.It further, can be with
The X-direction in third DMA write configuration information, which is generated, according to the width W of the first input feature vector figure counts configuration;According to the first input
The height H of characteristic pattern generates the Y-direction in third DMA write configuration information and counts configuration;Third DMA write is generated according to default value
The configuration of X-direction stride and the configuration of Y-direction stride in configuration information.
Can include but is not limited to for example, the 3rd DMA reads configuration information: X-direction counts configuration: W*H;Y-direction meter
Number configuration: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;In addition, the third DMA write configuration information may include but
Be not limited to: X-direction counts configuration: W;Y-direction counts configuration: H;X-direction stride configuration: 1;Y-direction stride configuration: 1.
Certainly, it is an example that above-mentioned 3rd DMA, which reads configuration information, reads configuration information with no restrictions to this 3rd DMA,
It can rule of thumb be configured, by taking above-mentioned 3rd DMA reads configuration information as an example.In addition, above-mentioned third DMA write configuration information is only
It is an example, with no restrictions to this third DMA write configuration information, can be rule of thumb configured, with above-mentioned third DMA write
For configuration information.
Situation seven determines that the 3rd DMA reads configuration information and third DMA write configuration information, comprising: can be according to the first input
Width W, height H and the port number N of characteristic pattern generate the X-direction that the 3rd DMA is read in configuration information and count configuration;According to default
The 3rd DMA of numerical generation reads the Y-direction in configuration information and counts configuration, the configuration of X-direction stride, the configuration of Y-direction stride, Z-direction
Count configuration, the configuration of Z-direction stride.Further, third DMA write can also be generated according to the width W of the first input feature vector figure
X-direction in configuration information counts configuration;The Y in third DMA write configuration information is generated according to the height H of the first input feature vector figure
Direction counts configuration;The Z-direction counting in third DMA write configuration information is generated according to the port number N of the first input feature vector figure to match
It sets;The configuration of X-direction stride, the configuration of Y-direction stride and the Z-direction step in third DMA write configuration information are generated according to default value
Width configuration.
Can include but is not limited to for example, the 3rd DMA reads configuration information: X-direction counts configuration: W*H*N;Y-direction counts
Configuration: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;Z-direction stride configuration: 0.In addition,
Third DMA write configuration information can include but is not limited to: X-direction counts configuration: W;Y-direction counts configuration: H;X-direction stride is matched
It sets: 1;Y-direction stride configuration: 1;Z-direction counts configuration: N;Z-direction stride configuration: 1.
Certainly, it is an example that above-mentioned 3rd DMA, which reads configuration information, reads configuration information with no restrictions to this 3rd DMA,
It can rule of thumb be configured, by taking above-mentioned 3rd DMA reads configuration information as an example.In addition, above-mentioned third DMA write configuration information is only
It is an example, with no restrictions to this third DMA write configuration information, can be rule of thumb configured, with above-mentioned third DMA write
For configuration information.
Wherein, it for application scenarios 1 and application scenarios 2, can be handled using situation six or situation seven.
Step 313, configuration information is read according to the first DMA, reads the first data from the first input feature vector figure;According to this
First DMA write configuration information exports the first data of reading to arithmetic logic.
In one example, dma controller can read configuration information according to the first DMA, from the first input feature vector figure
Corresponding initial address starts, and reads the first data of each of the first input feature vector figure.Further, dma controller may be used also
With according to the first DMA write configuration information, since the corresponding first entrance address of above-mentioned arithmetic logic, by each of reading
One data, which export, gives the arithmetic logic.
Step 314, configuration information is read according to the 2nd DMA, reads the second data from the second input feature vector figure;According to this
Second DMA write configuration information exports the second data of reading to arithmetic logic.
In one example, dma controller can read configuration information according to the 2nd DMA, from the second input feature vector figure
Corresponding initial address starts, and reads the second data of each of the second input feature vector figure.Further, dma controller may be used also
With according to the second DMA write configuration information, since the corresponding second entrance address of above-mentioned arithmetic logic, by each of reading
Two data, which export, gives the arithmetic logic.
Step 315, the operation result that configuration information reads arithmetic logic is read according to the 3rd DMA;According to the third DMA write
Configuration information, by the operation result storage of reading to output characteristic pattern.
In one example, dma controller can read configuration information according to the 3rd DMA, corresponding from above-mentioned arithmetic logic
Exit address start, read the arithmetic logic generation each operation result.Further, dma controller can also basis
The third DMA write configuration information, since the initial address of the output characteristic pattern, by each operation result storage of reading to institute
State output characteristic pattern.
For application scenarios 1, arithmetic logic is used to carry out Element-wise operation to the first data and the second data.Ginseng
As shown in Fig. 3 E, dma controller can realize that Element-wise is operated by three steps.
The first step, dma controller export the data in input feature vector Fig. 1 to the entrance of Element-wise arithmetic logic
Address I1.Second step, dma controller export the data in input feature vector Fig. 2 to the entrance of Element-wise arithmetic logic
Address I2.Then, Element-wise arithmetic logic carries out Element- to the data of entry address I1 and entry address I2
Wise operation.Third step, the operation result that dma controller generates Element-wise arithmetic logic, storage is arrived defeated in order
Characteristic pattern out.In conclusion operation is moved by three steps, in addition Element-wise arithmetic logic, just realizes element-
Wise function.
For application scenarios 2, arithmetic logic is used to carry out BN operation to the first data and the second data.Referring to Fig. 3 F institute
Show, dma controller can realize that BN is operated by three steps.The first step, dma controller can be by the numbers in input feature vector Fig. 1
According to output to the entry address I1 of BN arithmetic logic.Second step, dma controller export γ to the entry address of BN arithmetic logic
I2, BN arithmetic logic carry out the multiplication in linear transformation using data of the γ to entry address I1 and operate.Third step, DMA control
Device exports β to the entry address I3 of BN arithmetic logic, BN arithmetic logic using β to above-mentioned multiplication operate as a result, progress line
Property transformation in add operation.4th step, the operation result that dma controller generates BN arithmetic logic, storage is arrived defeated in order
Characteristic pattern out.In conclusion operation is moved by four steps, in addition BN arithmetic logic, so that it may realize Batch
The function of Normalization.
In one example, before the operation result storage to output characteristic pattern that will be read, it can also determine that first is defeated
Enter the corresponding target DMA configuration information of characteristic pattern, and corresponding according to the target DMA configuration information the first input feature vector figure of construction
Export characteristic pattern.The output characteristic pattern of this construction is the output characteristic pattern of original state, and there are no in write-in input feature vector figure
Data, can be specific characteristic pattern, be also possible to the characteristic pattern of full 0 or 1.It is to store data into this in step 315
The output characteristic pattern of construction.After all data to be stored to the output characteristic pattern to construction, available final output characteristic pattern.
Wherein it is determined that the corresponding target DMA configuration information of the first input feature vector figure, comprising: according to the first input feature vector figure
Width W generate X-direction count configuration;Y-direction, which is generated, according to the height H of the first input feature vector figure counts configuration;According to first
The port number N of input feature vector figure generates Z-direction and counts configuration;The configuration of X-direction stride, Y-direction stride are generated according to default value
Configuration and the configuration of Z-direction stride.
Wherein, which can include but is not limited to: X-direction counts configuration: W;Y-direction counts configuration:
H;X-direction stride configuration: 1;Y-direction stride configuration: 1;Z-direction counts configuration: N;Z-direction stride configuration: 1.Certainly, above-mentioned mesh
Marking DMA configuration information is example, without limitation, can rule of thumb be configured, herein above to state target DMA configuration
For information.
Wherein, the corresponding output characteristic pattern of the first input feature vector figure is constructed according to the target DMA configuration information, comprising: structure
Make the output characteristic pattern having a size of W*H*M;Wherein, output characteristic pattern is full 0.
Wherein, the corresponding output characteristic pattern of the first input feature vector figure is constructed according to the target DMA configuration information, comprising: DMA
Controller reads specific style information from designated storage location, and according to target DMA configuration information, construction and specific style information
Corresponding output characteristic pattern.Further, according to target DMA configuration information, output corresponding with the specific style information is constructed
Characteristic pattern, comprising: according to the target DMA configuration information, construct the output characteristic pattern of full 0.It is, of course, also possible to construct complete 1 it is defeated
Characteristic pattern out.
In practical applications, many image algorithms all refer to the operation of fixed matrix, for example, in gaussian filtering
Laplacian matrix and Sobel matrix, fast Fourier variation or Hough transformation in Gaussian matrix, edge detection
In trigonometric function matrix, accelerate Toeplitz matrix, random matrix, full 0/1 matrix etc. in matrix multiplication.If above-mentioned square
Battle array is generated by CPU, then will increase the burden of CPU.Based on this, above-mentioned matrix can be generated, by dma controller so as to mitigate
The burden of CPU.
In the above-described embodiments, dma controller constructs the process of output characteristic pattern according to target DMA configuration information, practical
Upper is exactly the process of dma controller structural matrix, rather than by CPU structural matrix.
According to actual needs, if output characteristic pattern is Gaussian matrix, dma controller construction is exactly Gaussian
Matrix;If output characteristic pattern is trigonometric function matrix, dma controller construction is exactly trigonometric function matrix;If exporting feature
Figure is full 0 matrix, then dma controller construction is exactly full 0 matrix;If exporting characteristic pattern is all 1's matrix, dma controller structure
What is made is exactly all 1's matrix;And so on, it is without limitation, in the present embodiment by taking dma controller constructs full 0 matrix as an example.
In order to realize the above process, specific style information, the specific style information table can be stored in designated storage location
Show matrix-type.For example, representing matrix type is that full 0 matrix (is used for various types when specific style information is first identifier
Filling or interleave);When specific style information is second identifier, representing matrix type is that all 1's matrix (is used for various types
Filling);When specific style information is that third identifies, representing matrix type is that Gaussian matrix is (high for two-dimensional/three-dimensional
This filtering);When specific style information is the 4th mark, representing matrix type is Laplacian matrix (being used for edge detection);
When specific style information is the 5th mark, representing matrix type is Sobel matrix (being used for edge detection);When special style is believed
When breath identifies for the 6th, representing matrix type is trigonometric function matrix (for Fast Fourier Transform (FFT) or Hough transformation);When
When specific style information is the 7th mark, representing matrix type is Toeplitz matrix (accelerating for matrix multiplication);When specific
When style information is the 8th mark, representing matrix type is random matrix (for training the initialization of weight);To this matrix class
Type is with no restrictions.
In conclusion dma controller can read specific style information from designated storage location, and construct and the specific sample
The corresponding output characteristic pattern of formula information.For example, the output that can then construct full 0 is special when specific style information is first identifier
Sign figure.And so on, other specific style informations are repeated no more.
It in one example, can be by some special address (such as 0xFFFF_FFFF, 0x8765_4321,0x5A5A_
5A5A etc.) it is used as designated storage location, or certain domains of CFG (Control Flow Graph, controlling stream graph) register are made
For designated storage location, specific style information is stored in designated storage location, thus specified matrix type.In this way, dma controller
Specific style information can be read from designated storage location, then know matrix-type, and construct corresponding with the matrix-type
Export characteristic pattern.
In one example, in structural matrix, the data in matrix are generated (such as dma controller by dma controller itself
Generate the data of full 0), it does not need to read data from other positions, therefore, there is no need to that DMA configuration information is arranged for reading process,
It only needs that DMA configuration information is arranged for writing process.
In one example, seven registers can be set for writing process, this seven registers store starting point respectively
Location (DST_STRT_ADDR), X-direction count configuration (X_COUNT), X-direction stride configures (X_STRIDE), Y-direction counting is matched
Set (Y_COUNT), Y-direction stride configuration (Y_STRIDE), Z-direction counting configuration (Z_COUNT), Z-direction stride configuration (Z_
STRIDE)。
Based on inventive concept same as the above method, a kind of dma controller is also provided in the embodiment of the present invention, it is described
Dma controller is used for: being generated the first DMA according to the characteristic information of input feature vector figure and is read configuration information and the first DMA write with confidence
Breath, and determine that the 2nd DMA reads configuration information and the second DMA write configuration information;Configuration information is read according to the first DMA, from institute
It states in input feature vector figure and reads data;According to the first DMA write configuration information, the data of reading are exported to arithmetic logic;
The operation result that configuration information reads arithmetic logic is read according to the 2nd DMA;It, will according to the second DMA write configuration information
The operation result of reading is stored to output characteristic pattern.
The characteristic information includes: the width W, height H, port number N of the input feature vector figure;
The dma controller is specifically used when generating the first DMA reading configuration information according to the characteristic information of input feature vector figure
In: X-direction is generated according to the width W of the input feature vector figure and counts configuration;Y is generated according to the height H of the input feature vector figure
Direction counts configuration;The configuration of X-direction stride and the configuration of Y-direction stride are generated according to default value;According to the input feature vector figure
Port number N generate Z-direction count configuration;The configuration of Z-direction stride is generated according to default value.
The characteristic information includes: the width W of the input feature vector figure, height H;The dma controller is according to input
The characteristic information of characteristic pattern is specifically used for when generating the first DMA write configuration information: according to the width W and height of the input feature vector figure
It spends H and generates X-direction counting configuration;Y-direction counting configuration, the configuration of X-direction stride and Y-direction stride is generated according to default value to match
It sets;
Alternatively, the characteristic information includes: the width W, height H, port number N of the input feature vector figure;The DMA control
Device is specifically used for when generating the first DMA write configuration information according to the characteristic information of input feature vector figure: according to the input feature vector
Width W, height H and the port number N of figure generate X-direction and count configuration;And Y-direction counting is generated according to default value and is matched
It sets, the configuration of X-direction stride, the configuration of Y-direction stride, Z-direction counts configuration, Z-direction stride configures.
The dma controller is reading configuration information according to the first DMA, when reading data from the input feature vector figure
It is specifically used for: configuration information is read according to the first DMA, since the corresponding initial address of the input feature vector figure, reads institute
State each data in input feature vector figure;
The dma controller is according to the first DMA write configuration information, when the data of reading are exported to arithmetic logic
It is specifically used for: according to the first DMA write configuration information, since the corresponding entry address of the arithmetic logic, by reading
Each data are exported to the arithmetic logic.
The dma controller is specific when reading the operation result of configuration information reading arithmetic logic according to the 2nd DMA
For: configuration information is read according to the 2nd DMA and reads the operation since the corresponding exit address of the arithmetic logic
Each operation result that logic generates;
The dma controller stores the operation result of reading special to output according to the second DMA write configuration information
It is specifically used for when sign figure: according to the second DMA write configuration information, since the initial address of output characteristic pattern, by reading
Each operation result is stored to the output characteristic pattern.
The dma controller is also used to before by the operation result of reading storage to output characteristic pattern: being determined described defeated
Enter the corresponding target DMA configuration information of characteristic pattern;Output characteristic pattern is constructed according to the target DMA configuration information.
The dma controller is specifically used for when constructing output characteristic pattern according to the target DMA configuration information: from specified
Storage location reads specific style information, and according to the target DMA configuration information, constructs corresponding with the specific style information
Output characteristic pattern.
Based on inventive concept same as the above method, a kind of dma controller is also provided in the embodiment of the present invention, it is described
Dma controller is used for: generating the first DMA reading configuration information according to the characteristic information of the first input feature vector figure and the first DMA write is matched
Confidence breath generates the 2nd DMA according to the characteristic information of the second input feature vector figure and reads configuration information and the second DMA write configuration information,
And determine that the 3rd DMA reads configuration information and third DMA write configuration information;Configuration information is read according to the first DMA, it is defeated from first
Enter and reads the first data in characteristic pattern;According to the first DMA write configuration information, the first data of reading are exported and are patrolled to operation
Volume;Configuration information is read according to the 2nd DMA, reads the second data from the second input feature vector figure;According to second DMA write
Configuration information exports the second data of reading to arithmetic logic;Configuration information, which is read, according to the 3rd DMA reads the operation
The operation result of logic;According to the third DMA write configuration information, by the operation result storage of reading to output characteristic pattern.
The characteristic information of the first input feature vector figure includes: the width W of the first input feature vector figure, height H, channel
Number N;The dma controller is specifically used when generating the first DMA reading configuration information according to the characteristic information of the first input feature vector figure
In: X-direction is generated according to the width W of the first input feature vector figure and counts configuration;According to the height of the first input feature vector figure
It spends H and generates Y-direction counting configuration;The configuration of X-direction stride and the configuration of Y-direction stride are generated according to default value;According to described
The port number N of one input feature vector figure generates Z-direction and counts configuration;The configuration of Z-direction stride is generated according to default value.
The characteristic information of the first input feature vector figure includes: the width W of the first input feature vector figure, height H;The DMA
Controller is specifically used for when generating the first DMA write configuration information according to the characteristic information of the first input feature vector figure: according to described
The width W and height H of first input feature vector figure generate X-direction and count configuration;Y-direction, which is generated, according to default value counts configuration, X
The configuration of direction stride and the configuration of Y-direction stride;Alternatively, the characteristic information of the first input feature vector figure includes: the first input spy
Levy width W, height H, the port number N of figure;The dma controller is generating first according to the characteristic information of the first input feature vector figure
It is specifically used for when DMA write configuration information: according to the width W, height H and port number N of the first input feature vector figure, generates X-direction meter
Number configuration;Y-direction counting configuration is generated according to default value, X-direction stride configures, Y-direction stride configures, Z-direction counting is matched
It sets, the configuration of Z-direction stride.
The dma controller is reading configuration information according to the first DMA, and the first number is read from the first input feature vector figure
According to when be specifically used for: according to the first DMA read configuration information, opened from the corresponding initial address of the first input feature vector figure
Begin, reads the first data of each of the first input feature vector figure;
First data of reading are exported and are patrolled to operation according to the first DMA write configuration information by the dma controller
It is specifically used for when collecting: according to the first DMA write configuration information, since the corresponding first entrance address of the arithmetic logic,
The first data of each of reading are exported to the arithmetic logic.
The characteristic information of the second input feature vector figure includes: the width W of the second input feature vector figure, height H, channel
Number N;The dma controller is specifically used when generating the 2nd DMA reading configuration information according to the characteristic information of the second input feature vector figure
In: X-direction is generated according to the width W of the second input feature vector figure and counts configuration;According to the height of the second input feature vector figure
It spends H and generates Y-direction counting configuration;The configuration of X-direction stride and the configuration of Y-direction stride are generated according to default value;According to described
The port number N of two input feature vector figures generates Z-direction and counts configuration;The configuration of Z-direction stride is generated according to default value.
The characteristic information of the second input feature vector figure includes: the width W of the second input feature vector figure, height H;The DMA
Controller is specifically used for when generating the second DMA write configuration information according to the characteristic information of the second input feature vector figure: according to described
The width W and height H of second input feature vector figure generate X-direction and count configuration;Y-direction, which is generated, according to default value counts configuration, X
The configuration of direction stride and the configuration of Y-direction stride;Alternatively, the characteristic information of the second input feature vector figure includes: the second input spy
Levy width W, height H, the port number N of figure;The dma controller is generating second according to the characteristic information of the second input feature vector figure
It is specifically used for when DMA write configuration information: according to the width W, height H and port number N of the second input feature vector figure, generates X-direction meter
Number configuration;Y-direction counting configuration is generated according to default value, X-direction stride configures, Y-direction stride configures, Z-direction counting is matched
It sets, the configuration of Z-direction stride.
The dma controller is reading configuration information according to the 2nd DMA, and the second number is read from the second input feature vector figure
According to when be specifically used for: according to the 2nd DMA read configuration information, opened from the corresponding initial address of the second input feature vector figure
Begin, reads the second data of each of the second input feature vector figure;
Second data of reading are exported and are patrolled to operation according to the second DMA write configuration information by the dma controller
It is specifically used for when collecting: according to the second DMA write configuration information, since the corresponding second entrance address of the arithmetic logic,
The second data of each of reading are exported to the arithmetic logic.
The dma controller is specifically used for when determining that the 3rd DMA reads configuration information and third DMA write configuration information: root
According to the width W and height H of the first input feature vector figure, generates the X-direction counting that the 3rd DMA is read in configuration information and match
It sets;The Y-direction in the 3rd DMA reading configuration information, which is generated, according to default value counts configuration, the configuration of X-direction stride and the side Y
It is configured to stride;
The counting of the X-direction in the third DMA write configuration information is generated according to the width W of the first input feature vector figure to match
It sets;The Y-direction in the third DMA write configuration information, which is generated, according to the height H of the first input feature vector figure counts configuration;Root
The configuration of the X-direction stride in the third DMA write configuration information and the configuration of Y-direction stride are generated according to default value.
The dma controller is specifically used for when determining that the 3rd DMA reads configuration information and third DMA write configuration information: root
According to the width W, height H and port number N of the first input feature vector figure, the X-direction in the 3rd DMA reading configuration information is generated
Count configuration;The Y-direction counting configuration in the 3rd DMA reading configuration information is generated according to default value, X-direction stride is matched
It sets, the configuration of Y-direction stride, Z-direction counts configuration, Z-direction stride configures;
The counting of the X-direction in the third DMA write configuration information is generated according to the width W of the first input feature vector figure to match
It sets;The Y-direction in the third DMA write configuration information, which is generated, according to the height H of the first input feature vector figure counts configuration;Root
The Z-direction in the third DMA write configuration information, which is generated, according to the port number N of the first input feature vector figure counts configuration;According to
Default value generates the configuration of the X-direction stride in the third DMA write configuration information, the configuration of Y-direction stride and Z-direction stride and matches
It sets.
The dma controller is when reading the operation result of the arithmetic logic according to the 3rd DMA reading configuration information
It is specifically used for: configuration information is read according to the 3rd DMA, since the corresponding exit address of the arithmetic logic, described in reading
Each operation result that arithmetic logic generates;
The dma controller stores the operation result of reading special to output according to the third DMA write configuration information
It is specifically used for when sign figure: will be read since the initial address of the output characteristic pattern according to the third DMA write configuration information
The each operation result taken is stored to the output characteristic pattern.
The dma controller is being also used to before by the operation result of reading storage to output characteristic pattern: determining described the
The corresponding target DMA configuration information of one input feature vector figure;The first input feature vector figure pair is constructed according to the target DMA configuration information
The output characteristic pattern answered.
The dma controller is specifically used for when determining the corresponding target DMA configuration information of the first input feature vector figure:
X-direction, which is generated, according to the width W of the first input feature vector figure counts configuration;According to the height H of the first input feature vector figure
It generates Y-direction and counts configuration;Z-direction, which is generated, according to the port number N of the first input feature vector figure counts configuration;According to present count
Value generates the configuration of X-direction stride, the configuration of Y-direction stride and the configuration of Z-direction stride.
The dma controller is constructing the corresponding output spy of the first input feature vector figure according to the target DMA configuration information
It is specifically used for when sign figure: reads specific style information from designated storage location, and according to the target DMA configuration information, construction
Output characteristic pattern corresponding with the specific style information.
Based on inventive concept same as the above method, a kind of data processing equipment is also provided in the embodiment of the present invention, such as
Shown in Fig. 4, the data processing equipment includes: memory and dma controller;Wherein, the memory, for storing program generation
Code;The dma controller when said program code is performed, realizes preceding claim for calling said program code
Data processing method.
Based on inventive concept same as the above method, a kind of computer-readable storage medium is also provided in the embodiment of the present invention
Matter is stored with several computer instructions on the computer readable storage medium, and the computer instruction is performed, and realizes power
Benefit requires above-mentioned data processing method.
System, device, module or the unit that above-described embodiment illustrates can realize by computer chip or entity, or
It is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can be
Personal computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, is led at laptop computer
It is any in equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment of navigating
The combination of several equipment.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each unit can be realized in the same or multiple software and or hardware when invention.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as the production of method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or implementation combining software and hardware aspects can be used in the present invention
The form of example.Moreover, it wherein includes the meter of computer usable program code that the embodiment of the present invention, which can be used in one or more,
The computer journey implemented in calculation machine usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of sequence product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
Figure and/or block diagram describe.It is generally understood that being realized by computer program instructions each in flowchart and/or the block diagram
The combination of process and/or box in process and/or box and flowchart and/or the block diagram.It can provide these computer journeys
Sequence instruct to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices processor with
A machine is generated, so that the instruction generation executed by computer or the processor of other programmable data processing devices is used for
Realize the dress for the function of specifying in one or more flows of the flowchart and/or one or more blocks of the block diagram
It sets.
Moreover, these computer program instructions also can store be able to guide computer or other programmable datas processing set
In standby computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates
Manufacture including command device, the command device are realized in one process of flow chart or multiple processes and/or block diagram one
The function of being specified in a box or multiple boxes.
These computer program instructions can also be loaded into computer or other programmable data processing devices, so that calculating
Series of operation steps are executed on machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
The foregoing is merely the embodiment of the present invention, are not intended to restrict the invention.Those skilled in the art are come
It says, the invention may be variously modified and varied.All any modifications made within the spirit and principles of the present invention are equally replaced
It changes, improve, should be included within scope of the presently claimed invention.
Claims (72)
1. a kind of data processing method, which is characterized in that be applied to direct memory access dma controller, which comprises
The first DMA is generated according to the characteristic information of input feature vector figure and reads configuration information and the first DMA write configuration information, and determines the
Two DMA read configuration information and the second DMA write configuration information;
Configuration information is read according to the first DMA, reads data from the input feature vector figure;Matched according to first DMA write
Confidence breath, the data of reading are exported to arithmetic logic;
The operation result that configuration information reads arithmetic logic is read according to the 2nd DMA;Match confidence according to second DMA write
Breath, by the operation result storage of reading to output characteristic pattern.
2. the method according to claim 1, wherein
The characteristic information includes: the width W of the input feature vector figure, height H;The characteristic information according to input feature vector figure
It generates the first DMA and reads configuration information, comprising:
X-direction, which is generated, according to the width W of the input feature vector figure counts configuration;
Y-direction, which is generated, according to the height H of the input feature vector figure counts configuration;
The configuration of X-direction stride and the configuration of Y-direction stride are generated according to default value.
3. according to the method described in claim 2, it is characterized in that,
It includes: that X-direction counts configuration: W that first DMA, which reads configuration information,;Y-direction counts configuration: H;The configuration of X-direction stride:
1;Y-direction stride configuration: 1.
4. according to the method described in claim 2, it is characterized in that,
The characteristic information further include: the port number N of the input feature vector figure;It is described raw according to the characteristic information of input feature vector figure
Configuration information is read at the first DMA, comprising:
Z-direction, which is generated, according to the port number N of the input feature vector figure counts configuration;
The configuration of Z-direction stride is generated according to default value.
5. the method according to claim 1, wherein
The characteristic information includes: the width W of the input feature vector figure, height H;The characteristic information according to input feature vector figure
Generate the first DMA write configuration information, comprising:
X-direction, which is generated, according to the width W of the input feature vector figure and height H counts configuration;
Y-direction, which is generated, according to default value counts configuration, the configuration of X-direction stride and the configuration of Y-direction stride.
6. according to the method described in claim 5, it is characterized in that,
The first DMA write configuration information includes: that X-direction counts configuration: W*H;Y-direction, which counts, to be configured: 0;X-direction stride is matched
It sets: 0;Y-direction stride configuration: 0.
7. the method according to claim 1, wherein
The characteristic information includes: the width W, height H, port number N of the input feature vector figure;It is described according to input feature vector figure
Characteristic information generates the first DMA write configuration information, comprising:
According to the width W, height H and port number N of the input feature vector figure, generates X-direction and count configuration;And according to default
Numerical generation Y-direction counts configuration, X-direction stride configures, the configuration of Y-direction stride, Z-direction counts configuration, Z-direction stride is matched
It sets.
8. the method according to the description of claim 7 is characterized in that the first DMA write configuration information includes: that X-direction counts
Configuration: W*H*N;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;Z
Direction stride configuration: 0.
9. the method according to claim 1, wherein described read configuration information according to the first DMA, from described
Data are read in input feature vector figure, comprising:
Configuration information, which is read, according to the first DMA reads the input since the corresponding initial address of the input feature vector figure
Each data in characteristic pattern.
10. will read the method according to claim 1, wherein described according to the first DMA write configuration information
The data taken are exported to arithmetic logic, comprising:
According to the first DMA write configuration information, since the corresponding entry address of the arithmetic logic, by every number of reading
According to output to the arithmetic logic.
11. according to the method described in claim 10, it is characterized in that,
The arithmetic logic is used to carry out average value operation or maximum operation to continuous W*H data;Wherein, W and H difference
For the width and height of the input feature vector figure.
12. the method according to claim 1, wherein it includes: that X-direction counts that the 2nd DMA, which reads configuration information,
Configuration: 1;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;The second DMA write configuration information
It include: X-direction counting configuration: 1;Y-direction, which counts, to be configured: 1;X-direction stride configuration: 0;Y-direction stride configuration: 0.
13. the method according to claim 1, wherein it includes: that X-direction counts that the 2nd DMA, which reads configuration information,
Configuration: N;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;Z-direction
Stride configuration: 0;The second DMA write configuration information includes: that X-direction counts configuration: N;Y-direction, which counts, to be configured: 1;X-direction step
Width configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;Z-direction stride configuration: 0.
14. the method according to claim 1, wherein
The operation result that configuration information reads arithmetic logic is read according to the 2nd DMA, comprising:
Configuration information is read according to the 2nd DMA to read the operation since the corresponding exit address of the arithmetic logic and patrol
Collect each operation result generated.
15. will read the method according to claim 1, wherein described according to the second DMA write configuration information
The operation result taken is stored to output characteristic pattern, comprising:
According to the second DMA write configuration information, since the initial address of output characteristic pattern, by each operation result of reading
Store the output characteristic pattern.
16. the method according to claim 1, wherein
Before the operation result storage to output characteristic pattern by reading, the method also includes:
Determine the corresponding target DMA configuration information of the input feature vector figure;
Output characteristic pattern is constructed according to the target DMA configuration information.
17. according to the method for claim 16, which is characterized in that
The target DMA configuration information includes: that X-direction counts configuration: N;Y-direction, which counts, to be configured: 1;X-direction stride configuration: 0;Y
Direction stride configuration: 0;Z-direction, which counts, to be configured: 0;Z-direction stride configuration: 0;Wherein, the N is the logical of the input feature vector figure
Road number.
18. according to the method for claim 16, which is characterized in that
It is described that output characteristic pattern is constructed according to the target DMA configuration information, comprising:
Specific style information is read from designated storage location, and according to the target DMA configuration information, construction and the specific sample
The corresponding output characteristic pattern of formula information.
19. a kind of data processing method, which is characterized in that be applied to direct memory access dma controller, which comprises
The first DMA, which is generated, according to the characteristic information of the first input feature vector figure reads configuration information and the first DMA write configuration information, according to
The characteristic information of second input feature vector figure generates the 2nd DMA and reads configuration information and the second DMA write configuration information, and determines third
DMA reads configuration information and third DMA write configuration information;
Configuration information is read according to the first DMA, reads the first data from the first input feature vector figure;According to the first DMA
Configuration information is write, the first data of reading are exported to arithmetic logic;
Configuration information is read according to the 2nd DMA, reads the second data from the second input feature vector figure;According to the 2nd DMA
Configuration information is write, the second data of reading are exported to arithmetic logic;
The operation result that configuration information reads the arithmetic logic is read according to the 3rd DMA;It is configured according to the third DMA write
Information, by the operation result storage of reading to output characteristic pattern.
20. according to the method for claim 19, which is characterized in that
The characteristic information of the first input feature vector figure includes: the width W of the first input feature vector figure, height H;According to first
The characteristic information of input feature vector figure generates the first DMA and reads configuration information, comprising:
X-direction, which is generated, according to the width W of the first input feature vector figure counts configuration;
Y-direction, which is generated, according to the height H of the first input feature vector figure counts configuration;
The configuration of X-direction stride and the configuration of Y-direction stride are generated according to default value.
21. according to the method for claim 20, which is characterized in that
It includes: that X-direction counts configuration: W that first DMA, which reads configuration information,;Y-direction counts configuration: H;The configuration of X-direction stride:
1;Y-direction stride configuration: 1.
22. according to the method for claim 20, which is characterized in that
The characteristic information of the first input feature vector figure further include: the port number N of the first input feature vector figure;It is defeated according to first
The characteristic information for entering characteristic pattern generates the first DMA and reads configuration information, further includes:
Z-direction, which is generated, according to the port number N of the first input feature vector figure counts configuration;
The configuration of Z-direction stride is generated according to default value.
23. according to the method for claim 19, which is characterized in that
The characteristic information of the first input feature vector figure includes: the width W of the first input feature vector figure, height H;According to first
The characteristic information of input feature vector figure generates the first DMA write configuration information, comprising:
X-direction, which is generated, according to the width W of the first input feature vector figure and height H counts configuration;
Y-direction, which is generated, according to default value counts configuration, the configuration of X-direction stride and the configuration of Y-direction stride.
24. according to the method for claim 23, which is characterized in that
The first DMA write configuration information includes: that X-direction counts configuration: W*H;Y-direction, which counts, to be configured: 0;X-direction stride is matched
It sets: 0;Y-direction stride configuration: 0.
25. according to the method for claim 19, which is characterized in that the characteristic information of the first input feature vector figure includes:
Width W, height H, the port number N of the first input feature vector figure;It is described to be generated according to the characteristic information of the first input feature vector figure
First DMA write configuration information, comprising:
According to the width W, height H and port number N of the first input feature vector figure, generates X-direction and count configuration;And according to
Default value generation Y-direction counts configuration, the configuration of X-direction stride, the configuration of Y-direction stride, Z-direction counting configuration, Z-direction stride
Configuration.
26. according to the method for claim 25, which is characterized in that the first DMA write configuration information includes: X-direction meter
Number configuration: W*H*N;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;
Z-direction stride configuration: 0.
27. according to the method for claim 19, which is characterized in that it is described that configuration information is read according to the first DMA, from the
The first data are read in one input feature vector figure, comprising:
Configuration information is read according to the first DMA, since the corresponding initial address of the first input feature vector figure, described in reading
The first data of each of first input feature vector figure.
28. according to the method for claim 19, which is characterized in that it is described according to the first DMA write configuration information, it will read
The first data taken are exported to arithmetic logic, comprising:
According to the first DMA write configuration information, since the corresponding first entrance address of the arithmetic logic, by the every of reading
A first data are exported to the arithmetic logic.
29. according to the method for claim 19, which is characterized in that
The characteristic information of the second input feature vector figure includes: the width W of the second input feature vector figure, height H;According to second
The characteristic information of input feature vector figure generates the 2nd DMA and reads configuration information, comprising:
X-direction, which is generated, according to the width W of the second input feature vector figure counts configuration;
Y-direction, which is generated, according to the height H of the second input feature vector figure counts configuration;
The configuration of X-direction stride and the configuration of Y-direction stride are generated according to default value.
30. according to the method for claim 29, which is characterized in that
It includes: that X-direction counts configuration: W that 2nd DMA, which reads configuration information,;Y-direction counts configuration: H;The configuration of X-direction stride:
1;Y-direction stride configuration: 1.
31. according to the method for claim 29, which is characterized in that
The characteristic information of the second input feature vector figure further include: the port number N of the second input feature vector figure;It is defeated according to second
The characteristic information for entering characteristic pattern generates the 2nd DMA and reads configuration information, further includes:
Z-direction, which is generated, according to the port number N of the second input feature vector figure counts configuration;
The configuration of Z-direction stride is generated according to default value.
32. according to the method for claim 19, which is characterized in that
The characteristic information of the second input feature vector figure includes: the width W of the second input feature vector figure, height H;According to second
The characteristic information of input feature vector figure generates the second DMA write configuration information, comprising:
X-direction, which is generated, according to the width W of the second input feature vector figure and height H counts configuration;
Y-direction, which is generated, according to default value counts configuration, the configuration of X-direction stride and the configuration of Y-direction stride.
33. according to the method for claim 32, which is characterized in that
The second DMA write configuration information includes: that X-direction counts configuration: W*H;Y-direction, which counts, to be configured: 0;X-direction stride is matched
It sets: 0;Y-direction stride configuration: 0.
34. according to the method for claim 19, which is characterized in that the characteristic information of the second input feature vector figure includes:
Width W, height H, the port number N of the second input feature vector figure;It is described to be generated according to the characteristic information of the second input feature vector figure
Second DMA write configuration information, comprising:
According to the width W, height H and port number N of the second input feature vector figure, generates X-direction and count configuration;And according to
Default value generation Y-direction counts configuration, the configuration of X-direction stride, the configuration of Y-direction stride, Z-direction counting configuration, Z-direction stride
Configuration.
35. according to the method for claim 34, which is characterized in that the second DMA write configuration information includes: X-direction meter
Number configuration: W*H*N;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;
Z-direction stride configuration: 0.
36. according to the method for claim 19, which is characterized in that
If the second input feature vector figure is at least one Parameter Map, for each Parameter Map, the 2nd DMA reads configuration information
It include: X-direction counting configuration: 1;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 1;Y-direction stride configuration: 0;Described second
DMA write configuration information includes: X-direction counting configuration: 1;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride is matched
It sets: 0.
37. according to the method for claim 19, which is characterized in that if the second input feature vector figure is at least one parameter
Figure, for each Parameter Map, it includes: that X-direction counts configuration: N that the 2nd DMA, which reads configuration information,;Y-direction, which counts, to be configured: 0;X
Direction stride configuration: 1;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;Z-direction stride configuration: 0;Second DMA write
Configuration information includes: that X-direction counts configuration: N;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;
Z-direction, which counts, to be configured: 0;Z-direction stride configuration: 0.
38. according to the method for claim 19, which is characterized in that it is described that configuration information is read according to the 2nd DMA, from the
The second data are read in two input feature vector figures, comprising:
Configuration information is read according to the 2nd DMA, since the corresponding initial address of the second input feature vector figure, described in reading
The second data of each of second input feature vector figure.
39. according to the method for claim 19, which is characterized in that it is described according to the second DMA write configuration information, it will read
The second data taken are exported to arithmetic logic, comprising:
According to the second DMA write configuration information, since the corresponding second entrance address of the arithmetic logic, by the every of reading
A second data are exported to the arithmetic logic.
40. according to the method for claim 39, which is characterized in that the arithmetic logic is used for the first data and the second number
According to progress element-wise operation or Batch Normalization operation.
41. according to the method for claim 19, which is characterized in that
The 3rd DMA of determination reads configuration information and third DMA write configuration information, comprising:
According to the width W and height H of the first input feature vector figure, the X-direction meter in the 3rd DMA reading configuration information is generated
Number configuration;According to default value generate the Y-direction that the 3rd DMA reads in configuration information count configuration, the configuration of X-direction stride and
The configuration of Y-direction stride;
The X-direction in the third DMA write configuration information, which is generated, according to the width W of the first input feature vector figure counts configuration;
The Y-direction in the third DMA write configuration information, which is generated, according to the height H of the first input feature vector figure counts configuration;According to
Default value generates the configuration of the X-direction stride in the third DMA write configuration information and the configuration of Y-direction stride.
42. according to the method for claim 41, which is characterized in that it includes: X-direction meter that the 3rd DMA, which reads configuration information,
Number configuration: W*H;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;The third DMA write configuration
Information includes: that X-direction counts configuration: W;Y-direction counts configuration: H;X-direction stride configuration: 1;Y-direction stride configuration: 1.
43. according to the method for claim 19, which is characterized in that
The 3rd DMA of determination reads configuration information and third DMA write configuration information, comprising:
According to the width W, height H and port number N of the first input feature vector figure, generates the 3rd DMA and read in configuration information
X-direction count configuration;The Y-direction in the 3rd DMA reading configuration information, which is generated, according to default value counts configuration, X-direction
Stride configuration, the configuration of Y-direction stride, Z-direction count configuration, the configuration of Z-direction stride;
The X-direction in the third DMA write configuration information, which is generated, according to the width W of the first input feature vector figure counts configuration;
The Y-direction in the third DMA write configuration information, which is generated, according to the height H of the first input feature vector figure counts configuration;According to
The port number N of the first input feature vector figure generates the Z-direction in the third DMA write configuration information and counts configuration;According to pre-
If the X-direction stride in third DMA write configuration information described in numerical generation configures, the configuration of Y-direction stride and Z-direction stride are matched
It sets.
44. according to the method for claim 43, which is characterized in that it includes: X-direction meter that the 3rd DMA, which reads configuration information,
Number configuration: W*H*N;Y-direction, which counts, to be configured: 0;X-direction stride configuration: 0;Y-direction stride configuration: 0;Z-direction, which counts, to be configured: 0;
Z-direction stride configuration: 0;Third DMA write configuration information includes: that X-direction counts configuration: W;Y-direction counts configuration: H;X-direction step
Width configuration: 1;Y-direction stride configuration: 1;Z-direction counts configuration: N;Z-direction stride configuration: 1.
45. according to the method for claim 19, which is characterized in that
The operation result that configuration information reads the arithmetic logic is read according to the 3rd DMA, comprising:
Configuration information is read according to the 3rd DMA to read the operation since the corresponding exit address of the arithmetic logic and patrol
Collect each operation result generated.
46. according to the method for claim 19, which is characterized in that it is described according to the third DMA write configuration information, it will read
The operation result taken is stored to output characteristic pattern, comprising:
According to the third DMA write configuration information, since the initial address of the output characteristic pattern, by each operation of reading
As a result the output characteristic pattern is arrived in storage.
47. according to the method for claim 19, which is characterized in that
Before the operation result storage to output characteristic pattern by reading, the method also includes:
Determine the corresponding target DMA configuration information of the first input feature vector figure;
The corresponding output characteristic pattern of the first input feature vector figure is constructed according to the target DMA configuration information.
48. according to the method for claim 47, which is characterized in that
The corresponding target DMA configuration information of determination the first input feature vector figure, comprising:
X-direction, which is generated, according to the width W of the first input feature vector figure counts configuration;
Y-direction, which is generated, according to the height H of the first input feature vector figure counts configuration;
Z-direction, which is generated, according to the port number N of the first input feature vector figure counts configuration;
The configuration of X-direction stride, the configuration of Y-direction stride and the configuration of Z-direction stride are generated according to default value.
49. according to the method for claim 48, which is characterized in that the target DMA configuration information includes: that X-direction counts
Configuration: W;Y-direction counts configuration: H;X-direction stride configuration: 1;Y-direction stride configuration: 1;Z-direction counts configuration: N;Z-direction
Stride configuration: 1.
50. according to the method for claim 47, which is characterized in that described according to target DMA configuration information construction the
The corresponding output characteristic pattern of one input feature vector figure, comprising:
Specific style information is read from designated storage location, and according to the target DMA configuration information, construction and the specific sample
The corresponding output characteristic pattern of formula information.
51. a kind of direct memory access dma controller, which is characterized in that dma controller is used for:
The first DMA is generated according to the characteristic information of input feature vector figure and reads configuration information and the first DMA write configuration information, and determines the
Two DMA read configuration information and the second DMA write configuration information;
Configuration information is read according to the first DMA, reads data from the input feature vector figure;Matched according to first DMA write
Confidence breath, the data of reading are exported to arithmetic logic;
The operation result that configuration information reads arithmetic logic is read according to the 2nd DMA;Match confidence according to second DMA write
Breath, by the operation result storage of reading to output characteristic pattern.
52. dma controller according to claim 51, which is characterized in that
The characteristic information includes: the width W, height H, port number N of the input feature vector figure;
The dma controller is specifically used for when generating the first DMA reading configuration information according to the characteristic information of input feature vector figure: root
X-direction, which is generated, according to the width W of the input feature vector figure counts configuration;Y-direction meter is generated according to the height H of the input feature vector figure
Number configuration;The configuration of X-direction stride and the configuration of Y-direction stride are generated according to default value;According to the channel of the input feature vector figure
Number N generates Z-direction and counts configuration;The configuration of Z-direction stride is generated according to default value.
53. dma controller according to claim 51, which is characterized in that
The characteristic information includes: the width W of the input feature vector figure, height H;The dma controller is according to input feature vector
The characteristic information of figure is specifically used for when generating the first DMA write configuration information: according to the width W and height H of the input feature vector figure
It generates X-direction and counts configuration;Y-direction, which is generated, according to default value counts configuration, the configuration of X-direction stride and the configuration of Y-direction stride;
Alternatively, the characteristic information includes: the width W, height H, port number N of the input feature vector figure;The dma controller exists
It is specifically used for when generating the first DMA write configuration information according to the characteristic information of input feature vector figure: according to the input feature vector figure
Width W, height H and port number N generate X-direction and count configuration;And Y-direction is generated according to default value and counts configuration, the side X
Configuration, the configuration of Z-direction stride are counted to stride configuration, the configuration of Y-direction stride, Z-direction.
54. dma controller according to claim 51, which is characterized in that
The dma controller is reading configuration information according to the first DMA, reads from the input feature vector figure specific when data
For: configuration information is read according to the first DMA, since the corresponding initial address of the input feature vector figure, is read described defeated
Enter each data in characteristic pattern;
The dma controller is specific when the data of reading are exported to arithmetic logic according to the first DMA write configuration information
For: according to the first DMA write configuration information, since the corresponding entry address of the arithmetic logic, by each of reading
Data are exported to the arithmetic logic.
55. dma controller according to claim 51, which is characterized in that
The dma controller is being read to be specifically used for when configuration information reads the operation result of arithmetic logic according to the 2nd DMA:
Configuration information is read according to the 2nd DMA, since the corresponding exit address of the arithmetic logic, the arithmetic logic is read and produces
Raw each operation result;
The dma controller stores the operation result of reading to output characteristic pattern according to the second DMA write configuration information
When be specifically used for: according to the second DMA write configuration information, since the initial address of output characteristic pattern, by each of reading
Operation result is stored to the output characteristic pattern.
56. dma controller according to claim 51, which is characterized in that the dma controller is in the operation knot that will be read
It is also used to before fruit storage to output characteristic pattern: determining the corresponding target DMA configuration information of the input feature vector figure;According to described
Target DMA configuration information construction output characteristic pattern.
57. dma controller according to claim 56, which is characterized in that
The dma controller is specifically used for when constructing output characteristic pattern according to the target DMA configuration information: from specified storage
Specific style information is read in position, and according to the target DMA configuration information, constructs corresponding with the specific style information defeated
Characteristic pattern out.
58. a kind of direct memory access dma controller, which is characterized in that dma controller is used for:
The first DMA, which is generated, according to the characteristic information of the first input feature vector figure reads configuration information and the first DMA write configuration information, according to
The characteristic information of second input feature vector figure generates the 2nd DMA and reads configuration information and the second DMA write configuration information, and determines third
DMA reads configuration information and third DMA write configuration information;
Configuration information is read according to the first DMA, reads the first data from the first input feature vector figure;According to the first DMA
Configuration information is write, the first data of reading are exported to arithmetic logic;
Configuration information is read according to the 2nd DMA, reads the second data from the second input feature vector figure;According to the 2nd DMA
Configuration information is write, the second data of reading are exported to arithmetic logic;
The operation result that configuration information reads the arithmetic logic is read according to the 3rd DMA;It is configured according to the third DMA write
Information, by the operation result storage of reading to output characteristic pattern.
59. dma controller according to claim 58, which is characterized in that the characteristic information of the first input feature vector figure
It include: the width W, height H, port number N of the first input feature vector figure;
The dma controller is specifically used when generating the first DMA reading configuration information according to the characteristic information of the first input feature vector figure
In: X-direction is generated according to the width W of the first input feature vector figure and counts configuration;According to the height of the first input feature vector figure
It spends H and generates Y-direction counting configuration;The configuration of X-direction stride and the configuration of Y-direction stride are generated according to default value;According to described
The port number N of one input feature vector figure generates Z-direction and counts configuration;The configuration of Z-direction stride is generated according to default value.
60. dma controller according to claim 58, which is characterized in that the characteristic information of the first input feature vector figure
It include: width W, the height H of the first input feature vector figure;The dma controller is in the feature according to the first input feature vector figure
Information is specifically used for when generating the first DMA write configuration information: generating X according to the width W of the first input feature vector figure and height H
Direction counts configuration;Y-direction, which is generated, according to default value counts configuration, the configuration of X-direction stride and the configuration of Y-direction stride;
Alternatively, the characteristic information of the first input feature vector figure includes: the width W of the first input feature vector figure, height H, leads to
Road number N;The dma controller is specific when generating the first DMA write configuration information according to the characteristic information of the first input feature vector figure
For: according to the width W, height H and port number N of the first input feature vector figure, generates X-direction and count configuration;According to default value
Generation Y-direction counts configuration, the configuration of X-direction stride, the configuration of Y-direction stride, Z-direction counting configuration, the configuration of Z-direction stride.
61. dma controller according to claim 58, which is characterized in that
The dma controller is reading configuration information according to the first DMA, when reading the first data from the first input feature vector figure
It is specifically used for: configuration information is read according to the first DMA, since the corresponding initial address of the first input feature vector figure, reads
Take the first data of each of the first input feature vector figure;
The dma controller is according to the first DMA write configuration information, when the first data of reading are exported to arithmetic logic
It is specifically used for: will be read since the corresponding first entrance address of the arithmetic logic according to the first DMA write configuration information
The first data each of are taken to export to the arithmetic logic.
62. dma controller according to claim 58, which is characterized in that the characteristic information of the second input feature vector figure
It include: the width W, height H, port number N of the second input feature vector figure;
The dma controller is specifically used when generating the 2nd DMA reading configuration information according to the characteristic information of the second input feature vector figure
In: X-direction is generated according to the width W of the second input feature vector figure and counts configuration;According to the height of the second input feature vector figure
It spends H and generates Y-direction counting configuration;The configuration of X-direction stride and the configuration of Y-direction stride are generated according to default value;According to described
The port number N of two input feature vector figures generates Z-direction and counts configuration;The configuration of Z-direction stride is generated according to default value.
63. dma controller according to claim 58, which is characterized in that the characteristic information of the second input feature vector figure
It include: width W, the height H of the second input feature vector figure;The dma controller is in the feature according to the second input feature vector figure
Information is specifically used for when generating the second DMA write configuration information: generating X according to the width W of the second input feature vector figure and height H
Direction counts configuration;Y-direction, which is generated, according to default value counts configuration, the configuration of X-direction stride and the configuration of Y-direction stride;
Alternatively, the characteristic information of the second input feature vector figure includes: the width W of the second input feature vector figure, height H, leads to
Road number N;The dma controller is specific when generating the second DMA write configuration information according to the characteristic information of the second input feature vector figure
For: according to the width W, height H and port number N of the second input feature vector figure, generates X-direction and count configuration;According to default value
Generation Y-direction counts configuration, the configuration of X-direction stride, the configuration of Y-direction stride, Z-direction counting configuration, the configuration of Z-direction stride.
64. dma controller according to claim 58, which is characterized in that
The dma controller is reading configuration information according to the 2nd DMA, when reading the second data from the second input feature vector figure
It is specifically used for: configuration information is read according to the 2nd DMA, since the corresponding initial address of the second input feature vector figure, reads
Take the second data of each of the second input feature vector figure;
The dma controller is according to the second DMA write configuration information, when the second data of reading are exported to arithmetic logic
It is specifically used for: will be read since the corresponding second entrance address of the arithmetic logic according to the second DMA write configuration information
The second data each of are taken to export to the arithmetic logic.
65. dma controller according to claim 58, which is characterized in that
The dma controller is specifically used for when determining that the 3rd DMA reads configuration information and third DMA write configuration information: according to institute
The width W and height H of the first input feature vector figure are stated, the X-direction that the 3rd DMA is read in configuration information is generated and counts configuration;Root
The Y-direction in the 3rd DMA reading configuration information, which is generated, according to default value counts configuration, the configuration of X-direction stride and Y-direction stride
Configuration;
The X-direction in the third DMA write configuration information, which is generated, according to the width W of the first input feature vector figure counts configuration;
The Y-direction in the third DMA write configuration information, which is generated, according to the height H of the first input feature vector figure counts configuration;According to
Default value generates the configuration of the X-direction stride in the third DMA write configuration information and the configuration of Y-direction stride.
66. dma controller according to claim 58, which is characterized in that
The dma controller is specifically used for when determining that the 3rd DMA reads configuration information and third DMA write configuration information: according to institute
The width W, height H and port number N of the first input feature vector figure are stated, the X-direction that the 3rd DMA is read in configuration information is generated and counts
Configuration;The Y-direction in the 3rd DMA reading configuration information, which is generated, according to default value counts configuration, the configuration of X-direction stride, the side Y
Configuration, the configuration of Z-direction stride are counted to stride configuration, Z-direction;
The X-direction in the third DMA write configuration information, which is generated, according to the width W of the first input feature vector figure counts configuration;
The Y-direction in the third DMA write configuration information, which is generated, according to the height H of the first input feature vector figure counts configuration;According to
The port number N of the first input feature vector figure generates the Z-direction in the third DMA write configuration information and counts configuration;According to pre-
If the X-direction stride in third DMA write configuration information described in numerical generation configures, the configuration of Y-direction stride and Z-direction stride are matched
It sets.
67. dma controller according to claim 58, which is characterized in that
The dma controller is specific when reading the operation result of the arithmetic logic according to the 3rd DMA reading configuration information
For: configuration information is read according to the 3rd DMA and reads the operation since the corresponding exit address of the arithmetic logic
Each operation result that logic generates;
The dma controller stores the operation result of reading to output characteristic pattern according to the third DMA write configuration information
When be specifically used for: according to the third DMA write configuration information, since the initial address of the output characteristic pattern, by reading
Each operation result is stored to the output characteristic pattern.
68. dma controller according to claim 58, which is characterized in that
The dma controller is also used to before by the operation result of reading storage to output characteristic pattern: determining that described first is defeated
Enter the corresponding target DMA configuration information of characteristic pattern;It is corresponding that the first input feature vector figure is constructed according to the target DMA configuration information
Export characteristic pattern.
69. dma controller according to claim 68, which is characterized in that
The dma controller is specifically used for when determining the corresponding target DMA configuration information of the first input feature vector figure: according to
The width W of the first input feature vector figure generates X-direction and counts configuration;Y is generated according to the height H of the first input feature vector figure
Direction counts configuration;Z-direction, which is generated, according to the port number N of the first input feature vector figure counts configuration;It is raw according to default value
At the configuration of X-direction stride, the configuration of Y-direction stride and the configuration of Z-direction stride.
70. dma controller according to claim 68, which is characterized in that
The dma controller is constructing the corresponding output characteristic pattern of the first input feature vector figure according to the target DMA configuration information
When be specifically used for: read specific style information from designated storage location, and according to the target DMA configuration information, construction and institute
State the corresponding output characteristic pattern of specific style information.
71. a kind of data processing equipment, which is characterized in that the data processing equipment includes:
Memory, for storing program code;
Dma controller, for calling said program code, when said program code is performed, realization claim 1-18 appoints
Data processing method described in one, alternatively, realizing any data processing method of claim 19-50.
72. a kind of computer readable storage medium, which is characterized in that be stored with several meters on the computer readable storage medium
The instruction of calculation machine, the computer instruction are performed, and realize any data processing method of claim 1-18, alternatively,
Realize any data processing method of claim 19-50.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/120273 WO2019127538A1 (en) | 2017-12-29 | 2017-12-29 | Data processing method and device, dma controller, and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109074334A true CN109074334A (en) | 2018-12-21 |
Family
ID=64812380
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201780022803.9A Pending CN109074334A (en) | 2017-12-29 | 2017-12-29 | Data processing method, equipment, dma controller and computer readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109074334A (en) |
WO (1) | WO2019127538A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114328315A (en) * | 2021-11-22 | 2022-04-12 | 北京智芯微电子科技有限公司 | DMA-based data preprocessing method, DMA component and chip structure |
CN114399034A (en) * | 2021-12-30 | 2022-04-26 | 北京奕斯伟计算技术有限公司 | Data handling method for direct memory access device |
US11789709B2 (en) | 2019-09-18 | 2023-10-17 | Huawei Technologies Co., Ltd. | Intermediate representation construction method, compiler, and server |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070294514A1 (en) * | 2006-06-20 | 2007-12-20 | Koji Hosogi | Picture Processing Engine and Picture Processing System |
CN101552916A (en) * | 2009-05-05 | 2009-10-07 | 北京红旗胜利科技发展有限责任公司 | DMA transfer method, device and DMA controller for YUV video data |
CN102567254A (en) * | 2010-12-31 | 2012-07-11 | 重庆重邮信科通信技术有限公司 | Method for performing data normalization processing by use of DMA (direct memory access) controller |
CN103207847A (en) * | 2013-04-27 | 2013-07-17 | 杭州士兰微电子股份有限公司 | DMA (direct memory access) controller and direct memory access control method |
CN104899182A (en) * | 2015-06-09 | 2015-09-09 | 中国人民解放军国防科学技术大学 | Matrix multiplication acceleration method for supporting variable blocks |
CN107391402A (en) * | 2017-07-21 | 2017-11-24 | 郑州云海信息技术有限公司 | A kind of data operating method, device and a kind of data operation card |
-
2017
- 2017-12-29 WO PCT/CN2017/120273 patent/WO2019127538A1/en active Application Filing
- 2017-12-29 CN CN201780022803.9A patent/CN109074334A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070294514A1 (en) * | 2006-06-20 | 2007-12-20 | Koji Hosogi | Picture Processing Engine and Picture Processing System |
CN101552916A (en) * | 2009-05-05 | 2009-10-07 | 北京红旗胜利科技发展有限责任公司 | DMA transfer method, device and DMA controller for YUV video data |
CN102567254A (en) * | 2010-12-31 | 2012-07-11 | 重庆重邮信科通信技术有限公司 | Method for performing data normalization processing by use of DMA (direct memory access) controller |
CN103207847A (en) * | 2013-04-27 | 2013-07-17 | 杭州士兰微电子股份有限公司 | DMA (direct memory access) controller and direct memory access control method |
CN104899182A (en) * | 2015-06-09 | 2015-09-09 | 中国人民解放军国防科学技术大学 | Matrix multiplication acceleration method for supporting variable blocks |
CN107391402A (en) * | 2017-07-21 | 2017-11-24 | 郑州云海信息技术有限公司 | A kind of data operating method, device and a kind of data operation card |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11789709B2 (en) | 2019-09-18 | 2023-10-17 | Huawei Technologies Co., Ltd. | Intermediate representation construction method, compiler, and server |
CN114328315A (en) * | 2021-11-22 | 2022-04-12 | 北京智芯微电子科技有限公司 | DMA-based data preprocessing method, DMA component and chip structure |
CN114399034A (en) * | 2021-12-30 | 2022-04-26 | 北京奕斯伟计算技术有限公司 | Data handling method for direct memory access device |
Also Published As
Publication number | Publication date |
---|---|
WO2019127538A1 (en) | 2019-07-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108885596A (en) | Data processing method, equipment, dma controller and computer readable storage medium | |
TWI775605B (en) | Deep vision processor | |
CN108229654B (en) | Neural network convolution operation device and method | |
CN109074335A (en) | Data processing method, equipment, dma controller and computer readable storage medium | |
US11294599B1 (en) | Registers for restricted memory | |
CN108645411B (en) | Robot path planning method and device based on particle swarm algorithm and terminal equipment | |
US20210157594A1 (en) | Data temporary storage apparatus, data temporary storage method and operation method | |
CN109791625A (en) | Face recognition is carried out using artificial neural network | |
CN105608490B (en) | Cellular array computing system and communication means therein | |
CN107895191A (en) | A kind of information processing method and Related product | |
CN107329734A (en) | A kind of apparatus and method for performing convolutional neural networks forward operation | |
CN103559476B (en) | Fingerprint matching method and device thereof | |
CN109074334A (en) | Data processing method, equipment, dma controller and computer readable storage medium | |
CN111465943A (en) | On-chip computing network | |
US20200210805A1 (en) | Neural Network Generator | |
US20240160909A1 (en) | Shared scratchpad memory with parallel load-store | |
CN107707899A (en) | Multi-view image processing method, device and electronic equipment comprising moving target | |
CN109726755A (en) | A kind of picture mask method, device and electronic equipment | |
CN105843591A (en) | Method and device for generating data through multi-dimensional array sliding as well as processor | |
JP2017010255A (en) | Image recognition apparatus and image recognition method | |
CN113822975B (en) | Techniques for efficient sampling of images | |
US9570125B1 (en) | Apparatuses and methods for shifting data during a masked write to a buffer | |
CN112396072A (en) | Image classification acceleration method and device based on ASIC and VGG16 | |
CN110910478B (en) | GIF map generation method and device, electronic equipment and storage medium | |
CN114761920A (en) | Hardware accelerator with reconfigurable instruction set |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20181221 |