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

[RFC][AUTOTVM] Counting FLOPs vs. OPs #2628

Closed
eqy opened this issue Feb 20, 2019 · 6 comments
Closed

[RFC][AUTOTVM] Counting FLOPs vs. OPs #2628

eqy opened this issue Feb 20, 2019 · 6 comments

Comments

@eqy
Copy link
Contributor

eqy commented Feb 20, 2019

AutoTVM has a handy floating point operation counter that has fit most use cases to this point, as almost all tuned workloads have been floating point. However, the recent introduction of the quantization pass means that we may be seeing non-floating point templates in the near-future. The current counter enforces that the data type at the bottom of every computation is some kind of a float, which breaks on tasks extracted from quantized graphs.

Should we ignore this for now (e.g., manually add "FLOP"s in this case), migrate to just counting "OPs", or something else like maintaining more than one counter?

CC @merrymercy @tqchen @ZihengJiang

@ZihengJiang
Copy link
Contributor

I prefer ops, since we only need a metric for evaluating the computation overhead

@tqchen tqchen changed the title [AUTOTVM] Counting FLOPs vs. OPs [RFC][AUTOTVM] Counting FLOPs vs. OPs Feb 20, 2019
@tqchen
Copy link
Member

tqchen commented Feb 20, 2019

counting ops, or more specifically, MOPS(number of multiplications) is usually a good proxy for perf

@merrymercy
Copy link
Member

merrymercy commented Feb 22, 2019

Yes, we should move to OPs.
The reason I used FLOPs is to discard the integer multiplications in index expressions.
If we want to count integer OPs, should we discard them?

@tqchen
Copy link
Member

tqchen commented Feb 27, 2019

seems we are converging to OPS, maybe we can summarize the decision and conclude by closing the RFC @eqy

@eqy
Copy link
Contributor Author

eqy commented Feb 27, 2019

Okay, the question is should we implement this change---@merrymercy has a point about whether we want to count index expressions. Is there an easy way to discard them?

@ajtulloch
Copy link
Contributor

This came up in some of my int8 work, so I put together a pretty minimal PR at #2776 which I believe addresses this (modulo renaming compute_flops to something more general). To @eqy's point, it's pretty straightforward to ignore indexing expressions, and IMO ignoring them is the correct thing to do for essentially all the use-cases we have. If we were looking at extending this functionality, analytically computing the total amount of memory traffic (i.e. loads/stores) would be pretty useful, then we can essentially compute the roofline position of a given AutoTVM candidate which would be very helpful for stuff like e.g. early stopping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants