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

Special variable references for zeroing internals #634

Merged
merged 33 commits into from
Aug 28, 2024
Merged

Conversation

neworderofjamie
Copy link
Contributor

@neworderofjamie neworderofjamie commented Aug 20, 2024

Having to zero things like outPost (inSyn in GeNN 4 parlance) on the host between trials slows down simulations with extra cudaMemcpy and Python-side processing. This PR adds some extra functionality that lets you move more of this into custom updates and also improves the handling of delayed variables in custom updates:

  • New VarAccessMode::BROADCAST and CustomUpdateVarAccess::BROADCAST_DELAY to indicate variables, writes to which are 'broadcast' across all delay slots
  • A writeOnly flag for value types - these can only be assigned with plain = assignement. Applied to both VarAccessMode::BROADCAST variables and also reductions to improve error handling (also, while I was in this code, tightened up some type-checking)
  • Some new functions to create variable references to outPost and denDelay.
  • Updated MNIST MB classifier user project to use this functionality

Together, this means you can do all resetting required for delayed EventProp on device.

…elaySlots`` which returns the actual number of delay slots as an optional - tidies up quite a bit of code
…functionality to generate delayed indices in CustomUpdateGroupMerged
* Mechanism for ensuring custom updates only refernce dendritic delay buffers from one synapse group
* Code generation of dendritic delay-based indexing of variable references
@neworderofjamie neworderofjamie added this to the GeNN 5.1.0 milestone Aug 20, 2024
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 86.06811% with 45 lines in your changes missing coverage. Please review.

Project coverage is 88.29%. Comparing base (851cfdf) to head (0d552c5).
Report is 37 commits behind head on master.

Files Patch % Lines
src/genn/genn/transpiler/typeChecker.cc 61.90% 24 Missing ⚠️
include/genn/genn/transpiler/statement.h 52.63% 9 Missing ⚠️
...enn/genn/code_generator/customUpdateGroupMerged.cc 85.18% 4 Missing ⚠️
src/genn/genn/code_generator/backendBase.cc 70.00% 3 Missing ⚠️
src/genn/genn/models.cc 95.52% 3 Missing ⚠️
src/genn/genn/transpiler/parser.cc 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #634      +/-   ##
==========================================
+ Coverage   87.94%   88.29%   +0.35%     
==========================================
  Files         104      106       +2     
  Lines       13914    14853     +939     
==========================================
+ Hits        12237    13115     +878     
- Misses       1677     1738      +61     

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

@neworderofjamie neworderofjamie marked this pull request as ready for review August 21, 2024 12:41
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.

Very sensible & looks good.

@neworderofjamie neworderofjamie merged commit bb8609b into master Aug 28, 2024
2 of 3 checks passed
@neworderofjamie neworderofjamie deleted the resetting branch August 28, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants