Skip to content

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 ajtulloch force-pushed the tvm-flops-for-int8 branch from 732707d to 8bcb01c Compare March 11, 2019 18:10
@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