Skip to content

append applied_flows container before filling instead of after

Javier Duarte requested to merge jmitrevs/applied_flows into main

Created by: jmitrevs

Description

This change simply appends applied_flows to ModelGraph._applied_flows in the beginning, before it is filled, so that ModelGraph._applied_flows always has an accurate description of what has been applied. This is important in the FIFO depth optimization, because the FifoDepthOptimization runs the writer flow outside of the main flow, before the flow is finished and before ModelGraph._applied_flows is updated, so currently it sees ModelGraph._applied_flows == [], and since the writer depends on 'vivado:ip', all the optimizers are run again, which sometimes messes things up. For example, running on a ResNet sample, rerunning the optimizers changes a type from being PackedType to just being FixedPrecisionType, causing it to fail. This way, ModelGraph._applied_flows is always current so the out of main flow writer does not run 'vivado:ip' again.

I also updated a few empty lists to empty sets so that applied_flows is always a dictionary of sets, not a dictionary of sets or empty lists.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Tests

The main test is to see that this doesn't break the current pytests. The FIFO optimization is too long to run as a standard test.

Checklist

  • I have read the guidelines for contributing.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

Merge request reports

Loading