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

Fix loading weights in GarNetStacked and GarNet internal array precisions #827

Merged
merged 5 commits into from
Jul 7, 2023

Conversation

joshlerner
Copy link
Contributor

Description

In the change from using the reader to storing weights as attributes, GarNetStack input feature weights + biases and output feature weights were missed. Fixed by storing all GarNetStack weights/biases as attributes.

All non default precisions specified for internal GarNet arrays (edge weight, norm, etc.) were not converted to CPP definitions, and produced typedef errors in firmware/parameters.h. Fixed by applying an APTypeConverter to all internal array precisions, not just those with default values.

Modified contrib/garnet.py to include an output activation for GarNetStack models, which was necessary to test above changes. This had previously been commented out due to being unused.

Type of change

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

Tests

Added test similar to pre-existing in test_garnet.py for GarNetStack models

  • GarNet internal arrays are included in the generated config automatically for name and type granularity
  • Previous tests overwrote these specifications, but the new test includes non-default internal arrays in the config

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.

@joshlerner
Copy link
Contributor Author

Hello! I have been working on a GarNet calibration model to be run on an FPGA using hls4ml. This is my first pull request, so some of the formalities are new to me. Thank you for your patience!

@jmitrevs jmitrevs added bug please test Trigger testing by creating local PR branch labels Jul 6, 2023
@jmitrevs jmitrevs merged commit 3b458f9 into fastmachinelearning:main Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug please test Trigger testing by creating local PR branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants