UCI-CARL / CARLsim6

CARLsim is an efficient, easy-to-use, GPU-accelerated software framework for simulating large-scale spiking neural network (SNN) models with a high degree of biological detail.
MIT License
41 stars 16 forks source link

Cuda Memory Error on Connections with 0 synapses #44

Open joey-kilgore opened 1 month ago

joey-kilgore commented 1 month ago

Context - I'm working on smaller scale network models and comparing their network dynamics and potential for scaling. The current model we use has a wide selection of 9-param IZ groups, but some with significantly fewer neurons than another. I know that running smaller scale networks is faster on CPU, but often the networks may have one or two group with >1000 neurons, and one or two groups with <5 neurons, and it would be nice to not have to keep switching between the two.

Problem - Often times we are scaling to the point they may be only 1 neuron in a group, which may have a connection to another group with 1 neuron. While we test different connection probabilities, in this connection from a 1 neuron group to another 1 neuron group, it would often generate a connection with no synapses (based on the connection probability). This would throw a cuda memory error (since it would try and copy the non existent synaptic info)

Fix in my project - I think there are ways for me to avoid this in my work by just forcing probabilities to be 1 if there is a low enough number of neurons. BUT this is something that technically could always occur. For instance if there are 2 neurons in groups being connecting, a probability of 0.5 should work, but would fail 1/16 of the time.

Fix in CARLsim6 - There needs to be a check at synaptic generation for empty connections, and generate a random connection. With that the following steps should occur