-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[NNAPI QDQ] AddQDQAdd/Mul, update to NNAPI QDQ handling, update some test settings #10483
Conversation
commit 1238049 Author: Guoyu Wang <[email protected]> Date: Mon Feb 7 12:59:04 2022 -0800 Add qdq mul support commit 9cadda7 Merge: 7a32847 0f5d0a0 Author: Guoyu Wang <[email protected]> Date: Mon Feb 7 11:24:47 2022 -0800 Merge remote-tracking branch 'origin/master' into gwang-msft/qdq_mul commit 7a32847 Author: Guoyu Wang <[email protected]> Date: Mon Feb 7 00:41:30 2022 -0800 move test case to util commit c1a8f0d Author: Guoyu Wang <[email protected]> Date: Fri Feb 4 13:04:26 2022 -0800 update input/output check commit a6f0a0d Author: Guoyu Wang <[email protected]> Date: Thu Feb 3 18:37:21 2022 -0800 update quantized io check functions commit 87f4d1d Merge: 7849f07 97b8f6f Author: Guoyu Wang <[email protected]> Date: Wed Feb 2 17:22:58 2022 -0800 Merge remote-tracking branch 'origin/master' into gwang-msft/qdq_mul commit 7849f07 Author: Guoyu Wang <[email protected]> Date: Wed Feb 2 17:22:55 2022 -0800 minor update commit 7196cdf Author: Guoyu Wang <[email protected]> Date: Wed Feb 2 10:50:10 2022 -0800 init change commit 84c0077 Merge: a8c7dce 7318361 Author: Guoyu Wang <[email protected]> Date: Tue Feb 1 18:21:17 2022 -0800 Merge remote-tracking branch 'origin/master' into gwang-msft/qdq_mul commit a8c7dce Merge: 55e536c ef7b4dc Author: Guoyu Wang <[email protected]> Date: Tue Feb 1 13:51:04 2022 -0800 Merge remote-tracking branch 'origin/master' into gwang-msft/qdq_mul commit 55e536c Author: Guoyu Wang <[email protected]> Date: Tue Feb 1 11:44:34 2022 -0800 address cr comments commit d460f5b Author: Guoyu Wang <[email protected]> Date: Tue Feb 1 00:33:54 2022 -0800 fix android UT failure commit 52146cf Author: Guoyu Wang <[email protected]> Date: Mon Jan 31 16:01:13 2022 -0800 fix build break commit ec6d07d Author: Guoyu Wang <[email protected]> Date: Mon Jan 31 15:41:52 2022 -0800 minor update to UT commit 8ec8490 Author: Guoyu Wang <[email protected]> Date: Mon Jan 31 15:01:30 2022 -0800 Add NNAPI support of QDQ Resize
auto* output_arg = builder.MakeOutput(); | ||
|
||
#ifdef USE_NNAPI // NNAPI require consistent scales for DQ -> bin op -> Q | ||
float q_scale = 0.008f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true for all binary ops? Naively I would have expected mul or div to potentially change the scale but maybe that isn't the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the output scale and ZP can be changed, updated the test case, it is only required to be the same for QD->bin_op_input and bin_op_output->Q
onnxruntime/core/providers/nnapi/nnapi_builtin/builders/helper.cc
Outdated
Show resolved
Hide resolved
op_registrations.support_checkers.push_back(std::make_unique<T>()); | ||
for (const auto& op : op_types) { | ||
op_registrations.op_support_checker_map.emplace(op, op_registrations.support_checkers.back().get()); | ||
const auto& scale_tensor = *initializers.at(scale_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also shows up in HasExternalInitializer(), IsQuantizationZeroPointSupported(), ReshapeOpSupportChecker::IsOpSupportedImpl(), and ConvOpSupportChecker::IsOpSupportedImpl()
can also address it later
onnxruntime/core/providers/nnapi/nnapi_builtin/builders/op_support_checker.cc
Outdated
Show resolved
Hide resolved
onnxruntime/core/providers/nnapi/nnapi_builtin/builders/op_support_checker.cc
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description: [NNAPI QDQ] AddQDQAdd/Mul, update to NNAPI QDQ handling, update some test settings
Motivation and Context
RunAndVerifyOutputsWithEP
to verify fp32 results with optional tolerance