raoyongming / DynamicViT

[NeurIPS 2021] [T-PAMI] DynamicViT: Efficient Vision Transformers with Dynamic Token Sparsification
https://dynamicvit.ivg-research.xyz/
MIT License
551 stars 69 forks source link

GFLOPs and Throughput #14

Closed AmeenAli closed 2 years ago

AmeenAli commented 2 years ago

Hi, Thanks sharing this awesome work, can you elaborate more on how you measure the GFLOPs and Throughput reported in the experiments ? Thanks,

raoyongming commented 2 years ago

Hi, thanks for your interest in our work. We measure the FLOPs by manually writing down the complexity of each type of layer and summing them up using a simple script. The throughput is measured on a single 3090 GPU with batch size fixed to 32.

shadowpa0327 commented 2 years ago

I thinks the flops can be calculate using the fvcore. Just add model.eval() before you invoke the FlopCountAnalysis function.