Skip to content

Commit

Permalink
skip 2 tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
yf711 committed Jul 17, 2024
1 parent dfaf189 commit 21daa6a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions onnxruntime/test/providers/cpu/tensor/isinf_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ constexpr double DOUBLE_NINF = -std::numeric_limits<double>::infinity();
constexpr double DOUBLE_NAN = std::numeric_limits<double>::quiet_NaN();

template <typename T>
void run_is_inf_test(int opset, int64_t detect_positive, int64_t detect_negative, const std::initializer_list<T>& input, const std::initializer_list<bool>& output) {
void run_is_inf_test(int opset, int64_t detect_positive, int64_t detect_negative, const std::initializer_list<T>& input, const std::initializer_list<bool>& output, bool skip_trt = false) {
OpTester test("IsInf", opset);
test.AddAttribute<int64_t>("detect_positive", detect_positive);
test.AddAttribute<int64_t>("detect_negative", detect_negative);
test.AddInput<T>("X", {onnxruntime::narrow<int64_t>(input.size())}, input);
test.AddOutput<bool>("Y", {onnxruntime::narrow<int64_t>(output.size())}, output);
test.Run();
if (skip_trt) {
test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kTensorrtExecutionProvider});
} else {
test.Run();
}
}

TEST(IsInfTest, test_isinf_float10) {
Expand Down Expand Up @@ -124,7 +128,7 @@ TEST(IsInfTest, test_isinf_bfloat16) {
std::initializer_list<BFloat16> input = {BFloat16{-1.7f}, BFloat16::NaN, BFloat16::Infinity, 3.6_bfp16,
BFloat16::NegativeInfinity, BFloat16::Infinity};
std::initializer_list<bool> output = {false, false, true, false, true, true};
run_is_inf_test(20, 1, 1, input, output);
run_is_inf_test(20, 1, 1, input, output, true); // Skip as TRT10 supports BF16 but T4 GPU run on TRT CIs doesn't
}

TEST(IsInfTest, test_isinf_positive_bfloat16) {
Expand All @@ -146,7 +150,7 @@ TEST(IsInfTest, test_Float8E4M3FN) {
std::initializer_list<Float8E4M3FN> input = {
Float8E4M3FN(-1.0f), Float8E4M3FN(FLOAT_NAN, false), Float8E4M3FN(1.0f), Float8E4M3FN(FLOAT_NINF, false), Float8E4M3FN(FLOAT_NINF, false), Float8E4M3FN(FLOAT_INF, false)};
std::initializer_list<bool> output = {false, false, false, false, false, false};
run_is_inf_test(20, 1, 1, input, output);
run_is_inf_test(20, 1, 1, input, output, true); // Skip as TRT10.1 supports Float8 but T4 GPU run on TRT CIs doesn't
}

TEST(IsInfTest, test_Float8E4M3FNUZ) {
Expand Down

0 comments on commit 21daa6a

Please sign in to comment.