-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support next brian release #249
Conversation
977d063
to
b2c5841
Compare
We are using `constant_or_scalar` to get the group N. Since constant N is now just translated to _N (instead of replaced by a literal), we need `HOST_CONSTANTS` defined (which defines _N).
Resulted in a compile error when using `INFINITY` in device code (which should be defined correctly via `#include <cmath>`) This was removed in brian a long time ago, see brian-team/brian2@c8516ea190
Test fails in current state since we call cuRAND host API to generate an uneven number of random numbers.
- Correctly use subgroup sizes (was using group size before) - Always generate even numbers (cuRAND fails for odd numbers) - Also replaced all the `THREADS_PER_BLOCK` with `blockDim.x`
This also includes adding changes from PR brian-team/brian2#1304, which we had stored in `brian2.diff`.
This commit just copies all the changes from the `cpp_standalone` `synapses_create_generator` template. See brian-team/brian2#1280
Remove constants literal replacement
See PR brian-team/brian2#1324 This calls the reset kernel at the end of run. It might be enough thought to just reset the eventspace counter with a `cudaMemset` call, but I wasn't sure if that is enough if `uses_atomics=False` in `synapses.cu` template. Needs to be checked.
This commit just copies all the changes from the `cpp_standalone` `synapses_create_generator` template. See brian-team/brian2#1294
Support fixed size synapses, see PR brian-team/brian2#1280
Support synapses generator expression `i="..."`
Fix deactivating spiking objects, see PR brian-team/brian2#1324
b2c5841
to
e040aa0
Compare
Constants are no longer automatically hardcoded via text replacement
I struggled a bit with the merge, but after that everything went smoothly. Except for + print("INFO _last_run_time = {} s".format(self._last_run_time)) the I'm getting two failed tests. The first test failure is The second test that fails is ERROR: cudaMemcpyToSymbol(d_curand_seed, &dev_curand_seed, sizeof(unsigned long long*)) failed at objects.cu:107 : invalid device symbol But I just realized that this is probably simply due to the fact that the test sets compute capability to 6.1 while the ancient GPU I use on my work machine has only compute capability 5.0 😆 So I guess after dealing with the floor division warning we are ready to merge this PR (after adapting |
Hey @mstimberg , thanks for this! I will have a look at it tomorrow afternoon and run the test suite in the meantime on my GPU :) Could probably make And for the warning, I'll also look into it. I have to remember what the issue was, but I came across the problem before, and there is also an issue for potentially getting rid of that warning altogether... #135 |
👍
I would not worry too much about it – maybe simply set it to the lowest supported compute capability? |
Alright, i had a rough look over the changes, looks all good to me. If all tests are passing, it must be right, right? :P Super nice that brian2.diff is now only required for benchmarks! And that part has changed so much compared to the Brian2 version that its probably best to copy it over to Brian2CUDA anyways. Well, next time we want to run benchmarks maybe :) The And I updated Great, merging this! |
+ for v in sorted(self.record_variables)] | ||
code = '\n'.join(code) | ||
|
||
self.codeobj_class = codeobj_class | ||
diff --git a/brian2/tests/features/base.py b/brian2/tests/features/base.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that the all the changes in brian2.diff
coming below here have changed with this PR? This broke our benchmark scripts. I'm opening an issue for this.
@mstimberg Do you have an idea what happened? Since you seem to have pushed some changes here, but not the ones we had before? Could it be that you had an outdated brian2.diff
to start with? Maybe it wasn't updated by the merge from master?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um, no sorry, not quite sure what happened here. But I had a hard time looking making proper sense of diffs of diffs, so it's entirely possible that I messed this up...
This ended up being a development branch where I merged all updates from brian2 master, which came after the last release (2.4.2). Will be merged with the next brian2 release.
My update procedure: I first go through all Brian2 PRs and try to filter out those that changed something that required an update in Brian2CUDA. Then I go through each selected PR in their merge order and do the following:
frozen_repos/brian2
submodule (see e.g. f0b8d54)