From 6b7c944e016429b771857bb28fcb38ecddbf7151 Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 12:39:02 +0000 Subject: [PATCH 01/14] Added .gitattributes to prevent git messing with shell script line endings on windows (makes GeNN unusable on WSL) --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..efdba87644 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* text=auto +*.sh text eol=lf From c0a2d0321121bb56a9faf9685947689993814847 Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 12:40:15 +0000 Subject: [PATCH 02/14] Started updating release notes --- doxygen/09_ReleaseNotes.dox | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doxygen/09_ReleaseNotes.dox b/doxygen/09_ReleaseNotes.dox index 10b28289f6..283941f4c4 100644 --- a/doxygen/09_ReleaseNotes.dox +++ b/doxygen/09_ReleaseNotes.dox @@ -1,4 +1,22 @@ /*! \page ReleaseNotes Release Notes +Release Notes for GeNN v4.1.0 +==== +This release + +User Side Changes +---- + + +Bug fixes: +---- +1. Fixed incomaptibilies with older compilers (GCC 4.9 and Visual Studio 2013) accidentally introduced in 4.0.0. +2. Fixed typo in ``GeNNModel.push_var_to_device`` method in PyGeNN +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 when GeNN decides to employ some 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. +7. + Release Notes for GeNN v4.0.2 ==== This release fixes several small issues with the generation of binary wheels for Python: From ab4f817841b891b4ff813245983291d0072ca3d8 Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 12:46:13 +0000 Subject: [PATCH 03/14] renamed makedoc to match gitattributes --- makedoc => makedoc.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename makedoc => makedoc.sh (100%) mode change 100755 => 100644 diff --git a/makedoc b/makedoc.sh old mode 100755 new mode 100644 similarity index 100% rename from makedoc rename to makedoc.sh From 8e8b3306c823eba34d54678ea5253e3b1af42572 Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 12:47:46 +0000 Subject: [PATCH 04/14] updated versions --- setup.py | 2 +- version.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e9b6f87a99..feafccff83 100644 --- a/setup.py +++ b/setup.py @@ -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}, diff --git a/version.txt b/version.txt index 4d54daddb6..ee74734aa2 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -4.0.2 +4.1.0 From 11475fc82c9311f8018e2ae1c764084f3025b125 Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 12:56:21 +0000 Subject: [PATCH 05/14] To avoid messing deeper with doxygen config-horror, set GENN_PATH in makedoc.sh --- makedoc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makedoc.sh b/makedoc.sh index 94e2614ed6..e5b1518276 100644 --- a/makedoc.sh +++ b/makedoc.sh @@ -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 From c5b1848e468fb5744c4e29ddb595a494a4b433fe Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 13:35:15 +0000 Subject: [PATCH 06/14] Include SpineML simulator in doxygen paths and fix paths --- doxygen/genn-doxygen.conf | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/doxygen/genn-doxygen.conf b/doxygen/genn-doxygen.conf index c79e85c356..fade93b6f6 100644 --- a/doxygen/genn-doxygen.conf +++ b/doxygen/genn-doxygen.conf @@ -765,12 +765,14 @@ 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 # This tag can be used to specify the character encoding of the source files From eb605fe51e0ff42b673c50c85342a32f525785ac Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 13:46:46 +0000 Subject: [PATCH 07/14] reduced msbuild output junk when running tests --- tests/run_tests.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run_tests.bat b/tests/run_tests.bat index 45d03fb52e..b17afa005e 100644 --- a/tests/run_tests.bat +++ b/tests/run_tests.bat @@ -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" /t:%%F /p:BuildProjectReferences=true /verbosity:minimal /p:Configuration=Release REM Run tests test.exe --gtest_output="xml:test_results.xml" From b4c116e9871dba7856d49ed9b228c456de7d50b1 Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 14:03:20 +0000 Subject: [PATCH 08/14] Include userproject/include in doxygen --- doxygen/genn-doxygen.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doxygen/genn-doxygen.conf b/doxygen/genn-doxygen.conf index fade93b6f6..dc4e040d3e 100644 --- a/doxygen/genn-doxygen.conf +++ b/doxygen/genn-doxygen.conf @@ -772,7 +772,8 @@ INPUT = $(GENN_PATH)/doxygen \ $(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)/src/spineml/simulator \ + $(GENN_PATH)/userproject/include # This tag can be used to specify the character encoding of the source files @@ -826,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 From 5fb2c976302629a77ccc03d5223743a32f102ebc Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 14:07:24 +0000 Subject: [PATCH 09/14] Finished release notes --- doxygen/09_ReleaseNotes.dox | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/doxygen/09_ReleaseNotes.dox b/doxygen/09_ReleaseNotes.dox index 283941f4c4..d9c02293a3 100644 --- a/doxygen/09_ReleaseNotes.dox +++ b/doxygen/09_ReleaseNotes.dox @@ -1,21 +1,29 @@ /*! \page ReleaseNotes Release Notes Release Notes for GeNN v4.1.0 ==== -This release +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 older compilers (GCC 4.9 and Visual Studio 2013) accidentally introduced in 4.0.0. -2. Fixed typo in ``GeNNModel.push_var_to_device`` method in PyGeNN +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 when GeNN decides to employ some CUDA optimizations. +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. -7. Release Notes for GeNN v4.0.2 ==== @@ -37,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. From 113f3ced69e52b4d6a701634c80e40b0b203fa03 Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 14:10:06 +0000 Subject: [PATCH 10/14] Fixed small typo --- doxygen/13_UserGuide.dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doxygen/13_UserGuide.dox b/doxygen/13_UserGuide.dox index 8c1d7e8c07..980141d4f2 100644 --- a/doxygen/13_UserGuide.dox +++ b/doxygen/13_UserGuide.dox @@ -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 From 03b712ced3dbfadeca0e0e13aa1685347fb4dfec Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 14:26:07 +0000 Subject: [PATCH 11/14] Little bit of text about readonly --- doxygen/10_UserManual.dox | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doxygen/10_UserManual.dox b/doxygen/10_UserManual.dox index 25bb3c0fdc..a643a44d73 100644 --- a/doxygen/10_UserManual.dox +++ b/doxygen/10_UserManual.dox @@ -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: @@ -219,7 +219,7 @@ public: SET_PARAM_NAMES({"tau"}); - SET_VARS({{"V", "scalar"}}); + SET_VARS({{"V", "scalar", VarAccess::READ_WRITE}}); }; \endcode @@ -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 &pars, double dt){ return std::exp(-dt / pars[0]); }}}); From 3634a8795b333102d0904cbf5830387d4bf517ca Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 14:31:18 +0000 Subject: [PATCH 12/14] Updated PyGeNN instructions --- doxygen/07_PyGeNN.dox | 4 ++-- pygenn/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doxygen/07_PyGeNN.dox b/doxygen/07_PyGeNN.dox index 5fda2baf83..b0299b833b 100644 --- a/doxygen/07_PyGeNN.dox +++ b/doxygen/07_PyGeNN.dox @@ -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: diff --git a/pygenn/README.md b/pygenn/README.md index 6f055959af..75c5d9f2a3 100644 --- a/pygenn/README.md +++ b/pygenn/README.md @@ -2,8 +2,8 @@ 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/). ### 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 From 0d812a135f52f08cbfe04a13ac91726f3f18d50f Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 14:32:10 +0000 Subject: [PATCH 13/14] Fixed typo in PyGeNN readme --- pygenn/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygenn/README.md b/pygenn/README.md index 75c5d9f2a3..e32a5b9856 100644 --- a/pygenn/README.md +++ b/pygenn/README.md @@ -1,5 +1,5 @@ # 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 (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. From 96cef066406f43b8eb0d85e73eeaa8683d41a1b5 Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2019 14:41:04 +0000 Subject: [PATCH 14/14] Use multiple cores for msbuild incantatations and reduce verbosity of output in generateRun --- tests/run_tests.bat | 2 +- userproject/include/generateRun.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/run_tests.bat b/tests/run_tests.bat index b17afa005e..63bff37428 100644 --- a/tests/run_tests.bat +++ b/tests/run_tests.bat @@ -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 /verbosity:minimal /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" diff --git a/userproject/include/generateRun.h b/userproject/include/generateRun.h index 210f33085a..60160e67f6 100644 --- a/userproject/include/generateRun.h +++ b/userproject/include/generateRun.h @@ -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"; }