This repository is the official implementation of HPCA 2025 paper, Prosperity: Accelerating Spiking Neural Networks via Product Sparsity. It contains the cycle-accurate simulator for Prosperity architecture and implementation of several baseline accelerators.
We propose a Spiking Neural Networks (SNNs) accelerator, Prosperity, that leverage a novel product sparsity paradigm to improve various SNNs efficiency.
- Python == 3.10
- GCC/G++ >= 11.3.0
- CUDA >= 12.1
We recommend using conda to manage the environment.
Clone the repository and install the requirements, cloning may take a while due to the large size of the data in the repository.
conda create -n prosperity python=3.10 -y
conda activate prosperity
pip install -r requirements.txt
git submodule update --initInstall Prosperity CUDA kernel
cd kernels
python setup.py install
cd ..Install CACTI
cd cacti
make
cd ..simulator: Cycle-accurate simulator for Prosperity and baselineskernels: CUDA kernel for fast simulation of Prosperitydata: The activation matrix data for simulationcacti: CACTI for buffer area evaluationreference: Reference results for Prosperity and baselines
cd simulator
./run_simulator_all.shThis script will run the simulation of Prosperity and baselines on all of the models and datasets shown in Figure 8 in the paper.
It is expected to take 15 minutes to finish with CUDA.
It will output the end to end runtime and energy consumption of each accelerator and on each dataset.
The results will be stored in output folder, named as time.csv and energy.csv.
We provide several reference files in reference folder. time_reference.xlsx and energy_reference.xlsx contain reference results and figure 8 in the paper.
The energy evaluation depend on the file mem_reference.csv. This stats is derived from the Prosperity simulation output in file Prosperity_ST_SCNN_256_16_cuda.txt in output folder.
For two key design choices in Prosperity, tile size on M dimension and K dimension, we provide a script that test different tile_size_M and tile_size_K configuration in Prosperity and organize this result into file M_dse.csv for M dimension exploration and file K_dse.csv for K dimension exploration.
File M_dse_reference.xlsx and K_dse_reference.xlsx contain reference DSE results and figure 7 in the paper.
Notice that this script does not include power and area stats, since it is evaluated by synopsys design compiler, we are not able to release the script for this part under the license.
./run_DSE.shpython simulator.py --type Prosperity --sparse_analysis_mode --use_cudaThe script record the bit density and product density of Prosperity on all the models and datasets in Figure 11 in the paper.
The results will be stored in file density_analysis.csv.
The reference file is density_analysis_reference.xlsx.
Notice that the output file does not contain the density stats for FS neuron since this result is directly derived from the baseline paper.
python buffer_cacti.pyThis program call the CACTI to evaluate the buffer power, area of Prosperity. It also evaluate the power of DRAM. The output result should be identical to the buffer area value in left pie chart in Figure 10 in the paper.
- Black pillar: Eyeriss with 128 PE, scale the time result of following ablation study by 128/168 to get the result used in Figure 9.
python simulator.py --type Eyeriss- For the orange, green, purple, and blue pillars
python simulator.py --type PTB
python simulator.py --type Prosperity --bit_sparsity
python simulator.py --type Prosperity --issue_type 1 --use_cuda
python simulator.py --type Prosperity --use_cudaOur proposed ProSparsity can be applied to other SNN accelerators. We provide an example of applying ProSparsity to LoAS.
python simulator.py --type LoASIf you find Prosperity helpful in your project or research, please consider citing our paper:
@inproceedings{wei2025prosperity,
title={Prosperity: Accelerating Spiking Neural Networks via Product Sparsity},
author={Wei, Chiyue and Guo, Cong and Cheng, Feng and Li, Shiyu and Yang, Hao Frank and Li, Hai Helen and Chen, Yiran},
booktitle={2025 IEEE International Symposium on High Performance Computer Architecture (HPCA)},
pages={806--820},
year={2025},
organization={IEEE}
}
Welcome to use the code or contribute to the project!