Skip to content
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

Don't overwrite already set accum_t, fix pointwise output resolution #1146

Merged
merged 3 commits into from
Dec 14, 2024

Conversation

jmitrevs
Copy link
Contributor

Description

Modify Layer._set_accum_t() to not overwrite an already existing accum_t, which can happen in an optimizer. Also, modify the pointwise init functions to do nothing, since the values are already set. Otherwise, the result_t was overwritten, potentially nullifying an explicit value set by a quantizer (a Quant node in a failing test).

Type of change

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

Tests

The failing test that this fixes will be added soon. It is important that it doesn't break anything else.

TODO: We should confirm that there are no other optimizers that may cause the same probelm

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.
  • I have installed and run pre-commit on the files I edited or added.
  • I have added tests that prove my fix is effective or that my feature works.

@jmitrevs
Copy link
Contributor Author

This needs fastmachinelearning/example-models#19 to be merged.

@jmitrevs jmitrevs marked this pull request as ready for review December 13, 2024 23:14
@jmitrevs
Copy link
Contributor Author

With the updated example-models, and existing test (test_qonnx.py::test_sep_conv[Vitis]) fails in main but passes with this change. For the TODO, I moved the optimizer to merge the linear activation to later, so I do not think there are any other layers that will fail in this way.

@JanFSchulte JanFSchulte merged commit 0dd372a into main Dec 14, 2024
7 checks passed
@JanFSchulte JanFSchulte deleted the fix_pointwise_res_type branch December 14, 2024 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants