Skip to content

Commit 669128a

Browse files
[QNN EP] Upgrade QNN to 2.42.0 (microsoft#26958)
### Description Update Qnn default version to 2.42.0.251225 Co-authored-by: Ashwath Shankarnarayan <ashwshan@qti.qualcomm.com>
1 parent f86a0ed commit 669128a

22 files changed

Lines changed: 37 additions & 26 deletions

.github/workflows/windows_qnn_x64.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ jobs:
5151
- name: Download QNN SDK
5252
working-directory: ${{ runner.temp }}
5353
run: |
54-
azcopy.exe cp --recursive https://lotusscus.blob.core.windows.net/models/qnnsdk/qnn-v2.41.0.251128 .
54+
azcopy.exe cp --recursive https://lotusscus.blob.core.windows.net/models/qnnsdk/qnn-v2.42.0.251225 .
5555
dir
5656
shell: pwsh
5757

5858
- name: Set QNN_SDK_ROOT environment variable
5959
shell: pwsh
6060
run: |
61-
$qnn_sdk_path = Join-Path $env:RUNNER_TEMP "qnn-v2.41.0.251128"
61+
$qnn_sdk_path = Join-Path $env:RUNNER_TEMP "qnn-v2.42.0.251225"
6262
echo "QNN_SDK_ROOT=$qnn_sdk_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
6363
echo "QNN SDK Root: $qnn_sdk_path"
6464
dir $qnn_sdk_path

onnxruntime/core/providers/qnn/builder/opbuilder/layer_norm_op_builder.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ class LayerNormOpBuilder : public BaseOpBuilder {
3535
Status LayerNormOpBuilder::IsOpSupported(QnnModelWrapper& qnn_model_wrapper,
3636
const NodeUnit& node_unit,
3737
const logging::Logger& logger) const {
38+
bool is_cpu_backend = IsCpuBackend(qnn_model_wrapper.GetQnnBackendType());
39+
40+
// Disable LayerNorm for CPU backend when API version > 2.31
41+
// This catches SDK version 2.42 which has API version 2.32
42+
if (is_cpu_backend && (QNN_API_VERSION_MAJOR == 2 && QNN_API_VERSION_MINOR > 31)) {
43+
return ORT_MAKE_STATUS(ONNXRUNTIME, NOT_IMPLEMENTED,
44+
"LayerNorm is not supported on QNN CPU backend with QNN SDK version > 2.41 due to accuracy issues");
45+
}
46+
3847
// Also check output type is float for CPU.
3948
const auto& outputs = node_unit.Outputs();
4049
ORT_RETURN_IF(outputs.size() > 1, "QNN LayerNorm only support 1 output.");

onnxruntime/test/providers/qnn/layer_norm_test.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,35 +32,37 @@ static void RunLayerNormCpuTest(const TestInputDef<float>& input_def,
3232
expected_ep_assignment);
3333
}
3434

35-
TEST_F(QnnCPUBackendTests, LayerNorm) {
35+
// Disabled all QNN CPU LayerNorm tests due to bug in 2.42 SDK
36+
37+
TEST_F(QnnCPUBackendTests, DISABLED_LayerNorm) {
3638
RunLayerNormCpuTest(TestInputDef<float>({2, 3}, false, GetFloatDataInRange(0.0f, 10.0f, 6)),
3739
TestInputDef<float>({2, 3}, false, GetFloatDataInRange(0.0f, 10.0f, 6)),
3840
{utils::MakeAttribute("axis", static_cast<int64_t>(0))},
3941
ExpectedEPNodeAssignment::All);
4042
}
4143

42-
TEST_F(QnnCPUBackendTests, LayerNorm1D_Axis0) {
44+
TEST_F(QnnCPUBackendTests, DISABLED_LayerNorm1D_Axis0) {
4345
RunLayerNormCpuTest(TestInputDef<float>({1, 2, 3}, false, GetFloatDataInRange(0.0f, 10.0f, 6)),
4446
TestInputDef<float>({1, 2, 3}, false, GetFloatDataInRange(0.0f, 10.0f, 6)),
4547
{utils::MakeAttribute("axis", static_cast<int64_t>(0))},
4648
ExpectedEPNodeAssignment::All);
4749
}
4850

49-
TEST_F(QnnCPUBackendTests, LayerNorm1D_AxisLast) {
51+
TEST_F(QnnCPUBackendTests, DISABLED_LayerNorm1D_AxisLast) {
5052
RunLayerNormCpuTest(TestInputDef<float>({1, 2, 3}, false, GetFloatDataInRange(0.0f, 10.0f, 6)),
5153
TestInputDef<float>({3}, false, GetFloatDataInRange(0.0f, 10.0f, 3)),
5254
{utils::MakeAttribute("axis", static_cast<int64_t>(-1))},
5355
ExpectedEPNodeAssignment::All);
5456
}
5557

56-
TEST_F(QnnCPUBackendTests, LayerNorm2D) {
58+
TEST_F(QnnCPUBackendTests, DISABLED_LayerNorm2D) {
5759
RunLayerNormCpuTest(TestInputDef<float>({1, 2, 3, 3}, false, GetFloatDataInRange(0.0f, 10.0f, 18)),
5860
TestInputDef<float>({1, 2, 3, 3}, false, GetFloatDataInRange(0.0f, 10.0f, 18)),
5961
{utils::MakeAttribute("axis", static_cast<int64_t>(0))},
6062
ExpectedEPNodeAssignment::All);
6163
}
6264

63-
TEST_F(QnnCPUBackendTests, LayerNorm3D) {
65+
TEST_F(QnnCPUBackendTests, DISABLED_LayerNorm3D) {
6466
RunLayerNormCpuTest(TestInputDef<float>({1, 2, 3, 3, 4}, false, GetFloatDataInRange(0.0f, 10.0f, 72)),
6567
TestInputDef<float>({1, 2, 3, 3, 4}, false, GetFloatDataInRange(0.0f, 10.0f, 72)),
6668
{utils::MakeAttribute("axis", static_cast<int64_t>(0))},

tools/ci_build/github/azure-pipelines/android-arm64-v8a-QNN-crosscompile-ci-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ parameters:
3232
- name: QnnSdk
3333
displayName: QNN SDK version
3434
type: string
35-
default: 2.41.0.251128
35+
default: 2.42.0.251225
3636

3737
jobs:
3838
- job: Build_QNN_EP

tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ parameters:
5555
- name: QnnSdk
5656
displayName: QNN SDK Version
5757
type: string
58-
default: 2.41.0.251128
58+
default: 2.42.0.251225
5959

6060
- name: CudaVersion
6161
displayName: CUDA version

tools/ci_build/github/azure-pipelines/c-api-noopenmp-test-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ stages:
8383
artifactName: 'onnxruntime-android-qnn-aar'
8484
packageName: 'onnxruntime-android-qnn'
8585
#TODO: get this information from the setup stage
86-
QnnSDKVersion: '2.41.0.251128'
86+
QnnSDKVersion: '2.42.0.251225'
8787

8888
- template: nuget/templates/test_win.yml
8989
parameters:

tools/ci_build/github/azure-pipelines/linux-qnn-ci-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ parameters:
3333
- name: QnnSdk
3434
displayName: QNN SDK version
3535
type: string
36-
default: 2.41.0.251128
36+
default: 2.42.0.251225
3737

3838
jobs:
3939
- job: Build_QNN_EP

tools/ci_build/github/azure-pipelines/py-packaging-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ parameters:
5959
- name: qnn_sdk_version
6060
type: string
6161
displayName: 'QNN SDK version. Only for QNN packages.'
62-
default: 2.41.0.251128
62+
default: 2.42.0.251225
6363

6464
trigger: none
6565

tools/ci_build/github/azure-pipelines/qnn-ep-nuget-packaging-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ parameters:
22
- name: QnnSdk
33
displayName: QNN SDK Version
44
type: string
5-
default: 2.41.0.251128
5+
default: 2.42.0.251225
66

77
- name: build_config
88
displayName: Build Configuration

tools/ci_build/github/azure-pipelines/stages/py-cpu-packaging-stage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ parameters:
5959
- name: qnn_sdk_version
6060
type: string
6161
displayName: 'QNN SDK version. Only for QNN packages.'
62-
default: 2.41.0.251128
62+
default: 2.42.0.251225
6363

6464
stages:
6565
- ${{ if eq(parameters.enable_windows_cpu, true) }}:

0 commit comments

Comments
 (0)