# US 2022/0292334 A1 · Efficient memory use optimization for neural network deployment and execution

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

- Number: US 2022/0292334 A1
- Document ID: US20220292334A1
- Status: Published application
- Kind: A1
- Application number: 17/513,684
- Filed: 2021-10-28
- Published: 2022-09-15
- Earliest claimed: 2021-03-12
- Assignees: Cypress Semiconductor Corporation
- Applicants: Cypress Semiconductor Corporation
- Inventors: Ashutosh Pandey; Kaiping Li; Vijay Deep Bhatt; Vikram Kumar Ramanna
- Web page: https://patentgrep.com/patent/US20220292334A1

## CPC

- G06N 3/063: using electronic means
- G06N 3/045: Combinations of networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/09: Supervised learning
- G06N 20/10: using kernel methods, e.g. support vector machines [SVM]
- G06N 3/08: Learning methods
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Implementations disclosed describe methods and systems to perform the methods of deploying and executing machine learning models on target-specific computational platforms. Optimization techniques include but are not limited to alignment of kernel operations with hardware instructions of a target processing device, reduction of kernel dimensions near boundaries of data, efficient reuse of a small number of memory components during neural network operations, run-time quantization of data and neural network parameters, and other methods.

## Claims

### Claim 1

A method to run a machine-learning model (MLM), the method comprising:
computing, by a processing device, a first output of a first neuron layer of the MLM;
storing, by the processing device, the first output in a first plurality of memory locations;
computing, by the processing device, a second output of a second neuron layer of the MLM;
storing, by the processing device, the second output in a second plurality of memory locations;
computing, by the processing device, a third output of a third neuron layer of the MLM; and
storing, by the processing device, the third output in the first plurality of memory locations.

### Claim 2 (depends on 1)

The method of claim 1, wherein an input into the second neuron layer of the MLM comprises the first output and an input into the third neuron layer of the MLM comprises the second output.

### Claim 3 (depends on 1)

The method of claim 1, wherein the first plurality of memory locations are in a first memory buffer and the second plurality of memory locations are in a second memory buffer different from the first memory buffer.

### Claim 4 (depends on 3)

The method of claim 3, wherein a size of the first memory buffer is sufficient to store an output of any one of odd-numbered neuron layers of the MLM, the odd-numbered neuron layers of the MLM comprising the first neuron layer and the third neuron layer.

### Claim 5 (depends on 3)

The method of claim 3, wherein a size of the second memory buffer is sufficient to store an output of any one of even-numbered neuron layers of the MLM, the even-numbered neuron layers of the MLM comprising the second neuron layer.

### Claim 6 (depends on 1)

The method of claim 1, wherein the first plurality of memory locations and the second plurality of memory locations are in a same memory buffer.

### Claim 7 (depends on 6)

The method of claim 6, wherein the same memory buffer is a cache buffer located on a processor chip of the processing device.

### Claim 8

A method comprising:
performing, by a processing device, a first kernel operation of a plurality of kernel operations of a machine-learning model, each of the plurality of kernel operations comprising an application of a kernel to a respective portion of a plurality of portions of data, wherein the first kernel operation is applied to a first portion of data of the plurality of portions of data, the first portion of data stored in a first set of memory locations;
selecting, by the processing device, a subset of the first set of memory locations storing values of the data that are not used in subsequent kernel operations of the plurality of kernel operations; and
storing, by the processing device, an output of the first kernel operation in the selected subset of the first set of memory locations.

### Claim 9 (depends on 8)

The method of claim 8, wherein the plurality of portions of data are non-overlapping.

### Claim 10 (depends on 8)

The method of claim 8, wherein the application of the kernel to the respective portion of a plurality of portions of data comprises selecting at least one of: i) a maximum value within the respective portion of data or ii) an average value within the respective portion of data.

### Claim 11 (depends on 8)

The method of claim 8, wherein at least some of the plurality of portions of data are overlapping.

### Claim 12 (depends on 8)

The method of claim 8, wherein the application of the kernel to the respective portion of a plurality of portions of data comprises computing a convolution of the respective portion of data with the kernel.

### Claim 13 (depends on 8)

The method of claim 8, wherein the first set of memory locations is in a cache buffer located on a processor chip of the processing device.

### Claim 14

A system comprising:
a memory subsystem; and
a processing device communicatively coupled to the memory subsystem, the processing device to:
compute a first output of a first neuron layer of a machine-learning model (MLM);
store the first output in a first plurality of memory locations of the memory subsystem;
compute a second output of a second neuron layer of the MLM;
store the second output in a second plurality of memory locations of the memory subsystem;
compute a third output of a third neuron layer of the MLM; and
store the third output in the first plurality of memory locations.

### Claim 15 (depends on 14)

The system of claim 14 wherein an input into the second neuron layer of the MLM comprises the first output and an input into the third neuron layer of the MLM comprises the second output.

### Claim 16 (depends on 14)

The system of claim 14, wherein the first plurality of memory locations are in a first memory buffer of the memory subsystem and the second plurality of memory locations are in a second memory buffer of the memory subsystem, the second memory buffer different from the first memory buffer.

### Claim 17 (depends on 16)

The system of claim 16, wherein a size of the first memory buffer is sufficient to store an output of any one of odd-numbered neuron layers of the MLM, the odd-numbered neuron layers of the MLM comprising the first neuron layer and the third neuron layer.

### Claim 18 (depends on 16)

The system of claim 16, wherein a size of the second memory buffer is sufficient to store an output of any one of even-numbered neuron layers of the MLM, the even-numbered neuron layers of the MLM comprising the second neuron layer.

### Claim 19 (depends on 18)

The system of claim 18, wherein the first plurality of memory locations and the second plurality of memory locations are in a same memory buffer.

### Claim 20 (depends on 19)

The system of claim 19, wherein the same memory buffer is a cache buffer located on a processor chip of the processing device.
