Skip to content

Comments

Fix PyGeNN shared neuron#578

Merged
neworderofjamie merged 11 commits intomasterfrom
fix_pygenn_shared_neuron
Apr 19, 2023
Merged

Fix PyGeNN shared neuron#578
neworderofjamie merged 11 commits intomasterfrom
fix_pygenn_shared_neuron

Conversation

@neworderofjamie
Copy link
Contributor

@neworderofjamie neworderofjamie commented Mar 24, 2023

Clearly #539 left a whole bunch of corner cases unhandled involving custom updates actually operating directly (rather than reducing into) SHARED_NEURON variables (i.e. duplicated across batches but shared across neurons) which I encountered when trying to use these in mlGeNN:

  1. Added CustomUpdate::isPerNeuron - this is set if any custom update variables or variable reference targets aren't SHARED_NEURON
  2. If Custom updates are per-neuron then they can only read from SHARED_NEURON variables
  3. Added SIMT and single-threaded CPU code generation for custom updates which aren't per-neuron.
  4. PyGeNN now makes correctly-sized views for accessing SHARED_NEURON variables

And, as ever, I extended some feature tests to cover this behaviour as well as adding a couple of unit tests to check the CustomUpdate::isPerNeuron logic. On a similarly typical vein, there are also a couple of unrelated small fixes:

  1. SynapseGroup.matrix_type can now be set from enumeration as well as by string (useful for mlGeNN connectivity type checking)
  2. You can now use SynapseGroup.get_var_values on KERNEL connectivity (useful when attempting to learn convolutions)

@neworderofjamie neworderofjamie added this to the GeNN 4.8.1 milestone Mar 24, 2023
@codecov
Copy link

codecov bot commented Mar 27, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.41 ⚠️

Comparison is base (6b09eaa) 89.36% compared to head (975a99c) 88.96%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #578      +/-   ##
==========================================
- Coverage   89.36%   88.96%   -0.41%     
==========================================
  Files          76       76              
  Lines       12393    12428      +35     
==========================================
- Hits        11075    11056      -19     
- Misses       1318     1372      +54     
Impacted Files Coverage Δ
include/genn/genn/customUpdateInternal.h 0.00% <ø> (ø)
include/genn/genn/customUpdate.h 95.38% <100.00%> (+0.07%) ⬆️
src/genn/backends/single_threaded_cpu/backend.cc 91.05% <100.00%> (+0.01%) ⬆️
src/genn/genn/code_generator/backendSIMT.cc 95.21% <100.00%> (+0.07%) ⬆️
src/genn/genn/customUpdate.cc 94.48% <100.00%> (+0.83%) ⬆️

... and 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@tnowotny tnowotny left a comment

Choose a reason for hiding this comment

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

What you say makes sense & I trust you that the code does as you say - also as usual I am afraid.

@neworderofjamie neworderofjamie merged commit 800bd65 into master Apr 19, 2023
@neworderofjamie neworderofjamie deleted the fix_pygenn_shared_neuron branch April 19, 2023 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants