Giter VIP home page Giter VIP logo

autobridge's Introduction

Latest

  • [04/29/2022] We are holding a tutorial at FCCM 2022.

  • [04/29/2022] Check our latest documentation for the workflow here.

  • [02/20/2022] We decide to only maintain AutoBridge as a plug-in of the TAPA workflow. The TAPA framework provides a stable and robust environment for AutoBridge across different HLS versions. TAPA is easy and natural to use if you are familiar with the HLS dataflow coding style.

image

  • [01/06/2022] We are integrating AutoBridge and TAPA to create a robust workflow. Currently AutoBridge relis on hacking the RTL generated by Vivado HLS, which makes it fragile. Instead, using the open-source TAPA compiler as the frontend will make the floorplanning-pipelining flow much more robust. While the integration of AutoBridge and TAPA is still in progress, feel free to contact me if you want to try it out, we will provide as much help as needed to make your design work!

  • [01/06/2022] With the help of AutoBridge and TAPA, Serpens achieves 270 MHz on Alveo U280 while using 24 HBM channels, while a normal Vitis flow will failed in routing. Serpens is an HBM-based accelerator for sparse matrix-vector multiplication (SpMV). With the high frequency, Serpens gets a 3.79X performance improvement over the previous state-of-the art GraphLily.

  • [01/06/2022] With the help of AutoBridge and TAPA, Sextans achieves 260 MHz on Alveo U250 while using 4 DDR channels, while a normal Vitis flow will only achieves 190 MHz.

  • [12/20/2021] We just open-sourced RapidStream, a follow-up work of AutoBridge. This time we parallelize the placement and routing of each slot based on the floorplanning by AutoBridge. Check out how we achieve 5-7X speedup over Vivado!

  • A new implementation has been ready! Check the example in AutoBridge/in-develop/test/autosa_cnn_13x8/.

  • The user interface has been significantly simplified. To invoke the new AutoBridge, just write a simple config file like this:

{
  "Board" : "U250",
  "HLSProjectPath" : "./kernel3",
  "HLSSolutionName" : "solution",
  "TopName" : "kernel3",

  "FloorplanMethod": "IterativeDivisionToHalfSLR",
  "AreaUtilizationRatio" : 0.7,

  "BundleToDDRMapping" : {
    "gmem_A": 0,
    "gmem_B": 1,
    "gmem_C": 2
  },

  "LoggingLevel" : "DEBUG"
}

About

  • What: AutoBridge is a floorplanning tool for Vivado HLS dataflow designs.

  • Why: Co-optimizing HLS compilation and placement brings new opportunities to improve the final achievable frequency.

  • How: Pre-determine the rough location of each module during HLS compilation, so that:

    • the long interconnect could be adequately pipelined by the HLS scheduler.

    • we prevent the Vivado placer to place the logic too densely.

  • In our experiments with a total of 43 design configurations, we improve the average frequency from 147 MHz to 297 MHz.

    • Notably, in 16 experiments we make the originally unroutable designs achieve 274 MHz on average
  • The pre-print manuscript of our paper could be found at https://vast.cs.ucla.edu/sites/default/files/publications/AutoBridge_FPGA2021.pdf

  • Projects using AutoBridge:

  • Motivating Examples:

    • Comparison of a stencil accelerator on Xilinx U280. From routing failure to 297 MHz.

      • Each color represents a module.
      • AutoBridge ensures a clean separation of logic in different regions to minimize unnecessary die crossing.
    • Comparison of a systolic array on Xilinx U250. From 158 MHz to 316 MHz.

      • Note that Vivado will try to pack things together to avoid die crossing as much as possible.
      • Instead, we ensure a balanced resource utilization across the whole device to reduce local congestion.
      • Meanwhile, the global connections will be adequately pipelined.

