Closed smc447 closed 1 year ago
Hi @chhzh123
Is this a related issue to this line here? https://github.com/cornell-zhang/heterocl/blob/38e3ca171d5451ebd4cf6f3303f3993bd870283f/hlib/python/hlib/bnn.py#L190
Was this a workaround?
It is a workaround. I think the issue is not that easy to fix as the reuse_at logic is already very complicated. I would suggest using a batch size larger than one for testing.
Side note: the issue mentioned in the code comment is that trip count 1 loops get removed before hcl.reuse_at is applied, causing errors in the LoopTransformation pass.
It turns out this isn't a bug, but the error is definitely not informative. The issue is that there's a padding operation before convolution in bnn.nchw
, and we should perform reuse_at on the output of the padding operation. Changing the first reuse_at to the following should solve the problem.
LB = s.reuse_at(bnn_conv.conv1_pad, s[bnn_conv.conv1], bnn_conv.conv1.axis[2])
I am trying to add the line and buffer to BNN convolution using reuse_at The heteroCl code is below
The error message is