Skip to content

Commit 13e537d

Browse files
authored
CVS-178008: Revert tests for ovep (#883)
* Revert "CVS-174886: Make onnxruntime tests pass on OpenVINO (#790)" This reverts commit 5c40da5. * Keep loop and concat cases
1 parent f0685ad commit 13e537d

File tree

6 files changed

+6
-88
lines changed

6 files changed

+6
-88
lines changed

onnxruntime/test/contrib_ops/quantize_ops_test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ TEST(QuantizeLinearContribOpTest, QuantizeLinear_per_tensor_float_int8) {
287287
127, -127,
288288
127, -128,
289289
127, -128});
290-
test.SetOutputAbsErr("y", 1.0f);
291290
// Disable Tensorrt EP due to error: node1_quantize_scale_node: out of bounds channel axis 1. Number of input dimensions is 1.
292291
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider});
293292
}
@@ -312,7 +311,6 @@ TEST(QuantizeLinearContribOpTest, QuantizeLinear_per_tensor_float_uint16) {
312311
32769, 32765,
313312
65535, 0,
314313
65535, 0});
315-
test.SetOutputAbsErr("y", 1.0f);
316314

317315
// Disable Tensorrt EP due to error: unsupported data type
318316
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider});

onnxruntime/test/providers/cpu/tensor/cast_op_test.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -853,9 +853,6 @@ TEST(CastOpTest, Int32ToInt4x2OddNumberOfElements) {
853853
}
854854

855855
TEST(CastOpTest, Int32ToInt4x2EmptyTensor) {
856-
if (DefaultOpenVINOExecutionProvider().get() != nullptr) {
857-
GTEST_SKIP() << "The OpenVINO not support 0 size input";
858-
}
859856
// GIVEN
860857
const std::vector<int64_t> empty_shape{0};
861858
const std::vector<int32_t> empty_input = {};

onnxruntime/test/providers/cpu/tensor/quantize_linear_test.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ TEST(QuantizeLinearOpTest, Uint16) {
448448
32769, 32765,
449449
65535, 0,
450450
65535, 0});
451-
test.SetOutputAbsErr("y", 1.0f);
452451

453452
// Disable Tensorrt EP due to error: unsupported data type
454453
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider});
@@ -478,7 +477,6 @@ TEST(QuantizeLinearOpTest, Int16) {
478477
32767, -32768,
479478
32767, -32768,
480479
32767, -32768});
481-
test.SetOutputAbsErr("y", 1.0f);
482480

483481
// Disable Tensorrt EP due to error: unsupported data type
484482
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider});
@@ -503,7 +501,6 @@ TEST(QuantizeLinearOpTest, Int4) {
503501
test.AddOutput<Int4x2>("y", dims,
504502
{Int4x2(-8, -7), Int4x2(-1, 1), Int4x2(2, 7),
505503
Int4x2(7, unused_val)});
506-
test.SetOutputAbsErr("y", 1.0f);
507504

508505
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider});
509506
}
@@ -571,7 +568,6 @@ TEST(QuantizeLinearOpTest, OddLarge_Int4) {
571568
test.AddInput<float>("scale", {}, {scale}, true);
572569
test.AddInput<Int4x2>("zero_point", {}, {Int4x2(zp, unused_val)}, true);
573570
test.AddOutput<Int4x2>("y", dims, output);
574-
test.SetOutputAbsErr("y", 1.0f);
575571

576572
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider});
577573
}
@@ -598,7 +594,6 @@ TEST(QuantizeLinearOpTest, OddLarge_UInt4) {
598594
test.AddInput<float>("scale", {}, {scale}, true);
599595
test.AddInput<UInt4x2>("zero_point", {}, {UInt4x2(zp, unused_val)}, true);
600596
test.AddOutput<UInt4x2>("y", dims, output);
601-
test.SetOutputAbsErr("y", 1.0f);
602597

603598
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider});
604599
}
@@ -616,7 +611,6 @@ TEST(QuantizeLinearOpTest, Int8_NegativeZeroPoint) {
616611
test.AddInput<float>("y_scale", {}, {.039215686f});
617612
test.AddInput<int8_t>("y_zero_point", {}, {-23});
618613
test.AddOutput<int8_t>("y", dims, {-23, 28, 53, 104, 127, -74, -128, -128});
619-
test.SetOutputAbsErr("y", 1.0f);
620614
// Disable Tensorrt EP due to the error, node1_quantize_scale_node: out of bounds channel axis 1. Number of input dimensions is 1.
621615
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider});
622616
}
@@ -634,7 +628,6 @@ TEST(QuantizeLinearOpTest, Int8_PositiveZeroPoint) {
634628
test.AddInput<float>("y_scale", {}, {.039215686f});
635629
test.AddInput<int8_t>("y_zero_point", {}, {23});
636630
test.AddOutput<int8_t>("y", dims, {23, 74, 99, 127, 127, -28, -104, -128});
637-
test.SetOutputAbsErr("y", 1.0f);
638631
// Disable Tensorrt EP due to error:node1_quantize_scale_node: out of bounds channel axis 1. Number of input dimensions is 1.
639632
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider});
640633
}

