Skip to content

Neuromorphic Intermediate Representation reference implementation

License

Notifications You must be signed in to change notification settings

neuromorphs/NIR

Repository files navigation

NIR Logo

NIR - Neuromorphic Intermediate Representation

NIR is a set of computational primitives, shared across different neuromorphic frameworks and technology stacks. NIR is currently supported by 7 simulators and 4 hardware platforms, allowing users to seamlessly move between any of these platforms. The goal of NIR is to decouple the evolution of neuromorphic hardware and software, ultimately increasing the interoperability between platforms and improving accessibility to neuromorphic technologies.

Installation

NIR is installable via pip

pip install nir

Check your local framework for NIR support.

Usage

Read more in our documentation about NIR usage

To end-users, NIR is just a declarative format that sits between formats and will hopefully be as invisible as possible. However, it is possible to export Python objects or NIR files.

import nir
# Write to file
nir.write("my_graph.nir", nir_graph) 

# Read file
imported_graph = nir.read("my_graph.nir")

About NIR

Read more in our documentation about NIR primitives

On top of popular primitives such as convolutional or fully connected/linear computations, we define additional compuational primitives that are specific to neuromorphic computing and hardware implementations thereof. Computational units that are not specifically neuromorphic take inspiration from the Pytorch ecosystem in terms of naming and parameters (such as Conv2d that uses groups/strides).

Frameworks that currently support NIR

Framework Write to NIR Read from NIR Examples
Lava-DL Lava/Loihi examples
Nengo Nengo examples
Norse Norse examples
Rockpool (SynSense Xylo chip) Rockpool/Xylo examples
Sinabs (SynSense Speck chip) Sinabs/Speck examples
snnTorch snnTorch examples
SpiNNaker2 SpiNNaker2 examples
Spyx Spyx examples

Acknowledgements

This work was originally conceived at the Telluride Neuromorphic Workshop 2023 by the authors below (in alphabetical order):

If you use NIR in your work, please cite the following arXiv preprint

article{NIR2024, 
    title={Neuromorphic intermediate representation: A unified instruction set for interoperable brain-inspired computing}, 
    author={Pedersen, Jens E. and Abreu, Steven and Jobst, Matthias and Lenz, Gregor and Fra, Vittorio and Bauer, Felix Christian and Muir, Dylan Richard and Zhou, Peng and Vogginger, Bernhard and Heckel, Kade and Urgese, Gianvito and Shankar, Sadasivan and Stewart, Terrence C. and Sheik, Sadique and Eshraghian, Jason K.}, 
    rights={2024 The Author(s)},
    DOI={10.1038/s41467-024-52259-9}, 
    number={1},
    journal={Nature Communications}, 
    volume={15},
    year={2024}, 
    month=sep, 
    pages={8122},
}