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

Add Profiler base class #444

Merged
merged 4 commits into from
Oct 25, 2022
Merged

Conversation

PhilippPlank
Copy link
Contributor

@PhilippPlank PhilippPlank commented Oct 25, 2022

Objective of pull request: Adding a profiler base class which selects an appropriate Profiler based on the chosen RunCfg. Currently only the Loihi2HWProfiler for profiling Loihi 2 will be available, if lava-loihi is also installed (INRC members only). In the future this class can choose profiler implementations for Loihi 1, Loihi 2, CPU, GPU or other neuromorphic hardware.

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?

  • No profiler is available

What is the new behavior?

  • Profiler base class available to select appropriate profiler implementation

Does this introduce a breaking change?

  • Yes
  • No

Supplemental information

@PhilippPlank PhilippPlank self-assigned this Oct 25, 2022
@PhilippPlank PhilippPlank added the 1-feature New feature request label Oct 25, 2022
@PhilippPlank PhilippPlank added this to the Release 0.5.1 milestone Oct 25, 2022
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.

Looks good to me. No test cases, so not running but I guess it can't break anything...

@PhilippPlank PhilippPlank merged commit ae908be into lava-nc:main Oct 25, 2022
@PhilippPlank PhilippPlank deleted the profiler_api branch October 25, 2022 21:59
src/lava/utils/profiler.py Show resolved Hide resolved
src/lava/utils/profiler.py Show resolved Hide resolved
from lava.magma.core.run_configs import RunConfig, Loihi2HwCfg

# Dictionary to relate a certain RunCfg to specific Profiler
run_cfg_dict: ty.Dict[RunConfig, RunConfig] = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this maybe go into the Profiler class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was, but this dict needs to be filled based on available imports. The current solution can probably be improved, but it fits with our current style to try importing loihi specific modules.

src/lava/utils/profiler.py Show resolved Hide resolved
monkin77 pushed a commit to monkin77/thesis-lava that referenced this pull request Jul 12, 2024
* Update profiler.py

* Update profiler.py

* Update profiler.py

* Update profiler.py
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.

4 participants