cornell-zhang/heterocl

Support for more data reuse patterns

Closed this issue · 1 comments

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:

  1. 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.
  2. 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.
  3. 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 .

This has already been added in the latest HCL-MLIR release. Mark as done.