Skip to content

Commit e662bf1

Browse files
authored
Merge pull request #1050 from intel/rajeev/contrib_ops_test
CVS-165537 Minor fixes to partially enable contrib op tests
2 parents 76cb3a3 + 8156acd commit e662bf1

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

onnxruntime/test/contrib_ops/embed_layer_norm_op_test.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ static void RunTest(const embedlayernorm::OpData& data,
153153
execution_providers.push_back(DefaultDmlExecutionProvider());
154154
tester.Run(OpTester::ExpectResult::kExpectSuccess, "", {}, nullptr, &execution_providers);
155155
} else {
156-
tester.Run(OpTester::ExpectResult::kExpectSuccess, "", {kOpenVINOExecutionProvider});
156+
if (sum_output) {
157+
// OpenVINO EP only supports 2 outputs for EmbedLayerNormalization, skip when 3rd output (embedding_sum) is requested
158+
tester.Run(OpTester::ExpectResult::kExpectSuccess, "", {kOpenVINOExecutionProvider});
159+
} else {
160+
tester.Run();
161+
}
157162
}
158163
}
159164
}

onnxruntime/test/contrib_ops/fused_matmul_op_test.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
#include <unordered_set>
5+
46
#include "gtest/gtest.h"
57
#include "test/providers/provider_test_utils.h"
68
#include "test/common/cuda_op_test_utils.h"
@@ -212,8 +214,13 @@ void RunFusedMatMulTest(const char* op_name, int32_t opset_version = 7, bool tra
212214

213215
test.AddOutput<T>("Y", t.expected_dims, t.expected_vals);
214216

215-
// Disable OpenVINO, TensorRT because of unsupported data type
216-
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider, kOpenVINOExecutionProvider, kQnnExecutionProvider});
217+
// Disable TensorRT because of unsupported data type.
218+
// Disable OpenVINO for scale (alpha != 1.0) and transBatch cases due to OV compilation errors.
219+
std::unordered_set<std::string> excluded_eps = {kTensorrtExecutionProvider, kQnnExecutionProvider};
220+
if (alpha != 1.0f || is_trans_batch_a || is_trans_batch_b) {
221+
excluded_eps.insert(kOpenVINOExecutionProvider);
222+
}
223+
test.Run(OpTester::ExpectResult::kExpectSuccess, "", excluded_eps);
217224
}
218225
}
219226

onnxruntime/test/contrib_ops/matmul_4bits_test.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ void TestMatMulNBitsTyped(std::optional<float> abs_error = std::nullopt,
293293
base_opts.output_abs_error = 0.1f;
294294
} else if constexpr (std::is_same<AType, MLFloat16>::value) {
295295
base_opts.output_abs_error = 0.055f;
296+
} else {
297+
base_opts.output_abs_error = 0.05f;
296298
}
297299

298300
if (rel_error.has_value()) {
@@ -301,6 +303,8 @@ void TestMatMulNBitsTyped(std::optional<float> abs_error = std::nullopt,
301303
base_opts.output_rel_error = 0.02f;
302304
} else if constexpr (std::is_same<AType, MLFloat16>::value) {
303305
base_opts.output_rel_error = 0.02f;
306+
} else {
307+
base_opts.output_rel_error = 0.02f;
304308
}
305309

306310
{
@@ -357,8 +361,6 @@ void TestMatMulNBitsTyped(std::optional<float> abs_error = std::nullopt,
357361
#endif
358362
}
359363

360-
#if !defined(USE_OPENVINO)
361-
362364
TEST(MatMulNBits, Float32_4b_Accuracy0) {
363365
TestMatMulNBitsTyped<float, 1, 1, 16, 16, 0>();
364366
TestMatMulNBitsTyped<float, 1, 2, 16, 16, 0>();
@@ -591,7 +593,6 @@ TEST(MatMulNBits, Float32_4b_Accuracy4_Batch) {
591593
RunTest<float>(opts);
592594
}
593595

594-
#endif
595596
#endif
596597
#endif
597598

0 commit comments

Comments
 (0)