[Paper Review] Compiler Phase Ordering as an Orthogonal Approach for Reducing Energy Consumption
This paper proposes compiler phase ordering as an orthogonal optimization strategy to reduce energy consumption in embedded and HPC workloads, using a graph-based model to generate energy-optimized pass sequences. Experiments on ARM and x86 platforms show up to 24% energy reduction without performance gains, demonstrating that performance-optimized compiler flags (e.g., -O3) do not always yield the most energy-efficient code.
Compiler writers typically focus primarily on the performance of the generated program binaries when selecting the passes and the order in which they are applied in the standard optimization levels, such as GCC -O3. In some domains, such as embedded systems and High-Performance Computing (HPC), it might be sometimes acceptable to slowdown computations if the energy consumed can be significantly decreased. Embedded systems often rely on a battery and besides energy also have power dissipation limitations, while HPC centers have a growing concern with electricity and cooling costs. Relying on power policies to apply frequency/voltage scaling and/or change the CPU to idle states (e.g., alternate between power levels in bursts) as the main method to reduce energy leaves potential for improvement using other orthogonal approaches. In this work we evaluate the impact of compiler pass sequences specialization (also known as compiler phase ordering) as a means to reduce the energy consumed by a set of programs/functions when comparing with the use of the standard compiler phase orders provided by, e.g., -OX flags. We use our phase selection and ordering framework to explore the design space in the context of a Clang+LLVM compiler targeting a multicore ARM processor in an ODROID board and a dual x86 desktop representative of a node in a Supercomputing center. Our experiments with a set of representative kernels show that there we can reduce energy consumption by up to 24% and that some of these improvements can only be partially explained by improvements to execution time. The experiments show cases where applications that run faster consume more energy. Additionally, we make an effort to characterize the compiler sequence exploration space in terms of their impact on performance and energy.
Motivation & Objective
- Address the gap in energy-efficient compilation by exploring compiler phase ordering as an orthogonal optimization dimension beyond performance.
- Investigate whether custom compiler pass sequences can reduce energy consumption more effectively than standard optimization levels like -O3.
- Characterize the design space of compiler phase orders in terms of their impact on both performance and energy consumption.
- Develop and evaluate a graph-based framework for generating energy-optimized compiler sequences tailored to specific functions and target architectures.
- Demonstrate that energy efficiency and performance are not perfectly correlated, especially under dynamic power management.
Proposed method
- Use a graph model to represent likely energy-efficient compiler pass orderings, trained on statistical data from previously optimized sequences.
- Implement a phase selection and ordering framework within a Clang+LLVM compiler targeting ARM (ODROID XU+E) and x86 (dual Xeon) platforms.
- Measure execution time, energy, and power consumption across multiple OpenMP thread configurations for 12 PolyBench/C kernels.
- Compare energy consumption of custom phase orders against standard compiler flags (-O1 to -O3) and baseline sequences.
- Apply a leave-one-out validation method to assess the effectiveness and scalability of the phase ordering exploration process.
- Use fingerprinting and clustering techniques to reduce the search space for compiler phase sequences, improving exploration efficiency.
Experimental results
Research questions
- RQ1Can compiler phase ordering be used as an orthogonal approach to reduce energy consumption beyond standard optimization levels like -O3?
- RQ2To what extent do performance-optimized compiler flags (e.g., -O3) lead to energy-optimized binaries, and where do they fall short?
- RQ3How do custom phase orders affect energy consumption relative to execution time, especially when performance degrades?
- RQ4What is the impact of different CPU architectures (ARM vs. x86) and power management policies on the effectiveness of phase ordering?
- RQ5Can a graph-based model trained on historical optimization data effectively predict energy-efficient phase sequences?
Key findings
- Compiler phase ordering can reduce energy consumption by up to 24% compared to standard -O3 optimization levels, even when performance is not improved.
- Some programs that run faster under -O3 consume more energy, demonstrating that performance and energy efficiency are not perfectly correlated.
- Energy savings from custom phase orders cannot be fully explained by execution time improvements, indicating that other factors such as memory access and power state transitions play a key role.
- The graph-based framework for phase ordering generation accelerates exploration by an order of magnitude compared to traditional methods like genetic algorithms.
- The approach is effective across diverse platforms, showing significant energy reduction on both ARM-based embedded systems and x86-based HPC workstations.
- Clustering-based pruning of the phase order space reduces exploration time by 18× compared to a genetic algorithm baseline, while achieving 43% performance speedups in prior work.
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.