Giter VIP home page Giter VIP logo

Comments (8)

denisalevi avatar denisalevi commented on June 11, 2024

I implemented BinomialFunction while trying to get the Potjans-Diesmann model to work. Didn't have the chance to test it yet. Implementation is in the binomial_implementation branch and not merged yet.

Tests should include:

  • checking if brians seed mechanism works correclty the way it is implemented
  • This implementation uses device side curand calls. We would need some device side buffer system in order to be able to use host side random number generation since we don't know how many random numbers will be needed in the current binomial implementation (rand inside while loop). Check performance loss of device side curand calls.
  • We are just using the cpp binomial implementation. Could be parallelise that?

from brian2cuda.

denisalevi avatar denisalevi commented on June 11, 2024

Wrote a test for checking brians seed mechanism, but it uses multiple run() calls with random number generation, therefore fails due to #85. Fix that first.

from brian2cuda.

denisalevi avatar denisalevi commented on June 11, 2024

Binomial implementation is merged, including testing (hopefully) all different RNG cases. See PR #178 for details.

from brian2cuda.

denisalevi avatar denisalevi commented on June 11, 2024

@mstimberg I am implementing TimedArray right now. At first glance I'm not entirely sure how to add a new implementation for the cuda_standalone device. For the BinomialFunction, there is a BinomialFunction.implementations dictionary defined that can be extended by new implementations. Should I change the TimedArray implementation accordingly or is there something I am missing / another way to easily add the cuda implementation?

from brian2cuda.

mstimberg avatar mstimberg commented on June 11, 2024

Indeed! The implementations are slightly more tricky for TimedArray – the implementing function has to return another function that actually generates the code. This is because the final implementation might depend on the dt of the context, and that context is not known until the actual run. I made the changes to TimedArray in the timedarray_implementations branch, let me know whether this works for you.

from brian2cuda.

denisalevi avatar denisalevi commented on June 11, 2024

Thanks @mstimberg, this works!

from brian2cuda.

mstimberg avatar mstimberg commented on June 11, 2024

Ok thanks, I'll open a PR and merge this into Brian master soon.

from brian2cuda.

denisalevi avatar denisalevi commented on June 11, 2024

Binomial function was implemented in PR #178.
TimedArray was implemented in PR #181.

I added separate issues for the remaining (low priority) points in this issue:

  • Parallelize binomial implementation (#188)
  • Implement device side RNG buffer (#189)
  • Remove change in brian2.diff once we update frozen Brian2 (#187)

And there is one case complicated test that was not reproducible with the same brian.seed() in CUDA Standalone but was in C++ Standalone. Need to investigate if this is due to parallelisation or a bug. See #190.

from brian2cuda.

Related Issues (20)

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.