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

Update Qnn SDK default version to 2.30 #23411

Merged
merged 7 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
10 changes: 6 additions & 4 deletions onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -546,14 +546,16 @@ Status QnnBackendManager::CreateContext() {

QnnContext_Config_t context_priority_config = QNN_CONTEXT_CONFIG_INIT;
ORT_RETURN_IF_ERROR(SetQnnContextConfig(context_priority_, context_priority_config));
const QnnContext_Config_t* context_configs[] = {&context_priority_config,
&context_config_weight_sharing,
nullptr};
const QnnContext_Config_t* npu_context_configs[] = {&context_priority_config,
&context_config_weight_sharing,
nullptr};
const QnnContext_Config_t* empty_context_configs[] = {nullptr};
bool is_npu_backend = IsNpuBackend(GetQnnBackendType());

Qnn_ContextHandle_t context = nullptr;
Qnn_ErrorHandle_t result = qnn_interface_.contextCreate(backend_handle_,
device_handle_,
context_configs,
is_npu_backend ? npu_context_configs : empty_context_configs,
&context);

ORT_RETURN_IF(QNN_CONTEXT_NO_ERROR != result, "Failed to create context. Error: ", QnnErrorHandleToString(result));
Expand Down
35 changes: 35 additions & 0 deletions onnxruntime/test/providers/qnn/conv_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,12 @@ TEST_F(QnnHTPBackendTests, Conv_PerChannel_UnsupportedAxis) {
// QnnDsp <V> Wake up free backend 1 thread(s)
// QnnDsp <I> QnnGraph_finalize done. status 0x3ea
// onnxruntime::qnn::QnnModel::FinalizeGraphs] Failed to finalize QNN graph.
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, Conv3D_U8S8S32_PerChannel) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_Conv3D_U8S8S32_PerChannel) {
#endif
std::vector<int64_t> input_shape = {1, 2, 4, 4, 4};
std::vector<int64_t> weight_shape = {3, 2, 2, 2, 2};
std::vector<int64_t> bias_shape = {3};
Expand Down Expand Up @@ -1201,7 +1206,12 @@ TEST_F(QnnHTPBackendTests, ConvDepthwiseU8S8S32_PerChannel) {
// QnnDsp <V> Wake up free backend 1 thread(s)
// QnnDsp <I> QnnGraph_finalize done. status 0x3ea
// onnxruntime::qnn::QnnModel::FinalizeGraphs] Failed to finalize QNN graph.
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, Conv3D_U8S8S32_PerChannel2) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_Conv3D_U8S8S32_PerChannel2) {
#endif
std::vector<int64_t> input_shape = {1, 2, 4, 4, 4};
std::vector<int64_t> weight_shape = {2, 1, 2, 2, 2};
std::vector<int64_t> bias_shape = {2};
Expand Down Expand Up @@ -1286,7 +1296,12 @@ TEST_F(QnnHTPBackendTests, ConvTranspose_PerChannel_UnsupportedAxis) {

// ConvTranspose3D per-channel
// Disable it for 2.21 since it failed, re-enabled it for 2.22
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, ConvTranspose3D_U8S8S32_PerChannel) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_ConvTranspose3D_U8S8S32_PerChannel) {
#endif
std::vector<int64_t> input_shape = {1, 2, 4, 4, 4};
std::vector<int64_t> weight_shape = {2, 3, 2, 2, 2};
std::vector<int64_t> bias_shape = {3};
Expand Down Expand Up @@ -1350,7 +1365,12 @@ TEST_F(QnnHTPBackendTests, ConvU16S8S32_PerChannel) {
// QnnDsp <V> Wake up free backend 1 thread(s)
// QnnDsp <I> QnnGraph_finalize done. status 0x3ea
// onnxruntime::qnn::QnnModel::FinalizeGraphs] Failed to finalize QNN graph.
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, Conv3D_U16S8S32_PerChannel) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_Conv3D_U16S8S32_PerChannel) {
#endif
std::vector<int64_t> input_shape = {1, 2, 4, 4, 4};
std::vector<int64_t> weight_shape = {3, 2, 2, 2, 2};
std::vector<int64_t> bias_shape = {3};
Expand Down Expand Up @@ -1406,7 +1426,12 @@ TEST_F(QnnHTPBackendTests, ConvTransposeU16S8S32_PerChannel) {
}

// Disable it for 2.21, re-enable it for 2.22
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, ConvTranspose3D_U16S8S32_PerChannel) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_ConvTranspose3D_U16S8S32_PerChannel) {
#endif
std::vector<int64_t> input_shape = {1, 2, 4, 4, 4};
std::vector<int64_t> weight_shape = {2, 3, 2, 2, 2};
std::vector<int64_t> bias_shape = {3};
Expand Down Expand Up @@ -1471,7 +1496,12 @@ TEST_F(QnnHTPBackendTests, ConvDepthwiseU16S8S32_PerChannel) {
// QnnDsp <V> Wake up free backend 1 thread(s)
// QnnDsp <I> QnnGraph_finalize done. status 0x3ea
// onnxruntime::qnn::QnnModel::FinalizeGraphs] Failed to finalize QNN graph.
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, Conv3D_U16S8S32_PerChannel2) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_Conv3D_U16S8S32_PerChannel2) {
#endif
std::vector<int64_t> input_shape = {1, 2, 4, 4, 4};
std::vector<int64_t> weight_shape = {2, 1, 2, 2, 2};
std::vector<int64_t> bias_shape = {2};
Expand Down Expand Up @@ -1824,7 +1854,12 @@ TEST_F(QnnHTPBackendTests, ConvTransposeU8U8S32_DynamicWeight_NoBias) {
// Exception from backendValidateOpConfig:
// Exception thrown at 0x00007FFF9E0128B0 (QnnHtpPrepare.dll) in onnxruntime_test_all.exe:
// 0xC0000005: Access violation reading location 0x7079745F656C706D.
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, ConvTranspose3D_U8U8S32_DynamicWeight_NoBias) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_ConvTranspose3D_U8U8S32_DynamicWeight_NoBias) {
#endif
RunHTPConvOpTest<uint8_t, uint8_t>("ConvTranspose",
TestInputDef<float>({1, 3, 32, 32, 32}, false, -10.0f, 10.0f), // Input
TestInputDef<float>({3, 1, 4, 4, 4}, false, -10.0f, 10.0f), // Weights
Expand Down
5 changes: 5 additions & 0 deletions onnxruntime/test/providers/qnn/gather_op_htp_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ TEST_F(QnnHTPBackendTests, GatherOp_IndicesDynamicInt32_Axis0) {
// nodes are supported by the QNN EP, and that the inference results are as accurate as CPU EP.
//
// Static int32 indices with axis = 1
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, GatherOp_IndicesStaticInt32_Axis1) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_GatherOp_IndicesStaticInt32_Axis1) {
#endif
RunQDQGatherOpTest<uint8_t, int32_t>(TestInputDef<float>({3, 3}, false, {1.0f, 1.2f, 1.9f, 2.3f, 3.4f, 3.9f, 4.5f, 5.7f, 5.9f}),
TestInputDef<int32_t>({1, 2}, true, {0, 2}),
{utils::MakeAttribute("axis", static_cast<int64_t>(1))},
Expand Down
10 changes: 10 additions & 0 deletions onnxruntime/test/providers/qnn/gemm_op_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,12 @@ TEST_F(QnnHTPBackendTests, Gemm_Broadcast_Bias_DynamicA_StaticB_StaticC) {
// Expected val: 120.73912048339844
// QNN QDQ val: 0 (err 120.73912048339844)
// CPU QDQ val: 120.73889923095703 (err 0.00022125244140625)
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, Gemm_Dynamic_A_Static_B_Dynamic_Bias_U16) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_Gemm_Dynamic_A_Static_B_Dynamic_Bias_U16) {
#endif
std::vector<float> input_a_data = GetFloatDataInRange(-10.0f, 10.0f, 6);
std::vector<float> input_b_data = GetFloatDataInRange(-5.0f, 5.0f, 24);
std::vector<float> input_c_data = GetFloatDataInRange(-1.0f, 1.0f, 4);
Expand Down Expand Up @@ -368,7 +373,12 @@ TEST_F(QnnHTPBackendTests, Gemm_Dynamic_A_Static_B_Dynamic_Bias_U16Act_U8Weight)
// Expected val: 120.73912048339844
// QNN QDQ val: 77.012794494628906 (err 43.726325988769531)
// CPU QDQ val: 119.85115814208984 (err 0.88796234130859375)
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, Gemm_Dynamic_A_B_Static_Bias) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_Gemm_Dynamic_A_B_Static_Bias) {
#endif
std::vector<float> input_a_data = GetFloatDataInRange(-10.0f, 10.0f, 6);
std::vector<float> input_b_data = GetFloatDataInRange(-5.0f, 5.0f, 24);
std::vector<float> input_c_data = GetFloatDataInRange(-1.0f, 1.0f, 4);
Expand Down
9 changes: 8 additions & 1 deletion onnxruntime/test/providers/qnn/matmul_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,14 @@ TEST_F(QnnCPUBackendTests, MatMulOp) {
RunMatMulOpTest(false, {3, 3, 3}, {3, 2}, true, false);
RunMatMulOpTest(false, {2, 3, 3, 3}, {3, 2}, false, true);
RunMatMulOpTest(false, {2, 3, 3, 3}, {2, 3, 3, 2}, false, true);

#if defined(__linux__)
// TODO: This fails on Linux (HTP emulation). Works on Windows ARM64.
//Expected: contains 24 values, where each value and its corresponding value in 16-byte object <18-00 00-00 00-00 00-00 00-29 4E-53 A8-55 00-00> are an almost-equal pair
//Actual: 16-byte object <18-00 00-00 00-00 00-00 80-28 3E-53 A8-55 00-00>, where the value pair (0.0285999943, 0) at index #12 don't match, which is -0.0286 from 0.0286
#else
HectorSVC marked this conversation as resolved.
Show resolved Hide resolved
RunMatMulOpTest(false, {2, 1, 2, 3}, {3, 3, 2}, false, false);
#endif
RunMatMulOpTest(false, {3}, {3}, false, false);
RunMatMulOpTest(false, {3}, {3}, false, true);
RunMatMulOpTest(false, {3}, {3}, true, false);
Expand Down Expand Up @@ -293,7 +300,7 @@ TEST_F(QnnHTPBackendTests, MatMulOp_QDQ) {
// // UINT16, per-channel INT8 weight
RunQDQPerChannelMatMulOpTest<uint16_t, int8_t, uint16_t>({2, 3}, {3, 2}, 1, QDQTolerance(),
ExpectedEPNodeAssignment::All, 21, false, false);
RunQDQPerChannelMatMulOpTest<uint16_t, int8_t, uint16_t>({2, 3, 3}, {3}, -1);
RunQDQPerChannelMatMulOpTest<uint16_t, int8_t, uint16_t>({2, 3, 3}, {3}, -1, QDQTolerance(0.005f));
}

#endif // defined(__aarch64__) || defined(_M_ARM64) || defined(__linux__)
Expand Down
5 changes: 5 additions & 0 deletions onnxruntime/test/providers/qnn/reduce_op_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,12 @@ TEST_F(QnnCPUBackendTests, ReduceL2Opset13) {
// HTP backend with FP16 precision, and that the inference results match the CPU EP results.
//
// Failed QNN Opvalidation because of 5D input. It runs OK if bypass the op validation
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, ReduceSumOpset11_5D_FP16) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_ReduceSumOpset11_5D_FP16) {
#endif
float fp32_abs_err = 3e-2f;
bool enable_fp16 = true;
RunReduceTest<float>("ReduceSum",
Expand Down
10 changes: 10 additions & 0 deletions onnxruntime/test/providers/qnn/simple_op_htp_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,12 @@ TEST_F(QnnHTPBackendTests, UnaryOp_Ceil) {
// CPU EP f32 model output: [-12.0, -7.0, -2.0, 3.0, 8.0, 12.0]
// CPU EP qdq model output: [-12.0, -6.99, -1.99, 3.0, 8.0, 11.99]
// QNN EP qdq model output: [-11.0 (WRONG), -7.0, -2.0, 2.99, 8.0, 11.99]
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, UnaryOp_Ceil_U16) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_UnaryOp_Ceil_U16) {
#endif
const std::vector<float> input_data = GetFloatDataInRange(-12.0f, 12.0f, 6);
RunQDQOpTest<uint16_t>("Ceil",
{TestInputDef<float>({1, 2, 3}, false, input_data)},
Expand Down Expand Up @@ -1070,7 +1075,12 @@ TEST_F(QnnHTPBackendTests, GridSample_U16_AlignCorners) {
// Expected val: 3.3620510101318359
// QNN QDQ val: 3.2922921180725098 (err 0.069758892059326172)
// CPU QDQ val: 3.3850328922271729 (err 0.022981882095336914)
// Issue fixed in 2.30
#if (QNN_API_VERSION_MAJOR == 2) && (QNN_API_VERSION_MINOR >= 23)
TEST_F(QnnHTPBackendTests, GridSample_BorderPadding) {
#else
TEST_F(QnnHTPBackendTests, DISABLED_GridSample_BorderPadding) {
#endif
RunQDQOpTest<uint8_t>("GridSample",
{TestInputDef<float>({1, 1, 3, 2}, false, -10.0f, 10.0f),
TestInputDef<float>({1, 2, 4, 2}, false, -10.0f, 10.0f)},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ parameters:
- name: QnnSdk
displayName: QNN SDK version
type: string
default: 2.28.2.241116
default: 2.30.0.250109

jobs:
- job: Build_QNN_EP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ parameters:
- name: QnnSdk
displayName: QNN SDK Version
type: string
default: 2.28.0.241029
default: 2.30.0.250109

resources:
repositories:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ parameters:
- name: QnnSdk
displayName: QNN SDK version
type: string
default: 2.28.2.241116
default: 2.30.0.250109

jobs:
- job: Build_QNN_EP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ parameters:
- name: qnn_sdk_version
type: string
displayName: 'QNN SDK version. Only for QNN packages.'
default: 2.28.2.241116
default: 2.30.0.250109

trigger: none

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ parameters:
- name: QnnSdk
displayName: QNN SDK Version
type: string
default: 2.28.2.241116
default: 2.30.0.250109

- name: build_config
displayName: Build Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ parameters:
- name: qnn_sdk_version
type: string
displayName: 'QNN SDK version. Only for QNN packages.'
default: 2.28.2.241116
default: 2.30.0.250109

stages:
- ${{ if eq(parameters.enable_windows_cpu, true) }}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ parameters:
- name: QnnSDKVersion
displayName: QNN SDK Version
type: string
default: '2.28.0.241029'
default: '2.30.0.250109'

jobs:
- job: Final_AAR_Testing_Android_${{ parameters.job_name_suffix }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ parameters:
- name: QnnSDKVersion
displayName: QNN SDK Version
type: string
default: '2.28.0.241029'
default: '2.30.0.250109'

jobs:
- job: Android_Java_API_AAR_Packaging_${{ parameters.job_name_suffix }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ parameters:
- name: QnnSDKVersion
displayName: QNN SDK Version
type: string
default: 2.28.0.241029
default: 2.30.0.250109

stages:
- template: linux-cpu-packaging-pipeline.yml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
- name: QnnSDKVersion
type: string
default: '2.28.2.241116'
default: '2.30.0.250109'

steps:
- script: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
parameters:
- name: QnnSDKVersion
type: string
default: '2.28.2.241116'
default: '2.30.0.250109'

steps:
- powershell: |
azcopy.exe cp --recursive https://lotusscus.blob.core.windows.net/models/qnnsdk/qnn-v${{ parameters.QnnSDKVersion }}_win $(Agent.TempDirectory)
HectorSVC marked this conversation as resolved.
Show resolved Hide resolved
azcopy.exe cp --recursive https://lotusscus.blob.core.windows.net/models/qnnsdk/qnn-v${{ parameters.QnnSDKVersion }} $(Agent.TempDirectory)
displayName: 'Download QNN SDK v${{ parameters.QnnSDKVersion }}'
- powershell: |
echo "##vso[task.setvariable variable=QnnSDKRootDir]$(Agent.TempDirectory)\qnn-v${{ parameters.QnnSDKVersion }}_win"
echo "##vso[task.setvariable variable=QnnSDKRootDir]$(Agent.TempDirectory)\qnn-v${{ parameters.QnnSDKVersion }}"
displayName: Set QnnSDKRootDir
- task: CmdLine@2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ parameters:
- name: QnnSdk
displayName: QNN SDK version
type: string
default: 2.28.2.241116
default: 2.30.0.250109

jobs:
- job: Linux_py_qnn_Wheels_x64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parameters:
- name: QNN_SDK
displayName: QNN SDK Version
type: string
default: 2.28.2.241116
default: 2.30.0.250109

- name: ENV_SETUP_SCRIPT
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parameters:
- name: QNN_SDK
displayName: QNN SDK Version
type: string
default: 2.28.2.241116
default: 2.30.0.250109

- name: ENV_SETUP_SCRIPT
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parameters:
- name: QNN_SDK
displayName: QNN SDK Version
type: string
default: 2.28.2.241116
default: 2.30.0.250109

- name: ENV_SETUP_SCRIPT
type: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
QnnSdk: '2.28.2.241116'
QnnSdk: '2.30.0.250109'
build_config: 'RelWithDebInfo'
IsReleaseBuild: false
DoEsrp: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ parameters:
- name: QnnSdk
displayName: QNN SDK version
type: string
default: 2.28.2.241116
default: 2.30.0.250109

jobs:
- job: 'build'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ parameters:
- name: QnnSdk
displayName: QNN SDK version
type: string
default: 2.28.2.241116
default: 2.30.0.250109

jobs:
- job: 'build'
Expand Down
Loading