Open hecmay opened 2 years ago
We shouldn't unroll the loop. We should just pipeline it. Do we specify that in the HCL code?
We should just move the initialization outside.
It's ok to modify the HCL code as long as it makes sense and is still functional.
We shouldn't unroll the loop. We should just pipeline it. Do we specify that in the HCL code?
In HCL code, the outer loop is pipelined, and inner loop is optimized with parallel()
. I am using the pre-generated HLS code inside smith_waterman
folder.
So these loops should be moved outside of the top-level loop nests, right?
ap_int<16> matrix[129][129];
for (ap_int<32> x = 0; x < 129; ++x) {
for (ap_int<32> y = 0; y < 129; ++y) {
matrix[x][y] = (ap_int<16>)0;
}
}
ap_int<16> action[129][129];
for (ap_int<32> x1 = 0; x1 < 129; ++x1) {
for (ap_int<32> y1 = 0; y1 < 129; ++y1) {
action[x1][y1] = (ap_int<16>)3;
}
}
I will modify the HLS code first and will update the HCL code once I ensure the HSL can actually work.
The log from Vitis HLS 2020 is a bit misleading and it points to a random line number and complains that "the loop" in that line cannot be unrolled...
After I switched to Vitis 2019, I figured out that Vitis HLS actually has difficulty unrolling one of the loop nest inside body of the inner
loop, which is annotated in the snippet below.
for (ap_int<32> t_outer = 0; t_outer < 32; ++t_outer) {
for (ap_int<32> t_inner = 0; t_inner < 32; ++t_inner) {
#pragma HLS pipeline
ap_int<32> mutate3;
for (ap_int<32> i = 0; i < 129; ++i) { // THIS CANNOT BE UNROLLED
for (ap_int<32> j = 0; j < 129; ++j) {
ap_int<32> trace_back[4];
for (ap_int<32> x2 = 0; x2 < 4; ++x2) {
trace_back[x2] = 0;
}
Do you have the complete HLS generated code?
I am using this one: https://github.com/cornell-zhang/heterocl/blob/master/samples/smith_waterman/smith_vhls.cl @seanlatias
Im trying to reproduce some performance numbers mentioned in HCL paper on AWS F1.
Here is part of generated HLS code from HCL. The root cause, as indicated in the error log, is that the second loop's body is too large to be unrolled. We probably need function outlining for the large loop body here to make it synthesizable