Skip to content

Bellerophon is a genetic optimization tool for Approximate Computing (AxC). It is meant to be use in collaboration with Clang-Chimera.

License

Notifications You must be signed in to change notification settings

andreaaletto/Bellerophon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bellerophon

Build Status License: GPL v3

An evolute search engine for Approximate Computing.

Introduction

Bellerophon is a genetic optimization tool for approximate computing. It is meant for using in collaboration with clang-Chimera. Indeed, Clang-Chimera provides the code mutation feature, while Bellerophon uses Genetic Algorithm for explore approximate variants and finds the pareto-frontier solutions. Bellerophon includes the ParadisEO metaheuristic framework.

Bellerophon is part of the IIDEAA project. For further information, please refer to IIDEAA website.

Build Bellerophon from source

Now you will understand how to compile and install Bellerophon correctly.

Install LLVM/Clang


Bellerophon is intended to be used together with Clang-Chimera, so you need to install LLVM/Clang in the same way as specified in Clang-Chimera readme, so please refer to its section Install LLVM/Clang.

Install ParadisEO


Bellerophon requires ParadisEO metaheuristics framework. Use the following commands to download and install ParadisEO 2.0.1:

$ cd ~
$ wget https://gforge.inria.fr/frs/download.php/31732/ParadisEO-2.0.1.tar.gz
$ tar xvfz ParadisEO-2.0.1.tar.gz && rm -f ParadisEO-2.0.1.tar.gz
$ cd ParadisEO-2.0
$ mkdir build && cd build

Before running CMake, it is necessary to solve two issues due to the latest version of "CMake Policy Requirement" and ConfigureChecks. These issues can be easily solved, by upgrading to 3.3 the minimum CMake version of the package eo and commenting the inclusion of ConfigureCheks.

$ sed -i "s/CMAKE_MINIMUM_REQUIRED(VERSION 2.6)/CMAKE_MINIMUM_REQUIRED(VERSION 3.3)/g" ../eo/CMakeLists.txt
$ sed -i "s/INCLUDE(ConfigureChecks.cmake)/#INCLUDE(ConfigureChecks.cmake)/g" ../eo/CMakeLists.txt

Now it is possible to run CMake configuration. As well as Clang-Chimera, also for Bellerophon, a compilation with Ninja building tool is recomended, in order to exploit the multicore platform by default.

$ cmake .. -G Ninja
$ ninja
$ sudo ninja install

Install Bellerophon


First of all you need to download Bellerophon source and prepare it to the building phase:

$ cd ~
$ git clone https://github.com/andreaaletto/Bellerophon.git
$ cd Bellerophon

In order to build Bellerohon it is necessary to adjust the CMakeLists.txt file, by adding the currently installed LLVM components and linking ParadisEO library. This can be automated with the script run_cmake (assuming that ParadisEO source is located in ~/ParadisEO-2.0):

$ chmod +x run_cmake
$ ./run_cmake

Now you can build and install Bellerophon with ninja-build:

$ ninja
$ sudo ninja install

At the end of the process you will find Bellerophon in /usr/local/bin. Try run:

$ bellerophon -version

How To Use

Running bellerophon without input parameters, it will print the following short helper:

    OVERVIEW: Launch a design space exploration over a C/C++ project compiled just-in-time

    USAGE: bellerophon [subcommand] [options] <tau> <source0> [... <sourceN>]

    OPTIONS:

    Bellerophon:
    Options for the Bellerophon tool

     -P=<path>                                 - Specify the path of the parent directory of a .param file
     -arcs=<archive object-path>               - Specify an archive object, or multiple comma separated, to load when linking the executable. It can be specified multiple times
     -cd-dir=<cd-dir>                          - Specify the path of a parent directory in which search for a compile_database.json file
     -extra-arg=<string>                       - Additional argument to append to the compiler command line
     -extra-arg-before=<string>                - Additional argument to prepend to the compiler command line
     -l                                        - Show approximate technique list
     -libdb=<string>                           - Specify the patch in which of the parent directory of a library_database.csv file
     -objs=<path to object file ('.o' , '.so'> - Specify an object, or multiple comma separated, to load when linking the executable. It can be specified multiple times
     -p=<string>                               - Build path
     -r=<string>                               - Report produced by Approximation Operator
     -t=<string>                               - Select the approximate technique to apply
     -test                                     - Simple test
     -v                                        - Enable verbose outputs
    
    Generic Options:

     -help                                     - Display available options (-help-hidden for more)
     -help-list                                - Display list of available options (-help-list-hidden for more)
     -version                                  - Display the version of this program

Bellerophon takes some inputs for testing the approximate variants. First, with -cd-dir flag, it takes a compilation database, useful to provide compilation commands to the JIT engine. With -r flag you can pass a report in CSV format that specifies in which place of the code Bellerophon has to apply approximation techniques. This two inputs usually are generated and provided by Clang-Chimera.

Bellerophon takes other inputs, such as the particular approximate computing technique that has to be applied by using the -t flag. The flag -P provides a path to a .param file that specifies Genetic Algorithm parameters. Finally, it is mandatory to specify a tau value, which is considered as the maximum error that each approximate configuration causes.

Quick Start

If you don't want to build LLVM/Clang and Bellerophon from scratch, a ready-to-use solution is provided through a Docker Container. Please refer to IIDEAA Docker repository for further details.

LICENSE


Contributing


Github is for social coding: if you want to write code, I encourage contributions through pull requests from forks of this repository.

About

Bellerophon is a genetic optimization tool for Approximate Computing (AxC). It is meant to be use in collaboration with Clang-Chimera.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 97.3%
  • CMake 2.6%
  • Shell 0.1%