Successful Cases

  • Serpens, to appear in DAC'22, achieves 270 MHz on the Xilinx Alveo U280 HBM board when using 24 HBM channels. The Vivado baseline failed in routing.
  • Sextans, FPGA'22, achieves 260 MHz on the Xilinx Alveo U250 board when using 4 DDR channels. The Vivado baseline achieves only 189 MHz.
  • SPLAG, FPGA'22, achieves up to a 4.9× speedup over state-of-the-art FPGA accelerators, up to a 2.6× speedup over 32-thread CPU running at 4.4 GHz, and up to a 0.9× speedup over an A100 GPU (that has 4.1× power budget and 3.4× HBM bandwidth).
  • AutoSA Systolic-Array Compiler, FPGA'21: AutoSA Frequency Figure
  • KNN, FPT'20, achieves 252 MHz on the Xilinx Alveo U280 board. The Vivado baseline achieves only 165 MHz.

Getting Started

Related Publications

FPGA'21 Artifact Review

The experiment results for all benchmarks in our submission to FPGA'21 are available at: https://ucla.box.com/s/5hpgduqrx93t2j4kx6fflw6z15oylfhu

Currently only a subset of the source code of the benchmarks are open-sourced here, as some designs are not published yet and will be updated later.

autobridge's People

Contributors

blaok avatar licheng-guo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autobridge's Issues

Code Organization

Hi @luojw-dwr,

Thanks for your quick reply and suggestions.

For the floorplanning part, I'm not sure which parts you think are inappropriately coupled? Currently the floorplan class takes in a dataflow graph and returns a mapping from the slots to the vertices assigned to this slot. I think we could have multiple classes, each for a different floorplanning algorithm?

BTW, previously you mentioned that you formulate the problem in another non-linear model. I'm not sure this is a good idea. With an ILP model, we already run into a scalability issue, which I'm working on right now. If some slots are completely out, as in the F1 case, we could set the available resource to 0 to handle the situation. Thus I do not see a solid motivation in making the model more complex, maybe you could explain more?

I agree the user interface is a mess right now, though I don't have the bandwidth for that recently. Ideally, the users should only provide the target device and their source code and nothing else. Then we will parse the mapping from the source code to the RTL. On the other hand, if they want to hack with the tool (e.g. add additional board, specify extra floorplanning constraints), they are supposed to be somewhat familiar with the CAD flow and I believe clock regions are relatively basic concepts? Let me know if you disagree.

My plan is to leave the user interface aside for a while (3 months, before my next deadline), and if users (rare for now) run into problems I could provide direct help.

Best,
Licheng

Hi @Licheng-Guo ,

About the HLSParser package, it is nice to see that tapa frontend has been added. It is quite a good beginning.

About the Device package, my idea is to leave the concrete device information to plain-text files, e.g. yaml or csv. We may have further discussion about how to represent the 'branches' on the resource variations induced by composition of instantiations of IPs, e.g. DDR, NoC infrastructures, etc. What choices come to me at this early stage:

  • record different resource situation as you've done in the old code base, but this may be a problem when the compositions are of a terrifying number.
  • let users pick the correct 'branch' in the resource file. (then supporting on comments can be a must for the file format)

About the Opt package, the components are still heavily coupled with the details of the proposed floorplanning algorithm. I'd like to start a new git branch to get them decoupled as I've mentioned in the last few e-mails. Hopefully I will keep the interfaces consistent (one exception is the coordination of floorplanner and slots, as the organizaton of slots may vary a lot depending on the floorplanner implementation).

About the Flow package, the Floorplan (optional) setion in def help seems to be confusing. It is really a problem for both of us to allow user to make partial assignment with a tidy interface without knowledge about the floorplanning implementation details on naming conventions.

  • This may be a problem if users want to connect vhls and autobridge directly as a whole workflow. (Some manual coding is not too big a realistic problem at this stage though).

  • The naming convention (the CLOCKREGION stuff) is not quite obvious even after I have read the Device package. This can be a real problem as normally user won't dive into the Opt package for namings (though the floorplanner itself and the constraint stuffs are there).

  • Maybe either

    • expose the namings to somewhere more obvious, or
    • let users bind to slot graphs and leave us to manage the name mappings. (It is not a choice if the slot graph is dynamically generated during floorplanning though. Several round trips between abstract coordinates and slot-during-iteration is otherwise needed.)

By the way, discussing in a closed issue seems not to be a correct way using GitHub. Maybe start a new issue ;-P

It is nice to be on a consistent track with you!

Best,
Jianwen

Attach images to README.md

This issue will only be used to upload images to the GitHub server and attach images to the readme file.

[Error Report] Benchmarks do not run

Hi,

I am running benchmarks/CNN/13x10/runme.sh with Vivado HLS 2019.2/2020.1 and Python 3.6.1. When executing./ab_cnn_13x10.py it reports:

Using Python-MIP package version 1.8.1
Traceback (most recent call last):
  File "./ab_cnn_13x10.py", line 101, in <module>
    NaiveBalance = NaiveBalance)
TypeError: __init__() got an unexpected keyword argument 'column'
Detecting error, Rerun AutoBridge...
Using Python-MIP package version 1.8.1
Traceback (most recent call last):
  File "./ab_cnn_13x10.py", line 101, in <module>
    NaiveBalance = NaiveBalance)
TypeError: __init__() got an unexpected keyword argument 'column'

Similar problems also occur withbenchmarks/Stencil/3PE/runme.sh, benchmarks/LUDecomposition/12x12/u250/runme.sh and benchmarks/PageRank/runme.sh.

Please contact if more concrete information is needed to debug. Thanks for your time.

[Error Report] Regression does not run

Hi,

I am running regression/systolic_2x2/run.sh with Vivado HLS 2019.2/2020.1 and Python 3.6.12. When executing step2-autobridge.py, it reports:

Using Python-MIP package version 1.8.1
Traceback (most recent call last):
  File "./step2-autobridge.py", line 141, in <module>
    NaiveBalance = True)
  File "../../src/formator.py", line 167, in __init__
    self.safety_check()
  File "../../src/formator.py", line 172, in safety_check
    assert any('control_s_axi' in key for key in self.DDR_loc_2d_y.keys()), f'no constraint found for the control_s_axi'
AssertionError: no constraint found for the control_s_axi

Please contact if more concrete information is needed to debug. Thanks for your time.

`src/autobridge/Floorplan/__init__.py` breaks logging

The current logging configuration in https://github.com/Licheng-Guo/AutoBridge/blob/master/src/autobridge/Floorplan/__init__.py breaks logging in two ways:

  • It makes the logging system print the logging message only, without any of the usual useful information like module name, line number, timestamp, etc.
  • It makes whoever imports autobridge crash when running from a directory without write permission

I can see that you are trying to keep a permanent log file. It'll be good if you could make it optional or default to somewhere like /tmp.

Issue with Vitis HLS 2021.2

完全按照作者的环境编译,是可以的,但是无法升级。我提出几点,仅供参考:

  1. AutoBridge 内在属性无法支持 Vitis HLS 2021.2 版本。从编译的 log 文件来看,因该是 Vivado HLS 和 Vitis HLS 产生了较大的不同,而 AutoBridge 严重依赖于 HLS 工具的某些内在属性,导致即便 step1 可以正常运行,而 step2 无法正常运行。建议尽快升级到最新的 Vitis HLS 平台,因为里面很多特性,都是 Vivado HLS 所不具备的。
  2. AutoBridge 和 OS 及其 Libraries 版本的依赖非常大,而且其使用的 GCC 版本比较老。建议和 GCC/LLVM 做一定的解耦设计,如果无法做到,可以使用宏定义来规避。不过依然建议升级到 GCC 11 和 LLVM 14 版本,体现编译优势。
  3. 没有文档,只有 Example 是比较致命的。建议写个简单的文档,就把基本的步骤写一下。深入了解可以 --help

Question about Hard-coded Resource Information

Hello, I'm wondering how to get the drop of resource after DDR is enabled. I found in src/formator.py that there's a 1/4 drop of hard-coded total BRAM, FF and LUT after DDR is enabled, i.e., BRAM: 384->288, FF: 329280->245760, LUT: 164640->122800. DSP also dropped from 1344 to 1152, and URAM from 192 to 128.

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.