# US 2025/0148042 A1 · Optimizing functions for target processors by searching through candidate computer programs

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

- Number: US 2025/0148042 A1
- Document ID: US20250148042A1
- Status: Published application
- Kind: A1
- Application number: 18/940,773
- Filed: 2024-11-07
- Published: 2025-05-08
- Earliest claimed: 2023-11-07
- Assignees: Google Inc.
- Applicants: Google LLC
- Inventors: Esteban Alberto Real; Mirko Rossini; Connal Joseph de Souza; Manav Garg
- Web page: https://patentgrep.com/patent/US20250148042A1

## CPC

- G06F 17/11: for solving equations {, e.g. nonlinear equations, general mathematical optimization problems (optimization specially adapted for a specific administrative, business or logistic context G06Q10/04)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for optimizing a target function for execution on a target processor. In particular, the target function is optimized by searching through candidate computer programs that each represent an approximation of the target function.

## Claims

### Claim 1

A method performed by one or more computers, the method comprising:
obtaining data specifying a target function to be optimized for execution on a target processor, the data specifying the target function comprising:
a plurality of training examples that each comprise an input to the target function and a target output of the target function, and
a plurality of validation examples that each comprise an input to the target function and a target output of the target function; and
generating a computer program that represents an optimized version of the target function that is optimized for execution on the target processor, the computer program being represented as a computational graph comprising a plurality of vertices and edges, the plurality of vertices comprising a plurality of internal vertices that each represent an instruction selected from a set of instructions for the target processor and a plurality of external vertices that include an input vertex that represents an input to the target function, one or more coefficient vertices that each represent a respective coefficient, and an output vertex that represents an output of the target function, the generating comprising repeatedly performing search operations comprising:
generating a new candidate computational graph representing a new candidate computer program, the new candidate computational graph comprising a respective plurality of candidate vertices and candidate edges;
optimizing the new candidate computational graph using the plurality of training examples to determine optimized values for one or more coefficients represented by one or more coefficient vertices included in the respective plurality of candidate vertices;
determining a precision of the new candidate computer program on the plurality of validation examples when the one or more coefficients have the optimized values;
determining a measure of performance of executing the new candidate computer program on the target processor; and
adding data specifying the new candidate computational graph, the precision of the new candidate computer program, and the performance of executing the new candidate computer program to a population of candidate computer programs.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
causing the target processor to execute the computer program to perform the target algorithm.

### Claim 3 (depends on 1)

The method of claim 1, wherein generating a computer program that represents an optimized version of the target function that is optimized for execution on the target processor further comprises:
after repeatedly performing the operations, selecting the computer program from the population based on the performances and precisions of the candidate computer programs in the population.

### Claim 4 (depends on 1)

The method of claim 1, wherein generating a new candidate computational graph representing a new candidate computer program comprises:
selecting a candidate computer program from the population; and
modifying a computational graph representing the selected candidate computer program.

### Claim 5 (depends on 4)

The method of claim 4, wherein modifying a computational graph representing the selected candidate computer program comprises:
breaking an existing edge in the computational graph representing the selected candidate computer program and inserting a new vertex into the computational graph.

### Claim 6 (depends on 4)

The method of claim 4, wherein modifying a computational graph representing the selected candidate computer program comprises:
deleting an existing vertex in the computational graph representing the selected candidate computer program.

### Claim 7 (depends on 4)

The method of claim 4, wherein modifying a computational graph representing the selected candidate computer program comprises:
modifying an existing edge in the computational graph representing the selected candidate computer program to connect the existing edge to a different vertex in the computational graph representing the selected candidate computer program.

### Claim 8 (depends on 1)

The method of claim 1, wherein generating a new candidate computational graph representing a new candidate computer program further comprises:
after modifying a computational graph representing the selected candidate computer program, pruning the computational graph representing the selected candidate computer program to remove any vertices that are no longer on a path from a vertex representing the input to the target function to a vertex representing an output of the target function.

### Claim 9 (depends on 4)

The method of claim 4, wherein selecting a candidate computer program from the population comprises:
selecting a candidate computer program from the population based on the precisions and performances of the computer programs in the population.

### Claim 10 (depends on 9)

The method of claim 9, wherein selecting a candidate computer program from the population based on the precisions and performances of the computer programs in the population comprises:
applying an evolutionary search selection algorithm to the candidate computer programs from the population.

### Claim 11 (depends on 1)

The method of claim 1, wherein the target processor is a central processing unit (CPU).

### Claim 12 (depends on 1)

The method of claim 1, wherein the target processor is an ASIC.

### Claim 13 (depends on 1)

The method of claim 1, wherein the search operations are repeatedly performed asynchronously by a plurality of worker devices.

### Claim 14 (depends on 10, 13)

The method of claim 13, when dependent on claim 10, wherein the evolutionary search algorithm is a distributed evolutionary search algorithm that partitions candidate computer programs into a plurality of fronts.

### Claim 15 (depends on 1)

The method of claim 1, wherein optimizing the new candidate computational graph using the plurality of training examples to determine optimized values for one or more coefficients represented by one or more coefficient vertices included in the respective plurality of candidate vertices comprises:
compiling, using a compiler for the target processor, the new candidate computational graph to generate a compiled program; and
determining optimized values for the one or more coefficients by optimizing a precision of the compiled program.

### Claim 16 (depends on 1)

The method of claim 1, wherein determining a precision of the new candidate computer program on the plurality of validation examples when the one or more coefficients have the optimized values comprises:
compiling, using a compiler for the target processor, the new candidate computational graph bound with the optimized values of the one or more coefficients to generate an optimized compiled program; and
determining a precision of the optimized compiled program on the plurality of validation examples.

### Claim 17 (depends on 16)

The method of claim 16, wherein determining a measure of performance of executing the new candidate computer program on the target processor comprises:
measuring a speed or a latency of the optimized compiled program when processing the plurality of validation examples.

### Claim 18

A system comprising:
one or more computers; and
one or more storage devices storing instructions that, when executed by the one or more computers, cause the one or more computers to perform operations comprising:
obtaining data specifying a target function to be optimized for execution on a target processor, the data specifying the target function comprising:
a plurality of training examples that each comprise an input to the target function and a target output of the target function, and
a plurality of validation examples that each comprise an input to the target function and a target output of the target function; and
generating a computer program that represents an optimized version of the target function that is optimized for execution on the target processor, the computer program being represented as a computational graph comprising a plurality of vertices and edges, the plurality of vertices comprising a plurality of internal vertices that each represent an instruction selected from a set of instructions for the target processor and a plurality of external vertices that include an input vertex that represents an input to the target function, one or more coefficient vertices that each represent a respective coefficient, and an output vertex that represents an output of the target function, the generating comprising repeatedly performing search operations comprising:
generating a new candidate computational graph representing a new candidate computer program, the new candidate computational graph comprising a respective plurality of candidate vertices and candidate edges;
optimizing the new candidate computational graph using the plurality of training examples to determine optimized values for one or more coefficients represented by one or more coefficient vertices included in the respective plurality of candidate vertices;
determining a precision of the new candidate computer program on the plurality of validation examples when the one or more coefficients have the optimized values;
determining a measure of performance of executing the new candidate computer program on the target processor; and
adding data specifying the new candidate computational graph, the precision of the new candidate computer program, and the performance of executing the new candidate computer program to a population of candidate computer programs.

### Claim 19

One or more non-transitory computer-readable storage media storing instructions that when executed by one or more computers cause the one or more computers to perform operations comprising:
obtaining data specifying a target function to be optimized for execution on a target processor, the data specifying the target function comprising:
a plurality of training examples that each comprise an input to the target function and a target output of the target function, and
a plurality of validation examples that each comprise an input to the target function and a target output of the target function; and
generating a computer program that represents an optimized version of the target function that is optimized for execution on the target processor, the computer program being represented as a computational graph comprising a plurality of vertices and edges, the plurality of vertices comprising a plurality of internal vertices that each represent an instruction selected from a set of instructions for the target processor and a plurality of external vertices that include an input vertex that represents an input to the target function, one or more coefficient vertices that each represent a respective coefficient, and an output vertex that represents an output of the target function, the generating comprising repeatedly performing search operations comprising:
