IP Library Granted Patent US 12,124,939
Granted Patent B1
US 12,124,939 · App. 17/199,221 · Granted Oct 22, 2024

Generation of machine-trained network instructions

Inventors: Justin Tantiongloc (San Jose, CA); Brian Thomas (Vancouver, CA); Steven L. Teig (Menlo Park, CA)
Assignee: PERCEIVE CORPORATION
G06N3/048G06F9/4881G06F9/5016G06F18/2163G06N3/063G06F2209/5017G06F2209/506
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,124,939
App. No.
17/199,221
Granted
Oct 22, 2024
Kind
B1
Abstract

Some embodiments provide a method for generating neural network program instructions for a neural network inference circuit to execute a neural network. The neural network inference circuit includes a particular amount of available memory. The method receives a specification of the neural network including multiple layers. The method determines (i) a required amount of weight memory for the neural network and (ii) required amounts of activation memory for each of a set of layers of the neural network. When the required amount of weight memory and the required amount of activation memory for at least one layer is greater than the particular amount of available memory, the method generates the program instructions for the neural network inference circuit to execute a first set of the layers of the neural network multiple times for different blocks of input data and execute a second set of the layers in a single pass.

Claims (54)

1. A method for generating neural network program instructions for a neural network inference circuit to execute a neural network, the neural network inference circuit comprising a particular amount of available memory, the method comprising:

receiving a specification of the neural network comprising a plurality of layers;

determining (i) a required amount of weight memory for the neural network based on (1) a number of filters in the neural network and (2) a percentage of the weights of the neural network that are non-zero and (ii) required amounts of activation memory for each of a set of layers of the neural network, wherein the weights of the neural network are ternary weight values such that each weight is encoded in the memory of the neural network inference circuit as one of zero, a positive value for the weight, and a negation of the positive value for the weight; and

when the required amount of weight memory and the required amount of activation memory for at least one layer is greater than the particular amount of available memory, generating the neural network program instructions for the neural network inference circuit to execute a first set of the layers of the neural network multiple times for different blocks of input data and execute a second set of the layers in a single pass.

2. The method of claim 1 , wherein:

the weights of the neural network are loaded into the memory at bootup of the neural network inference circuit such that the required amount of weight memory is used by the weights during the entire execution of the neural network by the neural network inference circuit; and

activation values computed for each layer of the neural network are only stored in memory during a subset of the layers of the neural network.

3. The method of claim 1 , wherein generating the neural network program instructions comprises:

determining a number of blocks into which the input data is divided, wherein the number of times the first set of layers of the neural network is executed is equal to the number of blocks; and

determining each of the blocks within the input data.

4. The method of claim 3 , wherein:

the input data is arranged as a set of channels;

each channel comprises an equally-sized grid of input values arranged in rows and columns; and

determining the blocks comprises dividing the grids of input values into blocks of rows such that each block comprises input values from a block of rows of input values across all of the channels of input data.

5. The method of claim 1 , wherein generating the neural network program instructions comprises generating instructions for the neural network inference circuit to execute each of the layers in the first set of layers multiple times.

6. The method of claim 5 , wherein:

each respective instruction for executing a first layer of the network uses input data from a different respective memory location; and

each respective instruction for executing a last layer of the first set of layers stores output activation values in a different respective memory location.

7. The method of claim 6 , wherein each respective instruction for other layers of the first set of layers uses input activation values from a same first memory location and stores output activation values to a same second memory location.

8. A method for generating neural network program instructions for a neural network inference circuit to execute a neural network, the neural network inference circuit comprising a particular amount of available memory, the method comprising:

receiving a specification of the neural network comprising a plurality of layers;

determining (i) a required amount of weight memory for the neural network and (ii) required amounts of activation memory for each of a set of layers of the neural network; and

when the required amount of weight memory and the required amount of activation memory for at least one layer is greater than the particular amount of available memory, generating the neural network program instructions for the neural network inference circuit to execute a first set of the layers of the neural network multiple times for different blocks of input data and execute a second set of the layers in a single pass by (i) determining a number of blocks into which the input data is divided, wherein the number of times the first set of layers of the neural network is executed is equal to the number of blocks and (ii) determining each of the blocks within the input data,

wherein:

the input data is arranged as a set of channels;

each channel comprises an equally-sized grid of input values arranged in rows and columns; and

