Skip to content
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

Create less intermediate data from events #2249

Merged

Conversation

thorstenhater
Copy link
Contributor

@thorstenhater thorstenhater commented Jan 17, 2024

This PR optimizes event handling by removing the intermediate structure created by this chain
of transformations:

  1. event_lanes := vector<vector<event>> (one lane per local cell, each lane sorted by time)
  2. staged_events_per_mech_id := vector<vector<vector<deliverable_event>>> (one vector per mech id and time step, sorted by time)
  3. vector<event_stream> one stream per mech id

The following optimisations where performed:

  • cut out the middle step (2) completely as it is wholly unneeded and sort directly into event streams
  • remove a spurious index structure from cable_cell_group
  • slim down deliverable_event and deliverable_event_data
  • event_stream now uses a partition instead of a vector of ranges for splitting its data into dt buckets. (Save 8B per dt ;))

The result is that the quite pathological example calcium_stdp.py (as given in which generates immense amounts
of spikes using a single cell group and a single epoch drops from 3.8GB heap to 1.9GB heap usage at peak
using the same runtime or slightly less (<5% difference).

TODO

  • Port to GPU.
  • Tests pass
  • Examples run through
  • Fix tests... Interestingly locally all tests pass on my dev machine regardless of optimisation, vectorisation, and assertion settings.

@thorstenhater thorstenhater requested a review from boeschf January 17, 2024 09:05
@thorstenhater thorstenhater mentioned this pull request Jan 18, 2024
13 tasks
@thorstenhater thorstenhater marked this pull request as ready for review February 21, 2024 14:14
@boeschf
Copy link
Contributor

boeschf commented Feb 21, 2024

cscs-ci run daint-mc

Copy link
Contributor

@boeschf boeschf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, some code is duplicated between the backends, see this PR.

arbor/backends/shared_state_base.hpp Outdated Show resolved Hide resolved
arbor/backends/multicore/event_stream.hpp Outdated Show resolved Hide resolved
arbor/backends/gpu/event_stream.hpp Outdated Show resolved Hide resolved
arbor/fvm_lowered_cell.hpp Outdated Show resolved Hide resolved
arbor/backends/shared_state_base.hpp Outdated Show resolved Hide resolved
arbor/backends/shared_state_base.hpp Outdated Show resolved Hide resolved
@thorstenhater thorstenhater merged commit 047550d into arbor-sim:master Sep 17, 2024
22 checks passed
@thorstenhater thorstenhater deleted the perf/create-less-event-data branch September 17, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants