Collapse or Preserve: Data-Dependent Temporal Aggregation for Spiking Neural Network Acceleration
Abstract
Spike sparsity is widely believed to enable efficient spiking neural network (SNN) inference on GPU hardware. We demonstrate this is an illusion: five distinct sparse computation strategies on Apple M3 Max all fail to outperform dense convolution, because SIMD architectures cannot exploit the fine-grained, unstructured sparsity of i.i.d. binary spikes. Instead, we propose Temporal Aggregated Convolution (TAC), which exploits convolution linearity to pre-aggregate spike frames before a single convolution call, reducing calls to . On rate-coded data, TAC achieves 13.8times speedup with +1.6% accuracy on MNIST and +5.4% on Fashion-MNIST -- a simultaneous improvement in both speed and accuracy. However, on event-based data where the temporal dimension carries genuine motion information, TAC's temporal collapse is harmful. We therefore introduce TAC-TP (Temporal Preservation), which shares each group's convolution output across K independent LIF steps, preserving full temporal resolution for downstream layers. On DVS128-Gesture, TAC-TP achieves 95.1% accuracy (vs. 96.3% baseline) with 50% fewer convolution calls, while standard TAC drops to 91.3%. Our key finding is that the optimal temporal aggregation strategy is data-dependent: collapse the temporal dimension for rate-coded data (noise reduction) but preserve it for event data (information retention). Speedup is hardware-agnostic: TAC achieves 11.0times on NVIDIA V100, confirming the mechanism transfers across GPU architectures. All operators in the mlx-snn library are open source.
Figures & tables
| Method | Speedup | Sparsity Used? | Failure Mode |
|---|---|---|---|
| Temporal Delta Conv | No | Temporal batching, not sparsity | |
| Weight-Gather | Attempted | Irregular memory access | |
| Graph Compilation | No | General optimization | |
| Sparse GEMM | Attempted | No structured sparsity | |
| Custom Metal SIMD | Attempted | Cannot beat vendor GEMM |
| MNIST | Fashion-MNIST | |||||
|---|---|---|---|---|---|---|
| Operator | Acc. (%) | Speedup | Acc. (%) | Speedup | ||
| Baseline | — | — | ||||
| TAC =4 | +1.56 | +4.84 | ||||
| TAC =8 | +1.63 | +5.36 | ||||
| TAC =16 | +1.60 | +5.20 | ||||
| TAC-TP =4 | 4.02 | 5 | 6.76 | 5 | ||
| Operator | Accuracy (%) | Conv Calls | Time/ep (s) | Speedup |
|---|---|---|---|---|
| Baseline | 80 | 69.0 | ||
| TAC-TP =2 | 40 | 57.5 | ||
| TAC-TP =4 | 20 | 58.1 | ||
| TAC-TP =8 | 10 | 56.0 | ||
| TAC =2 | 40 | 46.6 |
| MNIST | Fashion-MNIST | |||||
|---|---|---|---|---|---|---|
| Operator | Acc. (%) | Time (s) | Speedup | Acc. (%) | Time (s) | Speedup |
| Baseline | 692 | 682 | ||||
| TAC =4 | 137 | 137 | ||||
| TAC =8 | 80 | 82 | ||||
| TAC =16 | 53 | 57 | ||||
| TAC-TP =4 | 455 | 461 | ||||
| Rate-Coded (MNIST) | Event (DVS-Gesture) | |||
|---|---|---|---|---|
| Strategy | Acc | Speedup | Acc | Speedup |
| TAC (collapse) =2 | +1.6% | 2 | 5.0% | 1.5 |
| TAC-TP (preserve) =2 | — | — | 1.2% | 1.2 |
| Method | Architecture | MNIST | FMNIST | DVS-Gesture |
|---|---|---|---|---|
| STBP ( Wu et al., 2018 ) | Conv, 5 layers | 99.42 | — | — |
| tdBN ( Zheng et al., 2021 ) † | ResNet-19 | — | — | 96.87 |
| TCJA-SNN ( Zhu et al., 2024 ) † | TCJA-7B | — | 94.80 | 97.60 |
| SpikingJelly ( Fang et al., 2023 ) | CSNN, 5 layers | — | — | 93.75 |
| snnTorch Baseline ‡ | Conv, 2 layers | 98.56 | 88.11 | — |
| Ours: Baseline (M3 Max) | Conv, 2/5 layers | 97.22 | 83.14 | 96.30 |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Operator | Seed 0 | Seed 1 | Seed 2 | Mean Std |
| Baseline | 97.09 | 97.43 | 97.13 | |
| TAC =4 | 98.69 | 98.89 | 98.75 | |
| TAC =8 | 98.81 | 98.90 | 98.83 | |
| TAC =16 | 98.74 | 98.81 | 98.91 | |
| TAC-TP =4 | 90.66 | 94.66 | 94.27 | |
| TAC-TP =8 | 89.91 | 91.00 | 88.31 |
| Operator | Seed 0 | Seed 1 | Seed 2 | Mean Std |
| Baseline | 82.07 | 83.91 | 83.45 | |
| TAC =4 | 87.47 | 88.38 | 88.08 | |
| TAC =8 | 88.48 | 88.21 | 88.81 | |
| TAC =16 | 88.14 | 88.54 | 88.35 | |
| TAC-TP =4 | 76.82 | 75.95 | 76.38 | |
| TAC-TP =8 | 71.70 | 77.85 | 77.09 |
| Operator | Seed 0 | Seed 42 | Seed 123 | Mean Std | Conv Calls |
|---|---|---|---|---|---|
| Baseline | 95.8 | 96.9 | 96.2 | 80 | |
| TAC-TP =2 | 94.1 | 94.8 | 96.5 | 40 | |
| TAC-TP =4 | — | 93.8 | — | 20 | |
| TAC-TP =8 | — | 92.0 | — | 10 | |
| TAC =2 | — | 91.3 | — | 40 |
| Parameter | MNIST / FMNIST | DVS-Gesture |
|---|---|---|
| Timesteps ( ) | 25 | 16 |
| Batch size | 128 | 16 |
| Learning rate | ||
| LR schedule | Cosine annealing | Cosine w/ warm restarts ( =64) |
| Optimizer | Adam | Adam |
| Epochs | 15 | 256 |
Spiking Neural Networks
Spiking neural networks process information through discrete, time-dependent neural events, aiming for efficient computation and biologically inspired learning.
See all 336 papers