Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

SpikingJelly

中文 | English

PyPI Python Docs GitHub contributors repo size Visitors

SpikingJelly demo

Contents

Why SpikingJelly

SpikingJelly is a PyTorch-native framework for spiking neural networks (SNNs), with support for large-scale SNN training and inference.

  • Beginner-friendly API
  • ANN2SNN conversion
  • Event-based datasets
  • Acceleration backends: torch, cupy, triton
  • Memory-efficient training, distributed execution, precision control
  • Hardware deployment and framework exchange

Installation

SpikingJelly is built on PyTorch. Install PyTorch, torchvision, and torchaudio first.

  • Python >=3.11
  • PyTorch >=2.6.0 (tested with 2.7.1)

Install the latest stable PyPI release:

pip install spikingjelly

Install V2 pre-releases from PyPI when they are published:

pip install --pre spikingjelly

Install the latest development version from source:

git clone https://github.com/fangwei123456/spikingjelly.git
cd spikingjelly
pip install .

Optional dependencies:

Feature Install
CuPy backend pip install cupy-cuda12x or pip install cupy-cuda11x
Triton backend pip install triton==3.3.1
NIR exchange pip install "spikingjelly[nir]" (PyPI) or pip install ".[nir]" (source checkout)
Lightning integration pip install lightning jsonargparse[signatures]

Quick Start

Define an SNN in the same way that you would define any PyTorch model:

from torch import nn
from spikingjelly.activation_based import layer, neuron, surrogate

net = nn.Sequential(
    layer.Flatten(),
    layer.Linear(28 * 28, 10, bias=False),
    neuron.LIFNode(tau=2.0, surrogate_function=surrogate.ATan())
)

Next steps:

Core Capabilities

Area What SpikingJelly provides
SNN modeling Activation-based SNN components: spiking neurons, surrogate gradients, stateful and stateless modules. Predefined SNN models.
Training workflows PyTorch-native training flows, online-learning utilities, and ANN2SNN conversion
Performance torch, cupy, and triton backends, FlexSN for customized neuron kernels, and mixed-precision training utilities (e.g., fp8)
Scaling Memory-efficient training, and distributed training
Datasets Neuromorphic datasets, and data preprocessing pipelines
Analysis FLOPs / SynOps / memory-access profiling, and inference energy estimation
Interchange and deployment NIR, Lava, and Lynxi-oriented exchange interfaces for neuromorphic workflows

Backend Performance

Spiking neuron models run on torch, cupy, or triton backends. The backend is set at neuron creation and can be changed later. All backends are compatible with torch.compile.

Below: execution time comparison for multi-step LIF neurons on torch vs cupy. Triton is covered in the backend tutorials.

Backend benchmark for multi-step LIF neurons

Large-Scale SNN Systems

For large-scale SNN systems, SpikingJelly provides:

  • Memory-efficient training with spike compression (memopt)
  • Experimental distributed execution for multi-GPU workloads
  • Precision policy tools for large-scale training and inference
  • Spiking transformer components

Datasets

SpikingJelly includes the following event-based and neuromorphic datasets:

Each dataset supports raw event access and frame representations. See the neuromorphic datasets tutorial for the full workflow.

Interchange and Deployment

Export SpikingJelly models to neuromorphic hardware or other frameworks:

Project Status and Version Notes

Development / release policy:

Starting from SpikingJelly V2, release versions follow PEP 440 compatible, SemVer-style MAJOR.MINOR.PATCH semantics. MAJOR marks compatibility generations, MINOR adds backward-compatible functionality, and PATCH fixes bugs. Python package pre-release spelling is used for V2 development releases, for example 2.0.0.dev0, 2.0.0a1, 2.0.0b1, and 2.0.0rc1.

See CHANGELOG.md for the V2 release changelog.

Compatibility, migration, and older docs
  • Before V2, SpikingJelly used a legacy 0.0.0.0.X scheme: odd X tracked development versions on GitHub / OpenI, and even X tracked stable releases published to PyPI.
  • If your project must stay on pre-V2 releases, pin dependencies with an upper bound such as spikingjelly<2.
  • From 0.0.0.0.14, modules including clock_driven and event_driven were renamed. See Migrate From Old Versions.
  • The default documentation points to the latest development version.
  • If you rely on an older release, check bugs.md and switch to the matching documentation version.

Historical documentation:

License

SpikingJelly is distributed under the Open-Intelligence Open Source License Version 1.0. See the authoritative Chinese license, translations, and the usage and distribution guide.

Acknowledgement

Maintainers

Current maintainers (since July 2024):

Previous core maintainers (before July 2024):

Contributors

The full contributor list is on the contributors page.

contributors

Institutes

The main institutions behind SpikingJelly are Multimedia Learning Group, Institute of Digital Media (NELVT), Peking University and Peng Cheng Laboratory.

PKU PCL

Community and related links

Contributing

We welcome issues, pull requests, documentation improvements, and translations.

  • Read the Contributing Guide.
  • Check issues for ongoing work.
  • API docs are not fully bilingual yet; translation contributions are especially welcome.

Citation

Publications using SpikingJelly are listed on the documentation page. The source of truth in this repository is publications.json.

If you use SpikingJelly in your work, please cite:

@article{
doi:10.1126/sciadv.adi1480,
author = {Wei Fang and Yanqi Chen and Jianhao Ding and Zhaofei Yu and Timothee Masquelier and Ding Chen and Liwei Huang and Huihui Zhou and Guoqi Li and Yonghong Tian},
title = {SpikingJelly: An open-source machine learning infrastructure platform for spike-based intelligence},
journal = {Science Advances},
volume = {9},
number = {40},
pages = {eadi1480},
year = {2023},
doi = {10.1126/sciadv.adi1480},
url = {https://www.science.org/doi/abs/10.1126/sciadv.adi1480},
eprint = {https://www.science.org/doi/pdf/10.1126/sciadv.adi1480}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spikingjelly-2.0.0rc1.tar.gz (810.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spikingjelly-2.0.0rc1-py3-none-any.whl (978.2 kB view details)

Uploaded Python 3

File details

Details for the file spikingjelly-2.0.0rc1.tar.gz.

File metadata

  • Download URL: spikingjelly-2.0.0rc1.tar.gz
  • Upload date:
  • Size: 810.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for spikingjelly-2.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 6026348a535b822bbc5f5fc55699f93b72d845f0d593149859a9f8b96d107785
MD5 ad8fb879b061e44b66a6141b3a04d516
BLAKE2b-256 474cfb5d8abd0112aadc414251b61e1f9dc2c235636d8502ee748e9995b529eb

See more details on using hashes here.

File details

Details for the file spikingjelly-2.0.0rc1-py3-none-any.whl.

File metadata

  • Download URL: spikingjelly-2.0.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 978.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for spikingjelly-2.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 99bea3f7cb3582d6fd4518c8f4c8df355efa382005bca17786342fc21f8cf688
MD5 f0727ac0f6fd9e8168f6d14f47aa3de1
BLAKE2b-256 a19d194982048ff5a2a328252742fa9a6d42a122a974918f2f66bfc18e669e37

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.0rc1 This release

2 files

0.0.0.0.14

2 files

0.0.0.0.12

2 files

0.0.0.0.10

2 files

0.0.0.0.8

2 files

0.0.0.0.6

2 files

0.0.0.0.4

3 files

0.0.0.0.3

1 file

0.0.0.0.2

2 files

0.0.0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page