Skip to content

Optimized Pipeline for the modelling of Spiking Neural Networks (SNNs)

License

Notifications You must be signed in to change notification settings

SpikeAI/2020-12_brainhack_Project7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpSNN : Optimized Pipeline for Spiking Neural Networks

Project info

Title: Optimized Pipeline for the modelling of Spiking Neural Networks (SNNs)

Project lead and collaborators:

Lead: Alberto Vergani @albertovergani

Lead: Laurent Perrinet @laurentperrinet

Collaborator: Julia Sprenger @juliasprenger

Description

We are doing Spiking Neural Networks of the primary visual cortex designed to help us better understand visual computations using Spatio-temporal Diffusion Kernels and Traveling Waves. We are using neural simulators using classical pipelines (pyNN AND (Nest OR SpiNNaker) ), but for which we wish to optimize the different steps: (1) setting up the network, (2) running the simulation & (3) analyzing the results.

We wish to go beyond the classical strategy ("yet another model") but to understand "why" such a given network would be a good descriptor of neural computations (for a context, see https://arxiv.org/ftp/arxiv/papers/2004/2004.07580.pdf ). With such an efficient simulation pipeline, we would like in the future to "close the loop" and explore the space of all network configurations, in normal as well as pathological conditions.

Links of interest:

Goals for Brainhack Marseille

  • working goals: handle the interface between simulations blocks (network building, running simulations, results analysis)
  • perspective goal: thinking about closing the loop by optimizing the network structure based on the output of the analysis.

Skills: python 100% numpy 80% PyNN 40%

Striking Image brainhack2020_2

Wrap-up of results:

We first investigated existing solutions / efforts in that direction :

output

we tested different backends for writing files, while keeping neo files (and thus the same plotting functions).

For the testing, we run simulations on SpiNNaker with 1000 cells (https://github.com/SpikeAI/2020-12_brainhack_Project7/blob/main/output/3_boilerplate.ipynb) obtaining:

pkl format

Nodes                  : 1
Number of Neurons      : 1000
Excitatory conductance : 4 nS
Inhibitory conductance : 51 nS
Excitatory rate        : 0.84 Hz
Inhibitory rate        : 0.73 Hz
Build time             : 0.00574541 s
Simulation time        : 68.6002 s
Writing time           : 0.246068 s

nixio format

Nodes                  : 1
Number of Neurons      : 1000
Excitatory conductance : 4 nS
Inhibitory conductance : 51 nS
Excitatory rate        : 1.07875 Hz
Inhibitory rate        : 1.095 Hz
Build time             : 0.00556111 s
Simulation time        : 66.1884 s
Writing time           : 212.847 s

The writing time regards the saving of spikes for 1000 cells, but voltage for two cells (i.e., [0] and [1])

voltage comparison between pkl and nixio format

Overlapped since identical results

brainhack2020_comparison

check extended results (spikes and voltage) here https://github.com/SpikeAI/2020-12_brainhack_Project7/blob/main/output/3_C_loading_inputs.ipynb

summary

  • in summary, we compared Neo pickle vs Neo-Nix as interchange file formats
    • pickle: faster saving time, smaller file sizes, requires identical environment for reading
    • nix: slower in saving, larger file sizes, interoperable hdf5 file, less dependent on package versions (see also update on NeuralEnsemble/python-neo#310)

input

we have now the possibility to import tonic datasets into pyNN:

output spikesoutput spikesoutput spikesoutput spikes

check out https://github.com/SpikeAI/2020-12_brainhack_Project7/blob/main/input/D_tonic2SpikeSourceArray.ipynb

benchmark

using

  N_pop=1000,  # number of cells
  simtime=1000, # (ms) simulaton duration

we get the following results

on nest with hdf5:

population size bio simtime
2020-12-04_scan_nest__N_pop 2020-12-04_scan_nest__simtime
buildCPUTime (ms) = 0.583 * N_pop + 0.016/1000 * simtime (ms) * N_pop
simCPUTime (ms) = -0.007 * N_pop + 2.841/1000 * simtime (ms) * N_pop
writeCPUTime (ms) = 0.202 * N_pop + 0.035/1000 * simtime (ms) * N_pop

on nest with nixio:

buildCPUTime (ms) = 0.588 * N_pop + 0.017 * simtime (ms) * N_pop/1000
simCPUTime (ms) = 0.047 * N_pop + 3.139 * simtime (ms) * N_pop/1000
writeCPUTime (ms) = 19.241 * N_pop + 0.134 * simtime (ms) * N_pop/1000

on spinnaker:

population size bio simtime
2020-12-04_scan_spinnaker_N_pop 2020-12-04_scan_spinnaker_simtime
buildCPUTime (ms) = 0.002 * N_pop + 0.000/1000 * simtime (ms) * N_pop
simCPUTime (ms) = 24.476 * N_pop + 6.483/1000 * simtime (ms) * N_pop
writeCPUTime (ms) = 0.253 * N_pop + 0.186/1000 * simtime (ms) * N_pop

About

Optimized Pipeline for the modelling of Spiking Neural Networks (SNNs)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published