Performance comparison

This page compares SpikingNeuralNetworks.jl v2 (SNNModels 2.0) with its predecessor v1 (SNNModels 1.9.1) and with two established simulators: Auryn and Brian2 (C++ standalone mode). All arms simulate the same models with the same parameters, connectivity and inputs.

Method

  • Machine. Intel Xeon w5-3425, Linux 6.8, Julia 1.12.6, Brian2 2.9.0 (cpp_standalone, g++ 13.3 with Brian2's default flags), Auryn 0.8.3 (-O3 -march=native -ffast-math).
  • One thread. Every arm runs on one thread pinned to an idle core (taskset). Brian2 OpenMP, Auryn MPI and Julia threading are not part of these comparisons.
  • Precision. Julia and Auryn use Float32, Brian2 uses float64. Julia Float64 runs are reported where relevant.
  • Timing. Each value is the median of 3 processes. Only the simulation is timed: compilation, Julia's first-call (JIT) cost and network construction are excluded. For Brian2 the time is device._last_run_time as Brian2 reports it.
  • Versions. v2 was measured at SNNModels commit b25eb27; v1 is SNNModels 1.9.1.
  • Correctness. Timings are only compared between runs that agree:
    • single LIF neuron: identical spike times across the three simulators;
    • STDP final weights: equal to within 1e-6 between v1, v2 and Brian2;
    • balanced network: matching rate and CV-ISI distributions at N = 4000.

The campaign's data, scripts and full tables are in the JuliaSNN_publication repository (validation/profilation_v1.10/perf/final_v2).

Balanced E/I network

A network of leaky integrate-and-fire neurons:

  • 80 % excitatory neurons, K = 100 inputs per neuron;
  • current-based synapses with a 5 ms time constant;
  • 0.8 ms delays, dt = 0.1 ms, recording off.

The table gives the wall-clock time per simulated second.

Nv1 (s)v2 (s)Auryn (s)Brian2 (s)v2 ns per neuron-step
5000.06140.006970.007280.009161.40
1 0000.1320.01210.01490.01571.21
2 0000.2830.02180.03010.03511.09
4 0000.6060.04370.06180.05901.09
10 0001.790.1090.1660.1691.09
20 000-0.2350.3590.3131.17
50 000-0.6841.050.9611.37
  • v2 against v1: v2 is 9 to 16 times faster than v1. v1 was measured only up to N = 10 000.
  • v2 against Auryn and Brian2: v2 is 1.0 to 1.6 times faster than Auryn and Brian2 at every size.
  • Spike recording: recording every spike costs v2 6 % at N = 5 000 and 1 % at N = 50 000.
  • Memory: the synapse arrays take 8.3 bytes per synapse, close to Auryn's 8.5. Brian2 takes 42.
    • Julia's peak RSS has a fixed part of about 800 MB for the runtime, the package code and the JIT.
    • Auryn and Brian2 use 26 to 212 MB in total.

Balanced E/I network

Neuron models

The table gives the cost of integrating each neuron model, in ns per neuron per step. The setup is N = 10 000 neurons with no synapses, driven into the spiking regime.

modelv1v2 Float32v2 Float64Brian2Auryn
IF5.481.283.002.723.14
AdEx10.13.055.1911.36.83
HH36.07.9711.027.8-
Izhikevich0.960.651.301.062.84
Morris-Lecar33.67.7333.230.2-
Tripod53.411.432.7--
BallAndStick34.67.0718.4--

A dash means the model is not available in that simulator. The integration schemes of the simulators differ, so the firing rates are similar but not identical: AdEx fires at 71 Hz in Julia and at 81 Hz in Brian2 and Auryn.

Neuron models

Synaptic plasticity

STDP rules

The test is 200 or 10 000 Poisson inputs onto one neuron, with 20 s simulated. The table gives the wall-clock time in seconds.

synapsesrulev1v2AurynBrian2
200pair0.09650.01860.02380.0430
200triplet0.1030.01880.02470.0443
10 000pair0.3140.02390.04640.0579
10 000triplet0.3900.02600.04770.0810
10 000weight-dependent0.4110.04770.07030.0581

STDP is event-driven in v2, as it is in Auryn and Brian2. Its cost therefore grows slowly with the number of synapses.

Voltage-based STDP (Clopath)

This uses the same setup as the STDP rules, with 20 s simulated. Auryn has no voltage-based STDP rule. The Brian2 event-driven version is hand-written for this comparison.

synapsesv1 densev2 densev2 event-drivenBrian2 denseBrian2 event-driven
2000.2950.05430.02700.08920.0476
10 0002.321.910.03772.570.0557
  • Dense mode (vSTDPDenseParameter) updates every synapse at every step, so its cost grows with the number of synapses.
  • Event-driven mode (vSTDPParameter, the default in v2) brings the cost at 10 000 synapses down to about 1.6 times that of pair STDP, against about 80 times for dense mode.

Plastic network

This is the balanced network with pair STDP on the E→E connections. The table gives the time per simulated second for N = 10 000.

v1v2AurynBrian2
static1.810.1110.1660.170
plastic E→E2.110.1670.2230.380

All four simulators give the same rates (6.7 to 6.9 Hz) and the same final E→E weight distributions.

Plasticity

Delays and Poisson input

Both tests use the balanced network with N = 10 000. The tables give the time per simulated second.

Synaptic delays. In v2 the delays are stored in ring buffers, so the cost does not depend on the delay length.

delayv1v2AurynBrian2
1 ms1.920.1080.1670.169
10 ms2.170.1100.1690.170

Poisson input. The network receives input from a Poisson population, and the table gives the rate of each input neuron.

input ratev1v2AurynBrian2
1 Hz2.790.1240.1830.500
50 Hz6.590.2080.3070.612
500 Hz49.30.9041.251.57

Delays and Poisson input

Notes

  • Not measured: threading, MPI and OpenMP, which are not included in these comparisons.
  • Precision: Float64 populations cost 1.4 to 4 times the Float32 ones, depending on the model, and 2.3 times on the E/I network.
  • Per-call overhead: after the measurement, SNNModels 2.0.1 removed a fixed cost of 12 to 30 ns from each call of the single-step train!. This cost matters only for very small networks stepped one call at a time, such as the plasticity tests above, where it is a few percent of the time.
    • With 2.0.1, pair STDP at 10 000 synapses takes 0.020 s.
    • Event-driven voltage-based STDP at 10 000 synapses takes 0.036 s.