We have implemented different quantization schemes including linear, non-linear, and fixed-grid-based binning for both weights and activations.
- Ultra-Low Precision Quantization: Employs gird-based quantization techniques tailored for hardware-aware spiking neural networks.
- Scalability: Demonstrates high performance across various CNN/SNN architectures and event/static datasets.
- Python >= 3.8
- PyTorch >= 1.9
- CUDA (Optional, for GPU acceleration)
Clone the repository and install dependencies:
git clone https://github.com/Ahmedhasssan/Quantization_for_all.git
cd Quantization_for_all
pip install -r requirements.txtYou are required to have the basic knowledge of quantization to adopt any relevant technique and implement it for your use. For hardware-specific tasks, fixed-grid-based quantization is better to adopt. For software-level quantization, one can choose any of the techniques provided above depending on the dynamic range of weight and activations.
The repository includes examples for training and evaluating SNNs on popular Event (DVS-MNIST, DVS-CIFAR-10) and Static image (MNIST, CIFAR-10 and Caltech-101) datasets:
bash scripts/vgg9_dvs_cifar.sh
bash scripts/vgg9_dvs_caltech.shFor any inquiries or collaboration opportunities, feel free to reach out:
- Email: ah2288.@cornell.edu
- GitHub: Ahmedhasssan
Papers that used this repository:
- IM-SNN: Hasssan, A., Meng, J., Anupreetham, A., & Seo, J. S. (2024, August). IM-SNN: Memory-Efficient Spiking Neural Network with Low-Precision Membrane Potentials and Weights. IEEE/ACM International Conference on Neuromorphic Systems (ICONS).*. Link to paper.
- Sp-QuantSNN: Hasssan, Ahmed, Jian Meng, Anupreetham Anupreetham, and Jae-sun Seo. "SpQuant-SNN: ultra-low precision membrane potential with sparse activations unlock the potential of on-device spiking neural networks applications." Frontiers in Neuroscience 18 (2024): 1440000. Link to paper.
We welcome feedback, suggestions, and contributions to enhance Quantization approaches!