-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Tapa HLS backend #269
Conversation
Can you attach a simple program and the generated TAPA code as a comment in this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing! This PR is very comprehensive!
- Can you provide instructions on how to build and run TAPA programs from Allo? Based on the description, it can only generate the TAPA C++ file and require users to explicitly invoke docker, right?
- Is it possible to reuse the
EmitVivadoHLS
pass? It seems most of the facilities are the same, but only the function generation logic needs to be changed. Copying the whole implementation may make it hard to maintain afterwards.
Thanks for reviewing! For the questions:
|
Can you be specific about which parts involve many small changes? I thought only the function interfaces are different |
Take this simple 2 * 2 tiled gemm as an example:
The generated Tapa HLS code is as follows:
|
Currently, there are getTypeName, emitValue, emitArrayDecl, emitAffineLoad, emitAffineStore, emitCall, emitLoopDirectives, emitFunctionDirectives, emitFunction, and emitModule. |
I think a better way to do this is to provide a basic class for |
That actually makes great sense. Do you want me to include it in this PR? |
Maybe not in this PR as it requires lots of code change, but I think you can annotate the functions (just using one line of comment) that are different from the Vivado HLS backend. |
Sure, just updated. |
Description
This PR supports Tapa HLS (https://github.com/rapidstream-org/rapidstream-tapa/) backend for Allo. This is mainly designed with Allo dataflow programming interface. The original scheduling interface hasn't been tested yet. This backend has a new kernel codegen, host codegen, and makefile codegen. The basic usage is also different from Vitis HLS. Some usages with makefile are as follows.
make csim
: A fast software simulation that only relied onkernel.cpp
andtapa_host.cpp
.make fast_hw_emu
A fast hardware emulation similar to hw_emu, but no longer need to generate.xclbin
.make run TARGET=<hw_emu/hw>
: sw_emu is no longer supported with make run, one can just use csim instead.Examples
To use Tapa HLS for backend, we can simply choose "tapa" as target when building. For example:
Issues
tapa g++
andtapa compile
is currently not runnable in our server. Which means we should generate the Tapa executable and.xo
file in a docker container, copy the generated file, and run the actual testing in our server (You can use docker image ethanmeng324/tapa:v3.0). This will be resolved in the future where there will be an alternative choice that implicitly go through this process (launch docker container, generate file, copy result, continue running).a[1][1]
toa[1 * 16 + 1]
, where 16 is the size of dim_0. Because of this issue, input and output array buffer as L3 cache is not supported in Tapa. However, we will change the input and output buffer into stream type in the future, which will solve this problem.Checklist