# US 2019/0317732 A1 · Convolution Operation Chip And Communications Device

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

- Number: US 2019/0317732 A1
- Document ID: US20190317732A1
- Status: Published application
- Kind: A1
- Application number: 16/456,119
- Filed: 2019-06-28
- Published: 2019-10-17
- Earliest claimed: 2016-12-29
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Bin XU; Honghui YUAN; Leijun HE
- Web page: https://patentgrep.com/patent/US20190317732A1

## CPC

- G06F 7/5443: {Sum of products (for applications thereof, see the relevant places, e.g. G06F17/10, H03H17/00)}
- G06F 17/153: {Multidimensional correlation or convolution}
- G06F 7/57: Arithmetic logic units [ALU], i.e. arrangements or devices for performing two or more of the operations covered by groups G06F7/483 – G06F7/556 or for performing logical operations {(G06F7/49, G06F7/491 take precedence)}
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A convolution operation chip (300) and a communications device are provided. The convolution operation chip (300) includes: an M×N multiplication accumulator array (320), including a first multiplication accumulation window, where a processing element PEX,Y of the first multiplication accumulation window is configured to: perform a multiplication operation on convolutional data of the PEX,Y and a convolutional parameter of the PEX,Y, transmit the convolutional parameter of the PEX,Y to a PEX,Y+1, transmit the convolutional data of the PEX,Y to a PEX−1,Y+1, and respectively use the convolutional parameter of the PEX,Y and the convolutional data of the PEX,Y as multipliers of multiplication operations performed by the PEX,Y+1 and the PEX−1,Y+1; a data cache module (310), configured to transmit convolutional data and a convolutional parameter to the first multiplication accumulation window; and an output control module (330), configured to output a convolutional result.

## Claims

### Claim 1

A convolution operation chip, comprising a data cache circuit, an M×N multiplication accumulator array, and an output control circuit, wherein
the data cache circuit is configured to transmit a plurality of pieces of convolutional data and a plurality of convolutional parameters used for a convolution operation to a first multiplication accumulation window in the M×N multiplication accumulator array, wherein the plurality of convolutional parameters are determined by the data cache circuit based on a first convolutional parameter matrix, the plurality of pieces of convolutional data are determined by the data cache circuit based on a first convolutional data matrix, the first convolutional parameter matrix comprises A rows and B columns, the first convolutional data matrix comprises D rows and E columns, the first multiplication accumulation window comprises A rows and C columns, A is an integer greater than or equal to 2, B and C are each an integer greater than or equal to 1, D is a positive integer greater than or equal to A, E is an integer greater than or equal to max (B, C), M is a positive integer greater than or equal to A, and N is a positive integer greater than or equal to C;
the first multiplication accumulation window comprises A×C processing elements, wherein a processing element in an ith row and a jth column is marked as PEi,j, i is set to an integer each time in ascending order of 1 to A in sequence, and corresponding to each value of i, j is set to an integer each time in ascending order of 1 to C in sequence; a processing element PEX,Y of the first multiplication accumulation window is configured to perform a multiplication operation on convolutional data of the PEX,Y and a convolutional parameter of the PEX,Y; and when C is greater than or equal to 2, the processing element PEX,Y is further configured to: transmit the convolutional parameter of the PEX,Y to a PEX,Y+1, transmit the convolutional data of the PEX,Y to a PEX−1,Y+1, and respectively use the convolutional parameter of the PEX,Y and the convolutional data of the PEX,Y as multipliers of multiplication operations performed by the PEX,Y+1 and the PEX−1,Y+1, wherein X is an integer greater than or equal to 2 and less than or equal to A, Y is an integer greater than or equal to 1 and less than or equal to C−1, the convolutional data of the PEX,Y is one of the plurality of pieces of convolutional data transmitted by the data cache circuit, and the convolutional parameter of the PEX,Y is one of the plurality of convolutional parameters transmitted by the data cache circuit;
the first multiplication accumulation window is configured to perform an addition operation on a product obtained after a PEi,J performs a multiplication operation, to obtain a convolutional result, wherein J is an integer greater than or equal to 1 and less than or equal to C; and
the output control circuit is configured to output the convolutional result.

### Claim 2 (depends on 1)

The convolution operation chip according to claim 1, wherein the convolution operation chip further comprises:
an array control circuit, configured to: determine the first multiplication accumulation window used for the convolution operation from the M×N multiplication accumulator array, determine a row quantity of the first multiplication accumulation window based on a row quantity of the first convolutional parameter matrix, and determine a column quantity of the first multiplication accumulation window based on the row quantity of the first convolutional parameter matrix and a row quantity of the first convolutional data matrix.

### Claim 3 (depends on 2)

The convolution operation chip according to claim 2, wherein the array control circuit specifically determines the column quantity of the first multiplication accumulation window according to the following formula:
C=D−A+1.

### Claim 4 (depends on 1)

The convolution operation chip according to claim 1, wherein the first multiplication accumulation window is specifically configured to:
perform a multiplication operation on convolutional data of a processing element PEi,1 in a first column and a convolutional parameter of the PEi,1 in a tth clock cycle, to obtain a product Xi,1t, wherein the convolutional data of the PEi,1 and the convolutional parameter of the PEi,1 are transmitted by the data cache circuit to the PEi,1;
transmit a convolutional parameter of a PEx,1 to a PEx,2, transmit convolutional data of the PEx,1 to a PEx−1,2, and respectively use the convolutional parameter of the PEx,1 and the convolutional data of the PEx,1 as multipliers of multiplication operations performed by the PEx,2 and the PEx−1,2 in a (t+1)th clock cycle, wherein x is set to an integer each time in ascending order of 2 to A in sequence; and
when t is set to each integer in a range [nB+1, nB+B], perform, by using the following formula, an addition operation on all products Xi,1t corresponding to all values of t, to obtain a convolutional result S1:
S
1
=
∑
t
=
nB
+
1
nB
+
B

∑
i
=
1
A

X
i
,
1
t
,
wherein
n is an integer greater than or equal to 0 and less than or equal to (E−B).

### Claim 5 (depends on 3)

The convolution operation chip according to claim 3, wherein when C is greater than or equal to 2, the first multiplication accumulation window is further specifically configured to:
perform a multiplication operation on convolutional data of a processing element PEi,J′ in a (J′)th column and a convolutional parameter of the PEi,J′ in a Tth clock cycle, to obtain a product Xi,J′T, wherein J′ is an integer greater than or equal to 2 and less than or equal to C, the convolutional parameter of the PEi,J′ is obtained after convolutional parameter of a PEi,J′−1 is transmitted to the PEi,J′, convolutional data of a PEh,J′ is obtained after convolutional data of a PEh+1,J′−1 is transmitted to the PEh,J′, a convolutional parameter of a PEA,J′ and convolutional data of the PEA,J′ are transmitted by the data cache circuit to the PEA,J′, and h is set to an integer each time in ascending order of 1 to A−1 in sequence; and
when T is set to each integer in a range [nB+J′, nB+J′+B−1], perform, by using the following formula, an addition operation on all products Xi,J′T corresponding to all values of T, to obtain a convolutional result SJ′:
S
J
′
=
∑
T
=
nB
+
J
′
nB
+
J
′
+
B
-
1

∑
i
=
1
A

X
i
,
J
′
T
,
wherein
n is an integer greater than or equal to 0 and less than or equal to (E−B).

### Claim 6 (depends on 5)

The convolution operation chip according to claim 5, wherein the D×E convolutional data matrix comprises D×E pieces of convolutional data ap,q, p is set to an integer each time in ascending order of 1 to D in sequence, and corresponding to each value of p, q is set to an integer each time in ascending order of 1 to E in sequence; the A×B convolutional parameter matrix comprises A×B convolutional parameters bp′,q′, p′ is set to an integer each time in ascending order of 1 to A in sequence, and corresponding to each value of p′, q′ is set to an integer each time in ascending order of 1 to B in sequence; and the data cache circuit comprises:
a cache, configured to cache the D×E pieces of convolutional data and the A×B convolutional parameters; and
a counter, configured to determine, in an (nB+P)th clock cycle, that the convolutional data of the PEi,1 is ai,n+P, and the convolutional parameter of the PEi,1 is bi,P, wherein a value of P is an integer greater than or equal to 1 and less than or equal to B; and
the counter is further configured to determine, in an (nB+J′+Z−1)th clock cycle, that the convolutional data of the PEA,J′ is aA+J′−1,n+Z, and the convolutional parameter of the PEA,J′ is bA,Z, wherein a value of Z is an integer greater than or equal to 1 and less than or equal to B.

### Claim 7 (depends on 1)

