-
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
Set delay values (in seconds) only on host #83
Comments
hi @denisalevi , I agree that matching on the name is not very elegant, even on |
Thanks @mstimberg! At least with |
Yes, the
Not quite. In principle, synaptic |
With 335c42a, the It might be, that accessibility to the I added tests for changing the When fixing this issue, undo the changed in 335c42a. |
Access to |
Current implementation (will be merged with PR #300): The delay (in seconds) is available on host and device, because setting the delay (with group_variable_set... templates) happens on the device. With PR #299 copying of modified variables back to the host is fixed (that means the delay will be copied back to the host when set on the device). This is required when changing the delay between In this issue I originally wanted all to happen on the host, but that would require having We can get rid of all the device to host copies if we implement synapse generation and spike queue initializations on the device. Closing this with PR #300 |
Follow-up issue for spike loss when changing delays between |
Currently all arrays set in
CUDAStandaloneDevice.generate_main_source()
are set first on the host and then copied to the device. But this does not make sense for the delay array (in seconds), which we do not use on the device. Instead it gets transformed into delays (as integer multiples of the simulations step) in the connectivity matrix of eachSynapticPathway
(happening insynapses_initialise_queue.cu
). Those are then copied to the device and used. The current situation copies both delay representations to the device.My first fast fix was to delete the device array after creation of the connectivity matrix (in
synapses_initialise_queue.cu
). This solves the memory issue, but introduces a bug when using multiplerun()
calls and changing the delay values between them (which sets the host array and copies it to the device array, which is deleted).What should be done instead, is to catch delay variables in
CUDAStandaloneDevice.generate_main_source()
and modify the code snippets such, that the arrays are not copied to the device at all. Theself.main_queue
attribute contains the array names as they will be used in the C++ project (e.g._dynamic_array_synapses_delay
, but not anymore theVariable.name
names (which would bedelay
). The only way I see, is to check if an array name ends with_delay
or_delay_n
, wheren
is an integer (for multipleSynapticPathways
in the sameSynapses
object, the delay arrays are numbered). But this seems like a not very clean solution. It would be better to have access to theVariable.name
attribute, but that would need overwriting a bunch of methods from the parent classCPPStandaloneDevice
, whereself.main_queue
is filled.@mstimberg Can I savely assume that in
cpp_standalone
projects delay variables and ONLY delay variables have array names ending in_delay
or_delay_n
withn
being integer?And additionally we would need a version of the
group_variable_set...
templates that does only set variables on the host. Currently they only set the device array values in a kernel call. This is happening, when delays are set with python arrays or string syntax (e.g.syn.delay = "2*ms * rand()"
).And there need to be some tests for this. The bug described above with changing the delay values between
run()
calls was not caught by any test from the test suite.The text was updated successfully, but these errors were encountered: