Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions onnxruntime/test/onnx/TestCase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,8 @@ std::unique_ptr<std::set<BrokenTest>> GetBrokenTests(const std::string& provider
broken_tests->insert({"convtranspose_1d", "Access violation 0xc000005 from call graphAddNode."});
broken_tests->insert({"convtranspose", "Access violation 0xc000005 from call graphAddNode."});
broken_tests->insert({"averagepool_2d_ceil", "result differs. expected 13.5 (41580000), got 0 (0)"});
// Fails with QNN 2.32
broken_tests->insert({"resize_upsample_scales_linear", "expected 1 (3f800000), got 0.25 (3e800000)"});
}

#ifdef DISABLE_CONTRIB_OPS
Expand Down
17 changes: 5 additions & 12 deletions onnxruntime/test/providers/cpu/tensor/space_depth_ops_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ TEST(TensorOpTest, SpaceToDepthTest_1) {
3.1f, 3.3f};
test.AddOutput<float>("output", {N, C * blocksize * blocksize, H / blocksize, W / blocksize}, result);

// TODO: Test is flaky on QNN EP (CPU backend).
// Re-enable when the QnnCPUBackendTests.DISABLED_SpaceToDepth_Flaky test is fixed.
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kQnnExecutionProvider});
test.Run(OpTester::ExpectResult::kExpectSuccess);
}

TEST(TensorOpTest, SpaceToDepthTest_1_double) {
Expand Down Expand Up @@ -111,9 +109,7 @@ TEST(TensorOpTest, SpaceToDepthTest_2) {
88., 103., 106., 68., 71., 86., 89., 104., 107.};
test.AddOutput<float>("output", {2, 27, 1, 2}, result);

// TODO: Test is flaky on QNN EP (CPU backend).
// Re-enable when the QnnCPUBackendTests.DISABLED_SpaceToDepth_Flaky2 test is fixed.
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kQnnExecutionProvider});
test.Run(OpTester::ExpectResult::kExpectSuccess);
}

TEST(TensorOpTest, SpaceToDepthTest_3) {
Expand Down Expand Up @@ -327,8 +323,7 @@ TYPED_TEST(TensorOpTest, DepthToSpaceTest_3) {
ORT_THROW("Type not supported");
}

// TODO: Test is flaky on QNN EP (CPU backend).
// Re-enable when the QnnCPUBackendTests.DISABLED_SpaceToDepth_Flaky test is fixed.
// type not supported by QNN EP: MLFloat16 and unsigned char
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kQnnExecutionProvider});
}

Expand Down Expand Up @@ -392,8 +387,7 @@ TYPED_TEST(TensorOpTest, DepthToSpaceTest_4) {
ORT_THROW("Type not supported");
}

// TODO: Test is flaky on QNN EP (CPU backend).
// Re-enable when the QnnCPUBackendTests.DISABLED_SpaceToDepth_Flaky2 test is fixed.
// type not supported by QNN EP: MLFloat16 and unsigned char
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kQnnExecutionProvider});
}

Expand Down Expand Up @@ -439,8 +433,7 @@ TYPED_TEST(TensorOpTest, DepthToSpaceTest_5) {
ORT_THROW("Type not supported");
}

// TODO: Test is flaky on QNN EP (CPU backend).
// Re-enable when the QnnCPUBackendTests.DISABLED_SpaceToDepth_Flaky2 test is fixed.
// type not supported by QNN EP: MLFloat16 and unsigned char
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kQnnExecutionProvider});
}

Expand Down
12 changes: 8 additions & 4 deletions onnxruntime/test/providers/qnn/conv_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ static void RunHTPConvOpPerChannelTest(const std::string& conv_op_type, const Te
// Check that QNN compiles DQ -> Conv -> Q as a single unit.
// Tests bias as a dynamic input.
// TODO: Segfaults when calling graphFinalize(). v2.13
TEST_F(QnnCPUBackendTests, DISABLED_Convf32_dynamic_bias) {
// fixed by QNN 2.32
TEST_F(QnnCPUBackendTests, Convf32_dynamic_bias) {
RunCPUConvOpTest("Conv",
TestInputDef<float>({1, 1, 3, 3}, false, 0.0f, 10.0f), // Random dynamic input
TestInputDef<float>({2, 1, 2, 2}, true, 0.0f, 1.0f), // Random static weights
Expand Down Expand Up @@ -499,7 +500,8 @@ TEST_F(QnnCPUBackendTests, Convf32_AutoPadLower) {
// Tests ConvTranspose's auto_pad value "SAME_LOWER" (compares to CPU EP).
// 2.31 Exception from qnn_interface.graphAddNode
// unknown file: error: SEH exception with code 0xc0000005 thrown in the test body
TEST_F(QnnCPUBackendTests, DISABLED_ConvTransposef32_AutoPadLower) {
// fixed by QNN 2.32
TEST_F(QnnCPUBackendTests, ConvTransposef32_AutoPadLower) {
RunCPUConvOpTest("ConvTranspose",
TestInputDef<float>({1, 1, 3, 3}, false, -3.0f, 3.0f), // Random dynamic input
TestInputDef<float>({1, 2, 2, 2}, false, -1.0f, 1.0f), // Random dynamic weights
Expand All @@ -516,7 +518,8 @@ TEST_F(QnnCPUBackendTests, DISABLED_ConvTransposef32_AutoPadLower) {
// Exception from graphFinalize
// Exception thrown at 0x00007FFFB7651630 (QnnCpu.dll) in onnxruntime_test_all.exe:
// 0xC0000005: Access violation reading location 0x0000000000000000.
TEST_F(QnnCPUBackendTests, DISABLED_ConvTranspose3D_f32_AutoPadLower) {
// fixed by QNN 2.32
TEST_F(QnnCPUBackendTests, ConvTranspose3D_f32_AutoPadLower) {
RunCPUConvOpTest("ConvTranspose",
TestInputDef<float>({1, 1, 3, 3, 3}, false, -3.0f, 3.0f), // Random dynamic input
TestInputDef<float>({1, 2, 2, 2, 2}, false, -1.0f, 1.0f), // Random dynamic weights
Expand Down Expand Up @@ -642,7 +645,8 @@ TEST_F(QnnCPUBackendTests, ConvTranspose1Df32_StaticWeights_DefaultBias) {
// Test 1D ConvTranspose with dynamic weights (implemented in QNN EP as 2D convolution with height of 1).
// 2.31 Exception from qnn_interface.graphAddNode
// unknown file: error: SEH exception with code 0xc0000005 thrown in the test body
TEST_F(QnnCPUBackendTests, DISABLED_ConvTranspose1Df32_DynamicWeights_DefaultBias) {
// fixed by QNN 2.32
TEST_F(QnnCPUBackendTests, ConvTranspose1Df32_DynamicWeights_DefaultBias) {
std::vector<float> input_data = {0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f};
RunCPUConvOpTest("ConvTranspose",
TestInputDef<float>({1, 2, 4}, false, input_data), // Dynamic input
Expand Down
8 changes: 5 additions & 3 deletions onnxruntime/test/providers/qnn/matmul_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ template <typename Input0QType, typename Input1QType, typename OutputQType>
static void RunQDQMatMulOpTest(const std::vector<int64_t>& shape_0, const std::vector<int64_t>& shape_1,
bool is_initializer_0, bool is_initializer_1,
ExpectedEPNodeAssignment expected_ep_assignment = ExpectedEPNodeAssignment::All,
int opset = 21, bool use_contrib_qdq = false) {
int opset = 21, bool use_contrib_qdq = false,
QDQTolerance tolerance = QDQTolerance()) {
ProviderOptions provider_options;
#if defined(_WIN32)
provider_options["backend_path"] = "QnnHtp.dll";
Expand All @@ -159,7 +160,7 @@ static void RunQDQMatMulOpTest(const std::vector<int64_t>& shape_0, const std::v
TestQDQModelAccuracy(
BuildMatMulOpTestCase(input0_def, input1_def),
BuildMatMulOpQDQTestCase<Input0QType, Input1QType, OutputQType>(input0_def, input1_def, use_contrib_qdq),
provider_options, opset, expected_ep_assignment);
provider_options, opset, expected_ep_assignment, tolerance);
}

template <typename InputQType, typename WeightQType, typename OutputQType>
Expand Down Expand Up @@ -279,7 +280,8 @@ TEST_F(QnnHTPBackendTests, MatMulOp_QDQ) {
// RunQDQMatMulOpTest(shape_0, shape_1, is_initializer_0, is_initializer_1, expected_ep_assignment, opset,
// use_contrib_qdq)
RunQDQMatMulOpTest<uint8_t, uint8_t, uint8_t>({2, 3}, {3, 2}, false, false);
RunQDQMatMulOpTest<uint8_t, uint8_t, uint8_t>({2, 3}, {3, 2}, false, true);
RunQDQMatMulOpTest<uint8_t, uint8_t, uint8_t>({2, 3}, {3, 2}, false, true, ExpectedEPNodeAssignment::All, 21,
false, QDQTolerance(0.008f));
RunQDQMatMulOpTest<uint8_t, uint8_t, uint8_t>({2, 2, 3}, {3, 2}, true, false, ExpectedEPNodeAssignment::All, 18,
true);
RunQDQMatMulOpTest<uint8_t, uint8_t, uint8_t>({2, 1, 3, 3}, {3, 3, 2}, false, true);
Expand Down
3 changes: 2 additions & 1 deletion onnxruntime/test/providers/qnn/pad_op_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ TEST_F(QnnCPUBackendTests, Pad2dPadsNotIni) {
// Pad reflect mode
// Expected: contains 12 values, where each value and its corresponding value in 16-byte object <0C-00 00-00 00-00 00-00 40-01 23-05 EC-01 00-00> are an almost-equal pair
// Actual: 16-byte object <0C-00 00-00 00-00 00-00 40-01 12-05 EC-01 00-00>, where the value pair (1.2, 0) at index #1 don't match, which is -1.2 from 1.2
TEST_F(QnnCPUBackendTests, DISABLED_PadModeReflect) {
// fixed by QNN 2.32
TEST_F(QnnCPUBackendTests, PadModeReflect) {
bool has_constant_value = false;
RunPadOpTest(TestInputDef<float>({3, 2}, false, {1.0f, 1.2f, 2.3f, 3.4f, 4.5f, 5.6f}),
TestInputDef<int64_t>({4}, true, {0, 1, 0, 0}),
Expand Down
10 changes: 8 additions & 2 deletions onnxruntime/test/providers/qnn/resize_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,20 @@ TEST_F(QnnCPUBackendTests, ResizeDownsampleNearestAlignCorners_rpf) {
// Cpu tests that use the "linear" mode.
//

TEST_F(QnnCPUBackendTests, Resize2xLinearHalfPixel) {
// accuracy issue since QNN 2.31
// Expected: contains 240 values, where each value and its corresponding value in 16-byte object <F0-00 00-00 00-00 00-00 40-01 57-DD 45-01 00-00> are an almost-equal pair
// Actual: 16-byte object <F0-00 00-00 00-00 00-00 40-01 39-DD 45-01 00-00>, where the value pair (-10, -10.5084743) at index #0 don't match, which is -0.508474 from -10
TEST_F(QnnCPUBackendTests, DISABLED_Resize2xLinearHalfPixel) {
std::vector<float> input_data = GetFloatDataInRange(-10.0f, 10.0f, 60);
RunCPUResizeOpTest(TestInputDef<float>({1, 3, 4, 5}, false, input_data),
{1, 3, 8, 10}, "linear", "half_pixel", "",
ExpectedEPNodeAssignment::All);
}

TEST_F(QnnCPUBackendTests, Resize2xLinearHalfPixel_scales) {
// accuracy issue since QNN 2.31
// Expected: contains 240 values, where each value and its corresponding value in 16-byte object <F0-00 00-00 00-00 00-00 40-01 57-4B C9-02 00-00> are an almost-equal pair
// Actual: 16-byte object <F0-00 00-00 00-00 00-00 40-01 39-4B C9-02 00-00>, where the value pair (-10, -10.5084743) at index #0 don't match, which is -0.508474 from -10
TEST_F(QnnCPUBackendTests, DISABLED_Resize2xLinearHalfPixel_scales) {
std::vector<float> input_data = GetFloatDataInRange(-10.0f, 10.0f, 60);
RunCPUResizeOpTestWithScales(TestInputDef<float>({1, 3, 4, 5}, false, input_data),
{1.0f, 1.0f, 2.0f, 2.0f}, "linear", "half_pixel", "",
Expand Down
14 changes: 10 additions & 4 deletions onnxruntime/test/providers/qnn/simple_op_htp_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ static void RunOpTestOnCPU(const std::string& op_type,
// index #2 don't match, which is -1.9 from 2
//
// If/when fixed, enable QNN EP in cpu test TensorOpTest.SpaceToDepthTest_1
TEST_F(QnnCPUBackendTests, DISABLED_SpaceToDepth_Flaky) {
// fixed by QNN 2.32
TEST_F(QnnCPUBackendTests, SpaceToDepth_Flaky) {
std::vector<float> X =
{0.0f, 0.1f, 0.2f, 0.3f,
1.0f, 1.1f, 1.2f, 1.3f,
Expand All @@ -73,7 +74,8 @@ TEST_F(QnnCPUBackendTests, DISABLED_SpaceToDepth_Flaky) {
// at index #2 don't match, which is -17 from 18
//
// If/when fixed, enable QNN EP in cpu test TensorOpTest.SpaceToDepthTest_2
TEST_F(QnnCPUBackendTests, DISABLED_SpaceToDepth_Flaky2) {
// fixed by QNN 2.32
TEST_F(QnnCPUBackendTests, SpaceToDepth_Flaky2) {
const std::vector<float> X = {
0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.,
11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21.,
Expand Down Expand Up @@ -1054,7 +1056,10 @@ TEST_F(QnnHTPBackendTests, GridSample_AlignCorners) {
utils::MakeAttribute("mode", "bilinear"),
utils::MakeAttribute("padding_mode", "zeros")},
17,
ExpectedEPNodeAssignment::All);
ExpectedEPNodeAssignment::All,
kOnnxDomain,
false,
QDQTolerance(0.008f));
}

// Test 16-bit QDQ GridSample with align corners
Expand Down Expand Up @@ -1116,7 +1121,8 @@ TEST_F(QnnHTPBackendTests, GridSample_U16_Nearest) {
// Expected val: 3.212885856628418
// QNN QDQ val: 3.1308119297027588 (err 0.08207392692565918)
// CPU QDQ val: 3.2036216259002686 (err 0.0092642307281494141)
TEST_F(QnnHTPBackendTests, DISABLED_GridSample_ReflectionPaddingMode) {
// fixed by QNN 2.32
TEST_F(QnnHTPBackendTests, GridSample_ReflectionPaddingMode) {
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.31.0.250130
default: 2.32.0.250228

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.31.0.250130
default: 2.32.0.250228

resources:
repositories:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parameters:
- name: QnnSdk
displayName: QNN SDK Version
type: string
default: 2.31.0.250130
default: 2.32.0.250228

- name: IsReleaseBuild
displayName: Is a release build? Set it to true if you are doing an Onnx Runtime release.
Expand Down
10 changes: 5 additions & 5 deletions tools/ci_build/github/azure-pipelines/linux-qnn-ci-pipeline.yml
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.31.0.250130
default: 2.32.0.250228

jobs:
- job: Build_QNN_EP
Expand Down Expand Up @@ -90,29 +90,29 @@ jobs:
inputs:
script: |
./build/Release/onnx_test_runner -e qnn \
-v -j 1 -i "backend_path|$(QnnSDKRootDir)/lib/x86_64-linux-clang/libQnnCpu.so" \
-j 1 -i "backend_path|$(QnnSDKRootDir)/lib/x86_64-linux-clang/libQnnCpu.so" \
cmake/external/onnx/onnx/backend/test/data/node

- task: CmdLine@2
displayName: Run float32 model tests
inputs:
script: |
./build/Release/onnx_test_runner -e qnn \
-v -j 1 -i "backend_path|$(QnnSDKRootDir)/lib/x86_64-linux-clang/libQnnCpu.so" \
-j 1 -i "backend_path|$(QnnSDKRootDir)/lib/x86_64-linux-clang/libQnnCpu.so" \
/data/float32_models

- task: CmdLine@2
displayName: Run QDQ model tests
inputs:
script: |
./build/Release/onnx_test_runner -e qnn \
-v -j 1 -i "backend_path|$(QnnSDKRootDir)/lib/x86_64-linux-clang/libQnnHtp.so" \
-j 1 -i "backend_path|$(QnnSDKRootDir)/lib/x86_64-linux-clang/libQnnHtp.so" \
/data/qdq_models

- task: CmdLine@2
displayName: Run QDQ model tests with context cache enabled
inputs:
script: |
./build/Release/onnx_test_runner -e qnn \
-v -f -j 1 -i "backend_path|$(QnnSDKRootDir)/lib/x86_64-linux-clang/libQnnHtp.so" \
-f -j 1 -i "backend_path|$(QnnSDKRootDir)/lib/x86_64-linux-clang/libQnnHtp.so" \
/data/qdq_models/mobilenetv2-1.0_add_transpose_quant
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.31.0.250130
default: 2.32.0.250228

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.31.0.250130
default: 2.32.0.250228

- 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.31.0.250130
default: 2.32.0.250228

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

jobs:
- job: Final_AAR_Testing_Android
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.31.0.250130'
default: '2.32.0.250228'

- name: is1ES
displayName: Is 1ES pipeline
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.31.0.250130
default: 2.32.0.250228

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.31.0.250130'
default: '2.32.0.250228'

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

steps:
- powershell: |
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.31.0.250130
default: 2.32.0.250228

- name: is1ES
displayName: 'Whether the pipeline is running in 1ES'
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.31.0.250130
default: 2.32.0.250228

- 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.31.0.250130
default: 2.32.0.250228

- 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.31.0.250130
default: 2.32.0.250228

- 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.31.0.250130'
QnnSdk: '2.32.0.250228'
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.31.0.250130
default: 2.32.0.250228

jobs:
- job: 'BUILD_QNN_EP'
Expand Down
Loading