The convolution operation chip according to claim 1, wherein the first multiplication accumulation window is further specifically configured to:
in an (nB+J)th clock cycle, transmit a product X1,JnB+J to a PE2,J, and perform an addition operation on the product X1,JnB+J and a product X2,JnB+J to obtain a convolutional intermediate result Q1nB+J, wherein the product X1,JnB+J is a product obtained after a PE1,J performs a multiplication operation on convolutional data of the PE1,J and a convolutional parameter of the PE1,J in the (nB+J)th clock cycle, and the product X2,JnB+J is a product obtained after the PE2,J performs a multiplication operation on convolutional data of the PE2,J and a convolutional parameter of the PE2,J in the (nB+J)th clock cycle;
transmit, to a PEf+1,J, a convolutional intermediate result Qf−1nB+J obtained after a PEf,J performs an addition operation, wherein f is set to an integer each time in ascending order of 2 to A−1 in sequence;
perform an addition operation on the convolutional intermediate result Qf−1nB+J and a product Xf+1,JnB+J obtained after the PEf+1,J performs a multiplication operation, to obtain a convolutional intermediate result QfnB+J;
transmit a convolutional intermediate result QA−1nB+J obtained in a PEA,J to the output control circuit for caching;
transmit the convolutional intermediate result QA−1nB+J to the PEi,J in an (nB+J+1)th clock cycle, and use the convolutional intermediate result QA−1nB+J as an initial accumulation value of an addition operation performed in the (nB+J+1)th clock cycle; and
determine, as a convolutional result SJ, a convolutional intermediate result QAnB+J+1 obtained in an ((n+1)B+J−1)th clock cycle.

### Claim 8 (depends on 1)

The convolution operation chip according to claim 1, wherein the M×N multiplication accumulator array further comprises a second multiplication accumulation window, and the first multiplication accumulation window does not intersect with the second multiplication accumulation window.

### Claim 9 (depends on 8)

The convolution operation chip according to claim 8 wherein the first convolutional data matrix is the same as a second convolutional data matrix, and the second convolutional data matrix is a convolutional data matrix to which convolutional data transmitted by the data cache circuit to the second multiplication accumulation window belongs; and
the first convolutional parameter matrix is different from a second convolutional parameter matrix, and the second convolutional parameter matrix is a convolutional parameter matrix to which a convolutional parameter transmitted by the data cache circuit to the second multiplication accumulation window belongs.

### Claim 10 (depends on 8)

The convolution operation chip according to claim 8, wherein the first convolutional data matrix is different from a second convolutional data matrix, and the second convolutional data matrix is a convolutional data matrix to which convolutional data transmitted by the data cache circuit to the second multiplication accumulation window belongs; and
the first convolutional parameter matrix is the same as a second convolutional parameter matrix, and the second convolutional parameter matrix is a convolutional parameter matrix to which a convolutional parameter transmitted by the data cache circuit to the second multiplication accumulation window belongs.

### Claim 11

A communications device, comprising a central processing unit (CPU), a double data rate synchronous dynamic random access memory (DDR SDRAM), and a convolution operation chip that are communicatively connected,
wherein the communication device comprising: a data cache circuit, an M×N multiplication accumulator array, and an output control circuit, wherein
the data cache circuit is configured to transmit a plurality of pieces of convolutional data and a plurality of convolutional parameters used for a convolution operation to a first multiplication accumulation window in the M×N multiplication accumulator array, wherein the plurality of convolutional parameters are determined by the data cache circuit based on a first convolutional parameter matrix, the plurality of pieces of convolutional data are determined by the data cache circuit based on a first convolutional data matrix, the first convolutional parameter matrix comprises A rows and B columns, the first convolutional data matrix comprises D rows and E columns, the first multiplication accumulation window comprises A rows and C columns, A is an integer greater than or equal to 2, B and C are each an integer greater than or equal to 1, D is a positive integer greater than or equal to A, E is an integer greater than or equal to max (B, C), M is a positive integer greater than or equal to A, and N is a positive integer greater than or equal to C;
the first multiplication accumulation window comprises A×C processing elements, wherein a processing element in an ith row and a jth column is marked as PEi,j, i is set to an integer each time in ascending order of 1 to A in sequence, and corresponding to each value of i, j is set to an integer each time in ascending order of 1 to C in sequence; a processing element PEX,Y of the first multiplication accumulation window is configured to perform a multiplication operation on convolutional data of the PEX,Y and a convolutional parameter of the PEX,Y; and when C is greater than or equal to 2, the processing element PEX,Y is further configured to: transmit the convolutional parameter of the PEX,Y to a PEX,Y+1, transmit the convolutional data of the PEX,Y to a PEX−1,Y+1, and respectively use the convolutional parameter of the PEX,Y and the convolutional data of the PEX,Y as multipliers of multiplication operations performed by the PEX,Y+1 and the PEX−1,Y+1, wherein X is an integer greater than or equal to 2 and less than or equal to A, Y is an integer greater than or equal to 1 and less than or equal to C−1, the convolutional data of the PEX,Y is one of the plurality of pieces of convolutional data transmitted by the data cache circuit, and the convolutional parameter of the PEX,Y is one of the plurality of convolutional parameters transmitted by the data cache circuit;
the first multiplication accumulation window is configured to perform an addition operation on a product obtained after a PEi,J performs a multiplication operation, to obtain a convolutional result, wherein J is an integer greater than or equal to 1 and less than or equal to C; and
the output control circuit is configured to output the convolutional result;
wherein the CPU is configured to control the communications device to start the convolution operation, and the DDR SDRAM is configured to input the plurality of pieces of convolutional data and the plurality of convolutional parameters to the data cache circuit of the communications device.

### Claim 12 (depends on 11)

The communications device according to claim 11, wherein the communications device further comprises:
an array control circuit, configured to: determine the first multiplication accumulation window used for the convolution operation from the M×N multiplication accumulator array, determine a row quantity of the first multiplication accumulation window based on a row quantity of the first convolutional parameter matrix, and determine a column quantity of the first multiplication accumulation window based on the row quantity of the first convolutional parameter matrix and a row quantity of the first convolutional data matrix.

### Claim 13 (depends on 12)

The communications device according to claim 12, wherein the array control circuit specifically determines the column quantity of the first multiplication accumulation window according to the following formula:
C=D−A+1.

### Claim 14 (depends on 11)

The communications device according to claim 11, wherein the first multiplication accumulation window is specifically configured to:
perform a multiplication operation on convolutional data of a processing element PEi,1 in a first column and a convolutional parameter of the PEi,1 in a tth clock cycle, to obtain a product Xi,1t, wherein the convolutional data of the PEi,1 and the convolutional parameter of the PEi,1 are transmitted by the data cache circuit to the PEi,1;
transmit a convolutional parameter of a PEx,1 to a PEx,2, transmit convolutional data of the PEx,1 to a PEx−1,2, and respectively use the convolutional parameter of the PEx,1 and the convolutional data of the PEx,1 as multipliers of multiplication operations performed by the PEx,2 and the PEx−1,2 in a (t+1)th clock cycle, wherein x is set to an integer each time in ascending order of 2 to A in sequence; and
when t is set to each integer in a range [nB+1, nB+B], perform, by using the following formula, an addition operation on all products Xi,1t corresponding to all values of t, to obtain a convolutional result S1:
S
1
=
∑
t
=
nB
+
1
nB
+
B

∑
i
=
1
A

X
i
,
1
t
,
wherein
n is an integer greater than or equal to 0 and less than or equal to (E−B).

### Claim 15 (depends on 13)

The communications device according to claim 13, wherein when C is greater than or equal to 2, the first multiplication accumulation window is further specifically configured to:
perform a multiplication operation on convolutional data of a processing element PEi,J′ in a (J′)th column and a convolutional parameter of the PEi,J′ in a Tth clock cycle, to obtain a product Xi,J′T, wherein J′ is an integer greater than or equal to 2 and less than or equal to C, the convolutional parameter of the PEi,J′ is obtained after convolutional parameter of a PEi,J′−1 is transmitted to the PEi,J′, convolutional data of a PEh,J′ is obtained after convolutional data of a PEh+1,J′−1 is transmitted to the PEh,J′, a convolutional parameter of a PEA,J′ and convolutional data of the PEA,J′ are transmitted by the data cache circuit to the PEA,J′, and h is set to an integer each time in ascending order of 1 to A−1 in sequence; and
when T is set to each integer in a range [nB+J′, nB+J′+B−1], perform, by using the following formula, an addition operation on all products Xi,J′T corresponding to all values of T, to obtain a convolutional result SJ′:
S
J
′
=
∑
T
=
nB
+
J
′
nB
+
J
′
+
B
-
1

