flops-counter.pytorch icon indicating copy to clipboard operation
flops-counter.pytorch copied to clipboard

Additions and Multiplications count separately

Open yashbhalgat opened this issue 4 years ago • 3 comments

Hi,

This is a great repo! :-) But can you add functionality to compute the addition count and multiplication count separately?

Thanks!

yashbhalgat avatar Apr 18 '20 05:04 yashbhalgat

I think this makes no sense since modern computational accelerators have FMA instructions.

sovrasov avatar Apr 18 '20 18:04 sovrasov

Multiply operations are in general an order of magnitude more expensive than additions. So, it might be very useful for people experimenting with hardware not having FMA instructions.

yashbhalgat avatar Apr 19 '20 20:04 yashbhalgat

Multiply operations are in general an order of magnitude more expensive than additions. So, it might be very useful for people experimenting with hardware not having FMA instructions.

Do you mean mul (or conv2d) layers consume drastically more flops than bias-add/add ? SInce I ran some flops caluation in tensorflow, the flops report usually mul (or conv2d) over 90% flops, but bias-add/add only consume less than 5%.

hcleung3325 avatar May 26 '21 05:05 hcleung3325