Service release 2.2
Release Notes for GeNN v2.2
This release includes minor new features, some core code improvements and several bug fixes on GeNN v2.1.
User Side Changes
-
GeNN now analyses automatically which parameters each kernel needs access to and these and only these are passed in the kernel argument list in addition to the global time t. These parameters can be a combination of extraGlobalNeuronKernelParameters and extraGlobalSynapseKernelParameters in either neuron or synapse kernel. In the unlikely case that users wish to call kernels directly, the correct call can be found in the
stepTimeGPU()
function.
Reflecting these changes, the predefined Poisson neurons now simply have two extraGlobalNeuronParameterrates
andoffset
which replace the previous pointer argument ofstepTimeGPU()
to the array of input rates and integer offset to indicate the current input pattern. TheseextraGlobalNeuronKernelParameters
are passed to the neuron kernel automatically, but the rates themselves within the array are of course not updated automatically (this is exactly as before with the specifically generated kernel arguments for Poisson neurons).
In case of doubt, please refer to classol::runGPU. The C arrays d_pattern and d_baserates were prepared earlier in the user side code in classol::allocate_device_mem_patterns.
The concept of "directInput" has been removed. Users can easily achieve the same functionality by adding an additional variable (if there are individual inputs to neurons), an extraGlobalNeuronParameter (if the input is homogeneous but time dependent) or, obviously, a simple parameter if it's homogeneous and constant.Note: The global time variable "t" is now provided by GeNN; please make sure that you are not duplicating its definition or shadowing it. This could have severe consequences for simulation correctness (e.g. time not advancing in cases of over-shadowing).
-
We introduced the namespace GENN_PREFERENCES which contains variables that determine the behaviour of GeNN.
-
We introduced a new code snippet called "supportCode" for neuron models, weightupdate models and post-synaptic models. This code snippet is intended to contain user-defined functions that are used from the other code snippets. We advise where possible to define the support code functions with the CUDA keywords "host device" so that they are available for both GPU and CPU version. Alternatively one can define separate versions for host and device in the snippet. The snippets are automatically made available to the relevant code parts. This is regulated through namespaces so that name clashes between different models do not matter. An exception are hash defines. They can in principle be used in the supportCode snippet but need to be protected specifically using
ifndef. For example
#ifndef clip(x)
#define clip(x) x > 10.0? 10.0 : x
#endif
Note: If there are conflicting definitions for hash defines, the one that appears first in the GeNN generated code will then prevail.
- The new convenience macros spikeCount_XX and spike_XX where "XX" is the name of the neuron group are now also available for events: spikeEventCount_XX and spikeEvent_XX. They access the values for the current time step even if there are synaptic delays and spikes events are stored in circular queues.
- The old buildmodel.[sh|bat] scripts have been superseded by new genn-buildmodel.[sh|bat] scripts. These scripts accept UNIX style option switches, allow both relative and absolute model file paths, and allow the user to specify the directory in which all output files are placed (-o ). Debug (-d), CPU-only (-c) and show help (-h) are also defined.
- We have introduced a CPU-only "-c" genn-buildmodel switch, which, if it's defined, will generate a GeNN version that is completely independent from CUDA and hence can be used on computers without CUDA installation or CUDA enabled hardware. Obviously, this then can also only run on CPU. CPU only mode can either be switched on by defining CPU_ONLY in the model description file or by passing appropriate parameters during the build, in particular
genn-buildmodel.[sh|bat] \<modelfile\> -c
make release CPU_ONLY=1
- The new genn-buildmodel "-o" switch allows the user to specify the output directory for all generated files - the default is the current directory. For example, a user project could be in '/home/genn_project', whilst the GeNN directory could be '/usr/local/genn'. The GeNN directory is kept clean, unless the user decides to build the sample projects inside of it without copying them elsewhere. This allows the deployment of GeNN to a read-only directory, like '/usr/local' or 'C:\Program Files'. It also allows multiple users - i.e. on a compute cluster - to use GeNN simultaneously, without overwriting each other's code-generation files, etcetera.
- The ARM architecture is now supported - e.g. the NVIDIA Jetson development platform.
- The NVIDIA CUDA SM_5* (Maxwell) architecture is now supported.
- An error is now thrown when the user tries to use double precision floating-point numbers on devices with architecture older than SM_13, since these devices do not support double precision.
- All GeNN helper functions and classes, such as
toString()
andNNmodel
, are defined in the header files atgenn/lib/include/
, for examplestringUtils.h
andmodelSpec.h
, which should be individually included before the functions and classes may be used. The functions and classes are actually implementated in the static librarygenn\lib\lib\genn.lib
(Windows) orgenn/lib/lib/libgenn.a
(Mac, Linux), which must be linked into the final executable if any GeNN functions or classes are used. - In the
modelDefinition()
file, only the header filemodelSpec.h
should be included - i.e. not the source filemodelSpec.cc
. This is because the declaration and definition ofNNmodel
, and associated functions, has been separated intomodelSpec.h
andmodelSpec.cc
, respectively. This is to enable NNmodel code to be precompiled separately. Henceforth, only the header filemodelSpec.h
should be included in model definition files! - In the
modelDefinition()
file, DT is now preferrably defined usingmodel.setDT(<val>);
, rather than #define DT <val>
, in order to prevent problems with DT macro redefinition. For backward-compatibility reasons, the old #define DT <val>
method may still be used, however users are advised to adopt the new method. - In preparation for multi-GPU support in GeNN, we have separated out the compilation of generated code from user-side code. This will eventually allow us to optimise and compile different parts of the model with different CUDA flags, depending on the CUDA device chosen to execute that particular part of the model. As such, we have had to use a header file
definitions.h
as the generated code interface, rather than therunner.cc
file. In practice, this means that user-side code should includemyModel_CODE/definitions.h
, rather thanmyModel_CODE/runner.cc
. Includingrunner.cc
will likely result in pages of linking errors at best!
Developer Side Changes
- Blocksize optimization and device choice now obtain the ptxas information on memory usage from a CUDA driver API call rather than from parsing ptxas output of the nvcc compiler. This adds robustness to any change in the syntax of the compiler output.
- The information about device choice is now stored in variables in the namespace
GENN_PREFERENCES
. This includeschooseDevice
,optimiseBlockSize
,optimizeCode
,debugCode
,showPtxInfo
,defaultDevice
.asGoodAsZero
has also been moved into this namespace. - We have also introduced the namespace GENN_FLAGS that contains unsigned int variables that attach names to numeric flags that can be used within GeNN.
- The definitions of all generated variables and functions such as pullXXXStateFromDevice etc, are now generated into definitions.h. This is useful where one wants to compile separate object files that cannot all include the full definitions in e.g. "runnerGPU.cc". One example where this is useful is the brian2genn interface.
- A number of feature tests have been added that can be found in the
featureTests
directory. They can be run with the respectiverunTests.sh
scripts. ThecleanTests.sh
scripts can be used to remove all generated code after testing.
Improvements
- Improved method of obtaining ptxas compiler information on register and shared memory usage and an improved algorithm for estimating shared memory usage requirements for different block sizes.
- Replaced pageable CPU-side memory with page-locked memory. This can significantly speed up simulations in which a lot of data is regularly copied to and from a CUDA device.
- GeNN library objects and the main generateALL binary objects are now compiled separately, and only when a change has been made to an object's source, rather than recompiling all software for a minor change in a single source file. This should speed up compilation in some instances.
Bug fixes:
- Fixed a minor bug with delayed synapses, where delaySlot is declared but not referenced.
- We fixed a bug where on rare occasions a synchronisation problem occurred in sparse synapse populations.
- We fixed a bug where the combined spike event condition from several synapse populations was not assembled correctly in the code generation phase (the parameter values of the first synapse population over-rode the values of all other populations in the combined condition).
Please refer to the full documentation for further details, tutorials and complete code documentation.