∑
i
=
1
A

X
i
,
J
′
T
,
wherein
n is an integer greater than or equal to 0 and less than or equal to (E−B).

### Claim 16 (depends on 15)

The communications device according to claim 15, wherein the D×E convolutional data matrix comprises D×E pieces of convolutional data ap,q, p is set to an integer each time in ascending order of 1 to D in sequence, and corresponding to each value of p, q is set to an integer each time in ascending order of 1 to E in sequence; the A×B convolutional parameter matrix comprises A×B convolutional parameters bp′,q′, p′ is set to an integer each time in ascending order of 1 to A in sequence, and corresponding to each value of p′, q′ is set to an integer each time in ascending order of 1 to B in sequence; and the data cache circuit comprises:
a cache, configured to cache the D×E pieces of convolutional data and the A×B convolutional parameters; and
a counter, configured to determine, in an (nB+P)th clock cycle, that the convolutional data of the PEi,1 is ai,n+P, and the convolutional parameter of the PEi,1 is bi,P, wherein a value of P is an integer greater than or equal to 1 and less than or equal to B; and
the counter is further configured to determine, in an (nB+J′+Z−1)th clock cycle, that the convolutional data of the PEA,J′ is aA+J′−1,n+Z, and the convolutional parameter of the PEA,J′ is bA,Z, wherein a value of Z is an integer greater than or equal to 1 and less than or equal to B.

### Claim 17 (depends on 11)

The communications device according to claim 11, wherein the first multiplication accumulation window is further specifically configured to:
in an (nB+J)th clock cycle, transmit a product X1,JnB+J to a PE2,J, and perform an addition operation on the product X1,JnB+J and a product X2,JnB+J to obtain a convolutional intermediate result Q1nB+J, wherein the product X1,JnB+J is a product obtained after a PE1,J performs a multiplication operation on convolutional data of the PE1,J and a convolutional parameter of the PE1,J in the (nB+J)th clock cycle, and the product X2,JnB+J is a product obtained after the PE2,J performs a multiplication operation on convolutional data of the PE2,J and a convolutional parameter of the PE2,J in the (nB+J)th clock cycle;
transmit, to a PEf+1,J, a convolutional intermediate result Qf−1nB+J obtained after a PEf,J performs an addition operation, wherein f is set to an integer each time in ascending order of 2 to A−1 in sequence;
perform an addition operation on the convolutional intermediate result Qf−1nB+J and a product Xf+1,JnB+J obtained after the PEf+1,J performs a multiplication operation, to obtain a convolutional intermediate result QfnB+J;
transmit a convolutional intermediate result QA−1nB+J obtained in a PEA,J to the output control circuit for caching;
transmit the convolutional intermediate result QA−1nB+J to the PE1,J in an (nB+J+1)th clock cycle, and use the convolutional intermediate result QA−1nB+J as an initial accumulation value of an addition operation performed in the (nB+J+1)th clock cycle; and
determine, as a convolutional result SJ, a convolutional intermediate result QAnB+J+1 obtained in an ((n+1)B+J−1)th clock cycle.

### Claim 18 (depends on 11)

The communications device according to claim 11, wherein the M×N multiplication accumulator array further comprises a second multiplication accumulation window, and the first multiplication accumulation window does not intersect with the second multiplication accumulation window.

### Claim 19 (depends on 18)

The communications device according to claim 18 wherein the first convolutional data matrix is the same as a second convolutional data matrix, and the second convolutional data matrix is a convolutional data matrix to which convolutional data transmitted by the data cache circuit to the second multiplication accumulation window belongs; and
the first convolutional parameter matrix is different from a second convolutional parameter matrix, and the second convolutional parameter matrix is a convolutional parameter matrix to which a convolutional parameter transmitted by the data cache circuit to the second multiplication accumulation window belongs.

### Claim 20 (depends on 18)

The communications device according to claim 18, wherein the first convolutional data matrix is different from a second convolutional data matrix, and the second convolutional data matrix is a convolutional data matrix to which convolutional data transmitted by the data cache circuit to the second multiplication accumulation window belongs; and
the first convolutional parameter matrix is the same as a second convolutional parameter matrix, and the second convolutional parameter matrix is a convolutional parameter matrix to which a convolutional parameter transmitted by the data cache circuit to the second multiplication accumulation window belongs.
