Autotuning in High-Performance Computing Applications
Paper · 2018 · Prasanna Balaprakash, Jack J. Dongarra, Todd Gamblin et al.
Summary
Scientific software can run correctly on a new supercomputer and still run slowly. A loop arrangement that makes good use of one processor’s memory may waste time on another. A parallel execution policy that pays off on large pieces of a simulation may cost more than it saves on small ones. Balaprakash and colleagues examine how autotuning addresses these problems. An autotuner generates or exposes alternative implementations, estimates or measures their performance, and selects a suitable version. The goal is performance portability, meaning that the same application source can deliver high performance across different machines without requiring an extensive manual rewrite for each one.
The paper surveys tools that make decisions at different levels. A library can time several versions of a standard operation before settling on an implementation for a particular machine. A compiler can generate versions of an application loop with different orders, block sizes, or arrangements of work. At the application level, a tuner can choose a numerical solver or decide how to execute a calculation when its input becomes available. These choices also differ in when the work happens. A search before deployment can leave the running program with a single selected implementation, while training on earlier runs can leave it with a lightweight decision to make whenever it encounters a new input.
The authors draw on case studies from their earlier work. A stencil-aware implementation in PETSc achieved speedups between 1.8 and 4.8 for matrix–vector computations over NVIDIA Cusp in a regular-grid problem. In the SMG2000 multigrid benchmark, a workflow extracted expensive loops, tuned them, and reinserted them into the program, improving overall performance by 27%. A CPU optimization integrated into Nek5000 reached up to 1.26X speedup for the full application on 256 Jaguar nodes. In the hydrodynamics code CleverLeaf, choosing between sequential and OpenMP execution according to the input achieved up to 2.5x speedup on 256 cores for the Sedov problem.
The authors place these gains alongside the work required to sustain them. Searching takes time, performance measurements lose relevance as software and hardware change, and generated variants need to produce scientifically acceptable answers. The sparse solver and hydrodynamics examples show why reusable search tools still need access to information about the computation. The paper argues that autotuning will become easier to adopt when it fits into ordinary builds, can reuse relevant measurements, and can be reapplied as applications and architectures evolve.
Deep dive: Autotuning in High-Performance Computing Applications
This survey explains how autotuning finds faster implementations for scientific software and what it takes to keep them fast as computing systems change. · about 33 minutes to read
The problem and its context
Why moving a program can mean tuning it again
The authors start from the diversity of large computing systems. They describe RoadRunner as a combination of standard AMD64 multicore processors and custom IBM Cell processors. By the end of 2017, the leading machines they name drew on fundamentally different processor architectures from different vendors. For developers, a move between systems could mean revisiting the organization of parallel work, the way data is laid out, and which pieces of a calculation fit into fast memory.
A programming interface can make it possible to express work for several kinds of hardware. The paper points to CPU and GPU support in OpenMP 4 as an example. The ability to express where a computation can run leaves open how it should run there. Block size, data placement, and the division of work among threads can still depend on the machine. Code originally arranged around the behavior of one device can therefore require substantial changes to make effective use of another. These are central concerns in GPU and parallel computing.
The same problem can arise in the life of a single application on a single system. The paper uses a change in data layout as an example of something that can make a previously tuned computation worth tuning again. Some applications also face a changing workload within a run. A numerical calculation may be called on pieces of a mesh with different sizes and shapes, so a choice made for the application as a whole can be too coarse. The portability problem consequently has a maintenance dimension and an input-dependent dimension. A tuning system has to account for the situations in which its choices will be used.
Manual tuning can address each of these situations, but the investment is repeated as conditions change. A programmer can rewrite a dominant loop to exploit a processor feature, then face the same task when the target changes or when the loop ceases to dominate the revised application. Autotuning moves some of this work into a repeatable search. A programmer or tool specifies the alternatives and their constraints. The tuner explores them and makes the resulting choice available to the application. The specification may survive a change that invalidates a particular chosen implementation.
Why libraries were a natural starting point
Early systems could take advantage of a design already common in numerical software. A library interface hides the implementation of widely used computations from applications that call them. The Basic Linear Algebra Subprograms, or BLAS, provide such an interface for dense linear algebra. A program can ask for a general matrix multiplication, known as GEMM, and let the linked library handle its implementation. With this arrangement, a change to the matrix multiplication code can benefit many applications without changing their calls.
The paper traces early work on tuning GEMM to PHiPAC and ATLAS in the early 1990s. ATLAS illustrates why a standard library operation is an attractive place to search. Its mathematical task and interface are established, while many choices remain about how to organize the code. The system can detect hardware characteristics, use specialized knowledge to discard unlikely candidates, and then time the compiled alternatives. The same relatively focused tuning work can be reused by applications that share the operation.
A library boundary can also encourage adoption. Where an established interface exists, an application may be able to adopt a tuned implementation by linking against it. A standard can also give developers access to a reference or vendor implementation if an independently tuned library becomes unavailable. The authors describe a different route for FFTW, a library for the fast Fourier transform. Its interface became widely used in a setting where an established standard had yet to take hold. The authors point to the use of its interface in vendor libraries as part of that history.
Sparse linear algebra shows how much the approach depends on the interface and the computation. A sparse matrix contains enough zero entries that its representation can focus storage and work on the nonzeros. Different patterns of nonzeros can favor different representations and methods. Deciding how to store a matrix may require inspecting the actual input, and reorganizing the data has a cost of its own. The authors also describe more variety in sparse data structures and calling conventions, with less agreement on a common interface. A tuning technique can be effective for a particular sparse operation yet remain difficult to deliver broadly through existing solver software.
Library designers can exploit expertise that a general transformation tool may lack. The survey uses SPIRAL as an example of a system that represents linear signal transforms symbolically so that mathematical structure helps it generate alternative algorithms. It also discusses sparse libraries that use knowledge of likely input patterns to choose representations and implementations. Those gains in specificity help explain both the appeal and the reach of library tuning. When an application’s calculation meets the conditions and assumptions specified by a library’s interface, the application can use the knowledge built into that library.
What compilers and applications can express
The paper describes a compiler tradition in which optimization decisions rely on analytical estimates and heuristics designed to avoid slowing common workloads. A compiler choosing a default strategy for many programs has reason to be cautious about a transformation whose effect depends strongly on the input or processor. An autotuning compiler can examine the code under conditions closer to its eventual use. It can generate multiple versions and choose according to what performs well for the computation and machine at hand.
The transformations considered by these tools change how a program carries out its work. Tiling divides iterations into blocks so that a calculation can reuse data while it is close to the processor. Unrolling places the work of several iterations in the loop body, giving the compiler a different sequence of operations to work with. Permutation changes the order of loops in a nest. The survey also discusses joining or splitting loops, requesting data ahead of its use, and reorganizing data. A transformation can have parameters of its own, and the order in which transformations are applied can matter. A compiler tuner therefore needs a way to describe both the available changes and the combinations worth considering.
Application-level systems can express decisions that require knowledge of what the program is trying to accomplish. A program can expose several solvers or several ways of decomposing a problem. PetaBricks and Sequoia illustrate size-dependent selection. Tuning can locate the problem sizes at which different implementations become preferable, leaving a runtime lookup to make the choice. Other systems use features of the input itself. An application comparing alternative solvers may need details about a linear system that become available only when it is about to be solved.
Programmer involvement changes with the level of the choice. A widely used library can deliver a tuned routine to many programs from one implementation effort. A compiler can reuse transformations across calculations, although the authors describe deriving the right search space automatically as a difficult problem. Application developers can make more substantial changes available to the tuner because they know which algorithms and results are acceptable. The cost is that someone familiar with each application has to supply that information.
Frameworks such as RAJA and Kokkos offer another place to make choices explicit. As described in the paper, they can represent a loop through its body and a policy that controls execution. The developer expresses the calculation in the application, and the policy specifies how the hardware will carry it out. A static policy is useful when a choice can be made in advance. A system such as Apollo can keep several policies available and select one while the program runs. That possibility connects the portability framework to the rest of the tuning process, from collecting evidence about each policy to deciding when a new choice is warranted.
The method, step by step
The paper surveys a family of methods. They share a sequence of decisions even though each tool implements a different part of it. The first decision is what the tuner is allowed to change. The next is how it will obtain evidence about possible choices. The last is how the chosen code, or the means of choosing it, becomes part of an application. A build that produces a single implementation and a simulation that selects a policy for each input both fit this description.
From a tunable computation to a deployed choice
The steps in order.
Define the alternatives and the objective
A search space is the set of choices the tuner can consider. In a numerical library it may describe many generated versions of one operation. In a compiler it can be a transformation recipe with parameters to fill in. In an application it may comprise distinct algorithms or a set of execution policies. Each fully specified choice is a configuration. A configuration might determine an order for the loops, a tile size, and an unroll factor. Together those values describe a version that the tool can generate and evaluate.
An effective description exposes differences that could plausibly affect the objective. ATLAS is the paper’s example of using hardware information to make the search more tractable. It detects properties such as cache sizes and characteristics of the floating-point pipeline, then uses heuristics to screen the proposed implementations. The remaining alternatives are generated, compiled, run, and timed. The knowledge that narrows the search is specific to the operation and its implementation, while the timing experiment distinguishes among the candidates that survive.
Transformation recipes let specialized knowledge enter a more general compiler framework. A recipe can say which transformations a loop nest should undergo and leave some values for the tuner to set. Alternatively, it can describe several sequences of transformations. Tools that let programmers express transformations can expand what the system considers, as illustrated by POET and Xevolver. Once the alternatives are encoded, producing many variants becomes less laborious than writing each one separately.
An application can offer choices whose acceptability depends on scientific judgment. The paper describes GS2, a plasma physics code in which the grid-point count and the energy grid affect the simulation’s output. Experts limited the values the tuner could try so that any resulting changes would fall within tolerable bounds. This makes the search space part of the scientific specification. The performance objective can then guide the search among permitted configurations, with acceptable accuracy defined independently of speed.
Runtime is the main objective in many examples. The authors also describe evaluating other performance quantities when they matter for a particular tuning problem. Whatever quantity is chosen, the scope must be clear. Measuring an extracted loop helps compare versions of that loop. Evaluating the rebuilt application answers a separate question about the effect on the full run.
Generate programs that can be evaluated
The SMG2000 study illustrates how a compiler workflow can turn a region of application code into a tuning target. The ROSE compiler outlines expensive loop nests. Outlining means extracting the loops into functions that can run separately with data representative of their use in the application. Those functions make it possible to try a new version of an expensive region without invoking the full program for every search decision.
CHiLL supplies the code transformations in that workflow. The described recipe applies permutation, tiling, and unrolling in a fixed sequence. The recipe leaves particular optimization values open for Active Harmony to choose during the search. Once selected, the variants return to the application for evaluation there. The tools thus divide responsibility for identifying and extracting the code, producing its versions, and choosing which configurations to try.
In the Nek5000 CPU case, the motivation for generating code comes from the size and shape of the matrices in the application. Its repeated multiplications involve small rectangular matrices. The authors describe conventional BLAS implementations as generally optimized for large square matrices whose working data exceeds the capacity of parts of the memory hierarchy. CHiLL can generate a loop ordering tailored to the application’s matrices and unroll the loops to make reuse of registers and independent instructions available to the compiler. The native Intel ICC compiler then translates the result for the target. The variants were few enough for the study to explore them exhaustively.
The sparse solver case extends generation to the representation of the data. Its important operation is sparse matrix multivector multiplication, abbreviated SpMM. It multiplies a sparse matrix by a narrow collection of dense vectors organized as a matrix. The paper describes the dimensions as follows.
A (m × n) · B (n × k)
A is the sparse input matrix and B is the dense input matrix. The dot denotes matrix multiplication. The letter m gives the number of rows of A, and n gives the shared dimension, which is the number of columns of A and rows of B. The letter k is the number of columns of B. The multiplication signs inside the parentheses describe matrix dimensions. The right-hand matrix is tall and narrow because it contains a small collection of vectors of length n.
For this computation, the CHiLL workflow converts the sparse matrix into a compressed sparse block representation. The paper calls the approach inspector–executor. The inspector performs the data transformation, and the executor carries out the calculation on the new representation. Because the matrix in this example is symmetric, the representation can store the upper triangular portion and support parallel work involving the matrix and its transpose. The generated implementation also uses short integers in the information that points to the start of each block, reducing the movement of index data. It marks selected code for AVX vectorization through directives understood by Intel ICC. These features were made available to the generator in part by studying the manually optimized implementation.
Decide which configurations are worth measuring
Empirical search evaluates a configuration by running it and observing the objective. Complete enumeration is the most direct case. The tuner measures every configuration in the specified space, or every configuration that remains after pruning, then selects the best observed result. This works when the number of candidates is manageable and each trial is affordable. As tunable parameters and their possible values accumulate, an exhaustive approach can become too expensive.
Search that proceeds without a performance predictor can use the measurements in different ways. A global search aims to cover more of the space while using evidence acquired so far. The paper places methods such as simulated annealing and genetic algorithms in this group and emphasizes that practical runs stop at a specified limit. A local search examines alternatives defined as neighbors of a current configuration and moves toward better measured results. Its neighborhood might be shaped around the meaning of the tuning parameters. Progress stops when the search finds no improving neighbor. A good initial setting can make this a productive use of a short budget. The same procedure can settle in an unpromising region if the starting point is poor.
Predictive search tries to estimate performance without running every proposed configuration on the target. An analytical approach can use properties of code or hardware. The authors describe extracting control flow and instruction counts from compiled PTX, a representation of a CUDA program. Those properties can support an estimate of GPU occupancy for choices such as thread counts and block sizes. Code still has to be generated and compiled for this analysis, but the estimate can reduce or eliminate execution trials. The approach is most informative when the quantities derived from code capture what drives actual performance.
An empirical predictor learns from measured configurations. The tuning process samples part of the search space, evaluates those settings on the target, and records the objective with the corresponding parameter values. These pairs serve as training examples for supervised machine learning.
A fitted predictor can stand in for some expensive trials. A search can use it to rank candidate settings after training, or the training and search can proceed together. The paper illustrates the latter procedure with a sequence of evaluated points, a fitted surrogate for the measured objective, and newly proposed points expected to perform well. Those proposals are evaluated, their measurements are added, and the predictor is fitted again. The search proceeds within the user’s evaluation budget. In this setup, the measurements drawn from promising regions serve both to find configurations and to improve the next set of predictions.
The authors also discuss using earlier runs as training material. Here the information that identifies a measurement matters as much as the value itself. A time recorded for one arrangement of code, data, and hardware is useful when a later decision can establish how closely those conditions match. A performance database can record the search setting and its provenance. The paper points to TAUdb as an example of infrastructure for storing such measurements.
Train a decision for the input that actually arrives
A runtime selector solves a different practical problem from a search for one configuration on a representative input. It needs enough information about a new input to decide among implementations already available to it. The features must be informative, and collecting them must be cheap enough that the selection still pays off.
The Lighthouse project applies this strategy to large sparse linear systems. It searches among pairs consisting of a solver and a preconditioner. A preconditioner changes the form of the system presented to the solver to support the numerical solution process. During training, candidate pairs are sampled on a large and varied collection of linear systems. Each system is characterized by fewer than ten features chosen to be easy to compute. At runtime, the classifier uses the features of a new system to return a list of configurations expected to work well. The selector is integrated into existing solver interfaces, allowing applications to use it through those interfaces.
Apollo applies input-dependent selection to a finer-grained decision. In the hydrodynamics studies, the same loop may run on arrays associated with mesh patches of different shapes and sizes. The body of the computation is expressed through RAJA, and alternative policies are available for executing it. Training prepares a lightweight selector that can use information about the arrays when control reaches the kernel. In the reported dynamic comparisons, its choice is between sequential execution and OpenMP execution. That choice can be made repeatedly within a run as the work presented to the same kernel changes.
Measurement can be transparent to the application or informed by application annotations. The authors describe Dyninst as an example of infrastructure that can collect observations through binary instrumentation. They describe Caliper as a way for developers to associate measurements with meanings that are apparent in the program, such as a physics phase or an iteration in a solver. Such information can support context-dependent decisions and relate observations from different layers of the software. The context useful for one kernel may be irrelevant to another, so the paper treats the way it is collected as part of the tuning design.
Verify the result and decide when tuning happens
A performance result establishes how quickly a variant ran under particular conditions. The authors treat validity of the answer as a separate requirement. A tuner can compare an output with the result of a trusted implementation using a specified tolerance. A domain-specific check can instead rely on known numerical error bounds or, where appropriate, evidence such as convergence behavior. This distinction matters for parallel reductions and other transformations that can alter the order of operations. Different numerical outputs can meet the same criterion for accuracy. A candidate that fails the intended check can be discarded or regenerated.
The point in the software lifecycle at which tuning occurs determines what infrastructure is needed. An offline search can produce a variant to compile or link into the final application. Developers can also compile several candidates and defer only selection until runtime. With more alternatives than are practical to include in a binary, a dynamic approach may generate, compile, and link variants during execution. Active Harmony and ADAPT are the paper’s examples of systems that can try variants while an iterative computation continues and substitute improved implementations when they are found.
Incremental tuning adds a way to carry evidence forward. Measurements gathered earlier help a later run spend less of its own time exploring, provided the earlier observations still apply. This arrangement depends on identifying the application version, configuration, input conditions, and target environment with enough precision to judge relevance. The paper’s continuum from compile-time to runtime support reflects the choices involved. The same application can use offline tuning for choices that are stable across a workload and defer decisions whose relevant inputs appear only during a run.
Experiments and results
The reported results come from case studies of different scientific computations and from earlier studies discussed by the authors. An input can be a regular grid, a collection of sparse linear systems, or a simulation with changing mesh patches. A comparison can concern a kernel, a full application, the performance of several libraries as more cores are used, or the amount of source a programmer supplies. Those distinctions matter to the interpretation of each result. A kernel speedup concerns one portion of the application's computation, while an overall speedup includes time spent elsewhere.
PETSc stencil computations on a GPU
The PETSc example starts with a numerical application on a regular grid. A stencil gives the pattern of nearby grid values involved in a calculation. In a matrix representation, that pattern determines where the relevant coefficients appear. The study evaluates a partial differential equation application discretized with a 3-D seven-point stencil. The structure of the resulting matrix is known before execution and remains fixed, which makes a specialized storage scheme possible.
The study uses a packed dense format tailored to the stencil. A general compressed sparse row representation tracks the column positions of stored entries. In this case, the known pattern provides a way to organize the stored values without relying on the same indirect memory accesses. PETSc’s high-level interfaces also allow the new matrix and vector types to support the computation without application source changes. Orio generates and tunes the operations involving those data types and can specialize them to the sizes used in the application.
For matrix–vector computations in the stencil problem, the reference is NVIDIA Cusp, a vendor-optimized library. The reported speedup ranges between 1.8 and 4.8. The range describes the matrix–vector operations in that evaluation. The paper reports the endpoints without assigning them in its discussion to named input sizes or configurations.
Reported speedup endpoints for PETSc seven-point stencil matrix–vector computations over NVIDIA Cusp
The tuned implementation's performance advantage over Cusp varies across the reported comparisons.
The numbers
| System or setting | speedup × |
|---|---|
| Tuned PETSc, low end of reported range | 1.8 |
| Tuned PETSc, high end of reported range (this paper) | 4.8 |
This comparison tests the combined effect of a specialized data representation and tuned implementations against an existing library. The known stencil pattern is central to both parts of the approach. It enables the storage change and gives the tuner a regular computation to specialize. A sparse problem whose structure varies would provide a different set of opportunities and costs for the same library interface.
Solver selection in Lighthouse
The Lighthouse case changes the unit of tuning. The alternatives are solver–preconditioner pairs for large sparse linear systems, of the kind supported by PETSc and Trilinos. The training workload is a large and varied set of systems. The procedure samples choices on those systems, associates the observations with easy-to-compute features, and prepares a classifier to recommend configurations for new inputs.
The case describes how a learned selection mechanism fits an existing numerical interface. Its output is a list of likely candidates, so the result concerns guidance at the algorithmic level. The paper gives no numerical comparison with a default solver, no error rate for the classifier, and no reported training and test split for this case. Its evidence here is the organization of the selection procedure and its integration into the solver interface. It serves a different role from the timed PETSc stencil comparison, where the baseline and range of speedups are explicit.
Whole-application optimization in SMG2000
SMG2000 is a benchmark for semi-coarsening multigrid on structured grids. A multigrid calculation works with representations of a problem at different grid resolutions. The study uses the benchmark to test an end-to-end compiler workflow. ROSE extracts expensive loop nests with representative inputs. CHiLL generates their alternatives, and Active Harmony navigates the settings for the transformations. The implementations found by the search are then inserted back into the benchmark.
The comparison concerns the original and tuned versions of the full application. When the application uses the selected code, the reported overall performance improvement is 27%. This number is especially relevant to the scope of the workflow. The candidates can be evaluated as extracted regions, while the outcome of interest is measured with those regions back in the application that uses them. The case demonstrates that tuning isolated loops can yield a measurable benefit at that broader scope for this benchmark.
The description identifies the sequence of transformations and the tools that perform the individual jobs. It gives the overall result for the combined workflow. The reported 27% therefore belongs to the tuned application as a whole. The contribution of loop permutation, tiling, and unrolling individually remains open.
CPU specialization and GPU generation in Nek5000
Nek5000 is a spectral element application whose computation makes extensive use of small rectangular matrix multiplications. The CPU study targets the loops involved in these multiplications. CHiLL explores permutations and unrolling choices to arrange the work for Intel SSE vector execution, expose data reuse in registers, and give Intel ICC opportunities to schedule independent instructions. The search enumerates a small space of candidates.
The paper reports a full-application speedup of up to 1. Using 256 nodes of Oak Ridge’s Jaguar yielded a 26× speedup. Although the condition motivating the work is the particular sizes of matrices in an important kernel, the measurement covers the whole application. The generated CPU code was integrated into the production version of Nek5000. The study therefore records both a performance result and a concrete deployment outcome for that implementation.
The paper also describes a wider GPU optimization of the same application. Instead of limiting generation to the matrix multiplication, that effort targets the enclosing calculation, called local_grad3. It uses Octopi to express tensor contractions, CUDA-CHiLL for generation, and the SURF search algorithm in Orio. A tensor contraction combines arrays by summing along shared dimensions. Expressing the larger calculation in this form exposes more of the work to the generator. For this case, the paper provides no GPU speedup figure and notes that the application developers still had to adopt the implementation when the paper was written.
Sparse multivector multiplication and programmer input
The LOBPCG case concerns a solver that uses sparse matrix multivector multiplication. It compares code generated by CHiLL with a manually optimized implementation for the same algorithm, discussed in earlier work on sparse matrix multivector multiplication.
The authors report that the compiler-directed optimization outperformed the manually tuned code by 3%. They also report a distinct comparison of source sizes. The manual SpMM implementation was over 2000 lines, and the source given to CHiLL for that computation was 7 lines. The paper describes this as a 300× difference. The source measurements concern the application-specific implementation and the computation supplied to the generator, respectively. The code generator contains the transformation capabilities that let the short input serve as a description of the computation.
Source lines in the manual SpMM implementation and the CHiLL input for LOBPCG
The input to CHiLL expresses the computation in far fewer lines than the handwritten implementation.
The numbers
| System or setting | lines of code |
|---|---|
| Manual SpMM implementation, reported lower bound | 2000 |
| SpMM input supplied to CHiLL (this paper) | 7 |
This productivity evidence is about the size of the code that expresses the calculation. The study also makes the supporting effort visible. It required extensions to CHiLL informed by the manual version, including data and loop transformations that enabled the generated implementation to reproduce important aspects of its behavior. The result shows how implementation knowledge can move from the source of one algorithm into reusable compiler facilities. The size comparison leaves open the total engineering time invested in building those facilities.
Parallel FFT and performance across software layers
The OFFT study considers distributed fast Fourier transforms, where an implementation has to manage computation and communication together. A fast local calculation can still spend time waiting for data owned elsewhere. An implementation can overlap part of that communication with computation, and the paper describes how the timing of calls into the message-passing layer affects that overlap. MPI, the communication interface used in the example, may need periodic polling to advance pending transfers and determine whether they have finished.
The timing decision has costs in both directions. Polling interrupts local work, so calling the routine too frequently consumes execution time. Calling it too rarely can leave transfers waiting and reduce overlap. The tuner can choose different intervals at different places in the implementation. It can also vary communication tile and window sizes and the sizes of smaller computational tiles. The authors report 24 tunable parameters. Active Harmony converged to a configuration the authors describe as optimal after trying about 35 parameter combinations in this case.
The performance comparison uses strong scaling on Edison at NERSC, from 128 to 32K cores. Strong scaling keeps the workload fixed and increases the computing resources assigned to it. The figure compares OFFT with FFTW, DCMP, and UPCF and includes an ideal speedup line. The original FFTW uses a 1-D decomposition of the data, so its series ends at 1024 cores. The other comparisons support the paper’s reported pattern that OFFT was faster at the plotted scales where implementations could be compared and that its performance advantage grew with core count.
The scaling result concerns a vertically integrated implementation. A parameter can affect the local calculation, the organization of data transfers, or the progress of communication while calculation continues. Treating these decisions together lets the tuner find combinations that work as a whole. The paper describes their joint result through scaling behavior and the amount of search effort. Its account gives no individual runtime for a plotted core count.
Dynamic execution in CleverLeaf and ARES
The hydrodynamics study examines calculations whose inputs change during execution. CleverLeaf uses adaptive mesh refinement, which adjusts the resolution of parts of a simulated domain and produces patches of different sizes. ARES is a multiphysics hydrodynamics code that uses an arbitrary Lagrangian–Eulerian formulation. Its hotspot problem provides another setting in which work can vary across the domain. Both use RAJA to express the loops to which execution policies apply.
The paper’s plots examine the top eight kernels in the hydrocodes and show that timings can differ by orders of magnitude with array size, shape, and execution policy. The timings used to characterize variability include different ways of running the kernels, including GPU execution. The reported adaptive runs evaluate a choice between sequential and OpenMP execution. That distinction narrows what the headline speedups demonstrate. They measure the value of adapting the choice of on-node execution to changing inputs in these runs.
For the Sedov problem in CleverLeaf, the authors report up to 2.5x speedup on 256 cores, with Apollo applied throughout the code. They report a speedup of up to 15% for the ARES hotspot problem using 256 cores, with all tuning done in the Lagrange hydrodynamics phase. The paper gives those speedups under the stated scopes without identifying every setting of the baseline policy in its discussion. A direct comparison of the headline values would conflate different applications, different problems, and different fractions of the code using the tuner.
The study also reports that the gains increased for larger-scale runs. The authors connect this to the way a strongly scaled run divides its domain. More cores lead to finer pieces of the fixed problem, and smaller local patches can offer too little work to recover the cost of launching an OpenMP parallel region. An input-dependent policy can run such patches sequentially and still select parallel execution where the work warrants it. This is a case in which the decision made for one call may be inappropriate for the next call to the same kernel.
What the ablations show
The paper has no formal ablation study of a single autotuner, but it discusses direct comparisons and analyses of search budgets, permissible choices, scaling, and input-dependent execution.
A search algorithm’s value depends on the space and the budget
According to the authors, random search outperformed the other search algorithms evaluated in earlier comparisons. Those studies covered global and local approaches, including genetic algorithms and simulated annealing in the global group and methods such as Nelder–Mead in the local group. The paper attributes the outcome to the prevalence of high-performing configurations in the problems examined. If many points perform well, sampling can find a satisfactory point without spending much effort learning the shape of the space. It also observes that local methods were less effective in studies where they had received little customization to the tuning tasks.
A separate comparison analyzed global and local methods when tuning time was short. Under those conditions, the additional exploration of global methods was less useful. With a good initial configuration, local search could reach a high-performing variant within the available time. Poor starting configurations reduced the effectiveness of methods sensitive to where search began. This supports a conditional conclusion about search effort. The distribution of good configurations, the quality of available starting points, and the amount of time for exploration help determine whether a method’s behavior is advantageous.
The two comparisons address different sources of difficulty. A space with many good choices can reward broad sampling. A short search near a promising starting point can reward carefully designed moves among nearby choices. The paper treats the tuning problem and its budget as essential information for interpreting which algorithm did well.
Expanding the space can change the best achievable result
The GS2 example gives a comparison in which the meaning of an acceptable variant changes. The more restrictive search considers parameters that leave the simulation answer the same. Informed by domain experts, the broader search can vary both the grid point count and the energy grid within acceptable ranges. The paper reports an extra 30% reduction in runtime relative to the best autotuned version using only answer-preserving parameters.
This result shows what becomes possible when the performance search can use domain knowledge about accuracy. The source of additional freedom is the new set of permitted configurations. The study does not assign a separate effect to the grid-point count and the energy grid. Their combined availability moves the boundary of what the tuner can try. A practical consequence for this example is that the faster version depends on the domain experts’ criterion for an acceptable answer.
The sparse solver case also illustrates the importance of which implementations a tuner can generate. Its comparison places the generated implementation alongside a strong manual baseline for the same algorithm. The authors describe adding capabilities after examining the manual code. The outcome provides evidence that a compiler can express and reproduce sophisticated techniques given the right transformations. It leaves the speed contribution of any single transformation, such as compression of indices or the use of vector directives, unmeasured in the paper’s discussion.
Scaling makes runtime information more valuable in these hydrocodes
The hydrodynamics measurements reveal the behavioral reason for keeping several execution policies available. Patch size and shape vary, and the relative cost of policies varies with them. Strong scaling pushes more work units into the range where the authors say OpenMP launch overhead can dominate the useful computation. The improvement associated with dynamic selection grows in the reported larger runs, consistently with this explanation.
CleverLeaf and ARES illustrate the same mechanism under different coverage. CleverLeaf uses Apollo across the application. ARES uses it in one phase. Their respective gains establish that input-dependent selection can matter at both scopes in the reported problems. The paper does not present the two applications as a controlled test of how much more an identical workload would gain from expanding the tuner to every phase. Their different scientific computations and workloads prevent that attribution.
The OFFT analysis likewise concerns behavior as more resources are used. The comparison with other FFT libraries shows how the relative performance of implementations changes at scale. The authors give a concrete mechanism for why polling frequency can affect overlap, and they optimize that frequency together with data transfer and computation settings. The scaling curves evaluate the resulting implementation. They leave open how those same curves would change if polling were fixed and the other parameters were retuned.
Limitations
Limits the authors identify
The authors regard adoption as a software engineering problem as much as a search problem. Offline tuning can add repeated compilation and execution to a developer’s workflow, and some trials must run on the target platform. That effort can delay quick development builds. The paper calls for ways to bypass expensive tuning during ordinary iteration and set hard limits on the time or number of evaluations a tuning run consumes. A developer who agrees to search during a port or a release may have a much smaller budget during routine edits.
The build process determines whether tuning can be repeated when necessary. Incorporating one generated implementation makes it possible to verify and deploy that code, but a change in the application or architecture can leave it poorly suited to its new context. The authors describe Orio as usable through a compiler wrapper, so a build can invoke it through infrastructure it already uses. For larger packages, they identify Spack’s build harness and its ability to set up compiler wrappers as a possible integration point. Spack can mediate how different packages configure their compilers. The authors present its use for broad autotuner integration as an opportunity.
The authors also identify the work of defining the search space and features as a barrier. A tuning system has to expose useful variants compactly or derive them automatically. Expert programmers may be able to specify a useful set of transformations, while other users may want the benefits without supplying a recipe. A classifier poses a similar problem when choosing its input features requires substantial manual effort. The paper points to collecting features through a common framework, as with RAJA and Apollo, as a way to reduce that burden. It also calls for a way to connect detailed performance observations to the program abstractions developers recognize.
Context changes complicate reuse of earlier measurements. The target machine may differ from the system available for offline experiments. The resources available to an application may also change because of energy management or component failure. The paper describes early prediction work that uses past measurements from other architectures. It reports that such prediction is most effective when the source and target have related architectures or resources. A proxy can help when it captures a dominant cost, such as synchronization. Its usefulness depends on how closely that cost explains what the application experiences on the target.
A single developer may have too few applications and inputs to create predictors that work over a wide range of conditions. The authors envisage facilities helping to gather measurements across many workloads and systems, with mechanisms to record and share the information securely. They also recognize that users are unlikely to want to manage the resulting volume of tuning data themselves. This is an institutional dependency in the authors’ proposal. It takes collection and stewardship across a facility to supply the kind of training coverage they describe.
Correctness and maintainability matter after selection, particularly when the application changes variants while running. The authors discuss tolerance-based comparisons, domain error bounds, and other evidence of acceptable numerical behavior. They describe formal correctness proofs as a possible route to checking more complex automatically generated variants, with substantial cost. They also recognize the challenge of debugging automatically generated code. Large scientific applications may be in use for decades, so developers need confidence that a tuning tool will be maintained through that lifetime. The authors regard integration into widely used, trusted open-source software as a route to longer-term availability.
Limits visible in the case studies
The reported findings establish that the approaches worked on the examined computations under their own conditions. How frequently similar improvements arise elsewhere remains an open question. The case studies use different hardware, inputs, software layers, and baselines. PETSc is compared with a vendor library for a specific stencil computation. Nek5000 and SMG2000 report full-application results. OFFT is evaluated as core count increases. These scales of measurement give evidence about different questions, so the paper supplies no common performance estimate across them.
Several comparisons combine changes. The specialized PETSc storage layout and Orio-generated operations are evaluated together. OFFT tunes computation and communication settings together. The sparse solver combines a data representation change, adjustments to index storage, and changes that support vectorization. These combined interventions are relevant to how the implementations actually run. They limit attribution of the observed gains to any individual optimization or to the choice of search algorithm alone.
The reported benefits rely in several cases on structure that was already understood. The PETSc stencil has a fixed pattern. Nek5000 supplies known matrix sizes that justify specialization. The LOBPCG study can use symmetry in its data representation, and development of CHiLL’s transformations draws on a manual implementation. Such details are precisely what give the tuner a productive space to search. The studies leave open how readily that space could be derived for an unfamiliar computation, where an expert has yet to identify either the useful variants or their constraints.
Training and search costs also receive uneven quantitative coverage. The OFFT case reports how many parameter combinations were tried. The Lighthouse case describes the character of its training collection and features without a numerical generalization result. The Apollo cases report speeds for the named workloads and coverage of the code without showing how a trained selector would fare on unrelated inputs or a different machine. The paper leaves open how many later runs would be needed in each case to recover offline tuning costs, and how often changes would trigger new tuning.
The code-size comparison has a similarly specific scope. Counting the source given to CHiLL shows how much application-specific implementation the programmer can express compactly. It does not measure the time required to add the necessary compiler capabilities, validate the generated versions, or maintain the surrounding tool. The production integration of the CPU optimization in Nek5000 is direct evidence of adoption for that case. The GPU work shows a broader automated generation process at an earlier point in adoption. Runtime gains, compact source, successful generation, and production use are separate outcomes in the paper’s evidence.
What came after
Subsequent studies that cite and extend this survey are not documented here. The authors do describe directions in which they expected the work to develop. Their outlook centers on retuning as part of the life of a scientific application. A build-integrated tuner could reapply an established search when code, libraries, or hardware change. Earlier measurements could inform that search, and runtime selection could handle decisions that depend on information available only during execution.
They also anticipate a broader range of variants. As software is adapted for many-core processors, GPUs, and heterogeneous systems, candidate implementations can differ in algorithms and data structures as well as in loop parameters. The paper points to communication-avoiding algorithms as an example of changes that can reduce data movement, and it notes that alternative numerical algorithms can differ in convergence or stability. Including those alternatives in a search gives the tuner more substantial decisions to make and increases the importance of specifying acceptable numerical behavior.
The authors see related opportunities in deep learning and data analytics, where the performance of matrix and vector operations can matter to larger computations. Their argument is that a growing range of possible implementations increases the value of tools that can generate and evaluate them. The cases in the survey show how that process can work at several levels. The open question they leave for future work is how to make it repeatable enough to follow applications and their workloads through successive changes in hardware and software.
Cite
Cite as Prasanna Balaprakash, Jack J. Dongarra, Todd Gamblin, Mary W. Hall, Jeffrey K. Hollingsworth, Boyana Norris and Richard W. Vuduc. 2018. Autotuning in High-Performance Computing Applications. Proceedings of the IEEE.
@inproceedings{balaprakash2018autotuning,
title = {{Autotuning in High-Performance Computing Applications}},
author = {Prasanna Balaprakash, Jack J. Dongarra, Todd Gamblin, Mary W. Hall, Jeffrey K. Hollingsworth, Boyana Norris and Richard W. Vuduc},
booktitle = {Proceedings of the IEEE},
year = {2018},
doi = {10.1109/jproc.2018.2841200},
url = {https://doi.org/10.1109/jproc.2018.2841200}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/balaprakash-2018-autotuning-high-performance-computing-applications/