Giter Site home page Giter Site logo

genn-team / genn Goto Github PK

View Code? Open in Web Editor NEW
229.0 229.0 57.0 253.43 MB

GeNN is a GPU-enhanced Neuronal Network simulation environment based on code generation for Nvidia CUDA.

Home Page: http://genn-team.github.io/

License: GNU Lesser General Public License v2.1

Makefile 0.22% Shell 0.32% C++ 77.33% Objective-C 0.57% Batchfile 0.12% C 10.23% Python 11.18% Dockerfile 0.04%
computational-neuroscience hacktoberfest nvidia-cuda simulation spiking-neural-networks

genn's People

Contributors

9inpachi avatar ajaysub110 avatar ajc158 avatar alandiamond avatar alexdewar avatar anindyaghosh avatar bdevans avatar brad-mengchi avatar braintimeexception avatar chanokin avatar costrau avatar edward-cf avatar esinyavuz avatar fabianschubert avatar jamesturner246 avatar kanishk16 avatar karlhuang007 avatar kernfel avatar lebedov avatar mstimberg avatar neworderofjamie avatar obaid51 avatar stevinson avatar tnowotny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

genn's Issues

Small DT and single precision floating point

If DT is small (e.g. 0.01) and single precision floating point is used I have observed that
int riT= (int) (runtime/DT);
resulted in riT== 0 for runtime= 0.01 and hence no time stepping.
I suggest to amend all user projects that do a similar step to use:
int riT= (int) (runtime/DT+1e-6);

Avoiding creating unused variables

I'm renaming this thread as we have other instances of unused variable type of problems and it would be nice to take care of this in a more systematic way during code generation.

The previous thread consisted of the warnings on:
Unused variable warning for ipost, ipre for GLOBALG used with NSYNAPSE model

This happens in the SynDelay project. It is not as straightforward as it seems; indexing is not necessary when we use GLOBAL, but if we had a synapse model with a variable that uses these indices they would be needed. These are just warnings at the moment, but it would be more elegant to make a proper check.

Another example of this kind of problem is unnecessary post-to-pre arrays for sparse connectivity. They are (presumably) not needed unless the learning kernel is used.

Creating unnecessary variables would fill the memory unnecessarily and we should avoid this.

Better global memory access

According to the CUDA programming guide, align keyword makes copy of a number of consecutive values in an array to run as fast as a single element copy. It may be useful especially for sparse connectivity.

Code-generated function createSparseFromDense<synapseName> only works for g

@ajc158 pointed out that this function is problematic when the model does not have any variable called g. This function should be changed to either:

  • provide an individual function for every variable of every synapse,

or

  • take variable name as an argument to the function.

A workaround would be to disable the lines that write this function in generateRunner.cc. An equivalent function which is independent of any variable or synapse grup is available in $GENN_PATH/lib/include/sparseUtils.cc.

If you are using this function, please be aware that it will be changed.

Arbitrary compilation problem with stable release 1.1.1 on ubuntu 14.04

Sometimes the projects won't compile, giving an nvlink error. It is probably a gcc/cuda version problem, and we don't have this problem in the development branch. It will be fixed in next release, please use the development branch until the next release if you experience this problem.

In the MBody_userdef example gRaw is not initialised correctly

gRawKCDN should be initialised as the inverse "g-function" of the initial gKCDN values that are read from file. This is currently not done and gRawKCDN has the standard initial value from the modeldefinition function. For an example how it can be done see MBody1 example in map_classol::read_kcdnsyns().

Make all the synapses user-defined

All the standard models are already rewritten as user-defined in MBody_userdef example. Wee need to move these to utils.h or somewhere similar.

Indentation in user-defined code snippets

The first line is aligned with the indentation of the generated code but the other lines don't. This makes the generated code a bit ugly but there are no functional problems.

padSumSynapseTrgN etc.

We define these (sumSynapseTrgN, padSumSynapseTrgN, padSumSynapseKrnl) in what used to be called NNmodel::initDerivedSynapsePara, but is now renamed to NNmodel::registerSynapsePopulation. However, these don't seem to be used anywhere? If they are not necessary any more we should remove them.

Revisit blocksize optimisation

investigate instruction level parallelism.
performance gap between small models and larger models
revisit optimization goal (currently device occupancy only), e.g. memory bandwidth, memory sizes, etc.

If more than one sparse synapse population is defined and maxConn is defined only one of them, second population goes out of array when looking for maxConn

In order to solve this, setMaxConn can be called for every synapse population during synapse creation instead of pushing in a vector only when it is needed. Current workaround is to define maxConn for every sarse population in the model definition (an upper limit such as number of postsynaptic neurons is ok), or not to set it for any population at all -- the latter will se t the maxconn to number of postsynaptic neurons.

New blocksize optimisation

I have created a new way of acquiring ptxas info so that we can build a more robust blocksize optimisation procedure.
While doing so I have noticed that the current logic is relying on a very old method for testing whether learning is present (test for == LEARN1SYNPASE). This needs to be updated. Also the order of kernels in the optimisation is odd: synapse, learning, neuron. If there is no learning the second kernel slot runs on zeros (hopefully not with any detremental effects).
This needs teting and cleaning up.

Sparse connectivity with networks bigger than the block size is not supported for gpu sm < 2.0

This is because atomicadd of floating types is not supported by older gpus.

I think of 3 workarounds:

1: provide an overloaded atomicAdd function for floats if sm < 2.0 (maybe in the longer run, this is not planned at the moment). Users who want this can implement their own methods, for an example see: https://devtalk.nvidia.com/default/topic/458062/atomicadd-float-float-atomicmul-float-float-/

Also considering issue #29, we can do one of the following:
2: warn users that their device may not support certain functionalities (this seems like the best option at the moment)

3: if we have more of this kind of issues, we may considering providing a GeNN functionality table/checklist for each gpu on the computer. Based on this and the user model, we can improve auto device selection.

Creating sparse connectivity from dense under different floating types

The new code-generated version of createSparseFromDense calls the

countEntriesAbove function (DATATYPE * Array, int sz, float includeAbove)

function which picks all the non-zero (or all above includeAbove) values to create sparse connectivity.

We want includeAbove to be slightly higher than zero for floating type errors and divergence problems with zero values in our learning synapse model. The problem is that this value is defined as a float, and when the dense array uses double precision, we are mixing floating types. In the older versions, it uses a pre-defined value (asGoodAsZero) which is a float and its value was set in global.h. In the code-generated version, this value is set to the minimum of float or double according to precision, and when double precision is used it complains about the number not fitting in the defined float type.

I pushed a workaround which sets asGoodAsZero to double instead of float, and modified countEntriesAbove to use double as well. But it is still a bit messy.

Provide more modern alternatives for addNeuronPopulation etc

This is a suggestion only, but may be something to consider: Should we have overloaded functions where users use C++ vectors rather than C arrays for all parameters and initial values? For these we could then check that the number of provided paras is correct. Whereas with the current low-tech versions the users are on their own?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.