Skip to content

POPiX2.0

Latest
Compare
Choose a tag to compare
@dbenkhal dbenkhal released this 10 Jan 10:32
f5360db

POPiX2.0: Floating to Fixed-Point Program Tuner for FPGA Hardware

POPIX 2.0 adds several features to POPiX that enhance its performance. One of these features is to include the generation of fixed-point program for FPGA-based hardware. The tool has been extended to use the ap_fixed library of fixed-point formats
for high-level synthesis (HLS) of FPGA programs instead of using a fixed library with a uniform 32-bit number representation in a previous version.

To use POPiX2.0, you must install the following dependencies:

🔨 Running the Example

  • Go inside Examples folder, choose a vitis example and copy its code to the file popix_src.

  • Next, open Main.java, add your the POPiX path on your machine at Line 15, and the path of the fixed-point library at Line 208

  • Compile POPiX2.0 with the following commands

java -cp /path-to-antlr-jar org.antlr.v4.Tool -Dlanguage=Java *.g4
javac -cp  /path-to-jars *.java  src/Boolean/*.java src/Constraint/*.java src/Expression/*.java src/Number/*.java src/Statement/*.java src/Main.java src/Util/*.java
  • Now you can run POPiX2.0 to tune precision of the program in popix_src using the following command
cd src
java -cp /path-to-jars/:. Main
  • if you encounter some compilation error, try to add the path to generated Grammar files to the classpath

    java -cp /path-to-jars/:/path-to-generated-Grammaire-files/:.Main
    
  • To modify the user's accuracy requirement or the output variable, it is enough to modify it directly in the require_nsb(variable, nb_bits) statement which is usually the last line of each of our programs.

Generated Files

Once the execution process is done successfully, this will generate the follwowing files:

  • popix_lab: program source annotated with control points at each node of the AST
  • constraints: prints the semantic equations generated for the program source
  • popix_output: Optimized program annotated with the couple |ufp, nsb| where ufp is the weight of the most ignificant bit of the variable and nsb is the optimized precision returned by POPiX (at bit-level)
  • popix_float.py: MPFR code to create a program that gives an exact result (i.e. 500 bits)
  • popix_mpfr.py: MPFR code generated with the optimized precisions returned by our POPiX
  • popix_vitis.cpp: fixed-point program written in C++ with the ap_fixed fixed-point library formats

To use a program generated with the ap_fixed library (popix_vitis.cpp), open the Vitis HLS tool and create a new project using the generated file. Import the source code, configure the project settings, and ensure the appropriate FPGA target is selected. Once set up, initiate the synthesis process to generate hardware descriptions (e.g., RTL). The synthesized results can then be analyzed to evaluate performance metrics such as latency, resource utilization, and power consumption.

You need to declare the input variables of your programs using the keyword vitis_inas shown

vitis_in [variable_name]

Extension

If you would like to test other examples, the programs must follow the grammar that implements the POPiX language. The grammar is available in the file Grammaire.g4.

Result Metrics

In addition to the generated files, the POPiX2.0 metrics after tuning will be displayed directly on the console. You will find:

  • Information about the LP solver: number of constraints/variables in the solver and whether an optimal solution was found
  • Total number of bits before/after tuning at bit-level
  • % of optimization at bit-level and in IEEE754 formats (FP16, FP32, FP64, FP128, FPxx)
  • Execution time measurements for each step of the POPiX workflow

📑 Cite This Work

POPiX version 1.0 is already available at GitHub release.
Please cite our PoPiX articles (CF'24, CoDIT'23, DASIP'22).

@inproceedings{KhalifaM24,
  author       = {Dorra {Ben Khalifa} and
                  Matthieu Martel},
  title        = {Compile-Time Optimization of the Energy Consumption of Numerical Computations},
  booktitle    = {Proceedings of the 21th ACM International Conference on Computing Frontiers, CF 2024},
  pages        = {},
  publisher    = {{ACM}},
  year         = {2024}
}

@inproceedings{KhalifaM23,
  author       = {Dorra {Ben Khalifa} and
                  Matthieu Martel},
  title        = {On the Functional Properties of Automatically Generated Fixed-Point
                  Controllers},
  booktitle    = {9th International Conference on Control, Decision and Information
                  Technologies, CoDIT},
  pages        = {786--791},
  publisher    = {{IEEE}},
  year         = {2023}
}

@inproceedings{BessaiKBM22,
  author       = {Sofiane Bessa{\"{\i}} and
                  Dorra {Ben Khalifa} and
                  Hanane Benmaghnia and
                  Matthieu Martel},
  title        = {Fixed-Point Code Synthesis Based on Constraint Generation},
  booktitle    = {Design and Architecture for Signal and Image Processing - 15th International
                  Workshop, {DASIP} 2022, Budapest, Hungary, June 20-22, 2022, Proceedings},
  series       = {Lecture Notes in Computer Science},
  volume       = {13425},
  pages        = {108--120},
  publisher    = {Springer},
  year         = {2022}
}

📋 License

POPiX 2.0 is licensed under the GNU GPL 3 license only.
Copyright (c) 2024. All rights reserved.

This program and the accompanying materials are made available under the terms of the GNU General Public License v3.0 only (GPL-3.0-only) which accompanies this
distribution, and is available at: https://www.gnu.org/licenses/gpl-3.0.en.html

Author : Dorra Ben Khalifa 📧 [email protected]