Weight Scale Responsibility#1677
Open
rowleya wants to merge 9 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR shifts responsibility for converting user-space synaptic weights into “ring-buffer scaled” machine format from synapse_io into the synapse-dynamics implementations, to better support alternative internal weight representations (e.g., NestML and higher-fractional-bit STDP weight formats).
Changes:
- Removes weight scaling/unscaling logic from
synapse_ioand threadsring_buffer_weight_scalesinto synapse-dynamics encode/decode paths. - Updates static and STDP synapse dynamics to pre-scale weights when generating synaptic matrices, and to undo scaling when decoding matrices back to connections.
- Extends the abstract static/plastic synapse dynamics APIs to accept
ring_buffer_weight_scales.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| spynnaker/pyNN/models/neuron/synapse_io.py | Removes central weight scaling and forwards ring-buffer weight scales into synapse-dynamics encode/decode. |
| spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_weight_changer.py | Applies ring-buffer scaling in weight-changer encoding/decoding logic. |
| spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_stdp.py | Applies ring-buffer scaling in STDP matrix generation and attempts to undo scaling on readback. |
| spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_static.py | Applies ring-buffer scaling in static matrix generation and attempts to undo scaling on readback. |
| spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_static_synapse_dynamics.py | Extends static synapse dynamics API to accept ring_buffer_weight_scales. |
| spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_plastic_synapse_dynamics.py | Extends plastic synapse dynamics API to accept ring_buffer_weight_scales. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…NakerManchester/sPyNNaker.git into weight_scale_responsibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move responsibility for weight scaling to the synapse dynamics object. Although this has little effect on the sPyNNaker code itself, this has been done in recognition that NestML wants to represent weights differently in the synapses and the ring buffers, This is a valid option - the scaling can be done at the time of addition of weights to the ring buffers to allow weights to be represented differently in the synapses.
Note that this also helps with STDP rules where the weight representation might have more fractional bits to allow small updates to occur, even if those updates can't immediately affect the inputs to the ring buffers. Multiple updates however might do so!