brainhackorg / global2022

Github repo for the brainhack 2022 website and event
https://brainhack.org/global2022/
MIT License
3 stars 6 forks source link

Large Scale FPGA Neuromorphic Interface precursor work. A GPU implementation of Allen Brain V1 measured model using Julia and or PyGeNN #17

Open russelljjarvis opened 2 years ago

russelljjarvis commented 2 years ago

Title

GPU implementation of Allen Brain V1 measured model using Julia and or PyGeNN: A precursor to a large scale FPGA based very large scale spiking neuronal network.

Leaders

@russelljjarvis

Collaborators

No response

Brainhack Global 2022 Event

Brainhack Australasia

Project Description

How to get started?

code entry point is bash workflow.sh But it assumes you first followed the install intructions in the README.md here https://github.com/JuliaWSU/TrainSpikingNet.jl/blob/master/workflow.sh

Link to project repository/sources

Through pers-comm I have established that the author of the original repository may be open to PRs.

https://github.com/SpikingNetwork/TrainSpikingNet.jl

However there exist some more experimental forks for intermediate hacking. Another fork of TrainSpikingNet is here

A lot of the implied work is in wrangling the Pandas data frame and Sonata HDF5 connectomes into Julia-compatible HDF5 and or compressed arrays saved as JLD2.

The code for getting Python connectomes is [here] (https://github.com/williamsnider/v1_project/blob/main/build_model.py)

Goals for Brain Hack Global

Applying SNNs dynamic simulations to pre-existing connectome data.

Reproducing pre-existing computational research but using different more Democratic tools.

Good First Issues:

1.

Use PCA and UMAP on the output raster plot spike trains in Julia and or Python in order to understand and compare the output of the simulation [Done, or done for a trivially small spike time raster plot].

Possibly the easiest immediate thing someone could get working: Apply sequence detection to the spike trains too via PPSeq.jl https://github.com/lindermanlab/PPSeq.jl https://github.com/JuliaWSU/TrainSpikingNet.jl/blob/master/src/plot.jl#L72 Apply PPSeq.jl to the spike train array: nss

2.

Use Do community partitioning on the static adjacency (connection) matrix, using any approach that works (maybe even do this using Pythons networkx). Networkx community partitioning algorithms like Louvain would expect your network to be un-directed. Networkx has a constructor for making an undirected network, from a numpy matrix input. Issues here are making the network connection matrix (Hermitian) and or Symmetric. Julia has two packages (https://github.com/bicycle1885/Leiden.jl, and METIS). Metis expects a matrix of Integers rather than float Real numbers between [0,1] as is common for synaptic weights.

Note these people have made progress on graph analysis of biological neural networks: realneuralnetworks https://github.com/jingpengw/realneuralnetworks-notebook/blob/main/34_connectivity_analysis/ju_connectivity_graph.ipynb

Note these people (realneuralnetworks) have made progress on graph analysis of biological neural networks, it is unknown if their approach scales well. If it does give credit and re-purpose their methods. https://github.com/jingpengw/realneuralnetworks-notebook/blob/main/34_connectivity_analysis/ju_connectivity_graph.ipynb https://github.com/jingpengw/realneuralnetworks-notebook/blob/main/34_connectivity_analysis/ju_connection-psd.ipynb

Julia Light Graphs also supports community partitioning. Issues I have experienced for light graphs partitioning are (1 running out of memory). and 2. Matrix is not symmetric and or Hermitian.

HPC (Gadi) may solve the memory issue. Julia Graph partitioning

Good Advanced Issues

1.

Rat V1 Connectomes fromWrangle Rat V1 Connectomes from Sonata HDF5/Python to Julia here (Sonata/HDF5) to Julia JLD2 (also HDF5).

This is partially done. See for example here: https://github.com/russelljjarvis/TrainSpikingNet.jl/blob/master/src/fast_connection_matrices.jl#L1_L67

However, it would be good to compare this against the PyGeNN connectome (which uses different indexing). Also, I have only done this for a partition of this enormous connectome. See discussion here: https://github.com/russelljjarvis/TrainSpikingNet.jl/discussions/5#discussioncomment-4112622

2.

Make dynamic time-varying simulations by applying Ben Arthur's Spiking Neural Network code, to large-scale spiking neural networks.

https://github.com/SpikingNetwork/TrainSpikingNet.jl One big issue here is that connection matrix-building methods are read in from a sequence of files that defines all the parameters of a simulation. Finally, a plethora of different connection matrix variables is embedded in a Julia static struct. The dimensionality of these matrices needs to be compatible with input stimulus dimensions. Compared to Python, plugging in new connection matrices is delicate and some care and understanding of Julia structs is required. See discussion here: https://github.com/russelljjarvis/TrainSpikingNet.jl/discussions/5#discussioncomment-4112622

Can we simply use https://github.com/rafaqz/Mixers.jl to make a copy of the original struct and add in replacement matrices to a the cloned struct instance?

Another issue is wrangling the Sonata defined artificial synaptic inputs to make them compatible with TrainSpikingNet.jl

3.

Silence the correlation-based spike time training parts of the simulation workflow, as we are not yet training a network, but instead are just simulating it. Decoupling this code may be tricky.

4.

Benchmark Ben Arthur's Julia code against PyGENN/CUDA, and ultimately Neuromorphic hardware applied to similarly wired connectome.

https://github.com/russelljjarvis/v1_project

Communication channels

https://mattermost.brainhack.org/brainhack/channels/spikenetopt.jl

Skills

Onboarding documentation

https://github.com/russelljjarvis/SpikeNetOpt.jl/blob/main/CONTRIBUTING.md

What will participants learn?

Julia

Data to use

https://github.com/russelljjarvis/getConnectomes

Number of collaborators

>=1

Credit to collaborators

I used all-contributors last year, and I think that will keep working well :)

Also co-authorship is a possibility? The goal is to publish something.

https://github.com/russelljjarvis/SpikeNetOpt.jl/pull/17

Image

Leave this text if you don't have an image yet. Pending

Type

coding_methods, method_development, visualization

Development status

0_concept_no_content

Topic

connectome, data_visualisation, physiology, reproducible_scientific_methods

Tools

other

Programming language

Julia, Python, CUDA.

Modalities

other

Git skills

0_no_git_skills, 1_commit_push, 2_branches_PRs, 3_continuous_integration, 4_not_applicable

Things to do after the project is submitted and ready to review.

Remi-Gau commented 2 years ago

@russelljjarvis thanks for opening the issue we are still sorting it out who is in charge of project reviews: will get back to you once this is done

russelljjarvis commented 2 years ago

No worries @Remi-Gau, this was just a draft PR. I am still trying to figure out the exact details so I am happy for non immediate feedback.

Remi-Gau commented 2 years ago

OK this looks good to go for me.

Remi-Gau commented 2 years ago

@russelljjarvis Your project is on the website: https://brainhack.org/global2022/projects/

russelljjarvis commented 2 years ago

Hi @RyanGreenup,

Let me know if you want to be added as a collaborator above.