onnxruntime/test/providers/cpu/tensor/resize_op_test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ TEST(ResizeOpTest, NhwcResizeOpLinearDownSampleTest_4DBilinear_uint8) {
304304
std::vector<uint8_t> Y = {2, 4};
305305

306306
test.AddOutput<uint8_t>("Y", {N, static_cast<int64_t>(H * scales[1]), static_cast<int64_t>(W * scales[2]), C}, Y);
307-
test.SetOutputAbsErr("Y", 1.0f);
308307
// CUDA: result mismatch due to not implementing NHWC support
309308
test.Run(OpTester::ExpectResult::kExpectSuccess, "",
310309
{kCudaExecutionProvider, kCudaNHWCExecutionProvider});
@@ -642,7 +641,6 @@ TEST(ResizeOpTest, NhwcResizeOpLinearDownSampleTest_4DBilinear_pytorch_half_pixe
642641
std::vector<uint8_t> Y = {1, 7, 12};
643642

644643
test.AddOutput<uint8_t>("Y", {N, sizes[1], sizes[2], C}, Y);
645-
test.SetOutputAbsErr("Y", 1.0f);
646644
// CUDA: result mismatch due to not implementing NHWC support
647645
// DML: results mismatch
648646
test.Run(OpTester::ExpectResult::kExpectSuccess, "",

onnxruntime/test/providers/cpu/tensor/slice_op.test.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,6 @@ TEST(SliceTest, Slice1D_ReverseAllAxes_1) {
540540
GTEST_SKIP() << "Skipping because of the following error: Expected output shape [{4}] did not match run output shape [{0}] for output";
541541
}
542542

543-
if (DefaultOpenVINOExecutionProvider().get() != nullptr) {
544-
GTEST_SKIP() << "Skipping because of the following error: The input ends do not support int max when step is negative.";
545-
}
546-
547543
RunSliceTest<float>({4},
548544
{1.0f, 2.0f, 3.0f, 4.0f},
549545
{-1},

onnxruntime/test/unittest_util/checkers.cc

Lines changed: 6 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -225,27 +225,17 @@ template <>
225225
struct TensorCheck<Int4x2> {
226226
void operator()(const Tensor& expected, const Tensor& actual, const ValidateOutputParams& params,
227227
const std::string& /*provider_type*/) const {
228-
const bool has_abs_err = params.absolute_error.has_value();
229-
Tensor expected_sorted, actual_sorted;
228+
ORT_UNUSED_PARAMETER(params);
230229
const Int4x2* cur_expected;
231230
const Int4x2* cur_actual;
232231
const auto size = narrow<size_t>(actual.Shape().Size());
233232
cur_expected = expected.Data<Int4x2>();
234233
cur_actual = actual.Data<Int4x2>();
235-
double threshold = 0.0f;
236-
if (has_abs_err) {
237-
threshold = *(params.absolute_error);
238-
}
239234

240235
for (size_t i = 0; i < size; ++i) {
241236
size_t r = i >> 1;
242237
size_t c = i & 0x1;
243-
// TODO: the relative error is not used for int4 yet.
244-
if (has_abs_err) {
245-
EXPECT_NEAR(cur_expected[r].GetElem(c), cur_actual[r].GetElem(c), threshold) << "i:" << i;
246-
} else {
247-
EXPECT_EQ(cur_expected[r].GetElem(c), cur_actual[r].GetElem(c)) << "i:" << i;
248-
}
238+
EXPECT_EQ(cur_expected[r].GetElem(c), cur_actual[r].GetElem(c)) << "i:" << i;
249239
}
250240
}
251241
};
@@ -254,28 +244,17 @@ template <>
254244
struct TensorCheck<UInt4x2> {
255245
void operator()(const Tensor& expected, const Tensor& actual, const ValidateOutputParams& params,
256246
const std::string& /*provider_type*/) const {
257-
const bool has_abs_err = params.absolute_error.has_value();
258-
Tensor expected_sorted, actual_sorted;
247+
ORT_UNUSED_PARAMETER(params);
259248
const UInt4x2* cur_expected;
260249
const UInt4x2* cur_actual;
261250
const auto size = narrow<size_t>(actual.Shape().Size());
262251
cur_expected = expected.Data<UInt4x2>();
263252
cur_actual = actual.Data<UInt4x2>();
264253

265-
double threshold = 0.0f;
266-
if (has_abs_err) {
267-
threshold = *(params.absolute_error);
268-
}
269-
270-
for (size_t i = 0; i < static_cast<size_t>(size); ++i) {
254+
for (size_t i = 0; i < size; ++i) {
271255
size_t r = i >> 1;
272256
size_t c = i & 0x1;
273-
// TODO: the relative error is not used for int4 yet.
274-
if (has_abs_err) {
275-
EXPECT_NEAR(cur_expected[r].GetElem(c), cur_actual[r].GetElem(c), threshold) << "i:" << i;
276-
} else {
277-
EXPECT_EQ(cur_expected[r].GetElem(c), cur_actual[r].GetElem(c)) << "i:" << i;
278-
}
257+
EXPECT_EQ(cur_expected[r].GetElem(c), cur_actual[r].GetElem(c)) << "i:" << i;
279258
}
280259
}
281260
};
@@ -313,7 +292,7 @@ struct TensorCheck<uint8_t> {
313292
// For any other EPs, we still expect an exact match for the results
314293
// TODO: Verify if DML can possibly have a ROUNDING_MODE parameter and conform to the other EPs #41968513
315294
if ((provider_type == kNnapiExecutionProvider || provider_type == kDmlExecutionProvider ||
316-
provider_type == kXnnpackExecutionProvider || provider_type == kOpenVINOExecutionProvider) &&
295+
provider_type == kXnnpackExecutionProvider) &&
317296
(has_abs_err || has_rel_err)) {
318297
double threshold = has_abs_err ? *(params.absolute_error)
319298
: 0.0;
@@ -378,49 +357,6 @@ struct TensorCheck<int8_t> {
378357
}
379358
};
380359

381-
template <>
382-
struct TensorCheck<uint16_t> {
383-
void operator()(const Tensor& expected,
384-
const Tensor& actual,
385-
const ValidateOutputParams& params,
386-
const std::string&) const {
387-
const bool has_abs_err = params.absolute_error.has_value();
388-
const bool has_rel_err = params.relative_error.has_value();
389-
390-
Tensor expected_sorted, actual_sorted;
391-
const uint16_t* cur_expected;
392-
const uint16_t* cur_actual;
393-
const auto size = actual.Shape().Size();
394-
if (params.sort_output) {
395-
sort_expected_and_actual_buffers<uint16_t>(expected, expected_sorted, actual, actual_sorted);
396-
cur_expected = expected_sorted.Data<uint16_t>();
397-
cur_actual = actual_sorted.Data<uint16_t>();
398-
} else {
399-
cur_expected = expected.Data<uint16_t>();
400-
cur_actual = actual.Data<uint16_t>();
401-
}
402-
403-
if (has_abs_err || has_rel_err) {
404-
double threshold = has_abs_err ? *(params.absolute_error)
405-
: 0.0;
406-
407-
for (int64_t i = 0; i < size; ++i) {
408-
if (has_rel_err) {
409-
EXPECT_NEAR(cur_expected[i], cur_actual[i],
410-
*(params.relative_error) * cur_expected[i]) // expected[i] is unsigned, can't be negative
411-
<< "i:" << i;
412-
} else { // has_abs_err
413-
EXPECT_NEAR(cur_expected[i], cur_actual[i], threshold) << "i:" << i;
414-
}
415-
}
416-
} else {
417-
for (int64_t i = 0; i < size; ++i) {
418-
EXPECT_EQ(cur_expected[i], cur_actual[i]) << "i:" << i;
419-
}
420-
}
421-
}
422-
};
423-
424360
template <>
425361
struct TensorCheck<double> {
426362
void operator()(const Tensor& expected,

0 commit comments

Comments
 (0)