Skip to content

Feat: Neuron Operations#266

Merged
jasonlyik merged 5 commits intodevfrom
feat/macs_neuron
Dec 30, 2025
Merged

Feat: Neuron Operations#266
jasonlyik merged 5 commits intodevfrom
feat/macs_neuron

Conversation

@ben9809
Copy link
Copy Markdown
Member

@ben9809 ben9809 commented Dec 9, 2025

This PR introduces the NeuronOperations metric, which calculates the computational workload associated with neuron activity in spiking neural networks (SNNs).

The metric provides two key outputs:

  • Effective Neuron Ops: The total number of operations actually performed by neurons, normalized by the number of samples.
  • Neuron Dense Ops: The total number of operations that would be computed if all neurons were updated at every time step, regardless of spiking activity.

Minor changes:

  1. Unit tests have been added to validate the metric's functionality under various conditions, including scenarios with spiking and non-spiking inputs.

  2. Lockfile was updated due to security reasons for some of the Python dependencies.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 89.47368% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.14%. Comparing base (4fa2cfb) to head (81f58d5).
⚠️ Report is 6 commits behind head on dev.

Files with missing lines Patch % Lines
neurobench/metrics/workload/neuron_operations.py 88.88% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #266      +/-   ##
==========================================
+ Coverage   77.63%   78.14%   +0.50%     
==========================================
  Files          43       44       +1     
  Lines         805      842      +37     
  Branches      119      123       +4     
==========================================
+ Hits          625      658      +33     
- Misses        133      134       +1     
- Partials       47       50       +3     
Flag Coverage Δ
unittests 78.14% <89.47%> (+0.50%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jasonlyik
Copy link
Copy Markdown
Contributor

Looks good, would like to see

  1. How are the number of reset computes calculated for each neuron?
  2. Documenting what is the diff between effective and dense Neuron Ops

@jasonlyik jasonlyik self-requested a review December 30, 2025 16:23
@jasonlyik jasonlyik merged commit 221357c into dev Dec 30, 2025
6 checks passed
@jasonlyik jasonlyik deleted the feat/macs_neuron branch December 30, 2025 16:27
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