fastmachinelearning / hls4ml

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

Fix inplace variables #714

Closed jmitrevs closed 1 year ago

jmitrevs commented 1 year ago

Description

Inplace variables are broken in the main branch because they are fixed too early. Subsequent optimizations can make this connection no longer valid. Issue #707 (and the attempted fix in #708) is an example of this issue. This was largely developed in the ingest-qonnx-master branch, but is extracted here, and an omission related to stream repacking for quartus was discovered and fixed.

Type of change

Bug fix

Tests

The pytest, test_reshape.py, is the main test, though test_cnn_mnist.py is also pertinent. The new reshape functionality for Intel needs testing, though. There is also the question of whether flatten can always be removed for io_stream. This should be checked further, and if exceptions are found, we may need to change when we run the optimizers.

Checklist