Hi everyone!
I've just published the first release of NeuroLib: a Rust workspace built on top of Burn for spiking neural networks (SNNs), transformer layers, quantization, GPU kernels and neural-recording I/O. It is on crates.io as neurolib (plus ten neo-* crates it is made of).
- GitHub: GitHub - Emphronic/NeuroLib: Spiking neural networks, quantized layers, fused kernels, a weight format and tools for neural recordings in Rust, built on [Burn](https://burn.dev) · GitHub
- crates.io: crates.io: Rust Package Registry
- docs: neurolib - Rust
Why I built it
Most spiking-network tooling lives in Python. I wanted a Rust-native stack where the same code runs on CPU and GPU through Burn, where network structure is something you can change at runtime, and where the same library can read the recordings the networks are compared against. NeuroLib is my attempt at that.
Getting started
[dependencies] neurolib = { version = "0.1", features = ["snn", "flex"] } # CPU backend burn = "0.22" For a GPU use wgpu, cuda or rocm instead of flex:
neurolib = { version = "0.1", features = ["snn", "wgpu"] } burn = "0.22" neurolib is a single entry point, like the burn crate: everything else is enabled by features. By default you get the ML stack (ml: SNN, layers, quantization, kernels, weight format); signal adds recording I/O, viewing and spike curation; full enables everything except the GPU backends.
use neurolib::prelude::*; // everyday names from neo-snn use neurolib::nn; // transformer layers use neurolib::quant; // quantization burn is not re-exported, so declare it in your project (0.22, same as the workspace).
What's inside
| Crate | What it does |
|---|---|
neo-snn | Spiking layers on Burn: LIF, RLeaky, AdEx, Izhikevich, Hodgkin–Huxley, graded and stochastic neurons; surrogate gradients; STDP (pair/triplet/reward-modulated); e-prop; reservoirs (LSM/ESN); learnable synaptic delays; spiking self-attention; ANN→SNN conversion; state quantization |
neo-snn (structural) | Structural plasticity: growing and pruning neurons and synapses at runtime, Dale's principle (E/I/modulatory), a controller with rollback, checkpoints, and NEAT-style architecture evolution |
neo-nn | Transformer layers: attention (GQA, QK-norm), gated FFNs, MoE, embeddings, PEFT, quantized linear layers |
neo-quantization | GGUF Q4_0…Q8_1, K-quants, the IQ series, NF4, ternary and INT1…INT8, with scheme switching at runtime |
neo-synk | Fused CubeCL kernels (wgpu / CUDA / ROCm): quantized GEMM, leaky scan, spike and surrogate ops |
neo-store | The .syn weight format: checksummed (CRC-32C per tensor), mmap reads, atomic writes, NIR-like graph, NIR JSON import/export |
neo-core, neo-io, neo-view, neo-synapse | Time and buffers, recording formats (raw, .npy/.npz, Zarr, NWB, SpikeGLX, mtscomp), min/max envelopes for viewing, spike-train metrics and Phy/Kilosort loading |
neo-gui | A desktop workbench (GPUI): traces, heatmap, timeline, live training telemetry and structural-plasticity visualization |
Examples
The repository has runnable examples (they are not part of the crates package, so clone the repo to try them):
git clone https://github.com/Emphronic/NeuroLib.git cd NeuroLib cargo run -p neo-snn --example synthetic_snn --release --features demo cargo run -p neo-snn --example train_fixed_shape --release --features demo There are also e-prop, learnable-delay, plasticity-pipeline and NEAT (XOR) examples, and a book in neo-book/ with a getting-started guide.
Status and what I'd like feedback on
This is an early 0.1.0 release: the API will change, and I expect rough edges. The test suites pass (500+ tests in neo-snn alone) and the code is clippy -D warnings clean, but real-world usage will surely find things I haven't.
I'd especially love feedback on:
- API ergonomics of the SNN layers and the structural-plasticity controller.
- What you'd need to use this for your own SNN or neuroscience project.
- Which Burn backends and platforms you'd want tested.
Issues, ideas and PRs are very welcome on GitHub. Thanks for reading!
1 post - 1 participant