emer / axon

Axon is a spiking, biologically-based neural model driven by predictive error-driven learning, for systems-level models of the brain
BSD 3-Clause "New" or "Revised" License
18 stars 8 forks source link

SendSpike on CPU can be parallelized over Send Neurons #220

Closed rcoreilly closed 1 year ago

rcoreilly commented 1 year ago

It is currently by layer, which doesn't make sense..

Meanwhile, I keep having the same confusion, thinking that SendPrjns (Prjns array) is more fine-grained than Neurons, but I'm actually thinking about SendCon, which is Neurons * sending prjns.

As of now, we cannot iterate over SendCon in GPU, because we would need to store: sending neuron index, prjn idx in a slice, same size as SendCon, so we can recover those from SendCon index.

this is easily doable and not very big -- will give it a try after first pass on GPU sender-based.

rcoreilly commented 1 year ago

I will do this as part of the sender PR, just a reminder to do it.

rcoreilly commented 1 year ago

The issue was write conflict on recv GBuf -- but easy enough to add atomic add just like in GPU -- works well, and sendspike now benefits from threading.

Also, SendSpike also calls PostSpike at neuron level, which would otherwise require a separate call, so probably not worth doing at this point.