NEAT: A Framework for Automated Exploration of Floating Point Approximations

Saeid Barati, Lee Ehudin, Hank HoffmannarXiv 2021

TL;DR

This paper introduces NEAT, a novel framework that automates the exploration of accuracy-energy trade-offs for floating-point computations. By allowing users to define approximate floating-point implementations and programmable rules for their placement, NEAT helps discover energy-efficient configurations without manual code instrumentation or extensive expertise.

What Problem Does This Paper Address?

Modern computing systems are increasingly focused on energy efficiency, and a significant portion of energy consumption comes from floating-point operations (FPUs). While reducing the precision of floating-point numbers can save energy, it comes at the cost of accuracy. The challenge lies in finding the optimal balance between accuracy and energy savings for different parts of an application. Manually exploring the vast space of possible approximations and their placements within a program is prohibitively complex and time-consuming, even for domain experts. Existing solutions often require significant code modification or are limited in their flexibility.

Methods

NEAT is a dynamic instrumentation tool built using the Intel Pin framework. It allows users to:

  • Define Approximate Floating-Point Implementations (FPIs): Users can create custom FPIs, typically by truncating mantissa bits of standard floating-point formats (32-bit float, 64-bit double).
  • Specify Placement Rules: Users define rules that dictate where and when these FPIs should be applied. These rules can be:
  • Whole-Program (WP): A single FPI is used for all floating-point operations in the entire program.
  • Currently-In-Progress (CIP): A specific FPI is chosen for all floating-point operations within a given function.
  • Function Call Stack (FCS): The choice of FPI for a function can depend on its caller, allowing for more nuanced control.
  • Automated Exploration: NEAT uses a genetic algorithm (NSGA-II) to efficiently search the vast configuration space defined by FPIs and placement rules.
  • Energy and Accuracy Estimation: The tool dynamically instruments the program to collect data on floating-point operations, estimate FPU and memory access energy, and measure accuracy loss.

Datasets

The paper evaluates NEAT on benchmarks from the Parsec 3.0 and Rodinia 3.1 suites. For the neural network case study, it uses the MNIST dataset for digit recognition. No new benchmarks were introduced.

Key Insights and Ideas

  • Granularity Matters: Applying approximations at a finer granularity (e.g., per-function) yields significantly better energy savings than a whole-program approach, especially for accuracy-sensitive applications.
  • Programmable Rules are Key: The ability to define flexible placement rules, rather than just selecting a single approximation, is crucial for navigating the complex accuracy-energy trade-off space.
  • Automated Exploration is Essential: The sheer size of the configuration space makes manual exploration infeasible. NEAT's genetic algorithm effectively explores this space to find optimal configurations.
  • Memory Accesses are a Significant Energy Contributor: Reducing precision not only saves FPU energy but also memory access energy, as less data needs to be transferred.
  • NEAT is Applicable to Complex Domains: The framework demonstrates its utility in specialized areas like Convolutional Neural Networks (CNNs), where it can identify layer-specific precision requirements for optimal energy savings without compromising model accuracy.

Key Results

  • Energy Savings: Per-function (CIP) placement rules achieved up to 22.1% and 3.2% energy savings in FPU and memory respectively, with only a 1% accuracy loss, compared to the whole-program approach.
  • Memory Energy Savings: Increasing the error rate from 1% to 10% resulted in 3.2-10.5% less memory energy consumption.
  • Robustness: NEAT demonstrated robustness across different input sets, with high correlation coefficients (R-values) between training and test data for accuracy loss and FPU energy.
  • CNN Application: For a digit recognition CNN, NEAT found optimal precision levels for each layer, achieving significant energy savings without substantial accuracy degradation. For instance, with 1%, 5%, and 10% accuracy loss, NEAT with per-layer-instance (PLI) placement achieved 6%, 4%, and 3% more energy savings compared to a default configuration.

Limitations and Future Work

  • Limitations:
    • The genetic algorithm is a heuristic, meaning it might not always find the absolute global optimum, especially for specific configurations or benchmarks where the CIP approach doesn't dominate WP.
  • The current FPIs are primarily based on bit truncation of mantissa bits.
  • Future Work:
    • Explore additional machine learning techniques for configuring floating-point usage.
  • Investigate runtime systems for dynamically tuning floating-point usage in changing workloads.
  • Implement control schemes in hardware for floating-point approximation.

Summary updated

BibTeX
@misc{barati2021neat,
  author = {Saeid Barati and Lee Ehudin and Hank Hoffmann},
  title = {{NEAT: A Framework for Automated Exploration of Floating Point Approximations}},
  year = {2021},
  eprint = {2102.08547},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2102.08547},
}
Figure