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

Compiler graph: Enable model selection, fixing warning in QUBO tutorial #418

Merged
merged 5 commits into from Oct 14, 2022
Merged

Conversation

phstratmann
Copy link
Contributor

Issue Number: 417 (& 56 in lava-optimization)

Objective of pull request:
As the compiler graph scans through all modules in the path, it checks if either of the encountered class is a ProcModel.
If a file imports a module, like in solver.py of lava-optimization,
from lava.lib.optimization.solvers.generic.sub_process_models import StochasticIntegrateAndFireModel
the crawler will try to import that module as well. This leads to a warning, as the compiler graph incorrectly assumes that the found StochasticIntegrateAndFireModel is in solver.py.
The correct behavior should be that the crawler goes through all modules, and only selects Models implemented in the specific module, not those that are only imported.

The important change is in compiler_graphs.py.
Unfortunately, this change broke four unit tests, three in test_monitors, one in test_tutorial. This was due to the fact that the new crawler chooses the bitacc LifProcModel by default. Accordingly, I now specifically select the floating_pt model where tests would break otherwise.

Pull request checklist

Your PR fulfills the following requirements:

  • Issue created that explains the change and why it's needed
  • Tests are part of the PR (for bug fixes / features)
  • Docs reviewed and added / updated if needed (for bug fixes / features)
  • PR conforms to Coding Conventions
  • PR applys BSD 3-clause or LGPL2.1+ Licenses to all code files
  • Lint (flakeheaven lint src/lava tests/) and (bandit -r src/lava/.) pass locally
  • Build tests (pytest) passes locally

Pull request type

Please check your PR type:

  • Bugfix

Copy link
Contributor

@GaboFGuerra GaboFGuerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

PhilippPlank and others added 3 commits October 14, 2022 13:54
@PhilippPlank PhilippPlank merged commit bafca33 into lava-nc:main Oct 14, 2022
mathisrichter added a commit to mathisrichter/lava that referenced this pull request Oct 14, 2022
bamsumit pushed a commit that referenced this pull request Oct 20, 2022
…O tutorial (#418)" (#419)

This reverts commit bafca33.

Co-authored-by: Philipp Stratmann <86950058+phstratmann@users.noreply.github.com>
@tim-shea tim-shea added this to the Release 0.5.1 milestone Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants