Code Monkey home page Code Monkey logo

Comments (8)

Lyken17 avatar Lyken17 commented on July 25, 2024 6

I made clarification here https://github.com/Lyken17/pytorch-OpCounter/tree/master/benchmark#macs-flops-what-is-the-difference

from pytorch-opcounter.

ssgosh avatar ssgosh commented on July 25, 2024 5

I am confused by the FLOPs results in original ResNet paper. Let's take resnet-50 as an example. In ResNet paper the FLOPs value is 3.8G while in this repo we get 4.14G for MACs which means 4.14*2G FLOPs. So can we infer that FLOPs definition is the same here with MACs?

OpCounter
ResNet

The original resnet paper reports MACs - see the bottom-right paragraph on page 3: https://arxiv.org/pdf/1512.03385.pdf . Technically a multiply-add is a single floating point operation since 2008 (https://en.wikipedia.org/wiki/IEEE_754-2008_revision), which is probably why they still call it flops. I suppose one could make the distinction as IEEE754-1985 FLOPs vs IEEE754-2008 FLOPs.

image

from pytorch-opcounter.

xuxy09 avatar xuxy09 commented on July 25, 2024 3

As far as I can understand, the direct output of the "profile" function is MACs instead of FLOPs. However, the demo code in the readme file uses flops as the name of the output variable. Is this a typo? Thanks.

from pytorch-opcounter.

ZhangYuef avatar ZhangYuef commented on July 25, 2024 3

I am confused by the FLOPs results in original ResNet paper. Let's take resnet-50 as an example. In ResNet paper the FLOPs value is 3.8G while in this repo we get 4.14G for MACs which means 4.14*2G FLOPs. So can we infer that FLOPs definition is the same here with MACs?

OpCounter
ResNet

from pytorch-opcounter.

mjjung0925 avatar mjjung0925 commented on July 25, 2024

This might help! sovrasov/flops-counter.pytorch#16

from pytorch-opcounter.

minghongli233 avatar minghongli233 commented on July 25, 2024

Thanks for your supply! It is really helpful.

from pytorch-opcounter.

haoweiz23 avatar haoweiz23 commented on July 25, 2024

As far as I can understand, the direct output of the "profile" function is MACs instead of FLOPs. However, the demo code in the readme file uses flops as the name of the output variable. Is this a typo? Thanks.

the demo code in benchmark/readme is wrong. Macs returned by the "profile" function . If you want get the Flops, you should multiply 2.

from pytorch-opcounter.

YongyuG avatar YongyuG commented on July 25, 2024

MACs can also defined as "Memory Access Cost" which is strongly relative to inference time, but I think in this repo is Multi-Add Calculation

from pytorch-opcounter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.