Support for more data reuse patterns
Closed this issue · 1 comments
chhzh123 commented
Currently, HeteroCL only supports simple reuse pattern as Tutorial: Memory Customization depicts. However, when doing data streaming, we need to guarantee each element of an array is only read or written once. Supporting more reuse patterns makes streaming across different stages possible.
Just take neural networks as an example, we need to enhance the following patterns:
- Convolution with strides more than one. This is necessary when building large networks like ResNet which leverages stride 2 conv in the basic building block.
- Maxpool / Avgpool layers. To make the memory access sequential, we need to allocate a line buffer to hold the elements in the previous several lines, though each element is used for once in this case.
- Fully connected layers. The input feature may be used in different neurons, thus it needs to be cached for the next computation. The generated code is something like #288 .
chhzh123 commented
This has already been added in the latest HCL-MLIR release. Mark as done.