EP4537196A1 - Optimizing algorithms for target processors using representation neural networks - Google Patents
Optimizing algorithms for target processors using representation neural networksInfo
- Publication number
- EP4537196A1 EP4537196A1 EP23748726.9A EP23748726A EP4537196A1 EP 4537196 A1 EP4537196 A1 EP 4537196A1 EP 23748726 A EP23748726 A EP 23748726A EP 4537196 A1 EP4537196 A1 EP 4537196A1
- Authority
- EP
- European Patent Office
- Prior art keywords
- assembly
- program
- neural network
- candidate
- assembly program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
- G06F8/4441—Reducing the execution time required by the program code
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/447—Target code generation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/092—Reinforcement learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N5/00—Computing arrangements using knowledge-based models
- G06N5/01—Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
Definitions
- This specification relates to processing inputs using neural networks.
- Neural networks are machine learning models that employ one or more layers of nonlinear units to predict an output for a received input.
- Some neural networks include one or more hidden layers in addition to an output layer. The output of each hidden layer is used as input to the next layer in the network, i.e., another hidden layer or the output layer.
- Each layer of the network generates an output from a received input in accordance with current values of a respective set of parameters.
- This specification describes a system implemented as computer programs on one or more computers in one or more locations that optimizes a target algorithm for execution on a target processor. That is, the system determines an optimized algorithm that satisfies the specification of the target algorithm but can be executed on the target processor with reduced latency, i.e., relative to an existing implementation of the target algorithm for the target processor.
- a method includes receiving data specifying a target algorithm to be optimized for execution on a target processor, e.g., a target processor that has a particular architecture, and generating an assembly program that represents an optimized version of the target algorithm that is optimized for execution on target processor, e.g., on the particular architecture of the target processor.
- a target processor e.g., a target processor that has a particular architecture
- an assembly program that represents an optimized version of the target algorithm that is optimized for execution on target processor, e.g., on the particular architecture of the target processor.
- the assembly program includes a plurality of assembly instructions in an assembly programming language for the target processor and the generating includes repeatedly performing operations that include generating a candidate assembly program by adding a respective assembly instruction to the candidate assembly program at each of a plurality of time steps, including, at each of the plurality of time steps: generating a current state input specifying a current state of the candidate assembly program as of the time step, processing the current state input using a representation neural network that is configured to process the current state input to generate a state representation of the current state of the candidate assembly program; and selecting an assembly instruction from a set of assembly instructions in the assembly programming language using the state representation of the current state of the candidate assembly program; determining, for each of one or more of the time steps, a correctness measure for the candidate assembly program as of the time step that measures whether the candidate assembly program as of the time step, when executed on the target processor, generates outputs that match outputs generated by the target algorithm; and determining a latency measure that measures a latency of the candidate assembly program when executed on the target processor.
- the system can improve the runtime efficiency of the target processor, e.g., by decreasing the latency of workloads executed on the target processor.
- many algorithms e.g., sorting or hashing, are building blocks of many different computational workloads and, as a result, executing these algorithms with decreased latency can result in significant overall performance improvement.
- the described system optimizes a target algorithm for execution on a target processor by representing the target algorithm as an assembly program in an assembly language that is specific to the particular architecture of the target processor. That is, the target processor has control unit(s), registers, arithmetic and logic unit(s), and memory constructed to enable the target processor to recognize and execute programming instructions defined by the assembly program.
- optimizations of the target algorithm in assembly language are particularly adapted for the design and internal functioning (i.e. the architecture) of the target processor.
- the system can optimize the algorithm at the lowest level of optimization, which provides the most headroom for efficiency improvements, i.e., relative to optimizing the algorithm by optimizing a program in a higher-level programming language. That is, as a result of the system optimizing the algorithm at the assembly level by representing the algorithm as an assembly program, the target processor can achieve significant latency gains without sacrificing accuracy when executing the target algorithm.
- the system can effectively explore both correct and incorrect assembly programs to arrive at an optimized program that is correct and has reduced latency even for algorithms that have already been optimized using other approaches, e.g., sorting or hashing functions.
- FIG. 1 is a diagram of an example algorithm optimization system.
- FIG. 2 is a flow diagram of an example process for generating a candidate assembly program.
- FIG. 4 is a flow diagram of an example process for adding an instruction to a candidate assembly program.
- FIG. 1 shows an example algorithm optimization system 100.
- the algorithm optimization system 100 is an example of a system implemented as computer programs on one or more computers in one or more locations, in which the systems, components, and techniques described below can be implemented.
- the algorithm optimization system 100 optimizes a target algorithm 102 for execution on a target processor 110.
- the target processor 110 can generally be any appropriate computer processor having a particular architecture that performs computations using memory and registers.
- the target processor 110 can be a central processing unit (CPU) with a particular computer architecture, e.g., an x86 CPU or a RISC CPU.
- CPU central processing unit
- a particular computer architecture e.g., an x86 CPU or a RISC CPU.
- the target processor 110 can be an application-specific integrated circuit (ASIC).
- ASIC application-specific integrated circuit
- the target processor 110 can be a graphics processing unit (GPU) with a particular architecture.
- GPU graphics processing unit
- the system 100 receives data specifying a target algorithm 102 and generates as output an optimized assembly program 150 that represents an optimized version of the target algorithm 102, i.e., that satisfies the specifications of the target algorithm 102 while having a reduced latency compared to other programs that also satisfy the specification of the target algorithm 102.
- an assembly program can be considered to satisfy the specification of an algorithm when the assembly program generates the same outputs as the algorithm for a given set of inputs when executed on the target processor 110.
- the optimized assembly program 150 generates the same outputs as the target algorithm 102 for a given set of inputs when executed on the target processor 110.
- the assembly program can be considered to satisfy the specifications of an algorithm when the outputs of the assembly program for a given set of inputs satisfy a property of the target algorithm 102.
- the property can be satisfied when the number of collisions between hashes of the given set of inputs is below a threshold.
- the property can be satisfied when the average reconstruction quality of reconstructions generated from compressed representations generated by the assembly program is above a threshold quality.
- the optimized assembly program 150 is one that can be executed more efficiently (in terms of latency) on the target processor 110 but that is still “correct” relative to the target algorithm 102.
- the data specifying the target algorithm 102 can be any representation of the target algorithm 102 that contains sufficient information to allow the system 100 to determine what the output of the target algorithm 102 is for any given input.
- target algorithms examples include, but are not limited to, fixed sort algorithms for sorting various-sized sets of numbers, i.e., fixed length sequences of numbers, variable sort algorithms for sorting variable-sized sets of numbers, i.e., variable length sequences up to a specified maximum length, a Varint Deserialization algorithm, hashing algorithms for hashing input data, compression algorithms for compressing input data, and any of a variety of other algorithms.
- An assembly program is a sequence of assembly instructions in an assembly language for the target processor 102. That is, the assembly program contains a sequence of assembly instructions and each assembly instruction in the program is an instruction selected from a set of assembly instructions.
- the instructions in the set of assembly instructions are instructions that manipulate data between memory and registers of the target processor 102.
- the instructions in the set can include instructions that copy values from memory locations into registers, instructions that manipulate values between registers, instruction that return values from registers to memory locations, and so on.
- the instructions can be of the format Opcode ⁇ OperandA, OperandB>.
- An example of such an instruction is mov ⁇ A,B> which is defined as moving a value from source (A) to destination (B). Additional examples include cmp ⁇ A,B> - compare whether the values A and B are equal and set a register flag accordingly; cmovX ⁇ A,B> - conditionally move the value from A to B if a register flag is set where X can be L (Less than), G (Greater than), LE (Less than or equal) or GE (Greater than or equal); or jX ⁇ A> - jump to a different part of the program defined by the label A.
- the set of assembly instructions from which the instructions in the program can be selected can be received as an input by the system 100 and can be, e.g., the entire set of instructions in the assembly language of the target processor 102 or a subset of the instructions in the assembly language that have been identified as potentially being useful for carrying out the target algorithm 102.
- the system 100 can optimize the algorithm at the lowest level of optimization, which provides the most headroom for efficiency improvements, i.e., relative to optimizing the algorithm 102 by optimizing a program in a higher-level programming language. That is, by optimizing the algorithm 102 at the assembly level by representing the algorithm 102 as an assembly program, the target processor 110 can achieve significant latency gains without sacrificing accuracy when executing the target algorithm 102.
- the system 100 repeatedly generates candidate assembly programs using a neural network (“NN”) 120 while also training the neural network 120 to generate more efficient but correct assembly programs.
- a “correct” assembly program is one that satisfies the specifications of the target algorithm 102.
- the system 100 repeatedly generates candidate assembly programs using the neural network 120 and uses the generated candidate assembly programs to generate training data for training the neural network 120.
- the system 100 then intermittently trains the neural network 120 on the training data, so that the candidate assembly programs generated using the neural network 120 become more efficient as training progresses.
- the system 100 trains the neural network 120 on the training data intermittently during the generation of candidate assembly programs, the candidate assembly programs generated by the system 100 using the neural network 120 will generally become more efficient while still generating correct outputs.
- the system 100 can select, as the optimized assembly program 150, one of the candidate programs that were generated during the training. For example, the system 100 can select, from the candidate programs that satisfy the specifications of the target algorithm, the candidate program with the smallest latency. Alternatively, the system 100 can select, from the candidate programs, the candidate program for which the sum or weighted sum of a correctness measure and a latency measure is highest.
- the system 100 can generate, from optimized assembly program 150, executable machine code for the target processor 102.
- the system can cause the target processor to execute the executable machine code to perform the target algorithm 102.
- an assembler for the target processor 102 can convert the optimized assembly program 150 into executable machine code for the target processor 102.
- system 100 can provide the optimized assembly program 150 or the executable machine code to another system for use in executing the target algorithm 102 on the target process 110.
- the optimized assembly program 150 may be included in a programming language library.
- the executable machine code may be included in a programming language library, such as a higher level programming language library.
- Standard libraries provide building blocks of programs written in higher-level languages.
- the system 100 generates a candidate assembly program by adding a respective assembly instruction to the candidate assembly program at each of a plurality of time steps using the neural network 120.
- the system 100 starts with an empty buffer and then iteratively adds instructions to the buffer using the neural network 120 to build the candidate assembly program.
- the system can generate a state input st that specifies a current state of the candidate assembly program 140 as of the time step t and can select an assembly instruction at that corresponds to the assembly instruction MOV ⁇ Registero, Memoryi>, i.e., an instruction that moves data from register 0 to memory location 1, and can add the assembly instruction at to the candidate assembly program 140.
- the neural network 120 generally includes a representation neural network 130.
- the representation neural network 130 is a neural network that is configured to receive a state input specifying a current state of a candidate assembly program as of the time step and to process the current state input to generate a state representation of the current state of the candidate assembly program.
- the state representation is an ordered collection of numerical values, e.g., a vector or a matrix or a higher-order tensor, that represents the state of the candidate assembly program.
- the state input can include instruction data representing the instructions that are currently in the candidate assembly program and location data representing the state of the memory and the registers of the target processor 110. That is, the location data represents the state of the memory and the registers after executing the instructions that are currently in the candidate assembly program on a set of inputs for the target algorithm 102.
- the neural network 120 can also include one or more other components that are used by the system 100 to map the state representation of the state of a candidate assembly program to a new assembly instruction to be added to the candidate assembly program, i.e., after the last assembly program that is currently in the candidate assembly program.
- the neural network 120 can include a policy neural network that is configured to process the state representation to generate a probability distribution over the set of assembly instructions.
- the system 100 can, for example, directly use the probability distribution generated by the neural network 120 to select the instruction to be added candidate assembly program or can perform a search of future states of the candidate assembly program using the representation neural network 120 and the policy neural network (and other components) and then select the instruction using the results of the search.
- Generating candidate assembly programs using the neural network 120 is described in more detail below.
- the system 100 can receive data specifying a target algorithm 102 that is not configured to be run by a target processor 110, e.g., because the target algorithm is represented in an assembly language that is not valid for the target processor 110, because the target algorithm in its current form requires hardware capabilities that are not present on the target processor 110, or because executing the target algorithm 102 on the target processor 110 exceeds a latency budget for the corresponding computation.
- the system 100 can then determine an optimized assembly program as described above and then operate the target processor 110 using the optimized assembly program, e.g., by generating executable machine code for the target processor 102 and causing the target processor to execute the executable machine code to perform the target algorithm 102.
- FIG. 2 is a flow diagram of an example process 200 for generating a candidate assembly program during training of the neural network.
- the process 200 will be described as being performed by a system of one or more computers located in one or more locations.
- an algorithm optimization system e.g., the algorithm optimization system 100 depicted in FIG. 1, appropriately programmed in accordance with this specification, can perform the process 200.
- the system generates a candidate assembly program by adding a respective assembly instruction to the candidate assembly program at each of a plurality of time steps using the neural network.
- the system generates a current state input specifying a current state of the candidate assembly program as of the time step (step 202).
- the system processes the current state input using a representation neural network that is configured to process the current state input to generate a state representation of the current state of the candidate assembly program (step 204).
- the system selects an assembly instruction from the set of assembly instructions in the assembly programming language using the state representation of the current state of the candidate assembly program (step 206).
- the system can perform a tree search using the state representation in order to select the assembly instruction to be added to the current candidate assembly program.
- Performing the tree search will generally make use of additional components of the neural network, i.e., components in addition to the representation neural network, e.g., one or more of a policy neural network, a dynamics neural network, or one or more value neural networks.
- the policy neural network is a neural network, e.g., a feed-forward neural network, that is configured to receive a state representation and to process the state representation to generate a probability distribution over the set of assembly instructions.
- the dynamics neural network is a neural network, e.g., a feed-forward neural network, that is configured to receive a state representation and data identifying an assembly instruction and to generate a predicted next state representation that represents the state of the program if the identified instruction is added to the program when the program is in the state represented by the input state representation.
- a neural network e.g., a feed-forward neural network
- the system uses two value neural networks: a latency neural network that predicts a latency return for the program given the current state and a correctness neural network that predicts a correctness return for the program given the current state.
- the latency return is a prediction of the cumulative latency measures (described below) determined for the program after the program is in the current state. For example, when the latency measure is computed only at the last time step, the latency return is a prediction of the latency measure that will be computed at the last time step or of the latency measure multiplied by a discount factor.
- the correctness return is a prediction of the cumulative correctness measures (described below) determined for the program after the program is in the current state. For example, when the correctness measure is computed only at the last time step, the latency return is a prediction of the correctness measure that will be computed at the last time step or of the correctness measure multiplied by a discount factor. When the correctness measure is computed at multiple time steps, the latency return is a prediction of the sum or the time- discounted sum of the future correctness measures computed at future time steps.
- the system can process the state representation of the current state using the policy neural network to generate a probability distribution over the set of assembly instructions.
- the system can then select the instruction to be added to the assembly program using the probability distribution, e.g., by selecting the instruction with the highest probability or by sampling from the distribution using an appropriate sampling technique.
- the system can verify that the instruction is valid according to a known syntax or other constraint for the program prior to adding the instruction to the program.
- the system then adds the selected assembly instruction to the assembly program, i.e., as the last instruction in the assembly program (step 208).
- the system also determines, for each of one or more of the time steps at which an instruction was added, a correctness measure for the candidate assembly program as of the time step (step 210).
- the correctness measure measures whether the candidate assembly program as of the time step, when executed on the target processor, generates outputs that match outputs generated by the target algorithm.
- the system only computes the correctness measure at the last time step in the candidate program, i.e., after the last time step in the candidate assembly program.
- the system computes the correctness measure for multiple time steps in the candidate program, e.g., at each of the plurality of time steps at which instructions were added.
- the correctness measure for a given time step is an absolute correctness measure that depends only on the performance of the program as of the given time step.
- the system can compute a respective individual absolute correctness measure for each given input in a set of one or more given inputs based on the degree to which the output generated by the program as of the time step for the given input matches the output of the target algorithm for the given input.
- This individual absolute correctness measure can be a binary measure, e.g., equal to one if the outputs match exactly, or can be a more granular measure.
- the measure can be equal to the fraction of the inputs in the input sequence that are sorted into the correct position by the program as of the time step. If there are multiple given inputs in the set, the system can then combine, e.g., average, the individual absolute correctness measures to generate the absolute correctness measure.
- the measure can measure a degree to which outputs generated by the program have a particular property of outputs that are generated by the target algorithm.
- the correctness measure can measure the number of hashing collisions that occur between outputs of the assembly program for inputs in a given set of inputs.
- the correctness measure can measure a quality of reconstructions generated from compressed outputs of the assembly program generated for inputs in a given set of inputs.
- the correctness measure for a given time step is a relative correctness measure that depends on the absolute correctness measure for the program for the time step and the absolute correctness measures for the program at one or more earlier time steps.
- the relative correctness measure can be equal to the absolute correctness measure for the given step minus the absolute correctness measure for the preceding time step.
- the relative correctness measure “rewards” improvement in the correctness of the program across time steps.
- the relative correctness measure can be a function of the absolute correctness measure for the given step and the absolute correctness measure for the preceding time step, e.g., the difference between the two measures, a square root of the difference between the two measures, a difference between respective square roots of the two measures, and so on.
- the relative correctness measure “rewards” improvement in the correctness of the program across time steps.
- the system also determines a latency measure that measures a latency of the candidate assembly program when executed on the target processor (step 212).
- the system can execute the candidate assembly program on the target processor as described above and measure the execution latency.
- the system can determine a “proxy” latency measure from the number of instructions in the candidate assembly program, e.g., by assigning longer latency measures to longer programs.
- the proxy latency measure can be equal to the number of instructions in the program or a different increasing function of the number of instructions.
- the system performs the training using reinforcement learning to optimize the latency and correctness returns.
- the system can optimize a sum or a weighted sum of expected latency and correctness returns or can optimize both the latency and the correctness returns, e.g., through multi-objective reinforcement learning.
- Example techniques for generating training examples and training the representation neural network and the other components of the neural network using the training examples are described in Shawieser, et al., Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model, at arXiv: 1911.08265, Shawieser, et al., Online and Offline Reinforcement Learning by Planning with a Learned Model, at arXiv:2104.006294, and Hubert, et al, Learning and Planning in Complex Action Spaces, at arXiv:2104.06303, all of which are hereby incorporated by reference herein in their entirety.
- the system can train the policy neural network and the representation neural network using any appropriate reinforcement learning technique, e.g., a policy gradient technique, an actor-critic technique, and so on.
- reinforcement learning technique e.g., a policy gradient technique, an actor-critic technique, and so on.
- the system can intersperse steps of training the neural network between iterations of performing the process 200 to generate new candidate assembly programs. For example, the system can train the neural network after every n iterations of the process 200, where n is an integer greater than or equal one, or can add training examples generated as a result of performing the process 200 to a buffer and can asynchronously sample training examples from the buffer in order to perform training steps.
- the candidate assembly programs generated by the system using the neural network will generally become more efficient while still generating correct outputs, i.e., due the neural network generating higher-quality outputs as training progresses.
- the system can select, as the optimized assembly program, one of the candidate programs that were generated during the training based on the correctness measures for the candidate programs and the latency measures for the candidate programs. For example, the system can select, from the candidate programs that have correctness measures that indicate that the optimized program satisfies the specifications of the target algorithm, the candidate program with the smallest latency measure.
- the system can generate a new assembly program using the trained neural network, i.e., by adding assembly instructions to the assembly program using the trained neural network as described above, and then select the new assembly program as the optimized assembly program.
- FIG. 3 shows an example architecture 300 of the representation neural network 130.
- the representation neural network 130 receives a current state input specifying a current state of the candidate assembly program as of the time step and processes the current state input to generate a state representation 310 of the current state of the candidate assembly program.
- the current state input includes instruction data 320 representing the assembly instructions that are included in the candidate assembly program as of the time step and location data 330 representing a state of memory and registers of the target processor after executing the candidate assembly program as of the time step on a set of inputs.
- the location data 330 can specify, for each of a set of inputs to the target algorithm and for each register and memory location of the target processor, the state of the register or memory location after the current assembly program as of the time step has been executed on the set of inputs, i.e., specify, for each input in the set, what value, if any, is stored in the register or memory location. That is, if there are k inputs in the set, the location data 330 includes k states for each register and memory location of the target processor.
- the set of inputs can include, e.g., all possible inputs to the target algorithm or a set of inputs that have been determined to be representative of the possible inputs to the target algorithm.
- the instruction encoder 340 is a Transformer encoder 370, i.e., a neural network that applies self-attention over the inputs to the neural network to generate as output a respective embedding of each of the inputs to the neural network.
- a Transformer encoder 370 i.e., a neural network that applies self-attention over the inputs to the neural network to generate as output a respective embedding of each of the inputs to the neural network.
- the system can generate a respective encoding for each assembly instruction that is in the candidate assembly program as of the time step and process the respective encodings using the Transformer encoder 370 to generate the respective embeddings of the instructions.
- the system can generate the respective encoding of each of the assembly instructions that are included in the candidate assembly program as of the time step from (i) respective one hot encodings 380 of each component of the assembly instruction and (ii) a positional encoding representing a position of the assembly instruction in the candidate assembly program as of the time step.
- the components of the instruction include the type of the instruction (“OpCode”) and the operands of the instruction, i.e., the memory locations, register locations, or both that are operated on by the instruction.
- the system first applies one-hot encoding 382 to encode each instruction as a concatenation of three one-hot vectors: a first one-hot vector with 3 entries encoding the OpCode, a second one-hot vector with 6 entries encoding the first operand, and a third one-hot vector with 6 entries encoding the second operand.
- the system can then determine the encoding for each assembly instruction by combining, e.g., summing or averaging or concatenating, the concatenation of the one-hot encodings with the positional encoding for the position of the assembly instruction in the assembly program.
- the system can generally use any appropriate positional encoding, e.g., learned encodings or pre-determined, e.g., sinusoidal, encodings, and the positional encodings can encode either the relative positions of the assembly instructions within the program or the absolute positions of the assembly instructions within the program.
- positional encoding e.g., learned encodings or pre-determined, e.g., sinusoidal, encodings
- the Transformer encoder 370 uses multi-query attention in order to increase computational efficiency. That is, in these implementations, the Transformer encoder 370 includes one or more multi-query attention blocks. Each multiquery attention block includes multiple self-attention heads that each have a respective learned query transformation but that share keys and values generated using a respective shared learned transformation that is shared between the attention heads.
- the system represents the current assembly program as a graph of nodes and edges.
- Each node in the graph represents one of (i) a memory location of the target processor, (ii) a register location of the target processor, or (iii) a register flag.
- Each edge in the graph represents data flow induced by a corresponding assembly instruction that is included in the candidate assembly program as of the time step.
- the system generates, from the instruction data, node features for the nodes of the graph and edge features for the edges of the graph and then processes the data representing the graph, i.e., the node and edge features and the data identifying which nodes are connected by which edges, using a graph neural network to generate the respective embedding of each of the assembly instructions that are included in the candidate assembly program as of the time step.
- the respective node features for each node in the graph characterize values of the corresponding (i) memory location, (ii) register location, or (iii) register flag after processing each input in a set of inputs using the candidate assembly program as of the time step, i.e., as described above with respect to the location data.
- the edge features for each edge in the graph include features of the instruction corresponding to the edge.
- the features of the edge can include the instruction order, the instruction arguments, and the instruction type of the instruction corresponding to the edge.
- the graph data also includes one or more global features, e.g., a vector that summarizes information that characterizes the entire graph, e.g., the total number of nodes in the graph, the total number of edges in the graph, and so on.
- global features e.g., a vector that summarizes information that characterizes the entire graph, e.g., the total number of nodes in the graph, the total number of edges in the graph, and so on.
- the system then processes the graph data using the graph neural network to generate embeddings of each of the nodes in the graph, which the system uses as the embeddings 342 of the instructions in the assembly program.
- the graph neural network can have any appropriate graph neural network architecture, e.g., can be any appropriate graph neural network that includes one or more graph neural network layers that apply any of a variety of message passing techniques to update the feature representations. Examples include those employed by Graph Attention Networks, Message Passing Neural Networks, Graph Convolutional Networks, and so on.
- the representation neural network 130 can also process the location data 330 using a processor state encoder 350 to generate a set of one or more input embeddings 352.
- the processor state encoder 350 can be a multi-layer perceptron (MLP) or other feedforward neural network that processes the respective states of each register or memory location to generate a respective embedding for the register or memory location.
- the processor state encoder 350 can be a multi-layer perceptron (MLP) or other feedforward neural network that processes a concatenation of the respective states of each register or memory location to generate a single embedding that represents the states of all of the registers and memory locations.
- MLP multi-layer perceptron
- MLP multi-layer perceptron
- the representation neural network 130 can then generate the state representation 310 from the embeddings 342 and the input embeddings 352 by combining the embeddings 342 and the input embeddings 352. For example, the representation neural network 130 can concatenate the embeddings 342 and the input embeddings 352 to generate the state representation. As another example, the representation neural network 130 can pool the embeddings 342 to generate a first pooled embedding, pool the input embeddings 352 to generate a second pooled embeddings, and then concatenate the first and second pooled embeddings to generate the input embeddings 352. As yet another example, the system can apply one or more learned operations, e.g., one or more fully-connected neural network layers, to the embeddings 342 and the input embeddings 352 to generate the state representation 310.
- one or more learned operations e.g., one or more fully-connected neural network layers
- FIG. 4 is a flow diagram of an example process 400 for selecting an instruction to be added to a candidate assembly program at a given time step using a state representation.
- the process 400 will be described as being performed by a system of one or more computers located in one or more locations.
- an algorithm optimization system e.g., the algorithm optimization system 100 depicted in FIG. 1, appropriately programmed in accordance with this specification, can perform the process 400.
- the state of the candidate assembly program at the given time step is represented by a root node in a state tree that includes nodes representing states of the candidate assembly program and edges representing instructions added to the candidate assembly program.
- the system performs, using the state representation and starting from the root node in the state tree, a look-ahead search through the state tree (step 404).
- the system can select actions using an optimistic strategy called the predictor upper confidence tree bound (PUCT), meant to balance exploration (trying new actions) and exploitation (progressing further down the subtree of the current estimate of the best action).
- PCT predictor upper confidence tree bound
- the system evaluates the leaf node in the actual state space of the assembly program. That is, the system maintains an assembly program that has a state that corresponds to the state represented by the leaf node and determines which node is connected to the leaf node by a given edge by adding the corresponding instruction to the assembly program.
- the system performs the evaluation in the (latent) state representation space.
- the system uses the dynamics neural network to generate a predicted state representation for the node that is connected to the leaf node by the given edge by processing an input that includes a state representation corresponding to the leaf node and identifies the corresponding instruction.
- the system updates statistics for edges from the root node. For example, the system can maintain a visit count for each edge from the root node and can increment the visit count for a given edge from the root node whenever the edge is traversed during a search iteration.
- the system selects, based on the statistics for edges from the root node after the look-ahead search is performed, the instruction from the set of instructions (step 406). For example, as described above, the system can maintain a visit count for each edge that represents the number of times that the edge was traversed during the look-ahead search. The system can then assign, to each edge, a probability that is proportional to the visit count for the edge and then sample an edge in accordance with the probabilities.
- Embodiments of the subject matter and the functional operations described in this specification can be implemented in digital electronic circuitry, in tangibly-embodied computer software or firmware, in computer hardware, including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them.
- Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, e.g., one or more modules of computer program instructions encoded on a tangible non transitory storage medium for execution by, or to control the operation of, data processing apparatus.
- the computer storage medium can be a machine- readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
- the program instructions can be encoded on an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to suitable receiver apparatus for execution by a data processing apparatus.
- a computer program which may also be referred to or described as a program, software, a software application, an app, a module, a software module, a script, or code, can be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages; and it can be deployed in any form, including as a stand alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
- a program may, but need not, correspond to a file in a file system.
- a program can be stored in a portion of a file that holds other programs or data, e.g., one or more scripts stored in a markup language document, in a single file dedicated to the program in question, or in multiple coordinated files, e.g., files that store one or more modules, sub programs, or portions of code.
- a computer program can be deployed to be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a data communication network.
- the term “database” is used broadly to refer to any collection of data: the data does not need to be structured in any particular way, or structured at all, and it can be stored on storage devices in one or more locations.
- the index database can include multiple collections of data, each of which may be organized and accessed differently.
- engine is used broadly to refer to a software-based system, subsystem, or process that is programmed to perform one or more specific functions.
- an engine will be implemented as one or more software modules or components, installed on one or more computers in one or more locations. In some cases, one or more computers will be dedicated to a particular engine; in other cases, multiple engines can be installed and running on the same computer or computers.
- the processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform functions by operating on input data and generating output.
- the processes and logic flows can also be performed by special purpose logic circuitry, e.g., an FPGA or an ASIC, or by a combination of special purpose logic circuitry and one or more programmed computers.
- Computers suitable for the execution of a computer program can be based on general or special purpose microprocessors or both, or any other kind of central processing unit.
- a central processing unit will receive instructions and data from a read only memory or a random access memory or both.
- the essential elements of a computer are a central processing unit for performing or executing instructions and one or more memory devices for storing instructions and data.
- the central processing unit and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.
- a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto optical disks, or optical disks. However, a computer need not have such devices.
- a computer can be embedded in another device, e.g., a mobile telephone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device, e.g., a universal serial bus (USB) flash drive, to name just a few.
- PDA personal digital assistant
- GPS Global Positioning System
- USB universal serial bus
- Computer readable media suitable for storing computer program instructions and data include all forms of non volatile memory, media and memory devices, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto optical disks; and CD ROM and DVD-ROM disks.
- semiconductor memory devices e.g., EPROM, EEPROM, and flash memory devices
- magnetic disks e.g., internal hard disks or removable disks
- magneto optical disks e.g., CD ROM and DVD-ROM disks.
- embodiments of the subject matter described in this specification can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to the user and a keyboard and a pointing device, e.g., a mouse or a trackball, by which the user can provide input to the computer.
- a display device e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor
- keyboard and a pointing device e.g., a mouse or a trackball
- Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input.
- a computer can interact with a user by sending documents to and receiving documents from a device that is used by the user; for example, by sending web pages to a web browser on a user’s device in response to requests received from the web browser.
- a computer can interact with a user by sending text messages or other forms of message to a personal device, e.g., a smartphone that is running a messaging application, and receiving responsive messages from the user in return.
- Data processing apparatus for implementing machine learning models can also include, for example, special-purpose hardware accelerator units for processing common and compute-intensive parts of machine learning training or production, e.g., inference, workloads.
- Machine learning models can be implemented and deployed using a machine learning framework, .e.g., a TensorFlow framework or a Jax framework.
- Embodiments of the subject matter described in this specification can be implemented in a computing system that includes a back end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front end component, e.g., a client computer having a graphical user interface, a web browser, or an app through which a user can interact with an implementation of the subject matter described in this specification, or any combination of one or more such back end, middleware, or front end components.
- the components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN) and a wide area network (WAN), e.g., the Internet.
- LAN local area network
- WAN wide area network
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
Description
Claims
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US202263391276P | 2022-07-21 | 2022-07-21 | |
| PCT/EP2023/070308 WO2024018065A1 (en) | 2022-07-21 | 2023-07-21 | Optimizing algorithms for target processors using representation neural networks |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| EP4537196A1 true EP4537196A1 (en) | 2025-04-16 |
Family
ID=87550952
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| EP23748726.9A Pending EP4537196A1 (en) | 2022-07-21 | 2023-07-21 | Optimizing algorithms for target processors using representation neural networks |
Country Status (2)
| Country | Link |
|---|---|
| EP (1) | EP4537196A1 (en) |
| WO (1) | WO2024018065A1 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20250252338A1 (en) * | 2024-02-01 | 2025-08-07 | Qualcomm Technologies, Inc. | Self-improving artificial intelligence programming |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP3698283A1 (en) * | 2018-02-09 | 2020-08-26 | DeepMind Technologies Limited | Generative neural network systems for generating instruction sequences to control an agent performing a task |
-
2023
- 2023-07-21 WO PCT/EP2023/070308 patent/WO2024018065A1/en not_active Ceased
- 2023-07-21 EP EP23748726.9A patent/EP4537196A1/en active Pending
Also Published As
| Publication number | Publication date |
|---|---|
| WO2024018065A1 (en) | 2024-01-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112579063B (en) | Acceleration method for exploring optimization space in deep learning compiler | |
| CN110663049B (en) | Neural Network Optimizer Search | |
| US20190370659A1 (en) | Optimizing neural network architectures | |
| US20260105300A1 (en) | Granular neural network architecture search over low-level primitives | |
| US20240256964A1 (en) | Pretraining Already-Pretrained Models for Diverse Downstream Tasks | |
| CN116795341A (en) | Generating a machine-learned model of a code segment with predicted placeholders to optimize software development | |
| JP2024504179A (en) | Method and system for lightweighting artificial intelligence inference models | |
| KR102561799B1 (en) | Method and system for predicting latency of deep learning model in device | |
| Chen et al. | TANGO: Re-Thinking quantization for graph neural network training on GPUs | |
| Rudakov et al. | Activations and gradients compression for model-parallel training | |
| EP4537196A1 (en) | Optimizing algorithms for target processors using representation neural networks | |
| Nawaz et al. | Proof searching and prediction in HOL4 with evolutionary/heuristic and deep learning techniques | |
| KR20230152629A (en) | Method, system, and computer readable record medium for generating reformulated query | |
| US12360743B1 (en) | Neural network systems for source code generation and ranking | |
| CN112990461B (en) | Methods, devices, computer equipment and storage media for building neural network models | |
| CN113076089A (en) | API completion method based on object type | |
| Miao et al. | Cuwide: Towards efficient flow-based training for sparse wide models on gpus | |
| CN117556787A (en) | Methods and systems for generating target text sequences for natural language text sequences | |
| CN117574964A (en) | A hardware-aware CNN hierarchical search analysis modeling method | |
| Dai et al. | Accelerating OpenPangu Inference on NPU via Speculative Decoding | |
| US20250148042A1 (en) | Optimizing functions for target processors by searching through candidate computer programs | |
| Yang et al. | Computationally expensive constrained problems via surrogate-assisted dynamic population evolutionary optimization | |
| KR20230116028A (en) | Highly parallel processing architecture using double fork execution | |
| do Rosario et al. | Fast selection of compiler optimizations using performance prediction with graph neural networks | |
| Chen et al. | DTuner: A Construction-Based Optimization Method for Dynamic Tensor Operators Accelerating |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| STAA | Information on the status of an ep patent application or granted ep patent |
Free format text: STATUS: UNKNOWN |
|
| STAA | Information on the status of an ep patent application or granted ep patent |
Free format text: STATUS: THE INTERNATIONAL PUBLICATION HAS BEEN MADE |
|
| PUAI | Public reference made under article 153(3) epc to a published international application that has entered the european phase |
Free format text: ORIGINAL CODE: 0009012 |
|
| STAA | Information on the status of an ep patent application or granted ep patent |
Free format text: STATUS: REQUEST FOR EXAMINATION WAS MADE |
|
| 17P | Request for examination filed |
Effective date: 20250110 |
|
| AK | Designated contracting states |
Kind code of ref document: A1 Designated state(s): AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC ME MK MT NL NO PL PT RO RS SE SI SK SM TR |
|
| DAV | Request for validation of the european patent (deleted) | ||
| DAX | Request for extension of the european patent (deleted) | ||
| RAP1 | Party data changed (applicant data changed or rights of an application transferred) |
Owner name: GDM HOLDING LLC |
|
| STAA | Information on the status of an ep patent application or granted ep patent |
Free format text: STATUS: EXAMINATION IS IN PROGRESS |