Skip to content

Commit

Permalink
Merge pull request #279 from genn-team/4_1_0_release
Browse files Browse the repository at this point in the history
4.1.0 release
  • Loading branch information
neworderofjamie authored Nov 5, 2019
2 parents 30db4f9 + 96cef06 commit 37e7a83
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.sh text eol=lf
4 changes: 2 additions & 2 deletions doxygen/07_PyGeNN.dox
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ The ``pygenn.genn_model.GeNNModel`` class provides a thin wrapper around ``Model
``SynapseGroup``, ``NeuronGroup`` and ``CurrentSource`` are similarly wrapped by the ``pygenn.genn_groups.SynapseGroup``, ``pygenn.genn_groups.NeuronGroup`` and ``pygenn.genn_groups.CurrentSource`` classes respectively.

PyGeNN can be built from source on Windows, Mac and Linux following the instructions in the README file in the pygenn directory of the GeNN repository.
However, if you have a relatively recent version of Python and CUDA, we recommend that you instead downloading a suitable 'wheel' from our releases page.
These can then be installed using e.g. ``pip install cuda10-pygenn-0.2-cp27-cp27mu-linux_x86_64.whl`` for a Linux system with CUDA 10 and Python 2.7.
However, if you have a relatively recent version of Python and CUDA, we recommend that you instead downloading a suitable 'wheel' from our releases page (all wheels are build for CUDA 10 except for on Mac OS which is built for CUDA 9).
These can then be installed using e.g. ``pip install pygenn-0.2.1-cp27-cp27mu-linux_x86_64.whl`` for a Linux system with Python 2.7.
On Windows we recommend using the Python 3 version of [Anaconda](https://www.anaconda.com/distribution/).

The following example shows how PyGeNN can be easily interfaced with standard Python packages such as numpy and matplotlib to plot 4 different Izhikevich neuron regimes:
Expand Down
28 changes: 27 additions & 1 deletion doxygen/09_ReleaseNotes.dox
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
/*! \page ReleaseNotes Release Notes
Release Notes for GeNN v4.1.0
====
This release adds a number of new features to GeNN and its SpineML interface as well as fixing a number of bugs that have been identified since the 4.0.2 release.

User Side Changes
----
1. The SpineML simulator could previously only be used as a standalone application. This functionality is now provided by the spineml_simulator library and can be used via the ``SpineMLSimulator::Simulator`` class.
2. When declaring a model's variables using ``SET_VAR``, they can be marked as read-only by adding a 3rd parameter set to ``VarAccess::READ_ONLY`` to enable further optimisations. See \ref sect_own for more details.
3. Previously, unless models were very large or had very high spike rates, using ``SynapseGroup::SpanType::PRESYNAPTIC`` typically resulted in poor performance. When using the CUDA backend, ``SynapseGroup::setNumThreadsPerSpike`` can now be used to increase parallelism.
4. There were useful helpers for recording spikes (``SpikeRecorder``) and timing (``Timer``, ``TimerAccumulate``) in "userproject\include" which were not easily usable to user projects. ``genn-create-userproject.sh`` and ``genn-create-userproject.bat`` now have a "-u" option which puts this in the include path of the generated project.
5. Timing information generated when ``ModelSpec::setTiming`` is enabled was not accesible to SpineML models. This is now exposed through the ``SpineMLSimulator::Simulator`` class.
6. Neuron population state variables were not easily accessible if the populations had incoming or outgoing connections with synaptic delays. Additional helper functions are now generated. See \ref CreateAndSimulate for more details.
7. SpineML interface will now use heterogeneous dendritic delay system introduced in GeNN 3.2.0 if required.
8. Add ``CodeGenerator::CUDA::Preferences::generateLineInfo`` option to output CUDA line info for profiling.
9. CUDA backend supports ``half`` datatype allowing memory savings through reduced precision. Host C++ code does not support half-precision types so such state variables must have their location set to ``VarLocation::DEVICE``.
10. If ``ModelSpec::setDefaultNarrowSparseIndEnabled`` is set on a model or ``SynapseGroup::setNarrowSparseIndEnabled`` is set on an individual synapse population with sparse connectivity, 16-bit numbers will be used for postsynaptic indices, almost halving memory requirements.
11. Manual selection of CUDA devices is now exposed to PyGeNN via the ``pygenn.genn_model.GeNNModel.selected_gpu`` property.

Bug fixes:
----
1. Fixed incomaptibilies with GCC 4.9
3. Fixed bug that occured if derived parameters were used in spike-like-event threshold conditions.
4. Fixed bug that occured when merging of postsynaptic models is enabled and GeNN decides to employ specific CUDA optimizations.
5. Increase maximum supported CUDA kernel grid size - a bug was limiting this to 65536.
6. Fixed bugs in timing system when used with synapse dynamics kernels.

Release Notes for GeNN v4.0.2
====
This release fixes several small issues with the generation of binary wheels for Python:
Expand All @@ -19,7 +45,7 @@ User Side Changes

Bug fixes:
----
1. Fixed typo in ``GeNNModel.push_var_to_device`` function in PyGeNN.
1. Fixed typo in ``pygenn.genn_model.GeNNModel.push_var_to_device`` function in PyGeNN.
2. Fixed broken support for Visual C++ 2013.
3. Fixed zero-copy mode.
4. Fixed typo in tutorial 2.
Expand Down
8 changes: 4 additions & 4 deletions doxygen/10_UserManual.dox
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ For convenience the methods this class should implement can be implemented using
If defined as `NAME` here, they can then be referenced as \$(NAME) in the code string.
The length of this list should match the NUM_PARAM specified in DECLARE_MODEL.
Parameters are assumed to be always of type double.
- SET_VARS() defines the names and type strings (e.g. "float", "double", etc)
- SET_VARS() defines the names, type strings (e.g. "float", "double", etc) and (optionally) access mode
of the neuron state variables. The type string "scalar" can be used for variables which should be implemented using the precision set globally for the model with ModelSpec::setPrecision.
The variables defined here as `NAME` can then be used in the
syntax \$(NAME) in the code string.
syntax \$(NAME) in the code string. If the access mode is set to ``VarAccess::READ_ONLY``, GeNN applies additional optimisations and models should not write to it.
- SET_NEEDS_AUTO_REFRACTORY() defines whether the neuron should include an automatic refractory period to prevent it emitting spikes in successive timesteps.

For example, using these macros, we can define a leaky integrator \f$\tau\frac{dV}{dt}= -V + I_{{\rm syn}}\f$ solved using Euler's method:
Expand All @@ -219,7 +219,7 @@ public:

SET_PARAM_NAMES({"tau"});

SET_VARS({{"V", "scalar"}});
SET_VARS({{"V", "scalar", VarAccess::READ_WRITE}});
};
\endcode

Expand All @@ -242,7 +242,7 @@ public:

SET_PARAM_NAMES({"tau"});

SET_VARS({{"V", "scalar"}});
SET_VARS({{"V", "scalar", VarAccess::READ_WRITE}});

SET_DERIVED_PARAMS({
{"ExpTC", [](const vector<double> &pars, double dt){ return std::exp(-dt / pars[0]); }}});
Expand Down
2 changes: 1 addition & 1 deletion doxygen/13_UserGuide.dox
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ User-defined model variables originate from classes derived off the NeuronModels
SET_VARS({{"V", "scalar"}});
\endcode
When a neuron or synapse population using this model is added to the model, the full GeNN name of the variable will be obtained by concatenating the variable name with the name of the population.
For example if we a add a population called `Pop` using a model which contains our `V` variable, a variable `VPop` of type `scalar*` will be available in the global namespace of the simulation program. GeNN will pre-allocate this C array to the correct size of elements corresponding to the size of the neuron population. GeNN will also free these variables when the provided function `freeMem()` is called. Users can otherwise manipulate these variable arrays as they wish.
For example if we add a population called `Pop` using a model which contains our `V` variable, a variable `VPop` of type `scalar*` will be available in the global namespace of the simulation program. GeNN will pre-allocate this C array to the correct size of elements corresponding to the size of the neuron population. GeNN will also free these variables when the provided function `freeMem()` is called. Users can otherwise manipulate these variable arrays as they wish.
For convenience, GeNN provides functions to copy each state variable from the device into host memory and vice versa e.g. `pullVPopFromDevice()` and `pushVPoptoDevice()`.
Alternatively, all state variables associated with a population can be copied using a single call E.g.
\code
Expand Down
16 changes: 9 additions & 7 deletions doxygen/genn-doxygen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -765,12 +765,15 @@ WARN_LOGFILE =

INPUT = $(GENN_PATH)/doxygen \
$(GENN_PATH)/pygenn \
$(GENN_PATH)/include/genn \
$(GENN_PATH)/include/genn_cuda_backend \
$(GENN_PATH)/include/genn_single_threaded_cpu_backend \
$(GENN_PATH)/src/genn \
$(GENN_PATH)/src/genn_cuda_backend \
$(GENN_PATH)/src/genn_single_threaded_cpu_backend
$(GENN_PATH)/include/genn/genn \
$(GENN_PATH)/include/genn/backends/cuda \
$(GENN_PATH)/include/genn/backends/single_threaded_cpu \
$(GENN_PATH)/include/spineml/simulator \
$(GENN_PATH)/src/genn/genn \
$(GENN_PATH)/src/genn/backends/cuda \
$(GENN_PATH)/src/genn/backends/single_threaded_cpu \
$(GENN_PATH)/src/spineml/simulator \
$(GENN_PATH)/userproject/include


# This tag can be used to specify the character encoding of the source files
Expand Down Expand Up @@ -824,7 +827,6 @@ EXCLUDE = www \
makedoc \
publishdoc \
tests \
userproject \
pygenn/genn_wrapper

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
Expand Down
2 changes: 1 addition & 1 deletion makedoc → makedoc.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/bash

export GENN_PATH=$(dirname $(realpath "$0"))
(cat doxygen/genn-doxygen.conf ; echo "PROJECT_NUMBER=`cat version.txt`") | doxygen -
doxygen/fixLatexPageref.pl documentation/latex/files.tex
doxygen/fixLatexPageref.pl documentation/latex/hierarchy.tex
Expand Down
6 changes: 3 additions & 3 deletions pygenn/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# A Python interface to GeNN
PyGeNN wraps the C++ GeNN APU using SWIG, allowing GeNN to be used either directly from Python or as a backend for higher-level Python APIs such as [PyNN](https://github.com/genn-team/pynn_genn). Building PyGeNN is a little involved so we recommend installing a prebuilt binary wheel from our Releases page or direct from our [build server](https://gen-ci.inf.sussex.ac.uk/job/GeNN/job/genn/).
PyGeNN wraps the C++ GeNN API using SWIG, allowing GeNN to be used either directly from Python or as a backend for higher-level Python APIs such as [PyNN](https://github.com/genn-team/pynn_genn). Building PyGeNN is a little involved so we recommend installing a prebuilt binary wheel from our Releases page or direct from our [build server](https://gen-ci.inf.sussex.ac.uk/job/GeNN/job/genn/).

### Installing PyGeNN from binary wheels
- Select a suitable wheel from the Releases page. For example, if you have a Linux system with Python 3.7 and CUDA 10, you would pick ``cuda10-pygenn-0.2-cp37-cp37m-linux_x86_64.whl``. If you do not have CUDA installed, ignore the CUDA version and pick the wheel that otherwise matches your platform.
- Install the wheel using pip ``pip install cuda10-pygenn-0.2-cp37-cp37m-linux_x86_64.whl``
- Select a suitable wheel from the Releases page (all wheels are build for CUDA 10 except for on Mac OS which is built for CUDA 9). For example, if you have a Linux system with Python 3.7 you would pick ``pygenn-0.2.1-cp37-cp37m-linux_x86_64.whl``. If you do not have CUDA installed, ignore the CUDA version and pick the wheel that otherwise matches your platform.
- Install the wheel using pip ``pip install pygenn-0.2.1-cp37-cp37m-linux_x86_64.whl``

### Installing PyGeNN from source on Linux or Mac OSX
- Either download the latest release of GeNN and extract into your home directory or clone using git from https://github.com/genn-team/genn
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
**backend_extension_kwargs))

setup(name = "pygenn",
version = "0.2",
version = "0.2.1",
packages = find_packages(),
package_data={"pygenn": package_data},

Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ FOR /D %%F IN (*) DO (
CALL genn-buildmodel.bat %BUILD_FLAGS% model.cc

REM Build model
msbuild "%%F.sln" /t:%%F /p:BuildProjectReferences=true /p:Configuration=Release
msbuild "%%F.sln" /m /t:%%F /p:BuildProjectReferences=true /verbosity:minimal /p:Configuration=Release

REM Run tests
test.exe --gtest_output="xml:test_results.xml"
Expand Down
2 changes: 1 addition & 1 deletion userproject/include/generateRun.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class GenerateRunBase
cmd += " -c";
}

cmd += " && msbuild " + m_ProjectName + ".sln /t:" + m_ProjectName + " /p:Configuration=";
cmd += " && msbuild /verbosity:minimal /m " + m_ProjectName + ".sln /t:" + m_ProjectName + " /p:Configuration=";
if (m_Debug) {
cmd += "Debug";
}
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.2
4.1.0

0 comments on commit 37e7a83

Please sign in to comment.