# US 2026/0119137 A1 · Method and Device for Memory Scheduling for Code Generation for a Program Code for Computing an Artificial Neural Network in a Hardware Environment

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

- Number: US 2026/0119137 A1
- Document ID: US20260119137A1
- Status: Published application
- Kind: A1
- Application number: 19/366,004
- Filed: 2025-10-22
- Published: 2026-04-30
- Earliest claimed: 2024-10-24
- Assignees: Robert Bosch GmbH
- Applicants: Robert Bosch GmbH
- Inventors: Sebastian Boblest; Benjamin Wagner; Duy Khoi Vo; Leif Sulaiman; Markus Lochmann; Ulrik Hjort
- Web page: https://patentgrep.com/patent/US20260119137A1

## CPC

- G06F 8/35: model driven
- G06F 8/4442: {Reducing the number of cache misses; Data prefetching (cache prefetching G06F12/0862)}
- G06F 9/383: {Operand prefetching (cache prefetching G06F12/0862)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer-implemented method for performing memory scheduling for code generation to determine a code for computing a neural network in a hardware environment includes (i) providing successive computation steps of the neural network, wherein a plurality of the computation steps provide for the computation of a weight prefetching layer for which weight prefetching is applicable, (ii) assigning possible weight prefetching to at least a portion of the plurality of weight-prefetching layers in order to obtain multiple different combinations of weight-prefetching layers, wherein the weight prefetching provides for preloading of network parameters into a working memory of the hardware environment for the respective weight-prefetching layer, (iii) performing memory scheduling for the code to be generated for the plurality of different combinations, wherein the respective memory scheduling is carried out for the successive computation steps of the neural network while taking into account the respective combination of weight-prefetching layers for which weight prefetching is provided, wherein for each memory scheduling, for every computation step, the memory region of the respective input data block, output data block, and at least one network parameter block in the working memory is defined, and a maximum required memory space of the working memory is ascertained, and (iv) selecting one of the memory schedulings depending on the maximum required memory space of the working memory.

## Claims

### Claim 1

A computer-implemented method for performing memory scheduling for code generation to determine a code for computing a neural network in a hardware environment, comprising:
providing successive computation steps of the neural network, wherein a plurality of the computation steps provide for the computation of a weight prefetching layer for which weight prefetching is applicable;
assigning possible weight prefetching to at least a portion of the plurality of weight-prefetching layers in order to obtain multiple different combinations of weight-prefetching layers, wherein the weight prefetching provides for preloading of network parameters into a working memory of the hardware environment for the respective weight-prefetching layer;
performing memory scheduling for the code to be generated for the plurality of different combinations, wherein the respective memory scheduling is carried out for the successive computation steps of the neural network while taking into account the respective combination of weight-prefetching layers for which weight prefetching is provided, wherein for each memory scheduling, for every computation step, the memory region of the respective input data block, output data block, and at least one network parameter block in the working memory is defined, and a maximum required memory space of the working memory is ascertained; and
selecting one of the memory schedulings depending on the maximum required memory space of the working memory.

### Claim 2 (depends on 1)

The method according to claim 1, wherein performing the memory scheduling includes applying an optimization method in which the objective function takes into account minimization of the maximum required memory space in the working memory.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the selection of the memory scheduling is additionally carried out depending on a number of weight-prefetching layers for which weight prefetching is provided, wherein, in particular, that memory scheduling for which the number of weight-prefetching layers for which weight prefetching is provided is maximal, is selected.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the memory scheduling of that combination of weight-prefetching layers is selected in which, during memory scheduling, an increase in the maximum required memory space compared to the maximum required memory space in an implementation of a neural network without weight prefetching amounts to less than a predetermined relative proportion, and at the same time the number of weight-prefetching layers for which weight prefetching is provided is maximal.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the memory scheduling of that combination of weight-prefetching layers is selected from those combinations of weight-prefetching layers that lie on a Pareto curve of combinations of weight-prefetching layers for which weight prefetching is provided, wherein the Pareto curve indicates the lowest maximum required memory space with respect to a correspondingly shortest computation time for the computation of all computation steps.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the combinations of weight-prefetching layers further take into account tiling computation steps when tiling is provided for weight-prefetching layers suitable for tiling, in particular, for convolution layers, depthwise convolution layers, pooling layers, and all element-wise operating layers, with a plurality of possible tiling factors, such that for each combination of weight-prefetching layers and sequences of tiling computation steps determined by the tiling factor, for which weight prefetching is provided, a memory scheduling is carried out and a maximum required memory space of the working memory is determined.

### Claim 7 (depends on 1)

The method according to claim 1, wherein code generation for the hardware environment is performed based on the selected memory scheduling and the generated code is implemented therein.

### Claim 8 (depends on 1)

A device for carrying out the method according to claim 1.

### Claim 9 (depends on 1)

A computer program product comprising instructions which, when the program is executed by at least one data processing unit, cause said unit to carry out the steps of the method according to claim 1.

### Claim 10 (depends on 1)

A machine-readable storage medium comprising instructions which, when executed by at least one data processing unit, cause the data processing unit to perform the steps of the method according to claim 1.
