EP3871077A1 - Method and apparatus for determining compiler parameters settings - Google Patents

Method and apparatus for determining compiler parameters settings

Info

Publication number
EP3871077A1
EP3871077A1 EP18795482.1A EP18795482A EP3871077A1 EP 3871077 A1 EP3871077 A1 EP 3871077A1 EP 18795482 A EP18795482 A EP 18795482A EP 3871077 A1 EP3871077 A1 EP 3871077A1
Authority
EP
European Patent Office
Prior art keywords
program
representation
sources
training
compiler
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.)
Withdrawn
Application number
EP18795482.1A
Other languages
German (de)
French (fr)
Inventor
Fayçal AIT AOUDIA
Andrea ENRICI
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nokia Solutions and Networks Oy
Original Assignee
Nokia Solutions and Networks Oy
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nokia Solutions and Networks Oy filed Critical Nokia Solutions and Networks Oy
Publication of EP3871077A1 publication Critical patent/EP3871077A1/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation

Definitions

  • Various example embodiments relate generally to methods and apparatus for determining compiler parameters settings for program optimization.
  • Program sources also known as source code, describe, in a humanly understandable language, the operations that a program performs.
  • these program sources cannot typically be executed by the targeted hardware or virtual machine. Therefore, an executable program must be generated from the program sources through a compilation process. This is typically done by a compiler, which is a software that takes as an input the sources as well as parameters for setting the compilation process and produces an executable program. Some of these parameters relate to the performance optimization of the program, and are critical for achieving the desired performance requirements.
  • a method and apparatus are disclosed herein to avoid the requirement of having well-optimized settings for compilation parameters associated to the programs present in the training set by enabling the learning system to explore the space of possible settings by introducing small perturbations.
  • the method and apparatus once trained, may be able to map a given input program to compiler parameters which achieve high performance with respect to a predetermined performance metric.
  • an apparatus comprises means configured to perform: generating a representation of a program from the program’s sources, wherein the representation includes data regarding the program in relation to a performance metric; and determining, using a system including an algorithm having at least some trainable weights, compiler parameters from the representation, wherein the compiler parameters are configured such that compiling the program’s sources using the compiler parameters produced a program executable optimized with respect to the performance metric.
  • a method comprises generating a representation of a program from the program’s sources, wherein the representation includes data regarding the program in relation to a performance metric; and determining, using a system including an algorithm having at least some trainable weights, compiler parameters from the representation, wherein the compiler parameters are configured such that compiling the program’s sources using the compiler parameters produced a program executable optimized with respect to the performance metric.
  • a computer readable storage medium stores instructions which, when executed by a computer, cause the computer to perform a method.
  • the method comprises generating a representation of a program from the program’s sources, wherein the representation includes data regarding the program in relation to a performance metric; and determining, using a system including an algorithm having at least some trainable weights, compiler parameters from the representation, wherein the compiler parameters are configured such that compiling the program’s sources using the compiler parameters produced a program executable optimized with respect to the performance metric.
  • FIG. 1 shows an apparatus according to some embodiments described herein
  • FIG. 2 shows a system according to some embodiments described herein;
  • FIG. 3 shows an apparatus according to some embodiments described herein
  • FIG. 4 depicts a high-level block diagram of an apparatus 400 suitable for use in performing functions described herein according to some embodiments; and [014] FIGs. 5 and 6 show a method according to some embodiments described herein. Detailed Description
  • Example embodiments will now be described, including methods and apparatus that to avoid the requirement of having well-optimized settings for compilation parameters associated to the programs present in the training set by enabling the learning system to explore the space of possible settings by introducing small perturbations.
  • the method and apparatus once trained, may be able to map a given input program to compiler parameters which achieve high performance with respect to a predetermined performance metric.
  • processor or “controller” should not be construed to refer exclusively to hardware capable of executing software, and may implicitly include, without limitation, digital signal processor (DSP) hardware, network processor, application specific integrated circuit (ASIC), field programmable gate array (FPGA), read only memory (ROM) for storing software, random access memory (RAM), and non-volatile storage.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • ROM read only memory
  • RAM random access memory
  • non-volatile storage non-volatile storage.
  • Other hardware conventional or custom, may also be included. Their function may be carried out through the operation of program logic, through dedicated logic, through the interaction of program control and dedicated logic, or even manually, the particular technique being selectable by the implementer as more specifically understood from the context.
  • FIG. 1 illustrates an example apparatus 100 according to embodiments described herein.
  • the apparatus 100 comprises means 110 configured to perform generating a representation 120 of a program from the program’s sources 130.
  • the representation 120 includes data regarding the program in relation to a performance metric.
  • the apparatus 100 comprises means 140 configured to perform determining, using a system including an algorithm having at least some trainable weights, compiler parameters S from the representation 120.
  • the apparatus 100 further comprises means 150 configured to perform compiling the program’s sources 130 using the compiler parameters S.
  • the means 150 is a compiler in some embodiments.
  • the compiler parameters S are configured such that compiling the program’s sources 130 using the compiler parameters S produces a program executable 160 optimized with respect to the performance metric.
  • the means 1 10 are configured to perform generating the representation 120 of the program from the program’s sources 130 from the compiler 150.
  • the representation 120 may comprise an intermediate representation generated by the compiler 150.
  • the representation 120 may be a static program representation, namely a representation generated without the need to run the executable generated by the compiler 150.
  • Such representations can be generated using the compiler’s intermediate representations (e.g., number and type of instructions, control graphs).
  • the representation 120 comprises at least one representation selected from the list of: memory exclusion graph, control- flow graph, data flow graph, single static assignment form, and program dependence graph. Other representations known to those in the art may also be used.
  • the representation 120 may take the form of a vector representation of at least one of the listed representations.
  • the system 140 is implemented as a neural network having a plurality of trainable weights.
  • a vector Z is input to the system 140.
  • the system 140 in some embodiments comprises a plurality of dense layers 142.
  • the performance metric is at least one metric selected from the list of: memory footprint, execution time, processing throughput, and power consumption. Other performance metrics known to those skilled in the art may also be used.
  • the representation 120 includes data regarding the program in relation to the performance metric.
  • the representations 120 listed above essentially capture the flow of data (e.g., input samples) and control information (e.g., variables used in control statements such as loops, if-then-else), and in some cases the amount of data, in a program from the program sources 130.
  • control information e.g., variables used in control statements such as loops, if-then-else
  • the same representation 120 can be used for different purposes: for instance, both control- flow graphs and data-flow graphs can be used to track the value of variables and optimize the memory footprint. Further, different representations 120 can be used for the same goal.
  • representations such as call graphs, program dependence graphs and control flow graphs can all be used to optimize power consumption as they capture how often a code block is executed.
  • Such representations 120 can be used to reduce the power consumption of a target machine by training the means 140 to determine compiler parameters that map code that is seldom executed to an energetically expensive processor and map code that is often executed onto a less power- hungry processor.
  • the apparatus further comprises means 200 further configured to perform training of the system l40’s trainable weights.
  • the system 140 defines the mapping P— » S, where P is a set of program representations 120, and S is the set of compiler parameter settings.
  • the system 140 is parametrized by a vector, and the aim of the training phase is to find values for the trainable weights that maximize the performance, with respect to a given performance metric, of the program compiled with the parameters determined by the system 140.
  • the means 200 is configured to perform training of the system 140 as follows.
  • a plurality of training program sources 230 which will be used to train the system 140, are provided.
  • the program sources 230 are not used as inputs to the system 140 since learning a mapping from the program sources to the compiler parameters S would be inefficient. Instead, the means 200 is configured to perform generating a representation 220 of each training program from each training program’s sources 230.
  • the representation 220 is chosen so that it includes pertinent data about the program sources 230 with respect to the performance metric being optimized.
  • the system 140 is then fed with the representations 220 as described below.
  • An efficient way of generating the representation 220 is using static program representations, which can be generated without the need of running an executable generated by the compiler 150, and therefore can be generated once for all the training program sources 230.
  • Such representations 220 can be computed using the compiler’s 150 intermediate representations as discussed above.
  • the program sources 230 may be used as the representation 220 input to the system 140.
  • the means 200 is further configured to perform training of the system 140 by selecting a set of N training program sources at random from the plurality of training program sources 230.
  • the means 200 is next configured to perform training of the system 140 by determining, using the system 140, compiler parameters S for each training program from the representation 220 of each training program 220 in the set.
  • the means 200 is further configured to perform training of the system 140 by determining a set ofN perturbations, e, according to a distribution, P(e).
  • the perturbations, e are determined independently.
  • the distribution, P(e) is a Gaussian distribution, for example with a mean of zero and a small variance s 2 .
  • the means 200 is next configured to perform training of the system 140 by compiling each training program in the set from that training program’s sources using the determined compiler parameters modified by a perturbation.
  • the perturbation is a perturbation, e, in the set of perturbations.
  • the compiler parameters used to compile the program are s / + c / , where s / is the compiler parameters determined by the system 140 for the zth training program and e/ is the /th perturbation in the set of perturbations.
  • the means 200 is next configured to perform training of the system 140 by determining a loss value, /, pertaining to the performance metric for each compiled program 260 from the set of training programs by benchmarking.
  • Program benchmarking aims at evaluating the effectiveness of the compiler’s optimizations by measuring the performance of a program in its compiled, executable form. This evaluation is conducted by providing each compiled program with different types of workloads (e.g., signal-processing operations involving different matrix and vector operations) to be run onto a specific target platform.
  • Data are collected by profiling the executable program (e.g., monitor variables’ values, memory accesses, control statements, power usage), and from this data a scalar loss value /, relevant to a certain performance metric, is computed using a suitable loss function.
  • the loss value / indicates how well the program is performing with respect to this metric.
  • the means 200 is next configured to perform training of the system 140 by adjusting the trainable weights of the system 140 using a loss function pertaining to the performance metric.
  • the loss function is determined from the loss values / of the compiled programs in the set.
  • the system 140 is adjusted by applying one step of stochastic gradient descent (SGD) of variant thereof to the trainable parameters, or weights, of the neural network forming the system 140 using the loss function J
  • N is the number of training programs in the set selected at random from the plurality of training program sources 230
  • U is the loss value determined for the /th training program
  • Pr() means‘probability of
  • s / are the compiler parameters determined by the system 140 for the zth training program
  • c, ⁇ are the /th perturbation
  • p are the representation 220 of the /th training program.
  • the loss function could take any suitable form and does not necessarily need to be differentiable. Any suitable SGD variant may be used, including but not limited to Adam, RMSProp, and Momentum.
  • the means 200 is next configured to perform training of the system 140 by either stopping or repeat the above steps for another iteration.
  • the stop criterion in can take multiple forms: stop after a fixed number of training iterations, stop when the loss function L has not decreased during a fixed number of iterations, stop when the loss or another associated metric has reached a desired value.
  • the size N of the set as well as the learning-rate and possible other parameters of the chosen SGD variant are parameters of the means 200.
  • any new program for which the apparatus 100 might be useful can be added to the training set, and be used to optimize furthermore the system 140 after its initial training phase.
  • parameters of the distribution P() can be chosen to be trainable e.g., if P() is a Gaussian distribution with mean m and variance s 2 then m and s can be made trainable parameters.
  • the loss function J is simply a function of which the gradient with respect to the trainable parameters is computed.
  • the function is also known as the policy gradient.
  • Methods known to the skilled person to improve the convergence speed of the training algorithm may be applied.
  • Training relies on exploring the space of possible representation to compiler parameter mappings. Exploring the space is done by trying new mappings that are small variations of the current mapping, using the perturbations. Exploring can be done in numerous ways, two of the most popular approaches being Gaussian policy and -greedy.
  • the perturbation is determined from a multivariate zero-mean normal distribution and added to the current compiler parameters. This ensures exploration “in the neighborhood” of the current compiler parameters. This is useful where the compiler parameters take values in a continuous set.
  • the compiler parameters are those determined by the system 140, and with probability a random compiler parameter is taken. This is useful in the case where the compilation parameters take values in a discrete set.
  • the covariance matrix of the distribution from which the perturbations are determined, and the s parameter of the e-greedy approach, are usually fixed-parameters, i.e. not learned during training. These parameters control the“amount of exploration”, as making this parameters smaller reduces the amount of random exploration, and favors actions from the current policy of the system 140.
  • the means 110, 140, and 150 may take the form of an apparatus 400 comprising at least one processor 410 (e.g., a central processing unit (CPU) and/or other suitable processor(s)) and at least one memory 420 (e.g., random access memory (RAM), read only memory (ROM), or the like).
  • processor 410 e.g., a central processing unit (CPU) and/or other suitable processor(s)
  • memory 420 e.g., random access memory (RAM), read only memory (ROM), or the like.
  • the apparatus 400 further comprises computer program code 430 and various input/output devices 440 (e.g., a user input device (such as a keyboard, a keypad, a mouse, a microphone, a touch-sensitive display or the like), a user output device 450 (such as a display, a speaker, or the like), and storage devices (e.g., a tape drive, a floppy drive, a hard disk drive, a compact disk drive, non-volatile memory or the like)).
  • various input/output devices 440 e.g., a user input device (such as a keyboard, a keypad, a mouse, a microphone, a touch-sensitive display or the like), a user output device 450 (such as a display, a speaker, or the like), and storage devices (e.g., a tape drive, a floppy drive, a hard disk drive, a compact disk drive, non-volatile memory or the like)).
  • the computer program code 430 can be loaded into the memory 420 and executed by the processor 410 to implement functions as discussed herein and, thus, computer program code 430 (including associated data structures) can be stored on a computer readable storage medium, e.g., RAM memory, magnetic or optical drive or diskette, or the like.
  • a computer readable storage medium e.g., RAM memory, magnetic or optical drive or diskette, or the like.
  • Some embodiments relate to a method 500 as shown in FIG. 5.
  • the method 500 comprises, at 502, generating a representation of a program from the program’s sources, wherein the representation includes data regarding the program in relation to a performance metric.
  • the method 500 further comprises, at 504, determining, using a system including an algorithm having at least some trainable weights, compiler parameters S from the representation, wherein the compiler parameters are configured such that compiling the program’s sources using the compiler parameters produces a program executable optimized with respect to the performance metric.
  • the method 500 further comprises, at 506, compiling the program’s sources using the compiler parameters S.
  • the compiler parameters S are configured such that compiling the program’s sources using the compiler parameters S produces a program executable optimized with respect to the performance metric.
  • generating 502 a representation of the program comprises generating the representation of the program from the program’s sources from a compiler.
  • the representation may comprise an intermediate representation generated by the compiler.
  • the representation may be a static program representation, namely a representation generated without the need to run the executable generated by the compiler.
  • Such representations can be generated using the compiler’s intermediate representations (e.g., number and type of instructions, control graphs).
  • the representation comprises at least one representation selected from the list of: memory exclusion graph, control-flow graph, data-flow graph, single static assignment form, and program dependence graph. Other representations known to those in the art may also be used.
  • the representation may take the form of a vector representation of at least one of the listed representations.
  • the performance metric is at least one metric selected from the list of: memory footprint, and power consumption. Other performance metrics known to those skilled in the art may also be used.
  • the method 500 further comprises, at 510, training the system as follows.
  • a plurality of training program sources which will be used to train the system, are provided.
  • a representation of each training program is generated from each training program’s sources.
  • the representation is chosen so that it includes pertinent data about the program sources with respect to the performance metric being optimized.
  • the representations may be static program representations generated without the need of running an executable generated by the compiler. Such representations can be computed using the compiler’s intermediate representations as discussed above.
  • training 510 further comprises selecting a set of N training program sources at random from the plurality of training program sources.
  • Training 510 further comprises, at 518, determining, using the system, compiler parameters S for each training program from the representation of each training program in the set.
  • training 510 further comprises, at 520, determining a set of N perturbations, e, according to a distribution, P(e).
  • the perturbations, e are determined independently.
  • the distribution, P(e) is a Gaussian distribution, for example with a mean of zero and a small variance s 2 .
  • Training 510 further comprises, at 522, compiling each training program in the set from that training program’s sources using the determined compiler parameters modified by a perturbation.
  • the perturbation is a perturbation, e, in the set of perturbations.
  • the compiler parameters used to compile the program are s / + c / , where s / is the compiler parameters determined by the system for the zth training program and ez is the zth perturbation in the set of perturbations.
  • training 510 further comprises, at 524, determining a loss value, /, pertaining to the performance metric for each compiled program from the set of training programs by benchmarking.
  • Training 510 further comprises, at 526, adjusting the trainable weights of the system using a loss function pertaining to the performance metric.
  • the loss function is determined from the loss values / of the compiled programs in the set.
  • the system is adjusted by applying one step of stochastic gradient descent (SGD) or varaint thereof to the trainable parameters, or weights, of the neural network forming the system using the loss function J
  • N is the number of training programs in the set selected at random from the plurality of training program sources 230
  • U is the loss value determined for the zth training program
  • Pr() means‘probability of
  • s / are the compiler parameters determined by the system for the zth training program
  • e, ⁇ are the zth perturbation
  • p are the representation of the zth training program.
  • the loss function could take any suitable forms and does not necessarily need to be differentiable. Any suitable SGD variant may be used, including but not limited to Adam, RMSProp, and Momentum.
  • Training 510 further comprises, at 528, either stopping or repeat the above steps for another iteration.
  • the stop criterion in can take multiple forms: stop after a fixed number of training iterations, stop when the loss function L has not decreased during a fixed number of iterations, stop when the loss or another associated metric has reached a desired value.
  • the example representation 600 is a memory exclusion graph, however as described above other representations may also be used.
  • the memory exclusion graph (MEG) 600 is an example of a program representation that can be statically extracted by a compiler’s intermediate representations.
  • a MEG describes a program’s logical memory objects (e.g., First-In First-Out buffers) that cannot share the same physical memory area. That is, objects that cannot be allocated to the same memory addresses. MEGs may be used for optimizing the memory footprint.
  • the MEG 600 illustrated in FIG. 6 comprises a plurality of vertices 602, each of which represents a logical memory object of a program.
  • Each vertex 602 is labelled with a first label 602a corresponding to the actor(s) in the program to which the memory object relates, and a second label 602b that indicates the size of the memory object.
  • a plurality of edges 604 extend between pairs of vertices 602.
  • An edge 604 extending between two vertices 602 represents a memory exclusion relation between those two vertices, that is the two memory objects represented by the vertices 602 cannot be allocated to the same physical memory addresses.
  • the MEG 600 can be used as a program representation in order to optimize the memory footprint of an input source program. Vertices 602 that do not have a edge 604 extending between them designate memory objects that can be allocated to the same physical memory area. This establishes how to reuse memory and thus to reduce a program’ s memory footprint.
  • a system may determine compiler parameter from the MEG 600.
  • the goal of benchmarking is to measure the“goodness” of compilation parameters with respect to the memory footprint for a program and its associated representation. More precisely, the benchmarking phase consists of measuring the physical memory area that is allocated by the compiled program. The amount of physical memory allocated is denoted by m.
  • a MWC is used in determining the loss value since the allocation of a MEG will never use less memory than the weight of its MWC.
  • a clique is a subgraph of a MEG’s vertices within which each pair of vertices is linked by an edge.
  • the MWC is the clique whose weight is the largest of all cliques in the graph.
  • the weight of a clique gives a lower bound to the amount of memory that must be allocated for all of the clique’s memory objects. This weight is equal to the sum of the sizes of all clique’s memory objects.
  • the subsets of vertices 602 labelled ABl;AB2;B2C2 and ClDl;D2E;C2D2;DlE are examples of cliques.
  • the MWC for the MEG 60 in Figure 6 is given by the vertices 602 labelled AB2;BlCl;B2C2;ClC2;ClDl .
  • Embodiments described herein can also be applied to other compilation approaches such as those based on Model-Driven Engineering.
  • software is developed from textual programming languages (e.g., C/C++, Java) that are used to write program sources 130.
  • alternative software development paradigms exist.
  • Model-Driven Engineering software is generated from domain-specific modeling languages. These graphical languages abstract a system’s structure, behavior and requirements and combine code generation engines that produce source code (e.g., C/C++), simulation and verification software or alternative model representations.
  • Embodiments described herein in relation to FIGs. 1 and 2 may be applied to such program sources.
  • An executable program can be compiled from model-based program sources. From the latter, a program representation can be extracted and executable programs can be benchmarked in order to learn the optimal compiler parameters.
  • a further embodiment is a computer program product comprising a computer readable storage medium having computer readable program code embodied therein, the computer readable program code being configured to implement one of the above methods when being loaded on a computer, a processor, or a programmable hardware component.
  • the computer readable storage medium is non-transitory.
  • program storage devices e.g., digital data storage media, which are machine or computer readable and encode machine-executable or computer-executable programs of instructions where said instructions perform some or all of the steps of methods described herein.
  • the program storage devices may be, e.g., digital memories, magnetic storage media such as magnetic disks and magnetic tapes, hard drives, or optically readable digital data storage media.
  • the embodiments are also intended to cover computers programmed to perform said steps of methods described herein or (field) programmable logic arrays ((F)PLAs) or (field) programmable gate arrays ((F)PGAs), programmed to perform said steps of the above-described methods.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

An apparatus and method for determining compiler parameters settings for program optimization is described. A representation of a program is generated from the program's sources, the representation including data regarding the program in relation to a performance metric. A system including an algorithm having at least some trainable weightsis used to determine compiler parameters from the representation. The system is trained using an exploration strategy which avoids the need for a training set with optimized parameters.

Description

Title
METHOD AND APPARATUS FOR DETERMINING COMPILER PARAMETERS
SETTINGS
Technical Field
[001] Various example embodiments relate generally to methods and apparatus for determining compiler parameters settings for program optimization.
Background
[002] Program sources, also known as source code, describe, in a humanly understandable language, the operations that a program performs. However, these program sources cannot typically be executed by the targeted hardware or virtual machine. Therefore, an executable program must be generated from the program sources through a compilation process. This is typically done by a compiler, which is a software that takes as an input the sources as well as parameters for setting the compilation process and produces an executable program. Some of these parameters relate to the performance optimization of the program, and are critical for achieving the desired performance requirements.
[003] The setting of these parameters is typically done through benchmarking and hand-tuning, which requires a significant amount of time and resources. The performance of the executable program is affected by the parameter settings input to the compiler.
[004] Often it is desirable to optimize the performance of the executable program with respect to an performance metric, such as memory footprint or energy usage. The biggest obstacle to practical optimization of compiler parameters is that it requires hand tuning using benchmarking, which may necessitate a high amount of memory, computational and/or input-output resources, especially if the program being optimized is greedy. In addition to the high amount of resources required, it takes a considerable amount of time to achieve good parameter settings.
Summary
[005] A method and apparatus are disclosed herein to avoid the requirement of having well-optimized settings for compilation parameters associated to the programs present in the training set by enabling the learning system to explore the space of possible settings by introducing small perturbations. The method and apparatus, once trained, may be able to map a given input program to compiler parameters which achieve high performance with respect to a predetermined performance metric.
[006] In one embodiment, an apparatus comprises means configured to perform: generating a representation of a program from the program’s sources, wherein the representation includes data regarding the program in relation to a performance metric; and determining, using a system including an algorithm having at least some trainable weights, compiler parameters from the representation, wherein the compiler parameters are configured such that compiling the program’s sources using the compiler parameters produced a program executable optimized with respect to the performance metric.
[007] In one embodiment, a method comprises generating a representation of a program from the program’s sources, wherein the representation includes data regarding the program in relation to a performance metric; and determining, using a system including an algorithm having at least some trainable weights, compiler parameters from the representation, wherein the compiler parameters are configured such that compiling the program’s sources using the compiler parameters produced a program executable optimized with respect to the performance metric.
[008] In one embodiment, a computer readable storage medium stores instructions which, when executed by a computer, cause the computer to perform a method. The method comprises generating a representation of a program from the program’s sources, wherein the representation includes data regarding the program in relation to a performance metric; and determining, using a system including an algorithm having at least some trainable weights, compiler parameters from the representation, wherein the compiler parameters are configured such that compiling the program’s sources using the compiler parameters produced a program executable optimized with respect to the performance metric.
Brief Description of the Drawings
[009] Example embodiments will now be described with reference to the accompanying drawings, in which:
[010] FIG. 1 shows an apparatus according to some embodiments described herein;
[Oil] FIG. 2 shows a system according to some embodiments described herein;
[012] FIG. 3 shows an apparatus according to some embodiments described herein;
[013] FIG. 4 depicts a high-level block diagram of an apparatus 400 suitable for use in performing functions described herein according to some embodiments; and [014] FIGs. 5 and 6 show a method according to some embodiments described herein. Detailed Description
[015] Example embodiments will now be described, including methods and apparatus that to avoid the requirement of having well-optimized settings for compilation parameters associated to the programs present in the training set by enabling the learning system to explore the space of possible settings by introducing small perturbations. The method and apparatus, once trained, may be able to map a given input program to compiler parameters which achieve high performance with respect to a predetermined performance metric.
[016] Functional blocks denoted as "means configured to perform ..." (a certain function) shall be understood as functional blocks comprising circuitry that is adapted for performing or configured to perform a certain function. A means being configured to perform a certain function does, hence, not imply that such means necessarily is performing said function (at a given time instant). Moreover, any entity described herein as "means", may correspond to or be implemented as "one or more modules", "one or more devices", "one or more units", etc. When provided by a processor, the functions may be provided by a single dedicated processor, by a single shared processor, or by a plurality of individual processors, some of which may be shared. Moreover, explicit use of the term "processor" or "controller" should not be construed to refer exclusively to hardware capable of executing software, and may implicitly include, without limitation, digital signal processor (DSP) hardware, network processor, application specific integrated circuit (ASIC), field programmable gate array (FPGA), read only memory (ROM) for storing software, random access memory (RAM), and non-volatile storage. Other hardware, conventional or custom, may also be included. Their function may be carried out through the operation of program logic, through dedicated logic, through the interaction of program control and dedicated logic, or even manually, the particular technique being selectable by the implementer as more specifically understood from the context.
[017] FIG. 1 illustrates an example apparatus 100 according to embodiments described herein.
[018] The apparatus 100 comprises means 110 configured to perform generating a representation 120 of a program from the program’s sources 130. The representation 120 includes data regarding the program in relation to a performance metric.
[019] The apparatus 100 comprises means 140 configured to perform determining, using a system including an algorithm having at least some trainable weights, compiler parameters S from the representation 120.
[020] In some embodiments, the apparatus 100 further comprises means 150 configured to perform compiling the program’s sources 130 using the compiler parameters S. The means 150 is a compiler in some embodiments. The compiler parameters S are configured such that compiling the program’s sources 130 using the compiler parameters S produces a program executable 160 optimized with respect to the performance metric.
[021] In some embodiments, the means 1 10 are configured to perform generating the representation 120 of the program from the program’s sources 130 from the compiler 150. In such embodiments, the representation 120 may comprise an intermediate representation generated by the compiler 150. In some embodiments, the representation 120 may be a static program representation, namely a representation generated without the need to run the executable generated by the compiler 150. Such representations can be generated using the compiler’s intermediate representations (e.g., number and type of instructions, control graphs).
[022] In some embodiments, the representation 120 comprises at least one representation selected from the list of: memory exclusion graph, control- flow graph, data flow graph, single static assignment form, and program dependence graph. Other representations known to those in the art may also be used. In some embodiments, the representation 120 may take the form of a vector representation of at least one of the listed representations.
[023] Referring now to FIG. 2, in some embodiments the system 140 is implemented as a neural network having a plurality of trainable weights. A vector Z is input to the system 140. The system 140 in some embodiments comprises a plurality of dense layers 142.
[024] Returning now to FIG. 1, in some embodiments the performance metric is at least one metric selected from the list of: memory footprint, execution time, processing throughput, and power consumption. Other performance metrics known to those skilled in the art may also be used.
[025] As described above, the representation 120 includes data regarding the program in relation to the performance metric. The representations 120 listed above essentially capture the flow of data (e.g., input samples) and control information (e.g., variables used in control statements such as loops, if-then-else), and in some cases the amount of data, in a program from the program sources 130. [026] As will be understood by the skilled person, the same representation 120 can be used for different purposes: for instance, both control- flow graphs and data-flow graphs can be used to track the value of variables and optimize the memory footprint. Further, different representations 120 can be used for the same goal. For instance representations such as call graphs, program dependence graphs and control flow graphs can all be used to optimize power consumption as they capture how often a code block is executed. Such representations 120 can be used to reduce the power consumption of a target machine by training the means 140 to determine compiler parameters that map code that is seldom executed to an energetically expensive processor and map code that is often executed onto a less power- hungry processor.
[027] Referring now to FIG. 3, in some embodiments, the apparatus further comprises means 200 further configured to perform training of the system l40’s trainable weights. The system 140 defines the mapping P— » S, where P is a set of program representations 120, and S is the set of compiler parameter settings. The system 140 is parametrized by a vector, and the aim of the training phase is to find values for the trainable weights that maximize the performance, with respect to a given performance metric, of the program compiled with the parameters determined by the system 140.
[028] The means 200 is configured to perform training of the system 140 as follows. A plurality of training program sources 230, which will be used to train the system 140, are provided.
[029] Typically, the program sources 230 are not used as inputs to the system 140 since learning a mapping from the program sources to the compiler parameters S would be inefficient. Instead, the means 200 is configured to perform generating a representation 220 of each training program from each training program’s sources 230. The representation 220 is chosen so that it includes pertinent data about the program sources 230 with respect to the performance metric being optimized. The system 140 is then fed with the representations 220 as described below. An efficient way of generating the representation 220 is using static program representations, which can be generated without the need of running an executable generated by the compiler 150, and therefore can be generated once for all the training program sources 230. Such representations 220 can be computed using the compiler’s 150 intermediate representations as discussed above. In some embodiments, the program sources 230 may be used as the representation 220 input to the system 140.
[030] The means 200 is further configured to perform training of the system 140 by selecting a set of N training program sources at random from the plurality of training program sources 230.
[031] The means 200 is next configured to perform training of the system 140 by determining, using the system 140, compiler parameters S for each training program from the representation 220 of each training program 220 in the set.
[032] In some embodiments, the means 200 is further configured to perform training of the system 140 by determining a set ofN perturbations, e, according to a distribution, P(e). In some embodiments, the perturbations, e, are determined independently. In some embodiments, the distribution, P(e), is a Gaussian distribution, for example with a mean of zero and a small variance s2.
[033] The means 200 is next configured to perform training of the system 140 by compiling each training program in the set from that training program’s sources using the determined compiler parameters modified by a perturbation. In some embodiments, the perturbation is a perturbation, e, in the set of perturbations. Thus, for the /th training program, the compiler parameters used to compile the program are s/ + c/, where s/ is the compiler parameters determined by the system 140 for the zth training program and e/ is the /th perturbation in the set of perturbations.
[034] In some embodiments, the means 200 is next configured to perform training of the system 140 by determining a loss value, /, pertaining to the performance metric for each compiled program 260 from the set of training programs by benchmarking. Program benchmarking aims at evaluating the effectiveness of the compiler’s optimizations by measuring the performance of a program in its compiled, executable form. This evaluation is conducted by providing each compiled program with different types of workloads (e.g., signal-processing operations involving different matrix and vector operations) to be run onto a specific target platform. Data are collected by profiling the executable program (e.g., monitor variables’ values, memory accesses, control statements, power usage), and from this data a scalar loss value /, relevant to a certain performance metric, is computed using a suitable loss function. The loss value / indicates how well the program is performing with respect to this metric.
[035] The means 200 is next configured to perform training of the system 140 by adjusting the trainable weights of the system 140 using a loss function pertaining to the performance metric. In some embodiments, the loss function is determined from the loss values / of the compiled programs in the set. In some embodiments, the system 140 is adjusted by applying one step of stochastic gradient descent (SGD) of variant thereof to the trainable parameters, or weights, of the neural network forming the system 140 using the loss function J
[036] where N is the number of training programs in the set selected at random from the plurality of training program sources 230, U is the loss value determined for the /th training program, Pr() means‘probability of, s/ are the compiler parameters determined by the system 140 for the zth training program, and c,· are the /th perturbation, and p, are the representation 220 of the /th training program. The loss function could take any suitable form and does not necessarily need to be differentiable. Any suitable SGD variant may be used, including but not limited to Adam, RMSProp, and Momentum.
[037] The means 200 is next configured to perform training of the system 140 by either stopping or repeat the above steps for another iteration. The stop criterion in can take multiple forms: stop after a fixed number of training iterations, stop when the loss function L has not decreased during a fixed number of iterations, stop when the loss or another associated metric has reached a desired value.
[038] In some embodiments, the size N of the set as well as the learning-rate and possible other parameters of the chosen SGD variant (e.g., ADAM, RMSProp, Momentum) are parameters of the means 200.
[039] As the means 200 does not rely on examples of optimized compilation parameters for programs forming a training set (as would be required using a supervised learning approach), any new program for which the apparatus 100 might be useful can be added to the training set, and be used to optimize furthermore the system 140 after its initial training phase.
[040] In some embodiments, parameters of the distribution P() can be chosen to be trainable e.g., if P() is a Gaussian distribution with mean m and variance s2 then m and s can be made trainable parameters.
[041] The skilled person will note that the loss function J is simply a function of which the gradient with respect to the trainable parameters is computed. The function is also known as the policy gradient. Methods known to the skilled person to improve the convergence speed of the training algorithm may be applied. [042] Training relies on exploring the space of possible representation to compiler parameter mappings. Exploring the space is done by trying new mappings that are small variations of the current mapping, using the perturbations. Exploring can be done in numerous ways, two of the most popular approaches being Gaussian policy and -greedy.
[043] In Gaussian policy, the perturbation is determined from a multivariate zero-mean normal distribution and added to the current compiler parameters. This ensures exploration “in the neighborhood” of the current compiler parameters. This is useful where the compiler parameters take values in a continuous set.
[044] In s-greedy, in which with probability l- , the compiler parameters are those determined by the system 140, and with probability a random compiler parameter is taken. This is useful in the case where the compilation parameters take values in a discrete set.
[045] The covariance matrix of the distribution from which the perturbations are determined, and the s parameter of the e-greedy approach, are usually fixed-parameters, i.e. not learned during training. These parameters control the“amount of exploration”, as making this parameters smaller reduces the amount of random exploration, and favors actions from the current policy of the system 140.
[046] Referring now to FIG. 4, in some embodiments, the means 110, 140, and 150 may take the form of an apparatus 400 comprising at least one processor 410 (e.g., a central processing unit (CPU) and/or other suitable processor(s)) and at least one memory 420 (e.g., random access memory (RAM), read only memory (ROM), or the like). The apparatus 400 further comprises computer program code 430 and various input/output devices 440 (e.g., a user input device (such as a keyboard, a keypad, a mouse, a microphone, a touch-sensitive display or the like), a user output device 450 (such as a display, a speaker, or the like), and storage devices (e.g., a tape drive, a floppy drive, a hard disk drive, a compact disk drive, non-volatile memory or the like)). The computer program code 430 can be loaded into the memory 420 and executed by the processor 410 to implement functions as discussed herein and, thus, computer program code 430 (including associated data structures) can be stored on a computer readable storage medium, e.g., RAM memory, magnetic or optical drive or diskette, or the like.
[047] Some embodiments relate to a method 500 as shown in FIG. 5. The method 500 comprises, at 502, generating a representation of a program from the program’s sources, wherein the representation includes data regarding the program in relation to a performance metric.
[048] The method 500 further comprises, at 504, determining, using a system including an algorithm having at least some trainable weights, compiler parameters S from the representation, wherein the compiler parameters are configured such that compiling the program’s sources using the compiler parameters produces a program executable optimized with respect to the performance metric.
[049] In some embodiments, the method 500 further comprises, at 506, compiling the program’s sources using the compiler parameters S. The compiler parameters S are configured such that compiling the program’s sources using the compiler parameters S produces a program executable optimized with respect to the performance metric.
[050] In some embodiments, generating 502 a representation of the program comprises generating the representation of the program from the program’s sources from a compiler. In such embodiments, the representation may comprise an intermediate representation generated by the compiler. In some embodiments, the representation may be a static program representation, namely a representation generated without the need to run the executable generated by the compiler. Such representations can be generated using the compiler’s intermediate representations (e.g., number and type of instructions, control graphs).
[051] In some embodiments, the representation comprises at least one representation selected from the list of: memory exclusion graph, control-flow graph, data-flow graph, single static assignment form, and program dependence graph. Other representations known to those in the art may also be used. In some embodiments, the representation may take the form of a vector representation of at least one of the listed representations.
[052] In some embodiments the performance metric is at least one metric selected from the list of: memory footprint, and power consumption. Other performance metrics known to those skilled in the art may also be used.
[053] In some embodiments, the method 500 further comprises, at 510, training the system as follows. At 512, a plurality of training program sources, which will be used to train the system, are provided.
[054] Next, at 514, a representation of each training program is generated from each training program’s sources. The representation is chosen so that it includes pertinent data about the program sources with respect to the performance metric being optimized. The representations may be static program representations generated without the need of running an executable generated by the compiler. Such representations can be computed using the compiler’s intermediate representations as discussed above.
[055] At 516, training 510 further comprises selecting a set of N training program sources at random from the plurality of training program sources.
[056] Training 510 further comprises, at 518, determining, using the system, compiler parameters S for each training program from the representation of each training program in the set.
[057] In some embodiments, training 510 further comprises, at 520, determining a set of N perturbations, e, according to a distribution, P(e). In some embodiments, the perturbations, e, are determined independently. In some embodiments, the distribution, P(e), is a Gaussian distribution, for example with a mean of zero and a small variance s2.
[058] Training 510 further comprises, at 522, compiling each training program in the set from that training program’s sources using the determined compiler parameters modified by a perturbation. In some embodiments, the perturbation is a perturbation, e, in the set of perturbations. Thus, for the zth training program, the compiler parameters used to compile the program are s/ + c/, where s/ is the compiler parameters determined by the system for the zth training program and ez is the zth perturbation in the set of perturbations.
[059] In some embodiments, training 510 further comprises, at 524, determining a loss value, /, pertaining to the performance metric for each compiled program from the set of training programs by benchmarking.
[060] Training 510 further comprises, at 526, adjusting the trainable weights of the system using a loss function pertaining to the performance metric. In some embodiments, the loss function is determined from the loss values / of the compiled programs in the set. In some embodiments, the system is adjusted by applying one step of stochastic gradient descent (SGD) or varaint thereof to the trainable parameters, or weights, of the neural network forming the system using the loss function J
[061] where N is the number of training programs in the set selected at random from the plurality of training program sources 230, U is the loss value determined for the zth training program, Pr() means‘probability of, s/ are the compiler parameters determined by the system for the zth training program, and e,· are the zth perturbation, and p, are the representation of the zth training program. The loss function could take any suitable forms and does not necessarily need to be differentiable. Any suitable SGD variant may be used, including but not limited to Adam, RMSProp, and Momentum.
[062] Training 510 further comprises, at 528, either stopping or repeat the above steps for another iteration. The stop criterion in can take multiple forms: stop after a fixed number of training iterations, stop when the loss function L has not decreased during a fixed number of iterations, stop when the loss or another associated metric has reached a desired value.
[063] Referring now to FIG. 6, an example representation 600, which may be used in some embodiments described herein, is illustrated. The example representation 600 is a memory exclusion graph, however as described above other representations may also be used. The memory exclusion graph (MEG) 600 is an example of a program representation that can be statically extracted by a compiler’s intermediate representations. A MEG describes a program’s logical memory objects (e.g., First-In First-Out buffers) that cannot share the same physical memory area. That is, objects that cannot be allocated to the same memory addresses. MEGs may be used for optimizing the memory footprint. A Memory Exclusion Graph is a undirected, weighted graph that can be formally denoted as G = <V;E;w>, where V is the set of vertices that represent indivisible (atomic) memory objects (e.g., a First-In First-Out buffer), E is the set of edges representing memory exclusion relation, i.e., the impossibility to share physical memory area, and w : V ® N is a function, with w(v) representing the weight of a vertex v. The weight of a vertex v corresponds to the size of the memory object that the vertex v denotes.
[064] The MEG 600 illustrated in FIG. 6 comprises a plurality of vertices 602, each of which represents a logical memory object of a program. Each vertex 602 is labelled with a first label 602a corresponding to the actor(s) in the program to which the memory object relates, and a second label 602b that indicates the size of the memory object. A plurality of edges 604 extend between pairs of vertices 602. An edge 604 extending between two vertices 602 represents a memory exclusion relation between those two vertices, that is the two memory objects represented by the vertices 602 cannot be allocated to the same physical memory addresses.
[065] In some embodiments, the MEG 600 can be used as a program representation in order to optimize the memory footprint of an input source program. Vertices 602 that do not have a edge 604 extending between them designate memory objects that can be allocated to the same physical memory area. This establishes how to reuse memory and thus to reduce a program’ s memory footprint. A system, as described above, may determine compiler parameter from the MEG 600.
[066] In this example, during training of the system, the goal of benchmarking is to measure the“goodness” of compilation parameters with respect to the memory footprint for a program and its associated representation. More precisely, the benchmarking phase consists of measuring the physical memory area that is allocated by the compiled program. The amount of physical memory allocated is denoted by m. The loss 1 is defined as the difference between m and the weight of the Maximum Weight Clique (MWC) of the program’s MEG 600, denoted by c. Thus the loss value is calculated as 1 = m - c.
[067] A MWC is used in determining the loss value since the allocation of a MEG will never use less memory than the weight of its MWC. A clique is a subgraph of a MEG’s vertices within which each pair of vertices is linked by an edge. The MWC is the clique whose weight is the largest of all cliques in the graph. In the context of a MEG, as the memory objects of a clique cannot share memory space because they mutually exclude each other, the weight of a clique gives a lower bound to the amount of memory that must be allocated for all of the clique’s memory objects. This weight is equal to the sum of the sizes of all clique’s memory objects.
[068] For instance, in the MEG 600 shown in Figure 6, the subsets of vertices 602 labelled ABl;AB2;B2C2 and ClDl;D2E;C2D2;DlE are examples of cliques. The MWC for the MEG 60 in Figure 6 is given by the vertices 602 labelled AB2;BlCl;B2C2;ClC2;ClDl .
[069] Embodiments described herein can also be applied to other compilation approaches such as those based on Model-Driven Engineering. Traditionally, software is developed from textual programming languages (e.g., C/C++, Java) that are used to write program sources 130. However, alternative software development paradigms exist. For instance, in Model-Driven Engineering, software is generated from domain-specific modeling languages. These graphical languages abstract a system’s structure, behavior and requirements and combine code generation engines that produce source code (e.g., C/C++), simulation and verification software or alternative model representations. Embodiments described herein in relation to FIGs. 1 and 2 may be applied to such program sources. An executable program can be compiled from model-based program sources. From the latter, a program representation can be extracted and executable programs can be benchmarked in order to learn the optimal compiler parameters.
[070] It will be appreciated that the functions depicted and described herein may be implemented in software (e.g., via implementation of software on one or more processors, for executing on a general purpose computer (e.g., via execution by one or more processors) so as to implement a special purpose computer, or the like) and/or may be implemented in hardware (e.g., using a general purpose computer, one or more application specific integrated circuits (ASIC), and/or any other hardware equivalents).
[071] A further embodiment is a computer program product comprising a computer readable storage medium having computer readable program code embodied therein, the computer readable program code being configured to implement one of the above methods when being loaded on a computer, a processor, or a programmable hardware component. In some embodiments, the computer readable storage medium is non-transitory.
[072] A person of skill in the art would readily recognize that steps of various above- described methods can be performed by programmed computers. Herein, some embodiments are also intended to cover program storage devices, e.g., digital data storage media, which are machine or computer readable and encode machine-executable or computer-executable programs of instructions where said instructions perform some or all of the steps of methods described herein. The program storage devices may be, e.g., digital memories, magnetic storage media such as magnetic disks and magnetic tapes, hard drives, or optically readable digital data storage media. The embodiments are also intended to cover computers programmed to perform said steps of methods described herein or (field) programmable logic arrays ((F)PLAs) or (field) programmable gate arrays ((F)PGAs), programmed to perform said steps of the above-described methods.
[073] It should be appreciated by those skilled in the art that any block diagrams herein represent conceptual views of illustrative circuitry embodying the principles of the invention. Similarly, it will be appreciated that any flow charts, flow diagrams, state transition diagrams, pseudo code, and the like represent various processes which may be substantially represented in computer readable medium and so executed by a computer or processor, whether or not such computer or processor is explicitly shown.
[074] While aspects of the present disclosure have been particularly shown and described with reference to the embodiments above, it will be understood by those skilled in the art that various additional embodiments may be contemplated by the modification of the disclosed machines, systems and methods without departing from the scope of what is disclosed. Such embodiments should be understood to fall within the scope of the present disclosure as determined based upon the claims and any equivalents thereof.

Claims

1. An apparatus (100, 200) comprising means configured to perform:
generating (110) a representation (120, 220) of a program from the program’s sources (130, 230), wherein the representation includes data regarding the program in relation to a performance metric; and
determining (140), using a system including an algorithm having at least some trainable weights, compiler parameters (s) from the representation (120, 220), wherein the compiler parameters (s) are configured such that compiling the program’s sources (130, 230) using the compiler parameters (s) produces a program executable (160, 260) optimized with respect to the performance metric.
2. The apparatus of claim 1, wherein the means are further configured to perform:
compiling (150) the program’s sources using the compiler parameters (s).
3. The apparatus of claim 1 or 2, wherein the means are further configured to perform:
generating the representation (120, 220) of the program from the program’s sources (130, 230) from a compiler, wherein the representation (120, 220) is an intermediate representation.
4. The apparatus of claim 3, wherein:
the representation (120, 220) is at least one representation selected from the list of: memory exclusion graph, control-flow graph, data-flow graph, single static assignment form, and program dependence graph.
5. The apparatus of any preceding claim, wherein:
the performance metric is at least one metric selected from the list of: memory footprint, execution time, processing throughput, and power consumption.
6. The apparatus of any preceding claim, wherein the means are further configured to perform: training (510) of the system, comprising:
providing (512) a plurality of training program sources (230); generating (514) a representation (220) of each training program from each training program’s sources (230), wherein the representation includes data regarding that training program in relation to a performance metric;
selecting (516) a set of training program sources at random from the plurality of training program sources (230);
determining (518), using the system, compiler parameters (s) for each training program from the representation of each training program in the set;
compiling (522) each training program in the set from that training program’s sources using the determined compiler parameters (s) modified by a perturbation (e);
adjusting (526) the trainable weights of the system using a loss function pertaining to the performance metric.
7. The apparatus of claim 6, wherein the means are further configured to perform training (510) of the system, comprising:
determining (520) a set of perturbations (e), according to a distribution, wherein each training program in the set is compiled using the determined compiler parameters (s) modified by a perturbation (e) in the set of perturbations;
determining (524) a loss value (1) pertaining to the performance metric for each compiled program by benchmarking;
adjusting (526) the trainable weights of the system using a loss function determined from the loss values (1) of the compiled programs in the set.
8. The apparatus of claim 6 or 7, wherein:
the trainable weights of the system are adjusted using stochastic gradient descent or a variant thereof.
9. The apparatus of any preceding claim, wherein the means comprises:
at least one processor (410); and at least one memory (420) including computer program code (430), the at least one memory and computer program code configured to, with the at least one processor, cause the performance of the apparatus.
10. A method (500) comprising :
generating (502) a representation of a program from the program’s sources, wherein the representation includes data regarding the program in relation to a performance metric; and
determining (504), using a system including an algorithm having at least some trainable weights, compiler parameters from the representation, wherein the compiler parameters are configured such that compiling the program’s sources using the compiler parameters produces a program executable optimized with respect to the performance metric.
11. The method of claim 10, further comprising:
generating (508) the representation of the program from the program’s sources using a compiler, wherein the representation is at least one intermediate representation selected from the list of: memory exclusion graph, control- flow graph, data-flow graph, single static assignment form, and program dependence graph.
12. The method of claims 10 or 11, wherein:
the performance metric is at least one metric selected from the list of: memory footprint, execution time, processing throughput, and power consumption.
13. The method of claims 10 to 12, further comprising:
training (510) the system, comprising the steps of:
providing (512) a plurality of training program sources;
generating (514) a representation of each training program from each training program’s sources, wherein the representation includes data regarding that training program in relation to a performance metric;
selecting (516) a set of training program sources at random from the plurality of training program sources; determining (518) , using the system, compiler parameters for each training program from the representation of each training program in the set; compiling (522) each training program in the set from that training program’s sources using the determined compiler parameters modified by a perturbation;
adjusting (526) the trainable weights of the system using a loss function pertaining to the performance metric.
14. The method of claim 13, wherein training (510) of the system further comprises:
determining (520) a set of perturbations (e), according to a distribution, wherein each training program in the set is compiled using the determined compiler parameters (s) modified by a perturbation (e) in the set of perturbations;
determining (524) a loss value (1) pertaining to the performance metric for each compiled program by benchmarking;
adjusting (526) the trainable weights of the system using a loss function determined from the loss values (1) of the compiled programs in the set.
15. A computer readable storage medium storing instructions which, when executed by a computer, cause the computer to perform a method (500), the method comprising:
generating (502) a representation of a program from the program’s sources, wherein the representation includes data regarding the program in relation to a performance metric; and
determining (504), using a system including an algorithm having at least some trainable weights, compiler parameters from the representation, wherein the compiler parameters are configured such that compiling the program’s sources using the compiler parameters produced a program executable optimized with respect to the performance metric.
EP18795482.1A 2018-10-24 2018-10-24 Method and apparatus for determining compiler parameters settings Withdrawn EP3871077A1 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/EP2018/079222 WO2020083487A1 (en) 2018-10-24 2018-10-24 Method and apparatus for determining compiler parameters settings

