Introduction
Neuromorphic hardware, such as the BrainScaleS-2 (BSS-2) system, operates on principles fundamentally different from traditional von Neumann architectures. These systems are inherently asynchronous and event-driven, processing information via discrete "spikes" in continuous time. However, the development of software for these platforms has been hindered by a representation gap: most deep learning frameworks, including PyTorch and TensorFlow, are optimized for dense, synchronous tensors.
To bridge this gap, researchers typically resort to "time-binning," where continuous spike trains are discretized into fixed intervals to fit standard tensor shapes. This process introduces discretization errors, increases memory overhead for sparse data, and fails to capture the precise temporal dynamics of analog hardware. To address these challenges, the authors introduce jaxsnn, a JAX-based library designed specifically for training spiking neural networks (SNNs) directly on analog neuromorphic hardware using event-driven data structures.
Methodology
Event-Based Simulation
The core innovation of jaxsnn is its departure from the traditional time-grid paradigm. Instead of stepping through time in fixed increments (e.g., 1ms steps), the library employs an analytic root-solving approach. It calculates the exact future moment a neuron's membrane potential will reach its firing threshold, allowing the simulation to "jump" between spike events. This event-based representation is not only more efficient for sparse data but also more faithful to the underlying hardware dynamics.
Hardware-in-the-Loop (HIL) Training
jaxsnn treats physical analog chips as differentiable layers within a JAX computational graph. The library utilizes a functional design where:
- Forward Pass: Dispatched to the physical BSS-2 analog chip.
- Backward Pass: The resulting spikes are captured and processed through a software-based implementation of the EventProp algorithm.
By defining a custom Vector-Jacobian Product (VJP) via JAX’s custom_vjp, the authors allow standard machine learning optimizers to "see" through the hardware. For development without physical hardware access, the library includes a "mock" backend that simulates hardware non-idealities, such as parameter variations and saturation.
Vectorization
Event-driven simulations are notoriously difficult to parallelize because events occur at different times for different neurons. jaxsnn overcomes this by providing a vectorized algorithm that manages event processing using JAX primitives like jit (Just-In-Time compilation) and vmap (vectorized mapping), ensuring high-performance execution across neurons and batches.
Experimental Setup
The researchers validated the framework using the Yin-Yang dataset, a synthetic 2D classification task designed for SNN benchmarking. The task requires classifying points into three categories (black, white, and gray) within a non-linearly separable pattern.
- Encoding: 2D coordinates were mapped to spike times using a 5-dimensional input (mirrored coordinates plus a bias spike).
- Architecture: Networks were trained with 50 to 150 hidden neurons.
Key Results
The performance of jaxsnn was evaluated in both software simulation and on physical hardware, comparing favorably to existing state-of-the-art time-binned approaches:
- Software Accuracy: In pure software simulation,
jaxsnnachieved a test accuracy of (98.2 ± 0.2)%. - Hardware Accuracy: When running on the physical BSS-2 hardware, the system achieved (94.8 ± 0.2)% accuracy.
While analog hardware often suffers from noise and device mismatch that can degrade performance compared to "perfect" simulations, these results demonstrate that event-based gradient estimation is a viable and robust path forward for neuromorphic engineering.
Discussion and Future Work
jaxsnn represents a significant step toward unifying modern machine learning workflows with neuromorphic hardware. By treating the hardware as a differentiable layer and utilizing event-based processing, it avoids the overhead and inaccuracies of traditional tensor-based methods.
However, several areas for future development remain:
- Temporal Dynamics: The current implementation does not yet support axonal or synaptic delays, which are critical for complex temporal processing.
- Scalability: Experiments were limited to relatively small networks (up to 150 hidden neurons); scaling to multi-chip architectures will require further research into memory management.
- Standardization: The authors suggest that
jaxsnncould serve as a backend for the Neuromorphic Intermediate Representation (NIR), helping to unify the fragmented landscape of SNN software tools.
Summary updated