/neurodriver-benchmark

Neurodriver / Brian2GeNN Performance Comparison

Primary LanguagePythonOtherNOASSERTION

Neurodriver / Brian2GeNN Performance Comparison

Description

This code can be used to compare the performance of Neurodriver and Brian2GeNN when both are used to simulate a network of randomly connected Leaky IAF neurons connected by alpha function synapses, where all neurons and synapses are configured identically and a subset of the neurons are provided with a constant current input for the duration of the simulation.

To make the comparison as fair as possible, the following methodology is employed:

  • The execution time of the Brian2GeNN simulation measures the duration of both the call to the brian2.core.magic.run() method and the call to brian2.devices.device.CurrentDeviceProxy.build() because Brian2GeNN cannot currently reuse generated code in a new simulation run. Output generated by the generated GeNN binary is saved to disk and loaded into Brian data structures after it finishes running.
  • Since the constant input to the Neurodriver simulation is copied into the requisite variables at every step of the simulation, the constant input to the Brian2GeNN simulation is set at every execution step via brian2.NeuronGroup.run_regularly() (Brian2 timed arrays are currently not supported by Brian2GeNN).
  • Spike states generated during each run step of the Neurodriver simulation are copied to host memory after each step. States are saved to pagelocked memory to accelerate this copy operation.
  • The execution time of the Neurodriver simulation measures the duration of the simulation's entire run loop; this excludes initialization of variables used during the simulation and saving of the output to disk at the end of the run loop, but includes copying of the generated spike states to host memory described above.

Parameters

  • Simulation duration: 3 s
  • Time resolution: 1e-4 s

Required Software

Usage

  1. Run python run_brian2genn.py > brian2genn.log to generate benchmarks for the Brian2GeNN simulation. Repeat several times using different output files that match brian2genn*.log.
  2. Run python run_neurodriver.py > neurodriver.log to generate benchmarks for the Neurodriver simulation. Repeat several times using different output files that match neurodriver*.log.
  3. Run python plot_benchmark.py to generate a plot comparing the benchmarks.

Notes

It may be necessary to patch GeNN to run the benchmarks on certain GPUs.

Authors & Acknowledgements

See the included AUTHORS file for more information.

License

All files that make use of Brain2GeNN are licensed under the GPLv2 license. All files that make use of Neurodriver and Neurokernel are licensed under the BSD License. See the included LICENSE file for more information.