Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does a single multiply op count one flop? #119

Closed
jixiege opened this issue Nov 16, 2022 · 2 comments
Closed

Does a single multiply op count one flop? #119

jixiege opened this issue Nov 16, 2022 · 2 comments

Comments

@jixiege
Copy link

jixiege commented Nov 16, 2022

flopcounter supports aten::upsample_nearest2d, but seems that this op does not involving multiply-add operations.

I am confused whether to strictly conform to the definition of MACs since "We count one fused multiply-add as one flop." is mentioned in docstring.

Does a single multiply count one flop?

@ppwwyyxx
Copy link
Contributor

The idea was to count multiply-add as one MAC if the op use multiply-add, otherwise only count multiply so we don't ignore some possibly expensive ops. The flop counter provides APIs to overwrite these decisions.

This may not be ideal for a number of reasons, but that's mainly because MAC is a poorly defined concept (flop as well, but better).

I had attempted to change everything to flops instead of MAC in #77, but unfortunately could not get it approved at the time.

@jixiege
Copy link
Author

jixiege commented Nov 16, 2022

The idea was to count multiply-add as one MAC if the op use multiply-add, otherwise only count multiply so we don't ignore some possibly expensive ops. The flop counter provides APIs to overwrite these decisions.

This may not be ideal for a number of reasons, but that's mainly because MAC is a poorly defined concept (flop as well, but better).

I had attempted to change everything to flops instead of MAC in #77, but unfortunately could not get it approved at the time.

Got it, thanks for your reply.

@jixiege jixiege closed this as completed Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants