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

Support non-floating point operations in compute_flops for AutoTVM #2776

Merged
merged 1 commit into from
Mar 11, 2019

Conversation

ajtulloch
Copy link
Contributor

Closes #2628.

This is a simple modification that does two things:

a) Extends the unit tests in test_autotvm_flop_calculator to randomly sample various datatypes.
b) Modifies compute_flop to stop counting flops from indexing expressions (i.e. X[a, 4 * b, 5 * c] does not count as an operation, which is inline with expectations), and unconditionally accumulate flops from mathematical expressions (x * y + z, etc) without checking the datatype (which is what we expect for non-floating point operations).

The tests now pass for all cases, which is what we expect.

@ajtulloch
Copy link
Contributor Author

Updated with a more precise detection of expr.Call.Halide type calls (i.e. indexing expressions), which should help ensure we don't change behaviour for existing users.

@tqchen tqchen merged commit 2919a3e into apache:master Mar 11, 2019
@ajtulloch ajtulloch deleted the tvm-flops-for-int8 branch March 11, 2019 21:38
@tqchen
Copy link
Member

tqchen commented Mar 11, 2019

Please remember to request reviews from reviewers next time :)

@ajtulloch
Copy link
Contributor Author

Thanks for the quick merge @tqchen!

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

Successfully merging this pull request may close these issues.

2 participants