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

[WIP][QNN] Quantized fully connected #3597

Closed
wants to merge 56 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
8d9e317
[Relay] [Quantization] WIP - Common files for the qauntization work.
Jul 8, 2019
5485b58
[Relay] [Quantization] WIP - Prototyping requantize op.
Jul 8, 2019
877d834
Requantize operator implementation.
anijain2305 Jul 10, 2019
705b796
Typo and lint fixes.
anijain2305 Jul 10, 2019
6cd1328
Lint fix.
anijain2305 Jul 10, 2019
ac4349b
Doc fix.
anijain2305 Jul 10, 2019
a9fef75
Uncommenting the lint script (fixing mistake).
anijain2305 Jul 10, 2019
d9eff68
Modifying the unit tests.
anijain2305 Jul 10, 2019
abc7c4e
Moving C++ files into src/relay/qnn
anijain2305 Jul 11, 2019
275ddd0
Moving python files to python/tvm/relay/qnn. Some minor fixes.
anijain2305 Jul 11, 2019
a0ad8ca
Moving the attrs.h inside the include directory.
anijain2305 Jul 11, 2019
ff8936c
Pushing files that I forgot earlier. Changing util location.
anijain2305 Jul 11, 2019
bdca4c6
[Relay] [Quantization] WIP - Common files for the qauntization work.
Jul 8, 2019
755f934
[Relay] [Quantization] WIP - Prototyping requantize op.
Jul 8, 2019
dba71f0
Requantize operator implementation.
anijain2305 Jul 10, 2019
6016b2a
Typo and lint fixes.
anijain2305 Jul 10, 2019
d54cea8
Lint fix.
anijain2305 Jul 10, 2019
ca954e0
Doc fix.
anijain2305 Jul 10, 2019
db24f1e
Uncommenting the lint script (fixing mistake).
anijain2305 Jul 10, 2019
523e16a
Modifying the unit tests.
anijain2305 Jul 10, 2019
18bff76
Moving C++ files into src/relay/qnn
anijain2305 Jul 11, 2019
32b69df
Moving python files to python/tvm/relay/qnn. Some minor fixes.
anijain2305 Jul 11, 2019
21168ae
Moving the attrs.h inside the include directory.
anijain2305 Jul 11, 2019
4a4beec
Pushing files that I forgot earlier. Changing util location.
anijain2305 Jul 11, 2019
120c050
Incorporating comments. API change. Lint fixes.
anijain2305 Jul 15, 2019
989bbea
Modifying the GetFixedPointMultiplierShift API as per comments.
anijain2305 Jul 15, 2019
8df0ddb
Forgot the dialect change.
anijain2305 Jul 15, 2019
8d0af86
Retriggering Jenkins.
anijain2305 Jul 15, 2019
ff1b9e3
Changing rewrite to qnn_lower.
anijain2305 Jul 15, 2019
362869f
Renaming Quantize to Qnn for clarity.
anijain2305 Jul 15, 2019
36f0ed9
Remove use_int_domain.
anijain2305 Jul 17, 2019
b45c629
Working quantized fully-connected with int8 and uint8
Jul 17, 2019
419dee0
Merge branch 'requantize' into qfullyconnected
Jul 17, 2019
4958495
Incorportaing review comments.
anijain2305 Jul 19, 2019
f858a83
Adding API doc for QNN dialect.
anijain2305 Jul 19, 2019
823cc94
Move the qnn_lower pass to transform namespace.
anijain2305 Jul 19, 2019
28a9587
Moving from expr to module. Adding namespace in C++.
anijain2305 Jul 19, 2019
76476dc
Working test case for int/uint with bias_add
Jul 19, 2019
732d6ce
Minor sentence rewrites. Added qnn namespace.
anijain2305 Jul 19, 2019
fadc573
Added the API doc.
anijain2305 Jul 19, 2019
956d3de
Chanding default out_dtype to int8. Adding a test with in/out_dtype a…
anijain2305 Jul 19, 2019
7a63597
merge from upstream/requantize
Jul 19, 2019
3ffdbf8
Merge branch 'requantize' into qfullyconnected
Jul 19, 2019
d700945
Style fixes. Better error messages.
anijain2305 Jul 19, 2019
21963dc
Removing extra code.
Jul 22, 2019
29c9e06
Merge branch 'requantize' into qfullyconnected
Jul 22, 2019
d0fdd1c
Adding documentation.
anijain2305 Jul 22, 2019
33cc075
More documentation fixes.
anijain2305 Jul 22, 2019
bb38855
Adding out dtype check for requantize.
anijain2305 Jul 22, 2019
7aac28d
Adding corner case for FP32 to fixed point conversion.
anijain2305 Jul 22, 2019
635b053
Adding extra line.
anijain2305 Jul 22, 2019
222e189
Documentation fix.
anijain2305 Jul 22, 2019
6c833d5
quantized fully connected working with requantize.
Jul 22, 2019
a115c96
Adding static inline.
anijain2305 Jul 23, 2019
572a8f3
Merge branch 'master' into requantize
Jul 24, 2019
dd213b6
Merge branch 'requantize' into qfullyconnected
Jul 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Style fixes. Better error messages.
anijain2305 committed Jul 19, 2019
commit d7009450daff5ad7e3ffef4d5be69c637f25a0cc
2 changes: 0 additions & 2 deletions python/tvm/relay/qnn/op/qnn.py
Original file line number Diff line number Diff line change
@@ -63,8 +63,6 @@ def requantize(data,
result : tvm.relay.Expr
The computed result.
"""
assert rounding in ("UPWARD", "AWAY_FROM_ZERO"),\
"Unsupported rounding mode"

return _make.requantize(data,
input_scale,
1 change: 1 addition & 0 deletions python/tvm/relay/qnn/transform.py
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
# pylint: disable=invalid-name

"""QNN Dialect transformation passes."""
from __future__ import absolute_import

4 changes: 4 additions & 0 deletions src/relay/qnn/pass/qnn_lower.cc
Original file line number Diff line number Diff line change
@@ -213,6 +213,10 @@ Expr RequantizeForwardRewrite(const Call& ref_call,
<< " Please run infer_type pass.";
const auto input_dtype = input_tt->dtype;

// Check rounding validity.
CHECK(param->rounding == "UPWARD" || param->rounding == "AWAY_FROM_ZERO")
<< "QNN requantize supports two rounding modes - UPWARD and "
<< "AWAY_FROM_ZERO";
return RequantizeLower(quantized_data, param, input_dtype, out_shape);
}