Skip to content

Question about SpikeRecorder #669

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

Open
neworderofjamie opened this issue Apr 8, 2025 · 2 comments
Open

Question about SpikeRecorder #669

neworderofjamie opened this issue Apr 8, 2025 · 2 comments
Labels

Comments

@neworderofjamie
Copy link
Contributor

This definitely sounds like a bug - could you share your code with me? Either here or with [email protected] (although this email account, helpfully, blocks Python attachments so you'll need to rename the script to .txt or something).

Discussed in https://github.com/orgs/genn-team/discussions/668

Originally posted by OOOOOmoi April 8, 2025
Hello, I'm using GeNN to simulate a variant of the Potjans model containing three types of inhibitory neurons, with more diverse weights between each neuronal population. When I try to use the GeNNModel.pull_recording_buffers_from_device() method to record neuronal spikes in the network like this:

model.load(num_recording_timesteps=args.buffer_size)
spike_data = {n: [] for n in neuron_populations.keys()}
while model.t < duration:
    # Advance simulation
    print(model.timestep)
    model.step_time()
    # Indicate every 10%
    if not model.timestep % args.buffer_size:
        model.pull_recording_buffers_from_device()
        for n, pop in neuron_populations.items():
            spike_times, spike_ids = pop.spike_recording_data[0]
            spike_data[n].append(np.column_stack((spike_times, spike_ids)))
    if (model.timestep % ten_percent_timestep) == 0:
        print("%u%%" % (model.timestep / 100))

I found the program couldn't run properly and would always get stuck at pull_recording_buffers_from_device(), I've already enabled spike recording when creating neurons using neuron_pop.spike_recording_enabled = True. I also tried reducing the number of neurons and synapses, but that didn't work. What's puzzling is that when I don't create any synapses, set all synaptic weights to zero, or make the weights between different neuronal populations follow the same mean and variance, the program runs normally. Where do you think the problem might lie?
By the way, I encountered this same issue when using GeNN 4.X before. At that time, the program also got stuck at pull_recording_buffers_from_device(), but I didn't pay much attention to it - I directly modified the generated C++ code and makefile to bypass the SpikeRecorder.

@OOOOOmoi
Copy link

OOOOOmoi commented Apr 8, 2025

You can clone my code from https://github.com/OOOOOmoi/PyGeNNProject.git. The main script is located at /SingleColumn/SingleColumn.py, which is written following the PyGeNN documentation at https://genn-team.github.io/genn/documentation/5/userproject/potjans_microcircuit.html.

In lines 178–189, I defined three different synaptic weight distributions. You can selectively comment them out—currently, I have set the weights to zero. The default recording buffer size is 100 timesteps, but you can adjust it by passing the --buffer-size argument when running the code.

If you set the weights to specialized (non-zero) distributions, the code will halt when it reaches the same number of timesteps as the recording buffer size.

Unfortunately, I've already deleted the C++ version since it was too outdated. I only recalled this issue when working with the Python version.

@saadkhi
Copy link
Contributor

saadkhi commented Apr 13, 2025

Hey @neworderofjamie , I want to work on this can you brief me so that i can follow up that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants