Coder Social home page Coder Social logo

ic-lab-duth / fast-float4hls Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 3.0 12.71 MB

Fast Floating Point Operators for High Level Synthesis

License: MIT License

C++ 98.23% Shell 1.77%
floating-point-arithmetic fused-dot-product high-level-synthesis low-power

fast-float4hls's Introduction

Fast-Float4HLS

Fast-Float4HLS is a C++ header only library for floating point arithmetic operations developed to be used for High Level Synthesis implemetations.

Inside the header file <fast-float.h> is described a templated datatype 'fast_float<M,E>' together with a set of operations. The datatype supports different floating point representations depending on the definitions of the mantissa M and exponent E widths through the template. For example:

  • fast_float<23,8> is used for the single precision representation.
  • fast_float<52,11> is used for the double precision representation.
  • fast_float<7,8> is used for the representation of Brain Floating Point, bfloat16, developed by Google Brain.

Fast-Float4HLS depends only on ac_fixed library that is available in HLSLibs.

Also the post-synthesis RTL co-simultion of the given examples require the sc_verify flow of Catapult HLS. The necessary header (mc_scverify) is publicly available in ac_simutils.

Downloading the needed header-only libraries can be done by running the provided script set_libs.sh

Supported Operators

  • Addition (A+B)
  • Multiplication (A*B)
  • Multiply-Add (A*B + C)
  • Vector Dot Product (A[0]*B[0]+A[1]*B[1]+...+A[N-1]*B[N-1])

Addition and multiplication are overloaded also to + and * operators. The same holds for comparisons and assignment operators

Denormals

The operations of addition, multiplication and MAC support denormalized values through a template parameter ''DENORMALS''. By default, the operators do not support denormalized values, while converting them into zero values.

Currently the overloaded operators +, -, *, +=, -=, *= compute the corresponding operation without support for denormalized values.

Pending Features

  • Allow for possible increase the output precision of dot product.
  • Implement Division

Reference

The architecture and performance of the fused vector dot product unit, implemented as part of the FastFloat4HLS library, was published in the Journal of Low Power Electronics and Applications on Oct. 2022. You can find the paper here. To cite this work, please use:

@article{fused-fp-dot,
author = {Filippas, Dionysios and Nicopoulos, Chrysostomos and Dimitrakopoulos, Giorgos},
title = {Templatized Fused Vector Floating-Point Dot Product for High-Level Synthesis},
journal = {Journal of Low Power Electronics and Applications},
volume = {12},
year = {2022},
number = {4},
article-number = {56},

Contributors

Currently active: Dionysios Filippas, Christodoulos Peltekis and Giorgos Dimitrakopoulos

Past: Nikolaos Altanis

License

Fast-Float4HLS is licensed with the MIT License. You are completely free to re-distribute your work derived from Fast-Float4HLS

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.