# US 2019/0171454 A1 · Apparatus and methods for vector operations

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

- Number: US 2019/0171454 A1
- Document ID: US20190171454A1
- Status: Published application
- Kind: A1
- Application number: 16/250,148
- Filed: 2019-01-17
- Published: 2019-06-06
- Earliest claimed: 2016-04-26
- Assignees: Cambricon Technologies Corporation Limited
- Applicants: Cambricon Technologies Corporation Limited
- Inventors: Tao Luo; Tian Zhi; Shaoli Liu; Tianshi Chen; Yunji Chen
- Web page: https://patentgrep.com/patent/US20190171454A1

## CPC

- G06F 9/30029: {Logical and Boolean instructions, e.g. XOR, NOT}
- G06F 9/3838: {Dependency mechanisms, e.g. register scoreboarding}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 9/3004: {to perform operations on memory}
- G06F 9/30043: {LOAD or STORE instructions; Clear instruction}
- G06N 3/02: Neural networks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Aspects for vector operations in neural network are described herein. The aspects may include a vector caching unit configured to store a first vector and a second vector, wherein the first vector includes one or more first elements and the second vector includes one or more second elements. The aspects may further include a computation module that includes one or more bitwise processors and a combiner. The bitwise processors may be configured to perform bitwise operations between each of the first elements and a corresponding one of the second elements to generate one or more operation results. The combiner may be configured to combine the one or more operation results into an output vector.

## Claims

### Claim 1

An apparatus for vector operations in a neural network, comprising:
a controller unit configured to receive a vector bitwise operation instruction that indicates a first address of the first vector and a second address of a second vector; and
a computation module configured to receive the first vector and the second vector based on the first address and the second address in response to the vector bitwise operation instruction, wherein the first vector includes one or more first elements and the second vector includes one or more second elements, and wherein the computation module includes:
one or more bitwise processors configured to perform bitwise operations between each of the first elements and a corresponding one of the second elements to generate one or more operation results, and
a combiner configured to combine the one or more operation results into an output vector.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the vector bitwise operation instruction includes one or more register IDs that identify one or more registers configured to store the first address of the first vector, the second address of the second vector, a length of the first vector, and a length of the second vector.

### Claim 3 (depends on 1)

The apparatus of claim 1, further comprising one or more registers configured to store a length of the first vector and a length of the second vector.

### Claim 4 (depends on 3)

The apparatus of claim 3, further comprising a direct memory access unit configured to retrieve the first vector and the second vector from a storage device based on the starting address of the first vector, the length of the first vector, the starting address of the second vector, and the length of the second vector.

### Claim 5 (depends on 1)

The apparatus of claim 1, wherein the one or more bitwise processors are configured to perform a logical AND operation between each of the first elements and a corresponding one of the second elements to generate the one or more operation results when the vector bitwise operation instruction includes an operation code that indicates an AND operation between the first vector and the second vector.

### Claim 6 (depends on 1)

The apparatus of claim 1, wherein the one or more bitwise processors are configured to perform a logical OR operation between each of the first elements and a corresponding one of the second elements to generate the one or more operation results when the vector bitwise operation instruction includes an operation code that indicates an OR operation between the first vector and the second vector.

### Claim 7

An apparatus for vector operations in a neural network, comprising:
a controller unit configured to receive a vector bitwise operation instruction that includes an address of a vector;
a computation module configured to receive the vector that includes one or more elements based on the address of the vector included in the vector bitwise operation instruction, wherein the computation module includes one or more bitwise processors configured to perform bitwise operations to the one or more elements to generate an output result.

### Claim 8 (depends on 7)

The apparatus of claim 7, wherein the vector bitwise operation instruction includes one or more register IDs that identify one or more registers configured to store the address of the vector and a length of the vector.

### Claim 9 (depends on 7)

The apparatus of claim 7, further comprising one or more registers configured to store a length of the first vector.

### Claim 10 (depends on 9)

