[Paper Review] Finding representative sets of optimizations for adaptive multiversioning applications
This paper proposes a static multiversioning framework that automatically selects a minimal representative set of optimization variants for adaptive multiversioning applications, using machine learning to map dataset features to optimal code versions at runtime. By combining iterative off-line compilation with pruning and decision tree-based version selection, it achieves high performance with low code size and minimal runtime overhead, outperforming single-version binaries without dynamic recompilation.
Iterative compilation is a widely adopted technique to optimize programs for different constraints such as performance, code size and power consumption in rapidly evolving hardware and software environments. However, in case of statically compiled programs, it is often restricted to optimizations for a specific dataset and may not be applicable to applications that exhibit different run-time behavior across program phases, multiple datasets or when executed in heterogeneous, reconfigurable and virtual environments. Several frameworks have been recently introduced to tackle these problems and enable run-time optimization and adaptation for statically compiled programs based on static function multiversioning and monitoring of online program behavior. In this article, we present a novel technique to select a minimal set of representative optimization variants (function versions) for such frameworks while avoiding performance loss across available datasets and code-size explosion. We developed a novel mapping mechanism using popular decision tree or rule induction based machine learning techniques to rapidly select best code versions at run-time based on dataset features and minimize selection overhead. These techniques enable creation of self-tuning static binaries or libraries adaptable to changing behavior and environments at run-time using staged compilation that do not require complex recompilation frameworks while effectively outperforming traditional single-version non-adaptable code.
Motivation & Objective
- To address the challenge of code size explosion and performance loss when generating multiple optimized versions of functions for different datasets in static binaries.
- To enable run-time adaptation of statically compiled programs without requiring complex dynamic recompilation frameworks.
- To identify a minimal yet representative set of optimization variants that maintain high performance across diverse datasets.
- To develop an efficient, low-overhead run-time selection mechanism using machine learning to map input characteristics to optimal code versions.
- To minimize the number of versions while preserving performance and avoiding code bloat, especially in heterogeneous or virtualized environments.
Proposed method
- Apply off-line iterative compilation with random parameterized transformations (e.g., loop tiling, unrolling) across multiple datasets to generate a large pool of optimized function versions.
- Use a heuristic pruning strategy to iteratively eliminate suboptimal versions while maintaining overall performance and controlling code size growth.
- Extract dataset features (e.g., input size, data access patterns) to train supervised machine learning models such as decision trees or rule induction algorithms.
- Convert trained models into executable code for run-time version selection based on input characteristics, minimizing selection overhead.
- Integrate the framework into the Open64 compiler and plan for GCC integration, supporting hand-written, library-generated, or ISA-specific versions.
- Leverage hardware performance counters and staged compilation to enable self-tuning binaries that adapt to changing workloads at runtime.
Experimental results
Research questions
- RQ1How can a minimal yet representative set of optimization variants be selected to maintain high performance across multiple datasets without code size explosion?
- RQ2What machine learning techniques can effectively map dataset features to the best-performing optimized function version at run-time with low overhead?
- RQ3Can a static multiversioning framework achieve performance comparable to dynamic recompilation while avoiding complex runtime compilation infrastructure?
- RQ4How does the combination of iterative off-line compilation, pruning, and machine learning-based selection improve overall application adaptability in heterogeneous or virtualized environments?
- RQ5What is the trade-off between performance gain, code size, and selection overhead when using different classification algorithms for version mapping?
Key findings
- The proposed pruning-based method successfully reduces the number of optimization variants while preserving performance across all tested datasets, avoiding significant performance loss.
- Decision tree and rule induction models effectively map dataset features to optimal code versions, enabling fast and low-overhead run-time selection.
- The framework enables static binaries to adapt to changing workloads and environments at runtime without requiring dynamic recompilation or complex runtime systems.
- Experimental evaluation on kernels using Open64 shows measurable performance improvements over single-version binaries, with minimal runtime selection overhead.
- The approach is extensible to other compilers, hand-written versions, or different ISAs, supporting deployment in virtualized and heterogeneous computing environments.
- The framework demonstrates practical feasibility for creating self-tuning static libraries and binaries that maintain high performance across diverse execution scenarios.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.