Skip to content
/ HARP Public

ICCAD'23 Best Paper Award candidate: Robust GNN-based Representation Learning for HLS

License

Notifications You must be signed in to change notification settings

UCLA-VAST/HARP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HARP

Publication

About

This repo contains the codes for building HARP, an automated framework to be trained to act as the surrogate of the HLS tool. It can be used to expedite the design optimization process. The database used in this repo is built using the AMD/Xilinx HLS tools, but can be replaced by other databases.

HARP develops a GNN-based model and builds a hierarchical graph to tackle the long range of dependency in programs. It also decouples the representation of program and its transformations (i.e., pragmas), allowing the model to learn the individual impact of each of these components. These optimizations not only enhance the performance of the model and the design space exploration based on it but also improve the model’s transfer learning capability, enabling easier adaptation to new environments.

Content

  1. Requirements and Dependencies
  2. Project File Tree
  3. Running the Project

Requirements and Dependencies

Requirements

You can install the required packages for running this project using:

sudo apt-get install python3-venv
python3 -m venv venv
source venv/bin/activate
pip3 install --upgrade pip
pip3 install -r requirements.txt

Graph Generation

The graph generation requires LLVM. If you want to expand on the existing graphs, please consider installing it.

This project is built on LLVM 13 that can be installed by:

wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh <version number>

Database Generation

The initial database is generated by AutoDSE which is built on top of the Merlin Compiler. If you want to expand the database, please consider installing them.

For synthesizing the designs, three versions of the AMD/Xilinx HLS tools have been used, SDAccel 2018.3 (denoted with v18), Vitis 2020.2 (denoted with v20), and Vitis 2021.1 (denoted with v21).

Project File Tree

The project file structure is as below:

.
+-- dse_database          # database, graphs, codes to generate/analyze them
    +-- [machsuite/poly]  # the source code, ds config, and database for each of the benchmarks
    +-- generated_graphs  # the generated graphs for each of the kernels
    +-- merlin_prj        # the Merlin project to run each of the kernels
+-- models                # the best trained models along with the initial one-hot encoder
+-- src                   # the source codes for defining and training the model and running the DSE

Running the Project

The src/config.py contains all the tunable parameters of the project. The current configuration runs DSE using the trained models for v21 (Vitis 2021.1). If you want to change the modes of running, please edit this file.

After setting the configurations, run the following command to execute the project:

cd src
python3 -W ignore main.py

You can run the src/main.py for training, inference, and design space exploration based on the parameters in src/config.py. For generating the graph, run the following command:

cd dse_database
python3 -W ignore graph_gen.py 

Citation

If you find any of the ideas/codes useful for your research, please cite our paper:

@inproceedings{harp2023,
    title={Robust GNN-based Representation Learning for HLS},
    author={Sohrabizadeh, Atefeh and Bai, Yunsheng and Sun, Yizhou and Cong, Jason},
    booktitle={In Proceedings of the 42nd IEEE/ACM International Conference on Computer-Aided Design (ICCAD)},
    year={2023}
}

About

ICCAD'23 Best Paper Award candidate: Robust GNN-based Representation Learning for HLS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published