The apparatus of claim 9, further comprising a direct memory access unit configured to retrieve the vector from a storage device based on the starting address of the vector and the length of the first vector.

### Claim 11 (depends on 7)

The apparatus of claim 7, wherein the one or more bitwise processors are configured to perform a logical AND operation to the one or more elements in the vector to generate the output result when the vector bitwise operation instruction includes an operation code that indicates an AND operation between the elements of the vector.

### Claim 12 (depends on 7)

The apparatus of claim 7, wherein the one or more bitwise processors are configured to perform a logical OR operation to the one or more elements in the vector to generate the output result when the vector bitwise operation instruction includes an operation code that indicates an OR operation between the elements of the vector.

### Claim 13

A method for vector operations in a neural network, comprising:
receiving, by a controller unit, a vector bitwise operation instruction that indicates a first address of the first vector and a second address of a second vector;
receiving, by a computation module, the first vector and the second vector based on the first address and the second address in response to the vector bitwise operation instruction, wherein the first vector includes one or more first elements and the second vector includes one or more second elements;
performing, by one or more bitwise processors of the computation module, bitwise operations between each of the first elements and a corresponding one of the second elements to generate one or more operation results; and
combining, by a combiner of the computation module, the one or more operation results into an output vector.

### Claim 14 (depends on 13)

The method of claim 13, wherein the vector bitwise operation instruction includes one or more register IDs that identify one or more registers configured to store the first address of the first vector, the second address of the second vector, a length of the first vector, and a length of the second vector.

### Claim 15 (depends on 13)

The method of claim 13, further comprising storing, by one or more registers, a length of the first vector and a length of the second vector.

### Claim 16 (depends on 15)

The method of claim 15, further comprising retrieving, by a direct memory access unit, the first vector and the second vector from a storage device based on the starting address of the first vector, the length of the first vector, the starting address of the second vector, and the length of the second vector.

### Claim 17 (depends on 13)

The method of claim 13, further comprising performing, by the one or more bitwise processors, a logical AND operation between each of the first elements and a corresponding one of the second elements to generate the one or more operation results when the vector bitwise operation instruction includes an operation code that indicates an AND operation between the first vector and the second vector.

### Claim 18 (depends on 13)

The method of claim 13, further comprising performing, by the one or more bitwise processors, a logical OR operation between each of the first elements and a corresponding one of the second elements to generate the one or more operation results when the vector bitwise operation instruction includes an operation code that indicates an OR operation between the first vector and the second vector.

### Claim 19

A method for vector operations in a neural network, comprising:
receiving, by a controller unit, a vector bitwise operation instruction that includes an address of a vector;
receiving, by a computation module, the vector that includes one or more elements based on the address of the vector included in the vector bitwise operation instruction; and
performing, by one or more bitwise processors of the computation module, bitwise operations to the one or more elements to generate an output result.

### Claim 20 (depends on 19)

The method of claim 19, wherein the vector bitwise operation instruction includes one or more register IDs that identify one or more registers configured to store the address of the vector and a length of the vector.

### Claim 21 (depends on 19)

The method of claim 19, further comprising storing, by one or more registers a length of the first vector.

### Claim 22 (depends on 21)

The method of claim 21, further comprising retrieving, by a direct memory access unit, the vector from a storage device based on the starting address of the vector and the length of the first vector.

### Claim 23 (depends on 19)

The method of claim 19, wherein the performing bitwise operations further comprises performing, by the one or more bitwise processors, a logical AND operation to the one or more elements in the vector to generate the output result when the vector bitwise operation instruction includes an operation code that indicates an AND operation between the elements of the vector.

### Claim 24 (depends on 19)

The method of claim 19, wherein the performing bitwise operations further comprises performing, by the one or more bitwise processors, a logical OR operation to the one or more elements in the vector to generate the output result when the vector bitwise operation instruction includes an operation code that indicates an OR operation between the elements of the vector.
