Comments (3)
We actually do have a check for potentially undefined behaviour, and emit a warning or error (can't remember which) in that case. I seem to remember in an earlier version of brian2genn we had an explicit check for code of the form neuron_var += synaptic_var
that was treated specially. Are we talking about some generalisation of that?
Also, atomicAdd
may be very inefficient on medium density synaptic operations (but is good for very low density ones, see mine and Romain's paper on GPU spiking neural networks).
from brian2genn.
This problem arises where the "on_pre" modifies pre-synaptic neuron variables and "on_post" modifies post-synaptic neurons variables (somewhat unusual, the case we covered was "on_pre" changing post-synaptic vars).
This exposes a bit more general problem, where just giving full access to pre- and post-synaptic neuron variables in GeNN can lead to undefined behaviour due to race conditions. If you exclude truly undefined behaviour within Brian, then the expected code should only be +=, *=, -=, /= and equivalent, right? However, I am not sure how one would do a "atomicDivide" ...
As for efficiency: If one wants to allow these manipulations, there is no choice but to use atomic operations I believe.
from brian2genn.
Ah I get you. At a conference at the moment so can't think too deeply about it, so just a couple of points for now.
Yes, I think ultimately you'll only allow +=
etc. however there could be relatively complex expressions on the RHS of the +=
so you can't just consider v += w
type cases.
There is a way to do atomic divide although I've forgotten how you do it now. There's not a single operation, but I think you can put an atomic lock on a memory location? Something like that anyway.
Do you mean that if you want to allow modifications of both pre AND postsynaptic variables you have to use atomic operations? Because if you're just going in one direction there's all sorts of tricks, right? (I guess probably GeNN is using some of them, and NeMo uses a whole lot of tricks for sparse propagation.)
from brian2genn.
Related Issues (20)
- Question: How to work around restriction of synaptic output variable or summed variable? HOT 4
- Cannot open include file: 'brianlib/stdint_compat.h from clocks.h HOT 22
- Building genn executable fails after a certain number of successful runs when parameter fitting HOT 12
- Workaround for network-operation? HOT 30
- Use GeNN's new run_regularly mechanisms for run_regularly statements
- Use GeNN's initvar snippets for synapse creation
- Brian2genn model build is completed, but system cannot find the path specified HOT 17
- RuntimeError: Project compilation failed HOT 2
- Undeclared Identifier Error for Multiple Runs HOT 6
- potential problem with handling of build_options
- Custom header files are missing when used in `device.insert_code` calls HOT 1
- C99 math functions fail on integer type arguments HOT 18
- Inaccurate updates when having multiple differential equations in neuron groups HOT 3
- StateMonitor fails to collect data from some Synapses HOT 3
- use individually named dir instead of GeNNworkspace HOT 1
- [Feature request] Support for slower clocks in Monitors HOT 3
- RNG & seeding HOT 4
- SpikeGenerator problem HOT 2
- Error code 50 HOT 3
- Failed to build, error: ‘spikeCount_neurongroup’ was not declared in this scope HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brian2genn.