fastmachinelearning / hls4ml

Machine learning on FPGAs using HLS
https://fastmachinelearning.org/hls4ml
Apache License 2.0
1.22k stars 396 forks source link

Split FIFO optimization into multiple optimizers, don't call write explictily #705

Open jmitrevs opened 1 year ago

jmitrevs commented 1 year ago

Details

The FifoDepthOptimization optimizer calls ModelGraph.write(), which executes the self._writer_flow as part of the optimizer, outside the main flow being executed. The main flow continues when the optimizer ends.

Potentially it would be safer to implement the fifo depth optimization as a flow, without an external flow interrupting it. This external flow calls many of the same optimizers a second time, which has more potential for problems. A problems discovered with this setup was fixed with #641, and it appears to be working, so this change is fairly low priority, unless we run into another problem.

Parts of hls4ml being affected

The FifoDepthOptimization would likely have to be split into multiple optimizers and new flows would have to be defined.