-
Notifications
You must be signed in to change notification settings - Fork 477
Fix for cloned stream that is subsequently flattened #708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Flatten is one of the operations that often breaks in the current main branch. The qonnx branch has quite a few fixes there, because the inplace variable as is in main is generally broken when working with optimizers. It sets what the inplace variable points to too early, and optimizers often break this. Let me take a look more carefully at this fix. |
I actually have the test fail in main, ingest-qonnx-master, and clone_flatten branches, but I think the form of the code in myproject.cpp produced by both the ingest-qonnx-master and clone_flatten branches seems correct. I would recommend using the ingest-qonnx-master branch for these cases, because as I mentioned, inplace variables are broken in main. |
OK, the new test should now succeed in The test fails in This PR has a band-aid solution for (1) and a good solution for (2). Perhaps, the best way to proceed is
|
If I copy One thing, can you check if the same fix is needed for quartus? On a first glance it looks to me like it's needed there, too. The code is at https://github.com/fastmachinelearning/hls4ml/blob/main/hls4ml/templates/quartus/firmware/nnet_utils/nnet_merge_stream.h#L139-L165. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix pre-commit, and I will approve.
What's the deal with the failed test? |
I assume the failed tests are ones that succeed when #714 is also merged. |
…ning#708) * add failing test; update pre-commit to run on 3.8 * update * update * remove formatting for now * spacing * fix from ryan * rm bandaid solution * update quartus * add quartus test * add quartus * pre-commit * pre-commit --------- Co-authored-by: Jovan Mitrevski <[email protected]>
…ning#708) * add failing test; update pre-commit to run on 3.8 * update * update * remove formatting for now * spacing * fix from ryan * rm bandaid solution * update quartus * add quartus test * add quartus * pre-commit * pre-commit --------- Co-authored-by: Jovan Mitrevski <[email protected]>
Description
Fixes #707. The issue is if a cloned stream is subsequently flattened, the original stream is used later instead of the clone. I think this is because the
InplaceVariable
is not correctly updated.Somewhat related, there is also a bug in
concatenate1d
when you consider the case that a stream is not truly from a 1D array, but from a flattened 2D array. I tried to use @rfforelli's fix for this, but it seems to not be quite working. Maybe he has some input?Type of change
Tests
main
but succeed on this branchTest Configuration:
Checklist
pre-commit
on the files I edited or added. (to be done later)