4

I'm trying to rewrite a model from caffe to tensorflow. To make sure I did not make mistake, I count the macc and Flops and then I find this interesting thing:

For example, when input a image 112x112x3, and conv2d it with 32 3x3 kernel, stride=1, the macc in Caffe is 2.71M, while the FLOPs computed in tensorflow is 5. 42M.

I wonder why this 2x difference happen?

MarStarck
  • 383
  • 3
  • 12

2 Answers2

5

One MACC contains one multiplication and one addition. One multiplication or one addition can be seen as one FLOP. So one MACC has two FLOPS.

Kathy Lee
  • 418
  • 5
  • 15
1

i am not expert in this but FLOPS mean every floating point operation and not just multiplies or accumulates. There would be more FLOPS performed than MACS performed.

also i have read somewhere that If the MACs are for floating point performance and the loop overheads and memory bandwidths are identical for the two measurements, then usually 1 floating-point Multiply-Accumulate is considered equivalent to 2 FLOPs. One for the multipy and Second for addition in accumulator.

Divyanshu
  • 91
  • 1
  • 3