You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is somehow a weird problem. I wanted to generate the HLS code for the following input program (a simple convolutional layer), but the DSE engine crashed.
#definebs4
#defineoc16
#defineic6
#defineih8
#defineiw8
#definekh3
#definekw3
#defineoh6
#defineow6voidtest_conv2d(float A[bs][ic][ih][iw], float B[oc][ic][kh][kw], float C[bs][oc][oh][ow]) {
#pragma scop
for (int n = 0; n < bs; n += 1) {
for (int c = 0; c < oc; c += 1) {
for (int y = 0; y < oh; y += 1) {
for (int x = 0; x < ow; x += 1) {
float sum = 0;
for (int rc = 0; rc < ic; rc += 1) {
for (int rh = 0; rh < kh; rh += 1) {
for (int rw = 0; rw < kw; rw += 1) {
sum += A[n][rc][y+rh][x+rw] * B[c][rc][rh][rw];
}}}
C[n][c][y][x] = sum;
}}}}
#pragma endscop
}
Hi @chhzh123, I pushed a small patch to fix this issue - 0f9627a.
Basically, ScaleHLS DSE is not supporting iter_args currently, so we always apply materialize-reduction and buffer-loop-hoisting in the scalehls-dse-pipeline to remove iter_args and hoist the generated local buffers outside of the loop nest. However, the materialize-reduction pass can generate some redundant memory loads and stores, which may decrease the performance the DSE can achieve. For now, we don't have a optimization pass to remove these redundancies.
For the parsing result difference between ++ and += 1 in mlir-clang, I'm not sure whether this is intended or actually an issue to resolve. Could you open an issue in the Polygeist repository for this if it is not already existed?
This is somehow a weird problem. I wanted to generate the HLS code for the following input program (a simple convolutional layer), but the DSE engine crashed.
However, if I use
++
to increment instead of+=1
, this problem will not occur. For comparison, the MLIR assembly of the+=1
version is shown below.while the
++
version does not useiter_args
. I don't know why this is the case.The text was updated successfully, but these errors were encountered: