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

Enable Sparse processes #672

Merged
merged 52 commits into from
May 2, 2023
Merged

Enable Sparse processes #672

merged 52 commits into from
May 2, 2023

Conversation

weidel-p
Copy link
Contributor

@weidel-p weidel-p commented Apr 25, 2023

Issue Number:
#656 #636

Objective of pull request:
This PR enables connectivity using Sparse weight matrices. It also includes handling Delays and Learning in floating and bit-approximate versions.

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
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation changes
  • Other (please describe):

What is the current behavior?

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

Supplemental information

weidel-p and others added 30 commits April 5, 2023 15:08
…o dev/sparse_proc

� Conflicts:
�	tests/lava/proc/sparse/test_model.py
…o dev/sparse_proc

� Conflicts:
�	tests/lava/proc/sparse/test_model.py
…o dev/sparse_proc

� Conflicts:
�	tests/lava/proc/sparse/test_model.py
@PhilippPlank PhilippPlank linked an issue Apr 25, 2023 that may be closed by this pull request
8 tasks
@PhilippPlank PhilippPlank added the 1-feature New feature request label Apr 25, 2023
src/lava/magma/core/model/py/connection.py Show resolved Hide resolved
src/lava/magma/core/model/py/connection.py Show resolved Hide resolved
src/lava/magma/core/process/variable.py Outdated Show resolved Hide resolved
src/lava/utils/sparse.py Outdated Show resolved Hide resolved
tests/lava/proc/sparse/test_model.py Outdated Show resolved Hide resolved
src/lava/magma/core/model/py/connection.py Show resolved Hide resolved
tests/lava/proc/sparse/test_process.py Outdated Show resolved Hide resolved
Copy link
Contributor

@tim-shea tim-shea left a comment

Choose a reason for hiding this comment

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

Tests pass, fantastic work! Thank you very much!

Copy link
Contributor

@mathisrichter mathisrichter left a comment

Choose a reason for hiding this comment

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

This is such a huge PR that any reviewer will have a very hard time comprehending, let alone judging it. I made an effort to point out minor things that I noticed along the way but got overwhelmed by the amount of code. I have a feeling that we should be testing many more variations of the user-level API. The new sparse Processes have so many parameters that should be really be exercised more in tests.

src/lava/utils/sparse.py Outdated Show resolved Hide resolved
src/lava/utils/sparse.py Outdated Show resolved Hide resolved
src/lava/utils/sparse.py Outdated Show resolved Hide resolved
src/lava/utils/sparse.py Outdated Show resolved Hide resolved
src/lava/magma/core/model/py/connection.py Outdated Show resolved Hide resolved
tests/lava/proc/sparse/test_process.py Show resolved Hide resolved
tests/lava/proc/sparse/test_process.py Show resolved Hide resolved
tests/lava/proc/sparse/test_model.py Outdated Show resolved Hide resolved
tests/lava/proc/sparse/test_model.py Outdated Show resolved Hide resolved
tests/lava/proc/sparse/test_model.py Outdated Show resolved Hide resolved
@weidel-p weidel-p merged commit 21960d1 into main May 2, 2023
@tim-shea tim-shea added this to the Lava v0.7.1 milestone May 15, 2023
monkin77 pushed a commit to monkin77/thesis-lava that referenced this pull request Jul 12, 2024
* added Sparse proc and init test

* added test and implementatin for sparse proc model in floating precision

* test for graded spikes

* added bit acc version and adapted weight utils

* typehints

* integer weights for fixed point tests

* draft learning

* draft get

* refactoring tests

* avoid saving var in varmodel

* draft set

* Sparse get/set working on CPU

* delay sparse process + test

* change order of weights

* minor fix for complete sparse matrix

* minor fix

* delay sparse model + test

* get/set for float/fixed

* delay sparse fix for int input

* LearningSparse floating-pt version + test

* all tests for delay dense also run for delay sparse

* update test naming

* use dot product

* make learning float work

* fixed pt learning

* rm bit approx version

* lint

* added learning dense for bit approx

* improve calculation of wgt_dly

* tests for dt and dd

* lint

* avoid warnings

* improve getting the zero matrix

* lint

* minor changes

* improve documentation

* minor change

* changes to comments

* improve documentation

* improve documentation

* minor change

---------

Co-authored-by: gkarray <[email protected]>
Co-authored-by: SveaMeyer13 <[email protected]>
Co-authored-by: PhilippPlank <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-feature New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CPU support for Sparse Connectivity
6 participants