determining the blocks comprises:

dividing the grids of input values into blocks of rows such that each block comprises input values from a block of rows of input values across all of the channels of input data; and

computing an overlap between pairs of contiguous blocks of input data such that a subset of the rows of input values belong to two different blocks.

9. The method of claim 8 , wherein the required amount of memory is based on (i) a number of filters in the neural network and (ii) a percentage of the weights of the neural network that are non-zero.

10. The method of claim 9 , wherein the weights of the neural network are ternary weight values such that each weight is encoded in the memory of the neural network inference circuit as one of {0, 1, −1}.

11. The method of claim 8 , wherein computing the overlap comprises determining a receptive field within the input data for an activation value within a last layer of the first portion of the network.

12. A non-transitory machine-readable medium storing a program which when executed by at least one processing unit generates neural network program instructions for a neural network inference circuit to execute a neural network, the neural network inference circuit comprising a particular amount of available memory, the program comprising sets of instructions for:

receiving a specification of the neural network comprising a plurality of layers;

determining (i) a required amount of weight memory for the neural network based on (1) a number of filters in the neural network and (2) a percentage of the weights of the neural network that are non-zero and (ii) required amounts of activation memory for each of a set of layers of the neural network, wherein the weights of the neural network are ternary weight values such that each weight is encoded in the memory of the neural network inference circuit as one of zero, a positive value for the weight, and a negation of the positive value for the weight; and

when the required amount of weight memory and the required amount of activation memory for at least one layer is greater than the particular amount of available memory, generating the neural network program instructions for the neural network inference circuit to execute a first set of the layers of the neural network multiple times for different blocks of input data and execute a second set of the layers in a single pass.

13. The non-transitory machine-readable medium of claim 12 , wherein:

the weights of the neural network are loaded into the memory at bootup of the neural network inference circuit such that the required amount of weight memory is used by the weights during the entire execution of the neural network by the neural network inference circuit; and

activation values computed for each layer of the neural network are only stored in memory during a subset of the layers of the neural network.

14. The non-transitory machine-readable medium of claim 12 , wherein the set of instructions for generating the neural network program instructions comprises:

determining a number of blocks into which the input data is divided, wherein the number of times the first set of layers of the neural network is executed is equal to the number of blocks; and

determining each of the blocks within the input data.

15. The non-transitory machine-readable medium of claim 14 , wherein:

the input data is arranged as a set of channels;

each channel comprises an equally-sized grid of input values arranged in rows and columns; and

the set of instructions for determining the blocks comprises a set of instructions for dividing the grids of input values into blocks of rows such that each block comprises input values from a block of rows of input values across all of the channels of input data.

16. The non-transitory machine-readable medium of claim 15 , wherein:

the set of instructions for determining the blocks further comprises a set of instructions for computing an overlap between pairs of contiguous blocks of input data such that a subset of the rows of input values belong to two different blocks; and

the set of instructions for computing the overlap comprises a set of instructions for determining a receptive field within the input data for an activation value within a last layer of the first portion of the network.

17. The non-transitory machine-readable medium of claim 12 , wherein the set of instructions for generating the neural network program instructions comprises a set of instructions for generating instructions for the neural network inference circuit to execute each of the layers in the first set of layers multiple times.

18. The non-transitory machine-readable medium of claim 17 , wherein:

each respective instruction for executing a first layer of the network uses input data from a different respective memory location;

each respective instruction for executing a last layer of the first set of layers stores output activation values in a different respective memory location; and

each respective instruction for other layers of the first set of layers uses input activation values from a same first memory location and stores output activation values to a same second memory location.

Assignments (3)
BILL OF SALE Recorded Oct 31, 2024
From: AMAZON.COM SERVICES LLC
To: AMAZON TECHNOLOGIES, INC.
Reel/Frame 069288/0490 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 31, 2024
From: PERCEIVE CORPORATION
To: AMAZON.COM SERVICES LLC
Reel/Frame 069288/0731 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 23, 2021
From: TANTIONGLOC, JUSTIN; THOMAS, BRIAN; TEIG, STEVEN L.
To: PERCEIVE CORPORATION
Reel/Frame 056321/0329 →
Continuity (1)
Provisional Application 63117976 · Nov 24, 2020
Cited By (1)
US 12,664,570