Publications (1)

Publication Number Publication Date
EP3871077A1 true EP3871077A1 (en) 2021-09-01

Family

ID=64049215

Family Applications (1)

Application Number Title Priority Date Filing Date
EP18795482.1A Withdrawn EP3871077A1 (en) 2018-10-24 2018-10-24 Method and apparatus for determining compiler parameters settings

Country Status (2)

Country Link
EP (1) EP3871077A1 (en)
WO (1) WO2020083487A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114564201B (en) * 2020-11-27 2025-07-04 华为技术有限公司 Compilation sequence determination method and related device
CN118227141B (en) * 2024-04-16 2024-12-31 沐曦科技(成都)有限公司 Evaluation method, device, equipment and medium for performance optimization of general GPU compiler

Also Published As

Publication number Publication date
WO2020083487A1 (en) 2020-04-30

Similar Documents

Publication Publication Date Title
US11995515B2 (en) DAG-Based CSP quantum circuit modeling
US10656940B1 (en) Systems, devices, and methods for source code generation from binary files
US11373114B1 (en) CSP-based synthesis of a quantum circuit
Wahib et al. Scalable kernel fusion for memory-bound GPU applications
US8954309B2 (en) Techniques for application tuning
US11281988B1 (en) Re-generation of a gate-level quantum circuit based on gate-level analysis
Hemker et al. A mixed-integer simulation-based optimization approach with surrogate functions in water resources management
CN114365158A (en) Visual creation and monitoring of machine learning models
CN113574327A (en) Determining causal models for a control environment
US20120310870A1 (en) Application configuration generation
Mariani et al. OSCAR: An optimization methodology exploiting spatial correlation in multicore design spaces
Li et al. Discovery of potential parallelism in sequential programs
US20120222013A1 (en) Modeling software behavior using learned predicates
Maas A taxonomy of ML for systems problems
Haj-Ali et al. Protuner: tuning programs with monte carlo tree search
WO2010113330A2 (en) Method and apparatus for design space exploration in high level synthesis
CN109588054A (en) Accurate and detailed modeling using distributed simulation engine to the system with large complicated data set
WO2020169182A1 (en) Method and apparatus for allocating tasks
Mosaner et al. Using machine learning to predict the code size impact of duplication heuristics in a dynamic compiler
Calotoiu et al. Extrapeak: Advanced automatic performance modeling for HPC applications
Hosny et al. Characterizing and optimizing EDA flows for the cloud
CN117273115B (en) Static generation method, device, equipment and medium of reverse calculation graph
Chisholm et al. A standardised benchmark for assessing the performance of fixed radius near neighbours
EP3871077A1 (en) Method and apparatus for determining compiler parameters settings
Witzke et al. Proactive resource management to optimize distributed workflow executions

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: 20210525

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 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)
STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE APPLICATION IS DEEMED TO BE WITHDRAWN

18D Application deemed to be withdrawn

Effective date: 20211215