Git Product home page Git Product logo

posit-hls's Introduction

Generating Posit-Based Accelerators With High-Level Synthesis

This repo contains the code to reproduce the experiments, as well as the results, from the paper Generating Posit-Based Accelerators With High-Level Synthesis.
It can also serve as an example of how to use HLS for the generation of posit arithmetic accelerators.

Prerequisites

You need to install a modified version of the Bambu framework. More precisely, clone the following repo, which contains the necessary modifications to make Bambu work with posit units: https://github.com/RaulMurillo/PandA-bambu. Then follow the official installation instructions.

⚠️ Note: Ensure you install Bambu from the `posit_utils` branch.

After the installation, you must pre-characterize the target device you wish to use. To that end, you need to use the Eucalyptus tool. You can use the characterize_device_custom.sh script from PandA-bambu/etc/devices/ directory with the following arguments:

--devices=<list of target devices comma separated> --eucalyptus=/bin/eucalyptus --spider=/<bambu installation dir>/bin/spider -j8 -c"--flopoco=posit"

The resulting .xml file must be copied into the corresponding folder within PandA-bambu/etc/devices/.

Finally, compile and install the tool again.

⚠️ Note: This makes Bambu work just with the posit format, breaking compatibility with floating-point. To restore the original functionality, execute the previous script without the `-c"--flopoco=posit"` argument, and repeat the following steps. You can keep the different `.xml` files and just replace and compile (but the name must be preserved).

Usage

To generate a posit-based accelerator, take any C program using floating-point numbers, and use the option --flopoco=posit when calling Bambu. The float and double types will be automatically translated by 32 or 64-bit posits.

⚠️ Note: The automatic simulation of Bambu will fail when using posits, since it relies on C floats to simulate the behavior of the accelerator. Generating testbench with all 0's usually avoids this issue.

Structure of the repo

  • Both Bambu and Vitis_HLS contain a similar structure, with one subdir per test. Operation-level applications can be found at the root, while real applications are grouped under the polybench folder.
  • The sources from Bambu can serve as examples of how to use Bambu to generate posit-based accelerators. For more details, see the bambu.sh scripts.
  • In error_eval, the numerical error of the different PolyBench applications is computed via software emulation (for faster computation).

Publications

Overview paper:

R. Murillo, A. A. D. Barrio, G. Botella and C. Pilato, "Generating Posit-Based Accelerators With High-Level Synthesis," in IEEE Transactions on Circuits and Systems I: Regular Papers, doi: 10.1109/TCSI.2023.3299009.

If you find this project useful, please do not forget to cite this paper.

Acknowledgments

This work was supported in part by MCIN/AEI/10.13039/ 501100011033 under Grant PID2021-123041OB-I00; in part by the “ERDF—A Way of Making Europe;” in part by the 2020 Leonardo Grant for Researchers and Cultural Creators, BBVA Foundation, under Grant PR2003_20/01; in part by CM under Grant S2018/TCS-4423; in part by the EU Horizon 2020 Programme under Grant 957269; and in part by the HiPEAC6 Network funded by the EU Horizon 2020 Programme under Grant ICT-2019-871174.

posit-hls's People

Contributors

raulmurillo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.