Comments (8)
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?
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.
from pytorch-opcounter.
I made clarification here https://github.com/Lyken17/pytorch-OpCounter/tree/master/benchmark#macs-flops-what-is-the-difference
from pytorch-opcounter.
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.
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?
from pytorch-opcounter.
This might help! sovrasov/flops-counter.pytorch#16
from pytorch-opcounter.
Thanks for your supply! It is really helpful.
from pytorch-opcounter.
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.
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)
- thop/profile.py:12: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. `if LooseVersion(torch.__version__) < LooseVersion("1.0.0"):` HOT 2
- Does MACs and FLOPs count correctly for and INT8 quantized model? HOT 1
- Upload sdist to PyPI HOT 1
- Problem in bert HOT 1
- multiple inputs HOT 1
- Is the latest version calculate MACs or FLOPs HOT 2
- RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
- How to calculate the FLOPs of each type of layers?
- How to exclude flops of 1st input? HOT 1
- Incorrect macs without specifying batch size for conv layers
- will torch.matmul regards as zero_ops ?
- Is thop also effective for calculating Flops for spiking neural networks?
- rename calculate_conv2d_flops HOT 1
- thop calculates torch.nn module params incorrectly HOT 1
- RuntimeError: Can't add a new parameter
- count_normalization is only correct for batch_norm. wrong flops count for layernorm HOT 1
- Res add will be included when evaluate Resnet's OPs ? HOT 1
- Source distribution (sdist) and Git tags
- I got different results using thop and torchinfo HOT 1
- question about BN
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-opcounter.