# US 2021/0334105 A1 · Data processing method and apparatus, and related product

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

- Number: US 2021/0334105 A1
- Document ID: US20210334105A1
- Status: Published application
- Kind: A1
- Application number: 17/327,627
- Filed: 2021-05-21
- Published: 2021-10-28
- Earliest claimed: 2019-04-19
- Assignees: Cambricon Technologies Corporation Limited
- Applicants: Cambricon Technologies Corporation Limited
- Inventors: Shaoli Liu; Bingrui WANG; Zhen LI; Jun LIANG
- Web page: https://patentgrep.com/patent/US20210334105A1

## CPC

- G06F 9/30181: {Instruction operation extension or modification}
- G06F 9/30003: {Arrangements for executing specific machine instructions}
- G06F 9/345: of multiple operands or results {(addressing multiple banks G06F12/06)}
- G06F 9/3824: {Operand accessing}
- G06F 9/3881: {Arrangements for communication of instructions and data}
- G06F 13/1668: {Details of memory controller}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present disclosure provides a data processing method and an apparatus and a related product. The products include a control module including an instruction caching unit, an instruction processing unit, and a storage queue unit. The instruction caching unit is configured to store computation instructions associated with an artificial neural network operation; the instruction processing unit is configured to parse the computation instructions to obtain a plurality of operation instructions; and the storage queue unit is configured to store an instruction queue, where the instruction queue includes a plurality of operation instructions or computation instructions to be executed in the sequence of the queue. By utilizing the above-mentioned method, the present disclosure can improve the operation efficiency of related products when performing operations of a neural network model.

## Claims

### Claim 1

A data synchronization method performed by a first processor, comprising:
generating, by the first processor, a descriptor synchronization instruction according to a descriptor of tensor data to be synchronized, wherein the descriptor indicates a shape of the tensor data to be synchronized, and the descriptor synchronization instruction includes an identifier of the descriptor or content of the descriptor; and
sending the descriptor synchronization instruction to a second processor, wherein the descriptor synchronization instruction is configured to instruct the second processor to obtain the tensor data to be synchronized according to the descriptor synchronization instruction.

### Claim 2 (depends on 1)

The data synchronization method of claim 1, further comprising:
determining the descriptor of the tensor data to be synchronized according to a descriptor synchronization request instruction received from the second processor.

### Claim 3 (depends on 2)

The data synchronization method of claim 2, wherein the descriptor synchronization request instruction includes the identifier of the descriptor, and the determining the descriptor of the tensor data to be synchronized according to the descriptor synchronization request instruction received from the second processor includes:
parsing the descriptor synchronization request instruction to obtain the identifier of the descriptor; and
determining the descriptor of the tensor data to be synchronized according to the identifier of the descriptor.

### Claim 4 (depends on 2)

The data synchronization method of claim 2, wherein the descriptor synchronization request instruction includes data characteristics of the tensor data to be synchronized, and the determining the descriptor of the tensor data to be synchronized according to the descriptor synchronization request instruction received from the second processor includes:
parsing the descriptor synchronization request instruction to obtain the data characteristics of the tensor data to be synchronized, and
according to the data characteristics of the tensor data to be synchronized, determining the descriptor of the tensor data to be synchronized.

### Claim 5 (depends on 1)

The data synchronization method of claim 1, wherein the descriptor synchronization instruction includes the content of the descriptor of the tensor data to be synchronized, and the generating the descriptor synchronization instruction according to the descriptor of tensor data to be synchronized includes:
determining that a storage address of the tensor data to be synchronized is in a shared storage space; and
generating the descriptor synchronization instruction according to the content of the descriptor of the tensor data to be synchronized to instruct the second processor to obtain the tensor data to be synchronized from the shared storage space according to the content of the descriptor of the tensor data to be synchronized.

### Claim 6 (depends on 1)

The data synchronization method of claim 1, wherein the descriptor synchronization instruction includes the content of the descriptor of the tensor data to be synchronized, and the generating the descriptor synchronization instruction according to the descriptor of the tensor data to be synchronized includes:
storing the content of the descriptor of the tensor data to be synchronized to a storage space of synchronized data; and
generating the descriptor synchronization instruction to include an address of the content of the descriptor in the storage space of synchronized data to instruct the second processor to obtain the content of the descriptor of the tensor data to be synchronized from the address in the storage space of synchronized data.

### Claim 7 (depends on 1)

The data synchronization method of claim 1, wherein the descriptor synchronization instruction includes the content of the descriptor of the tensor data to be synchronized, and the generating the descriptor synchronization instruction according to the descriptor of the tensor data to be synchronized includes:
determining that a storage address of the tensor data to be synchronized is in a non-shared storage space;
storing the tensor data to be synchronized to a shared storage space;
generating the descriptor of the tensor data to be synchronized to include a new address of the tensor data to be synchronized in the shared storage space; and
generating the descriptor synchronization instruction according to the content of the descriptor of the tensor data to be synchronized to instruct the second processor to obtain the tensor data to be synchronized from the new address in the shared storage space according to the content of the descriptor of the tensor data to be synchronized.

### Claim 8 (depends on 1)

The data synchronization method of claim 1, wherein the generating the descriptor synchronization instruction according to the descriptor of the tensor data to be synchronized includes:
determining that a storage address of the tensor data to be synchronized is in a non-shared storage space;
storing the tensor data to be synchronized to a shared storage space;
modifying the descriptor of the tensor data to be synchronized in the non-shared storage space according to a new address of the tensor data to be synchronized in the shared storage space; and
generating the descriptor synchronization instruction according to the content of the descriptor of the tensor data to be synchronized to instruct the second processor to obtain the tensor data to be synchronized from the shared storage space according to the content of the descriptor of the tensor data to be synchronized.

### Claim 9

A data synchronization method performed by a second processor, comprising:
parsing a descriptor synchronization instruction received from a first processor to obtain a descriptor of tensor data to be synchronized, wherein the descriptor synchronization instruction includes an identifier of the descriptor or content of the descriptor, and the descriptor indicates a shape of the tensor data to be synchronized; and
obtaining the tensor data to be synchronized according to the descriptor of the tensor data to be synchronized.

### Claim 10 (depends on 9)

The data synchronization method of claim 9, wherein the descriptor synchronization instruction includes the content of the descriptor of the tensor data to be synchronized, and the obtaining the tensor data to be synchronized according to the descriptor of the tensor data to be synchronized includes:
obtaining the tensor data to be synchronized from a shared storage space according to the content of the descriptor of the tensor data to be synchronized.

### Claim 11 (depends on 9)

The data synchronization method of claim 9, wherein the descriptor synchronization instruction includes an address of the content of the descriptor of the tensor data to be synchronized in a storage space of synchronized data, and the obtaining the tensor data to be synchronized according to the descriptor of the tensor data to be synchronized includes:
obtaining the content of the descriptor of the tensor data to be synchronized from the storage space of synchronized data according to the address of the content of the descriptor of the tensor data to be synchronized in the storage space of synchronized data; and
obtaining the tensor data to be synchronized from a shared storage space according to the content of the descriptor of the tensor data to be synchronized.

### Claim 12

A data synchronization method performed by a second processor, comprising:
determining that there is tensor data to be synchronized;
generating a descriptor synchronization request instruction, wherein the descriptor synchronization request instruction is used to instruct a first processor to send a descriptor of the tensor data to be synchronized according to the descriptor synchronization request instruction, and the descriptor indicates a shape of the tensor data to be synchronized; and
sending the descriptor synchronization request instruction to the first processor.

### Claim 13 (depends on 12)

The data synchronization method of claim 12, wherein the descriptor synchronization request instruction includes an identifier of the descriptor or data characteristics of the tensor data to be synchronized.

### Claim 14 (depends on 13)

The data synchronization method of claim 13, further comprising:
parsing a descriptor synchronization instruction received from the first processor to obtain the descriptor of tensor data to be synchronized, wherein the descriptor synchronization instruction includes the identifier of the descriptor or content of the descriptor; and
obtaining the tensor data to be synchronized according to the descriptor of the tensor data to be synchronized.

### Claim 15 (depends on 14)

The data synchronization method of claim 14, wherein the descriptor synchronization instruction includes the content of the descriptor of the tensor data to be synchronized, and the obtaining the tensor data to be synchronized according to the descriptor of the tensor data to be synchronized includes:
obtaining the tensor data to be synchronized from a shared storage space according to the content of the descriptor of the tensor data to be synchronized.

### Claim 16 (depends on 14)

The data synchronization method of claim 14, wherein the descriptor synchronization instruction includes an address of the content of the descriptor of the tensor data to be synchronized in a storage space of synchronized data, and the obtaining the tensor data to be synchronized according to the descriptor of the tensor data to be synchronized includes:
obtaining the content of the descriptor of the tensor data to be synchronized from the storage space of synchronized data according to the address of the content of the descriptor of the tensor data to be synchronized in the storage space of synchronized data; and
obtaining the tensor data to be synchronized from a shared storage space according to the content of the descriptor of the tensor data to be synchronized.

### Claim 17

An artificial intelligence chip, comprising:
a first processor configured to generate a descriptor synchronization instruction according to a descriptor of tensor data to be synchronized, wherein the descriptor indicates a shape of the tensor data to be synchronized, and the descriptor synchronization instruction includes an identifier of the descriptor or content of the descriptor; and
a second processor configured to parse the descriptor synchronization instruction received from the first processor to obtain the descriptor of tensor data to be synchronized and obtain the tensor data to be synchronized according to the descriptor of the tensor data.

### Claim 18 (depends on 17)

The artificial intelligence chip of claim 17, wherein
the second processor is further configured to generate a descriptor synchronization request instruction, wherein the descriptor synchronization request instruction is used to instruct the first processor to send the descriptor of the tensor data to be synchronized according to the descriptor synchronization request instruction, wherein the descriptor synchronization request instruction includes the identifier of the descriptor, and
the first processor is further configured to parse the descriptor synchronization request instruction received from the second processor to obtain the identifier of the descriptor and determine the descriptor of the tensor data to be synchronized according to the identifier of the descriptor.

### Claim 19

A board card, comprising:
a storage device configured to store data;
an artificial intelligence chip of 17;
an interface apparatus configured to implement data transmission between the artificial intelligence chip and an external equipment; and
a control device configured to monitor state of the artificial intelligence chip.

### Claim 20 (depends on 19)

The board card of claim 19, wherein
the storage device includes a plurality of groups of storage units, wherein each group of the storage units is connected with the artificial intelligence chip by a bus, and the storage units are DDR SDRAM,
the artificial intelligence chip includes a DDR controller configured to control data transmission and data storage of each storage unit, and
the interface apparatus is a standard PCIE interface.
