Joseph Demarest

Projects / Science

FlySim

Running a complete fruit-fly brain, all 138,639 neurons of the FlyWire connectome, on a home PC.

Status
Early
Year
2026
Built with
Python, Brian2, PyTorch on ROCm
Source
Private
138,639 neurons MN9 Spikes
Same model, two engines: a C++ spiking simulator and sparse GPU math.

The FlyWire project mapped every neuron and synapse in an adult fruit fly's brain. FlySim reimplements the published whole-brain spiking model built on that map (Shiu et al., 2024): 138,639 neurons and about 15 million connections, all simple leaky integrate-and-fire units.

I built it two ways to see how far a home machine gets. Brian2 compiled to standalone C++ on eight CPU threads runs at 0.415 times real time. A PyTorch version on my AMD GPU, using sparse matrix-vector products, runs at 0.076 times real time. In single trials both drive MN9, a motor neuron involved in feeding, to 75 Hz.

The longer-term idea is to drive a physics-simulated fly body with it. So far that's a physics benchmark, and the brain is the part that works.