# US 11,442,786 B2 · Computation method and product thereof

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

- Number: US 11,442,786 B2
- Document ID: US11442786B2
- Status: Granted
- Kind: B2
- Application number: 16/720,171
- Filed: 2019-12-19
- Published: 2020-05-21
- Granted: 2022-09-13
- Earliest claimed: 2018-05-18
- Assignees: Shanghai Cambricon Information Technology Co., Ltd.
- Applicants: Shanghai Cambricon Information Technology Co., Ltd
- Inventors: Shaoli Liu; Xishan Zhang
- Web page: https://patentgrep.com/patent/US11442786B2

## CPC

- G06F 9/5061: {Partitioning or combining of resources}
- G06F 9/30109: {having multiple operands in a single register}
- G06F 9/30145: {Instruction analysis, e.g. decoding, instruction word fields}
- G06F 9/3802: {Instruction prefetching}
- G06F 9/3851: {from multiple instruction streams, e.g. multistreaming}
- G06F 9/3888: {controlled by a single instruction for multiple threads [SIMT] in parallel}
- G06F 9/5011: {the resources being hardware resources other than CPUs, Servers and Terminals}
- G06F 9/5038: {considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration (scheduling strategies G06F9/4881 and subgroups)}
- G06F 9/5066: {Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs (mappping at compile time, see G06F8/451)}
- G06F 9/546: {Message passing systems or structures, e.g. queues}
- G06N 3/044: Recurrent networks, e.g. Hopfield networks
- G06N 3/045: Combinations of networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/048: Activation functions
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/063: using electronic means
- G06N 3/08: Learning methods
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 3/09: Supervised learning
- G06N 20/10: using kernel methods, e.g. support vector machines [SVM]
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

The present disclosure provides a computation method and product thereof. The computation method adopts a fusion method to perform machine learning computations. Technical effects of the present disclosure include fewer computations and less power consumption.

## Claims

### Claim 1

A neural network operation module configured to perform operations of a multi-layer neural network, comprising:
a storage unit configured to store input neuron precision, weight precision, and output neuron gradient precision;
a controller unit configured to obtain input neuron precision Sx(l), weight precision Sw(l), and output neuron gradient precision S∇x(l) of an Lth layer of the multi-layer neural network, wherein L is an integer greater than 0; obtain gradient update precision T according to the input neuron precision Sx(l), the weight precision Sw(l), and the output neuron gradient precision S∇x(l); and if the gradient update precision T is greater than preset precision Tr, adjust the input neuron precision Sx(l), the weight precision Sw(l), and the output neuron gradient precision S∇x(l) to minimize an absolute value of a difference between the gradient update precision T and the preset precision Tr;
wherein the controller unit is further configured to obtain the preset precision Tr according to a method of machine learning; and
an operating unit configured to represent an output neuron and a weight of the Lth layer according to the adjusted input neuron precision Sx(l) and the adjusted weight precision Sw(l) and represent an output neuron gradient of the Lth layer obtained from computations according to the adjusted output neuron gradient precision S∇x(l) for subsequent computations;
wherein obtaining, by the controller unit, gradient update precision T according to the input neuron precision Sx(l), the weight precision Sw(l), and the output neuron gradient precision S∇x(l) includes:
the controller unit performs computations on the input neuron precision Sx(l), the weight precision Sw(l), and the output neuron gradient precision S∇x(l) according to a preset formula to obtain the gradient update precision T, wherein
the preset formula is: T=Sx(l)+S∇x(l)−Sw(l).

### Claim 2 (depends on 1)

The module of claim 1, wherein adjusting, by the controller unit, the input neuron precision Sx(l), the weight precision Sw(l), and the output neuron gradient precision S∇x(l) includes:
the controller unit keeps the input neuron precision Sx(l) and the weight precision Sw(l) unchanged, and decreases the output neuron gradient precision S∇x(l).

### Claim 3 (depends on 2)

The module of claim 2, wherein when the controller unit decreases the output neuron gradient precision S∇x(l), the controller unit increases a bit width of a fixed point data format representing the output neuron gradient.

### Claim 4 (depends on 3)

The module of claim 3, wherein the increasing, by the controller unit, of the bit width of the fixed point data format representing the output neuron gradient includes:
the controller unit increases the bit width of the fixed point data format representing the output neuron gradient according to a first preset stride N1,
wherein the first preset stride N1 can be any positive integer.

### Claim 5 (depends on 3)

The module of claim 3, wherein the increasing, by the controller unit, of the bit width of the fixed point data format representing the output neuron gradient includes:
the controller unit increases the bit width of the fixed point data format representing the output neuron gradient with an increment of 2.

### Claim 6 (depends on 2)

The module of claim 2, wherein after the controller unit decreases the output neuron gradient precision S∇x(l), the controller unit is further configured to:
determine whether the output neuron gradient overflows when the output neuron gradient is represented by the fixed point data format, and
if the output neuron gradient overflows, increase the bit width of the fixed point data format representing the output neuron gradient.

### Claim 7 (depends on 1)

The module of claim 1, wherein the controller unit is further configured to:
obtain the preset precision Tr according to a count of output neurons, a learning rate, and a count of samples during batch processing of an L−1th layer, wherein the greater the count of output neurons, the count of samples during batch processing, and the learning rate of the L−1th layer are, the greater the preset precision Tr is.

### Claim 8

A neural network operation method, comprising:
obtaining input neuron precision Sx(l), weight precision Sw(l), and output neuron gradient precision S∇x(l) of an Lth layer of a neural network;
obtaining gradient update precision T by performing computations according to the input neuron precision Sx(l), the weight precision Sw(l), and the output neuron gradient precision S∇x(l);
if the gradient update precision T is greater than preset precision Tr, adjusting the input neuron precision Sx(l), the weight precision Sw(l), and the output neuron gradient precision S∇x(l) to minimize an absolute value of a difference between the gradient update precision T and the preset precision Tr;
obtaining the preset precision Tr according to a method of machine learning; and
representing an output neuron and a weight of the Lth layer according to the adjusted input neuron precision Sx(l) and the weight precision Sw(l); and representing an output neuron gradient of the Lth layer obtained from computations according to the adjusted output neuron gradient precision S∇x(l) for subsequent computations;
wherein obtaining the gradient update precision T by performing computations according to the input neuron precision Sx(l), the weight precision Sw(l), and the output neuron gradient precision S∇x(l) includes:
performing computations on the input neuron precision Sx(l), the weight precision Sw(l), and the output neuron gradient precision S∇x(l) according to a preset formula to obtain the gradient update precision T,
wherein the preset formula is: T=Sx(l)+S∇x(l)−Sw(l).

### Claim 9 (depends on 8)

The method of claim 8, wherein the adjusting of the input neuron precision Sx(l), the weight precision Sw(l), and the output neuron gradient precision S∇x(l) includes:
keeping the input neuron precision Sx(l) and the weight precision Sw(l) unchanged, and decreasing the output neuron gradient precision S∇x(l).

### Claim 10 (depends on 9)

The method of claim 9, wherein when decreasing the output neuron gradient precision S∇x(l), the method further includes increasing a bit width of a fixed point data format representing the output neuron gradient.

### Claim 11 (depends on 10)

The method of claim 10, wherein the increasing of the bit width of the fixed point data format representing the output neuron gradient includes:
increasing the bit width of the fixed point data format representing the output neuron gradient according to a first preset stride N1,
wherein the first preset stride N1 can be any positive integer.

### Claim 12 (depends on 10)

The method of claim 10, wherein the increasing of the bit width of the fixed point data format representing the output neuron gradient includes:
increasing the bit width of the fixed point data format representing the output neuron gradient with an increment of 2.

### Claim 13 (depends on 9)

The method of claim 9, after decreasing the output neuron gradient precision S∇x(l), further comprising:
determining whether the output neuron gradient overflows when the output neuron gradient is represented by the fixed point data format, and
if the output neuron gradient overflows, increasing the bit width of the fixed point data format representing the output neuron gradient.

### Claim 14 (depends on 8)

The method of claim 8, further comprising:
obtaining the preset precision Tr according to a count of output neurons, a learning rate, and a count of samples during batch processing of an L−1th layer, wherein the greater the count of output neurons, the count of samples during batch processing, and the learning rate of the L−1th layer are, the greater the preset precision Tr is.
