fangwei123456 / spikingjelly

SpikingJelly is an open-source deep learning framework for Spiking Neural Network (SNN) based on PyTorch.
https://spikingjelly.readthedocs.io
Other
1.35k stars 239 forks source link

Query regarding calculation of energy metrics of SNN #258

Closed sauravtii closed 2 years ago

sauravtii commented 2 years ago

Hello! Is there a way to get the performance metrics like energy consumption, latency, etc of an SNN after simulating it ?

fangwei123456 commented 2 years ago

You need to get SOP of each spiking neurons layer->conv/fc, which is FLOP * fring rate * T. To get flop, you can search pytorch flop in github and get some python packages. To get firing rate, you can use the monitor: https://spikingjelly.readthedocs.io/zh_CN/latest/activation_based_en/monitor.html

sauravtii commented 2 years ago

Okay, by doing this I will be getting all the metrics for CPU or GPU, right ? Or spikingjelly uses any other hardware for simulation under the hood ?

fangwei123456 commented 2 years ago

by doing this I will be getting all the metrics for CPU or GPU, right ?

Yes, it can be done in both CPU and GPU.

sauravtii commented 2 years ago

Okay, thank you! Can you please help me with https://github.com/fangwei123456/spikingjelly/issues/259 ?

fangwei123456 commented 2 years ago

I do not know much details about ANN2SNN in spikingjelly. DingJianhao will help to solve that issue.