• Stars
    star
    191
  • Rank 202,877 (Top 4 %)
  • Language
    C++
  • License
    MIT License
  • Created over 4 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AutoSA: Polyhedral-Based Systolic Array Compiler

AutoSA: Polyhedral-Based Systolic Array Auto-Compilation

Documentation | Installation | Tutorials | Examples

This repository includes the code for AutoSA. AutoSA is an end-to-end systolic array compiler based on the polyhedral model. It takes algorithms in high-level programming languages (C) as inputs, performs polyhedral transformation and other architecture optimizations to map algorithms to systolic array architecture. The generated designs are in HLS C.

Quick Start

We offer a Docker image for quick start.

docker pull whbldhwj/autosa:latest

Let's try one small example. The input code can be found at ${AUTOSA_ROOT}/autosa_tests/mm/kernel.c. The code region to be transformed to systolic array is annotated using a pair of pragmas scop and endscop.

  1. Generating HLS C Code.

Run the following command to compile generate a systolic array.

./autosa ./autosa_tests/mm/kernel.c \
--config=./autosa_config/autosa_config.json \
--target=autosa_hls_c \
--output-dir=./autosa.tmp/output \
--sa-sizes="{kernel[]->space_time[3];kernel[]->array_part[16,16,16];kernel[]->latency[8,8];kernel[]->simd[2]}" \
--simd-info=./autosa_tests/mm/simd_info.json \
--host-serialize

The generated code can be found in ${AUTOSA_ROOT}/autosa.tmp/output/src/. For detailed explaination of each AutoSA compilation option, please run

./autosa --help

or refer to AutoSA Compilation Options.

  1. Generating FPGA Bitstream

To generate the final bitsteam, set up your local Vitis development kit first. Then execute the makefile to build the design.

cp ${AUTOSA_ROOT}/autosa_tests/mm/Makefile autosa.tmp/output/
cp ${AUTOSA_ROOT}/autosa_tests/mm/connectivity.cfg autosa.tmp/output/
cd ${AUTOSA_ROOT}/autosa.tmp/output
make all

Makefile Options Descriptions

  • MODE := hw_emu: Set the build configuration mode to HW Emulation, other modes: sw_emu|hw
  • PLATFORM := xilinx_u250_xdma_201830_2: Select the target platform
  • KERNEL_SRC := src/kernel_kernel.cpp: List the kernel source files
  • HOST_SRC := src/kernel_host.cpp: List the host source files

The connectivity.cfg describes the DRAM port mapping. For more details about how to change the DRAM port mapping, please refer to the Xilinx tutorials.

  1. Verifying Designs Using Xilinx HLS

AutoSA also supports generate HLS projects. Add the flag

--hls

to the command when compiling the program.

./autosa ./autosa_tests/mm/kernel.c \
--config=./autosa_config/autosa_config.json \
--target=autosa_hls_c \
--output-dir=./autosa.tmp/output \
--sa-sizes="{kernel[]->space_time[3];kernel[]->array_part[16,16,16];kernel[]->latency[8,8];kernel[]->simd[2]}" \
--simd-info=./autosa_tests/mm/simd_info.json \
--host-serialize \
--hls

AutoSA will generate an HLS host file ${AUTOSA_ROOT}/autosa.tmp/output/src/kernel_host.cpp instead of the OpenCL host file generated in the previous step. To build the HLS project, run the following commands.

cp ${AUTOSA_ROOT}/autosa_scripts/hls_scripts/hls_script.tcl autosa.tmp/output/
cd ${AUTOSA_ROOT}/autosa.tmp/output
vivado_hls -f hls_script.tcl

For more detailed instructions on using AutoSA, please refer to the AutoSA Documentation.

Send Us Failure Cases and Feedback!

AutoSA is open source for research purposes, and we would like to continously improve it! Please let us know if...

  1. you find any bug in the AutoSA code.
  2. you find any application that fails the compilation flow of AutoSA.
  3. you know how to further help improve any part of the compiler.
  4. etc.

Authors and Contributors

AutoSA is currently maintained by Jie Wang. Besides, we gratefully acknowledge the authors of PPCG for developing and actively maintaining PPCG as an open-source project.

Papers

More implementation details of AutoSA are covered in our paper. If you find this project useful in your research, please consider citing:

@inproceedings{wang2021autosa,
  title={AutoSA: A Polyhedral Compiler for High-Performance Systolic Arrays on FPGA},
  author={Wang, Jie and Guo, Licheng and Cong, Jason},
  booktitle={Proceedings of the 2021 ACM/SIGDA International Symposium on Field-Programmable Gate Arrays},
  year={2021}
}

More Repositories

1

AutoBridge

[FPGA 2021, Best Paper Award] An automated floorplanning and pipelining tool for Vivado HLS.
C++
119
star
2

RapidStream

[FPGA 2022, Best Paper Award] Parallel placement and routing of Vivado HLS dataflow designs.
Python
116
star
3

FlexCNN

C++
65
star
4

GNN-DSE

DAC'22 paper: "Automated Accelerator Optimization Aided by Graph Neural Networks"
LLVM
36
star
5

minimap2-acceleration

Hardware Acceleration of Long Read Pairwise Overlapping in Genome Sequencing: Open Source Repository
C
30
star
6

hbmbench

C++
23
star
7

blaze

Blaze runtime system that support efficient accelerator integration for big data.
C++
23
star
8

AutoDSE

ACM TODAES Best Paper Award, 2022
Python
22
star
9

splag

Accelerating SSSP for power-law graphs using an FPGA.
C++
21
star
10

recut

Large-scale medical image processing and reconstruction toolbox
C++
18
star
11

DPQA

Python
17
star
12

CLINK

Compact LSTM inference kernel (CLINK) designed in C/HLS for FPGA implementation.
C++
17
star
13

soda-compiler

Stencil with Optimized Dataflow Architecture Compiler
Python
16
star
14

heterohalide

HeteroHalide: From Image Processing DSL to Efficient FPGA Acceleration
C++
13
star
15

HT-Deflate-FPGA

Verilog
13
star
16

HARP

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

TAPA-CS

Ada
8
star
18

Merlin-UCLA

C++
7
star
19

cs-259-21f

C
2
star
20

Enola

Python
2
star
21

adds

A Fast Work-Efficient GPU Algorithm for SSSP
Cuda
2
star
22

Bonsai

Verilog
2
star
23

DSE-for-HLS

2
star
24

tapa-fast-cosim

Use a customized RTL testbench for cosim, avoid generating .xclbin
VHDL
2
star
25

EBMF

Python
2
star
26

cs-259-graph500-sssp

C
1
star
27

cs-133-21w

Starter Kits for CS 133 (2021 Winter)
C++
1
star
28

cs-259-w24

C++
1
star